diff options
author | dizzy <diosmosis@users.noreply.github.com> | 2022-10-10 15:55:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-10 15:55:38 +0300 |
commit | ff812d1faeab4d7f712289b53883b14a4e6910cb (patch) | |
tree | 4df007d5f4b79c07de9644445635ca04f4a3ffa5 /plugins | |
parent | 3611b1fc8c890dc2428eecf896180a2547e15466 (diff) |
[Vue] remove angularjs from CoreHome and CorePluginsAdmin (#19496)
* get propagation of property to child vue-entry components to work, if strangely
* add missing translations
* remove import added by phpstorm
* try to fix timing error in test
* try removing prefix/suffix entirely from vue entry properties
* fix issues from UI tests
* remove leading hash characters from hash value
* do not attempt to print if puppeteer context is destroyed
* update screenshot
* do not abort ajax requests when loading the sidebar
* revert back to suffixing an underscore
* avoid random failure
* built vue files
* add missing vue-entry property + add missing translations
* fixing UI tests locally
* update screenshots
* update CustomAlerts submodule
* add missing translations
* fix spacing
* couple fixes
* more ui test fixes
* make sure installation umd is loaded during installation (as well as translations)
* couple small UI test fixes
* Fix component name case.
* built vue files
* do not use html_attr to escape and in UI tests replace path with escaped slashes so json data gets replaced
* move UploadPluginDialog to CorePluginsAdmin so it will be available when internet access is not available and the Marketplace plugin is deactivated
* correct typing for feedback question input
* update screenshots
* revert last tweak
* styling tweak
* update screenshots and styling tweak
* fix attribute
* Allow composer plugins for dev dependency codesniffer to fix travis builds.
* keep dependent class and rename
* styling tweaks
* update expected screenshot
* update screenshots
* comma spacing tweak
* update screenshots + fix v-show condition
* some small fixes
* fix styling and formatting issues
* fix spacing issue
* fix property name
* update expected screenshots
* get to load in UI
* getting dashboard settings control to work
* styling tweaks
* fix html attribute output for singlemetricview
* fix vue-entry elements
* update expected screenshot
* fixing UI test issues, reintroduce compileAngularComponents (will remove calls in CoreHome PR)
* move function to correct class
* fix order of array elements
* fixing some more issues
* hide the dashboard manager on initial display as before
* styling fixes
* fix styles for widgetized glossary
* update expected screenshots
* fixing DashboardManager UI test that previously used the uiControlObject property
* update device detection demo to be accurate
* update expected screenshots
* fix race condition in dashboard ajax requests/aborts
* start removing angularjs from CoreHome
* remove more angularjs code
* remove angularjs from CustomDimensions plugin
* removing some angularjs files
* remove use of history service, the use of $location from MatomoUrl and the piwikApi service
* remove angularjs service module and filters
* removing more angularjs references
* remove more angular related code, including getAngularDependency()
* update submodules to vue-remove-angularjs branches
* try replacing angularjs expression parsing w/ mathjs/number
* logical operator fixes
* only import what is needed for math.js
* remove some functionality
* optimize math.js use
* convert zen mode code, add --bail option and some output to vue:build
* remove ng-app directive in twig layouts
* ajaxhelper.adapter.ts still required for vanilla ajaxHelper() object
* remove ng-cloak use
* fix datatableactions.vue errors
* do not propagate id param in vue-entry uses
* remove pointless defer
* get zen mode to work, fix couple issues in headermessage vue-entry usage
* move more data table action icon code to vue component from dataTable.js + fix use of angular in ui test JS override code
* couple more data table actions fixes
* UI test fixes + ng-non-bindable no longer needed
* fix more test issues + update some screenshots
* remove another use of isAngularRenderingThePage
* revert screenshot change
* fixing more issues
* move inline script to vue directive + fix a couple vue warnings
* built vue files
* remove inline script in system check widget
* fix some more datatableactions issues
* use VueEntryContainer in _singleWidget.twig
* remove unused inline script from _donate.twig
* update expected screenshots
* fix hide flat icon code
* updating screenshots and try to fix random failure
* fix numeric conversion
* update expected screenshots
* update screenshots
* use common method to load umd file
* get languages dropdown to work
* only add menu translations if installed
* make sure datatableactions vue entry is completely rendered before initing datatable
* correct enriched-headline selector
* update VisitorGenerator submodule
* do not load menu translations during updater as well
* update expected screenshots
* update screenshot
* update submodule
* update expected screenshot
* update submodule
* remove duplicate translations
* built vue files
* Fix various stuff that came in again through merge
* fix submodule ref
* built vue files
* remove unexpected else in twig template
* fix menu translation check
* readd ajaxhelper
* update some screenshots and fix a merge error
* fix another merge error
* update screenshots and remove ng-cloak from tagmanager page
* fix omnifixture sql
* tests/UI/expected-screenshots/UIIntegrationTest_api_listing.png
* add description column to tagmanager tables missing it in omnifixture dump
* update expected screenshots
* add delta to assert
* update submodule
* update LoginLdap submodule
* update expected screenshot
* update submodule
* reflect reversion made in 4.x-dev for this file
* remove reference to removed file in unit test
* update expected URLs in test
Co-authored-by: sgiehl <stefan@matomo.org>
Co-authored-by: sgiehl <sgiehl@users.noreply.github.com>
Diffstat (limited to 'plugins')
194 files changed, 6240 insertions, 11928 deletions
diff --git a/plugins/Actions/javascripts/actionsDataTable.js b/plugins/Actions/javascripts/actionsDataTable.js index 9d6461f683..8426e69409 100644 --- a/plugins/Actions/javascripts/actionsDataTable.js +++ b/plugins/Actions/javascripts/actionsDataTable.js @@ -283,7 +283,7 @@ content.trigger('piwik:dataTableLoaded'); - piwikHelper.compileAngularComponents(content); + piwikHelper.compileVueEntryComponents(content); piwikHelper.lazyScrollTo(content[0], 400); diff --git a/plugins/Actions/tests/UI/expected-screenshots/ActionsDataTable_search.png b/plugins/Actions/tests/UI/expected-screenshots/ActionsDataTable_search.png index e948285060..21f324d9f4 100644 --- a/plugins/Actions/tests/UI/expected-screenshots/ActionsDataTable_search.png +++ b/plugins/Actions/tests/UI/expected-screenshots/ActionsDataTable_search.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a366407551ebd68b55c7558ef3f90c9b675053d4ee5ff7e41ad95fde811536f3 -size 72689 +oid sha256:794bc933c941c6d352572ec5aa6759ca99c19cbba38dbf823e9f2055e7d3f0a0 +size 72692 diff --git a/plugins/AnonymousPiwikUsageMeasurement b/plugins/AnonymousPiwikUsageMeasurement -Subproject f60a1ff8fd01637f2d3bd0ea326c9e4038ec00f +Subproject 4d9e4a523fd241ffa27ebe52b0b33c825afdce7 diff --git a/plugins/CoreAdminHome/CoreAdminHome.php b/plugins/CoreAdminHome/CoreAdminHome.php index a80ca1f6a9..e64746eaaf 100644 --- a/plugins/CoreAdminHome/CoreAdminHome.php +++ b/plugins/CoreAdminHome/CoreAdminHome.php @@ -120,7 +120,6 @@ class CoreAdminHome extends \Piwik\Plugin $translationKeys[] = 'CoreAdminHome_ArchivingSettings'; $translationKeys[] = 'General_AllowPiwikArchivingToTriggerBrowser'; $translationKeys[] = 'General_ReportsContainingTodayWillBeProcessedAtMostEvery'; - $translationKeys[] = 'General_SmallTrafficYouCanLeaveDefault'; $translationKeys[] = 'General_ArchivingTriggerDescription'; $translationKeys[] = 'General_ArchivingTriggerSegment'; $translationKeys[] = 'General_SeeTheOfficialDocumentationForMoreInformation'; @@ -196,7 +195,6 @@ class CoreAdminHome extends \Piwik\Plugin $translationKeys[] = 'CoreAdminHome_JSTracking_CampaignKwdParam'; $translationKeys[] = 'SitesManager_EmailInstructionsSubject'; $translationKeys[] = 'SitesManager_JsTrackingTagHelp'; - $translationKeys[] = 'CoreAdminHome_JSTracking_CodeNoteBeforeClosingHeadEmail'; $translationKeys[] = 'CoreAdminHome_JSTrackingIntro3a'; $translationKeys[] = 'CoreAdminHome_JSTrackingIntro4'; $translationKeys[] = 'CoreAdminHome_JSTrackingIntro5'; diff --git a/plugins/CoreAdminHome/Menu.php b/plugins/CoreAdminHome/Menu.php index 36ef25914d..56733632ce 100644 --- a/plugins/CoreAdminHome/Menu.php +++ b/plugins/CoreAdminHome/Menu.php @@ -63,7 +63,7 @@ class Menu extends \Piwik\Plugin\Menu $icon = ($newChangesStatus === ChangesModel::NEW_CHANGES_EXIST ? 'icon-notifications_on' : 'icon-reporting-actions'); $menu->registerMenuIcon('CoreAdminHome_WhatIsNew', $icon); - $menu->addItem('CoreAdminHome_WhatIsNew', null, null, 990, + $menu->addItem('CoreAdminHome_WhatIsNew', null, 'javascript:', 990, Piwik::translate('CoreAdminHome_WhatIsNewTooltip'), $icon, "Piwik_Popover.createPopupAndLoadUrl('module=CoreAdminHome&action=whatIsNew', '". addslashes(Piwik::translate('CoreAdminHome_WhatIsNewTooltip'))."','what-is-new-popup')"); diff --git a/plugins/CoreHome/Controller.php b/plugins/CoreHome/Controller.php index cffeb62b7c..6e40d62dce 100644 --- a/plugins/CoreHome/Controller.php +++ b/plugins/CoreHome/Controller.php @@ -94,15 +94,13 @@ class Controller extends \Piwik\Plugin\Controller if ($config->getName() && Common::getRequestVar('showtitle', '', 'string') === '1') { if (strpos($content, '<h2') !== false || strpos($content, ' content-title=') !== false - || strpos($content, ' piwik-enriched-headline') !== false || strpos($content, 'CoreHome.EnrichedHeadline') !== false || strpos($content, '<h1') !== false ) { // already includes title return $content; } - if (strpos($content, 'piwik-content-block') === false - && strpos($content, '<!-- has-content-block -->') === false + if (strpos($content, '<!-- has-content-block -->') === false && strpos($content, 'class="card"') === false && strpos($content, "class='card'") === false && strpos($content, 'class="card-content"') === false diff --git a/plugins/CoreHome/CoreHome.php b/plugins/CoreHome/CoreHome.php index 3747500fdd..f5df865b4a 100644 --- a/plugins/CoreHome/CoreHome.php +++ b/plugins/CoreHome/CoreHome.php @@ -16,10 +16,12 @@ use Piwik\Container\StaticContainer; use Piwik\DbHelper; use Piwik\Development; use Piwik\IP; +use Piwik\Menu\MenuAdmin; use Piwik\Piwik; use Piwik\Plugin\ArchivedMetric; use Piwik\Plugin\ComputedMetric; use Piwik\Plugin\ThemeStyles; +use Piwik\SettingsPiwik; use Piwik\SettingsServer; use Piwik\Tracker\Model as TrackerModel; @@ -190,44 +192,11 @@ class CoreHome extends \Piwik\Plugin $jsFiles[] = "plugins/CoreHome/javascripts/color_manager.js"; $jsFiles[] = "plugins/CoreHome/javascripts/notification.js"; $jsFiles[] = "plugins/CoreHome/javascripts/numberFormatter.js"; - $jsFiles[] = "plugins/CoreHome/javascripts/zen-mode.js"; $jsFiles[] = "plugins/CoreHome/javascripts/noreferrer.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/piwikApp.config.js"; - - $jsFiles[] = "plugins/CoreHome/angularjs/common/services/service.module.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/common/services/piwik-api.js"; - - $jsFiles[] = "plugins/CoreHome/angularjs/common/filters/filter.module.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/common/filters/translate.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/common/filters/startfrom.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/common/filters/evolution.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/common/filters/length.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/common/filters/trim.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/common/filters/pretty-url.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/common/filters/escape.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/common/filters/htmldecode.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/common/filters/urldecode.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/common/filters/ucfirst.js"; - - $jsFiles[] = "plugins/CoreHome/angularjs/common/directives/directive.module.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/common/directives/attributes.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/common/directives/field-condition.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/common/directives/autocomplete-matched.js"; - $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/string-to-number.js"; - - $jsFiles[] = "plugins/CoreHome/angularjs/piwikApp.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/anchorLinkFix.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/http404check.js"; - - $jsFiles[] = "plugins/CoreHome/angularjs/history/history.service.js"; - // we have to load these CorePluginsAdmin files here. If we loaded them in CorePluginsAdmin, // there would be JS errors as CorePluginsAdmin is loaded first. Meaning it is loaded before - // any angular JS file is loaded etc. + // any Vue UMD file is loaded etc. $jsFiles[] = "node_modules/iframe-resizer/js/iframeResizer.min.js"; $jsFiles[] = "node_modules/iframe-resizer/js/iframeResizer.contentWindow.min.js"; } @@ -412,5 +381,32 @@ class CoreHome extends \Piwik\Plugin $translationKeys[] = 'CoreHome_StartDate'; $translationKeys[] = 'CoreHome_EndDate'; $translationKeys[] = 'CoreHome_DataForThisReportHasBeenDisabled'; + $translationKeys[] = 'CoreHome_ChangeVisualization'; + $translationKeys[] = 'General_ExportThisReport'; + $translationKeys[] = 'Annotations_Annotations'; + $translationKeys[] = 'CoreHome_CloseSearch'; + $translationKeys[] = 'CoreHome_DataTableHowToSearch'; + $translationKeys[] = 'CoreHome_ChangePeriod'; + $translationKeys[] = 'General_NewUpdatePiwikX'; + $translationKeys[] = 'CoreHome_SeeAvailableVersions'; + $translationKeys[] = 'CoreHome_OneClickUpdateNotPossibleAsMultiServerEnvironment'; + $translationKeys[] = 'General_PiwikXIsAvailablePleaseUpdateNow'; + $translationKeys[] = 'General_PiwikXIsAvailablePleaseNotifyPiwikAdmin'; + $translationKeys[] = 'General_YouAreCurrentlyUsing'; + + // add admin menu translations + if (SettingsPiwik::isMatomoInstalled() + && Common::getRequestVar('module', '') != 'CoreUpdater' + ) { + $menu = MenuAdmin::getInstance()->getMenu(); + foreach ($menu as $level1 => $level2) { + $translationKeys[] = $level1; + foreach ($level2 as $name => $params) { + if (strpos($name, '_') !== false) { + $translationKeys[] = $name; + } + } + } + } } } diff --git a/plugins/CoreHome/angularjs/anchorLinkFix.js b/plugins/CoreHome/angularjs/anchorLinkFix.js deleted file mode 100644 index 677eb31242..0000000000 --- a/plugins/CoreHome/angularjs/anchorLinkFix.js +++ /dev/null @@ -1,123 +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 - */ - -/** - * See https://github.com/piwik/piwik/issues/4795 "linking to #hash tag does not work after merging AngularJS" - */ -(function () { - - function scrollToAnchorNode($node) - { - $.scrollTo($node, 20); - } - - function preventDefaultIfEventExists(event) - { - if (event) { - event.preventDefault(); - } - } - - function scrollToAnchorIfPossible(hash, event) - { - if (!hash) { - return; - } - - if (-1 !== hash.indexOf('&')) { - return; - } - - try { - var $node = $('#' + hash); - } catch (err) { - // on jquery syntax error, ignore so nothing is logged to the console - return; - } - - if ($node && $node.length) { - scrollToAnchorNode($node); - preventDefaultIfEventExists(event); - return; - } - - $node = $('a[name='+ hash + ']'); - - if ($node && $node.length) { - scrollToAnchorNode($node); - preventDefaultIfEventExists(event); - } - } - - function isLinkWithinSamePage(location, newUrl) - { - if (location && location.origin && -1 === newUrl.indexOf(location.origin)) { - // link to different domain - return false; - } - - if (location && location.pathname && -1 === newUrl.indexOf(location.pathname)) { - // link to different path - return false; - } - - if (location && location.search && -1 === newUrl.indexOf(location.search)) { - // link with different search - return false; - } - - return true; - } - - function handleScrollToAnchorIfPresentOnPageLoad() - { - if (location.hash.slice(0, 2) == '#/') { - var hash = location.hash.slice(2); - scrollToAnchorIfPossible(hash, null); - } - } - - function handleScrollToAnchorAfterPageLoad() - { - angular.module('piwikApp').run(['$rootScope', function ($rootScope) { - - $rootScope.$on('$locationChangeStart', onLocationChangeStart); - - function onLocationChangeStart (event, newUrl, oldUrl, $location) { - - if (!newUrl) { - return; - } - - var hashPos = newUrl.indexOf('#/'); - if (-1 === hashPos) { - return; - } - - if (!isLinkWithinSamePage(this.location, newUrl)) { - return; - } - - var hash = newUrl.slice(hashPos + 2); - - scrollToAnchorIfPossible(hash, event); - } - }]); - } - - handleScrollToAnchorAfterPageLoad(); - $(handleScrollToAnchorIfPresentOnPageLoad); - - window.anchorLinkFix = { - scrollToAnchorInUrl: function () { - // may be called when page is only fully loaded after some additional requests - // timeout needed to ensure angular rendered fully - var $timeout = piwikHelper.getAngularDependency('$timeout'); - $timeout(handleScrollToAnchorIfPresentOnPageLoad); - } - }; -})(); diff --git a/plugins/CoreHome/angularjs/common/directives/attributes.js b/plugins/CoreHome/angularjs/common/directives/attributes.js deleted file mode 100644 index 7f4a30b60d..0000000000 --- a/plugins/CoreHome/angularjs/common/directives/attributes.js +++ /dev/null @@ -1,66 +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 - */ - -/** - * If the given text or resolved expression matches any text within the element, the matching text will be wrapped - * with a class. - * - * Example: - * <div piwik-autocomplete-matched="'text'">My text</div> ==> <div>My <span class="autocompleteMatched">text</span></div> - * - * <div piwik-autocomplete-matched="searchTerm">{{ name }}</div> - * <input type="text" ng-model="searchTerm"> - */ -(function () { - angular.module('piwikApp.directive').directive('piwikAttributes', piwikAttributes); - - piwikAttributes.$inject = ['$sanitize']; - - /** - * @deprecated - */ - function piwikAttributes(piwik, $sanitize) { - - return { - link: function (scope, element, attrs) { - if (!attrs.piwikAttributes || !angular.isString(attrs.piwikAttributes)) { - return; - } - - function applyAttributes(attributes) - { - if (angular.isObject(attributes)) { - angular.forEach(attributes, function (value, key) { - if (angular.isObject(value)) { - value = JSON.stringify(value); - } - - // replace line breaks in placeholder with big amount of spaces for safari, - // as line breaks are not support there - if (key === 'placeholder' && /^((?!chrome|android).)*safari/i.test(navigator.userAgent)) { - value = value.replace(/(?:\r\n|\r|\n)/g, (new Array(200)).join(' ')); - } - - if (key === 'disabled') { - element.prop(key, value); - } else { - element.attr(key, value); - } - }); - } - } - - applyAttributes(JSON.parse(attrs.piwikAttributes)); - - attrs.$observe('piwikAttributes', function (newVal) { - applyAttributes(JSON.parse(newVal)); - }); - - } - }; - } -})(); diff --git a/plugins/CoreHome/angularjs/common/directives/autocomplete-matched.js b/plugins/CoreHome/angularjs/common/directives/autocomplete-matched.js deleted file mode 100644 index 995950ef2d..0000000000 --- a/plugins/CoreHome/angularjs/common/directives/autocomplete-matched.js +++ /dev/null @@ -1,58 +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 - */ - -/** - * If the given text or resolved expression matches any text within the element, the matching text will be wrapped - * with a class. - * - * Example: - * <div piwik-autocomplete-matched="'text'">My text</div> ==> <div>My <span class="autocompleteMatched">text</span></div> - * - * <div piwik-autocomplete-matched="searchTerm">{{ name }}</div> - * <input type="text" ng-model="searchTerm"> - * - * @deprecated - */ -(function () { - angular.module('piwikApp.directive').directive('piwikAutocompleteMatched', piwikAutocompleteMatched); - - piwikAutocompleteMatched.$inject = ['piwik', '$sanitize']; - - /** - * @deprecated - */ - function piwikAutocompleteMatched(piwik, $sanitize) { - - return { - priority: 10, // makes sure to render after other directives, otherwise the content might be overwritten again see https://github.com/piwik/piwik/pull/8467 - link: function (scope, element, attrs) { - var searchTerm; - - scope.$watch(attrs.piwikAutocompleteMatched, function (value) { - searchTerm = value; - updateText(); - }); - - function updateText() { - if (!searchTerm || !element) { - return; - } - - var content = piwik.helper.htmlEntities(element.text()); - var startTerm = content.toLowerCase().indexOf(searchTerm.toLowerCase()); - - if (-1 !== startTerm) { - var word = content.slice(startTerm, startTerm + searchTerm.length); - var escapedword = $sanitize(piwik.helper.htmlEntities(word)); - content = content.replace(word, '<span class="autocompleteMatched">' + escapedword + '</span>'); - element.html(content); - } - } - } - }; - } -})(); diff --git a/plugins/CoreHome/angularjs/common/directives/directive.module.js b/plugins/CoreHome/angularjs/common/directives/directive.module.js deleted file mode 100644 index ae91d039b6..0000000000 --- a/plugins/CoreHome/angularjs/common/directives/directive.module.js +++ /dev/null @@ -1,9 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -(function () { - angular.module('piwikApp.directive', []); -})(); diff --git a/plugins/CoreHome/angularjs/common/directives/field-condition.js b/plugins/CoreHome/angularjs/common/directives/field-condition.js deleted file mode 100644 index 5c4c33ff8e..0000000000 --- a/plugins/CoreHome/angularjs/common/directives/field-condition.js +++ /dev/null @@ -1,92 +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: - * <div piwik-form-condition> - */ -(function () { - angular.module('piwikApp.directive').directive('fieldCondition', piwikFieldCondition); - - piwikFieldCondition.$inject = ['piwik', '$timeout']; - - /** - * Unused. - * @deprecated - */ - function piwikFieldCondition(piwik, $timeout){ - - function evaluate(scope, condition, element) - { - if (scope.$eval(condition, scope.allValues)) { - element.show(); - } else { - element.hide(); - } - } - - function getValueFromElement(element) - { - if (element.attr('type') === 'checkbox') { - return element.is(':checked'); - } else if (element.attr('type') === 'radio') { - return $('.form-group [name=' + element.attr('name') + ']:checked').val(); - } else if (element.prop('tagName').toLowerCase() === 'select') { - var name = element.val(); - if (name.indexOf('string:') === 0) { - return name.slice('string:'.length); - } - - return name; - } - - return element.val(); - } - - function evaluateConditionalExpression(scope, condition, element) - { - var fieldParts = condition.replace('!', ''); - fieldParts = fieldParts.split(' '); - var fieldNames = []; - fieldParts.forEach(function (name) { - name = $.trim(name); - if (name && name.length > 3) { - fieldNames.push(name); - } - }); - - scope.allValues = {}; - angular.forEach(fieldNames, function (name) { - var actualField = $('.form-group [name=' + name + ']').first(); - if (actualField.length) { - scope.allValues[name] = getValueFromElement(actualField); - actualField.on('change', function () { - scope.allValues[name] = getValueFromElement($(this)); - evaluate(scope, condition, element); - }); - } - }); - - evaluate(scope, condition, element); - } - - - return { - priority: 10, // makes sure to render after other directives, otherwise the content might be overwritten again see https://github.com/piwik/piwik/pull/8467 - restrict: 'A', - link: function(scope, element, attrs) { - - var condition = attrs.fieldCondition; - if (condition) { - $timeout(function (){ - evaluateConditionalExpression(scope, condition, element); - }); - } - }, - }; - } -})(); diff --git a/plugins/CoreHome/angularjs/common/directives/ignore-click.js b/plugins/CoreHome/angularjs/common/directives/ignore-click.js deleted file mode 100644 index 3bb8d724cb..0000000000 --- a/plugins/CoreHome/angularjs/common/directives/ignore-click.js +++ /dev/null @@ -1,28 +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 - */ - -/** - * Prevents the default behavior of the click. For instance useful if a link should only work in case the user - * does a "right click open in new window". - * - * Example - * <a piwik-ignore-click ng-click="doSomething()" href="/">my link</a> - */ -(function () { - angular.module('piwikApp.directive').directive('piwikIgnoreClick', piwikIgnoreClick); - - /** - * @deprecated - */ - function piwikIgnoreClick() { - return function(scope, element, attrs) { - $(element).click(function(event) { - event.preventDefault(); - }); - }; - } -})(); diff --git a/plugins/CoreHome/angularjs/common/directives/onenter.js b/plugins/CoreHome/angularjs/common/directives/onenter.js deleted file mode 100644 index c0b7ed4d51..0000000000 --- a/plugins/CoreHome/angularjs/common/directives/onenter.js +++ /dev/null @@ -1,34 +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 - */ - -/** - * Allows you to define any expression to be executed in case the user presses enter - * - * Example - * <div piwik-onenter="save()"> - * <div piwik-onenter="showList=false"> - */ -(function () { - angular.module('piwikApp.directive').directive('piwikOnenter', piwikOnenter); - - /** - * @deprecated - */ - function piwikOnenter() { - return function(scope, element, attrs) { - element.bind("keydown keypress", function(event) { - if(event.which === 13) { - scope.$apply(function(){ - scope.$eval(attrs.piwikOnenter, {'event': event}); - }); - - event.preventDefault(); - } - }); - }; - } -})(); diff --git a/plugins/CoreHome/angularjs/common/directives/string-to-number.js b/plugins/CoreHome/angularjs/common/directives/string-to-number.js deleted file mode 100644 index 328a2bc5fa..0000000000 --- a/plugins/CoreHome/angularjs/common/directives/string-to-number.js +++ /dev/null @@ -1,28 +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 - */ - -/** - * Converts ngModel value to a number - * - * Example: - * <input type="number" string-to-number>...</div> - */ -(function () { - angular.module('piwikApp.directive').directive('stringToNumber', function() { - return { - require: 'ngModel', - link: function(scope, element, attrs, ngModel) { - ngModel.$parsers.push(function(value) { - return '' + value; - }); - ngModel.$formatters.push(function(value) { - return parseFloat(value); - }); - } - }; - }); -})(); diff --git a/plugins/CoreHome/angularjs/common/directives/translate.js b/plugins/CoreHome/angularjs/common/directives/translate.js deleted file mode 100644 index badb9208a9..0000000000 --- a/plugins/CoreHome/angularjs/common/directives/translate.js +++ /dev/null @@ -1,39 +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 - */ - -/** - * Directive for easy & safe complex internationalization. This directive allows - * users to embed the sprintf arguments used in internationalization inside an HTML - * element. Since the HTML will eventually be sanitized by AngularJS, HTML can be used - * within the sprintf args. Using the filter, this is not possible w/o manually sanitizing - * and creating trusted HTML, which is not as safe. - * - * Note: nesting this directive is not supported. - * - * Usage: - * <span piwik-translate="Plugin_TranslationToken"> - * first arg::<strong>second arg</strong>::{{ unsafeDataThatWillBeSanitized }} - * </span> - */ -(function () { - angular.module('piwikApp.directive').directive('piwikTranslate', piwikTranslate); - - /** - * @deprecated - */ - function piwikTranslate() { - return { - priority: 1, - restrict: 'A', - compile: function(element, attrs) { - var parts = element.html().split('::'), - translated = _pk_translate(attrs.piwikTranslate, parts); - element.html(translated); - } - }; - } -})(); diff --git a/plugins/CoreHome/angularjs/common/filters/escape.js b/plugins/CoreHome/angularjs/common/filters/escape.js deleted file mode 100644 index 54fb5a5cde..0000000000 --- a/plugins/CoreHome/angularjs/common/filters/escape.js +++ /dev/null @@ -1,16 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -(function () { - angular.module('piwikApp.filter').filter('escape', escape); - - function escape() { - - return function(value) { - return piwikHelper.escape(piwikHelper.htmlEntities(value)); - }; - } -})();
\ No newline at end of file diff --git a/plugins/CoreHome/angularjs/common/filters/evolution.js b/plugins/CoreHome/angularjs/common/filters/evolution.js deleted file mode 100644 index 14adb00db1..0000000000 --- a/plugins/CoreHome/angularjs/common/filters/evolution.js +++ /dev/null @@ -1,15 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -(function () { - angular.module('piwikApp.filter').filter('evolution', evolutionFilter); - - function evolutionFilter() { - return function(currentValue, pastValue) { - return window.CoreHome.getFormattedEvolution(currentValue, pastValue); - }; - } -})(); diff --git a/plugins/CoreHome/angularjs/common/filters/filter.module.js b/plugins/CoreHome/angularjs/common/filters/filter.module.js deleted file mode 100644 index 8d7c672046..0000000000 --- a/plugins/CoreHome/angularjs/common/filters/filter.module.js +++ /dev/null @@ -1,9 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -(function () { - angular.module('piwikApp.filter', []); -})(); diff --git a/plugins/CoreHome/angularjs/common/filters/htmldecode.js b/plugins/CoreHome/angularjs/common/filters/htmldecode.js deleted file mode 100644 index a4162ac4f0..0000000000 --- a/plugins/CoreHome/angularjs/common/filters/htmldecode.js +++ /dev/null @@ -1,26 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -(function () { - angular.module('piwikApp.filter').filter('htmldecode', htmldecode); - - htmldecode.$inject = ['piwik']; - - /** - * Be aware that this filter can cause XSS so only use it when you're sure it is safe. - * Eg it should be safe when it is afterwards escaped by angular sanitize again. - */ - function htmldecode(piwik) { - - return function(text) { - if (text && text.length) { - return piwik.helper.htmlDecode(text); - } - - return text; - }; - } -})(); diff --git a/plugins/CoreHome/angularjs/common/filters/length.js b/plugins/CoreHome/angularjs/common/filters/length.js deleted file mode 100644 index a1393daa07..0000000000 --- a/plugins/CoreHome/angularjs/common/filters/length.js +++ /dev/null @@ -1,21 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -(function () { - angular.module('piwikApp.filter').filter('length', length); - - function length() { - - return function(stringOrArray) { - if (stringOrArray && stringOrArray.length) { - return stringOrArray.length; - } - - return 0; - }; - } - -})();
\ No newline at end of file diff --git a/plugins/CoreHome/angularjs/common/filters/pretty-url.js b/plugins/CoreHome/angularjs/common/filters/pretty-url.js deleted file mode 100644 index 5cba930825..0000000000 --- a/plugins/CoreHome/angularjs/common/filters/pretty-url.js +++ /dev/null @@ -1,16 +0,0 @@ -/*! - * Piwik - Web Analytics - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -(function () { - angular.module('piwikApp.filter').filter('prettyUrl', prettyUrl); - - function prettyUrl() { - return function(input) { - return input.trim().replace('http://', ''); - }; - } - -})();
\ No newline at end of file diff --git a/plugins/CoreHome/angularjs/common/filters/startfrom.js b/plugins/CoreHome/angularjs/common/filters/startfrom.js deleted file mode 100644 index f931677ca0..0000000000 --- a/plugins/CoreHome/angularjs/common/filters/startfrom.js +++ /dev/null @@ -1,16 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -(function () { - angular.module('piwikApp.filter').filter('startFrom', startFrom); - - function startFrom() { - return function(input, start) { - start = +start; //parse to int - return input.slice(start); - }; - } -})();
\ No newline at end of file diff --git a/plugins/CoreHome/angularjs/common/filters/startfrom.spec.js b/plugins/CoreHome/angularjs/common/filters/startfrom.spec.js deleted file mode 100644 index 75cd48b3d9..0000000000 --- a/plugins/CoreHome/angularjs/common/filters/startfrom.spec.js +++ /dev/null @@ -1,41 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -(function () { - describe('startFromFilter', function() { - var startFrom; - - beforeEach(module('piwikApp.filter')); - beforeEach(inject(function($injector) { - var $filter = $injector.get('$filter'); - startFrom = $filter('startFrom'); - })); - - describe('#startFrom()', function() { - - it('should return all entries if index is zero', function() { - - var result = startFrom([1,2,3], 0); - - expect(result).to.eql([1,2,3]); - }); - - it('should return only partial entries if filter is higher than zero', function() { - - var result = startFrom([1,2,3], 2); - - expect(result).to.eql([3]); - }); - - it('should return no entries if start is higher than input length', function() { - - var result = startFrom([1,2,3], 11); - - expect(result).to.eql([]); - }); - }); - }); -})();
\ No newline at end of file diff --git a/plugins/CoreHome/angularjs/common/filters/translate.js b/plugins/CoreHome/angularjs/common/filters/translate.js deleted file mode 100644 index 82bae3811f..0000000000 --- a/plugins/CoreHome/angularjs/common/filters/translate.js +++ /dev/null @@ -1,22 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -(function () { - angular.module('piwikApp.filter').filter('translate', translate); - - function translate() { - - return function(key, value1, value2, value3) { - var values = []; - if (arguments && arguments.length > 1) { - for (var index = 1; index < arguments.length; index++) { - values.push(arguments[index]); - } - } - return _pk_translate(key, values); - }; - } -})();
\ No newline at end of file diff --git a/plugins/CoreHome/angularjs/common/filters/trim.js b/plugins/CoreHome/angularjs/common/filters/trim.js deleted file mode 100644 index f711908772..0000000000 --- a/plugins/CoreHome/angularjs/common/filters/trim.js +++ /dev/null @@ -1,20 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -(function () { - angular.module('piwikApp.filter').filter('trim', trim); - - function trim() { - - return function(string) { - if (string) { - return $.trim('' + string); - } - - return string; - }; - } -})(); diff --git a/plugins/CoreHome/angularjs/common/filters/ucfirst.js b/plugins/CoreHome/angularjs/common/filters/ucfirst.js deleted file mode 100644 index 0af633e51e..0000000000 --- a/plugins/CoreHome/angularjs/common/filters/ucfirst.js +++ /dev/null @@ -1,21 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -(function () { - angular.module('piwikApp.filter').filter('ucfirst', ucfirst); - - function ucfirst() { - - return function(value) { - if (!value) { - return value; - } - - var firstLetter = (value + '').charAt(0).toUpperCase(); - return firstLetter + value.slice(1); - }; - } -})(); diff --git a/plugins/CoreHome/angularjs/common/filters/urldecode.js b/plugins/CoreHome/angularjs/common/filters/urldecode.js deleted file mode 100644 index e8dedd7c09..0000000000 --- a/plugins/CoreHome/angularjs/common/filters/urldecode.js +++ /dev/null @@ -1,22 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -(function () { - angular.module('piwikApp.filter').filter('urldecode', urldecode); - - urldecode.$inject = []; - - function urldecode() { - - return function(text) { - if (text && text.length) { - return decodeURIComponent(text); - } - - return text; - }; - } -})(); diff --git a/plugins/CoreHome/angularjs/common/services/piwik-api.js b/plugins/CoreHome/angularjs/common/services/piwik-api.js deleted file mode 100644 index 8436ea5900..0000000000 --- a/plugins/CoreHome/angularjs/common/services/piwik-api.js +++ /dev/null @@ -1,351 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -(function () { - angular.module('piwikApp.service').factory('piwikApi', piwikApiService); - - piwikApiService.$inject = ['$http', '$q', '$rootScope', 'piwik', '$window', 'piwikUrl']; - - /** - * @deprecated use AjaxHelper's promise API instead - */ - function piwikApiService ($http, $q, $rootScope, piwik, $window, piwikUrl) { - - var url = 'index.php'; - var format = 'json'; - var getParams = {}; - var postParams = {}; - var allRequests = []; - - /** - * Adds params to the request. - * If params are given more then once, the latest given value is used for the request - * - * @param {object} params - * @return {void} - */ - function addParams (params) { - if (typeof params == 'string') { - params = piwik.broadcast.getValuesFromUrl(params); - } - - var arrayParams = ['compareSegments', 'comparePeriods', 'compareDates']; - - for (var key in params) { - if (arrayParams.indexOf(key) !== -1 - && !params[key] - ) { - continue; - } - - getParams[key] = params[key]; - } - } - - function withTokenInUrl() - { - postParams['token_auth'] = piwik.token_auth; - // When viewing a widgetized report there won't be any session that can be used, so don't force session usage - postParams['force_api_session'] = piwik.broadcast.isWidgetizeRequestWithoutSession() ? 0 : 1; - } - - function isRequestToApiMethod() { - return getParams && getParams['module'] === 'API' && getParams['method']; - } - - function reset () { - getParams = {}; - postParams = {}; - } - - function isErrorResponse(response) { - return response && angular.isObject(response) && response.result == 'error'; - } - - function createResponseErrorNotification(response, options) { - if (response.message - && options.createErrorNotification - ) { - var UI = require('piwik/UI'); - var notification = new UI.Notification(); - notification.show(response.message, { - context: 'error', - type: 'toast', - id: 'ajaxHelper', - placeat: options.placeat - }); - setTimeout(function () { - // give some time for angular to render it - notification.scrollToNotification(); - }, 100); - } - } - - /** - * Send the request - * @return $promise - */ - function send (options) { - if (!options) { - options = {}; - } - - if (options.createErrorNotification === undefined) { - options.createErrorNotification = true; - } - - function onSuccess(response) - { - var headers = response.headers; - response = response.data; - - if (!angular.isDefined(response) || response === null) { - return $q.reject(null); - } else if (isErrorResponse(response)) { - createResponseErrorNotification(response, options); - - return $q.reject(response.message || null); - } else { - return options.includeHeaders ? { headers: headers, response: response } : response; - } - } - - function onError(response) - { - var message = 'Something went wrong'; - if (response && (response.status === 0 || response.status === -1)) { - message = 'Request was possibly aborted'; - } - - return $q.reject(message); - } - - var deferred = $q.defer(), - requestPromise = deferred.promise; - - var headers = { - 'Content-Type': 'application/x-www-form-urlencoded', - // ie 8,9,10 caches ajax requests, prevent this - 'cache-control': 'no-cache' - }; - - var requestFormat = format; - if (getParams.format && getParams.format.toLowerCase() !== 'json' && getParams.format.toLowerCase() !== 'json') { - requestFormat = getParams.format; - } - - var ajaxCall = { - method: 'POST', - url: url + '?' + $.param(mixinDefaultGetParams(getParams)), - responseType: requestFormat, - data: $.param(getPostParams(postParams)), - timeout: requestPromise, - headers: headers - }; - - var promise = $http(ajaxCall).then(onSuccess, onError); - - // we can't modify requestPromise directly and add an abort method since for some reason it gets - // removed after then/finally/catch is called. - var addAbortMethod = function (to, deferred) { - return { - then: function () { - return addAbortMethod(to.then.apply(to, arguments), deferred); - }, - - 'finally': function () { - return addAbortMethod(to.finally.apply(to, arguments), deferred); - }, - - 'catch': function () { - return addAbortMethod(to.catch.apply(to, arguments), deferred); - }, - - abort: function () { - deferred.resolve(); - return this; - } - }; - }; - - var request = addAbortMethod(promise, deferred); - - allRequests.push(request); - return request.finally(function() { - var index = allRequests.indexOf(request); - if (index !== -1) { - allRequests.splice(index, 1); - } - }); - } - - /** - * Get the parameters to send as POST - * - * @param {object} params parameter object - * @return {object} - * @private - */ - function getPostParams (params) { - if (isRequestToApiMethod() || piwik.shouldPropagateTokenAuth) { - params.token_auth = piwik.token_auth; - // When viewing a widgetized report there won't be any session that can be used, so don't force session usage - params.force_api_session = piwik.broadcast.isWidgetizeRequestWithoutSession() ? 0 : 1; - } - - return params; - } - - /** - * Mixin the default parameters to send as GET - * - * @param {object} getParamsToMixin parameter object - * @return {object} - * @private - */ - function mixinDefaultGetParams (getParamsToMixin) { - // we have to decode the value manually because broadcast will not decode anything itself. if we don't, - // angular will encode it again before sending the value in an HTTP request. - var segment = piwikUrl.getSearchParam('segment'); - if (segment) { - segment = decodeURIComponent(segment); - } - - var defaultParams = { - idSite: piwik.idSite || piwikUrl.getSearchParam('idSite'), - period: piwik.period || piwikUrl.getSearchParam('period'), - segment: segment - }; - - // never append token_auth to url - if (getParamsToMixin.token_auth) { - getParamsToMixin.token_auth = null; - delete getParamsToMixin.token_auth; - } - - for (var key in defaultParams) { - if (!(key in getParamsToMixin) && !(key in postParams) && defaultParams[key]) { - getParamsToMixin[key] = defaultParams[key]; - } - } - - // handle default date & period if not already set - if (!getParamsToMixin.date && !postParams.date) { - getParamsToMixin.date = piwik.currentDateString; - } - - return getParamsToMixin; - } - - function abortAll() { - reset(); - - allRequests.forEach(function (request) { - request.abort(); - }); - - allRequests = []; - } - - function abort () { - abortAll(); - } - - /** - * Perform a reading API request. - * @param getParams - */ - function fetch (getParams, options) { - - getParams.module = getParams.module || 'API'; - - if (!getParams.format) { - getParams.format = 'JSON'; - } - - addParams(getParams); - - var promise = send(options); - - reset(); - - return promise; - } - - function post(getParams, _postParams_, options) { - if (_postParams_) { - if (postParams && postParams.token_auth && !_postParams_.token_auth) { - _postParams_.token_auth = postParams.token_auth; - // When viewing a widgetized report there won't be any session that can be used, so don't force session usage - _postParams_.force_api_session = piwik.broadcast.isWidgetizeRequestWithoutSession() ? 0 : 1; - } - postParams = _postParams_; - } - - return fetch(getParams, options); - } - - function addPostParams(_postParams_) { - if (_postParams_) { - angular.merge(postParams, _postParams_); - } - } - - /** - * Convenience method that will perform a bulk request using Piwik's API.getBulkRequest method. - * Bulk requests allow you to execute multiple Piwik requests with one HTTP request. - * - * @param {object[]} requests - * @param {object} options - * @return {HttpPromise} a promise that is resolved when the request finishes. The argument passed - * to the .then(...) callback will be an array with one element per request - * made. - */ - function bulkFetch(requests, options) { - var bulkApiRequestParams = { - urls: requests.map(function (requestObj) { return '?' + $.param(requestObj); }) - }; - - var deferred = $q.defer(), - requestPromise = post({method: "API.getBulkRequest"}, bulkApiRequestParams, options).then(function (response) { - if (!(response instanceof Array)) { - response = [response]; - } - - // check for errors - for (var i = 0; i != response.length; ++i) { - var specificResponse = response[i]; - - if (isErrorResponse(specificResponse)) { - deferred.reject(specificResponse.message || null); - - createResponseErrorNotification(specificResponse, options || {}); - - return; - } - } - - deferred.resolve(response); - }).catch(function () { - deferred.reject.apply(deferred, arguments); - }); - - return deferred.promise; - } - - return { - withTokenInUrl: withTokenInUrl, // technically should probably be called withTokenInPost - bulkFetch: bulkFetch, - post: post, - fetch: fetch, - addPostParams: addPostParams, - abort: abort, - abortAll: abortAll, - mixinDefaultGetParams: mixinDefaultGetParams - }; - } -})(); diff --git a/plugins/CoreHome/angularjs/common/services/piwik-api.spec.js b/plugins/CoreHome/angularjs/common/services/piwik-api.spec.js deleted file mode 100644 index de457c82cc..0000000000 --- a/plugins/CoreHome/angularjs/common/services/piwik-api.spec.js +++ /dev/null @@ -1,273 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -(function () { - describe('piwikApiClient', function () { - var piwikApi, - $httpBackend; - - if (!window.piwik) window.piwik = {}; - if (!window.piwik.UI) window.piwik.UI = {}; - if (!window.piwik.UI.Notification) { - window.piwik.UI.Notification = function () { - this.show = function () {}; - this.scrollToNotification = function () {}; - return this; - }; - } - - beforeEach(module('piwikApp.service')); - beforeEach(inject(function($injector) { - piwikApi = $injector.get('piwikApi'); - - $httpBackend = $injector.get('$httpBackend'); - - $httpBackend.when('POST', /.*getBulkRequest.*/, /.*errorAction.*/).respond(function (method, url, data, headers) { - url = url.replace(/date=[^&]+/, "date="); - - var errorResponse = {result: 'error', message: "error message"}, - successResponse= "Response #2: " + url + " - " + data; - - return [200, [errorResponse, successResponse]]; - }); - - $httpBackend.when('POST', /.*getBulkRequest.*/).respond(function (method, url, data, headers) { - url = url.replace(/date=[^&]+/, "date="); - - var responses = [ - "Response #1: " + url + " - " + data, - "Response #2: " + url + " - " + data - ]; - - return [200, JSON.stringify(responses)]; - }); - - $httpBackend.when('POST', /.*/).respond(function (method, url, data, headers) { - url = url.replace(/date=[^&]+/, "date="); - return [200, "Request url: " + url]; - }); - })); - - it("should successfully send a request to Piwik when fetch is called", function (done) { - piwikApi.fetch({ - method: "SomePlugin.action" - }).then(function (response) { - expect(response).to.equal("Request url: index.php?method=SomePlugin.action&module=API&format=JSON&idSite=1&period=day&date="); - - done(); - }).catch(function (ex) { - done(ex); - }); - - $httpBackend.flush(); - }); - - it("should chain multiple then callbacks correctly when a fetch succeeds", function (done) { - var firstThenDone = false; - - piwikApi.fetch({ - method: "SomePlugin.action" - }).then(function (response) { - firstThenDone = true; - - return "newval"; - }).then(function (response) { - expect(firstThenDone).to.equal(true); - expect(response).to.equal("newval"); - - done(); - }).catch(function (ex) { - done(ex); - }); - - $httpBackend.flush(); - }); - - it("should fail when multiple aborts are issued", function (done) { - var request = piwikApi.fetch({ - method: "SomePlugin.action" - }).then(function (response) { - done(new Error("Aborted request succeeded but should fail!")); - }).catch(function (ex) { - done(); - }); - - request.abort(); - request.abort(); - - $httpBackend.flush(); - - request.abort(); - }); - - it("should send multiple requests concurrently when fetch is called more than once", function (done) { - var request1Done, request2Done; - - function finishIfBothDone() { - if (request1Done && request2Done) { - done(); - } - } - - piwikApi.fetch({ - method: "SomePlugin.action" - }).then(function (response) { - expect(response).to.equal("Request url: index.php?method=SomePlugin.action&module=API&format=JSON&idSite=1&period=day&date="); - - request1Done = true; - - finishIfBothDone(); - }).catch(function (ex) { - done(ex); - }); - - piwikApi.fetch({ - method: "SomeOtherPlugin.action" - }).then(function (response) { - expect(response).to.equal("Request url: index.php?method=SomeOtherPlugin.action&module=API&format=JSON&idSite=1&period=day&date="); - - request2Done = true; - - finishIfBothDone(); - }).catch(function (ex) { - done(ex); - }); - - $httpBackend.flush(); - }); - - it("should abort individual requests when abort() is called on a promise", function (done) { - var request1Done, request2Done; - - function finishIfBothDone() { - if (request1Done && request2Done) { - done(); - } - } - - var request = piwikApi.fetch({ - method: "SomePlugin.waitAction" - }).then(function (response) { - done(new Error("Aborted request finished!")); - }).catch(function (ex) { - request1Done = true; - finishIfBothDone(); - }); - - piwikApi.fetch({ - method: "SomeOtherPlugin.action" - }).then(function (response) { - expect(response).to.equal("Request url: index.php?method=SomeOtherPlugin.action&module=API&format=JSON&idSite=1&period=day&date="); - - request2Done = true; - - finishIfBothDone(); - }).catch(function (ex) { - done(ex); - }); - - request.abort(); - - $httpBackend.flush(); - }); - - it("should abort all requests when abortAll() is called on the piwikApi", function (done) { - var request1Done, request2Done; - - function finishIfBothDone() { - if (request1Done && request2Done) { - done(); - } - } - - piwikApi.fetch({ - method: "SomePlugin.waitAction" - }).then(function (response) { - done(new Error("Aborted request finished (request 1)!")); - }).catch(function (ex) { - request1Done = true; - finishIfBothDone(); - }); - - piwikApi.fetch({ - method: "SomePlugin.waitAction" - }).then(function (response) { - done(new Error("Aborted request finished (request 2)!")); - }).catch(function (ex) { - request2Done = true; - finishIfBothDone(); - }); - - piwikApi.abortAll(); - - $httpBackend.flush(); - }); - - it("should perform a bulk request correctly when bulkFetch is called on the piwikApi", function (done) { - piwikApi.bulkFetch([ - { - method: "SomePlugin.action", - param: "value" - }, - { - method: "SomeOtherPlugin.action" - } - ]).then(function (response) { - var restOfExpected = "index.php?method=API.getBulkRequest&module=API&format=JSON&idSite=1&period=day&date= - " - + "urls%5B%5D=%3Fmethod%3DSomePlugin.action%26param%3Dvalue&urls%5B%5D=%3Fmethod%3DSomeOtherPlugin.action" - + "&token_auth=100bf5eeeed1468f3f9d93750044d3dd&force_api_session=1"; - - expect(response.length).to.equal(2); - expect(response[0]).to.equal("Response #1: " + restOfExpected); - expect(response[1]).to.equal("Response #2: " + restOfExpected); - - done(); - }).catch(function (ex) { - done(ex); - }); - - $httpBackend.flush(); - }); - - it("should correctly handle errors in a bulk request response", function (done) { - piwikApi.bulkFetch([ - { - method: "SomePlugin.errorAction" - }, - { - method: "SomeOtherPlugin.whatever" - } - ]).then(function (response) { - done(new Error("promise resolved after bulkFetch request returned an error (response = " + JSON.stringify(response) + ")")); - }).catch(function (error) { - expect(error).to.equal("error message"); - - done(); - }); - - $httpBackend.flush(); - }); - - it("should correctly handle errors in a bulk request response, regardless of error location", function (done) { - piwikApi.bulkFetch([ - { - method: "SomeOtherPlugin.whatever" - }, - { - method: "SomePlugin.errorAction" - } - ]).then(function (response) { - done(new Error("promise resolved after bulkFetch request returned an error (response = " + JSON.stringify(response) + ")")); - }).catch(function (error) { - expect(error).to.equal("error message"); - - done(); - }); - - $httpBackend.flush(); - }); - }); -})(); diff --git a/plugins/CoreHome/angularjs/common/services/service.module.js b/plugins/CoreHome/angularjs/common/services/service.module.js deleted file mode 100644 index e41ca95d56..0000000000 --- a/plugins/CoreHome/angularjs/common/services/service.module.js +++ /dev/null @@ -1,9 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -(function () { - angular.module('piwikApp.service', []); -})();
\ No newline at end of file diff --git a/plugins/CoreHome/angularjs/history/history.service.js b/plugins/CoreHome/angularjs/history/history.service.js deleted file mode 100644 index b2ffa769ce..0000000000 --- a/plugins/CoreHome/angularjs/history/history.service.js +++ /dev/null @@ -1,114 +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 - */ - -/** - * History service. Provides the ability to change the window hash, and makes sure broadcast.pageload - * is called on every change. - * - * This service replaces the previously used jQuery history extension. - * - * Should only be used by the broadcast object. - * - * @deprecated in 3.2.2, will be removed in Matomo 5 - */ -(function (window, $, broadcast) { - angular.module('piwikApp').service('historyService', historyService); - - historyService.$inject = ['$location', '$rootScope']; - - function historyService($location, $rootScope) { - var service = {}; - service.load = load; - service.init = init; - return service; - - function init() { - if ($location.path() != '/') { - changePathToSearch(); - } - - $rootScope.$on('$locationChangeSuccess', function () { - loadCurrentPage(); - }); - - loadCurrentPage(); - } - - // currently, the AJAX content URL is stored in $location.search(), but before it was stored in $location.path(). - // this function makes sure URLs like http://piwik.net/?...#/module=Whatever&action=whatever still work. - function changePathToSearch() { - var path = $location.path(); - if (!path || path == '/') { - return; - } - - var searchParams = broadcast.getValuesFromUrl('?' + path.substring(1)); - // NOTE: we don't need to decode the parameters since $location.path() will decode the string itself - - $location.search(searchParams); - $location.path(''); - } - - function loadCurrentPage() { - var searchObject = $location.search(), - searchString = []; - for (var name in searchObject) { - if (!searchObject.hasOwnProperty(name) || name == '_') { - continue; - } - - // if more than one query parameter of the same name is supplied, angular will return all of them as - // an array. we only want to use the last one, though. - if (searchObject[name] instanceof Array) { - searchObject[name] = searchObject[name][searchObject[name].length - 1]; - } - - var value = searchObject[name]; - if (name != 'columns') { // the columns query parameter is not urldecoded in PHP code. TODO: this should be fixed in 3.0 - value = encodeURIComponent(value); - } - - searchString.push(name + '=' + value); - } - searchString = searchString.join('&'); - - // the location hash will have a / prefix, which broadcast.pageload doesn't want - broadcast.pageload(searchString); - } - - function load(hash) { - // make sure the hash is just the query parameter values, w/o a starting #, / or ? char. broadcast.pageload & $location.path should get neither - hash = normalizeHash(hash); - - var currentHash = normalizeHash(location.hash); - if (currentHash === hash) { - loadCurrentPage(); // it would not trigger a location change success event as URL is the same, call it manually - } else if (hash) { - $location.search(hash); - } else { - // NOTE: this works around a bug in angularjs. when unsetting the hash (ie, removing in the URL), - // angular will enter an infinite loop of digests. this is because $locationWatch will trigger - // $locationChangeStart if $browser.url() != $location.absUrl(), and $browser.url() will contain - // the '#' character and $location.absUrl() will not. so the watch continues to trigger the event. - $location.search('_='); - } - - setTimeout(function () { $rootScope.$apply(); }, 1); - } - - function normalizeHash(hash) { - var chars = ['#', '/', '?']; - for (var i = 0; i != chars.length; ++i) { - var charToRemove = chars[i]; - if (hash.charAt(0) == charToRemove) { - hash = hash.substring(1); - } - } - return hash; - } - } -})(window, jQuery, broadcast); diff --git a/plugins/CoreHome/angularjs/http404check.js b/plugins/CoreHome/angularjs/http404check.js deleted file mode 100644 index bba8ba6a65..0000000000 --- a/plugins/CoreHome/angularjs/http404check.js +++ /dev/null @@ -1,74 +0,0 @@ -(function () { - angular.module('piwikApp').factory('http404CheckInterceptor', http404CheckInterceptor); - - http404CheckInterceptor.$inject = ['$q', 'globalAjaxQueue']; - - function http404CheckInterceptor($q, globalAjaxQueue) { - - function isClientError(rejection) - { - if (rejection.status === 500 || rejection.status <= 0) { - return true; - } - - return rejection.status >= 400 && rejection.status < 408; - } - - return { - 'request': function(config) { - if ('object' === typeof piwik.relativePluginWebDirs - && config && config.url && config.url.indexOf('plugins/') === 0 - && config.url.indexOf('.html') > 0 - && config.url.indexOf('/angularjs/') > 0) { - - var urlParts = config.url.split('/'); - if (urlParts && urlParts.length > 2 && urlParts[1]) { - var pluginName = urlParts[1]; - if (pluginName && pluginName in piwik.relativePluginWebDirs && piwik.relativePluginWebDirs[pluginName]) { - urlParts[0] = piwik.relativePluginWebDirs[pluginName]; - config.url = urlParts.join('/'); - } - } - } - return config; - }, - 'responseError': function(rejection) { - - if (rejection && - isClientError(rejection) && - rejection.config && - rejection.config.url && - -1 !== rejection.config.url.indexOf('.html') && - -1 !== rejection.config.url.indexOf('plugins')) { - - var posEndUrl = rejection.config.url.indexOf('.html') + 5; - var url = rejection.config.url.slice(0, posEndUrl); - - var message = 'Please check your server configuration. You may want to whitelist "*.html" files from the "plugins" directory.'; - message += ' The HTTP status code is ' + rejection.status + ' for URL "' + url + '"'; - - if (rejection.status === -1) { - message = 'Please check if you have an ad blocker or something similar enabled.'; - } - - var UI = require('piwik/UI'); - var notification = new UI.Notification(); - notification.show(message, { - title: 'Failed to load HTML file:', - context: 'error', - id: 'Network_HtmlFileLoadingError' - }); - } - - return $q.reject(rejection); - } - }; - } - - angular.module('piwikApp').config(['$httpProvider',function($httpProvider) { - $httpProvider.interceptors.push('http404CheckInterceptor'); - }]); - - -})(); - diff --git a/plugins/CoreHome/angularjs/piwikApp.config.js b/plugins/CoreHome/angularjs/piwikApp.config.js deleted file mode 100644 index 8d73dda383..0000000000 --- a/plugins/CoreHome/angularjs/piwikApp.config.js +++ /dev/null @@ -1,13 +0,0 @@ -(function () { - angular.module('piwikApp.config', []); - - if ('undefined' === (typeof piwik) || !piwik) { - return; - } - - var piwikAppConfig = angular.module('piwikApp.config'); - // we probably want this later as a separate config file, till then it serves as a "bridge" - for (var index in piwik.config) { - piwikAppConfig.constant(index.toUpperCase(), piwik.config[index]); - } -})();
\ No newline at end of file diff --git a/plugins/CoreHome/angularjs/piwikApp.js b/plugins/CoreHome/angularjs/piwikApp.js deleted file mode 100644 index 1fa735757b..0000000000 --- a/plugins/CoreHome/angularjs/piwikApp.js +++ /dev/null @@ -1,22 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -(function () { - angular.module('piwikApp', [ - 'ngSanitize', - 'ngAnimate', - 'ngCookies', - 'piwikApp.config', - 'piwikApp.service', - 'piwikApp.directive', - 'piwikApp.filter' - ]); - angular.module('app', []); - - angular.module('piwikApp').config(['$locationProvider', function($locationProvider) { - $locationProvider.html5Mode({ enabled: false, rewriteLinks: false }).hashPrefix(''); - }]); -})();
\ No newline at end of file diff --git a/plugins/CoreHome/javascripts/broadcast.js b/plugins/CoreHome/javascripts/broadcast.js index 22b7c96e73..3fa04db151 100644 --- a/plugins/CoreHome/javascripts/broadcast.js +++ b/plugins/CoreHome/javascripts/broadcast.js @@ -63,8 +63,11 @@ var broadcast = { } broadcast._isInit = true; - angular.element(document).injector().invoke(function (historyService) { - historyService.init(); + var MatomoUrl = window.CoreHome.MatomoUrl; + var watchEffect = window.Vue.watchEffect; + + watchEffect(() => { + broadcast.pageload(MatomoUrl.stringify(MatomoUrl.hashParsed.value)); }); if(noLoadingMessage != true) { @@ -246,17 +249,14 @@ var broadcast = { } if (disableHistory) { - var $window = piwikHelper.getAngularDependency('$window'); - var newLocation = $window.location.href.split('#')[0] + '#?' + currentHashStr; + var newLocation = window.location.href.split('#')[0] + '#?' + currentHashStr; // window.location.replace changes the current url without pushing it on the browser's history stack - $window.location.replace(newLocation); + window.location.replace(newLocation); } else { // Let history know about this new Hash and load it. broadcast.forceReload = true; - angular.element(document).injector().invoke(function (historyService) { - historyService.load(currentHashStr); - }); + window.CoreHome.MatomoUrl.updateHash(currentHashStr.replace(/^[#\/?]+/, '')); } }, @@ -326,10 +326,8 @@ var broadcast = { var params_vals = str.split("&"); - var $window = piwikHelper.getAngularDependency('$window'); - // available in global scope - var currentSearchStr = $window.location.search; + var currentSearchStr = window.location.search; var currentHashStr = broadcast.getHashFromUrl(); if (!currentSearchStr) { @@ -398,20 +396,11 @@ var broadcast = { newUrl = wholeNewUrl; } - var $rootScope = piwikHelper.getAngularDependency('$rootScope'); - if ($rootScope) { - $rootScope.$on('$locationChangeStart', function (event) { - if (event) { - event.preventDefault(); - } - }); - } - if (oldUrl == newUrl) { - $window.location.reload(); + window.location.reload(); } else { this.forceReload = true; - $window.location.href = newUrl; + window.location.href = newUrl; } return false; @@ -608,7 +597,7 @@ var broadcast = { piwikHelper.hideAjaxLoading(); broadcast.lastUrlRequested = null; - piwikHelper.compileAngularComponents('#content'); + piwikHelper.compileVueDirectives('#content'); } initTopControls(); diff --git a/plugins/CoreHome/javascripts/dataTable.js b/plugins/CoreHome/javascripts/dataTable.js index 95444fa5df..373492010a 100644 --- a/plugins/CoreHome/javascripts/dataTable.js +++ b/plugins/CoreHome/javascripts/dataTable.js @@ -110,10 +110,12 @@ $.extend(DataTable.prototype, UIControl.prototype, { this.loadedSubDataTable = {}; this.isEmpty = $('.pk-emptyDataTable', domElem).length > 0; - this.bindEventsAndApplyStyle(domElem); - this._init(domElem); - this.enableStickHead(domElem); - this.initialized = true; + window.Vue.nextTick().then(() => { + this.bindEventsAndApplyStyle(domElem); + this._init(domElem); + this.enableStickHead(domElem); + this.initialized = true; + }); }, enableStickHead: function (domElem) { @@ -343,7 +345,7 @@ $.extend(DataTable.prototype, UIControl.prototype, { piwikHelper.lazyScrollTo(content[0], 400); } - piwikHelper.compileAngularComponents(content); + piwikHelper.compileVueEntryComponents(content); return content; }, @@ -768,7 +770,8 @@ $.extend(DataTable.prototype, UIControl.prototype, { return; } - var piwikPeriods = piwikHelper.getAngularDependency('piwikPeriods'); + var piwikPeriods = window.CoreHome.Periods; + var formatDate = window.CoreHome.format; if (self.param['dateUsedInGraph']) { // this parameter is passed along when switching between periods. So we perfer using // it, to avoid a change in the end date shown in the graph @@ -777,7 +780,7 @@ $.extend(DataTable.prototype, UIControl.prototype, { var currentPeriod = piwikPeriods.parse(self.param['period'], self.param['date']); } var endDateOfPeriod = currentPeriod.getDateRange()[1]; - endDateOfPeriod = piwikPeriods.format(endDateOfPeriod); + endDateOfPeriod = formatDate(endDateOfPeriod); var newPeriod = piwikPeriods.get(period); $('.periodName', domElem).html(newPeriod.getDisplayText()); @@ -1252,31 +1255,26 @@ $.extend(DataTable.prototype, UIControl.prototype, { } if ((typeof self.numberOfSubtables == 'undefined' || self.numberOfSubtables == 0) - && (typeof self.param.flat == 'undefined' || self.param.flat != 1)) { + && (typeof self.param.flat == 'undefined' || self.param.flat != 1) + ) { // if there are no subtables, remove the flatten action - $('.dataTableFlatten', domElem).parent().remove(); + const dataTableActionsVueApp = $('[vue-entry="CoreHome.DataTableActions"]', domElem).data('vueAppInstance'); + if (dataTableActionsVueApp) { + dataTableActionsVueApp.showFlattenTable_ = false; + } } var ul = $('ul.tableConfiguration', domElem); - function hideConfigurationIcon() { - // hide the icon when there are no actions available or we're not in a table view - $('.dropdownConfigureIcon', domElem).remove(); - } - if (!ul.find('li').length) { - hideConfigurationIcon(); return; } - var icon = $('a.dropdownConfigureIcon', domElem); - var iconHighlighted = false; - var generateClickCallback = function (paramName, callbackAfterToggle, setParamCallback) { return function () { if (setParamCallback) { var data = setParamCallback(); } else { - self.param[paramName] = (1 - self.param[paramName]) + ''; + self.param[paramName] = (1 - (self.param[paramName] || 0)) + ''; var data = {}; } self.param.filter_offset = 0; @@ -1288,70 +1286,19 @@ $.extend(DataTable.prototype, UIControl.prototype, { }; }; - var getText = function (text, addDefault, replacement) { - if (/(%(.\$)?s+)/g.test(_pk_translate(text))) { - var values = ['<br /><span class="action">']; - if(replacement) { - values.push(replacement); - } - text = _pk_translate(text, values); - if (addDefault) text += ' (' + _pk_translate('CoreHome_Default') + ')'; - text += '</span>'; - return text; - } - return _pk_translate(text); - }; - - var setText = function (el, paramName, textA, textB) { - if (typeof self.param[paramName] != 'undefined' && self.param[paramName] == 1) { - $(el).html(getText(textA, true)); - iconHighlighted = true; - } - else { - self.param[paramName] = 0; - $(el).html(getText(textB)); - } - }; - // handle low population $('.dataTableExcludeLowPopulation', domElem) - .each(function () { - // Set the text, either "Exclude low pop" or "Include all" - if (typeof self.param.enable_filter_excludelowpop == 'undefined') { - self.param.enable_filter_excludelowpop = 0; - } - if (Number(self.param.enable_filter_excludelowpop) != 0) { - var string = getText('CoreHome_IncludeRowsWithLowPopulation', true); - self.param.enable_filter_excludelowpop = 1; - iconHighlighted = true; - } - else { - var string = getText('CoreHome_ExcludeRowsWithLowPopulation'); - self.param.enable_filter_excludelowpop = 0; - } - $(this).html(string); - }) .click(generateClickCallback('enable_filter_excludelowpop')); // handle flatten $('.dataTableFlatten', domElem) - .each(function () { - setText(this, 'flat', 'CoreHome_UnFlattenDataTable', 'CoreHome_FlattenDataTable'); - }) .click(generateClickCallback('flat')); // handle flatten $('.dataTableShowTotalsRow', domElem) - .each(function () { - setText(this, 'keep_totals_row', 'CoreHome_RemoveTotalsRowDataTable', 'CoreHome_AddTotalsRowDataTable'); - }) .click(generateClickCallback('keep_totals_row')); $('.dataTableIncludeAggregateRows', domElem) - .each(function () { - setText(this, 'include_aggregate_rows', 'CoreHome_DataTableExcludeAggregateRows', - 'CoreHome_DataTableIncludeAggregateRows'); - }) .click(generateClickCallback('include_aggregate_rows', function () { if (self.param.include_aggregate_rows == 1) { // when including aggregate rows is enabled, we remove the sorting @@ -1362,25 +1309,10 @@ $.extend(DataTable.prototype, UIControl.prototype, { })); $('.dataTableShowDimensions', domElem) - .each(function () { - setText(this, 'show_dimensions', 'CoreHome_DataTableCombineDimensions', - 'CoreHome_DataTableShowDimensions'); - }) .click(generateClickCallback('show_dimensions')); // handle pivot by $('.dataTablePivotBySubtable', domElem) - .each(function () { - if (self.param.pivotBy - && self.param.pivotBy != '0' - ) { - $(this).html(getText('CoreHome_UndoPivotBySubtable', true)); - iconHighlighted = true; - } else { - var optionLabelText = getText('CoreHome_PivotBySubtable', false, self.props.pivot_dimension_name); - $(this).html(optionLabelText); - } - }) .click(generateClickCallback('pivotBy', null, function () { if (self.param.pivotBy && self.param.pivotBy != '0' @@ -1398,19 +1330,6 @@ $.extend(DataTable.prototype, UIControl.prototype, { self.param.filter_sort_column = ''; return {filter_sort_column: ''}; })); - - // handle highlighted icon - if (iconHighlighted) { - icon.addClass('highlighted'); - } - - if (!iconHighlighted - && !(self.param.viewDataTable == 'table' - || self.param.viewDataTable == 'tableAllColumns' - || self.param.viewDataTable == 'tableGoals')) { - hideConfigurationIcon(); - return; - } }, notifyWidgetParametersChange: function (domWidget, parameters) { @@ -1741,11 +1660,10 @@ $.extend(DataTable.prototype, UIControl.prototype, { // hackish solution to get binded html of p tag within the help node // at this point the ng-bind-html is not yet converted into html when report is not // initially loaded. Using $compile doesn't work. So get and set it manually - var helpParagraph = $('p[ng-bind-html]', $doc); + var helpParagraph = $doc.attr('data-content'); if (helpParagraph.length) { - var $parse = angular.element(document).injector().get('$parse'); - helpParagraph.html($parse(helpParagraph.attr('ng-bind-html'))); + helpParagraph.html(window.vueSanitize(helpParagraph)); } scope.inlineHelp = $.trim($doc.html()); diff --git a/plugins/CoreHome/javascripts/dataTable_rowactions.js b/plugins/CoreHome/javascripts/dataTable_rowactions.js index 2c95333d29..d0283b2992 100644 --- a/plugins/CoreHome/javascripts/dataTable_rowactions.js +++ b/plugins/CoreHome/javascripts/dataTable_rowactions.js @@ -305,10 +305,10 @@ DataTable_RowActions_RowEvolution.prototype.performAction = function (label, tr, label = this.multiEvolutionRows.join(','); if (this.multiEvolutionRowsSeries.length > 1) { // when comparison is active - var piwikUrl = piwikHelper.getAngularDependency('piwikUrl'); - extraParams.compareDates = piwikUrl.getSearchParam('compareDates'); - extraParams.comparePeriods = piwikUrl.getSearchParam('comparePeriods'); - extraParams.compareSegments = piwikUrl.getSearchParam('compareSegments'); + var MatomoUrl = window.CoreHome.MatomoUrl; + extraParams.compareDates = MatomoUrl.parsed.value.compareDates; + extraParams.comparePeriods = MatomoUrl.parsed.value.comparePeriods; + extraParams.compareSegments = MatomoUrl.parsed.value.compareSegments; extraParams.labelSeries = this.multiEvolutionRowsSeries.join(','); // remove override period/date/segment since we are sending compare params so we can have the whole set of comparison diff --git a/plugins/CoreHome/javascripts/popover.js b/plugins/CoreHome/javascripts/popover.js index d283853962..0ad2272632 100644 --- a/plugins/CoreHome/javascripts/popover.js +++ b/plugins/CoreHome/javascripts/popover.js @@ -207,7 +207,6 @@ var Piwik_Popover = (function () { container.html(html); container.children().each(function (i, childNode) { - piwikHelper.compileAngularComponents(childNode); piwikHelper.compileVueEntryComponents(childNode); }); diff --git a/plugins/CoreHome/javascripts/sparkline.js b/plugins/CoreHome/javascripts/sparkline.js index 3aab2976c2..dac878feb6 100644 --- a/plugins/CoreHome/javascripts/sparkline.js +++ b/plugins/CoreHome/javascripts/sparkline.js @@ -15,7 +15,7 @@ var sparklineDisplayWidth = 100; piwik.getSparklineColors = function () { var colors = piwik.ColorManager.getColors('sparkline-colors', sparklineColorNames); - var comparisonService = piwikHelper.getAngularDependency('piwikComparisonsService'); + var comparisonService = window.CoreHome.ComparisonsStoreInstance; if (comparisonService.isComparing()) { var comparisons = comparisonService.getAllComparisonSeries(); colors.lineColor = comparisons.map(function (comp) { return comp.color; }); @@ -63,7 +63,7 @@ window.initializeSparklines = function () { var graph = $(this); // we search for .widget to make sure eg in the Dashboard to not update any graph of another report - var selectorsToFindParent = ['.widget', '[piwik-widget-container]', '.reporting-page', 'body']; + var selectorsToFindParent = ['.widget', '.widget-container', '.reporting-page', 'body']; var index = 0, selector, parent; for (index; index < selectorsToFindParent.length; index++) { selector = selectorsToFindParent[index]; diff --git a/plugins/CoreHome/javascripts/top_controls.js b/plugins/CoreHome/javascripts/top_controls.js index 66dee03260..12cfe317ed 100644 --- a/plugins/CoreHome/javascripts/top_controls.js +++ b/plugins/CoreHome/javascripts/top_controls.js @@ -43,9 +43,15 @@ function initTopControls() { }); if (allRendered) { + var alreadyRendered = $('.top_controls').css('visibility') === 'visible'; + // we make top controls visible only after all selectors are rendered $('.top_controls').css('visibility', 'visible'); $('.top_controls').css('opacity', '1'); + + if (!alreadyRendered) { + window.CoreHome.Matomo.postEvent('Matomo.topControlsRendered'); + } } } diff --git a/plugins/CoreHome/javascripts/zen-mode.js b/plugins/CoreHome/javascripts/zen-mode.js deleted file mode 100644 index 1fd339a43a..0000000000 --- a/plugins/CoreHome/javascripts/zen-mode.js +++ /dev/null @@ -1,36 +0,0 @@ -$(function () { - - angular.element(document).injector().invoke(handleZenMode); - - function handleZenMode ($rootElement, $cookies) { - var zenMode = !!parseInt($cookies.get('zenMode'), 10); - var iconSwitcher = $('.top_controls .icon-arrowup'); - - iconSwitcher.click(function(event) { - Mousetrap.trigger('z') - }); - - function updateZenMode() { - if (zenMode) { - $('body').addClass('zenMode'); - iconSwitcher.addClass('icon-arrowdown').removeClass('icon-arrowup'); - iconSwitcher.prop('title', _pk_translate('CoreHome_ExitZenMode')); - } else { - $('body').removeClass('zenMode'); - iconSwitcher.removeClass('icon-arrowdown').addClass('icon-arrowup'); - iconSwitcher.prop('title', _pk_translate('CoreHome_EnterZenMode')); - } - } - - piwikHelper.registerShortcut('z', _pk_translate('CoreHome_ShortcutZenMode'), function (event) { - if (event.altKey) { - return; - } - zenMode = !zenMode; - $cookies.put('zenMode', zenMode ? '1' : '0'); - updateZenMode(); - }); - - updateZenMode(); - } -}); diff --git a/plugins/CoreHome/templates/_dataTable.twig b/plugins/CoreHome/templates/_dataTable.twig index 4ba518a511..80139750af 100644 --- a/plugins/CoreHome/templates/_dataTable.twig +++ b/plugins/CoreHome/templates/_dataTable.twig @@ -14,7 +14,7 @@ <h2 class="card-title" {% if properties.title_edit_entity_url %}edit-url="{{ properties.title_edit_entity_url }}"{% endif %} report-generated="{% if reportLastUpdatedMessage is defined %}{{ reportLastUpdatedMessage|raw }}{% endif %}" - piwik-enriched-headline + vue-entry="CoreHome.EnrichedHeadline" >{{ properties.title }}</h2> {% endif %} {% elseif showOnlyTitleWithoutCard %} @@ -42,14 +42,13 @@ {% endif %} <div class="reportDocumentation" data-content="{{ properties.documentation|default|e('html_attr') }}"> - {% if properties.documentation|default is not empty %}<p ng-bind-html="{{ properties.documentation|json_encode|e('html_attr') }}"></p>{% endif %} {% if properties.onlineGuideUrl|default is not empty %}<a href="{{ properties.onlineGuideUrl|safelink|e('html_attr') }}" target="_blank" rel="noreferrer noopener" class="onlineGuide">{{ 'CoreHome_ReadMoreOnlineGuide'|translate }}</a>{% endif %} {% if reportLastUpdatedMessage is defined and reportLastUpdatedMessage %}<span class="helpDate">{{ reportLastUpdatedMessage|raw }}</span>{% endif %} </div> <div class="dataTableWrapper"> {% if error is defined %} - <div piwik-alert="danger">{{ error.message }}</div> + <div vue-entry="CoreHome.Alert" severity="danger">{{ error.message }}</div> {% else %} {% if properties.show_header_message is defined and properties.show_header_message is not empty %} <div class='datatableHeaderMessage'>{{ properties.show_header_message | raw }}</div> diff --git a/plugins/CoreHome/templates/_dataTableActions.twig b/plugins/CoreHome/templates/_dataTableActions.twig index 39eec1cae5..deb8d917b2 100644 --- a/plugins/CoreHome/templates/_dataTableActions.twig +++ b/plugins/CoreHome/templates/_dataTableActions.twig @@ -1,156 +1,28 @@ - {% set randomIdForDropdown = random(999999) %} - - {% if properties.show_footer and properties.show_footer_icons %} - - <a class='dropdown-button dropdownConfigureIcon dataTableAction' - href='javascript:;' - data-target='dropdownConfigure{{ randomIdForDropdown }}'><span class="icon-configure"></span></a> - - {% set activeFooterIcon = '' %} - {% set numIcons = 0 %} - {% set visualizationIcons %} - <ul id='dropdownVisualizations{{ randomIdForDropdown }}' class='dropdown-content dataTableFooterIcons'> - {% for footerIconGroup in footerIcons %} - {% for footerIcon in footerIconGroup.buttons|filter(footerIcon => footerIcon.icon) %} - <li> - {% set numIcons = numIcons + 1 %} - {% set isActiveEcommerceView = clientSideParameters.abandonedCarts is defined and - ((footerIcon.id == 'ecommerceOrder' and clientSideParameters.abandonedCarts == 0) or - (footerIcon.id == 'ecommerceAbandonedCart' and clientSideParameters.abandonedCarts == 1)) %} - <a class="{{ footerIconGroup.class }} tableIcon {% if clientSideParameters.viewDataTable == footerIcon.id or isActiveEcommerceView %}activeIcon{% set activeFooterIcon = footerIcon.icon %}{% endif %}" - data-footer-icon-id="{{ footerIcon.id }}"> - {% if footerIcon.icon starts with 'icon-' %} - <span title="{{ footerIcon.title }}" class="{{ footerIcon.icon }}"></span> - {% else %} - <img width="16" height="16" title="{{ footerIcon.title }}" src="{{ footerIcon.icon }}"/> - {% endif %} - {% if footerIcon.title is defined %}<span>{{ footerIcon.title }}</span>{% endif %} - </a> - </li> - {% endfor %} - <li class="divider"></li> - {% endfor %} - </ul> - {% endset %} - - {% if activeFooterIcon and numIcons > 1 %} - <a class="dropdown-button dataTableAction activateVisualizationSelection" - href="javascript:;" - data-target="dropdownVisualizations{{ randomIdForDropdown }}"> - {% if activeFooterIcon starts with 'icon-' %} - <span title="{{ 'CoreHome_ChangeVisualization'|translate|e('html_attr') }}" class="{{ activeFooterIcon }}"></span> - {% else %} - <img title="{{ 'CoreHome_ChangeVisualization'|translate|e('html_attr') }}" width="16" height="16" src="{{ activeFooterIcon }}"/> - {% endif %} - </a> - {{ visualizationIcons|raw }} - {% endif %} - - {% if properties.show_export %} - {% set requestParams = properties.request_parameters_to_modify|json_encode %} - - {% set formats = {"CSV":"CSV","TSV":"TSV (Excel)","XML":"XML","JSON":"Json","HTML":"HTML"} %} - {% if properties.show_export_as_rss_feed %} - {% set formats = formats|merge({"RSS": "RSS"}) %} - {% endif %} - - <a class="dataTableAction activateExportSelection" piwik-report-export - report-title="{{ properties.title|e('html_attr') }}" request-params="{{ requestParams|e('html_attr') }}" - api-method="{{ properties.apiMethodToRequestDataTable }}" report-formats="{{ formats|json_encode|e('html_attr') }}" - href='javascript:;' title="{{ 'General_ExportThisReport'|translate|e('html_attr') }}" - max-filter-limit="{{ properties.max_export_filter_limit|e('html_attr') }}" - ><span class="icon-export"></span></a> - {% endif %} - - {% if properties.show_export_as_image_icon %} - <a class="dataTableAction tableIcon" href="javascript:;" id="dataTableFooterExportAsImageIcon" - onclick="$(this).closest('.dataTable').find('div.jqplot-target').trigger('piwikExportAsImage'); return false;" - title="{{ 'General_ExportAsImage'|translate }}"> - <span class="icon-image"></span> - </a> - {% endif %} - - {% if isPluginLoaded('Annotations') and not properties.hide_annotations_view %} - <a class='dataTableAction annotationView' - href='javascript:;' title="{{ 'Annotations_Annotations'|translate|e('html_attr') }}" - ><span class="icon-annotation"></span></a> - {% endif %} - - {% if properties.show_search %} - <a class='dropdown-button dataTableAction searchAction' - href='javascript:;' title="{{ 'General_Search'|translate|e('html_attr') }}" - ><span class="icon-search"></span> - <span class="icon-close" title="{{ 'CoreHome_CloseSearch'|translate|e('html_attr') }}"></span> - <input id="widgetSearch_{{ properties.report_id }}" - title="{{ 'CoreHome_DataTableHowToSearch'|translate|e('html_attr') }}" - type="text" - class="dataTableSearchInput" /> - </a> - {% endif %} - - {% if properties.datatable_actions|default is not empty %} - {% for action in properties.datatable_actions %} - <a class='dataTableAction {{ action.id|e('html_attr') }}' - href='javascript:;' title="{{ action.title|e('html_attr') }}" - > - {% if action.icon starts with 'icon-' %} - <span class="{{ action.icon }}"></span> - {% else %} - <img width="16" height="16" title="{{ action.title }}" src="{{ action.icon }}"/> - {% endif %} - </a> - {% endfor %} - {% endif %} - - <ul id='dropdownConfigure{{ randomIdForDropdown }}' class='dropdown-content tableConfiguration'> - {% if properties.show_flatten_table %} - <li> - <div class="configItem dataTableFlatten"></div> - </li> - {% if clientSideParameters.flat is defined and clientSideParameters.flat == 1 %} - {% if hasMultipleDimensions|default %} - <li> - <div class="configItem dataTableShowDimensions"></div> - </li> - {% endif %} - <li> - <div class="configItem dataTableIncludeAggregateRows"></div> - </li> - {% endif %} - {% endif %} - {% if not isDataTableEmpty and properties.show_totals_row|default(0) %} - <li> - <div class="configItem dataTableShowTotalsRow"></div> - </li> - {% endif %} - {% if properties.show_exclude_low_population %} - <li> - <div class="configItem dataTableExcludeLowPopulation"></div> - </li> - {% endif %} - {% if properties.show_pivot_by_subtable|default is not empty and not isComparing|default(false) %} - <li> - <div class="configItem dataTablePivotBySubtable"></div> - </li> - {% endif %} - </ul> - - {% if properties.show_periods %} - <a class="dropdown-button dataTableAction activatePeriodsSelection" - href="javascript:;" - title="{{ 'CoreHome_ChangePeriod'|translate|e('html_attr') }}" - data-target="dropdownPeriods{{ randomIdForDropdown }}" - > - <div><span class="icon-calendar"></span><span class="periodName">{{ properties.translations[clientSideParameters.period]|default(clientSideParameters.period) }}</span></div> - </a> - <ul id='dropdownPeriods{{ randomIdForDropdown }}' class='dropdown-content dataTablePeriods'> - {% for selectablePeriod in properties.selectable_periods %} - <li> - <a data-period="{{ selectablePeriod }}" class="tableIcon {% if (clientSideParameters.period|default('')) == selectablePeriod %}activeIcon{% endif %}"> - <span>{{ properties.translations[selectablePeriod]|default(selectablePeriod) }}</span> - </a> - </li> - {% endfor %} - </ul> - {% endif %} - {% endif %} +<div + vue-entry="CoreHome.DataTableActions" + show-footer="{{ properties.show_footer|json_encode }}" + show-footer-icons="{{ properties.show_footer_icons|json_encode }}" + footer-icons="{{ footerIcons|json_encode }}" + report-title="{{ properties.title|json_encode }}" + request-params="{{ properties.request_params_to_modify|default({})|json_encode }}" + api-method-to-request-data-table="{{ properties.apiMethodToRequestDataTable|json_encode }}" + max-filter-limit="{{ properties.max_export_filter_limit|json_encode }}" + show-export="{{ properties.show_export|json_encode }}" + show-export-as-image-icon="{{ properties.show_export_as_image_icon|json_encode }}" + show-annotations="{{ (isPluginLoaded('Annotations') and not properties.hide_annotations_view)|json_encode }}" + show-search="{{ properties.show_search|json_encode }}" + report-id="{{ properties.report_id|json_encode }}" + data-table-actions="{{ properties.datatable_actions|default([])|json_encode }}" + show-flatten-table="{{ properties.show_flatten_table|json_encode }}" + client-side-parameters="{{ clientSideParameters|json_encode }}" + has-multiple-dimensions="{{ hasMultipleDimensions|default(false)|json_encode }}" + is-data-table-empty="{{ isDataTableEmpty|json_encode }}" + show-totals-row="{{ properties.show_totals_row|default(false)|json_encode }}" + show-exclude-low-population="{{ properties.show_exclude_low_population|default(false)|json_encode }}" + show-pivot-by-subtable="{{ (properties.show_pivot_by_subtable|default(false) and not isComparing|default(false))|json_encode }}" + show-periods="{{ properties.show_periods|json_encode }}" + translations="{{ properties.translations|json_encode }}" + view-data-table="{{ clientSideParameters.viewDataTable|json_encode }}" + pivot-dimension-name="{{ properties.pivot_dimension_name|default(null)|json_encode }}" + selectable-periods="{{ properties.selectable_periods|default([])|json_encode }}" +></div> diff --git a/plugins/CoreHome/templates/_dataTableJS.twig b/plugins/CoreHome/templates/_dataTableJS.twig index 7d671c398a..3d2737d2ea 100644 --- a/plugins/CoreHome/templates/_dataTableJS.twig +++ b/plugins/CoreHome/templates/_dataTableJS.twig @@ -1,5 +1,7 @@ -<script type="text/javascript" defer="defer"> +<script type="text/javascript"> $(document).ready(function () { - require('piwik/UI/DataTable').initNewDataTables({{ reportId|json_encode|raw }}); + window.Vue.nextTick(function () { + require('piwik/UI/DataTable').initNewDataTables({{ reportId|json_encode|raw }}); + }); }); </script> diff --git a/plugins/CoreHome/templates/_donate.twig b/plugins/CoreHome/templates/_donate.twig index 06d7a4d836..938d9b73f9 100644 --- a/plugins/CoreHome/templates/_donate.twig +++ b/plugins/CoreHome/templates/_donate.twig @@ -31,11 +31,3 @@ </div> {% endif %} </div> -<script type="text/javascript"> -$(document).ready(function () { - // Note: this will cause problems if more than one donate form is on the page - $('.piwik-donate-slider').each(function () { - $(this).trigger('piwik:changePosition', {position: 1}); - }); -}); -</script> diff --git a/plugins/CoreHome/templates/_headerMessage.twig b/plugins/CoreHome/templates/_headerMessage.twig index 8fb6ec2e9e..28747514f9 100644 --- a/plugins/CoreHome/templates/_headerMessage.twig +++ b/plugins/CoreHome/templates/_headerMessage.twig @@ -11,52 +11,21 @@ {% endset %} {% if (latest_version_available and not isPiwikDemo and hasSomeViewAccess and not isUserIsAnonymous and showUpdateNotificationToUser) or (isSuperUser and isAdminArea is defined and isAdminArea) %} -<div piwik-expand-on-hover - id="header_message" - class="piwikSelector borderedControl {% if not latest_version_available %}header_info{% else %}{% endif %} piwikTopControl {% if latest_version_available %}update_available{% endif %}" - > - - {% if latest_version_available and not isPiwikDemo %} - {% if isMultiServerEnvironment %} - <span class="title" style="cursor:pointer;"> - {{ 'General_NewUpdatePiwikX'|translate(latest_version_available) }} - <span class="icon-warning"></span> - </span> - {% else %} - <a class="title" href="?module=CoreUpdater&action=newVersionAvailable" style="cursor:pointer;"> - {{ 'General_NewUpdatePiwikX'|translate(latest_version_available) }} - <span class="icon-warning"></span> - </a> - {% endif %} - {% elseif isSuperUser and isAdminArea is defined and isAdminArea %} - {% if isInternetEnabled %} - <a class="title">{{ updateCheck|raw }}</a> - {% else %} - <a class="title" href="https://matomo.org/changelog/" target="_blank" rel="noreferrer noopener"> - <span id="updateCheckLinkContainer"> - {{ 'CoreHome_SeeAvailableVersions'|translate }} - </span> - </a> - {% endif %} - {% endif %} - - <div class="dropdown positionInViewport"> - {% if latest_version_available and isSuperUser %} - {% if isMultiServerEnvironment %} - {{ 'CoreHome_OneClickUpdateNotPossibleAsMultiServerEnvironment'|translate("<a rel='noreferrer noopener' href='https://builds.matomo.org/piwik-" ~ latest_version_available ~ ".zip'>builds.matomo.org</a>")|raw }} - {% else %} - {{ 'General_PiwikXIsAvailablePleaseUpdateNow'|translate(latest_version_available,"<br /><a href='index.php?module=CoreUpdater&action=newVersionAvailable'>","</a>","<a target='_blank' rel='noreferrer noopener' href='https://matomo.org/changelog/'>","</a>")|raw }} - {% endif %} - <br /> - {% elseif latest_version_available and not isPiwikDemo and hasSomeViewAccess and not isUserIsAnonymous %} - {% set updateSubject = 'General_NewUpdatePiwikX'|translate(latest_version_available)|e('url') %} - {{ 'General_PiwikXIsAvailablePleaseNotifyPiwikAdmin'|translate("<a target='_blank' rel='noreferrer noopener' href='https://matomo.org/'>Matomo</a> <a target='_blank' rel='noreferrer noopener' href='https://matomo.org/changelog/'>" ~ latest_version_available ~ "</a>", "<a href='mailto:" ~ contactEmail|e('url') ~ "?subject=" ~ updateSubject ~ "'>", "</a>")|raw }} - <br /> - {% endif %} - - {{ 'General_YouAreCurrentlyUsing'|translate(piwik_version) }} - </div> -</div> +<div + vue-entry="CoreHome.VersionInfoHeaderMessage" + latest-version-available="{{ latest_version_available|default(null)|json_encode }}" + is-multi-server-environment="{{ isMultiServerEnvironment|json_encode }}" + is-piwik-demo="{{ isPiwikDemo|json_encode }}" + is-super-user="{{ isSuperUser|json_encode }}" + is-admin-area="{{ isAdminArea|json_encode }}" + is-internet-enabled="{{ isInternetEnabled|json_encode }}" + update-check="{{ updateCheck|default|json_encode }}" + has-some-view-access="{{ hasSomeViewAccess|json_encode }}" + is-anonymous="{{ isUserIsAnonymous|json_encode }}" + contact-email="{{ contactEmail|json_encode }}" + piwik-version="{{ piwik_version|default(null)|json_encode }}" + style="display:inline;" +></div> <span class="icon icon-arrowup"></span> <div style="clear:right"></div> diff --git a/plugins/CoreHome/templates/_indexContent.twig b/plugins/CoreHome/templates/_indexContent.twig index 17a581a115..7fbf202bc5 100644 --- a/plugins/CoreHome/templates/_indexContent.twig +++ b/plugins/CoreHome/templates/_indexContent.twig @@ -12,11 +12,9 @@ {{ ajax.loadingDiv() }} - <div piwik-popover></div> - <div id="content" class="home"> {% if content %}{{ content }}{% endif %} - <div piwik-reporting-page ng-cloak></div> + <div vue-entry="CoreHome.ReportingPage"></div> </div> <div class="clear"></div> </div> diff --git a/plugins/CoreHome/templates/_menu.twig b/plugins/CoreHome/templates/_menu.twig index b1bbc548a1..c2298d4627 100644 --- a/plugins/CoreHome/templates/_menu.twig +++ b/plugins/CoreHome/templates/_menu.twig @@ -49,38 +49,6 @@ {% endif %} {% endfor %} </ul> - <ul id="mobile-left-menu" class="sidenav hide-on-large-only"> - {% for level1,level2 in menu %} - - {% set hasSubmenuItem = false %} - {% for name,urlParameters in level2 %} - {% if name|slice(0,1) != '_' %} - {% set hasSubmenuItem = true %} - {% endif %} - {% endfor %} - - {% if hasSubmenuItem %} - <li class="no-padding"> - <ul class="collapsible collapsible-accordion" piwik-side-nav="nav .activateLeftMenu"> - <li> - <a class="collapsible-header">{{ level1|translate }}<i class="{{ level2._icon|default('icon-arrow-down') }}"></i></a> - <div class="collapsible-body"> - <ul> - {% for name,urlParameters in level2 %} - {% if name|slice(0,1) != '_' %} - <li> - <a title="{{ urlParameters._tooltip|default('')|translate|e('html_attr') }}" target="_self" - href="index.php?{{ urlParameters._url|urlRewriteWithParameters|slice(1) }}">{{ name|translate }}</a> - </li> - {% endif %} - {% endfor %} - </ul> - </div> - </li> - </ul> - {% endif %} - {% endfor %} - </li> - </ul> + <div vue-entry="CoreHome.MobileLeftMenu" menu="{{ menu|json_encode }}"></div> </div> {% endmacro %} diff --git a/plugins/CoreHome/templates/_periodSelect.twig b/plugins/CoreHome/templates/_periodSelect.twig index 673d85106f..c249638a17 100644 --- a/plugins/CoreHome/templates/_periodSelect.twig +++ b/plugins/CoreHome/templates/_periodSelect.twig @@ -1,6 +1,6 @@ <div id="periodString" - piwik-period-selector + vue-entry="CoreHome.PeriodSelector" periods="{{ enabledPeriods|json_encode|e('html_attr') }}" class="borderedControl piwikTopControl" > diff --git a/plugins/CoreHome/templates/_singleReport.twig b/plugins/CoreHome/templates/_singleReport.twig index 6d6ab8a4e6..b13a37d69b 100644 --- a/plugins/CoreHome/templates/_singleReport.twig +++ b/plugins/CoreHome/templates/_singleReport.twig @@ -1,2 +1,2 @@ -<h2 piwik-enriched-headline>{{ title }}</h2> +<h2 vue-entry="CoreHome.EnrichedHeadline">{{ title }}</h2> {{ report|raw }}
\ No newline at end of file diff --git a/plugins/CoreHome/templates/_singleWidget.twig b/plugins/CoreHome/templates/_singleWidget.twig index 9c2cd98bbe..d99d663cc5 100644 --- a/plugins/CoreHome/templates/_singleWidget.twig +++ b/plugins/CoreHome/templates/_singleWidget.twig @@ -1,3 +1,3 @@ -<div piwik-content-block content-title="{{ title|translate|e('html_attr') }}"> - {{ content|raw }} +<div vue-entry="CoreHome.ContentBlock" content-title="{{ title|translate|e('html_attr') }}" vue-components="CoreHome.VueEntryContainer"> + <vue-entry-container html="{{ content }}"></vue-entry-container> </div>
\ No newline at end of file diff --git a/plugins/CoreHome/templates/_siteSelectHeader.twig b/plugins/CoreHome/templates/_siteSelectHeader.twig index fd02c9ec5d..4b34d574f0 100644 --- a/plugins/CoreHome/templates/_siteSelectHeader.twig +++ b/plugins/CoreHome/templates/_siteSelectHeader.twig @@ -1,5 +1,5 @@ {% if not isSingleSite %} <div class="top_bar_sites_selector piwikTopControl"> - <div piwik-siteselector show-selected-site="true" show-all-sites-item="{{ isMultiSitesEnabled ? 'true' : 'false' }}" class="sites_autocomplete"></div> + <div vue-entry="CoreHome.SiteSelector" show-selected-site="true" show-all-sites-item="{{ isMultiSitesEnabled ? 'true' : 'false' }}" class="sites_autocomplete"></div> </div> {% endif %} diff --git a/plugins/CoreHome/templates/getDefaultIndexView.twig b/plugins/CoreHome/templates/getDefaultIndexView.twig index 84c20dd3e3..12c65d935c 100644 --- a/plugins/CoreHome/templates/getDefaultIndexView.twig +++ b/plugins/CoreHome/templates/getDefaultIndexView.twig @@ -15,7 +15,7 @@ <div id="content" class="home"> {% if content %}{{ content }}{% endif %} - <div piwik-reporting-page ng-cloak></div> + <div vue-entry="CoreHome.ReportingPage"></div> </div> <div class="clear"></div> diff --git a/plugins/CoreHome/templates/widgetContainer.twig b/plugins/CoreHome/templates/widgetContainer.twig index f09cbbc23e..59932260f9 100644 --- a/plugins/CoreHome/templates/widgetContainer.twig +++ b/plugins/CoreHome/templates/widgetContainer.twig @@ -1,19 +1,18 @@ <div> - <div piwik-widget - containerid="{{ containerId|e('html_attr') }}" - widgetized="{% if isWidgetized %}true{% else %}false{% endif %}"></div> + <div + vue-entry="CoreHome.Widget" + containerid="{{ containerId|json_encode }}" + widgetized="{% if isWidgetized %}true{% else %}false{% endif %}" + ></div> <script type="text/javascript"> $(function () { - var piwikWidget = $('[piwik-widget][containerid={{ containerId|e('js') }}]'); + var piwikWidget = $('[vue-entry="CoreHome.Widget"][containerid={{ containerId|e('js') }}]'); var isExportedAsWidget = $('body > .widget').length; if (!isExportedAsWidget) { - angular.element(document).injector().invoke(function($compile) { - var scope = angular.element(piwikWidget).scope(); - $compile(piwikWidget)(scope.$new()); - }); + piwikHelper.compileVueEntryComponents(piwikWidget); } }); diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.js b/plugins/CoreHome/vue/dist/CoreHome.umd.js index 9fae34462e..c6e8f6a2f8 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.js @@ -134,14 +134,8 @@ __webpack_require__.d(__webpack_exports__, "useExternalPluginComponent", functio __webpack_require__.d(__webpack_exports__, "DirectiveUtilities", function() { return /* reexport */ directiveUtilities; }); __webpack_require__.d(__webpack_exports__, "debounce", function() { return /* reexport */ debounce; }); __webpack_require__.d(__webpack_exports__, "getFormattedEvolution", function() { return /* reexport */ getFormattedEvolution; }); -__webpack_require__.d(__webpack_exports__, "createAngularJsAdapter", function() { return /* reexport */ createAngularJsAdapter; }); -__webpack_require__.d(__webpack_exports__, "transformAngularJsBoolAttr", function() { return /* reexport */ transformAngularJsBoolAttr; }); -__webpack_require__.d(__webpack_exports__, "transformAngularJsIntAttr", function() { return /* reexport */ transformAngularJsIntAttr; }); -__webpack_require__.d(__webpack_exports__, "removeAngularJsSpecificProperties", function() { return /* reexport */ removeAngularJsSpecificProperties; }); __webpack_require__.d(__webpack_exports__, "clone", function() { return /* reexport */ clone; }); -__webpack_require__.d(__webpack_exports__, "cloneThenApply", function() { return /* reexport */ cloneThenApply; }); __webpack_require__.d(__webpack_exports__, "VueEntryContainer", function() { return /* reexport */ VueEntryContainer; }); -__webpack_require__.d(__webpack_exports__, "activityIndicatorAdapter", function() { return /* reexport */ ActivityIndicator_adapter; }); __webpack_require__.d(__webpack_exports__, "ActivityIndicator", function() { return /* reexport */ ActivityIndicator; }); __webpack_require__.d(__webpack_exports__, "translate", function() { return /* reexport */ translate; }); __webpack_require__.d(__webpack_exports__, "translateOrDefault", function() { return /* reexport */ translateOrDefault; }); @@ -208,6 +202,10 @@ __webpack_require__.d(__webpack_exports__, "ContentIntro", function() { return / __webpack_require__.d(__webpack_exports__, "ContentTable", function() { return /* reexport */ ContentTable; }); __webpack_require__.d(__webpack_exports__, "AjaxForm", function() { return /* reexport */ AjaxForm; }); __webpack_require__.d(__webpack_exports__, "Passthrough", function() { return /* reexport */ Passthrough; }); +__webpack_require__.d(__webpack_exports__, "DataTableActions", function() { return /* reexport */ DataTableActions; }); +__webpack_require__.d(__webpack_exports__, "VersionInfoHeaderMessage", function() { return /* reexport */ VersionInfoHeaderMessage; }); +__webpack_require__.d(__webpack_exports__, "MobileLeftMenu", function() { return /* reexport */ MobileLeftMenu; }); +__webpack_require__.d(__webpack_exports__, "scrollToAnchorInUrl", function() { return /* reexport */ scrollToAnchorInUrl; }); // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js // This file is imported into lib/wc client bundles. @@ -228,9 +226,41 @@ if (typeof window !== 'undefined') { // EXTERNAL MODULE: ./plugins/CoreHome/vue/src/noAdblockFlag.ts var noAdblockFlag = __webpack_require__("2342"); -// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"} -var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf"); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/translate.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +function translate(translationStringId) { + if (!translationStringId) { + return ''; + } + for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + values[_key - 1] = arguments[_key]; + } + + var pkArgs = values; // handle variadic args AND single array of values (to match _pk_translate signature) + + if (values.length === 1 && values[0] && Array.isArray(values[0])) { + pkArgs = values[0]; + } + + return window._pk_translate(translationStringId, pkArgs); // eslint-disable-line +} +function translateOrDefault(translationStringIdOrText) { + if (!translationStringIdOrText || !window.piwik_translations[translationStringIdOrText]) { + return translationStringIdOrText; + } + + for (var _len2 = arguments.length, values = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + values[_key2 - 1] = arguments[_key2]; + } + + return translate.apply(void 0, [translationStringIdOrText].concat(values)); +} // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Periods.ts function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -334,129 +364,6 @@ var Periods = /*#__PURE__*/function () { }(); /* harmony default export */ var Periods_Periods = (new Periods()); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Matomo/Matomo.ts -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } - -function _nonIterableSpread() { 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 _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } - -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } - -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } - -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -var originalTitle; -var _window = window, - Matomo_piwik = _window.piwik, - Matomo_broadcast = _window.broadcast, - Matomo_piwikHelper = _window.piwikHelper; -Matomo_piwik.helper = Matomo_piwikHelper; -Matomo_piwik.broadcast = Matomo_broadcast; - -Matomo_piwik.updateDateInTitle = function updateDateInTitle(date, period) { - if (!$('.top_controls #periodString').length) { - return; - } // Cache server-rendered page title - - - originalTitle = originalTitle || document.title; - - if (originalTitle.indexOf(Matomo_piwik.siteName) === 0) { - var dateString = " - ".concat(Periods_Periods.parse(period, date).getPrettyString(), " "); - document.title = "".concat(Matomo_piwik.siteName).concat(dateString).concat(originalTitle.slice(Matomo_piwik.siteName.length)); - } -}; - -Matomo_piwik.hasUserCapability = function hasUserCapability(capability) { - return window.angular.isArray(Matomo_piwik.userCapabilities) && Matomo_piwik.userCapabilities.indexOf(capability) !== -1; -}; - -Matomo_piwik.on = function addMatomoEventListener(eventName, listener) { - function listenerWrapper(evt) { - listener.apply(void 0, _toConsumableArray(evt.detail)); // eslint-disable-line - } - - listener.wrapper = listenerWrapper; - window.addEventListener(eventName, listenerWrapper); -}; - -Matomo_piwik.off = function removeMatomoEventListener(eventName, listener) { - if (listener.wrapper) { - window.removeEventListener(eventName, listener.wrapper); - } -}; - -Matomo_piwik.postEventNoEmit = function postEventNoEmit(eventName) { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var event = new CustomEvent(eventName, { - detail: args - }); - window.dispatchEvent(event); -}; - -Matomo_piwik.postEvent = function postMatomoEvent(eventName) { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - - Matomo_piwik.postEventNoEmit.apply(Matomo_piwik, [eventName].concat(args)); // required until angularjs is removed - - window.angular.element(function () { - var $rootScope = Matomo_piwik.helper.getAngularDependency('$rootScope'); // eslint-disable-line - - $rootScope.$oldEmit.apply($rootScope, [eventName].concat(args)); - }); -}; - -var Matomo = Matomo_piwik; -/* harmony default export */ var Matomo_Matomo = (Matomo); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/translate.ts -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -function translate(translationStringId) { - if (!translationStringId) { - return ''; - } - - for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - values[_key - 1] = arguments[_key]; - } - - var pkArgs = values; // handle variadic args AND single array of values (to match _pk_translate signature) - - if (values.length === 1 && values[0] && Array.isArray(values[0])) { - pkArgs = values[0]; - } - - return window._pk_translate(translationStringId, pkArgs); // eslint-disable-line -} -function translateOrDefault(translationStringIdOrText) { - if (!translationStringIdOrText || !window.piwik_translations[translationStringIdOrText]) { - return translationStringIdOrText; - } - - for (var _len2 = arguments.length, values = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - values[_key2 - 1] = arguments[_key2]; - } - - return translate.apply(void 0, [translationStringIdOrText].concat(values)); -} // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/utilities.ts /*! * Matomo - free/libre analytics platform @@ -534,14 +441,275 @@ function todayIsInRange(dateRange) { return false; } +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Day.ts +function Day_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function Day_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function Day_createClass(Constructor, protoProps, staticProps) { if (protoProps) Day_defineProperties(Constructor.prototype, protoProps); if (staticProps) Day_defineProperties(Constructor, staticProps); return Constructor; } + +function Day_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + + + + +var Day_DayPeriod = /*#__PURE__*/function () { + function DayPeriod(dateInPeriod) { + Day_classCallCheck(this, DayPeriod); + + Day_defineProperty(this, "dateInPeriod", void 0); + + this.dateInPeriod = dateInPeriod; + } + + Day_createClass(DayPeriod, [{ + key: "getPrettyString", + value: function getPrettyString() { + return format(this.dateInPeriod); + } + }, { + key: "getDateRange", + value: function getDateRange() { + return [new Date(this.dateInPeriod.getTime()), new Date(this.dateInPeriod.getTime())]; + } + }, { + key: "containsToday", + value: function containsToday() { + return todayIsInRange(this.getDateRange()); + } + }], [{ + key: "parse", + value: function parse(strDate) { + return new DayPeriod(parseDate(strDate)); + } + }, { + key: "getDisplayText", + value: function getDisplayText() { + return translate('Intl_PeriodDay'); + } + }]); + + return DayPeriod; +}(); + + +Periods_Periods.addCustomPeriod('day', Day_DayPeriod); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Week.ts +function Week_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function Week_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function Week_createClass(Constructor, protoProps, staticProps) { if (protoProps) Week_defineProperties(Constructor.prototype, protoProps); if (staticProps) Week_defineProperties(Constructor, staticProps); return Constructor; } + +function Week_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + + + + +var Week_WeekPeriod = /*#__PURE__*/function () { + function WeekPeriod(dateInPeriod) { + Week_classCallCheck(this, WeekPeriod); + + Week_defineProperty(this, "dateInPeriod", void 0); + + this.dateInPeriod = dateInPeriod; + } + + Week_createClass(WeekPeriod, [{ + key: "getPrettyString", + value: function getPrettyString() { + var weekDates = this.getDateRange(); + var startWeek = format(weekDates[0]); + var endWeek = format(weekDates[1]); + return translate('General_DateRangeFromTo', [startWeek, endWeek]); + } + }, { + key: "getDateRange", + value: function getDateRange() { + var daysToMonday = (this.dateInPeriod.getDay() + 6) % 7; + var startWeek = new Date(this.dateInPeriod.getTime()); + startWeek.setDate(this.dateInPeriod.getDate() - daysToMonday); + var endWeek = new Date(startWeek.getTime()); + endWeek.setDate(startWeek.getDate() + 6); + return [startWeek, endWeek]; + } + }, { + key: "containsToday", + value: function containsToday() { + return todayIsInRange(this.getDateRange()); + } + }], [{ + key: "parse", + value: function parse(strDate) { + return new WeekPeriod(parseDate(strDate)); + } + }, { + key: "getDisplayText", + value: function getDisplayText() { + return translate('Intl_PeriodWeek'); + } + }]); + + return WeekPeriod; +}(); + + +Periods_Periods.addCustomPeriod('week', Week_WeekPeriod); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Month.ts +function Month_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function Month_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function Month_createClass(Constructor, protoProps, staticProps) { if (protoProps) Month_defineProperties(Constructor.prototype, protoProps); if (staticProps) Month_defineProperties(Constructor, staticProps); return Constructor; } + +function Month_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + + + + +var Month_MonthPeriod = /*#__PURE__*/function () { + function MonthPeriod(dateInPeriod) { + Month_classCallCheck(this, MonthPeriod); + + Month_defineProperty(this, "dateInPeriod", void 0); + + this.dateInPeriod = dateInPeriod; + } + + Month_createClass(MonthPeriod, [{ + key: "getPrettyString", + value: function getPrettyString() { + var month = translate("Intl_Month_Long_StandAlone_".concat(this.dateInPeriod.getMonth() + 1)); + return "".concat(month, " ").concat(this.dateInPeriod.getFullYear()); + } + }, { + key: "getDateRange", + value: function getDateRange() { + var startMonth = new Date(this.dateInPeriod.getTime()); + startMonth.setDate(1); + var endMonth = new Date(this.dateInPeriod.getTime()); + endMonth.setDate(1); + endMonth.setMonth(endMonth.getMonth() + 1); + endMonth.setDate(0); + return [startMonth, endMonth]; + } + }, { + key: "containsToday", + value: function containsToday() { + return todayIsInRange(this.getDateRange()); + } + }], [{ + key: "parse", + value: function parse(strDate) { + return new MonthPeriod(parseDate(strDate)); + } + }, { + key: "getDisplayText", + value: function getDisplayText() { + return translate('Intl_PeriodMonth'); + } + }]); + + return MonthPeriod; +}(); + + +Periods_Periods.addCustomPeriod('month', Month_MonthPeriod); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Year.ts +function Year_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function Year_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function Year_createClass(Constructor, protoProps, staticProps) { if (protoProps) Year_defineProperties(Constructor.prototype, protoProps); if (staticProps) Year_defineProperties(Constructor, staticProps); return Constructor; } + +function Year_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + + + + +var Year_YearPeriod = /*#__PURE__*/function () { + function YearPeriod(dateInPeriod) { + Year_classCallCheck(this, YearPeriod); + + Year_defineProperty(this, "dateInPeriod", void 0); + + this.dateInPeriod = dateInPeriod; + } + + Year_createClass(YearPeriod, [{ + key: "getPrettyString", + value: function getPrettyString() { + return this.dateInPeriod.getFullYear().toString(); + } + }, { + key: "getDateRange", + value: function getDateRange() { + var startYear = new Date(this.dateInPeriod.getTime()); + startYear.setMonth(0); + startYear.setDate(1); + var endYear = new Date(this.dateInPeriod.getTime()); + endYear.setMonth(12); + endYear.setDate(0); + return [startYear, endYear]; + } + }, { + key: "containsToday", + value: function containsToday() { + return todayIsInRange(this.getDateRange()); + } + }], [{ + key: "parse", + value: function parse(strDate) { + return new YearPeriod(parseDate(strDate)); + } + }, { + key: "getDisplayText", + value: function getDisplayText() { + return translate('Intl_PeriodYear'); + } + }]); + + return YearPeriod; +}(); + + +Periods_Periods.addCustomPeriod('year', Year_YearPeriod); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Range.ts -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || Range_unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { 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 Range_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Range_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Range_arrayLikeToArray(o, minLen); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function Range_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } @@ -778,40 +946,21 @@ var Range_RangePeriod = /*#__PURE__*/function () { Periods_Periods.addCustomPeriod('range', Range_RangePeriod); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Periods.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 - */ - - +// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"} +var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf"); -window.piwik.addCustomPeriod = Periods_Periods.addCustomPeriod.bind(Periods_Periods); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Matomo/Matomo.ts +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || Matomo_unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function piwikPeriods() { - return { - getAllLabels: Periods_Periods.getAllLabels.bind(Periods_Periods), - isRecognizedPeriod: Periods_Periods.isRecognizedPeriod.bind(Periods_Periods), - get: Periods_Periods.get.bind(Periods_Periods), - parse: Periods_Periods.parse.bind(Periods_Periods), - parseDate: parseDate, - format: format, - RangePeriod: Range_RangePeriod, - todayIsInRange: todayIsInRange - }; -} +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -window.angular.module('piwikApp.service').factory('piwikPeriods', piwikPeriods); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Day.ts -function Day_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +function Matomo_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Matomo_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Matomo_arrayLikeToArray(o, minLen); } -function Day_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function Day_createClass(Constructor, protoProps, staticProps) { if (protoProps) Day_defineProperties(Constructor.prototype, protoProps); if (staticProps) Day_defineProperties(Constructor, staticProps); return Constructor; } +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return Matomo_arrayLikeToArray(arr); } -function Day_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function Matomo_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } /*! * Matomo - free/libre analytics platform @@ -820,251 +969,60 @@ function Day_defineProperty(obj, key, value) { if (key in obj) { Object.definePr * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +var originalTitle; +var _window = window, + piwik = _window.piwik, + Matomo_broadcast = _window.broadcast, + Matomo_piwikHelper = _window.piwikHelper; +piwik.helper = Matomo_piwikHelper; +piwik.broadcast = Matomo_broadcast; +piwik.updateDateInTitle = function updateDateInTitle(date, period) { + if (!$('.top_controls #periodString').length) { + return; + } // Cache server-rendered page title -var Day_DayPeriod = /*#__PURE__*/function () { - function DayPeriod(dateInPeriod) { - Day_classCallCheck(this, DayPeriod); - - Day_defineProperty(this, "dateInPeriod", void 0); + originalTitle = originalTitle || document.title; - this.dateInPeriod = dateInPeriod; + if (originalTitle.indexOf(piwik.siteName) === 0) { + var dateString = " - ".concat(Periods_Periods.parse(period, date).getPrettyString(), " "); + document.title = "".concat(piwik.siteName).concat(dateString).concat(originalTitle.slice(piwik.siteName.length)); } +}; - Day_createClass(DayPeriod, [{ - key: "getPrettyString", - value: function getPrettyString() { - return format(this.dateInPeriod); - } - }, { - key: "getDateRange", - value: function getDateRange() { - return [new Date(this.dateInPeriod.getTime()), new Date(this.dateInPeriod.getTime())]; - } - }, { - key: "containsToday", - value: function containsToday() { - return todayIsInRange(this.getDateRange()); - } - }], [{ - key: "parse", - value: function parse(strDate) { - return new DayPeriod(parseDate(strDate)); - } - }, { - key: "getDisplayText", - value: function getDisplayText() { - return translate('Intl_PeriodDay'); - } - }]); - - return DayPeriod; -}(); - - -Periods_Periods.addCustomPeriod('day', Day_DayPeriod); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Week.ts -function Week_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function Week_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function Week_createClass(Constructor, protoProps, staticProps) { if (protoProps) Week_defineProperties(Constructor.prototype, protoProps); if (staticProps) Week_defineProperties(Constructor, staticProps); return Constructor; } - -function Week_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - - - - -var Week_WeekPeriod = /*#__PURE__*/function () { - function WeekPeriod(dateInPeriod) { - Week_classCallCheck(this, WeekPeriod); - - Week_defineProperty(this, "dateInPeriod", void 0); +piwik.hasUserCapability = function hasUserCapability(capability) { + return window.angular.isArray(piwik.userCapabilities) && piwik.userCapabilities.indexOf(capability) !== -1; +}; - this.dateInPeriod = dateInPeriod; +piwik.on = function addMatomoEventListener(eventName, listener) { + function listenerWrapper(evt) { + listener.apply(void 0, _toConsumableArray(evt.detail)); // eslint-disable-line } - Week_createClass(WeekPeriod, [{ - key: "getPrettyString", - value: function getPrettyString() { - var weekDates = this.getDateRange(); - var startWeek = format(weekDates[0]); - var endWeek = format(weekDates[1]); - return translate('General_DateRangeFromTo', [startWeek, endWeek]); - } - }, { - key: "getDateRange", - value: function getDateRange() { - var daysToMonday = (this.dateInPeriod.getDay() + 6) % 7; - var startWeek = new Date(this.dateInPeriod.getTime()); - startWeek.setDate(this.dateInPeriod.getDate() - daysToMonday); - var endWeek = new Date(startWeek.getTime()); - endWeek.setDate(startWeek.getDate() + 6); - return [startWeek, endWeek]; - } - }, { - key: "containsToday", - value: function containsToday() { - return todayIsInRange(this.getDateRange()); - } - }], [{ - key: "parse", - value: function parse(strDate) { - return new WeekPeriod(parseDate(strDate)); - } - }, { - key: "getDisplayText", - value: function getDisplayText() { - return translate('Intl_PeriodWeek'); - } - }]); - - return WeekPeriod; -}(); - - -Periods_Periods.addCustomPeriod('week', Week_WeekPeriod); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Month.ts -function Month_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function Month_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function Month_createClass(Constructor, protoProps, staticProps) { if (protoProps) Month_defineProperties(Constructor.prototype, protoProps); if (staticProps) Month_defineProperties(Constructor, staticProps); return Constructor; } - -function Month_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - - - - -var Month_MonthPeriod = /*#__PURE__*/function () { - function MonthPeriod(dateInPeriod) { - Month_classCallCheck(this, MonthPeriod); - - Month_defineProperty(this, "dateInPeriod", void 0); + listener.wrapper = listenerWrapper; + window.addEventListener(eventName, listenerWrapper); +}; - this.dateInPeriod = dateInPeriod; +piwik.off = function removeMatomoEventListener(eventName, listener) { + if (listener.wrapper) { + window.removeEventListener(eventName, listener.wrapper); } +}; - Month_createClass(MonthPeriod, [{ - key: "getPrettyString", - value: function getPrettyString() { - var month = translate("Intl_Month_Long_StandAlone_".concat(this.dateInPeriod.getMonth() + 1)); - return "".concat(month, " ").concat(this.dateInPeriod.getFullYear()); - } - }, { - key: "getDateRange", - value: function getDateRange() { - var startMonth = new Date(this.dateInPeriod.getTime()); - startMonth.setDate(1); - var endMonth = new Date(this.dateInPeriod.getTime()); - endMonth.setDate(1); - endMonth.setMonth(endMonth.getMonth() + 1); - endMonth.setDate(0); - return [startMonth, endMonth]; - } - }, { - key: "containsToday", - value: function containsToday() { - return todayIsInRange(this.getDateRange()); - } - }], [{ - key: "parse", - value: function parse(strDate) { - return new MonthPeriod(parseDate(strDate)); - } - }, { - key: "getDisplayText", - value: function getDisplayText() { - return translate('Intl_PeriodMonth'); - } - }]); - - return MonthPeriod; -}(); - - -Periods_Periods.addCustomPeriod('month', Month_MonthPeriod); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Year.ts -function Year_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function Year_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function Year_createClass(Constructor, protoProps, staticProps) { if (protoProps) Year_defineProperties(Constructor.prototype, protoProps); if (staticProps) Year_defineProperties(Constructor, staticProps); return Constructor; } - -function Year_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - - - - -var Year_YearPeriod = /*#__PURE__*/function () { - function YearPeriod(dateInPeriod) { - Year_classCallCheck(this, YearPeriod); - - Year_defineProperty(this, "dateInPeriod", void 0); - - this.dateInPeriod = dateInPeriod; +piwik.postEvent = function postMatomoEvent(eventName) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; } - Year_createClass(YearPeriod, [{ - key: "getPrettyString", - value: function getPrettyString() { - return this.dateInPeriod.getFullYear().toString(); - } - }, { - key: "getDateRange", - value: function getDateRange() { - var startYear = new Date(this.dateInPeriod.getTime()); - startYear.setMonth(0); - startYear.setDate(1); - var endYear = new Date(this.dateInPeriod.getTime()); - endYear.setMonth(12); - endYear.setDate(0); - return [startYear, endYear]; - } - }, { - key: "containsToday", - value: function containsToday() { - return todayIsInRange(this.getDateRange()); - } - }], [{ - key: "parse", - value: function parse(strDate) { - return new YearPeriod(parseDate(strDate)); - } - }, { - key: "getDisplayText", - value: function getDisplayText() { - return translate('Intl_PeriodYear'); - } - }]); - - return YearPeriod; -}(); - + var event = new CustomEvent(eventName, { + detail: args + }); + window.dispatchEvent(event); +}; -Periods_Periods.addCustomPeriod('year', Year_YearPeriod); +var Matomo = piwik; +/* harmony default export */ var Matomo_Matomo = (Matomo); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/index.ts /*! * Matomo - free/libre analytics platform @@ -1079,7 +1037,6 @@ Periods_Periods.addCustomPeriod('year', Year_YearPeriod); - // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts function MatomoUrl_slicedToArray(arr, i) { return MatomoUrl_arrayWithHoles(arr) || MatomoUrl_iterableToArrayLimit(arr, i) || MatomoUrl_unsupportedIterableToArray(arr, i) || MatomoUrl_nonIterableRest(); } @@ -1156,33 +1113,34 @@ var MatomoUrl_MatomoUrl = /*#__PURE__*/function () { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(Object.assign(Object.assign({}, _this.urlParsed.value), _this.hashParsed.value)); })); - this.url.value = new URL(window.location.href); // $locationChangeSuccess is triggered before angularjs changes actual window the hash, so we - // have to hook into this method if we want our event handlers to execute before other angularjs - // handlers (like the reporting page one) - - Matomo_Matomo.on('$locationChangeSuccess', function (absUrl) { - _this.url.value = new URL(absUrl); + this.url.value = new URL(window.location.href); + window.addEventListener('hashchange', function (event) { + _this.url.value = new URL(event.newURL); }); this.updatePeriodParamsFromUrl(); } MatomoUrl_createClass(MatomoUrl, [{ key: "updateHashToUrl", - value: function updateHashToUrl(url) { - var $location = Matomo_Matomo.helper.getAngularDependency('$location'); - $location.url(url); - var $timeout = Matomo_Matomo.helper.getAngularDependency('$timeout'); - $timeout(); + value: function updateHashToUrl(urlWithoutLeadingHash) { + var wholeHash = "#".concat(urlWithoutLeadingHash); + + if (window.location.hash === wholeHash) { + // trigger event manually since the url is the same + window.dispatchEvent(new HashChangeEvent('hashchange', { + newURL: window.location.href, + oldURL: window.location.href + })); + } else { + window.location.hash = wholeHash; + } } }, { key: "updateHash", value: function updateHash(params) { var modifiedParams = this.getFinalHashParams(params); var serializedParams = this.stringify(modifiedParams); - var $location = Matomo_Matomo.helper.getAngularDependency('$location'); - $location.search(serializedParams); - var $timeout = Matomo_Matomo.helper.getAngularDependency('$timeout'); - $timeout(); + this.updateHashToUrl("?".concat(serializedParams)); } }, { key: "updateUrl", @@ -1216,7 +1174,7 @@ var MatomoUrl_MatomoUrl = /*#__PURE__*/function () { }, { key: "updateLocation", value: function updateLocation(params) { - if (Matomo_Matomo.helper.isAngularRenderingThePage()) { + if (Matomo_Matomo.helper.isReportingPage()) { this.updateHash(params); return; } @@ -1252,11 +1210,10 @@ var MatomoUrl_MatomoUrl = /*#__PURE__*/function () { value = _ref2[1]; return value !== '' && value !== null && value !== undefined; - })); // TODO: using $ since URLSearchParams does not handle array params the way Matomo uses them + })); // using jQuery since URLSearchParams does not handle array params the way Matomo uses them return $.param(searchWithoutEmpty).replace(/%5B%5D/g, '[]') // some browsers treat URLs w/ date=a,b differently from date=a%2Cb, causing multiple - // entries to show up in the browser history. this has a compounding effect w/ angular.js, - // which when the back button is pressed to effectively abort the back navigation. + // entries to show up in the browser history. .replace(/%2C/g, ',') // jquery seems to encode space characters as '+', but certain parts of matomo won't // decode it correctly, so we make sure to use %20 instead .replace(/\+/g, '%20'); @@ -1298,71 +1255,6 @@ var MatomoUrl_MatomoUrl = /*#__PURE__*/function () { var instance = new MatomoUrl_MatomoUrl(); /* harmony default export */ var src_MatomoUrl_MatomoUrl = (instance); MatomoUrl_piwik.updatePeriodParamsFromUrl = instance.updatePeriodParamsFromUrl.bind(instance); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.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 piwikUrl() { - var model = { - getSearchParam: src_MatomoUrl_MatomoUrl.getSearchParam.bind(src_MatomoUrl_MatomoUrl) - }; - return model; -} - -window.angular.module('piwikApp.service').service('piwikUrl', piwikUrl); // make sure $location is initialized early - -window.angular.module('piwikApp.service').run(['$location', function () { - return null; -}]); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Matomo/Matomo.adapter.ts -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - - -function piwikService() { - return Matomo_Matomo; -} - -window.angular.module('piwikApp.service').service('piwik', piwikService); - -function initPiwikService(piwik, $rootScope) { - // overwrite $rootScope so all events also go through Matomo.postEvent(...) too. - $rootScope.$oldEmit = $rootScope.$emit; // eslint-disable-line - - $rootScope.$emit = function emitWrapper(name) { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - Matomo_Matomo.postEventNoEmit.apply(Matomo_Matomo, [name].concat(args)); - return this.$oldEmit.apply(this, [name].concat(args)); // eslint-disable-line - }; - - $rootScope.$oldBroadcast = $rootScope.$broadcast; // eslint-disable-line - - $rootScope.$broadcast = function broadcastWrapper(name) { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - - Matomo_Matomo.postEventNoEmit.apply(Matomo_Matomo, [name].concat(args)); - return this.$oldBroadcast.apply(this, [name].concat(args)); // eslint-disable-line - }; - - $rootScope.$on('$locationChangeSuccess', piwik.updatePeriodParamsFromUrl); -} - -initPiwikService.$inject = ['piwik', '$rootScope']; -window.angular.module('piwikApp.service').run(initPiwikService); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } @@ -1765,12 +1657,6 @@ var AjaxHelper_AjaxHelper = /*#__PURE__*/function () { this.requestHandle = this.buildAjaxCall(); window.globalAjaxQueue.push(this.requestHandle); - var $timeout = null; - - try { - $timeout = Matomo_Matomo.helper.getAngularDependency('$timeout'); - } catch (e) {// ignore - } if (this.abortController) { this.abortController.signal.addEventListener('abort', function () { @@ -1802,10 +1688,6 @@ var AjaxHelper_AjaxHelper = /*#__PURE__*/function () { console.log("Warning: the ".concat($.param(_this2.getParams), " request failed!")); reject(xhr); - }).done(function () { - if ($timeout) { - $timeout(); // trigger digest - } }); }); return result; @@ -2221,12 +2103,6 @@ var AjaxHelper_AjaxHelper = /*#__PURE__*/function () { // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.adapter.ts window.ajaxHelper = AjaxHelper_AjaxHelper; - -function ajaxQueue() { - return window.globalAjaxQueue; -} - -window.angular.module('piwikApp.service').service('globalAjaxQueue', ajaxQueue); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/PopoverHandler/PopoverHandler.ts function PopoverHandler_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -2333,36 +2209,97 @@ var PopoverHandler_PopoverHandler = /*#__PURE__*/function () { }(); /* harmony default export */ var src_PopoverHandler_PopoverHandler = (new PopoverHandler_PopoverHandler()); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Alert/Alert.vue?vue&type=template&id=c3863ae2 -function Alertvue_type_template_id_c3863ae2_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/CookieHelper/CookieHelper.ts +/* + * General utils for managing cookies in Typescript. + */ +// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types +function setCookie(name, val, seconds) { + var date = new Date(); // set default day to 3 days + if (!seconds) { + // eslint-disable-next-line no-param-reassign + seconds = 3 * 24 * 60 * 1000; + } // Set it expire in n days -function Alertvue_type_template_id_c3863ae2_render(_ctx, _cache, $props, $setup, $data, $options) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { - class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["alert", Alertvue_type_template_id_c3863ae2_defineProperty({}, "alert-".concat(_ctx.severity), true)]) - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default")], 2); -} -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.vue?vue&type=template&id=c3863ae2 -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Alert/Alert.vue?vue&type=script&lang=ts + date.setTime(date.getTime() + seconds); // Set it -/* harmony default export */ var Alertvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - severity: { - type: String, - required: true + document.cookie = "".concat(name, "=").concat(val, "; expires=").concat(date.toUTCString(), "; path=/"); +} // eslint-disable-next-line consistent-return,@typescript-eslint/explicit-module-boundary-types + +function getCookie(name) { + var value = "; ".concat(document.cookie); + var parts = value.split("; ".concat(name, "=")); // if cookie not exist return null + // eslint-disable-next-line eqeqeq + + if (parts.length == 2) { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + var data = parts.pop().split(';').shift(); + + if (typeof data !== 'undefined') { + return data; } } -})); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.vue + return null; +} // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types + +function deleteCookie(name) { + var date = new Date(); // Set it expire in -1 days + date.setTime(date.getTime() + -1 * 24 * 60 * 60 * 1000); // Set it -Alertvue_type_script_lang_ts.render = Alertvue_type_template_id_c3863ae2_render + document.cookie = "".concat(name, "=; expires=").concat(date.toUTCString(), "; path=/"); +} +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/zenMode.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ -/* harmony default export */ var Alert = (Alertvue_type_script_lang_ts); + + +var zenMode_window = window, + zenMode_$ = zenMode_window.$; + +function handleZenMode() { + var zenMode = !!parseInt(getCookie('zenMode'), 10); + var iconSwitcher = zenMode_$('.top_controls .icon-arrowup'); + + function updateZenMode() { + if (zenMode) { + zenMode_$('body').addClass('zenMode'); + iconSwitcher.addClass('icon-arrowdown').removeClass('icon-arrowup'); + iconSwitcher.prop('title', translate('CoreHome_ExitZenMode')); + } else { + zenMode_$('body').removeClass('zenMode'); + iconSwitcher.removeClass('icon-arrowdown').addClass('icon-arrowup'); + iconSwitcher.prop('title', translate('CoreHome_EnterZenMode')); + } + } + + Matomo_Matomo.helper.registerShortcut('z', translate('CoreHome_ShortcutZenMode'), function (event) { + if (event.altKey) { + return; + } + + zenMode = !zenMode; + setCookie('zenMode', zenMode ? '1' : '0'); + updateZenMode(); + }); + iconSwitcher.click(function () { + window.Mousetrap.trigger('z'); + }); + updateZenMode(); +} + +Matomo_Matomo.on('Matomo.topControlsRendered', function () { + handleZenMode(); +}); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/createVueApp.ts /*! * Matomo - free/libre analytics platform @@ -2507,21 +2444,44 @@ function useExternalPluginComponent(plugin, component) { }); }); } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/createAngularJsAdapter.ts -function createAngularJsAdapter_slicedToArray(arr, i) { return createAngularJsAdapter_arrayWithHoles(arr) || createAngularJsAdapter_iterableToArrayLimit(arr, i) || createAngularJsAdapter_unsupportedIterableToArray(arr, i) || createAngularJsAdapter_nonIterableRest(); } - -function createAngularJsAdapter_nonIterableRest() { 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 createAngularJsAdapter_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return createAngularJsAdapter_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return createAngularJsAdapter_arrayLikeToArray(o, minLen); } +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/directiveUtilities.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 getRef(expander, binding) { + var _binding$instance; -function createAngularJsAdapter_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + return expander instanceof HTMLElement ? expander : (_binding$instance = binding.instance) === null || _binding$instance === void 0 ? void 0 : _binding$instance.$refs[expander]; +} -function createAngularJsAdapter_iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } +/* harmony default export */ var directiveUtilities = ({ + getRef: getRef +}); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/debounce.ts +var DEFAULT_DEBOUNCE_DELAY = 300; +function debounce(fn) { + var delayInMs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_DEBOUNCE_DELAY; + var timeout; + return function wrapper() { + var _this = this; -function createAngularJsAdapter_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } -function createAngularJsAdapter_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { createAngularJsAdapter_typeof = function _typeof(obj) { return typeof obj; }; } else { createAngularJsAdapter_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return createAngularJsAdapter_typeof(obj); } + if (timeout) { + clearTimeout(timeout); + } + timeout = setTimeout(function () { + fn.call.apply(fn, [_this].concat(args)); + }, delayInMs); + }; +} +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/getFormattedEvolution.ts /*! * Matomo - free/libre analytics platform * @@ -2529,309 +2489,163 @@ function createAngularJsAdapter_typeof(obj) { "@babel/helpers - typeof"; if (typ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -/* eslint-disable @typescript-eslint/no-explicit-any */ - - +function calculateEvolution(currentValue, pastValue) { + var pastValueParsed = parseInt(pastValue, 10); + var currentValueParsed = parseInt(currentValue, 10) - pastValueParsed; + var evolution; -var transcludeCounter = 0; + if (currentValueParsed === 0 || Number.isNaN(currentValueParsed)) { + evolution = 0; + } else if (pastValueParsed === 0 || Number.isNaN(pastValueParsed)) { + evolution = 100; + } else { + evolution = currentValueParsed / pastValueParsed * 100; + } -function toKebabCase(arg) { - return arg.substring(0, 1).toLowerCase() + arg.substring(1).replace(/[A-Z]/g, function (s) { - return "-".concat(s.toLowerCase()); - }); + return evolution; } -function toAngularJsCamelCase(arg) { - return arg.substring(0, 1).toLowerCase() + arg.substring(1).replace(/-([a-z])/g, function (s, p) { - return p.toUpperCase(); - }); +function formatEvolution(evolution) { + return "".concat(evolution > 0 ? Matomo_Matomo.numbers.symbolPlus : '').concat(Math.round(evolution), "}%"); } -function removeAngularJsSpecificProperties(newValue) { - if (createAngularJsAdapter_typeof(newValue) === 'object' && newValue !== null && Object.getPrototypeOf(newValue) === Object.prototype) { - return Object.fromEntries(Object.entries(newValue).filter(function (pair) { - return !/^\$/.test(pair[0]); - })); - } - - return newValue; +function getFormattedEvolution(currentValue, pastValue) { + var evolution = calculateEvolution(currentValue, pastValue); + return formatEvolution(evolution); } -function createAngularJsAdapter(options) { - var component = options.component; - var require = options.require, - _options$scope = options.scope, - scope = _options$scope === void 0 ? {} : _options$scope, - _options$events = options.events, - events = _options$events === void 0 ? {} : _options$events, - $inject = options.$inject, - directiveName = options.directiveName, - transclude = options.transclude, - mountPointFactory = options.mountPointFactory, - postCreate = options.postCreate, - noScope = options.noScope, - _options$restrict = options.restrict, - restrict = _options$restrict === void 0 ? 'A' : _options$restrict, - priority = options.priority, - replace = options.replace; - var componentRef = component; - - if (typeof componentRef.plugin === 'string') { - component = useExternalPluginComponent(componentRef.plugin, componentRef.component); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/clone.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 clone(p) { + if (typeof p === 'undefined') { + return p; } - var currentTranscludeCounter = transcludeCounter; - - if (transclude) { - transcludeCounter += 1; - } + return JSON.parse(JSON.stringify(p)); +} +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/VueEntryContainer/VueEntryContainer.vue?vue&type=template&id=54e7e876 - var vueToAngular = {}; - var angularJsScope = {}; - Object.entries(scope).forEach(function (_ref) { - var _ref2 = createAngularJsAdapter_slicedToArray(_ref, 2), - scopeVarName = _ref2[0], - info = _ref2[1]; +var _hoisted_1 = { + ref: "root" +}; +function VueEntryContainervue_type_template_id_54e7e876_render(_ctx, _cache, $props, $setup, $data, $options) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_1, [_ctx.componentWrapper ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDynamicComponent"])(_ctx.componentWrapper), { + key: 0 + })) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 512); +} +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/VueEntryContainer/VueEntryContainer.vue?vue&type=template&id=54e7e876 - if (!info.vue) { - info.vue = scopeVarName; - } +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/VueEntryContainer/VueEntryContainer.vue?vue&type=script&lang=ts - if (info.angularJsBind) { - angularJsScope[scopeVarName] = info.angularJsBind; - } - vueToAngular[info.vue] = scopeVarName; - }); +/* harmony default export */ var VueEntryContainervue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + html: String + }, + mounted: function mounted() { + Matomo_Matomo.helper.compileVueEntryComponents(this.$refs.root); + }, + beforeUnmount: function beforeUnmount() { + Matomo_Matomo.helper.destroyVueComponent(this.$refs.root); + }, + computed: { + componentWrapper: function componentWrapper() { + if (!this.html) { + return null; + } - function angularJsAdapter() { - for (var _len = arguments.length, injectedServices = new Array(_len), _key = 0; _key < _len; _key++) { - injectedServices[_key] = arguments[_key]; + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["markRaw"])({ + template: this.html + }); } + } +})); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/VueEntryContainer/VueEntryContainer.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/VueEntryContainer/VueEntryContainer.vue - var adapter = { - restrict: restrict, - require: require, - priority: priority, - scope: noScope ? undefined : angularJsScope, - compile: function angularJsAdapterCompile() { - return { - post: function angularJsAdapterLink(ngScope, ngElement, ngAttrs, ngController) { - var transcludeClone = transclude ? ngElement.find("[ng-transclude][counter=".concat(currentTranscludeCounter, "]")) : null; // build the root vue template - - var rootVueTemplate = '<root-component'; - Object.entries(events).forEach(function (info) { - var _info = createAngularJsAdapter_slicedToArray(info, 1), - eventName = _info[0]; - - rootVueTemplate += " @".concat(toKebabCase(eventName), "=\"onEventHandler('").concat(eventName, "', $event)\""); - }); - Object.entries(scope).forEach(function (_ref3) { - var _ref4 = createAngularJsAdapter_slicedToArray(_ref3, 2), - info = _ref4[1]; - - if (info.angularJsBind === '&' || info.angularJsBind === '&?') { - var eventName = toKebabCase(info.vue); - - if (!events[info.vue]) { - // pass through scope & w/o a custom event handler - rootVueTemplate += " @".concat(eventName, "=\"onEventHandler('").concat(info.vue, "', $event)\""); - } - } else { - rootVueTemplate += " :".concat(toKebabCase(info.vue), "=\"").concat(info.vue, "\""); - } - }); - rootVueTemplate += '>'; - - if (transclude) { - rootVueTemplate += '<div ref="transcludeTarget"/>'; - } - - rootVueTemplate += '</root-component>'; // build the vue app - - var app = createVueApp({ - template: rootVueTemplate, - data: function data() { - var _this = this; - - var initialData = {}; - Object.entries(scope).forEach(function (_ref5) { - var _ref6 = createAngularJsAdapter_slicedToArray(_ref5, 2), - scopeVarName = _ref6[0], - info = _ref6[1]; - - var value = removeAngularJsSpecificProperties(ngScope[scopeVarName]); - - if (typeof value === 'undefined' && typeof info.default !== 'undefined') { - value = info.default instanceof Function ? info.default.apply(info, [ngScope, ngElement, ngAttrs].concat(injectedServices)) : info.default; - } - - if (info.transform) { - value = info.transform.apply(info, [value, _this, ngScope, ngElement, ngAttrs, ngController].concat(injectedServices)); - } - - initialData[info.vue] = value; - }); - return initialData; - }, - setup: function setup() { - if (transclude) { - var transcludeTarget = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(null); - return { - transcludeTarget: transcludeTarget - }; - } - - return undefined; - }, - methods: { - onEventHandler: function onEventHandler(name, $event) { - var scopePropertyName = toAngularJsCamelCase(name); - scopePropertyName = vueToAngular[scopePropertyName] || scopePropertyName; - - if (ngScope[scopePropertyName]) { - ngScope[scopePropertyName]($event); - } - - if (events[name]) { - events[name].apply(events, [$event, this, ngScope, ngElement, ngAttrs, ngController].concat(injectedServices)); - } - } - } - }); - app.component('root-component', component); // mount the app - - var mountPoint = mountPointFactory ? mountPointFactory.apply(void 0, [ngScope, ngElement, ngAttrs].concat(injectedServices)) : ngElement[0]; - var vm = app.mount(mountPoint); // setup watches to bind between angularjs + vue - - Object.entries(scope).forEach(function (_ref7) { - var _ref8 = createAngularJsAdapter_slicedToArray(_ref7, 2), - scopeVarName = _ref8[0], - info = _ref8[1]; - - if (!info.angularJsBind || info.angularJsBind === '&' || info.angularJsBind === '&?') { - return; - } - - ngScope.$watch(scopeVarName, function (newValue, oldValue) { - if (newValue === oldValue && JSON.stringify(vm[info.vue]) === JSON.stringify(newValue)) { - return; // initial - } - - var newValueFinal = removeAngularJsSpecificProperties(newValue); - - if (typeof info.default !== 'undefined' && typeof newValue === 'undefined') { - newValueFinal = info.default instanceof Function ? info.default.apply(info, [ngScope, ngElement, ngAttrs].concat(injectedServices)) : info.default; - } - if (info.transform) { - newValueFinal = info.transform.apply(info, [newValueFinal, vm, ngScope, ngElement, ngAttrs, ngController].concat(injectedServices)); - } - vm[info.vue] = newValueFinal; - }, info.deepWatch); - }); +VueEntryContainervue_type_script_lang_ts.render = VueEntryContainervue_type_template_id_54e7e876_render - if (transclude && transcludeClone) { - $(vm.transcludeTarget).append(transcludeClone); - } +/* harmony default export */ var VueEntryContainer = (VueEntryContainervue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?vue&type=template&id=7c5fe406 - if (postCreate) { - postCreate.apply(void 0, [vm, ngScope, ngElement, ngAttrs, ngController].concat(injectedServices)); - } // specifying replace: true on the directive does nothing w/ vue inside, so - // handle it here. +var ActivityIndicatorvue_type_template_id_7c5fe406_hoisted_1 = { + class: "loadingPiwik" +}; +var _hoisted_2 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { + src: "plugins/Morpheus/images/loading-blue.gif", + alt: "" +}, null, -1); - if (replace) { - // transfer attributes from angularjs element that are not in scope to - // mount point element - Array.from(ngElement[0].attributes).forEach(function (attr) { - if (scope[attr.nodeName]) { - return; - } +function ActivityIndicatorvue_type_template_id_7c5fe406_render(_ctx, _cache, $props, $setup, $data, $options) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ActivityIndicatorvue_type_template_id_7c5fe406_hoisted_1, [_hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.loadingMessage), 1)], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.loading]]); +} +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?vue&type=template&id=7c5fe406 - if (mountPoint.firstElementChild) { - mountPoint.firstElementChild.setAttribute(attr.nodeName, attr.nodeValue); - } - }); - ngElement.replaceWith(window.$(mountPoint).children()); - } +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?vue&type=script&lang=ts - ngElement.on('$destroy', function () { - app.unmount(); - }); - } - }; - } - }; - if (transclude) { - adapter.transclude = true; - adapter.template = "<div ng-transclude counter=\"".concat(currentTranscludeCounter, "\"/>"); +/* harmony default export */ var ActivityIndicatorvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + loading: { + type: Boolean, + required: true, + default: false + }, + loadingMessage: { + type: String, + required: false, + default: translate('General_LoadingData') } - - return adapter; - } - - angularJsAdapter.$inject = $inject || []; - window.angular.module('piwikApp').directive(directiveName, angularJsAdapter); - return angularJsAdapter; -} -function transformAngularJsBoolAttr(v) { - if (typeof v === 'undefined') { - return undefined; } +})); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue - if (v === 'true') { - return true; - } - return !!v && v > 0 && v !== '0'; -} -function transformAngularJsIntAttr(v) { - if (typeof v === 'undefined') { - return undefined; - } - if (v === null) { - return null; - } +ActivityIndicatorvue_type_script_lang_ts.render = ActivityIndicatorvue_type_template_id_7c5fe406_render - return parseInt(v, 10); -} // utility function for service adapters +/* harmony default export */ var ActivityIndicator = (ActivityIndicatorvue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Alert/Alert.vue?vue&type=template&id=c3863ae2 +function Alertvue_type_template_id_c3863ae2_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function clone(p) { - if (typeof p === 'undefined') { - return p; - } - return JSON.parse(JSON.stringify(p)); -} -function cloneThenApply(p) { - var result = clone(p); - Matomo_Matomo.helper.getAngularDependency('$rootScope').$applyAsync(); - return result; +function Alertvue_type_template_id_c3863ae2_render(_ctx, _cache, $props, $setup, $data, $options) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["alert", Alertvue_type_template_id_c3863ae2_defineProperty({}, "alert-".concat(_ctx.severity), true)]) + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default")], 2); } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.adapter.ts -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.vue?vue&type=template&id=c3863ae2 +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Alert/Alert.vue?vue&type=script&lang=ts -/* harmony default export */ var Alert_adapter = (createAngularJsAdapter({ - component: Alert, - scope: { +/* harmony default export */ var Alertvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { severity: { - vue: 'severity', - angularJsBind: '@piwikAlert' + type: String, + required: true } - }, - directiveName: 'piwikAlert', - transclude: true + } })); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.vue + + + +Alertvue_type_script_lang_ts.render = Alertvue_type_template_id_c3863ae2_render + +/* harmony default export */ var Alert = (Alertvue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/DropdownMenu/DropdownMenu.ts /*! * Matomo - free/libre analytics platform @@ -2891,37 +2705,6 @@ function cloneThenApply(p) { }); } }); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/DropdownMenu/DropdownMenu.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 piwikDropdownMenu($timeout) { - return { - restrict: 'A', - link: function piwikDropdownMenuLink(scope, element, attrs) { - var binding = { - instance: null, - value: { - activates: $("#".concat(attrs.activates))[0] - }, - oldValue: null, - modifiers: {}, - dir: {} - }; - $timeout(function () { - DropdownMenu.mounted(element[0], binding); - }); - } - }; -} - -piwikDropdownMenu.$inject = ['$timeout']; -window.angular.module('piwikApp').directive('piwikDropdownMenu', piwikDropdownMenu); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/FocusAnywhereButHere/FocusAnywhereButHere.ts /*! * Matomo - free/libre analytics platform @@ -2999,48 +2782,6 @@ var doc = document.documentElement; doc.removeEventListener('scroll', binding.value.onScroll); } }); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/FocusAnywhereButHere/FocusAnywhereButHere.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 - */ - -/** - * The given expression will be executed when the user presses either escape or presses something - * outside of this element - * - * Example: - * <div piwik-focus-anywhere-but-here="closeDialog()">my dialog</div> - */ - -function piwikFocusAnywhereButHere() { - return { - restrict: 'A', - link: function focusAnywhereButHereLink(scope, element, attr) { - var binding = { - instance: null, - value: { - blur: function blur() { - setTimeout(function () { - scope.$apply(attr.piwikFocusAnywhereButHere); - }, 0); - } - }, - oldValue: null, - modifiers: {}, - dir: {} - }; - FocusAnywhereButHere.mounted(element[0], binding); - element.on('$destroy', function () { - return FocusAnywhereButHere.unmounted(element[0], binding); - }); - } - }; -} - -window.angular.module('piwikApp.directive').directive('piwikFocusAnywhereButHere', piwikFocusAnywhereButHere); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/FocusIf/FocusIf.ts /*! * Matomo - free/libre analytics platform @@ -3068,61 +2809,137 @@ function doFocusIf(el, binding) { doFocusIf(el, binding); } }); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/FocusIf/FocusIf.adapter.ts +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Tooltips/Tooltips.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 Tooltips_window = window, + Tooltips_$ = Tooltips_window.$; -/** - * If the given expression evaluates to true the element will be focused - * - * Example: - * <input type="text" piwik-focus-if="view.editName"> - */ - -function piwikFocusIf() { - return { - restrict: 'A', - link: function focusIfLink(scope, element, attrs) { - scope.$watch(attrs.piwikFocusIf, function (newValue) { - var binding = { - instance: null, - arg: newValue ? '1' : undefined, - value: { - afterFocus: function afterFocus() { - return scope.$apply(); - } - }, - oldValue: null, - modifiers: {}, - dir: {} - }; - FocusIf.updated(element[0], binding); - }); - } - }; +function defaultContentTransform() { + var title = Tooltips_$(this).attr('title') || ''; + return window.vueSanitize(title.replace(/\n/g, '<br />')); } -window.angular.module('piwikApp.directive').directive('piwikFocusIf', piwikFocusIf); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/directiveUtilities.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 getRef(expander, binding) { - var _binding$instance; +function setupTooltips(el, binding) { + var _binding$value, _binding$value2, _binding$value3, _binding$value4, _binding$value5, _binding$value6; - return expander instanceof HTMLElement ? expander : (_binding$instance = binding.instance) === null || _binding$instance === void 0 ? void 0 : _binding$instance.$refs[expander]; + Tooltips_$(el).tooltip({ + track: true, + content: ((_binding$value = binding.value) === null || _binding$value === void 0 ? void 0 : _binding$value.content) || defaultContentTransform, + show: typeof ((_binding$value2 = binding.value) === null || _binding$value2 === void 0 ? void 0 : _binding$value2.show) !== 'undefined' ? (_binding$value3 = binding.value) === null || _binding$value3 === void 0 ? void 0 : _binding$value3.show : { + delay: ((_binding$value4 = binding.value) === null || _binding$value4 === void 0 ? void 0 : _binding$value4.delay) || 700, + duration: ((_binding$value5 = binding.value) === null || _binding$value5 === void 0 ? void 0 : _binding$value5.duration) || 200 + }, + hide: false, + tooltipClass: (_binding$value6 = binding.value) === null || _binding$value6 === void 0 ? void 0 : _binding$value6.tooltipClass + }); } -/* harmony default export */ var directiveUtilities = ({ - getRef: getRef +/* harmony default export */ var Tooltips = ({ + mounted: function mounted(el, binding) { + setTimeout(function () { + return setupTooltips(el, binding); + }); + }, + updated: function updated(el, binding) { + setTimeout(function () { + return setupTooltips(el, binding); + }); + }, + beforeUnmount: function beforeUnmount(el) { + try { + window.$(el).tooltip('destroy'); + } catch (e) {// ignore + } + } }); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/MatomoDialog/MatomoDialog.vue?vue&type=template&id=00aba563 + +var MatomoDialogvue_type_template_id_00aba563_hoisted_1 = { + ref: "root" +}; +function MatomoDialogvue_type_template_id_00aba563_render(_ctx, _cache, $props, $setup, $data, $options) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", MatomoDialogvue_type_template_id_00aba563_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default")], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.modelValue]]); +} +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/MatomoDialog/MatomoDialog.vue?vue&type=template&id=00aba563 + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/MatomoDialog/MatomoDialog.vue?vue&type=script&lang=ts + + +/* harmony default export */ var MatomoDialogvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + /** + * Whether the modal is displayed or not; + */ + modelValue: { + type: Boolean, + required: true + }, + + /** + * Only here for backwards compatibility w/ AngularJS. If supplied, we use this + * element to launch the modal instead of the element in the slot. This should not + * be used for new Vue code. + * + * @deprecated + */ + element: { + type: HTMLElement, + required: false + } + }, + emits: ['yes', 'no', 'closeEnd', 'close', 'validation', 'update:modelValue'], + activated: function activated() { + this.$emit('update:modelValue', false); + }, + watch: { + modelValue: function modelValue(newValue, oldValue) { + var _this = this; + + if (newValue) { + var slotElement = this.element || this.$refs.root.firstElementChild; + Matomo_Matomo.helper.modalConfirm(slotElement, { + yes: function yes() { + _this.$emit('yes'); + }, + no: function no() { + _this.$emit('no'); + }, + validation: function validation() { + _this.$emit('validation'); + } + }, { + onCloseEnd: function onCloseEnd() { + // materialize removes the child element, so we move it back to the slot + if (!_this.element) { + _this.$refs.root.appendChild(slotElement); + } + + _this.$emit('update:modelValue', false); + + _this.$emit('closeEnd'); + } + }); + } else if (newValue === false && oldValue === true) { + // the user closed the dialog, e.g. by pressing Esc or clicking away from it + this.$emit('close'); + } + } + } +})); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/MatomoDialog/MatomoDialog.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/MatomoDialog/MatomoDialog.vue + + + +MatomoDialogvue_type_script_lang_ts.render = MatomoDialogvue_type_template_id_00aba563_render + +/* harmony default export */ var MatomoDialog = (MatomoDialogvue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ExpandOnClick/ExpandOnClick.ts /*! * Matomo - free/libre analytics platform @@ -3225,35 +3042,6 @@ var ExpandOnClick_window = window, ExpandOnClick_doc.removeEventListener('scroll', binding.value.onScroll); } }); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ExpandOnClick/ExpandOnClick.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 piwikExpandOnClick() { - return { - restrict: 'A', - link: function expandOnClickLink(scope, element) { - var binding = { - instance: null, - value: { - expander: element.find('.title').first()[0] - }, - oldValue: null, - modifiers: {}, - dir: {} - }; - ExpandOnClick.mounted(element[0], binding); - element.on('$destroy', function () { - return ExpandOnClick.unmounted(element[0], binding); - }); - } - }; -} -window.angular.module('piwikApp').directive('piwikExpandOnClick', piwikExpandOnClick); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ExpandOnHover/ExpandOnHover.ts /*! * Matomo - free/libre analytics platform @@ -3328,37 +3116,6 @@ var ExpandOnHover_doc = document.documentElement; document.removeEventListener('mouseup', binding.value.onClickOutsideElement); } }); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ExpandOnHover/ExpandOnHover.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 piwikExpandOnHover() { - return { - restrict: 'A', - link: function expandOnHoverLink(scope, element) { - var binding = { - instance: null, - value: { - expander: element.find('.title').first()[0] - }, - oldValue: null, - modifiers: {}, - dir: {} - }; - ExpandOnHover.mounted(element[0], binding); - element.on('$destroy', function () { - return ExpandOnHover.unmounted(element[0], binding); - }); - } - }; -} - -window.angular.module('piwikApp').directive('piwikExpandOnHover', piwikExpandOnHover); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ShowSensitiveData/ShowSensitiveData.ts /*! * Matomo - free/libre analytics platform @@ -3416,34 +3173,6 @@ var ShowSensitiveData_window = window, }); } }); -// 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); - } - }; -} -window.angular.module('piwikApp').directive('piwikShowSensitiveData', piwikShowSensitiveData); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/DropdownButton/DropdownButton.ts /*! * Matomo - free/libre analytics platform @@ -3475,23 +3204,6 @@ var DropdownButton_window = window, } } }); -// 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]); - } - }; -} -window.angular.module('piwikApp').directive('dropdownButton', piwikDropdownButton); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SelectOnFocus/SelectOnFocus.ts /*! * Matomo - free/libre analytics platform @@ -3549,33 +3261,6 @@ function onBlurHandler(binding) { } } }); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SelectOnFocus/SelectOnFocus.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 piwikSelectOnFocus() { - return { - restrict: 'A', - link: function piwikSelectOnFocusLink(scope, element) { - var binding = { - instance: null, - value: {}, - oldValue: null, - modifiers: {}, - dir: {} - }; - SelectOnFocus.mounted(element[0], binding); - element.on('$destroy', function () { - return SelectOnFocus.unmounted(element[0], binding); - }); - } - }; -} -window.angular.module('piwikApp').directive('piwikSelectOnFocus', piwikSelectOnFocus); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SideNav/SideNav.ts /*! * Matomo - free/libre analytics platform @@ -3584,7 +3269,6 @@ window.angular.module('piwikApp').directive('piwikSelectOnFocus', piwikSelectOnF * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -var initialized = false; /** * Will activate the materialize side nav feature once rendered. We use this directive as * it makes sure the actual left menu is rendered at the time we init the side nav. @@ -3602,8 +3286,8 @@ var initialized = false; } setTimeout(function () { - if (!initialized) { - initialized = true; + if (!binding.value.initialized) { + binding.value.initialized = true; var sideNavActivator = directiveUtilities.getRef(binding.value.activator, binding); if (sideNavActivator) { @@ -3622,205 +3306,14 @@ var initialized = false; }); } }); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SideNav/SideNav.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 piwikSideNav($timeout) { - return { - restrict: 'A', - priority: 10, - link: function linkPiwikSideNav(scope, element, attr) { - var binding = { - instance: null, - value: { - activator: $(attr.piwikSideNav)[0] - }, - oldValue: null, - modifiers: {}, - dir: {} - }; - $timeout(function () { - SideNav.mounted(element[0], binding); - }); - } - }; -} -piwikSideNav.$inject = ['$timeout']; -window.angular.module('piwikApp.directive').directive('piwikSideNav', piwikSideNav); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/MatomoDialog/MatomoDialog.vue?vue&type=template&id=00aba563 - -var _hoisted_1 = { - ref: "root" -}; -function MatomoDialogvue_type_template_id_00aba563_render(_ctx, _cache, $props, $setup, $data, $options) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default")], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.modelValue]]); -} -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/MatomoDialog/MatomoDialog.vue?vue&type=template&id=00aba563 - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/MatomoDialog/MatomoDialog.vue?vue&type=script&lang=ts - - -/* harmony default export */ var MatomoDialogvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - /** - * Whether the modal is displayed or not; - */ - modelValue: { - type: Boolean, - required: true - }, - - /** - * Only here for backwards compatibility w/ AngularJS. If supplied, we use this - * element to launch the modal instead of the element in the slot. This should not - * be used for new Vue code. - * - * @deprecated - */ - element: { - type: HTMLElement, - required: false - } - }, - emits: ['yes', 'no', 'closeEnd', 'close', 'validation', 'update:modelValue'], - activated: function activated() { - this.$emit('update:modelValue', false); - }, - watch: { - modelValue: function modelValue(newValue, oldValue) { - var _this = this; - - if (newValue) { - var slotElement = this.element || this.$refs.root.firstElementChild; - Matomo_Matomo.helper.modalConfirm(slotElement, { - yes: function yes() { - _this.$emit('yes'); - }, - no: function no() { - _this.$emit('no'); - }, - validation: function validation() { - _this.$emit('validation'); - } - }, { - onCloseEnd: function onCloseEnd() { - // materialize removes the child element, so we move it back to the slot - if (!_this.element) { - _this.$refs.root.appendChild(slotElement); - } - - _this.$emit('update:modelValue', false); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/EnrichedHeadline/EnrichedHeadline.vue?vue&type=template&id=0945105a - _this.$emit('closeEnd'); - } - }); - } else if (newValue === false && oldValue === true) { - // the user closed the dialog, e.g. by pressing Esc or clicking away from it - this.$emit('close'); - } - } - } -})); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/MatomoDialog/MatomoDialog.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/MatomoDialog/MatomoDialog.vue - - - -MatomoDialogvue_type_script_lang_ts.render = MatomoDialogvue_type_template_id_00aba563_render - -/* harmony default export */ var MatomoDialog = (MatomoDialogvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/MatomoDialog/MatomoDialog.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 - */ - - -/* harmony default export */ var MatomoDialog_adapter = (createAngularJsAdapter({ - component: MatomoDialog, - scope: { - show: { - vue: 'modelValue', - default: false - }, - element: { - default: function _default(scope, element) { - return element[0]; - } - } - }, - events: { - yes: function yes($event, vm, scope, element, attrs) { - if (attrs.yes) { - scope.$eval(attrs.yes); - setTimeout(function () { - scope.$apply(); - }, 0); - } - }, - no: function no($event, vm, scope, element, attrs) { - if (attrs.no) { - scope.$eval(attrs.no); - setTimeout(function () { - scope.$apply(); - }, 0); - } - }, - validation: function validation($event, vm, scope, element, attrs) { - if (attrs.no) { - scope.$eval(attrs.no); - setTimeout(function () { - scope.$apply(); - }, 0); - } - }, - close: function close($event, vm, scope, element, attrs) { - if (attrs.close) { - scope.$eval(attrs.close); - setTimeout(function () { - scope.$apply(); - }, 0); - } - }, - 'update:modelValue': function updateModelValue(newValue, vm, scope, element, attrs, controller, $parse) { - setTimeout(function () { - scope.$apply($parse(attrs.piwikDialog).assign(scope, newValue)); - }, 0); - } - }, - $inject: ['$parse'], - directiveName: 'piwikDialog', - transclude: true, - mountPointFactory: function mountPointFactory(scope, element) { - var vueRootPlaceholder = $('<div class="vue-placeholder"/>'); - vueRootPlaceholder.appendTo(element); - return vueRootPlaceholder[0]; - }, - postCreate: function postCreate(vm, scope, element, attrs) { - scope.$watch(attrs.piwikDialog, function (newValue, oldValue) { - if (oldValue !== newValue) { - vm.modelValue = newValue || false; - } - }); - }, - noScope: true -})); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/EnrichedHeadline/EnrichedHeadline.vue?vue&type=template&id=744f4bf7 - -var EnrichedHeadlinevue_type_template_id_744f4bf7_hoisted_1 = { +var EnrichedHeadlinevue_type_template_id_0945105a_hoisted_1 = { key: 0, class: "title", tabindex: "6" }; -var _hoisted_2 = ["href", "title"]; +var EnrichedHeadlinevue_type_template_id_0945105a_hoisted_2 = ["href", "title"]; var _hoisted_3 = { class: "iconsBar" }; @@ -3847,7 +3340,7 @@ var _hoisted_11 = { var _hoisted_12 = ["innerHTML"]; var _hoisted_13 = ["innerHTML"]; var _hoisted_14 = ["href"]; -function EnrichedHeadlinevue_type_template_id_744f4bf7_render(_ctx, _cache, $props, $setup, $data, $options) { +function EnrichedHeadlinevue_type_template_id_0945105a_render(_ctx, _cache, $props, $setup, $data, $options) { var _component_RateFeature = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("RateFeature"); return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { @@ -3859,12 +3352,12 @@ function EnrichedHeadlinevue_type_template_id_744f4bf7_render(_ctx, _cache, $pro return _ctx.showIcons = false; }), ref: "root" - }, [!_ctx.editUrl ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", EnrichedHeadlinevue_type_template_id_744f4bf7_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default")])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.editUrl ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { + }, [!_ctx.editUrl ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", EnrichedHeadlinevue_type_template_id_0945105a_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default")])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.editUrl ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { key: 1, class: "title", href: _ctx.editUrl, title: _ctx.translate('CoreHome_ClickToEditX', _ctx.htmlEntities(_ctx.actualFeatureName)) - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default")], 8, _hoisted_2)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_3, [_ctx.helpUrl && !_ctx.actualInlineHelp ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default")], 8, EnrichedHeadlinevue_type_template_id_0945105a_hoisted_2)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_3, [_ctx.helpUrl && !_ctx.actualInlineHelp ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { key: 0, rel: "noreferrer noopener", target: "_blank", @@ -3896,7 +3389,7 @@ function EnrichedHeadlinevue_type_template_id_744f4bf7_render(_ctx, _cache, $pro href: _ctx.helpUrl }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_MoreDetails')), 9, _hoisted_14)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showInlineHelp]])], 544); } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/EnrichedHeadline/EnrichedHeadline.vue?vue&type=template&id=744f4bf7 +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/EnrichedHeadline/EnrichedHeadline.vue?vue&type=template&id=0945105a // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/EnrichedHeadline/EnrichedHeadline.vue?vue&type=script&lang=ts @@ -3909,30 +3402,30 @@ var RateFeature = useExternalPluginComponent('Feedback', 'RateFeature'); /** * Usage: * - * <h2 piwik-enriched-headline>All Websites Dashboard</h2> + * <h2><EnrichedHeadline>All Websites Dashboard</EnrichedHeadline></h2> * -> uses "All Websites Dashboard" as featurename * - * <h2 piwik-enriched-headline feature-name="All Websites Dashboard">All Websites Dashboard (Total: - * 309 Visits)</h2> + * <h2><EnrichedHeadline feature-name="All Websites Dashboard">All Websites Dashboard (Total: + * 309 Visits)</EnrichedHeadline></h2> * -> custom featurename * - * <h2 piwik-enriched-headline help-url="http://piwik.org/guide">All Websites Dashboard</h2> + * <h2><EnrichedHeadline help-url="http://piwik.org/guide">All Websites Dashboard</EnrichedHeadline></h2> * -> shows help icon and links to external url * - * <h2 piwik-enriched-headline edit-url="index.php?module=Foo&action=bar&id=4">All Websites - * Dashboard</h2> + * <h2><EnrichedHeadline edit-url="index.php?module=Foo&action=bar&id=4">All Websites + * Dashboard</EnrichedHeadline></h2> * -> makes the headline clickable linking to the specified url * - * <h2 piwik-enriched-headline inline-help="inlineHelp">Pages report</h2> + * <h2><EnrichedHeadline inline-help="inlineHelp">Pages report</EnrichedHeadline></h2> * -> inlineHelp specified via a attribute shows help icon on headline hover * - * <h2 piwik-enriched-headline>All Websites Dashboard + * <h2><EnrichedHeadline>All Websites Dashboard * <div class="inlineHelp">My <strong>inline help</strong></div> - * </h2> + * </EnrichedHeadline></h2> * -> alternative definition for inline help * -> shows help icon to display inline help on click. Note: You can combine inlinehelp and help-url * - * * <h2 piwik-enriched-headline report-generated="generated time">Pages report</h2> + * * <h2><EnrichedHeadline report-generated="generated time">Pages report</EnrichedHeadline></h2> * -> reportGenerated specified via this attribute shows a clock icon with a tooltip which * activated by hover * -> the tooltip shows the value of the attribute @@ -3972,58 +3465,54 @@ var RateFeature = useExternalPluginComponent('Feedback', 'RateFeature'); } }, mounted: function mounted() { - var _this = this; - - var root = this.$refs.root; // timeout used since angularjs does not fill out the transclude at this point + var root = this.$refs.root; - setTimeout(function () { - if (!_this.actualInlineHelp) { - var _root$parentElement; + if (!this.actualInlineHelp) { + var _root$parentElement; - var helpNode = root.querySelector('.title .inlineHelp'); + var helpNode = root.querySelector('.title .inlineHelp'); - if (!helpNode && (_root$parentElement = root.parentElement) !== null && _root$parentElement !== void 0 && _root$parentElement.nextElementSibling) { - // hack for reports :( - helpNode = root.parentElement.nextElementSibling.querySelector('.reportDocumentation'); - } + if (!helpNode && (_root$parentElement = root.parentElement) !== null && _root$parentElement !== void 0 && _root$parentElement.nextElementSibling) { + // hack for reports :( + helpNode = root.parentElement.nextElementSibling.querySelector('.reportDocumentation'); + } - if (helpNode) { - var _helpNode$getAttribut; + if (helpNode) { + var _helpNode$getAttribut; - // hackish solution to get binded html of p tag within the help node - // at this point the ng-bind-html is not yet converted into html when report is not - // initially loaded. Using $compile doesn't work. So get and set it manually - var helpDocs = (_helpNode$getAttribut = helpNode.getAttribute('data-content')) === null || _helpNode$getAttribut === void 0 ? void 0 : _helpNode$getAttribut.trim(); + // hackish solution to get binded html of p tag within the help node + // at this point the ng-bind-html is not yet converted into html when report is not + // initially loaded. Using $compile doesn't work. So get and set it manually + var helpDocs = (_helpNode$getAttribut = helpNode.getAttribute('data-content')) === null || _helpNode$getAttribut === void 0 ? void 0 : _helpNode$getAttribut.trim(); - if (helpDocs && helpDocs.length) { - _this.actualInlineHelp = "<p>".concat(helpDocs, "</p>"); - setTimeout(function () { - return helpNode.remove(); - }, 0); - } + if (helpDocs && helpDocs.length) { + this.actualInlineHelp = "<p>".concat(helpDocs, "</p>"); + setTimeout(function () { + return helpNode.remove(); + }, 0); } } + } - if (!_this.actualFeatureName) { - var _root$querySelector; + if (!this.actualFeatureName) { + var _root$querySelector; - _this.actualFeatureName = (_root$querySelector = root.querySelector('.title')) === null || _root$querySelector === void 0 ? void 0 : _root$querySelector.textContent; - } + this.actualFeatureName = (_root$querySelector = root.querySelector('.title')) === null || _root$querySelector === void 0 ? void 0 : _root$querySelector.textContent; + } - if (Matomo_Matomo.period && Matomo_Matomo.currentDateString) { - var currentPeriod = Periods_Periods.parse(Matomo_Matomo.period, Matomo_Matomo.currentDateString); + if (Matomo_Matomo.period && Matomo_Matomo.currentDateString) { + var currentPeriod = Periods_Periods.parse(Matomo_Matomo.period, Matomo_Matomo.currentDateString); - if (_this.reportGenerated && currentPeriod.containsToday()) { - window.$(root.querySelector('.report-generated')).tooltip({ - track: true, - content: _this.reportGenerated, - items: 'div', - show: false, - hide: false - }); - } + if (this.reportGenerated && currentPeriod.containsToday()) { + window.$(root.querySelector('.report-generated')).tooltip({ + track: true, + content: this.reportGenerated, + items: 'div', + show: false, + hide: false + }); } - }); + } }, methods: { htmlEntities: function htmlEntities(v) { @@ -4037,40 +3526,9 @@ var RateFeature = useExternalPluginComponent('Feedback', 'RateFeature'); -EnrichedHeadlinevue_type_script_lang_ts.render = EnrichedHeadlinevue_type_template_id_744f4bf7_render +EnrichedHeadlinevue_type_script_lang_ts.render = EnrichedHeadlinevue_type_template_id_0945105a_render /* harmony default export */ var EnrichedHeadline = (EnrichedHeadlinevue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/EnrichedHeadline/EnrichedHeadline.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 - */ - - -/* harmony default export */ var EnrichedHeadline_adapter = (createAngularJsAdapter({ - component: EnrichedHeadline, - scope: { - helpUrl: { - angularJsBind: '@' - }, - editUrl: { - angularJsBind: '@' - }, - reportGenerated: { - angularJsBind: '@?' - }, - featureName: { - angularJsBind: '@' - }, - inlineHelp: { - angularJsBind: '@?' - } - }, - directiveName: 'piwikEnrichedHeadline', - transclude: true -})); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/ContentBlock/ContentBlock.vue?vue&type=template&id=561baeb1 var ContentBlockvue_type_template_id_561baeb1_hoisted_1 = { @@ -4204,37 +3662,76 @@ var ContentBlockvue_type_script_lang_ts_window = window, ContentBlockvue_type_script_lang_ts.render = ContentBlockvue_type_template_id_561baeb1_render /* harmony default export */ var ContentBlock = (ContentBlockvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ContentBlock/ContentBlock.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 - */ +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Comparisons/Comparisons.vue?vue&type=template&id=d1a096d8 + +var Comparisonsvue_type_template_id_d1a096d8_hoisted_1 = { + key: 0, + ref: "root", + class: "matomo-comparisons" +}; +var Comparisonsvue_type_template_id_d1a096d8_hoisted_2 = { + class: "comparison-type" +}; +var Comparisonsvue_type_template_id_d1a096d8_hoisted_3 = ["title"]; +var Comparisonsvue_type_template_id_d1a096d8_hoisted_4 = ["href"]; +var Comparisonsvue_type_template_id_d1a096d8_hoisted_5 = ["title"]; +var Comparisonsvue_type_template_id_d1a096d8_hoisted_6 = { + class: "comparison-period-label" +}; +var Comparisonsvue_type_template_id_d1a096d8_hoisted_7 = ["onClick"]; +var Comparisonsvue_type_template_id_d1a096d8_hoisted_8 = ["title"]; +var Comparisonsvue_type_template_id_d1a096d8_hoisted_9 = { + class: "loadingPiwik", + style: { + "display": "none" + } +}; +var Comparisonsvue_type_template_id_d1a096d8_hoisted_10 = ["alt"]; +function Comparisonsvue_type_template_id_d1a096d8_render(_ctx, _cache, $props, $setup, $data, $options) { + var _directive_tooltips = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("tooltips"); + return _ctx.isComparing ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Comparisonsvue_type_template_id_d1a096d8_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Comparisons')), 1), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.segmentComparisons, function (comparison, $index) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { + class: "comparison card", + key: comparison.index + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", Comparisonsvue_type_template_id_d1a096d8_hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Segment')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + class: "title", + title: comparison.title + '<br/>' + decodeURIComponent(comparison.params.segment) + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + target: "_blank", + href: _ctx.getUrlToSegment(comparison.params.segment) + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(comparison.title), 9, Comparisonsvue_type_template_id_d1a096d8_hoisted_4)], 8, Comparisonsvue_type_template_id_d1a096d8_hoisted_3), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.periodComparisons, function (periodComparison) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { + class: "comparison-period", + key: periodComparison.index, + title: _ctx.getComparisonTooltip(comparison, periodComparison) + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "comparison-dot", + style: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeStyle"])({ + 'background-color': _ctx.getSeriesColor(comparison, periodComparison) + }) + }, null, 4), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", Comparisonsvue_type_template_id_d1a096d8_hoisted_6, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(periodComparison.title) + " (" + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.getComparisonPeriodType(periodComparison)) + ") ", 1)], 8, Comparisonsvue_type_template_id_d1a096d8_hoisted_5); + }), 128)), _ctx.segmentComparisons.length > 1 ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { + key: 0, + class: "remove-button", + onClick: function onClick($event) { + return _ctx.removeSegmentComparison($index); + } + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "icon icon-close", + title: _ctx.translate('General_ClickToRemoveComp') + }, null, 8, Comparisonsvue_type_template_id_d1a096d8_hoisted_8)], 8, Comparisonsvue_type_template_id_d1a096d8_hoisted_7)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]); + }), 128)), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", Comparisonsvue_type_template_id_d1a096d8_hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { + src: "plugins/Morpheus/images/loading-blue.gif", + alt: _ctx.translate('General_LoadingData') + }, null, 8, Comparisonsvue_type_template_id_d1a096d8_hoisted_10), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_LoadingData')), 1)])], 512)), [[_directive_tooltips, { + duration: 200, + delay: 200, + content: _ctx.transformTooltipContent + }]]) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true); +} +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Comparisons/Comparisons.vue?vue&type=template&id=d1a096d8 -/* harmony default export */ var ContentBlock_adapter = (createAngularJsAdapter({ - component: ContentBlock, - scope: { - contentTitle: { - angularJsBind: '@' - }, - feature: { - angularJsBind: '@' - }, - helpUrl: { - angularJsBind: '@' - }, - helpText: { - angularJsBind: '@' - }, - anchor: { - angularJsBind: '@?' - } - }, - directiveName: 'piwikContentBlock', - transclude: true -})); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Segmentation/Segments.store.ts function Segments_store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -4540,7 +4037,7 @@ var Comparisons_store_ComparisonsStore = /*#__PURE__*/function () { compareDates: compareDates }; // change the page w/ these new param values - var baseParams = Matomo_Matomo.helper.isAngularRenderingThePage() ? src_MatomoUrl_MatomoUrl.hashParsed.value : src_MatomoUrl_MatomoUrl.urlParsed.value; + var baseParams = Matomo_Matomo.helper.isReportingPage() ? src_MatomoUrl_MatomoUrl.hashParsed.value : src_MatomoUrl_MatomoUrl.urlParsed.value; src_MatomoUrl_MatomoUrl.updateLocation(Object.assign(Object.assign(Object.assign({}, baseParams), compareParams), extraParams)); } }, { @@ -4673,124 +4170,6 @@ var Comparisons_store_ComparisonsStore = /*#__PURE__*/function () { // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Comparisons/Comparisons.store.instance.ts /* harmony default export */ var Comparisons_store_instance = (new Comparisons_store_ComparisonsStore()); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Comparisons/Comparisons.vue?vue&type=template&id=d1a096d8 - -var Comparisonsvue_type_template_id_d1a096d8_hoisted_1 = { - key: 0, - ref: "root", - class: "matomo-comparisons" -}; -var Comparisonsvue_type_template_id_d1a096d8_hoisted_2 = { - class: "comparison-type" -}; -var Comparisonsvue_type_template_id_d1a096d8_hoisted_3 = ["title"]; -var Comparisonsvue_type_template_id_d1a096d8_hoisted_4 = ["href"]; -var Comparisonsvue_type_template_id_d1a096d8_hoisted_5 = ["title"]; -var Comparisonsvue_type_template_id_d1a096d8_hoisted_6 = { - class: "comparison-period-label" -}; -var Comparisonsvue_type_template_id_d1a096d8_hoisted_7 = ["onClick"]; -var Comparisonsvue_type_template_id_d1a096d8_hoisted_8 = ["title"]; -var Comparisonsvue_type_template_id_d1a096d8_hoisted_9 = { - class: "loadingPiwik", - style: { - "display": "none" - } -}; -var Comparisonsvue_type_template_id_d1a096d8_hoisted_10 = ["alt"]; -function Comparisonsvue_type_template_id_d1a096d8_render(_ctx, _cache, $props, $setup, $data, $options) { - var _directive_tooltips = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("tooltips"); - - return _ctx.isComparing ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Comparisonsvue_type_template_id_d1a096d8_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Comparisons')), 1), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.segmentComparisons, function (comparison, $index) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { - class: "comparison card", - key: comparison.index - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", Comparisonsvue_type_template_id_d1a096d8_hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Segment')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { - class: "title", - title: comparison.title + '<br/>' + decodeURIComponent(comparison.params.segment) - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { - target: "_blank", - href: _ctx.getUrlToSegment(comparison.params.segment) - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(comparison.title), 9, Comparisonsvue_type_template_id_d1a096d8_hoisted_4)], 8, Comparisonsvue_type_template_id_d1a096d8_hoisted_3), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.periodComparisons, function (periodComparison) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { - class: "comparison-period", - key: periodComparison.index, - title: _ctx.getComparisonTooltip(comparison, periodComparison) - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - class: "comparison-dot", - style: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeStyle"])({ - 'background-color': _ctx.getSeriesColor(comparison, periodComparison) - }) - }, null, 4), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", Comparisonsvue_type_template_id_d1a096d8_hoisted_6, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(periodComparison.title) + " (" + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.getComparisonPeriodType(periodComparison)) + ") ", 1)], 8, Comparisonsvue_type_template_id_d1a096d8_hoisted_5); - }), 128)), _ctx.segmentComparisons.length > 1 ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { - key: 0, - class: "remove-button", - onClick: function onClick($event) { - return _ctx.removeSegmentComparison($index); - } - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - class: "icon icon-close", - title: _ctx.translate('General_ClickToRemoveComp') - }, null, 8, Comparisonsvue_type_template_id_d1a096d8_hoisted_8)], 8, Comparisonsvue_type_template_id_d1a096d8_hoisted_7)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]); - }), 128)), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", Comparisonsvue_type_template_id_d1a096d8_hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { - src: "plugins/Morpheus/images/loading-blue.gif", - alt: _ctx.translate('General_LoadingData') - }, null, 8, Comparisonsvue_type_template_id_d1a096d8_hoisted_10), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_LoadingData')), 1)])], 512)), [[_directive_tooltips, { - duration: 200, - delay: 200, - content: _ctx.transformTooltipContent - }]]) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true); -} -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Comparisons/Comparisons.vue?vue&type=template&id=d1a096d8 - -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Tooltips/Tooltips.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 Tooltips_window = window, - Tooltips_$ = Tooltips_window.$; - -function defaultContentTransform() { - var title = Tooltips_$(this).attr('title') || ''; - return window.vueSanitize(title.replace(/\n/g, '<br />')); -} - -function setupTooltips(el, binding) { - var _binding$value, _binding$value2, _binding$value3, _binding$value4, _binding$value5, _binding$value6; - - Tooltips_$(el).tooltip({ - track: true, - content: ((_binding$value = binding.value) === null || _binding$value === void 0 ? void 0 : _binding$value.content) || defaultContentTransform, - show: typeof ((_binding$value2 = binding.value) === null || _binding$value2 === void 0 ? void 0 : _binding$value2.show) !== 'undefined' ? (_binding$value3 = binding.value) === null || _binding$value3 === void 0 ? void 0 : _binding$value3.show : { - delay: ((_binding$value4 = binding.value) === null || _binding$value4 === void 0 ? void 0 : _binding$value4.delay) || 700, - duration: ((_binding$value5 = binding.value) === null || _binding$value5 === void 0 ? void 0 : _binding$value5.duration) || 200 - }, - hide: false, - tooltipClass: (_binding$value6 = binding.value) === null || _binding$value6 === void 0 ? void 0 : _binding$value6.tooltipClass - }); -} - -/* harmony default export */ var Tooltips = ({ - mounted: function mounted(el, binding) { - setTimeout(function () { - return setupTooltips(el, binding); - }); - }, - updated: function updated(el, binding) { - setTimeout(function () { - return setupTooltips(el, binding); - }); - }, - beforeUnmount: function beforeUnmount(el) { - try { - window.$(el).tooltip('destroy'); - } catch (e) {// ignore - } - } -}); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Comparisons/Comparisons.vue?vue&type=script&lang=ts @@ -4950,27 +4329,6 @@ function setupTooltips(el, binding) { Comparisonsvue_type_script_lang_ts.render = Comparisonsvue_type_template_id_d1a096d8_render /* harmony default export */ var Comparisons = (Comparisonsvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Comparisons/Comparisons.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 ComparisonFactory() { - return Comparisons_store_instance; -} - -window.angular.module('piwikApp.service').factory('piwikComparisonsService', ComparisonFactory); -/* harmony default export */ var Comparisons_adapter = (createAngularJsAdapter({ - component: Comparisons, - directiveName: 'piwikComparisons', - restrict: 'E' -})); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/MenuItemsDropdown/MenuItemsDropdown.vue?vue&type=template&id=4478fe73 var MenuItemsDropdownvue_type_template_id_4478fe73_hoisted_1 = { @@ -5121,41 +4479,6 @@ var MenuItemsDropdownvue_type_script_lang_ts_window = window, MenuItemsDropdownvue_type_script_lang_ts.render = MenuItemsDropdownvue_type_template_id_4478fe73_render /* harmony default export */ var MenuItemsDropdown = (MenuItemsDropdownvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/MenuItemsDropdown/MenuItemsDropdown.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 - */ - - -/* harmony default export */ var MenuItemsDropdown_adapter = (createAngularJsAdapter({ - component: MenuItemsDropdown, - scope: { - menuTitle: { - angularJsBind: '@' - }, - tooltip: { - angularJsBind: '@' - }, - showSearch: { - angularJsBind: '=' - }, - menuTitleChangeOnClick: { - angularJsBind: '=' - } - }, - directiveName: 'piwikMenudropdown', - transclude: true, - events: { - 'after-select': function afterSelect($event, vm, scope) { - setTimeout(function () { - scope.$apply(); - }, 0); - } - } -})); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/DatePicker/DatePicker.vue?vue&type=template&id=589729fc var DatePickervue_type_template_id_589729fc_hoisted_1 = { @@ -5493,78 +4816,21 @@ var DatePickervue_type_script_lang_ts_window = window, DatePickervue_type_script_lang_ts.render = DatePickervue_type_template_id_589729fc_render /* harmony default export */ var DatePicker = (DatePickervue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/DatePicker/DatePicker.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 - */ - - -/* harmony default export */ var DatePicker_adapter = (createAngularJsAdapter({ - component: DatePicker, - 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 cellHover(event, vm, scope, element, attrs, controller, $timeout) { - $timeout(); // trigger new digest - }, - 'cell-hover-leave': function cellHoverLeave(event, vm, scope, element, attrs, controller, $timeout) { - $timeout(); // trigger new digest - }, - 'date-select': function dateSelect(event, vm, scope, element, attrs, controller, $timeout) { - $timeout(); // trigger new digest - } - }, - $inject: ['$timeout'] -})); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/DateRangePicker/DateRangePicker.vue?vue&type=template&id=7bf842c2 +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/DateRangePicker/DateRangePicker.vue?vue&type=template&id=67755d44 -var DateRangePickervue_type_template_id_7bf842c2_hoisted_1 = { +var DateRangePickervue_type_template_id_67755d44_hoisted_1 = { + class: "dateRangePicker" +}; +var DateRangePickervue_type_template_id_67755d44_hoisted_2 = { id: "calendarRangeFrom" }; -var DateRangePickervue_type_template_id_7bf842c2_hoisted_2 = { +var DateRangePickervue_type_template_id_67755d44_hoisted_3 = { id: "calendarRangeTo" }; -function DateRangePickervue_type_template_id_7bf842c2_render(_ctx, _cache, $props, $setup, $data, $options) { +function DateRangePickervue_type_template_id_67755d44_render(_ctx, _cache, $props, $setup, $data, $options) { var _component_DatePicker = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("DatePicker"); - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", DateRangePickervue_type_template_id_7bf842c2_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h6", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_DateRangeFrom')) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", DateRangePickervue_type_template_id_67755d44_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", DateRangePickervue_type_template_id_67755d44_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h6", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_DateRangeFrom')) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { type: "text", id: "inputCalendarFrom", name: "inputCalendarFrom", @@ -5594,7 +4860,7 @@ function DateRangePickervue_type_template_id_7bf842c2_render(_ctx, _cache, $prop onCellHoverLeave: _cache[5] || (_cache[5] = function ($event) { return _ctx.fromPickerHighlightedDates = [null, null]; }) - }, null, 8, ["view-date", "selected-date-start", "selected-date-end", "highlighted-date-start", "highlighted-date-end"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", DateRangePickervue_type_template_id_7bf842c2_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h6", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_DateRangeTo')) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + }, null, 8, ["view-date", "selected-date-start", "selected-date-end", "highlighted-date-start", "highlighted-date-end"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", DateRangePickervue_type_template_id_67755d44_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h6", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_DateRangeTo')) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { type: "text", id: "inputCalendarTo", name: "inputCalendarTo", @@ -5626,7 +4892,7 @@ function DateRangePickervue_type_template_id_7bf842c2_render(_ctx, _cache, $prop }) }, null, 8, ["view-date", "selected-date-start", "selected-date-end", "highlighted-date-start", "highlighted-date-end"])])]); } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/DateRangePicker/DateRangePicker.vue?vue&type=template&id=7bf842c2 +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/DateRangePicker/DateRangePicker.vue?vue&type=template&id=67755d44 // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/DateRangePicker/DateRangePicker.vue?vue&type=script&lang=ts @@ -5770,37 +5036,9 @@ var DATE_FORMAT = 'YYYY-MM-DD'; -DateRangePickervue_type_script_lang_ts.render = DateRangePickervue_type_template_id_7bf842c2_render +DateRangePickervue_type_script_lang_ts.render = DateRangePickervue_type_template_id_67755d44_render /* harmony default export */ var DateRangePicker = (DateRangePickervue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/DateRangePicker/DateRangePicker.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 - */ - - -/* harmony default export */ var DateRangePicker_adapter = (createAngularJsAdapter({ - component: DateRangePicker, - scope: { - startDate: { - angularJsBind: '<' - }, - endDate: { - angularJsBind: '<' - }, - rangeChange: { - angularJsBind: '&' - }, - submit: { - angularJsBind: '&' - } - }, - directiveName: 'piwikDateRangePicker', - restrict: 'E' -})); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/PeriodDatePicker/PeriodDatePicker.vue?vue&type=template&id=6d1fa14c function PeriodDatePickervue_type_template_id_6d1fa14c_render(_ctx, _cache, $props, $setup, $data, $options) { @@ -5915,7 +5153,231 @@ var piwikMaxDate = new Date(Matomo_Matomo.maxDateYear, Matomo_Matomo.maxDateMont PeriodDatePickervue_type_script_lang_ts.render = PeriodDatePickervue_type_template_id_6d1fa14c_render /* harmony default export */ var PeriodDatePicker = (PeriodDatePickervue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/PeriodDatePicker/PeriodDatePicker.adapter.ts +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Notification/Notification.vue?vue&type=template&id=52166f8a + +var Notificationvue_type_template_id_52166f8a_hoisted_1 = { + key: 0 +}; +var Notificationvue_type_template_id_52166f8a_hoisted_2 = ["data-notification-instance-id"]; +var Notificationvue_type_template_id_52166f8a_hoisted_3 = { + key: 1 +}; +var Notificationvue_type_template_id_52166f8a_hoisted_4 = { + class: "notification-body" +}; +var Notificationvue_type_template_id_52166f8a_hoisted_5 = ["innerHTML"]; +var Notificationvue_type_template_id_52166f8a_hoisted_6 = { + key: 1 +}; +function Notificationvue_type_template_id_52166f8a_render(_ctx, _cache, $props, $setup, $data, $options) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Transition"], { + name: _ctx.type === 'toast' ? 'slow-fade-out' : undefined, + onAfterLeave: _cache[1] || (_cache[1] = function ($event) { + return _ctx.toastClosed(); + }) + }, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [!_ctx.deleted ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Notificationvue_type_template_id_52166f8a_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Transition"], { + name: _ctx.type === 'toast' ? 'toast-slide-up' : undefined, + appear: "" + }, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Transition"], { + name: _ctx.animate ? 'fade-in' : undefined, + appear: "" + }, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["notification system", _ctx.cssClasses]), + style: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeStyle"])(_ctx.style), + ref: "root", + "data-notification-instance-id": _ctx.notificationInstanceId + }, [_ctx.canClose ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("button", { + key: 0, + type: "button", + class: "close", + "data-dismiss": "alert", + onClick: _cache[0] || (_cache[0] = function ($event) { + return _ctx.closeNotification($event); + }) + }, " × ")) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.title ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("strong", Notificationvue_type_template_id_52166f8a_hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.title), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", Notificationvue_type_template_id_52166f8a_hoisted_4, [_ctx.message ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { + key: 0, + innerHTML: _ctx.$sanitize(_ctx.message) + }, null, 8, Notificationvue_type_template_id_52166f8a_hoisted_5)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !_ctx.message ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Notificationvue_type_template_id_52166f8a_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default")])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])], 14, Notificationvue_type_template_id_52166f8a_hoisted_2)]; + }), + _: 3 + }, 8, ["name"])])]; + }), + _: 3 + }, 8, ["name"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]; + }), + _: 3 + }, 8, ["name"]); +} +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/Notification.vue?vue&type=template&id=52166f8a + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Notification/Notification.vue?vue&type=script&lang=ts + + +var Notificationvue_type_script_lang_ts_window = window, + Notificationvue_type_script_lang_ts_$ = Notificationvue_type_script_lang_ts_window.$; +/* harmony default export */ var Notificationvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + notificationId: String, + // NOTE: notificationId refers to server side ID for notifications stored in the session. + // this ID is just so it can be selected outside of this component (just for scrolling). + notificationInstanceId: String, + title: String, + context: String, + type: String, + noclear: Boolean, + toastLength: { + type: Number, + default: 12 * 1000 + }, + style: [String, Object], + animate: Boolean, + message: String, + cssClass: String + }, + computed: { + cssClasses: function cssClasses() { + var result = {}; + + if (this.context) { + result["notification-".concat(this.context)] = true; + } + + if (this.cssClass) { + result[this.cssClass] = true; + } + + return result; + }, + canClose: function canClose() { + if (this.type === 'persistent') { + // otherwise it is never possible to dismiss the notification + return true; + } + + return !this.noclear; + } + }, + emits: ['closed'], + data: function data() { + return { + deleted: false + }; + }, + mounted: function mounted() { + var _this = this; + + var addToastEvent = function addToastEvent() { + setTimeout(function () { + _this.deleted = true; + }, _this.toastLength); + }; + + if (this.type === 'toast') { + addToastEvent(); + } + + if (this.style) { + Notificationvue_type_script_lang_ts_$(this.$refs.root).css(this.style); + } + }, + methods: { + toastClosed: function toastClosed() { + var _this2 = this; + + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["nextTick"])(function () { + _this2.$emit('closed'); + }); + }, + closeNotification: function closeNotification(event) { + var _this3 = this; + + if (this.canClose && event && event.target) { + this.deleted = true; + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["nextTick"])(function () { + _this3.$emit('closed'); + }); + } + + this.markNotificationAsRead(); + }, + markNotificationAsRead: function markNotificationAsRead() { + if (!this.notificationId) { + return; + } + + AjaxHelper_AjaxHelper.post({ + module: 'CoreHome', + action: 'markNotificationAsRead' + }, { + notificationId: this.notificationId + }, { + withTokenInUrl: true + }); + } + } +})); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/Notification.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/Notification.vue + + + +Notificationvue_type_script_lang_ts.render = Notificationvue_type_template_id_52166f8a_render + +/* harmony default export */ var Notification = (Notificationvue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Notification/NotificationGroup.vue?vue&type=template&id=672051da + +var NotificationGroupvue_type_template_id_672051da_hoisted_1 = { + class: "notification-group" +}; +var NotificationGroupvue_type_template_id_672051da_hoisted_2 = ["innerHTML"]; +function NotificationGroupvue_type_template_id_672051da_render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_Notification = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Notification"); + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", NotificationGroupvue_type_template_id_672051da_hoisted_1, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.notifications, function (notification, index) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_Notification, { + key: notification.id || "no-id-".concat(index), + "notification-id": notification.id, + title: notification.title, + context: notification.context, + type: notification.type, + noclear: notification.noclear, + "toast-length": notification.toastLength, + style: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeStyle"])(notification.style), + animate: notification.animate, + message: notification.message, + "notification-instance-id": notification.notificationInstanceId, + "css-class": notification.class, + onClosed: function onClosed($event) { + return _ctx.removeNotification(notification.id); + } + }, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + innerHTML: _ctx.$sanitize(notification.message) + }, null, 8, NotificationGroupvue_type_template_id_672051da_hoisted_2)]; + }), + _: 2 + }, 1032, ["notification-id", "title", "context", "type", "noclear", "toast-length", "style", "animate", "message", "notification-instance-id", "css-class", "onClosed"]); + }), 128))]); +} +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/NotificationGroup.vue?vue&type=template&id=672051da + +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/Notifications.store.ts +function Notifications_store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function Notifications_store_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function Notifications_store_createClass(Constructor, protoProps, staticProps) { if (protoProps) Notifications_store_defineProperties(Constructor.prototype, protoProps); if (staticProps) Notifications_store_defineProperties(Constructor, staticProps); return Constructor; } + +function Notifications_store_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + /*! * Matomo - free/libre analytics platform * @@ -5924,207 +5386,272 @@ PeriodDatePickervue_type_script_lang_ts.render = PeriodDatePickervue_type_templa */ -/* harmony default export */ var PeriodDatePicker_adapter = (createAngularJsAdapter({ - component: PeriodDatePicker, - scope: { - period: { - angularJsBind: '<' - }, - date: { - angularJsBind: '<' - }, - select: { - angularJsBind: '&' + + +var Notifications_store_window = window, + Notifications_store_$ = Notifications_store_window.$; + +var Notifications_store_NotificationsStore = /*#__PURE__*/function () { + function NotificationsStore() { + Notifications_store_classCallCheck(this, NotificationsStore); + + Notifications_store_defineProperty(this, "privateState", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["reactive"])({ + notifications: [] + })); + + Notifications_store_defineProperty(this, "nextNotificationId", 0); + } + + Notifications_store_createClass(NotificationsStore, [{ + key: "state", + get: function get() { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(this.privateState); } - }, - directiveName: 'piwikPeriodDatePicker', - restrict: 'E' -})); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue?vue&type=template&id=17f03442 + }, { + key: "appendNotification", + value: function appendNotification(notification) { + this.checkMessage(notification.message); // remove existing notification before adding -var SiteSelectorvue_type_template_id_17f03442_hoisted_1 = ["value", "name"]; -var SiteSelectorvue_type_template_id_17f03442_hoisted_2 = ["title"]; -var SiteSelectorvue_type_template_id_17f03442_hoisted_3 = ["textContent"]; -var SiteSelectorvue_type_template_id_17f03442_hoisted_4 = { - key: 1, - class: "placeholder" -}; -var SiteSelectorvue_type_template_id_17f03442_hoisted_5 = { - class: "dropdown" -}; -var SiteSelectorvue_type_template_id_17f03442_hoisted_6 = { - class: "custom_select_search" -}; -var SiteSelectorvue_type_template_id_17f03442_hoisted_7 = ["placeholder"]; -var SiteSelectorvue_type_template_id_17f03442_hoisted_8 = { - key: 0 -}; -var SiteSelectorvue_type_template_id_17f03442_hoisted_9 = { - class: "custom_select_container" -}; -var SiteSelectorvue_type_template_id_17f03442_hoisted_10 = ["onClick"]; -var SiteSelectorvue_type_template_id_17f03442_hoisted_11 = ["innerHTML", "href", "title"]; -var SiteSelectorvue_type_template_id_17f03442_hoisted_12 = { - class: "ui-autocomplete ui-front ui-menu ui-widget ui-widget-content ui-corner-all\n siteSelect" -}; -var SiteSelectorvue_type_template_id_17f03442_hoisted_13 = { - class: "ui-menu-item" -}; -var SiteSelectorvue_type_template_id_17f03442_hoisted_14 = { - class: "ui-corner-all", - tabindex: "-1" -}; -var _hoisted_15 = { - key: 1 -}; -function SiteSelectorvue_type_template_id_17f03442_render(_ctx, _cache, $props, $setup, $data, $options) { - var _ctx$displayedModelVa, _ctx$displayedModelVa2, _ctx$displayedModelVa3, _ctx$displayedModelVa4; + if (notification.id) { + this.remove(notification.id); + } - var _component_AllSitesLink = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("AllSitesLink"); + this.privateState.notifications.push(notification); + } + }, { + key: "prependNotification", + value: function prependNotification(notification) { + this.checkMessage(notification.message); // remove existing notification before adding - var _directive_focus_if = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("focus-if"); + if (notification.id) { + this.remove(notification.id); + } - var _directive_focus_anywhere_but_here = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("focus-anywhere-but-here"); + this.privateState.notifications.unshift(notification); + } + /** + * Removes a previously shown notification having the given notification id. + */ - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { - class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["siteSelector piwikSelector borderedControl", { - 'expanded': _ctx.showSitesList, - 'disabled': !_ctx.hasMultipleSites - }]) - }, [_ctx.name ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("input", { - key: 0, - type: "hidden", - value: (_ctx$displayedModelVa = _ctx.displayedModelValue) === null || _ctx$displayedModelVa === void 0 ? void 0 : _ctx$displayedModelVa.id, - name: _ctx.name - }, null, 8, SiteSelectorvue_type_template_id_17f03442_hoisted_1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { - ref: "selectorLink", - onClick: _cache[0] || (_cache[0] = function () { - return _ctx.onClickSelector && _ctx.onClickSelector.apply(_ctx, arguments); - }), - onKeydown: _cache[1] || (_cache[1] = function ($event) { - return _ctx.onPressEnter($event); - }), - href: "javascript:void(0)", - class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])([{ - 'loading': _ctx.isLoading - }, "title"]), - tabindex: "4", - title: _ctx.selectorLinkTitle - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["icon icon-arrow-bottom", { - 'iconHidden': _ctx.isLoading, - 'collapsed': !_ctx.showSitesList - }]) - }, null, 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, [(_ctx$displayedModelVa2 = _ctx.displayedModelValue) !== null && _ctx$displayedModelVa2 !== void 0 && _ctx$displayedModelVa2.name || !_ctx.placeholder ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", { - key: 0, - textContent: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(((_ctx$displayedModelVa3 = _ctx.displayedModelValue) === null || _ctx$displayedModelVa3 === void 0 ? void 0 : _ctx$displayedModelVa3.name) || _ctx.firstSiteName) - }, null, 8, SiteSelectorvue_type_template_id_17f03442_hoisted_3)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !((_ctx$displayedModelVa4 = _ctx.displayedModelValue) !== null && _ctx$displayedModelVa4 !== void 0 && _ctx$displayedModelVa4.name) && _ctx.placeholder ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", SiteSelectorvue_type_template_id_17f03442_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.placeholder), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])], 42, SiteSelectorvue_type_template_id_17f03442_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_17f03442_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_17f03442_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - type: "text", - onClick: _cache[2] || (_cache[2] = function ($event) { - _ctx.searchTerm = ''; + }, { + key: "remove", + value: function remove(id) { + this.privateState.notifications = this.privateState.notifications.filter(function (n) { + return n.id !== id; + }); + } + }, { + key: "parseNotificationDivs", + value: function parseNotificationDivs() { + var _this = this; - _ctx.loadInitialSites(); - }), - "onUpdate:modelValue": _cache[3] || (_cache[3] = function ($event) { - return _ctx.searchTerm = $event; - }), - tabindex: "4", - class: "websiteSearch inp browser-default", - placeholder: _ctx.translate('General_Search') - }, null, 8, SiteSelectorvue_type_template_id_17f03442_hoisted_7), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelText"], _ctx.searchTerm], [_directive_focus_if, {}, _ctx.shouldFocusOnSearch]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { - title: "Clear", - onClick: _cache[4] || (_cache[4] = function ($event) { - _ctx.searchTerm = ''; + var $notificationNodes = Notifications_store_$('[data-role="notification"]'); + var notificationsToShow = []; + $notificationNodes.each(function (index, notificationNode) { + var $notificationNode = Notifications_store_$(notificationNode); + var attributes = $notificationNode.data(); + var message = $notificationNode.html(); - _ctx.loadInitialSites(); - }), - class: "reset", - src: "plugins/CoreHome/images/reset_search.png" - }, null, 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.searchTerm]])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.autocompleteMinSites <= _ctx.sites.length || _ctx.searchTerm]]), _ctx.allSitesLocation === 'top' && _ctx.showAllSitesItem ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", SiteSelectorvue_type_template_id_17f03442_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_AllSitesLink, { - href: _ctx.urlAllSites, - "all-sites-text": _ctx.allSitesText, - onClick: _cache[5] || (_cache[5] = function ($event) { - return _ctx.onAllSitesClick($event); - }) - }, null, 8, ["href", "all-sites-text"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_17f03442_hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", { - class: "custom_select_ul_list", - onClick: _cache[7] || (_cache[7] = function ($event) { - return _ctx.showSitesList = false; - }) - }, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.sites, function (site, index) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { - onClick: function onClick($event) { - return _ctx.switchSite(Object.assign(Object.assign({}, site), {}, { - id: site.idsite - }), $event); - }, - key: index - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { - onClick: _cache[6] || (_cache[6] = function ($event) { - return $event.preventDefault(); - }), - innerHTML: _ctx.$sanitize(_ctx.getMatchedSiteName(site.name)), - tabindex: "4", - href: _ctx.getUrlForSiteId(site.idsite), - title: site.name - }, null, 8, SiteSelectorvue_type_template_id_17f03442_hoisted_11)], 8, SiteSelectorvue_type_template_id_17f03442_hoisted_10)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !(!_ctx.showSelectedSite && "".concat(_ctx.activeSiteId) === "".concat(site.idsite))]]); - }), 128))]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", SiteSelectorvue_type_template_id_17f03442_hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", SiteSelectorvue_type_template_id_17f03442_hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", SiteSelectorvue_type_template_id_17f03442_hoisted_14, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_NotFound') + ' ' + _ctx.searchTerm), 1)])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.sites.length && _ctx.searchTerm]])]), _ctx.allSitesLocation === 'bottom' && _ctx.showAllSitesItem ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_15, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_AllSitesLink, { - href: _ctx.urlAllSites, - "all-sites-text": _ctx.allSitesText, - onClick: _cache[8] || (_cache[8] = function ($event) { - return _ctx.onAllSitesClick($event); - }) - }, null, 8, ["href", "all-sites-text"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showSitesList]])], 2)), [[_directive_focus_anywhere_but_here, { - blur: _ctx.onBlur - }]]); -} -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue?vue&type=template&id=17f03442 + if (message) { + notificationsToShow.push(Object.assign(Object.assign({}, attributes), {}, { + message: message, + animate: false + })); + } -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/SiteSelector/AllSitesLink.vue?vue&type=template&id=45607d28 + $notificationNodes.remove(); + }); + notificationsToShow.forEach(function (n) { + return _this.show(n); + }); + } + }, { + key: "clearTransientNotifications", + value: function clearTransientNotifications() { + this.privateState.notifications = this.privateState.notifications.filter(function (n) { + return n.type !== 'transient'; + }); + } + /** + * Creates a notification and shows it to the user. + */ -var AllSitesLinkvue_type_template_id_45607d28_hoisted_1 = ["innerHTML", "href"]; -function AllSitesLinkvue_type_template_id_45607d28_render(_ctx, _cache, $props, $setup, $data, $options) { - var _this = this; + }, { + key: "show", + value: function show(notification) { + this.checkMessage(notification.message); + var addMethod = notification.prepend ? this.prependNotification : this.appendNotification; + var notificationPosition = '#notificationContainer'; - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { - onClick: _cache[1] || (_cache[1] = function ($event) { - return _this.onClick($event); - }), - class: "custom_select_all" - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { - onClick: _cache[0] || (_cache[0] = function ($event) { - return $event.preventDefault(); - }), - innerHTML: _ctx.$sanitize(_ctx.allSitesText), - tabindex: "4", - href: _ctx.href - }, null, 8, AllSitesLinkvue_type_template_id_45607d28_hoisted_1)]); -} -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SiteSelector/AllSitesLink.vue?vue&type=template&id=45607d28 + if (notification.placeat) { + notificationPosition = notification.placeat; + } else { + // If a modal is open, we want to make sure the error message is visible and therefore + // show it within the opened modal + var modalSelector = '.modal.open .modal-content'; + var modal = document.querySelector(modalSelector); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/SiteSelector/AllSitesLink.vue?vue&type=script&lang=ts + if (modal) { + if (!modal.querySelector('#modalNotificationContainer')) { + Notifications_store_$(modal).prepend('<div id="modalNotificationContainer"/>'); + } -/* harmony default export */ var AllSitesLinkvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + notificationPosition = "".concat(modalSelector, " #modalNotificationContainer"); + addMethod = this.prependNotification; + } + } + + var group = notification.group || (notificationPosition ? notificationPosition.toString() : ''); + this.initializeNotificationContainer(notificationPosition, group); + var notificationInstanceId = (this.nextNotificationId += 1).toString(); + addMethod.call(this, Object.assign(Object.assign({}, notification), {}, { + noclear: !!notification.noclear, + group: group, + notificationId: notification.id, + notificationInstanceId: notificationInstanceId, + type: notification.type || 'transient' + })); + return notificationInstanceId; + } + }, { + key: "scrollToNotification", + value: function scrollToNotification(notificationInstanceId) { + setTimeout(function () { + var element = document.querySelector("[data-notification-instance-id='".concat(notificationInstanceId, "']")); + + if (element) { + Matomo_Matomo.helper.lazyScrollTo(element, 250); + } + }); + } + /** + * Shows a notification at a certain point with a quick upwards animation. + */ + + }, { + key: "toast", + value: function toast(notification) { + this.checkMessage(notification.message); + var $placeat = notification.placeat ? Notifications_store_$(notification.placeat) : undefined; + + if (!$placeat || !$placeat.length) { + throw new Error('A valid selector is required for the placeat option when using Notification.toast().'); + } + + var toastElement = document.createElement('div'); + toastElement.style.position = 'absolute'; + toastElement.style.top = "".concat($placeat.offset().top, "px"); + toastElement.style.left = "".concat($placeat.offset().left, "px"); + toastElement.style.zIndex = '1000'; + document.body.appendChild(toastElement); + var app = createVueApp({ + render: function render() { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Notification, Object.assign(Object.assign({}, notification), {}, { + notificationId: notification.id, + type: 'toast', + onClosed: function onClosed() { + app.unmount(); + } + })); + } + }); + app.mount(toastElement); + } + }, { + key: "initializeNotificationContainer", + value: function initializeNotificationContainer(notificationPosition, group) { + if (!notificationPosition) { + return; + } + + var $container = Notifications_store_$(notificationPosition); + + if ($container.children('.notification-group').length) { + return; + } // avoiding a dependency cycle. won't need to do this when NotificationGroup's do not need + // to be dynamically initialized. + + + var NotificationGroup = window.CoreHome.NotificationGroup; // eslint-disable-line + + var app = createVueApp({ + template: '<NotificationGroup :group="group"></NotificationGroup>', + data: function data() { + return { + group: group + }; + } + }); + app.component('NotificationGroup', NotificationGroup); + app.mount($container[0]); + } + }, { + key: "checkMessage", + value: function checkMessage(message) { + if (!message) { + throw new Error('No message given, cannot display notification'); + } + } + }]); + + return NotificationsStore; +}(); + +var Notifications_store_instance = new Notifications_store_NotificationsStore(); +/* harmony default export */ var Notifications_store = (Notifications_store_instance); // parse notifications on dom load + +Notifications_store_$(function () { + return Notifications_store_instance.parseNotificationDivs(); +}); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Notification/NotificationGroup.vue?vue&type=script&lang=ts + + + +/* harmony default export */ var NotificationGroupvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ props: { - href: String, - allSitesText: String + group: String + }, + components: { + Notification: Notification + }, + computed: { + notifications: function notifications() { + var _this = this; + + return Notifications_store.state.notifications.filter(function (n) { + if (_this.group) { + return _this.group === n.group; + } + + return !n.group; + }); + } }, - emits: ['click'], methods: { - onClick: function onClick(event) { - this.$emit('click', event); + removeNotification: function removeNotification(id) { + Notifications_store.remove(id); } } })); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SiteSelector/AllSitesLink.vue?vue&type=script&lang=ts +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/NotificationGroup.vue?vue&type=script&lang=ts -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SiteSelector/AllSitesLink.vue +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/NotificationGroup.vue -AllSitesLinkvue_type_script_lang_ts.render = AllSitesLinkvue_type_template_id_45607d28_render +NotificationGroupvue_type_script_lang_ts.render = NotificationGroupvue_type_template_id_672051da_render + +/* harmony default export */ var Notification_NotificationGroup = (NotificationGroupvue_type_script_lang_ts); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/index.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + + -/* harmony default export */ var AllSitesLink = (AllSitesLinkvue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SiteSelector/SitesStore.ts function SitesStore_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -6318,27 +5845,191 @@ var SitesStore_SitesStore = /*#__PURE__*/function () { }(); /* harmony default export */ var SiteSelector_SitesStore = (new SitesStore_SitesStore()); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/debounce.ts -var DEFAULT_DEBOUNCE_DELAY = 300; -function debounce(fn) { - var delayInMs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_DEBOUNCE_DELAY; - var timeout; - return function wrapper() { - var _this = this; +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue?vue&type=template&id=17f03442 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } +var SiteSelectorvue_type_template_id_17f03442_hoisted_1 = ["value", "name"]; +var SiteSelectorvue_type_template_id_17f03442_hoisted_2 = ["title"]; +var SiteSelectorvue_type_template_id_17f03442_hoisted_3 = ["textContent"]; +var SiteSelectorvue_type_template_id_17f03442_hoisted_4 = { + key: 1, + class: "placeholder" +}; +var SiteSelectorvue_type_template_id_17f03442_hoisted_5 = { + class: "dropdown" +}; +var SiteSelectorvue_type_template_id_17f03442_hoisted_6 = { + class: "custom_select_search" +}; +var SiteSelectorvue_type_template_id_17f03442_hoisted_7 = ["placeholder"]; +var SiteSelectorvue_type_template_id_17f03442_hoisted_8 = { + key: 0 +}; +var SiteSelectorvue_type_template_id_17f03442_hoisted_9 = { + class: "custom_select_container" +}; +var SiteSelectorvue_type_template_id_17f03442_hoisted_10 = ["onClick"]; +var SiteSelectorvue_type_template_id_17f03442_hoisted_11 = ["innerHTML", "href", "title"]; +var SiteSelectorvue_type_template_id_17f03442_hoisted_12 = { + class: "ui-autocomplete ui-front ui-menu ui-widget ui-widget-content ui-corner-all\n siteSelect" +}; +var SiteSelectorvue_type_template_id_17f03442_hoisted_13 = { + class: "ui-menu-item" +}; +var SiteSelectorvue_type_template_id_17f03442_hoisted_14 = { + class: "ui-corner-all", + tabindex: "-1" +}; +var _hoisted_15 = { + key: 1 +}; +function SiteSelectorvue_type_template_id_17f03442_render(_ctx, _cache, $props, $setup, $data, $options) { + var _ctx$displayedModelVa, _ctx$displayedModelVa2, _ctx$displayedModelVa3, _ctx$displayedModelVa4; - if (timeout) { - clearTimeout(timeout); - } + var _component_AllSitesLink = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("AllSitesLink"); - timeout = setTimeout(function () { - fn.call.apply(fn, [_this].concat(args)); - }, delayInMs); - }; + var _directive_focus_if = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("focus-if"); + + var _directive_focus_anywhere_but_here = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("focus-anywhere-but-here"); + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["siteSelector piwikSelector borderedControl", { + 'expanded': _ctx.showSitesList, + 'disabled': !_ctx.hasMultipleSites + }]) + }, [_ctx.name ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("input", { + key: 0, + type: "hidden", + value: (_ctx$displayedModelVa = _ctx.displayedModelValue) === null || _ctx$displayedModelVa === void 0 ? void 0 : _ctx$displayedModelVa.id, + name: _ctx.name + }, null, 8, SiteSelectorvue_type_template_id_17f03442_hoisted_1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + ref: "selectorLink", + onClick: _cache[0] || (_cache[0] = function () { + return _ctx.onClickSelector && _ctx.onClickSelector.apply(_ctx, arguments); + }), + onKeydown: _cache[1] || (_cache[1] = function ($event) { + return _ctx.onPressEnter($event); + }), + href: "javascript:void(0)", + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])([{ + 'loading': _ctx.isLoading + }, "title"]), + tabindex: "4", + title: _ctx.selectorLinkTitle + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["icon icon-arrow-bottom", { + 'iconHidden': _ctx.isLoading, + 'collapsed': !_ctx.showSitesList + }]) + }, null, 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, [(_ctx$displayedModelVa2 = _ctx.displayedModelValue) !== null && _ctx$displayedModelVa2 !== void 0 && _ctx$displayedModelVa2.name || !_ctx.placeholder ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", { + key: 0, + textContent: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(((_ctx$displayedModelVa3 = _ctx.displayedModelValue) === null || _ctx$displayedModelVa3 === void 0 ? void 0 : _ctx$displayedModelVa3.name) || _ctx.firstSiteName) + }, null, 8, SiteSelectorvue_type_template_id_17f03442_hoisted_3)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !((_ctx$displayedModelVa4 = _ctx.displayedModelValue) !== null && _ctx$displayedModelVa4 !== void 0 && _ctx$displayedModelVa4.name) && _ctx.placeholder ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", SiteSelectorvue_type_template_id_17f03442_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.placeholder), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])], 42, SiteSelectorvue_type_template_id_17f03442_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_17f03442_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_17f03442_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + type: "text", + onClick: _cache[2] || (_cache[2] = function ($event) { + _ctx.searchTerm = ''; + + _ctx.loadInitialSites(); + }), + "onUpdate:modelValue": _cache[3] || (_cache[3] = function ($event) { + return _ctx.searchTerm = $event; + }), + tabindex: "4", + class: "websiteSearch inp browser-default", + placeholder: _ctx.translate('General_Search') + }, null, 8, SiteSelectorvue_type_template_id_17f03442_hoisted_7), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelText"], _ctx.searchTerm], [_directive_focus_if, {}, _ctx.shouldFocusOnSearch]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { + title: "Clear", + onClick: _cache[4] || (_cache[4] = function ($event) { + _ctx.searchTerm = ''; + + _ctx.loadInitialSites(); + }), + class: "reset", + src: "plugins/CoreHome/images/reset_search.png" + }, null, 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.searchTerm]])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.autocompleteMinSites <= _ctx.sites.length || _ctx.searchTerm]]), _ctx.allSitesLocation === 'top' && _ctx.showAllSitesItem ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", SiteSelectorvue_type_template_id_17f03442_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_AllSitesLink, { + href: _ctx.urlAllSites, + "all-sites-text": _ctx.allSitesText, + onClick: _cache[5] || (_cache[5] = function ($event) { + return _ctx.onAllSitesClick($event); + }) + }, null, 8, ["href", "all-sites-text"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteSelectorvue_type_template_id_17f03442_hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", { + class: "custom_select_ul_list", + onClick: _cache[7] || (_cache[7] = function ($event) { + return _ctx.showSitesList = false; + }) + }, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.sites, function (site, index) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { + onClick: function onClick($event) { + return _ctx.switchSite(Object.assign(Object.assign({}, site), {}, { + id: site.idsite + }), $event); + }, + key: index + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + onClick: _cache[6] || (_cache[6] = function ($event) { + return $event.preventDefault(); + }), + innerHTML: _ctx.$sanitize(_ctx.getMatchedSiteName(site.name)), + tabindex: "4", + href: _ctx.getUrlForSiteId(site.idsite), + title: site.name + }, null, 8, SiteSelectorvue_type_template_id_17f03442_hoisted_11)], 8, SiteSelectorvue_type_template_id_17f03442_hoisted_10)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !(!_ctx.showSelectedSite && "".concat(_ctx.activeSiteId) === "".concat(site.idsite))]]); + }), 128))]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", SiteSelectorvue_type_template_id_17f03442_hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", SiteSelectorvue_type_template_id_17f03442_hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", SiteSelectorvue_type_template_id_17f03442_hoisted_14, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_NotFound') + ' ' + _ctx.searchTerm), 1)])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.sites.length && _ctx.searchTerm]])]), _ctx.allSitesLocation === 'bottom' && _ctx.showAllSitesItem ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_15, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_AllSitesLink, { + href: _ctx.urlAllSites, + "all-sites-text": _ctx.allSitesText, + onClick: _cache[8] || (_cache[8] = function ($event) { + return _ctx.onAllSitesClick($event); + }) + }, null, 8, ["href", "all-sites-text"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showSitesList]])], 2)), [[_directive_focus_anywhere_but_here, { + blur: _ctx.onBlur + }]]); +} +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue?vue&type=template&id=17f03442 + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/SiteSelector/AllSitesLink.vue?vue&type=template&id=45607d28 + +var AllSitesLinkvue_type_template_id_45607d28_hoisted_1 = ["innerHTML", "href"]; +function AllSitesLinkvue_type_template_id_45607d28_render(_ctx, _cache, $props, $setup, $data, $options) { + var _this = this; + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { + onClick: _cache[1] || (_cache[1] = function ($event) { + return _this.onClick($event); + }), + class: "custom_select_all" + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + onClick: _cache[0] || (_cache[0] = function ($event) { + return $event.preventDefault(); + }), + innerHTML: _ctx.$sanitize(_ctx.allSitesText), + tabindex: "4", + href: _ctx.href + }, null, 8, AllSitesLinkvue_type_template_id_45607d28_hoisted_1)]); } +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SiteSelector/AllSitesLink.vue?vue&type=template&id=45607d28 + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/SiteSelector/AllSitesLink.vue?vue&type=script&lang=ts + +/* harmony default export */ var AllSitesLinkvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + href: String, + allSitesText: String + }, + emits: ['click'], + methods: { + onClick: function onClick(event) { + this.$emit('click', event); + } + } +})); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SiteSelector/AllSitesLink.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SiteSelector/AllSitesLink.vue + + + +AllSitesLinkvue_type_script_lang_ts.render = AllSitesLinkvue_type_template_id_45607d28_render + +/* harmony default export */ var AllSitesLink = (AllSitesLinkvue_type_script_lang_ts); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/SiteSelector/SiteSelector.vue?vue&type=script&lang=ts @@ -6629,187 +6320,36 @@ function debounce(fn) { SiteSelectorvue_type_script_lang_ts.render = SiteSelectorvue_type_template_id_17f03442_render /* harmony default export */ var SiteSelector = (SiteSelectorvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SiteSelector/SiteSelector.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 - */ - - - - -/* harmony default export */ var SiteSelector_adapter = (createAngularJsAdapter({ - component: SiteSelector, - require: '?ngModel', - scope: { - showSelectedSite: { - angularJsBind: '=' - }, - showAllSitesItem: { - angularJsBind: '=' - }, - switchSiteOnSelect: { - angularJsBind: '=' - }, - onlySitesWithAdminAccess: { - angularJsBind: '=' - }, - name: { - angularJsBind: '@' - }, - allSitesText: { - angularJsBind: '@' - }, - allSitesLocation: { - angularJsBind: '@' - }, - placeholder: { - angularJsBind: '@' - }, - modelValue: { - default: function _default(scope, element, attrs) { - if (attrs.siteid && attrs.sitename) { - return { - id: attrs.siteid, - name: Matomo_Matomo.helper.htmlDecode(attrs.sitename) - }; - } - - if (Matomo_Matomo.idSite) { - return { - id: Matomo_Matomo.idSite, - name: Matomo_Matomo.helper.htmlDecode(Matomo_Matomo.siteName) - }; - } +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/QuickAccess/QuickAccess.vue?vue&type=template&id=43fb39c4 - return undefined; - } - } - }, - $inject: ['$timeout'], - directiveName: 'piwikSiteselector', - events: { - 'update:modelValue': function updateModelValue(newValue, vm, scope, element, attrs, ngModel, $timeout) { - if (newValue && !vm.modelValue || !newValue && vm.modelValue || newValue.id !== vm.modelValue.id) { - $timeout(function () { - scope.value = newValue; - element.attr('siteid', newValue.id); - element.trigger('change', newValue); - - if (ngModel) { - ngModel.$setViewValue(newValue); - ngModel.$render(); // not called automatically by the digest - } - }); - } - }, - blur: function blur(event, vm, scope) { - setTimeout(function () { - return scope.$apply(); - }); - } - }, - postCreate: function postCreate(vm, scope, element, attrs, controller) { - var ngModel = controller; - scope.$watch('value', function (newVal) { - Object(external_commonjs_vue_commonjs2_vue_root_Vue_["nextTick"])(function () { - if (newVal !== vm.modelValue) { - vm.modelValue = newVal; - } - }); - }); - - if (attrs.siteid && attrs.sitename) { - scope.value = { - id: attrs.siteid, - name: Matomo_Matomo.helper.htmlDecode(attrs.sitename) - }; - vm.modelValue = scope.value; - } else if (Matomo_Matomo.idSite) { - scope.value = { - id: Matomo_Matomo.idSite, - name: Matomo_Matomo.helper.htmlDecode(Matomo_Matomo.siteName) - }; - vm.modelValue = scope.value; - } // setup ng-model mapping - - - if (ngModel) { - ngModel.$setViewValue(vm.modelValue); - - ngModel.$render = function () { - Object(external_commonjs_vue_commonjs2_vue_root_Vue_["nextTick"])(function () { - Object(external_commonjs_vue_commonjs2_vue_root_Vue_["nextTick"])(function () { - if (window.angular.isString(ngModel.$viewValue)) { - vm.modelValue = JSON.parse(ngModel.$viewValue); - } else { - vm.modelValue = ngModel.$viewValue; - } - }); - }); - }; - } - } -})); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SiteSelector/SitesStore.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 siteSelectorModelAdapter() { - return { - get initialSites() { - return SiteSelector_SitesStore.initialSites.value; - }, - - loadSite: SiteSelector_SitesStore.loadSite.bind(SiteSelector_SitesStore), - loadInitialSites: function loadInitialSites() { - return cloneThenApply(SiteSelector_SitesStore.loadInitialSites()); - }, - searchSite: function searchSite() { - return cloneThenApply(SiteSelector_SitesStore.searchSite.apply(SiteSelector_SitesStore, arguments)); - } - }; -} - -window.angular.module('piwikApp.service').factory('siteSelectorModel', siteSelectorModelAdapter); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/QuickAccess/QuickAccess.vue?vue&type=template&id=21ce66fa - -var QuickAccessvue_type_template_id_21ce66fa_hoisted_1 = { +var QuickAccessvue_type_template_id_43fb39c4_hoisted_1 = { ref: "root", class: "quickAccessInside" }; -var QuickAccessvue_type_template_id_21ce66fa_hoisted_2 = ["title", "placeholder"]; -var QuickAccessvue_type_template_id_21ce66fa_hoisted_3 = { +var QuickAccessvue_type_template_id_43fb39c4_hoisted_2 = ["title", "placeholder"]; +var QuickAccessvue_type_template_id_43fb39c4_hoisted_3 = { class: "dropdown" }; -var QuickAccessvue_type_template_id_21ce66fa_hoisted_4 = { +var QuickAccessvue_type_template_id_43fb39c4_hoisted_4 = { class: "no-result" }; -var QuickAccessvue_type_template_id_21ce66fa_hoisted_5 = ["onClick"]; -var QuickAccessvue_type_template_id_21ce66fa_hoisted_6 = ["onMouseenter", "onClick"]; -var QuickAccessvue_type_template_id_21ce66fa_hoisted_7 = { +var QuickAccessvue_type_template_id_43fb39c4_hoisted_5 = ["onClick"]; +var QuickAccessvue_type_template_id_43fb39c4_hoisted_6 = ["onMouseenter", "onClick"]; +var QuickAccessvue_type_template_id_43fb39c4_hoisted_7 = { class: "quickAccessMatomoSearch" }; -var QuickAccessvue_type_template_id_21ce66fa_hoisted_8 = ["onMouseenter", "onClick"]; -var QuickAccessvue_type_template_id_21ce66fa_hoisted_9 = ["textContent"]; -var QuickAccessvue_type_template_id_21ce66fa_hoisted_10 = { +var QuickAccessvue_type_template_id_43fb39c4_hoisted_8 = ["onMouseenter", "onClick"]; +var QuickAccessvue_type_template_id_43fb39c4_hoisted_9 = ["textContent"]; +var QuickAccessvue_type_template_id_43fb39c4_hoisted_10 = { class: "quick-access-category helpCategory" }; -var QuickAccessvue_type_template_id_21ce66fa_hoisted_11 = ["href"]; -function QuickAccessvue_type_template_id_21ce66fa_render(_ctx, _cache, $props, $setup, $data, $options) { +var QuickAccessvue_type_template_id_43fb39c4_hoisted_11 = ["href"]; +function QuickAccessvue_type_template_id_43fb39c4_render(_ctx, _cache, $props, $setup, $data, $options) { var _directive_focus_if = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("focus-if"); var _directive_focus_anywhere_but_here = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("focus-anywhere-but-here"); - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", QuickAccessvue_type_template_id_21ce66fa_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", QuickAccessvue_type_template_id_43fb39c4_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { class: "icon-search", onMouseenter: _cache[0] || (_cache[0] = function ($event) { return _ctx.searchActive = true; @@ -6830,7 +6370,7 @@ function QuickAccessvue_type_template_id_21ce66fa_render(_ctx, _cache, $props, $ title: _ctx.quickAccessTitle, placeholder: _ctx.translate('General_Search'), ref: "input" - }, null, 40, QuickAccessvue_type_template_id_21ce66fa_hoisted_2), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelText"], _ctx.searchTerm], [_directive_focus_if, {}, _ctx.searchActive]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", QuickAccessvue_type_template_id_21ce66fa_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", QuickAccessvue_type_template_id_21ce66fa_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_SearchNoResults')), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !(_ctx.numMenuItems > 0 || _ctx.sites.length)]]), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.menuItems, function (subcategory) { + }, null, 40, QuickAccessvue_type_template_id_43fb39c4_hoisted_2), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelText"], _ctx.searchTerm], [_directive_focus_if, {}, _ctx.searchActive]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", QuickAccessvue_type_template_id_43fb39c4_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", QuickAccessvue_type_template_id_43fb39c4_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_SearchNoResults')), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !(_ctx.numMenuItems > 0 || _ctx.sites.length)]]), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.menuItems, function (subcategory) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("ul", { key: subcategory.title }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", { @@ -6840,7 +6380,7 @@ function QuickAccessvue_type_template_id_21ce66fa_render(_ctx, _cache, $props, $ _ctx.searchMenu(_ctx.searchTerm); } - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(subcategory.title), 9, QuickAccessvue_type_template_id_21ce66fa_hoisted_5), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(subcategory.items, function (submenuEntry) { + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(subcategory.title), 9, QuickAccessvue_type_template_id_43fb39c4_hoisted_5), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(subcategory.items, function (submenuEntry) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["result", { selected: submenuEntry.menuIndex === _ctx.searchIndex @@ -6852,9 +6392,9 @@ function QuickAccessvue_type_template_id_21ce66fa_render(_ctx, _cache, $props, $ return _ctx.selectMenuItem(submenuEntry.index); }, key: submenuEntry.index - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(submenuEntry.name.trim()), 1)], 42, QuickAccessvue_type_template_id_21ce66fa_hoisted_6); + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(submenuEntry.name.trim()), 1)], 42, QuickAccessvue_type_template_id_43fb39c4_hoisted_6); }), 128))]); - }), 128)), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", QuickAccessvue_type_template_id_21ce66fa_hoisted_7, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", { + }), 128)), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", QuickAccessvue_type_template_id_43fb39c4_hoisted_7, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", { class: "quick-access-category websiteCategory" }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_Sites')), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.hasSitesSelector && _ctx.sites.length || _ctx.isLoading]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", { class: "no-result" @@ -6872,8 +6412,8 @@ function QuickAccessvue_type_template_id_21ce66fa_render(_ctx, _cache, $props, $ key: site.idsite }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { textContent: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(site.name) - }, null, 8, QuickAccessvue_type_template_id_21ce66fa_hoisted_9)], 42, QuickAccessvue_type_template_id_21ce66fa_hoisted_8)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.hasSitesSelector && !_ctx.isLoading]]); - }), 128))]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", QuickAccessvue_type_template_id_21ce66fa_hoisted_10, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_HelpResources')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", { + }, null, 8, QuickAccessvue_type_template_id_43fb39c4_hoisted_9)], 42, QuickAccessvue_type_template_id_43fb39c4_hoisted_8)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.hasSitesSelector && !_ctx.isLoading]]); + }), 128))]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", QuickAccessvue_type_template_id_43fb39c4_hoisted_10, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_HelpResources')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", { class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])([{ selected: _ctx.searchIndex === 'help' }, "quick-access-help"]), @@ -6883,11 +6423,11 @@ function QuickAccessvue_type_template_id_21ce66fa_render(_ctx, _cache, $props, $ }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { href: "https://matomo.org?mtm_campaign=App_Help&mtm_source=Matomo_App&mtm_keyword=QuickSearch&s=".concat(encodeURIComponent(_ctx.searchTerm)), target: "_blank" - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CoreHome_SearchOnMatomo', _ctx.searchTerm)), 9, QuickAccessvue_type_template_id_21ce66fa_hoisted_11)], 34)])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.searchTerm && _ctx.searchActive]])], 512)), [[_directive_focus_anywhere_but_here, { + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CoreHome_SearchOnMatomo', _ctx.searchTerm)), 9, QuickAccessvue_type_template_id_43fb39c4_hoisted_11)], 34)])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.searchTerm && _ctx.searchActive]])], 512)), [[_directive_focus_anywhere_but_here, { blur: _ctx.onBlur }]]); } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/QuickAccess/QuickAccess.vue?vue&type=template&id=21ce66fa +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/QuickAccess/QuickAccess.vue?vue&type=template&id=43fb39c4 // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/QuickAccess/QuickAccess.vue?vue&type=script&lang=ts @@ -6932,8 +6472,7 @@ function scrollFirstElementIntoView(element) { mounted: function mounted() { var _this = this; - var root = this.$refs.root; // TODO: temporary, remove after angularjs is removed. - // this is currently needed since angularjs will render a div, then vue will render a div + var root = this.$refs.root; // this is currently needed since vue-entry code will render a div, then vue will render a div // within it, but the top controls and CSS expect to have certain CSS classes in the root // element. // same applies to above watch for searchActive() @@ -6979,7 +6518,7 @@ function scrollFirstElementIntoView(element) { }, computed: { hasSitesSelector: function hasSitesSelector() { - return !!document.querySelector('.top_controls [piwik-siteselector]'); + return !!document.querySelector('.top_controls .siteSelector,.top_controls [vue-entry="CoreHome.SiteSelector"]'); }, quickAccessTitle: function quickAccessTitle() { var searchAreasTitle = ''; @@ -7285,32 +6824,9 @@ function scrollFirstElementIntoView(element) { -QuickAccessvue_type_script_lang_ts.render = QuickAccessvue_type_template_id_21ce66fa_render +QuickAccessvue_type_script_lang_ts.render = QuickAccessvue_type_template_id_43fb39c4_render /* harmony default export */ var QuickAccess = (QuickAccessvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/QuickAccess/QuickAccess.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 - */ - - -/* harmony default export */ var QuickAccess_adapter = (createAngularJsAdapter({ - component: QuickAccess, - directiveName: 'piwikQuickAccess', - events: { - itemSelected: function itemSelected(event, vm, scope, elem, attrs, controller, $timeout) { - $timeout(); - }, - blur: function blur(event, vm, scope) { - setTimeout(function () { - return scope.$apply(); - }); - } - } -})); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/FieldArray/FieldArray.vue?vue&type=template&id=02c82ed4 function FieldArrayvue_type_template_id_02c82ed4_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } @@ -7422,54 +6938,6 @@ var Field = useExternalPluginComponent('CorePluginsAdmin', 'Field'); FieldArrayvue_type_script_lang_ts.render = FieldArrayvue_type_template_id_02c82ed4_render /* harmony default export */ var FieldArray = (FieldArrayvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/FieldArray/FieldArray.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 - */ - - -/* harmony default export */ var FieldArray_adapter = (createAngularJsAdapter({ - component: FieldArray, - require: '?ngModel', - scope: { - name: { - angularJsBind: '=' - }, - field: { - angularJsBind: '=' - } - }, - directiveName: 'matomoFieldArray', - events: { - 'update:modelValue': function updateModelValue(newValue, vm, scope, element, attrs, ngModel) { - if (newValue !== vm.modelValue) { - element.trigger('change', newValue); - - if (ngModel) { - ngModel.$setViewValue(newValue); - } - } - } - }, - postCreate: function postCreate(vm, scope, element, attrs, controller) { - var ngModel = controller; // setup ng-model mapping - - if (ngModel) { - ngModel.$setViewValue(vm.modelValue); - - ngModel.$render = function () { - if (window.angular.isString(ngModel.$viewValue)) { - vm.modelValue = JSON.parse(ngModel.$viewValue); - } else { - vm.modelValue = ngModel.$viewValue; - } - }; - } - } -})); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/MultiPairField/MultiPairField.vue?vue&type=template&id=340e896b function MultiPairFieldvue_type_template_id_340e896b_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } @@ -7706,110 +7174,53 @@ var MultiPairFieldvue_type_script_lang_ts_Field = useExternalPluginComponent('Co MultiPairFieldvue_type_script_lang_ts.render = MultiPairFieldvue_type_template_id_340e896b_render /* harmony default export */ var MultiPairField = (MultiPairFieldvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/MultiPairField/MultiPairField.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 - */ - +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/PeriodSelector/PeriodSelector.vue?vue&type=template&id=a5653966 -/* harmony default export */ var MultiPairField_adapter = (createAngularJsAdapter({ - component: MultiPairField, - require: '?ngModel', - scope: { - name: { - angularJsBind: '=' - }, - field1: { - angularJsBind: '=' - }, - field2: { - angularJsBind: '=' - }, - field3: { - angularJsBind: '=' - }, - field4: { - angularJsBind: '=' - } - }, - directiveName: 'matomoMultiPairField', - events: { - 'update:modelValue': function updateModelValue(newValue, vm, scope, element, attrs, ngModel) { - if (newValue !== vm.modelValue) { - element.trigger('change', newValue); - - if (ngModel) { - ngModel.$setViewValue(newValue); - } - } - } - }, - postCreate: function postCreate(vm, scope, element, attrs, controller) { - var ngModel = controller; // setup ng-model mapping - - if (ngModel) { - ngModel.$setViewValue(vm.modelValue); - - ngModel.$render = function () { - if (window.angular.isString(ngModel.$viewValue)) { - vm.modelValue = JSON.parse(ngModel.$viewValue); - } else { - vm.modelValue = ngModel.$viewValue; - } - }; - } - } -})); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/PeriodSelector/PeriodSelector.vue?vue&type=template&id=afcc9ab4 - -var PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_1 = { +var PeriodSelectorvue_type_template_id_a5653966_hoisted_1 = { ref: "root", class: "periodSelector piwikSelector" }; -var PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_2 = ["title"]; +var PeriodSelectorvue_type_template_id_a5653966_hoisted_2 = ["title"]; -var PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_3 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { +var PeriodSelectorvue_type_template_id_a5653966_hoisted_3 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { class: "icon icon-calendar" }, null, -1); -var PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_4 = { +var PeriodSelectorvue_type_template_id_a5653966_hoisted_4 = { id: "periodMore", class: "dropdown" }; -var PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_5 = { +var PeriodSelectorvue_type_template_id_a5653966_hoisted_5 = { class: "flex" }; -var PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_6 = { +var PeriodSelectorvue_type_template_id_a5653966_hoisted_6 = { key: 0, class: "period-date" }; -var PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_7 = { +var PeriodSelectorvue_type_template_id_a5653966_hoisted_7 = { class: "period-type" }; -var PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_8 = { +var PeriodSelectorvue_type_template_id_a5653966_hoisted_8 = { id: "otherPeriods" }; -var PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_9 = ["onDblclick", "title"]; -var PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_10 = ["id", "checked", "onChange", "onDblclick"]; -var PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_11 = { +var PeriodSelectorvue_type_template_id_a5653966_hoisted_9 = ["onDblclick", "title"]; +var PeriodSelectorvue_type_template_id_a5653966_hoisted_10 = ["id", "checked", "onChange", "onDblclick"]; +var PeriodSelectorvue_type_template_id_a5653966_hoisted_11 = { key: 0, class: "compare-checkbox" }; -var PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_12 = { +var PeriodSelectorvue_type_template_id_a5653966_hoisted_12 = { id: "comparePeriodToDropdown" }; -var PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_13 = { +var PeriodSelectorvue_type_template_id_a5653966_hoisted_13 = { key: 1, class: "compare-date-range" }; -var PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_14 = { +var PeriodSelectorvue_type_template_id_a5653966_hoisted_14 = { id: "comparePeriodStartDate" }; -var PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_15 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { +var PeriodSelectorvue_type_template_id_a5653966_hoisted_15 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { class: "compare-dates-separator" }, null, -1); @@ -7827,7 +7238,7 @@ var _hoisted_19 = { var _hoisted_20 = { class: "loadingSegment" }; -function PeriodSelectorvue_type_template_id_afcc9ab4_render(_ctx, _cache, $props, $setup, $data, $options) { +function PeriodSelectorvue_type_template_id_a5653966_render(_ctx, _cache, $props, $setup, $data, $options) { var _component_DateRangePicker = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("DateRangePicker"); var _component_PeriodDatePicker = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("PeriodDatePicker"); @@ -7838,13 +7249,13 @@ function PeriodSelectorvue_type_template_id_afcc9ab4_render(_ctx, _cache, $props var _directive_expand_on_click = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("expand-on-click"); - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", PeriodSelectorvue_type_template_id_a5653966_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { ref: "title", id: "date", class: "title", tabindex: "-1", title: _ctx.translate('General_ChooseDate', _ctx.currentlyViewingText) - }, [PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.currentlyViewingText), 1)], 8, PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_4, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_DateRangePicker, { + }, [PeriodSelectorvue_type_template_id_a5653966_hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.currentlyViewingText), 1)], 8, PeriodSelectorvue_type_template_id_a5653966_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PeriodSelectorvue_type_template_id_a5653966_hoisted_4, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PeriodSelectorvue_type_template_id_a5653966_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_DateRangePicker, { class: "period-range", "start-date": _ctx.startRangeDate, "end-date": _ctx.endRangeDate, @@ -7854,14 +7265,14 @@ function PeriodSelectorvue_type_template_id_afcc9ab4_render(_ctx, _cache, $props onSubmit: _cache[1] || (_cache[1] = function ($event) { return _ctx.onApplyClicked(); }) - }, null, 8, ["start-date", "end-date"]), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.selectedPeriod === 'range']]), _ctx.selectedPeriod !== 'range' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_PeriodDatePicker, { + }, null, 8, ["start-date", "end-date"]), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.selectedPeriod === 'range']]), _ctx.selectedPeriod !== 'range' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", PeriodSelectorvue_type_template_id_a5653966_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_PeriodDatePicker, { id: "datepicker", period: _ctx.selectedPeriod, date: _ctx.periodValue === _ctx.selectedPeriod ? _ctx.dateValue : null, onSelect: _cache[2] || (_cache[2] = function ($event) { return _ctx.setPiwikPeriodAndDate(_ctx.selectedPeriod, $event.date); }) - }, null, 8, ["period", "date"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_7, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h6", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Period')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_8, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.periodsFiltered, function (period) { + }, null, 8, ["period", "date"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PeriodSelectorvue_type_template_id_a5653966_hoisted_7, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h6", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Period')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PeriodSelectorvue_type_template_id_a5653966_hoisted_8, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.periodsFiltered, function (period) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", { key: period }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { @@ -7886,14 +7297,14 @@ function PeriodSelectorvue_type_template_id_afcc9ab4_render(_ctx, _cache, $props onDblclick: function onDblclick($event) { return _ctx.changeViewedPeriod(period); } - }, null, 40, PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_10), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelRadio"], _ctx.selectedPeriod]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.getPeriodDisplayText(period)), 1)], 42, PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_9)]); - }), 128))])])]), _ctx.isComparisonEnabled ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_11, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + }, null, 40, PeriodSelectorvue_type_template_id_a5653966_hoisted_10), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelRadio"], _ctx.selectedPeriod]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.getPeriodDisplayText(period)), 1)], 42, PeriodSelectorvue_type_template_id_a5653966_hoisted_9)]); + }), 128))])])]), _ctx.isComparisonEnabled ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", PeriodSelectorvue_type_template_id_a5653966_hoisted_11, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { id: "comparePeriodTo", type: "checkbox", "onUpdate:modelValue": _cache[4] || (_cache[4] = function ($event) { return _ctx.isComparing = $event; }) - }, null, 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelCheckbox"], _ctx.isComparing]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_CompareTo')), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + }, null, 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelCheckbox"], _ctx.isComparing]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_CompareTo')), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PeriodSelectorvue_type_template_id_a5653966_hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { modelValue: _ctx.comparePeriodType, "onUpdate:modelValue": _cache[5] || (_cache[5] = function ($event) { return _ctx.comparePeriodType = $event; @@ -7906,7 +7317,7 @@ function PeriodSelectorvue_type_template_id_afcc9ab4_render(_ctx, _cache, $props options: _ctx.comparePeriodDropdownOptions, "full-width": true, disabled: !_ctx.isComparing - }, null, 8, ["modelValue", "style", "options", "disabled"])])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.isComparing && _ctx.comparePeriodType === 'custom' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_14, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + }, null, 8, ["modelValue", "style", "options", "disabled"])])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.isComparing && _ctx.comparePeriodType === 'custom' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", PeriodSelectorvue_type_template_id_a5653966_hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PeriodSelectorvue_type_template_id_a5653966_hoisted_14, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { modelValue: _ctx.compareStartDate, "onUpdate:modelValue": _cache[6] || (_cache[6] = function ($event) { return _ctx.compareStartDate = $event; @@ -7916,7 +7327,7 @@ function PeriodSelectorvue_type_template_id_afcc9ab4_render(_ctx, _cache, $props "full-width": true, title: _ctx.translate('CoreHome_StartDate'), placeholder: 'YYYY-MM-DD' - }, null, 8, ["modelValue", "title"])])]), PeriodSelectorvue_type_template_id_afcc9ab4_hoisted_15, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_16, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + }, null, 8, ["modelValue", "title"])])]), PeriodSelectorvue_type_template_id_a5653966_hoisted_15, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_16, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { modelValue: _ctx.compareEndDate, "onUpdate:modelValue": _cache[7] || (_cache[7] = function ($event) { return _ctx.compareEndDate = $event; @@ -7941,50 +7352,8 @@ function PeriodSelectorvue_type_template_id_afcc9ab4_render(_ctx, _cache, $props expander: 'title' }]]); } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/PeriodSelector/PeriodSelector.vue?vue&type=template&id=afcc9ab4 - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?vue&type=template&id=7c5fe406 - -var ActivityIndicatorvue_type_template_id_7c5fe406_hoisted_1 = { - class: "loadingPiwik" -}; - -var ActivityIndicatorvue_type_template_id_7c5fe406_hoisted_2 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { - src: "plugins/Morpheus/images/loading-blue.gif", - alt: "" -}, null, -1); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/PeriodSelector/PeriodSelector.vue?vue&type=template&id=a5653966 -function ActivityIndicatorvue_type_template_id_7c5fe406_render(_ctx, _cache, $props, $setup, $data, $options) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ActivityIndicatorvue_type_template_id_7c5fe406_hoisted_1, [ActivityIndicatorvue_type_template_id_7c5fe406_hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.loadingMessage), 1)], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.loading]]); -} -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?vue&type=template&id=7c5fe406 - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?vue&type=script&lang=ts - - -/* harmony default export */ var ActivityIndicatorvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - loading: { - type: Boolean, - required: true, - default: false - }, - loadingMessage: { - type: String, - required: false, - default: translate('General_LoadingData') - } - } -})); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue - - - -ActivityIndicatorvue_type_script_lang_ts.render = ActivityIndicatorvue_type_template_id_7c5fe406_render - -/* harmony default export */ var ActivityIndicator = (ActivityIndicatorvue_type_script_lang_ts); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/PeriodSelector/PeriodSelector.vue?vue&type=script&lang=ts function PeriodSelectorvue_type_script_lang_ts_slicedToArray(arr, i) { return PeriodSelectorvue_type_script_lang_ts_arrayWithHoles(arr) || PeriodSelectorvue_type_script_lang_ts_iterableToArrayLimit(arr, i) || PeriodSelectorvue_type_script_lang_ts_unsupportedIterableToArray(arr, i) || PeriodSelectorvue_type_script_lang_ts_nonIterableRest(); } @@ -8228,7 +7597,7 @@ function isValidDate(d) { var compareParams = this.selectedComparisonParams; var baseParams; - if (Matomo_Matomo.helper.isAngularRenderingThePage()) { + if (Matomo_Matomo.helper.isReportingPage()) { this.closePeriodSelector(); baseParams = src_MatomoUrl_MatomoUrl.hashParsed.value; } else { @@ -8346,27 +7715,9 @@ function isValidDate(d) { -PeriodSelectorvue_type_script_lang_ts.render = PeriodSelectorvue_type_template_id_afcc9ab4_render +PeriodSelectorvue_type_script_lang_ts.render = PeriodSelectorvue_type_template_id_a5653966_render /* harmony default export */ var PeriodSelector = (PeriodSelectorvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/PeriodSelector/PeriodSelector.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 - */ - - -/* harmony default export */ var PeriodSelector_adapter = (createAngularJsAdapter({ - component: PeriodSelector, - scope: { - periods: { - angularJsBind: '<' - } - }, - directiveName: 'piwikPeriodSelector' -})); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.vue?vue&type=template&id=bfd51afa var ReportingMenuvue_type_template_id_bfd51afa_hoisted_1 = { @@ -8513,553 +7864,6 @@ function ReportingMenuvue_type_template_id_bfd51afa_render(_ctx, _cache, $props, } // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.vue?vue&type=template&id=bfd51afa -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Notification/Notification.vue?vue&type=template&id=52166f8a - -var Notificationvue_type_template_id_52166f8a_hoisted_1 = { - key: 0 -}; -var Notificationvue_type_template_id_52166f8a_hoisted_2 = ["data-notification-instance-id"]; -var Notificationvue_type_template_id_52166f8a_hoisted_3 = { - key: 1 -}; -var Notificationvue_type_template_id_52166f8a_hoisted_4 = { - class: "notification-body" -}; -var Notificationvue_type_template_id_52166f8a_hoisted_5 = ["innerHTML"]; -var Notificationvue_type_template_id_52166f8a_hoisted_6 = { - key: 1 -}; -function Notificationvue_type_template_id_52166f8a_render(_ctx, _cache, $props, $setup, $data, $options) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Transition"], { - name: _ctx.type === 'toast' ? 'slow-fade-out' : undefined, - onAfterLeave: _cache[1] || (_cache[1] = function ($event) { - return _ctx.toastClosed(); - }) - }, { - default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { - return [!_ctx.deleted ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Notificationvue_type_template_id_52166f8a_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Transition"], { - name: _ctx.type === 'toast' ? 'toast-slide-up' : undefined, - appear: "" - }, { - default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { - return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Transition"], { - name: _ctx.animate ? 'fade-in' : undefined, - appear: "" - }, { - default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { - return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { - class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["notification system", _ctx.cssClasses]), - style: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeStyle"])(_ctx.style), - ref: "root", - "data-notification-instance-id": _ctx.notificationInstanceId - }, [_ctx.canClose ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("button", { - key: 0, - type: "button", - class: "close", - "data-dismiss": "alert", - onClick: _cache[0] || (_cache[0] = function ($event) { - return _ctx.closeNotification($event); - }) - }, " × ")) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.title ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("strong", Notificationvue_type_template_id_52166f8a_hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.title), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", Notificationvue_type_template_id_52166f8a_hoisted_4, [_ctx.message ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { - key: 0, - innerHTML: _ctx.$sanitize(_ctx.message) - }, null, 8, Notificationvue_type_template_id_52166f8a_hoisted_5)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !_ctx.message ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Notificationvue_type_template_id_52166f8a_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default")])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])], 14, Notificationvue_type_template_id_52166f8a_hoisted_2)]; - }), - _: 3 - }, 8, ["name"])])]; - }), - _: 3 - }, 8, ["name"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]; - }), - _: 3 - }, 8, ["name"]); -} -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/Notification.vue?vue&type=template&id=52166f8a - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Notification/Notification.vue?vue&type=script&lang=ts - - -var Notificationvue_type_script_lang_ts_window = window, - Notificationvue_type_script_lang_ts_$ = Notificationvue_type_script_lang_ts_window.$; -/* harmony default export */ var Notificationvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - notificationId: String, - // NOTE: notificationId refers to server side ID for notifications stored in the session. - // this ID is just so it can be selected outside of this component (just for scrolling). - notificationInstanceId: String, - title: String, - context: String, - type: String, - noclear: Boolean, - toastLength: { - type: Number, - default: 12 * 1000 - }, - style: [String, Object], - animate: Boolean, - message: String, - cssClass: String - }, - computed: { - cssClasses: function cssClasses() { - var result = {}; - - if (this.context) { - result["notification-".concat(this.context)] = true; - } - - if (this.cssClass) { - result[this.cssClass] = true; - } - - return result; - }, - canClose: function canClose() { - if (this.type === 'persistent') { - // otherwise it is never possible to dismiss the notification - return true; - } - - return !this.noclear; - } - }, - emits: ['closed'], - data: function data() { - return { - deleted: false - }; - }, - mounted: function mounted() { - var _this = this; - - var addToastEvent = function addToastEvent() { - setTimeout(function () { - _this.deleted = true; - }, _this.toastLength); - }; - - if (this.type === 'toast') { - addToastEvent(); - } - - if (this.style) { - Notificationvue_type_script_lang_ts_$(this.$refs.root).css(this.style); - } - }, - methods: { - toastClosed: function toastClosed() { - var _this2 = this; - - Object(external_commonjs_vue_commonjs2_vue_root_Vue_["nextTick"])(function () { - _this2.$emit('closed'); - }); - }, - closeNotification: function closeNotification(event) { - var _this3 = this; - - if (this.canClose && event && event.target) { - this.deleted = true; - Object(external_commonjs_vue_commonjs2_vue_root_Vue_["nextTick"])(function () { - _this3.$emit('closed'); - }); - } - - this.markNotificationAsRead(); - }, - markNotificationAsRead: function markNotificationAsRead() { - if (!this.notificationId) { - return; - } - - AjaxHelper_AjaxHelper.post({ - module: 'CoreHome', - action: 'markNotificationAsRead' - }, { - notificationId: this.notificationId - }, { - withTokenInUrl: true - }); - } - } -})); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/Notification.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/Notification.vue - - - -Notificationvue_type_script_lang_ts.render = Notificationvue_type_template_id_52166f8a_render - -/* harmony default export */ var Notification = (Notificationvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/Notification.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 - */ - - -/* harmony default export */ var Notification_adapter = (createAngularJsAdapter({ - component: Notification, - scope: { - notificationId: { - angularJsBind: '@?' - }, - title: { - angularJsBind: '@?notificationTitle' - }, - context: { - angularJsBind: '@?' - }, - type: { - angularJsBind: '@?' - }, - noclear: { - angularJsBind: '@?', - transform: transformAngularJsBoolAttr - }, - toastLength: { - angularJsBind: '@?' - } - }, - directiveName: 'piwikNotification', - transclude: true -})); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/Notifications.store.ts -function Notifications_store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function Notifications_store_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function Notifications_store_createClass(Constructor, protoProps, staticProps) { if (protoProps) Notifications_store_defineProperties(Constructor.prototype, protoProps); if (staticProps) Notifications_store_defineProperties(Constructor, staticProps); return Constructor; } - -function Notifications_store_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - - - - -var Notifications_store_window = window, - Notifications_store_$ = Notifications_store_window.$; - -var Notifications_store_NotificationsStore = /*#__PURE__*/function () { - function NotificationsStore() { - Notifications_store_classCallCheck(this, NotificationsStore); - - Notifications_store_defineProperty(this, "privateState", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["reactive"])({ - notifications: [] - })); - - Notifications_store_defineProperty(this, "nextNotificationId", 0); - } - - Notifications_store_createClass(NotificationsStore, [{ - key: "state", - get: function get() { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(this.privateState); - } - }, { - key: "appendNotification", - value: function appendNotification(notification) { - this.checkMessage(notification.message); // remove existing notification before adding - - if (notification.id) { - this.remove(notification.id); - } - - this.privateState.notifications.push(notification); - } - }, { - key: "prependNotification", - value: function prependNotification(notification) { - this.checkMessage(notification.message); // remove existing notification before adding - - if (notification.id) { - this.remove(notification.id); - } - - this.privateState.notifications.unshift(notification); - } - /** - * Removes a previously shown notification having the given notification id. - */ - - }, { - key: "remove", - value: function remove(id) { - this.privateState.notifications = this.privateState.notifications.filter(function (n) { - return n.id !== id; - }); - } - }, { - key: "parseNotificationDivs", - value: function parseNotificationDivs() { - var _this = this; - - var $notificationNodes = Notifications_store_$('[data-role="notification"]'); - var notificationsToShow = []; - $notificationNodes.each(function (index, notificationNode) { - var $notificationNode = Notifications_store_$(notificationNode); - var attributes = $notificationNode.data(); - var message = $notificationNode.html(); - - if (message) { - notificationsToShow.push(Object.assign(Object.assign({}, attributes), {}, { - message: message, - animate: false - })); - } - - $notificationNodes.remove(); - }); - notificationsToShow.forEach(function (n) { - return _this.show(n); - }); - } - }, { - key: "clearTransientNotifications", - value: function clearTransientNotifications() { - this.privateState.notifications = this.privateState.notifications.filter(function (n) { - return n.type !== 'transient'; - }); - } - /** - * Creates a notification and shows it to the user. - */ - - }, { - key: "show", - value: function show(notification) { - this.checkMessage(notification.message); - var addMethod = notification.prepend ? this.prependNotification : this.appendNotification; - var notificationPosition = '#notificationContainer'; - - if (notification.placeat) { - notificationPosition = notification.placeat; - } else { - // If a modal is open, we want to make sure the error message is visible and therefore - // show it within the opened modal - var modalSelector = '.modal.open .modal-content'; - var modal = document.querySelector(modalSelector); - - if (modal) { - if (!modal.querySelector('#modalNotificationContainer')) { - Notifications_store_$(modal).prepend('<div id="modalNotificationContainer"/>'); - } - - notificationPosition = "".concat(modalSelector, " #modalNotificationContainer"); - addMethod = this.prependNotification; - } - } - - var group = notification.group || (notificationPosition ? notificationPosition.toString() : ''); - this.initializeNotificationContainer(notificationPosition, group); - var notificationInstanceId = (this.nextNotificationId += 1).toString(); - addMethod.call(this, Object.assign(Object.assign({}, notification), {}, { - noclear: !!notification.noclear, - group: group, - notificationId: notification.id, - notificationInstanceId: notificationInstanceId, - type: notification.type || 'transient' - })); - return notificationInstanceId; - } - }, { - key: "scrollToNotification", - value: function scrollToNotification(notificationInstanceId) { - setTimeout(function () { - var element = document.querySelector("[data-notification-instance-id='".concat(notificationInstanceId, "']")); - - if (element) { - Matomo_Matomo.helper.lazyScrollTo(element, 250); - } - }); - } - /** - * Shows a notification at a certain point with a quick upwards animation. - */ - - }, { - key: "toast", - value: function toast(notification) { - this.checkMessage(notification.message); - var $placeat = notification.placeat ? Notifications_store_$(notification.placeat) : undefined; - - if (!$placeat || !$placeat.length) { - throw new Error('A valid selector is required for the placeat option when using Notification.toast().'); - } - - var toastElement = document.createElement('div'); - toastElement.style.position = 'absolute'; - toastElement.style.top = "".concat($placeat.offset().top, "px"); - toastElement.style.left = "".concat($placeat.offset().left, "px"); - toastElement.style.zIndex = '1000'; - document.body.appendChild(toastElement); - var app = createVueApp({ - render: function render() { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(Notification, Object.assign(Object.assign({}, notification), {}, { - notificationId: notification.id, - type: 'toast', - onClosed: function onClosed() { - app.unmount(); - } - })); - } - }); - app.mount(toastElement); - } - }, { - key: "initializeNotificationContainer", - value: function initializeNotificationContainer(notificationPosition, group) { - if (!notificationPosition) { - return; - } - - var $container = Notifications_store_$(notificationPosition); - - if ($container.children('.notification-group').length) { - return; - } // avoiding a dependency cycle. won't need to do this when NotificationGroup's do not need - // to be dynamically initialized. - - - var NotificationGroup = window.CoreHome.NotificationGroup; // eslint-disable-line - - var app = createVueApp({ - template: '<NotificationGroup :group="group"></NotificationGroup>', - data: function data() { - return { - group: group - }; - } - }); - app.component('NotificationGroup', NotificationGroup); - app.mount($container[0]); - } - }, { - key: "checkMessage", - value: function checkMessage(message) { - if (!message) { - throw new Error('No message given, cannot display notification'); - } - } - }]); - - return NotificationsStore; -}(); - -var Notifications_store_instance = new Notifications_store_NotificationsStore(); -/* harmony default export */ var Notifications_store = (Notifications_store_instance); // parse notifications on dom load - -Notifications_store_$(function () { - return Notifications_store_instance.parseNotificationDivs(); -}); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/Notifications.store.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 - */ - -window.angular.module('piwikApp').factory('notifications', function () { - return Notifications_store; -}); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Notification/NotificationGroup.vue?vue&type=template&id=672051da - -var NotificationGroupvue_type_template_id_672051da_hoisted_1 = { - class: "notification-group" -}; -var NotificationGroupvue_type_template_id_672051da_hoisted_2 = ["innerHTML"]; -function NotificationGroupvue_type_template_id_672051da_render(_ctx, _cache, $props, $setup, $data, $options) { - var _component_Notification = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Notification"); - - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", NotificationGroupvue_type_template_id_672051da_hoisted_1, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.notifications, function (notification, index) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_Notification, { - key: notification.id || "no-id-".concat(index), - "notification-id": notification.id, - title: notification.title, - context: notification.context, - type: notification.type, - noclear: notification.noclear, - "toast-length": notification.toastLength, - style: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeStyle"])(notification.style), - animate: notification.animate, - message: notification.message, - "notification-instance-id": notification.notificationInstanceId, - "css-class": notification.class, - onClosed: function onClosed($event) { - return _ctx.removeNotification(notification.id); - } - }, { - default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { - return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { - innerHTML: _ctx.$sanitize(notification.message) - }, null, 8, NotificationGroupvue_type_template_id_672051da_hoisted_2)]; - }), - _: 2 - }, 1032, ["notification-id", "title", "context", "type", "noclear", "toast-length", "style", "animate", "message", "notification-instance-id", "css-class", "onClosed"]); - }), 128))]); -} -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/NotificationGroup.vue?vue&type=template&id=672051da - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Notification/NotificationGroup.vue?vue&type=script&lang=ts - - - -/* harmony default export */ var NotificationGroupvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - group: String - }, - components: { - Notification: Notification - }, - computed: { - notifications: function notifications() { - var _this = this; - - return Notifications_store.state.notifications.filter(function (n) { - if (_this.group) { - return _this.group === n.group; - } - - return !n.group; - }); - } - }, - methods: { - removeNotification: function removeNotification(id) { - Notifications_store.remove(id); - } - } -})); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/NotificationGroup.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/NotificationGroup.vue - - - -NotificationGroupvue_type_script_lang_ts.render = NotificationGroupvue_type_template_id_672051da_render - -/* harmony default export */ var Notification_NotificationGroup = (NotificationGroupvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Notification/index.ts -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - - - - - // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportingPages/ReportingPages.store.ts function ReportingPages_store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -9743,106 +8547,6 @@ var REPORTING_HELP_NOTIFICATION_ID = 'reportingmenu-help'; ReportingMenuvue_type_script_lang_ts.render = ReportingMenuvue_type_template_id_bfd51afa_render /* harmony default export */ var ReportingMenu = (ReportingMenuvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.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 - */ - - -/* harmony default export */ var ReportingMenu_adapter = (createAngularJsAdapter({ - component: ReportingMenu, - directiveName: 'piwikReportingMenu' -})); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.store.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 - */ - - // removed boolean active property from objects in vue so we can keep the store immutable, but, -// angularjs version should still have them - -function addActiveMenuItems(menu) { - menu.forEach(function (category) { - if (category.id === ReportingMenu_store.activeCategory.value) { - category.active = true; - (category.subcategories || []).forEach(function (subcat) { - if (subcat.id === ReportingMenu_store.activeSubcategory.value) { - subcat.active = true; - (subcat.subcategories || []).forEach(function (subsubcat) { - if (subsubcat.id === ReportingMenu_store.activeSubsubcategory.value) { - subsubcat.active = true; - } - }); - } - }); - } - }); - return menu; -} - -function reportingMenuModelAdapter() { - return { - get menu() { - return ReportingMenu_store.menu.value; - }, - - findSubcategory: ReportingMenu_store.findSubcategory.bind(ReportingMenu_store), - reloadMenuItems: function reloadMenuItems() { - return ReportingMenu_store.reloadMenuItems().then(function (p) { - return addActiveMenuItems(cloneThenApply(p)); - }); - }, - fetchMenuItems: function fetchMenuItems() { - return ReportingMenu_store.fetchMenuItems().then(function (p) { - return addActiveMenuItems(cloneThenApply(p)); - }); - } - }; -} - -window.angular.module('piwikApp.service').factory('reportingMenuModel', reportingMenuModelAdapter); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportingPages/ReportingPages.store.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 reportingPagesModelAdapter() { - return { - get pages() { - return ReportingPages_store.pages.value; - }, - - findPageInCategory: function findPageInCategory() { - return clone(ReportingPages_store.findPageInCategory.apply(ReportingPages_store, arguments)); - }, - findPage: function findPage() { - return clone(ReportingPages_store.findPage.apply(ReportingPages_store, arguments)); - }, - reloadAllPages: function reloadAllPages() { - return ReportingPages_store.reloadAllPages().then(function (p) { - return cloneThenApply(p); - }); - }, - getAllPages: function getAllPages() { - return ReportingPages_store.getAllPages().then(function (p) { - return cloneThenApply(p); - }); - } - }; -} - -window.angular.module('piwikApp.service').factory('reportingPagesModel', reportingPagesModelAdapter); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportMetadata/ReportMetadata.store.ts function ReportMetadata_store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -9914,64 +8618,41 @@ var ReportMetadata_store_ReportMetadataStore = /*#__PURE__*/function () { return ReportMetadataStore; }(); /* harmony default export */ var ReportMetadata_store = (new ReportMetadata_store_ReportMetadataStore()); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportMetadata/ReportMetadata.store.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 - */ - - -window.angular.module('piwikApp.service').factory('reportMetadataModel', function () { - return { - get reports() { - return ReportMetadata_store.reports.value; - }, - - findReport: ReportMetadata_store.findReport.bind(ReportMetadata_store), - fetchReportMetadata: function fetchReportMetadata() { - return ReportMetadata_store.fetchReportMetadata().then(function (m) { - return cloneThenApply(m); - }); - } - }; -}); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/WidgetLoader/WidgetLoader.vue?vue&type=template&id=de9d52d4 +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/WidgetLoader/WidgetLoader.vue?vue&type=template&id=701db217 -var WidgetLoadervue_type_template_id_de9d52d4_hoisted_1 = { +var WidgetLoadervue_type_template_id_701db217_hoisted_1 = { class: "widgetLoader" }; -var WidgetLoadervue_type_template_id_de9d52d4_hoisted_2 = { +var WidgetLoadervue_type_template_id_701db217_hoisted_2 = { key: 0 }; -var WidgetLoadervue_type_template_id_de9d52d4_hoisted_3 = { +var WidgetLoadervue_type_template_id_701db217_hoisted_3 = { key: 1, class: "notification system notification-error" }; -var WidgetLoadervue_type_template_id_de9d52d4_hoisted_4 = { +var WidgetLoadervue_type_template_id_701db217_hoisted_4 = { key: 0, rel: "noreferrer noopener", target: "_blank", href: "https://matomo.org/faq/troubleshooting/faq_19489/" }; -var WidgetLoadervue_type_template_id_de9d52d4_hoisted_5 = { +var WidgetLoadervue_type_template_id_701db217_hoisted_5 = { key: 2, class: "notification system notification-error" }; -var WidgetLoadervue_type_template_id_de9d52d4_hoisted_6 = { +var WidgetLoadervue_type_template_id_701db217_hoisted_6 = { class: "theWidgetContent", ref: "widgetContent" }; -function WidgetLoadervue_type_template_id_de9d52d4_render(_ctx, _cache, $props, $setup, $data, $options) { +function WidgetLoadervue_type_template_id_701db217_render(_ctx, _cache, $props, $setup, $data, $options) { var _component_ActivityIndicator = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ActivityIndicator"); - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", WidgetLoadervue_type_template_id_de9d52d4_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ActivityIndicator, { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", WidgetLoadervue_type_template_id_701db217_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ActivityIndicator, { "loading-message": _ctx.loadingMessage, loading: _ctx.loading - }, null, 8, ["loading-message", "loading"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [_ctx.widgetName ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("h2", WidgetLoadervue_type_template_id_de9d52d4_hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.widgetName), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !_ctx.loadingFailedRateLimit ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", WidgetLoadervue_type_template_id_de9d52d4_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ErrorRequest', '', '')) + " ", 1), _ctx.hasErrorFaqLink ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", WidgetLoadervue_type_template_id_de9d52d4_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ErrorRequestFaqLink')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", WidgetLoadervue_type_template_id_de9d52d4_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ErrorRateLimit')), 1))], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.loadingFailed]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", WidgetLoadervue_type_template_id_de9d52d4_hoisted_6, null, 512)]); + }, null, 8, ["loading-message", "loading"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [_ctx.widgetName ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("h2", WidgetLoadervue_type_template_id_701db217_hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.widgetName), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !_ctx.loadingFailedRateLimit ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", WidgetLoadervue_type_template_id_701db217_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ErrorRequest', '', '')) + " ", 1), _ctx.hasErrorFaqLink ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", WidgetLoadervue_type_template_id_701db217_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ErrorRequestFaqLink')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", WidgetLoadervue_type_template_id_701db217_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ErrorRateLimit')), 1))], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.loadingFailed]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", WidgetLoadervue_type_template_id_701db217_hoisted_6, null, 512)]); } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/WidgetLoader/WidgetLoader.vue?vue&type=template&id=de9d52d4 +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/WidgetLoader/WidgetLoader.vue?vue&type=template&id=701db217 // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/WidgetLoader/WidgetLoader.vue?vue&type=script&lang=ts @@ -10009,7 +8690,6 @@ function WidgetLoadervue_type_template_id_de9d52d4_render(_ctx, _cache, $props, loadingFailed: false, loadingFailedRateLimit: false, changeCounter: 0, - currentScope: null, lastWidgetAbortController: null }; }, @@ -10053,10 +8733,6 @@ function WidgetLoadervue_type_template_id_de9d52d4_render(_ctx, _cache, $props, var widgetContent = this.$refs.widgetContent; Matomo_Matomo.helper.destroyVueComponent(widgetContent); - if (this.currentScope) { - this.currentScope.$destroy(); - } - if (widgetContent) { widgetContent.innerHTML = ''; } @@ -10144,14 +8820,6 @@ function WidgetLoadervue_type_template_id_de9d52d4_render(_ctx, _cache, $props, } } - var $rootScope = Matomo_Matomo.helper.getAngularDependency('$rootScope'); - var scope = $rootScope.$new(); - _this.currentScope = scope; // compile angularjs first since it will modify all dom nodes, breaking vue bindings - // if they are present - - Matomo_Matomo.helper.compileAngularComponents($content, { - scope: scope - }); Matomo_Matomo.helper.compileVueEntryComponents($content); Notifications_store.parseNotificationDivs(); setTimeout(function () { @@ -10191,37 +8859,18 @@ function WidgetLoadervue_type_template_id_de9d52d4_render(_ctx, _cache, $props, -WidgetLoadervue_type_script_lang_ts.render = WidgetLoadervue_type_template_id_de9d52d4_render +WidgetLoadervue_type_script_lang_ts.render = WidgetLoadervue_type_template_id_701db217_render /* harmony default export */ var WidgetLoader = (WidgetLoadervue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/WidgetLoader/WidgetLoader.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 - */ - - -/* harmony default export */ var WidgetLoader_adapter = (createAngularJsAdapter({ - component: WidgetLoader, - scope: { - piwikWidgetLoader: { - vue: 'widgetParams', - angularJsBind: '=' - }, - widgetName: { - angularJsBind: '@' - } - }, - directiveName: 'piwikWidgetLoader' -})); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/WidgetContainer/WidgetContainer.vue?vue&type=template&id=41745e0f +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/WidgetContainer/WidgetContainer.vue?vue&type=template&id=24121adc -function WidgetContainervue_type_template_id_41745e0f_render(_ctx, _cache, $props, $setup, $data, $options) { +var WidgetContainervue_type_template_id_24121adc_hoisted_1 = { + class: "widget-container" +}; +function WidgetContainervue_type_template_id_24121adc_render(_ctx, _cache, $props, $setup, $data, $options) { var _component_Widget = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Widget"); - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", null, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.actualContainer, function (widget, index) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", WidgetContainervue_type_template_id_24121adc_hoisted_1, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.actualContainer, function (widget, index) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { key: index }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Widget, { @@ -10230,7 +8879,7 @@ function WidgetContainervue_type_template_id_41745e0f_render(_ctx, _cache, $prop }, null, 8, ["widget"])])]); }), 128))]); } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/WidgetContainer/WidgetContainer.vue?vue&type=template&id=41745e0f +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/WidgetContainer/WidgetContainer.vue?vue&type=template&id=24121adc // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/WidgetContainer/WidgetContainer.vue?vue&type=script&lang=ts function WidgetContainervue_type_script_lang_ts_toConsumableArray(arr) { return WidgetContainervue_type_script_lang_ts_arrayWithoutHoles(arr) || WidgetContainervue_type_script_lang_ts_iterableToArray(arr) || WidgetContainervue_type_script_lang_ts_unsupportedIterableToArray(arr) || WidgetContainervue_type_script_lang_ts_nonIterableSpread(); } @@ -10298,27 +8947,9 @@ var Widget = useExternalPluginComponent('CoreHome', 'Widget'); -WidgetContainervue_type_script_lang_ts.render = WidgetContainervue_type_template_id_41745e0f_render +WidgetContainervue_type_script_lang_ts.render = WidgetContainervue_type_template_id_24121adc_render /* harmony default export */ var WidgetContainer = (WidgetContainervue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/WidgetContainer/WidgetContainer.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 - */ - - -/* harmony default export */ var WidgetContainer_adapter = (createAngularJsAdapter({ - component: WidgetContainer, - scope: { - container: { - angularJsBind: '=piwikWidgetContainer' - } - }, - directiveName: 'piwikWidgetContainer' -})); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/WidgetByDimensionContainer/WidgetByDimensionContainer.vue?vue&type=template&id=3681f928 var WidgetByDimensionContainervue_type_template_id_3681f928_hoisted_1 = { @@ -10445,37 +9076,16 @@ function WidgetByDimensionContainervue_type_script_lang_ts_arrayWithHoles(arr) { WidgetByDimensionContainervue_type_script_lang_ts.render = WidgetByDimensionContainervue_type_template_id_3681f928_render /* harmony default export */ var WidgetByDimensionContainer = (WidgetByDimensionContainervue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/WidgetByDimensionContainer/WidgetByDimensionContainer.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 - */ - +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Widget/Widget.vue?vue&type=template&id=33b06f02 -/* harmony default export */ var WidgetByDimensionContainer_adapter = (createAngularJsAdapter({ - component: WidgetByDimensionContainer, - scope: { - widgets: { - angularJsBind: '=piwikWidgetByDimensionContainer', - transform: function transform(v) { - return v.widgets; - } - } - }, - directiveName: 'piwikWidgetByDimensionContainer' -})); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Widget/Widget.vue?vue&type=template&id=23f53472 - -var Widgetvue_type_template_id_23f53472_hoisted_1 = ["id"]; -var Widgetvue_type_template_id_23f53472_hoisted_2 = { +var Widgetvue_type_template_id_33b06f02_hoisted_1 = ["id"]; +var Widgetvue_type_template_id_33b06f02_hoisted_2 = { key: 1 }; -var Widgetvue_type_template_id_23f53472_hoisted_3 = { +var Widgetvue_type_template_id_33b06f02_hoisted_3 = { key: 2 }; -function Widgetvue_type_template_id_23f53472_render(_ctx, _cache, $props, $setup, $data, $options) { +function Widgetvue_type_template_id_33b06f02_render(_ctx, _cache, $props, $setup, $data, $options) { var _component_WidgetLoader = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("WidgetLoader"); var _component_WidgetContainer = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("WidgetContainer"); @@ -10494,15 +9104,15 @@ function Widgetvue_type_template_id_23f53472_render(_ctx, _cache, $props, $setup key: 0, "widget-params": _ctx.actualWidget.parameters, "widget-name": _ctx.actualWidget.name - }, null, 8, ["widget-params", "widget-name"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.actualWidget.isContainer && _ctx.actualWidget.layout !== 'ByDimension' && !this.preventRecursion ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Widgetvue_type_template_id_23f53472_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_WidgetContainer, { + }, null, 8, ["widget-params", "widget-name"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.actualWidget.isContainer && _ctx.actualWidget.layout !== 'ByDimension' && !this.preventRecursion ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Widgetvue_type_template_id_33b06f02_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_WidgetContainer, { container: _ctx.actualWidget.widgets - }, null, 8, ["container"])])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.actualWidget.isContainer && _ctx.actualWidget.layout === 'ByDimension' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Widgetvue_type_template_id_23f53472_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_WidgetByDimensionContainer, { + }, null, 8, ["container"])])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.actualWidget.isContainer && _ctx.actualWidget.layout === 'ByDimension' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Widgetvue_type_template_id_33b06f02_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_WidgetByDimensionContainer, { widgets: _ctx.actualWidget.widgets - }, null, 8, ["widgets"])])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 10, Widgetvue_type_template_id_23f53472_hoisted_1)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showWidget], [_directive_tooltips, { + }, null, 8, ["widgets"])])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 10, Widgetvue_type_template_id_33b06f02_hoisted_1)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showWidget], [_directive_tooltips, { content: _ctx.tooltipContent }]]) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true); } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Widget/Widget.vue?vue&type=template&id=23f53472 +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Widget/Widget.vue?vue&type=template&id=33b06f02 // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Widget/Widget.vue?vue&type=script&lang=ts @@ -10578,7 +9188,7 @@ function findContainer(widgetsByCategory, containerId) { function tooltipContent() { var $this = window.$(this); - if ($this.attr('piwik-field') === '' || $this.hasClass('matomo-form-field')) { + if ($this.hasClass('matomo-form-field')) { // do not show it for form fields return ''; } @@ -10667,33 +9277,9 @@ function findContainer(widgetsByCategory, containerId) { -Widgetvue_type_script_lang_ts.render = Widgetvue_type_template_id_23f53472_render +Widgetvue_type_script_lang_ts.render = Widgetvue_type_template_id_33b06f02_render /* harmony default export */ var Widget_Widget = (Widgetvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Widget/Widget.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 - */ - - -/* harmony default export */ var Widget_adapter = (createAngularJsAdapter({ - component: Widget_Widget, - scope: { - widget: { - angularJsBind: '=?piwikWidget' - }, - widgetized: { - angularJsBind: '=?' - }, - containerid: { - angularJsBind: '@' - } - }, - directiveName: 'piwikWidget' -})); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/ReportingPage/ReportingPage.vue?vue&type=template&id=08ed243e var ReportingPagevue_type_template_id_08ed243e_hoisted_1 = { @@ -11151,19 +9737,6 @@ function hideOnlyRawDataNoticifation() { ReportingPagevue_type_script_lang_ts.render = ReportingPagevue_type_template_id_08ed243e_render /* harmony default export */ var ReportingPage = (ReportingPagevue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportingPage/ReportingPage.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 - */ - - -/* harmony default export */ var ReportingPage_adapter = (createAngularJsAdapter({ - component: ReportingPage, - directiveName: 'piwikReportingPage' -})); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/ReportExport/ReportExportPopover.vue?vue&type=template&id=3d203950 var ReportExportPopovervue_type_template_id_3d203950_hoisted_1 = { @@ -11715,63 +10288,20 @@ var ReportExport_window = window, }); } }); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ReportExport/ReportExport.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 piwikReportExport($timeout) { - return { - restrict: 'A', - scope: { - reportTitle: '@', - requestParams: '@', - reportFormats: '@', - apiMethod: '@', - maxFilterLimit: '@' - }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - link: function piwikReportExportLink(scope, element) { - var binding = { - instance: null, - value: { - reportTitle: scope.reportTitle, - requestParams: scope.requestParams, - reportFormats: typeof scope.reportFormats === 'string' ? JSON.parse(scope.reportFormats) : scope.reportFormats, - apiMethod: scope.apiMethod, - maxFilterLimit: parseInt(scope.maxFilterLimit, 10), - onClose: function onClose() { - $timeout(function () { - window.angular.element(document).injector().get('$rootScope').$apply(); - }, 10); - } - }, - oldValue: null, - modifiers: {}, - dir: {} - }; - ReportExport.mounted(element[0], binding); - } - }; -} -piwikReportExport.$inject = ['$timeout']; -window.angular.module('piwikApp').directive('piwikReportExport', piwikReportExport); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Sparkline/Sparkline.vue?vue&type=template&id=7a628779 +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Sparkline/Sparkline.vue?vue&type=template&id=e9246a38 -var Sparklinevue_type_template_id_7a628779_hoisted_1 = ["src", "width", "height"]; -function Sparklinevue_type_template_id_7a628779_render(_ctx, _cache, $props, $setup, $data, $options) { +var Sparklinevue_type_template_id_e9246a38_hoisted_1 = ["src", "width", "height"]; +function Sparklinevue_type_template_id_e9246a38_render(_ctx, _cache, $props, $setup, $data, $options) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("img", { + class: "sparklineImg", loading: "lazy", alt: "", src: _ctx.sparklineUrl, width: _ctx.width, height: _ctx.height - }, null, 8, Sparklinevue_type_template_id_7a628779_hoisted_1); + }, null, 8, Sparklinevue_type_template_id_e9246a38_hoisted_1); } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Sparkline/Sparkline.vue?vue&type=template&id=7a628779 +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Sparkline/Sparkline.vue?vue&type=template&id=e9246a38 // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Sparkline/Sparkline.vue?vue&type=script&lang=ts function Sparklinevue_type_script_lang_ts_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Sparklinevue_type_script_lang_ts_typeof = function _typeof(obj) { return typeof obj; }; } else { Sparklinevue_type_script_lang_ts_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Sparklinevue_type_script_lang_ts_typeof(obj); } @@ -11859,31 +10389,9 @@ function Sparklinevue_type_script_lang_ts_typeof(obj) { "@babel/helpers - typeof -Sparklinevue_type_script_lang_ts.render = Sparklinevue_type_template_id_7a628779_render +Sparklinevue_type_script_lang_ts.render = Sparklinevue_type_template_id_e9246a38_render /* harmony default export */ var Sparkline = (Sparklinevue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Sparkline/Sparkline.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 - */ - - -/* harmony default export */ var Sparkline_adapter = (createAngularJsAdapter({ - component: Sparkline, - scope: { - seriesIndices: { - angularJsBind: '<' - }, - params: { - angularJsBind: '<' - } - }, - directiveName: 'piwikSparkline', - restrict: 'E' -})); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Progressbar/Progressbar.vue?vue&type=template&id=0048ddd7 var Progressbarvue_type_template_id_0048ddd7_hoisted_1 = { @@ -11949,27 +10457,6 @@ function Progressbarvue_type_template_id_0048ddd7_render(_ctx, _cache, $props, $ Progressbarvue_type_script_lang_ts.render = Progressbarvue_type_template_id_0048ddd7_render /* harmony default export */ var Progressbar = (Progressbarvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Progressbar/Progressbar.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 - */ - - -/* harmony default export */ var Progressbar_adapter = (createAngularJsAdapter({ - component: Progressbar, - scope: { - progress: { - angularJsBind: '=' - }, - label: { - angularJsBind: '=' - } - }, - directiveName: 'piwikProgressbar' -})); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ContentIntro/ContentIntro.ts /*! * Matomo - free/libre analytics platform @@ -11991,23 +10478,6 @@ Progressbarvue_type_script_lang_ts.render = Progressbarvue_type_template_id_0048 }); } }); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ContentIntro/ContentIntro.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 piwikContentIntro() { - return { - restrict: 'A', - link: function piwikContentIntroLink(scope, element) { - ContentIntro.mounted(element[0]); - } - }; -} -window.angular.module('piwikApp').directive('piwikContentIntro', piwikContentIntro); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ContentTable/ContentTable.ts /*! * Matomo - free/libre analytics platform @@ -12041,23 +10511,6 @@ window.angular.module('piwikApp').directive('piwikContentIntro', piwikContentInt }); } }); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ContentTable/ContentTable.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 piwikContentTable() { - return { - restrict: 'A', - link: function piwikContentTableLink(scope, element) { - ContentTable.mounted(element[0]); - } - }; -} -window.angular.module('piwikApp').directive('piwikContentTable', piwikContentTable); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/AjaxForm/AjaxForm.vue?vue&type=template&id=00d5220c var AjaxFormvue_type_template_id_00d5220c_hoisted_1 = { @@ -12178,388 +10631,937 @@ var AjaxFormvue_type_script_lang_ts_window = window, AjaxFormvue_type_script_lang_ts.render = AjaxFormvue_type_template_id_00d5220c_render /* harmony default export */ var AjaxForm = (AjaxFormvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/AjaxForm/AjaxForm.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 - */ +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Passthrough/Passthrough.vue?vue&type=template&id=6f9e3dd3 +function Passthroughvue_type_template_id_6f9e3dd3_render(_ctx, _cache, $props, $setup, $data, $options) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default"); +} +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Passthrough/Passthrough.vue?vue&type=template&id=6f9e3dd3 +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Passthrough/Passthrough.vue?vue&type=script&lang=ts -var AjaxForm_adapter_window = window, - AjaxForm_adapter_$ = AjaxForm_adapter_window.$; -/** - * AngularJS directive that manages an AJAX form. - * - * This directive will detect inputs & selects defined within an element and when a - * submit button is clicked, will post data from the inputs & selects to a Piwik API method. - * - * When the POST request is finished the result will, by default, be displayed as a - * notification. - * - * This directive accepts the following attributes: - * - * - **submit-api-method**: **required** The Piwik API method that handles the POST request. - * - **send-json-payload**: Whether to send the data as a form encoded URL or to send it as JSON. - * If sending as JSON, the payload will still be a form encoded value, - * but will contain a JSON object like `{data: {...form data...}}`. - * - * This is for forms with lots of fields where having the same number - * of parameters in an API method would not be desired. - * - **no-error-notification**: If true, does not display an error notification if the AJAX post - * fails. - * - **no-success-notification**: If true, does not display an error notification if the AJAX - * results in success. - * - * **Custom Success/Error Handling** - * - * On success/failure, the response will be stored in controller scope. Child elements of a - * piwik-ajax-form element can access this data, and thus, can customize what happens when - * a form submit succeeds/fails. - * - * See the ajax-form.controller.js file for more info. - * - * Usage: - * - * <div piwik-ajax-form - * submit-api-method="'MyPlugin.myFormSaveMethod'" - * send-json-payload="true" - * ng-model="myFormData"> - * - * <h2>My Form</h2> - * <input name="myOption" value="myDefaultValue" type="text" /> - * <input name="myOtherOption" type="checkbox" checked="checked" /> - * <input type="submit" value="Submit" ng-disabled="ajaxForm.isSubmitting" /> - * - * <div piwik-notification context='error' ng-show="errorPostResponse">ERROR!</div> - * </div> - * @deprecated - */ +/* harmony default export */ var Passthroughvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({})); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Passthrough/Passthrough.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Passthrough/Passthrough.vue -function piwikAjaxForm($parse) { - return { - restrict: 'A', - scope: { - submitApiMethod: '=', - sendJsonPayload: '=', - noErrorNotification: '=', - noSuccessNotification: '=', - useCustomDataBinding: '=' - }, - require: '?ngModel', - transclude: true, - compile: function piwikAjaxFormCompile(compileElement, compileAttrs) { - compileAttrs.noErrorNotification = !!compileAttrs.noErrorNotification; // eslint-disable-next-line @typescript-eslint/no-explicit-any - - return function piwikAjaxFormLink(scope, element, attrs, ngModel, transclude) { - if (!scope.submitApiMethod) { - throw new Error('submitApiMethod is required'); - } - scope.ajaxForm = {}; - scope.ajaxForm.submitApiMethod = scope.submitApiMethod; - scope.ajaxForm.sendJsonPayload = scope.sendJsonPayload; - scope.ajaxForm.noErrorNotification = scope.noErrorNotification; - scope.ajaxForm.noSuccessNotification = scope.noSuccessNotification; - scope.ajaxForm.data = {}; // if a model is supplied, initiate form data w/ model value - - if (ngModel) { - // probably redundant, but I cannot find another way to get the ng model value here - var ngModelGetter = $parse(attrs.ngModel); - scope.ajaxForm.data = ngModelGetter(scope.$parent); - } - var specialBindDirective = { - mounted: function mounted(el, binding) { - scope.ajaxForm.submitForm = binding.value.submitForm; - } - }; - var rootTemplate = "\n <AjaxForm\n :form-data=\"data\"\n :submit-api-method=\"submitApiMethod\"\n :send-json-payload=\"sendJsonPayload\"\n :no-error-notification=\"noErrorNotification\"\n :no-success-notification=\"noSuccessNotification\"\n >\n <template v-slot:default=\"ajaxFormVue\">\n <div\n ref=\"transcludeTarget\"\n v-special-bind-directive=\"{ submitForm: ajaxFormVue.submitForm }\"\n />\n </template>\n </AjaxForm>"; - var app = createVueApp({ - template: rootTemplate, - data: function data() { - return scope.ajaxForm; - }, - setup: function setup() { - var transcludeTarget = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(null); - return { - transcludeTarget: transcludeTarget - }; - } - }); - app.component('AjaxForm', AjaxForm); - app.directive('SpecialBindDirective', specialBindDirective); - var vm = app.mount(element[0]); - element.on('$destroy', function () { - app.unmount(); - }); +Passthroughvue_type_script_lang_ts.render = Passthroughvue_type_template_id_6f9e3dd3_render - function setFormValueFromInput(inputElement, skipScopeApply) { - var name = AjaxForm_adapter_$(inputElement).attr('name'); - var val; +/* harmony default export */ var Passthrough = (Passthroughvue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/DataTable/DataTableActions.vue?vue&type=template&id=614eb978 - if (AjaxForm_adapter_$(inputElement).attr('type') === 'checkbox') { - val = AjaxForm_adapter_$(inputElement).is(':checked'); - } else { - val = AjaxForm_adapter_$(inputElement).val(); - } +var DataTableActionsvue_type_template_id_614eb978_hoisted_1 = { + key: 0 +}; +var DataTableActionsvue_type_template_id_614eb978_hoisted_2 = ["data-target"]; - scope.ajaxForm.data[name] = val; +var DataTableActionsvue_type_template_id_614eb978_hoisted_3 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "icon-configure" +}, null, -1); - if (!skipScopeApply) { - setTimeout(function () { - scope.$apply(); - }, 0); - } - } // on change of any input, change appropriate value in model, but only if requested +var DataTableActionsvue_type_template_id_614eb978_hoisted_4 = [DataTableActionsvue_type_template_id_614eb978_hoisted_3]; +var DataTableActionsvue_type_template_id_614eb978_hoisted_5 = ["data-target"]; +var DataTableActionsvue_type_template_id_614eb978_hoisted_6 = ["title"]; +var DataTableActionsvue_type_template_id_614eb978_hoisted_7 = ["title", "src"]; +var DataTableActionsvue_type_template_id_614eb978_hoisted_8 = ["id"]; +var DataTableActionsvue_type_template_id_614eb978_hoisted_9 = ["data-footer-icon-id"]; +var DataTableActionsvue_type_template_id_614eb978_hoisted_10 = ["title"]; +var DataTableActionsvue_type_template_id_614eb978_hoisted_11 = ["title", "src"]; +var DataTableActionsvue_type_template_id_614eb978_hoisted_12 = { + key: 2 +}; +var DataTableActionsvue_type_template_id_614eb978_hoisted_13 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", { + class: "divider" +}, null, -1); - if (!scope.useCustomDataBinding) { - element.on('change', 'input,select', function (event) { - setFormValueFromInput(event.target); - }); - } // make sure child elements can access this directive's scope - // eslint-disable-next-line @typescript-eslint/no-explicit-any +var DataTableActionsvue_type_template_id_614eb978_hoisted_14 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", { + class: "divider" +}, null, -1); +var DataTableActionsvue_type_template_id_614eb978_hoisted_15 = ["title"]; - transclude(scope, function (clone, transcludeScope) { - if (!transcludeScope.useCustomDataBinding) { - var $inputs = clone.find('input,select').not('[type=submit]'); // initialize form data to input values (include <select>s +var DataTableActionsvue_type_template_id_614eb978_hoisted_16 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "icon-export" +}, null, -1); - $inputs.each(function inputEach() { - setFormValueFromInput(this, true); - }); - } // eslint-disable-next-line @typescript-eslint/no-explicit-any +var DataTableActionsvue_type_template_id_614eb978_hoisted_17 = [DataTableActionsvue_type_template_id_614eb978_hoisted_16]; +var DataTableActionsvue_type_template_id_614eb978_hoisted_18 = ["title"]; +var DataTableActionsvue_type_template_id_614eb978_hoisted_19 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "icon-image" +}, null, -1); - AjaxForm_adapter_$(vm.transcludeTarget).append(clone); - }); - }; +var DataTableActionsvue_type_template_id_614eb978_hoisted_20 = [DataTableActionsvue_type_template_id_614eb978_hoisted_19]; +var _hoisted_21 = ["title"]; + +var _hoisted_22 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "icon-annotation" +}, null, -1); + +var _hoisted_23 = [_hoisted_22]; +var _hoisted_24 = ["title"]; + +var _hoisted_25 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "icon-search" +}, null, -1); + +var _hoisted_26 = ["title"]; +var _hoisted_27 = ["id", "title"]; +var _hoisted_28 = ["title"]; +var _hoisted_29 = ["title", "src"]; +var _hoisted_30 = ["id"]; +var _hoisted_31 = { + key: 0 +}; +var _hoisted_32 = ["innerHTML"]; +var _hoisted_33 = { + key: 1 +}; +var _hoisted_34 = ["innerHTML"]; +var _hoisted_35 = { + key: 2 +}; +var _hoisted_36 = ["innerHTML"]; +var _hoisted_37 = { + key: 3 +}; +var _hoisted_38 = ["innerHTML"]; +var _hoisted_39 = { + key: 4 +}; +var _hoisted_40 = ["innerHTML"]; +var _hoisted_41 = { + key: 5 +}; +var _hoisted_42 = ["innerHTML"]; +var _hoisted_43 = ["title", "data-target"]; + +var _hoisted_44 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "icon-calendar" +}, null, -1); + +var _hoisted_45 = { + class: "periodName" +}; +var _hoisted_46 = ["id"]; +var _hoisted_47 = ["data-period"]; +function DataTableActionsvue_type_template_id_614eb978_render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_Passthrough = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Passthrough"); + + var _directive_dropdown_button = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("dropdown-button"); + + var _directive_report_export = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("report-export"); + + return _ctx.showFooter && _ctx.showFooterIcons ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", DataTableActionsvue_type_template_id_614eb978_hoisted_1, [_ctx.hasConfigItems && (_ctx.isAnyConfigureIconHighlighted || _ctx.isTableView) ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { + key: 0, + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["dropdown-button dropdownConfigureIcon dataTableAction", { + highlighted: _ctx.isAnyConfigureIconHighlighted + }]), + href: "", + onClick: _cache[0] || (_cache[0] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function () {}, ["prevent"])), + "data-target": "dropdownConfigure".concat(_ctx.randomIdForDropdown), + style: { + "margin-right": "3.5px" } - }; + }, DataTableActionsvue_type_template_id_614eb978_hoisted_4, 10, DataTableActionsvue_type_template_id_614eb978_hoisted_2)), [[_directive_dropdown_button]]) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.hasFooterIconsToShow ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { + key: 1, + class: "dropdown-button dataTableAction activateVisualizationSelection", + href: "", + "data-target": "dropdownVisualizations".concat(_ctx.randomIdForDropdown), + style: { + "margin-right": "3.5px" + }, + onClick: _cache[1] || (_cache[1] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function () {}, ["prevent"])) + }, [/^icon-/.test(_ctx.activeFooterIcon || '') ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", { + key: 0, + title: _ctx.translate('CoreHome_ChangeVisualization'), + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(_ctx.activeFooterIcon) + }, null, 10, DataTableActionsvue_type_template_id_614eb978_hoisted_6)) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("img", { + key: 1, + title: _ctx.translate('CoreHome_ChangeVisualization'), + width: "16", + height: "16", + src: _ctx.activeFooterIcon + }, null, 8, DataTableActionsvue_type_template_id_614eb978_hoisted_7))], 8, DataTableActionsvue_type_template_id_614eb978_hoisted_5)), [[_directive_dropdown_button]]) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.showFooterIcons ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("ul", { + key: 2, + id: "dropdownVisualizations".concat(_ctx.randomIdForDropdown), + class: "dropdown-content dataTableFooterIcons" + }, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.footerIcons, function (footerIconGroup, index) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_Passthrough, { + key: index + }, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(footerIconGroup.buttons.filter(function (i) { + return !!i.icon; + }), function (footerIcon) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { + key: footerIcon.id + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])("".concat(footerIconGroup.class, " tableIcon\n ").concat(_ctx.activeFooterIconIds.indexOf(footerIcon.id) !== -1 ? 'activeIcon' : '')), + "data-footer-icon-id": footerIcon.id + }, [/^icon-/.test(footerIcon.icon || '') ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", { + key: 0, + title: footerIcon.title, + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(footerIcon.icon), + style: { + "margin-right": "5.5px" + } + }, null, 10, DataTableActionsvue_type_template_id_614eb978_hoisted_10)) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("img", { + key: 1, + width: "16", + height: "16", + title: footerIcon.title, + src: footerIcon.icon, + style: { + "margin-right": "5.5px" + } + }, null, 8, DataTableActionsvue_type_template_id_614eb978_hoisted_11)), footerIcon.title ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", DataTableActionsvue_type_template_id_614eb978_hoisted_12, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(footerIcon.title), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 10, DataTableActionsvue_type_template_id_614eb978_hoisted_9)]); + }), 128)), DataTableActionsvue_type_template_id_614eb978_hoisted_13]; + }), + _: 2 + }, 1024); + }), 128)), DataTableActionsvue_type_template_id_614eb978_hoisted_14], 8, DataTableActionsvue_type_template_id_614eb978_hoisted_8)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.showExport ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { + key: 3, + class: "dataTableAction activateExportSelection", + title: _ctx.translate('General_ExportThisReport'), + href: "", + style: { + "margin-right": "3.5px" + }, + onClick: _cache[2] || (_cache[2] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function () {}, ["prevent"])) + }, DataTableActionsvue_type_template_id_614eb978_hoisted_17, 8, DataTableActionsvue_type_template_id_614eb978_hoisted_15)), [[_directive_report_export, { + reportTitle: _ctx.reportTitle, + requestParams: _ctx.requestParams, + apiMethod: _ctx.apiMethodToRequestDataTable, + reportFormats: _ctx.reportFormats, + maxFilterLimit: _ctx.maxFilterLimit + }]]) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.showExportAsImageIcon ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { + key: 4, + class: "dataTableAction tableIcon", + href: "", + id: "dataTableFooterExportAsImageIcon", + onClick: _cache[3] || (_cache[3] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { + return _ctx.showExportImage($event); + }, ["prevent"])), + title: _ctx.translate('General_ExportAsImage'), + style: { + "margin-right": "3.5px" + } + }, DataTableActionsvue_type_template_id_614eb978_hoisted_20, 8, DataTableActionsvue_type_template_id_614eb978_hoisted_18)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.showAnnotations ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { + key: 5, + class: "dataTableAction annotationView", + href: "", + title: _ctx.translate('Annotations_Annotations'), + onClick: _cache[4] || (_cache[4] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function () {}, ["prevent"])), + style: { + "margin-right": "3.5px" + } + }, _hoisted_23, 8, _hoisted_21)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.showSearch ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { + key: 6, + class: "dropdown-button dataTableAction searchAction", + href: "", + title: _ctx.translate('General_Search'), + style: { + "margin-right": "3.5px" + }, + onClick: _cache[5] || (_cache[5] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function () {}, ["prevent"])) + }, [_hoisted_25, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "icon-close", + title: _ctx.translate('CoreHome_CloseSearch') + }, null, 8, _hoisted_26), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + id: "widgetSearch_".concat(_ctx.reportId), + title: _ctx.translate('CoreHome_DataTableHowToSearch'), + type: "text", + class: "dataTableSearchInput" + }, null, 8, _hoisted_27)], 8, _hoisted_24)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.dataTableActions, function (action) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { + key: action.id, + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])("dataTableAction ".concat(action.id)), + href: "", + onClick: _cache[6] || (_cache[6] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function () {}, ["prevent"])), + title: action.title, + style: { + "margin-right": "3.5px" + } + }, [/^icon-/.test(action.icon || '') ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", { + key: 0, + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(action.icon) + }, null, 2)) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("img", { + key: 1, + width: "16", + height: "16", + title: action.title, + src: action.icon + }, null, 8, _hoisted_29))], 10, _hoisted_28); + }), 128)), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", { + id: "dropdownConfigure".concat(_ctx.randomIdForDropdown), + class: "dropdown-content tableConfiguration" + }, [_ctx.showFlattenTable ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", _hoisted_31, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + class: "configItem dataTableFlatten", + innerHTML: _ctx.$sanitize(_ctx.flattenItemText) + }, null, 8, _hoisted_32)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.showDimensionsConfigItem ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", _hoisted_33, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + class: "configItem dataTableShowDimensions", + innerHTML: _ctx.$sanitize(_ctx.showDimensionsText) + }, null, 8, _hoisted_34)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.showFlatConfigItem ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", _hoisted_35, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + class: "configItem dataTableIncludeAggregateRows", + innerHTML: _ctx.$sanitize(_ctx.includeAggregateRowsText) + }, null, 8, _hoisted_36)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.showTotalsConfigItem ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", _hoisted_37, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + class: "configItem dataTableShowTotalsRow", + innerHTML: _ctx.$sanitize(_ctx.keepTotalsRowText) + }, null, 8, _hoisted_38)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.showExcludeLowPopulation ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", _hoisted_39, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + class: "configItem dataTableExcludeLowPopulation", + innerHTML: _ctx.$sanitize(_ctx.excludeLowPopText) + }, null, 8, _hoisted_40)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.showPivotBySubtable ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", _hoisted_41, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + class: "configItem dataTablePivotBySubtable", + innerHTML: _ctx.$sanitize(_ctx.pivotByText) + }, null, 8, _hoisted_42)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 8, _hoisted_30), _ctx.showPeriods ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { + key: 7, + class: "dropdown-button dataTableAction activatePeriodsSelection", + href: "", + onClick: _cache[7] || (_cache[7] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function () {}, ["prevent"])), + title: _ctx.translate('CoreHome_ChangePeriod'), + "data-target": "dropdownPeriods".concat(_ctx.randomIdForDropdown) + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [_hoisted_44, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_45, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translations[_ctx.clientSideParameters.period] || _ctx.clientSideParameters.period), 1)])], 8, _hoisted_43)), [[_directive_dropdown_button]]) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.showPeriods ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("ul", { + key: 8, + id: "dropdownPeriods".concat(_ctx.randomIdForDropdown), + class: "dropdown-content dataTablePeriods" + }, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.selectablePeriods, function (selectablePeriod) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { + key: selectablePeriod + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + "data-period": selectablePeriod, + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])("tableIcon ".concat(_ctx.clientSideParameters.period === selectablePeriod ? 'activeIcon' : '')) + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translations[selectablePeriod] || selectablePeriod), 1)], 10, _hoisted_47)]); + }), 128))], 8, _hoisted_46)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true); } +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/DataTable/DataTableActions.vue?vue&type=template&id=614eb978 -piwikAjaxForm.$inject = ['$parse']; -window.angular.module('piwikApp').directive('piwikAjaxForm', piwikAjaxForm); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/getFormattedEvolution.ts -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/DataTable/DataTableActions.vue?vue&type=script&lang=ts +function DataTableActionsvue_type_script_lang_ts_toConsumableArray(arr) { return DataTableActionsvue_type_script_lang_ts_arrayWithoutHoles(arr) || DataTableActionsvue_type_script_lang_ts_iterableToArray(arr) || DataTableActionsvue_type_script_lang_ts_unsupportedIterableToArray(arr) || DataTableActionsvue_type_script_lang_ts_nonIterableSpread(); } +function DataTableActionsvue_type_script_lang_ts_nonIterableSpread() { 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 calculateEvolution(currentValue, pastValue) { - var pastValueParsed = parseInt(pastValue, 10); - var currentValueParsed = parseInt(currentValue, 10) - pastValueParsed; - var evolution; +function DataTableActionsvue_type_script_lang_ts_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return DataTableActionsvue_type_script_lang_ts_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return DataTableActionsvue_type_script_lang_ts_arrayLikeToArray(o, minLen); } - if (currentValueParsed === 0 || Number.isNaN(currentValueParsed)) { - evolution = 0; - } else if (pastValueParsed === 0 || Number.isNaN(pastValueParsed)) { - evolution = 100; - } else { - evolution = currentValueParsed / pastValueParsed * 100; +function DataTableActionsvue_type_script_lang_ts_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function DataTableActionsvue_type_script_lang_ts_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return DataTableActionsvue_type_script_lang_ts_arrayLikeToArray(arr); } + +function DataTableActionsvue_type_script_lang_ts_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + + + + + +var DataTableActionsvue_type_script_lang_ts_window = window, + DataTableActionsvue_type_script_lang_ts_$ = DataTableActionsvue_type_script_lang_ts_window.$; + +function getSingleStateIconText(text, addDefault, replacement) { + if (/(%(.\$)?s+)/g.test(translate(text))) { + var values = ['<br /><span class="action">']; + + if (replacement) { + values.push(replacement); + } + + var result = translate.apply(void 0, [text].concat(values)); + + if (addDefault) { + result += " (".concat(translate('CoreHome_Default'), ")"); + } + + result += '</span>'; + return result; } - return evolution; + return translate(text); } -function formatEvolution(evolution) { - return "".concat(evolution > 0 ? Matomo_Matomo.numbers.symbolPlus : '').concat(Math.round(evolution), "}%"); -} +function getToggledIconText(toggled, textToggled, textUntoggled) { + if (toggled) { + return getSingleStateIconText(textToggled, true); + } -function getFormattedEvolution(currentValue, pastValue) { - var evolution = calculateEvolution(currentValue, pastValue); - return formatEvolution(evolution); + return getSingleStateIconText(textUntoggled); } -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/VueEntryContainer/VueEntryContainer.vue?vue&type=template&id=54e7e876 -var VueEntryContainervue_type_template_id_54e7e876_hoisted_1 = { - ref: "root" -}; -function VueEntryContainervue_type_template_id_54e7e876_render(_ctx, _cache, $props, $setup, $data, $options) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", VueEntryContainervue_type_template_id_54e7e876_hoisted_1, [_ctx.componentWrapper ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDynamicComponent"])(_ctx.componentWrapper), { - key: 0 - })) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 512); +function isBooleanLikeSet(value) { + return !!value && value !== '0'; } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/VueEntryContainer/VueEntryContainer.vue?vue&type=template&id=54e7e876 - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/VueEntryContainer/VueEntryContainer.vue?vue&type=script&lang=ts - -/* harmony default export */ var VueEntryContainervue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ +/* harmony default export */ var DataTableActionsvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ props: { - html: String + showPeriods: Boolean, + showFooter: Boolean, + showFooterIcons: Boolean, + showSearch: Boolean, + showFlattenTable: Boolean, + footerIcons: { + type: Array, + required: true + }, + viewDataTable: { + type: String, + required: true + }, + reportTitle: String, + requestParams: { + type: Object, + required: true + }, + apiMethodToRequestDataTable: { + type: String, + required: true + }, + maxFilterLimit: { + type: Number, + required: true + }, + showExport: Boolean, + showExportAsImageIcon: Boolean, + showAnnotations: Boolean, + reportId: { + type: String, + required: true + }, + dataTableActions: { + type: Array, + required: true + }, + clientSideParameters: { + type: Object, + required: true + }, + hasMultipleDimensions: Boolean, + isDataTableEmpty: Boolean, + showTotalsRow: Boolean, + showExcludeLowPopulation: Boolean, + showPivotBySubtable: Boolean, + selectablePeriods: Array, + translations: { + type: Object, + required: true + }, + pivotDimensionName: String }, - mounted: function mounted() { - Matomo_Matomo.helper.compileVueEntryComponents(this.$refs.root); + components: { + Passthrough: Passthrough }, - beforeUnmount: function beforeUnmount() { - Matomo_Matomo.helper.destroyVueComponent(this.$refs.root); + directives: { + DropdownButton: DropdownButton, + ReportExport: ReportExport + }, + methods: { + showExportImage: function showExportImage(event) { + DataTableActionsvue_type_script_lang_ts_$(event.target).closest('.dataTable').find('div.jqplot-target').trigger('piwikExportAsImage'); + } }, computed: { - componentWrapper: function componentWrapper() { - if (!this.html) { - return null; + randomIdForDropdown: function randomIdForDropdown() { + return Math.floor(Math.random() * 999999); + }, + allFooterIcons: function allFooterIcons() { + return this.footerIcons.reduce(function (icons, footerIcon) { + icons.push.apply(icons, DataTableActionsvue_type_script_lang_ts_toConsumableArray(footerIcon.buttons)); + return icons; + }, []); + }, + activeFooterIcons: function activeFooterIcons() { + var _this = this; + + var params = this.clientSideParameters; + var result = [this.viewDataTable]; + + if (params.abandonedCarts === 0 || params.abandonedCarts === '0') { + result.push('ecommerceOrder'); + } else if (params.abandonedCarts === 1 || params.abandonedCarts === '1') { + result.push('ecommerceAbandonedCart'); } - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["markRaw"])({ - template: this.html + return result.map(function (id) { + return _this.allFooterIcons.find(function (button) { + return button.id === id; + }); + }).filter(function (icon) { + return !!icon; + }); + }, + activeFooterIcon: function activeFooterIcon() { + var _this$activeFooterIco; + + return (_this$activeFooterIco = this.activeFooterIcons[0]) === null || _this$activeFooterIco === void 0 ? void 0 : _this$activeFooterIco.icon; + }, + activeFooterIconIds: function activeFooterIconIds() { + return this.activeFooterIcons.map(function (icon) { + return icon.id; }); + }, + numIcons: function numIcons() { + return this.allFooterIcons.length; + }, + hasFooterIconsToShow: function hasFooterIconsToShow() { + return !!this.activeFooterIcons.length && this.numIcons > 1; + }, + reportFormats: function reportFormats() { + var formats = { + CSV: 'CSV', + TSV: 'TSV (Excel)', + XML: 'XML', + JSON: 'Json', + HTML: 'HTML' + }; + formats.RSS = 'RSS'; + return formats; + }, + showDimensionsConfigItem: function showDimensionsConfigItem() { + return this.showFlattenTable && "".concat(this.clientSideParameters.flat) === '1' && this.hasMultipleDimensions; + }, + showFlatConfigItem: function showFlatConfigItem() { + return this.showFlattenTable && "".concat(this.clientSideParameters.flat) === '1'; + }, + showTotalsConfigItem: function showTotalsConfigItem() { + return !this.isDataTableEmpty && this.showTotalsRow; + }, + hasConfigItems: function hasConfigItems() { + return this.showFlattenTable || this.showDimensionsConfigItem || this.showFlatConfigItem || this.showTotalsConfigItem || this.showExcludeLowPopulation || this.showPivotBySubtable; + }, + flattenItemText: function flattenItemText() { + var params = this.clientSideParameters; + return getToggledIconText(isBooleanLikeSet(params.flat), 'CoreHome_UnFlattenDataTable', 'CoreHome_FlattenDataTable'); + }, + keepTotalsRowText: function keepTotalsRowText() { + var params = this.clientSideParameters; + return getToggledIconText(isBooleanLikeSet(params.keep_totals_row), 'CoreHome_RemoveTotalsRowDataTable', 'CoreHome_AddTotalsRowDataTable'); + }, + includeAggregateRowsText: function includeAggregateRowsText() { + var params = this.clientSideParameters; + return getToggledIconText(isBooleanLikeSet(params.include_aggregate_rows), 'CoreHome_DataTableExcludeAggregateRows', 'CoreHome_DataTableIncludeAggregateRows'); + }, + showDimensionsText: function showDimensionsText() { + var params = this.clientSideParameters; + return getToggledIconText(isBooleanLikeSet(params.show_dimensions), 'CoreHome_DataTableCombineDimensions', 'CoreHome_DataTableShowDimensions'); + }, + pivotByText: function pivotByText() { + var params = this.clientSideParameters; + + if (isBooleanLikeSet(params.pivotBy)) { + return getSingleStateIconText('CoreHome_UndoPivotBySubtable', true); + } + + return getSingleStateIconText('CoreHome_PivotBySubtable', false, this.pivotDimensionName); + }, + excludeLowPopText: function excludeLowPopText() { + var params = this.clientSideParameters; + return getToggledIconText(isBooleanLikeSet(params.enable_filter_excludelowpop), 'CoreHome_IncludeRowsWithLowPopulation', 'CoreHome_ExcludeRowsWithLowPopulation'); + }, + isAnyConfigureIconHighlighted: function isAnyConfigureIconHighlighted() { + var params = this.clientSideParameters; + return isBooleanLikeSet(params.flat) || isBooleanLikeSet(params.keep_totals_row) || isBooleanLikeSet(params.include_aggregate_rows) || isBooleanLikeSet(params.show_dimensions) || isBooleanLikeSet(params.pivotBy) || isBooleanLikeSet(params.enable_filter_excludelowpop); + }, + isTableView: function isTableView() { + return this.viewDataTable === 'table' || this.viewDataTable === 'tableAllColumns' || this.viewDataTable === 'tableGoals'; } } })); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/VueEntryContainer/VueEntryContainer.vue?vue&type=script&lang=ts +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/DataTable/DataTableActions.vue?vue&type=script&lang=ts -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/VueEntryContainer/VueEntryContainer.vue +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/DataTable/DataTableActions.vue -VueEntryContainervue_type_script_lang_ts.render = VueEntryContainervue_type_template_id_54e7e876_render +DataTableActionsvue_type_script_lang_ts.render = DataTableActionsvue_type_template_id_614eb978_render -/* harmony default export */ var VueEntryContainer = (VueEntryContainervue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.adapter.ts -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ +/* harmony default export */ var DataTableActions = (DataTableActionsvue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/VersionInfoHeaderMessage/VersionInfoHeaderMessage.vue?vue&type=template&id=d18dd898 +var VersionInfoHeaderMessagevue_type_template_id_d18dd898_hoisted_1 = { + key: 0, + class: "title", + style: { + "cursor": "pointer" + }, + ref: "expander" +}; +var VersionInfoHeaderMessagevue_type_template_id_d18dd898_hoisted_2 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "icon-warning" +}, null, -1); -/* harmony default export */ var ActivityIndicator_adapter = (createAngularJsAdapter({ - component: ActivityIndicator, - scope: { - loading: { - vue: 'loading', - angularJsBind: '<' - }, - loadingMessage: { - vue: 'loadingMessage', - angularJsBind: '<', - default: function _default() { - return translate('General_LoadingData'); - } - } - }, - $inject: [], - directiveName: 'piwikActivityIndicator' -})); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/CookieHelper/CookieHelper.ts -/* - * General utils for managing cookies in Typescript. - */ -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -function setCookie(name, val, seconds) { - var date = new Date(); // set default day to 3 days +var VersionInfoHeaderMessagevue_type_template_id_d18dd898_hoisted_3 = { + key: 1, + class: "title", + href: "?module=CoreUpdater&action=newVersionAvailable", + style: { + "cursor": "pointer" + } +}; - if (!seconds) { - // eslint-disable-next-line no-param-reassign - seconds = 3 * 24 * 60 * 1000; - } // Set it expire in n days +var VersionInfoHeaderMessagevue_type_template_id_d18dd898_hoisted_4 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "icon-warning" +}, null, -1); +var VersionInfoHeaderMessagevue_type_template_id_d18dd898_hoisted_5 = ["innerHTML"]; +var VersionInfoHeaderMessagevue_type_template_id_d18dd898_hoisted_6 = { + key: 1, + class: "title", + href: "https://matomo.org/changelog/", + target: "_blank", + rel: "noreferrer noopener" +}; +var VersionInfoHeaderMessagevue_type_template_id_d18dd898_hoisted_7 = { + id: "updateCheckLinkContainer" +}; +var VersionInfoHeaderMessagevue_type_template_id_d18dd898_hoisted_8 = { + class: "dropdown positionInViewport" +}; +var VersionInfoHeaderMessagevue_type_template_id_d18dd898_hoisted_9 = ["innerHTML"]; +var VersionInfoHeaderMessagevue_type_template_id_d18dd898_hoisted_10 = ["innerHTML"]; +function VersionInfoHeaderMessagevue_type_template_id_d18dd898_render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_Passthrough = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Passthrough"); - date.setTime(date.getTime() + seconds); // Set it + var _directive_expand_on_hover = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("expand-on-hover"); - document.cookie = "".concat(name, "=").concat(val, "; expires=").concat(date.toUTCString(), "; path=/"); -} // eslint-disable-next-line consistent-return,@typescript-eslint/explicit-module-boundary-types + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { + id: "header_message", + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["piwikSelector borderedControl piwikTopControl", { + header_info: !_ctx.latestVersionAvailable, + update_available: _ctx.latestVersionAvailable + }]) + }, [_ctx.latestVersionAvailable && !_ctx.isPiwikDemo ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_Passthrough, { + key: 0 + }, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [_ctx.isMultiServerEnvironment ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", VersionInfoHeaderMessagevue_type_template_id_d18dd898_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_NewUpdatePiwikX', _ctx.latestVersionAvailable)) + " ", 1), VersionInfoHeaderMessagevue_type_template_id_d18dd898_hoisted_2], 512)) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", VersionInfoHeaderMessagevue_type_template_id_d18dd898_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_NewUpdatePiwikX', _ctx.latestVersionAvailable)) + " ", 1), VersionInfoHeaderMessagevue_type_template_id_d18dd898_hoisted_4]))]; + }), + _: 1 + })) : _ctx.isSuperUser && _ctx.isAdminArea ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_Passthrough, { + key: 1 + }, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [_ctx.isInternetEnabled ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { + key: 0, + class: "title", + innerHTML: _ctx.$sanitize(_ctx.updateCheck) + }, null, 8, VersionInfoHeaderMessagevue_type_template_id_d18dd898_hoisted_5)) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", VersionInfoHeaderMessagevue_type_template_id_d18dd898_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", VersionInfoHeaderMessagevue_type_template_id_d18dd898_hoisted_7, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CoreHome_SeeAvailableVersions')), 1)]))]; + }), + _: 1 + })) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", VersionInfoHeaderMessagevue_type_template_id_d18dd898_hoisted_8, [_ctx.latestVersionAvailable && _ctx.isSuperUser ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", { + key: 0, + innerHTML: _ctx.$sanitize(_ctx.updateNowText) + }, null, 8, VersionInfoHeaderMessagevue_type_template_id_d18dd898_hoisted_9)) : _ctx.latestVersionAvailable && !_ctx.isPiwikDemo && _ctx.hasSomeViewAccess && !_ctx.isAnonymous ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", { + key: 1, + innerHTML: _ctx.$sanitize(_ctx.updateAvailableText) + }, null, 8, VersionInfoHeaderMessagevue_type_template_id_d18dd898_hoisted_10)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_YouAreCurrentlyUsing', _ctx.piwikVersion)), 1)])], 2)), [[_directive_expand_on_hover, { + expander: 'expander' + }]]); +} +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/VersionInfoHeaderMessage/VersionInfoHeaderMessage.vue?vue&type=template&id=d18dd898 -function getCookie(name) { - var value = "; ".concat(document.cookie); - var parts = value.split("; ".concat(name, "=")); // if cookie not exist return null - // eslint-disable-next-line eqeqeq +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/VersionInfoHeaderMessage/VersionInfoHeaderMessage.vue?vue&type=script&lang=ts - if (parts.length == 2) { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - var data = parts.pop().split(';').shift(); - if (typeof data !== 'undefined') { - return data; + + +/* harmony default export */ var VersionInfoHeaderMessagevue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + isMultiServerEnvironment: Boolean, + latestVersionAvailable: String, + isPiwikDemo: Boolean, + isSuperUser: Boolean, + isAdminArea: Boolean, + isInternetEnabled: Boolean, + updateCheck: String, + isAnonymous: Boolean, + hasSomeViewAccess: Boolean, + contactEmail: String, + piwikVersion: String + }, + components: { + Passthrough: Passthrough + }, + directives: { + ExpandOnHover: ExpandOnHover + }, + computed: { + updateNowText: function updateNowText() { + var text = ''; + + if (this.isMultiServerEnvironment) { + var link = "https://builds.matomo.org/piwik-".concat(this.latestVersionAvailable, ".zip"); + text = translate('CoreHome_OneClickUpdateNotPossibleAsMultiServerEnvironment', "<a rel=\"noreferrer noopener\" href=\"".concat(link, "\">builds.matomo.org</a>")); + } else { + text = translate('General_PiwikXIsAvailablePleaseUpdateNow', this.latestVersionAvailable || '', '<br /><a href="index.php?module=CoreUpdater&action=newVersionAvailable">', '</a>', '<a target="_blank" rel="noreferrer noopener" href="https://matomo.org/changelog/">', '</a>'); + } + + return "".concat(text, "<br/>"); + }, + updateAvailableText: function updateAvailableText() { + var updateSubject = translate('General_NewUpdatePiwikX', this.latestVersionAvailable || ''); + var matomoLink = '<a target="_blank" rel="noreferrer noopener" href="https://matomo.org/">Matomo</a>'; + var changelogLinkStart = '<a target="_blank" rel="noreferrer noopener" href="https://matomo.org/changelog/">'; + var text = translate('General_PiwikXIsAvailablePleaseNotifyPiwikAdmin', "".concat(matomoLink, " ").concat(changelogLinkStart).concat(this.latestVersionAvailable, "</a>"), "<a href=\"mailto:".concat(this.contactEmail, "?subject=").concat(encodeURIComponent(updateSubject), "\">"), '</a>'); + return "".concat(text, "<br />"); } } +})); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/VersionInfoHeaderMessage/VersionInfoHeaderMessage.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/VersionInfoHeaderMessage/VersionInfoHeaderMessage.vue - return null; -} // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -function deleteCookie(name) { - var date = new Date(); // Set it expire in -1 days - date.setTime(date.getTime() + -1 * 24 * 60 * 60 * 1000); // Set it +VersionInfoHeaderMessagevue_type_script_lang_ts.render = VersionInfoHeaderMessagevue_type_template_id_d18dd898_render - document.cookie = "".concat(name, "=; expires=").concat(date.toUTCString(), "; path=/"); -} -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Passthrough/Passthrough.vue?vue&type=template&id=6f9e3dd3 +/* harmony default export */ var VersionInfoHeaderMessage = (VersionInfoHeaderMessagevue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/MobileLeftMenu/MobileLeftMenu.vue?vue&type=template&id=af27e6d2 +function MobileLeftMenuvue_type_template_id_af27e6d2_slicedToArray(arr, i) { return MobileLeftMenuvue_type_template_id_af27e6d2_arrayWithHoles(arr) || MobileLeftMenuvue_type_template_id_af27e6d2_iterableToArrayLimit(arr, i) || MobileLeftMenuvue_type_template_id_af27e6d2_unsupportedIterableToArray(arr, i) || MobileLeftMenuvue_type_template_id_af27e6d2_nonIterableRest(); } -function Passthroughvue_type_template_id_6f9e3dd3_render(_ctx, _cache, $props, $setup, $data, $options) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default"); -} -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Passthrough/Passthrough.vue?vue&type=template&id=6f9e3dd3 +function MobileLeftMenuvue_type_template_id_af27e6d2_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Passthrough/Passthrough.vue?vue&type=script&lang=ts +function MobileLeftMenuvue_type_template_id_af27e6d2_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return MobileLeftMenuvue_type_template_id_af27e6d2_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return MobileLeftMenuvue_type_template_id_af27e6d2_arrayLikeToArray(o, minLen); } -/* harmony default export */ var Passthroughvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({})); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Passthrough/Passthrough.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Passthrough/Passthrough.vue +function MobileLeftMenuvue_type_template_id_af27e6d2_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } +function MobileLeftMenuvue_type_template_id_af27e6d2_iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } +function MobileLeftMenuvue_type_template_id_af27e6d2_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -Passthroughvue_type_script_lang_ts.render = Passthroughvue_type_template_id_6f9e3dd3_render - -/* harmony default export */ var Passthrough = (Passthroughvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/index.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 MobileLeftMenuvue_type_template_id_af27e6d2_hoisted_1 = { + id: "mobile-left-menu", + class: "sidenav hide-on-large-only" +}; +var MobileLeftMenuvue_type_template_id_af27e6d2_hoisted_2 = { + class: "collapsible collapsible-accordion" +}; +var MobileLeftMenuvue_type_template_id_af27e6d2_hoisted_3 = { + class: "collapsible-header" +}; +var MobileLeftMenuvue_type_template_id_af27e6d2_hoisted_4 = { + class: "collapsible-body" +}; +var MobileLeftMenuvue_type_template_id_af27e6d2_hoisted_5 = ["title", "href"]; +function MobileLeftMenuvue_type_template_id_af27e6d2_render(_ctx, _cache, $props, $setup, $data, $options) { + var _directive_side_nav = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("side-nav"); + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("ul", MobileLeftMenuvue_type_template_id_af27e6d2_hoisted_1, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.menuWithSubmenuItems, function (level2, level1) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { + class: "no-padding", + key: level1 + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", MobileLeftMenuvue_type_template_id_af27e6d2_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", MobileLeftMenuvue_type_template_id_af27e6d2_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate(level1)), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("i", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(level2._icon || 'icon-arrow-down') + }, null, 2)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", MobileLeftMenuvue_type_template_id_af27e6d2_hoisted_4, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", null, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(Object.entries(level2).filter(function (_ref) { + var _ref2 = MobileLeftMenuvue_type_template_id_af27e6d2_slicedToArray(_ref, 1), + n = _ref2[0]; + + return n[0] !== '_'; + }), function (_ref3) { + var _ref4 = MobileLeftMenuvue_type_template_id_af27e6d2_slicedToArray(_ref3, 2), + name = _ref4[0], + params = _ref4[1]; + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { + key: name + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + title: params._tooltip ? _ctx.translate(params._tooltip) : '', + target: "_self", + href: _ctx.getMenuUrl(params._url) + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate(name)), 9, MobileLeftMenuvue_type_template_id_af27e6d2_hoisted_5)]); + }), 128))])])])], 512), [[_directive_side_nav, { + activator: _ctx.activateLeftMenu + }]])]); + }), 128))]); +} +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/MobileLeftMenu/MobileLeftMenu.vue?vue&type=template&id=af27e6d2 +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/MobileLeftMenu/MobileLeftMenu.vue?vue&type=script&lang=ts +function MobileLeftMenuvue_type_script_lang_ts_slicedToArray(arr, i) { return MobileLeftMenuvue_type_script_lang_ts_arrayWithHoles(arr) || MobileLeftMenuvue_type_script_lang_ts_iterableToArrayLimit(arr, i) || MobileLeftMenuvue_type_script_lang_ts_unsupportedIterableToArray(arr, i) || MobileLeftMenuvue_type_script_lang_ts_nonIterableRest(); } +function MobileLeftMenuvue_type_script_lang_ts_nonIterableRest() { 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 MobileLeftMenuvue_type_script_lang_ts_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return MobileLeftMenuvue_type_script_lang_ts_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return MobileLeftMenuvue_type_script_lang_ts_arrayLikeToArray(o, minLen); } +function MobileLeftMenuvue_type_script_lang_ts_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } +function MobileLeftMenuvue_type_script_lang_ts_iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } +function MobileLeftMenuvue_type_script_lang_ts_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } +var MobileLeftMenuvue_type_script_lang_ts_window = window, + MobileLeftMenuvue_type_script_lang_ts_$ = MobileLeftMenuvue_type_script_lang_ts_window.$; +/* harmony default export */ var MobileLeftMenuvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + menu: { + type: Object, + required: true + } + }, + directives: { + SideNav: SideNav + }, + methods: { + getMenuUrl: function getMenuUrl(params) { + return "?".concat(src_MatomoUrl_MatomoUrl.stringify(Object.assign(Object.assign({}, src_MatomoUrl_MatomoUrl.urlParsed.value), params))); + } + }, + computed: { + menuWithSubmenuItems: function menuWithSubmenuItems() { + var menu = this.menu || {}; + return Object.fromEntries(Object.entries(menu) // remove submenus that have no items that do not start w/ '_' + .filter(function (_ref) { + var _ref2 = MobileLeftMenuvue_type_script_lang_ts_slicedToArray(_ref, 2), + level2 = _ref2[1]; + + var itemsWithoutUnderscore = Object.entries(level2).filter(function (_ref3) { + var _ref4 = MobileLeftMenuvue_type_script_lang_ts_slicedToArray(_ref3, 1), + name = _ref4[0]; + + return name[0] !== '_'; + }); + return Object.keys(itemsWithoutUnderscore).length; + })); + }, + activateLeftMenu: function activateLeftMenu() { + return MobileLeftMenuvue_type_script_lang_ts_$('nav .activateLeftMenu')[0]; + } + } +})); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/MobileLeftMenu/MobileLeftMenu.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/MobileLeftMenu/MobileLeftMenu.vue +MobileLeftMenuvue_type_script_lang_ts.render = MobileLeftMenuvue_type_template_id_af27e6d2_render +/* harmony default export */ var MobileLeftMenu = (MobileLeftMenuvue_type_script_lang_ts); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/scrollToAnchorInUrl.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 scrollToAnchorInUrl_window = window, + scrollToAnchorInUrl_$ = scrollToAnchorInUrl_window.$; +function scrollToAnchorNode($node) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + scrollToAnchorInUrl_$.scrollTo($node, 20); +} +function preventDefaultIfEventExists(event) { + if (event) { + event.preventDefault(); + } +} +function scrollToAnchorIfPossible(hash, event) { + var _$node, _$node2; + if (!hash) { + return; + } + if (hash.indexOf('&') !== -1) { + return; + } + var $node = null; + try { + $node = scrollToAnchorInUrl_$("#".concat(hash)); + } catch (err) { + // on jquery syntax error, ignore so nothing is logged to the console + return; + } + if ((_$node = $node) !== null && _$node !== void 0 && _$node.length) { + scrollToAnchorNode($node); + preventDefaultIfEventExists(event); + return; + } + $node = scrollToAnchorInUrl_$("a[name=".concat(hash, "]")); + if ((_$node2 = $node) !== null && _$node2 !== void 0 && _$node2.length) { + scrollToAnchorNode($node); + preventDefaultIfEventExists(event); + } +} +function isLinkWithinSamePage(location, newUrl) { + if (location && location.origin && newUrl.indexOf(location.origin) === -1) { + // link to different domain + return false; + } + if (location && location.pathname && newUrl.indexOf(location.pathname) === -1) { + // link to different path + return false; + } + if (location && location.search && newUrl.indexOf(location.search) === -1) { + // link with different search + return false; + } + return true; +} +function handleScrollToAnchorIfPresentOnPageLoad() { + if (window.location.hash.slice(0, 2) === '#/') { + var hash = window.location.hash.slice(2); + scrollToAnchorIfPossible(hash, null); + } +} +function handleScrollToAnchorAfterPageLoad() { + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["watch"])(function () { + return src_MatomoUrl_MatomoUrl.url.value; + }, function (newUrl, oldUrl) { + if (!newUrl) { + return; + } + var hashPos = newUrl.href.indexOf('#/'); + if (hashPos === -1) { + return; + } + if (oldUrl && !isLinkWithinSamePage(oldUrl, newUrl.href)) { + return; + } + var hash = newUrl.href.slice(hashPos + 2); + scrollToAnchorIfPossible(hash, null); + }); +} +handleScrollToAnchorAfterPageLoad(); +scrollToAnchorInUrl_$(handleScrollToAnchorIfPresentOnPageLoad); +function scrollToAnchorInUrl() { + // may be called when page is only fully loaded after some additional requests + // timeout needed to ensure Vue rendered fully + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["nextTick"])(handleScrollToAnchorIfPresentOnPageLoad); +} +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/index.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js index dd6e6610c2..badc770dc2 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js @@ -1,576 +1,286 @@ -(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["CoreHome"]=t(require("vue")):e["CoreHome"]=t(e["Vue"])})("undefined"!==typeof self?self:this,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/CoreHome/vue/dist/",n(n.s="fae3")}({2342:function(e,t,n){"use strict"; +(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["CoreHome"]=t(require("vue")):e["CoreHome"]=t(e["Vue"])})("undefined"!==typeof self?self:this,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/CoreHome/vue/dist/",n(n.s="fae3")}({2342:function(e,t,n){"use strict"; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */window.hasBlockedContent=!1},"8bbf":function(t,n){t.exports=e},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"createVueApp",(function(){return dt})),n.d(t,"importPluginUmd",(function(){return gt})),n.d(t,"useExternalPluginComponent",(function(){return vt})),n.d(t,"DirectiveUtilities",(function(){return Gt})),n.d(t,"debounce",(function(){return Xi})),n.d(t,"getFormattedEvolution",(function(){return Iu})),n.d(t,"createAngularJsAdapter",(function(){return Vt})),n.d(t,"transformAngularJsBoolAttr",(function(){return Nt})),n.d(t,"transformAngularJsIntAttr",(function(){return Tt})),n.d(t,"removeAngularJsSpecificProperties",(function(){return Pt})),n.d(t,"clone",(function(){return At})),n.d(t,"cloneThenApply",(function(){return xt})),n.d(t,"VueEntryContainer",(function(){return Fu})),n.d(t,"activityIndicatorAdapter",(function(){return Ru})),n.d(t,"ActivityIndicator",(function(){return Oa})),n.d(t,"translate",(function(){return C})),n.d(t,"translateOrDefault",(function(){return E})),n.d(t,"Alert",(function(){return ut})),n.d(t,"AjaxHelper",(function(){return Ze})),n.d(t,"setCookie",(function(){return _u})),n.d(t,"getCookie",(function(){return $u})),n.d(t,"deleteCookie",(function(){return Hu})),n.d(t,"MatomoUrl",(function(){return Ee})),n.d(t,"Matomo",(function(){return S})),n.d(t,"Periods",(function(){return m})),n.d(t,"Day",(function(){return z})),n.d(t,"Week",(function(){return Z})),n.d(t,"Month",(function(){return ie})),n.d(t,"Year",(function(){return se})),n.d(t,"Range",(function(){return H})),n.d(t,"format",(function(){return D})),n.d(t,"getToday",(function(){return P})),n.d(t,"parseDate",(function(){return V})),n.d(t,"todayIsInRange",(function(){return N})),n.d(t,"DropdownMenu",(function(){return It})),n.d(t,"FocusAnywhereButHere",(function(){return $t})),n.d(t,"FocusIf",(function(){return qt})),n.d(t,"Tooltips",(function(){return Ur})),n.d(t,"MatomoDialog",(function(){return Tn})),n.d(t,"ExpandOnClick",(function(){return nn})),n.d(t,"ExpandOnHover",(function(){return un})),n.d(t,"ShowSensitiveData",(function(){return fn})),n.d(t,"DropdownButton",(function(){return bn})),n.d(t,"SelectOnFocus",(function(){return kn})),n.d(t,"SideNav",(function(){return En})),n.d(t,"EnrichedHeadline",(function(){return Yn})),n.d(t,"ContentBlock",(function(){return ar})),n.d(t,"Comparisons",(function(){return Wr})),n.d(t,"ComparisonsStore",(function(){return Er})),n.d(t,"ComparisonsStoreInstance",(function(){return Dr})),n.d(t,"MenuItemsDropdown",(function(){return ai})),n.d(t,"DatePicker",(function(){return pi})),n.d(t,"DateRangePicker",(function(){return yi})),n.d(t,"PeriodDatePicker",(function(){return Si})),n.d(t,"Notification",(function(){return dl})),n.d(t,"NotificationGroup",(function(){return Cl})),n.d(t,"NotificationsStore",(function(){return wl})),n.d(t,"SitesStore",(function(){return Qi})),n.d(t,"SiteSelector",(function(){return eo})),n.d(t,"QuickAccess",(function(){return bo})),n.d(t,"FieldArray",(function(){return Ao})),n.d(t,"MultiPairField",(function(){return Yo})),n.d(t,"PeriodSelector",(function(){return Ba})),n.d(t,"ReportingMenu",(function(){return ic})),n.d(t,"ReportingMenuStore",(function(){return Gl})),n.d(t,"ReportingPagesStore",(function(){return Tl})),n.d(t,"ReportMetadataStore",(function(){return pc})),n.d(t,"WidgetsStore",(function(){return tc})),n.d(t,"WidgetLoader",(function(){return jc})),n.d(t,"WidgetContainer",(function(){return Mc})),n.d(t,"WidgetByDimensionContainer",(function(){return Xc})),n.d(t,"Widget",(function(){return os})),n.d(t,"ReportingPage",(function(){return Ds})),n.d(t,"ReportExport",(function(){return ou})),n.d(t,"Sparkline",(function(){return du})),n.d(t,"Progressbar",(function(){return bu})),n.d(t,"ContentIntro",(function(){return yu})),n.d(t,"ContentTable",(function(){return Ou})),n.d(t,"AjaxForm",(function(){return Pu})),n.d(t,"Passthrough",(function(){return Wu})),"undefined"!==typeof window){var r=window.document.currentScript,i=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}n("2342");var o=n("8bbf");function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var u,d=function(){function e(){a(this,e),s(this,"periods",{}),s(this,"periodOrder",[])}return c(e,[{key:"addCustomPeriod",value:function(e,t){if(this.periods[e])throw new Error('The "'.concat(e,'" period already exists! It cannot be overridden.'));this.periods[e]=t,this.periodOrder.push(e)}},{key:"getAllLabels",value:function(){return Array().concat(this.periodOrder)}},{key:"get",value:function(e){var t=this.periods[e];if(!t)throw new Error("Invalid period label: ".concat(e));return t}},{key:"parse",value:function(e,t){return this.get(e).parse(t)}},{key:"isRecognizedPeriod",value:function(e){return!!this.periods[e]}}]),e}(),m=new d;function p(e){return v(e)||g(e)||h(e)||f()}function f(){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 h(e,t){if(e){if("string"===typeof e)return b(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)?b(e,t):void 0}}function g(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function v(e){if(Array.isArray(e))return b(e)}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r} -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var y=window,w=y.piwik,O=y.broadcast,j=y.piwikHelper;w.helper=j,w.broadcast=O,w.updateDateInTitle=function(e,t){if($(".top_controls #periodString").length&&(u=u||document.title,0===u.indexOf(w.siteName))){var n=" - ".concat(m.parse(t,e).getPrettyString()," ");document.title="".concat(w.siteName).concat(n).concat(u.slice(w.siteName.length))}},w.hasUserCapability=function(e){return window.angular.isArray(w.userCapabilities)&&-1!==w.userCapabilities.indexOf(e)},w.on=function(e,t){function n(e){t.apply(void 0,p(e.detail))}t.wrapper=n,window.addEventListener(e,n)},w.off=function(e,t){t.wrapper&&window.removeEventListener(e,t.wrapper)},w.postEventNoEmit=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=new CustomEvent(e,{detail:n});window.dispatchEvent(i)},w.postEvent=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];w.postEventNoEmit.apply(w,[e].concat(n)),window.angular.element((function(){var t=w.helper.getAngularDependency("$rootScope");t.$oldEmit.apply(t,[e].concat(n))}))};var k=w,S=k; + */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 ct})),n.d(t,"importPluginUmd",(function(){return pt})),n.d(t,"useExternalPluginComponent",(function(){return ft})),n.d(t,"DirectiveUtilities",(function(){return bt})),n.d(t,"debounce",(function(){return vt})),n.d(t,"getFormattedEvolution",(function(){return jt})),n.d(t,"clone",(function(){return wt})),n.d(t,"VueEntryContainer",(function(){return Et})),n.d(t,"ActivityIndicator",(function(){return Nt})),n.d(t,"translate",(function(){return a})),n.d(t,"translateOrDefault",(function(){return i})),n.d(t,"Alert",(function(){return At})),n.d(t,"AjaxHelper",(function(){return Je})),n.d(t,"setCookie",(function(){return nt})),n.d(t,"getCookie",(function(){return rt})),n.d(t,"deleteCookie",(function(){return ot})),n.d(t,"MatomoUrl",(function(){return Ce})),n.d(t,"Matomo",(function(){return ce})),n.d(t,"Periods",(function(){return m})),n.d(t,"Day",(function(){return j})),n.d(t,"Week",(function(){return E})),n.d(t,"Month",(function(){return N})),n.d(t,"Year",(function(){return L})),n.d(t,"Range",(function(){return Y})),n.d(t,"format",(function(){return p})),n.d(t,"getToday",(function(){return f})),n.d(t,"parseDate",(function(){return h})),n.d(t,"todayIsInRange",(function(){return b})),n.d(t,"DropdownMenu",(function(){return Lt})),n.d(t,"FocusAnywhereButHere",(function(){return Ut})),n.d(t,"FocusIf",(function(){return qt})),n.d(t,"Tooltips",(function(){return Jt})),n.d(t,"MatomoDialog",(function(){return Zt})),n.d(t,"ExpandOnClick",(function(){return sn})),n.d(t,"ExpandOnHover",(function(){return hn})),n.d(t,"ShowSensitiveData",(function(){return vn})),n.d(t,"DropdownButton",(function(){return jn})),n.d(t,"SelectOnFocus",(function(){return Cn})),n.d(t,"SideNav",(function(){return En})),n.d(t,"EnrichedHeadline",(function(){return qn})),n.d(t,"ContentBlock",(function(){return tr})),n.d(t,"Comparisons",(function(){return Ar})),n.d(t,"ComparisonsStore",(function(){return Ir})),n.d(t,"ComparisonsStoreInstance",(function(){return xr})),n.d(t,"MenuItemsDropdown",(function(){return Jr})),n.d(t,"DatePicker",(function(){return no})),n.d(t,"DateRangePicker",(function(){return so})),n.d(t,"PeriodDatePicker",(function(){return ho})),n.d(t,"Notification",(function(){return Eo})),n.d(t,"NotificationGroup",(function(){return Ro})),n.d(t,"NotificationsStore",(function(){return _o})),n.d(t,"SitesStore",(function(){return zo})),n.d(t,"SiteSelector",(function(){return fa})),n.d(t,"QuickAccess",(function(){return Va})),n.d(t,"FieldArray",(function(){return qa})),n.d(t,"MultiPairField",(function(){return li})),n.d(t,"PeriodSelector",(function(){return Ui})),n.d(t,"ReportingMenu",(function(){return Rl})),n.d(t,"ReportingMenuStore",(function(){return Tl})),n.d(t,"ReportingPagesStore",(function(){return pl})),n.d(t,"ReportMetadataStore",(function(){return zl})),n.d(t,"WidgetsStore",(function(){return Ml})),n.d(t,"WidgetLoader",(function(){return tc})),n.d(t,"WidgetContainer",(function(){return bc})),n.d(t,"WidgetByDimensionContainer",(function(){return Ic})),n.d(t,"Widget",(function(){return Fc})),n.d(t,"ReportingPage",(function(){return ls})),n.d(t,"ReportExport",(function(){return Fs})),n.d(t,"Sparkline",(function(){return qs})),n.d(t,"Progressbar",(function(){return Qs})),n.d(t,"ContentIntro",(function(){return Xs})),n.d(t,"ContentTable",(function(){return Zs})),n.d(t,"AjaxForm",(function(){return au})),n.d(t,"Passthrough",(function(){return cu})),n.d(t,"DataTableActions",(function(){return hd})),n.d(t,"VersionInfoHeaderMessage",(function(){return Pd})),n.d(t,"MobileLeftMenu",(function(){return Kd})),n.d(t,"scrollToAnchorInUrl",(function(){return am})),"undefined"!==typeof window){var r=window.document.currentScript,o=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);o&&(n.p=o[1])}n("2342"); /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function C(e){if(!e)return"";for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=n;return 1===n.length&&n[0]&&Array.isArray(n[0])&&(i=n[0]),window._pk_translate(e,i)}function E(e){if(!e||!window.piwik_translations[e])return e;for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return C.apply(void 0,[e].concat(n))} -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function D(e){return $.datepicker.formatDate("yy-mm-dd",e)}function P(){var e=new Date(Date.now());return e.setTime(e.getTime()+60*e.getTimezoneOffset()*1e3),e.setHours(e.getHours()+(window.piwik.timezoneOffset||0)/3600),e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),e}function V(e){if(e instanceof Date)return e;var t=decodeURIComponent(e).trim();if(""===t)throw new Error("Invalid date, empty string.");if("today"===t||"now"===t)return P();if("yesterday"===t||"yesterdaySameTime"===t){var n=P();return n.setDate(n.getDate()-1),n}if(t.match(/last[ -]?week/i)){var r=P();return r.setDate(r.getDate()-7),r}if(t.match(/last[ -]?month/i)){var i=P();return i.setDate(1),i.setMonth(i.getMonth()-1),i}if(t.match(/last[ -]?year/i)){var o=P();return o.setFullYear(o.getFullYear()-1),o}return $.datepicker.parseDate("yy-mm-dd",t)}function N(e){return 2===e.length&&(P()>=e[0]&&P()<=e[1])}function T(e,t){return M(e)||B(e,t)||x(e,t)||A()}function A(){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 x(e,t){if(e){if("string"===typeof e)return I(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)?I(e,t):void 0}}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function B(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0)if(o.push(r.value),t&&o.length===t)break}catch(c){l=!0,i=c}finally{try{a||null==n["return"]||n["return"]()}finally{if(l)throw i}}return o}}function M(e){if(Array.isArray(e))return e}function L(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function R(e,t,n){return t&&F(e.prototype,t),n&&F(e,n),e}function _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} +function a(e){if(!e)return"";for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=n;return 1===n.length&&n[0]&&Array.isArray(n[0])&&(o=n[0]),window._pk_translate(e,o)}function i(e){if(!e||!window.piwik_translations[e])return e;for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return a.apply(void 0,[e].concat(n))}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var H=function(){function e(t,n,r){L(this,e),_(this,"startDate",void 0),_(this,"endDate",void 0),_(this,"childPeriodType",void 0),this.startDate=t,this.endDate=n,this.childPeriodType=r}return R(e,[{key:"getPrettyString",value:function(){var e=D(this.startDate),t=D(this.endDate);return C("General_DateRangeFromTo",[e,t])}},{key:"getDateRange",value:function(){return[this.startDate,this.endDate]}},{key:"containsToday",value:function(){return N(this.getDateRange())}},{key:"getDayCount",value:function(){return Math.ceil((this.endDate.getTime()-this.startDate.getTime())/864e5)+1}}],[{key:"getLastNRange",value:function(t,n,r){var i=Math.max(parseInt(n.toString(),10)-1,0);if(Number.isNaN(i))throw new Error("Invalid range strAmount");var o=r?V(r):P(),a=new Date(o.getTime());if("day"===t)a.setDate(a.getDate()-i);else if("week"===t)a.setDate(a.getDate()-7*i);else if("month"===t)a.setDate(1),a.setMonth(a.getMonth()-i);else{if("year"!==t)throw new Error("Unknown period type '".concat(t,"'."));a.setFullYear(a.getFullYear()-i)}if("day"!==t){var l=m.periods[t].parse(a),c=m.periods[t].parse(o),s=l.getDateRange(),u=T(s,1);a=u[0];var d=c.getDateRange(),p=T(d,2);o=p[1]}var f=new Date(1991,7,6);if(a.getTime()-f.getTime()<0)switch(t){case"year":a=new Date(1992,0,1);break;case"month":a=new Date(1991,8,1);break;case"week":a=new Date(1991,8,12);break;case"day":default:a=f;break}return new e(a,o,t)}},{key:"getLastNRangeChild",value:function(t,n,r){var i=n?V(n):P(),o=new Date(i.getTime()),a=new Date(i.getTime());if("day"===t)o.setDate(o.getDate()-r),a.setDate(a.getDate()-r);else if("week"===t)o.setDate(o.getDate()-7*r),a.setDate(a.getDate()-7*r);else if("month"===t)o.setDate(1),o.setMonth(o.getMonth()-r),a.setDate(1),a.setMonth(a.getMonth()-r);else{if("year"!==t)throw new Error("Unknown period type '".concat(t,"'."));o.setFullYear(o.getFullYear()-r),a.setFullYear(a.getFullYear()-r)}if("day"!==t){var l=m.periods[t].parse(o),c=m.periods[t].parse(a),s=l.getDateRange(),u=T(s,1);o=u[0];var d=c.getDateRange(),p=T(d,2);a=p[1]}var f=new Date(1991,7,6);if(o.getTime()-f.getTime()<0)switch(t){case"year":o=new Date(1992,0,1);break;case"month":o=new Date(1991,8,1);break;case"week":o=new Date(1991,8,12);break;case"day":default:o=f;break}return new e(o,a,t)}},{key:"parse",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"day";if(/^previous/.test(t)){var r=e.getLastNRange(n,"2").startDate;return e.getLastNRange(n,t.substring(8),r)}if(/^last/.test(t))return e.getLastNRange(n,t.substring(4));var i=decodeURIComponent(t).split(",");return new e(V(i[0]),V(i[1]),n)}},{key:"getDisplayText",value:function(){return C("General_DateRangeInPeriodList")}}]),e}();function U(){return{getAllLabels:m.getAllLabels.bind(m),isRecognizedPeriod:m.isRecognizedPeriod.bind(m),get:m.get.bind(m),parse:m.parse.bind(m),parseDate:V,format:D,RangePeriod:H,todayIsInRange:N}}function q(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function W(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function J(e,t,n){return t&&W(e.prototype,t),n&&W(e,n),e}function G(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */m.addCustomPeriod("range",H), + */var d=function(){function e(){l(this,e),u(this,"periods",{}),u(this,"periodOrder",[])}return s(e,[{key:"addCustomPeriod",value:function(e,t){if(this.periods[e])throw new Error('The "'.concat(e,'" period already exists! It cannot be overridden.'));this.periods[e]=t,this.periodOrder.push(e)}},{key:"getAllLabels",value:function(){return Array().concat(this.periodOrder)}},{key:"get",value:function(e){var t=this.periods[e];if(!t)throw new Error("Invalid period label: ".concat(e));return t}},{key:"parse",value:function(e,t){return this.get(e).parse(t)}},{key:"isRecognizedPeriod",value:function(e){return!!this.periods[e]}}]),e}(),m=new d; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -window.piwik.addCustomPeriod=m.addCustomPeriod.bind(m),window.angular.module("piwikApp.service").factory("piwikPeriods",U);var z=function(){function e(t){q(this,e),G(this,"dateInPeriod",void 0),this.dateInPeriod=t}return J(e,[{key:"getPrettyString",value:function(){return D(this.dateInPeriod)}},{key:"getDateRange",value:function(){return[new Date(this.dateInPeriod.getTime()),new Date(this.dateInPeriod.getTime())]}},{key:"containsToday",value:function(){return N(this.getDateRange())}}],[{key:"parse",value:function(t){return new e(V(t))}},{key:"getDisplayText",value:function(){return C("Intl_PeriodDay")}}]),e}();function Y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Q(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function K(e,t,n){return t&&Q(e.prototype,t),n&&Q(e,n),e}function X(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} +function p(e){return $.datepicker.formatDate("yy-mm-dd",e)}function f(){var e=new Date(Date.now());return e.setTime(e.getTime()+60*e.getTimezoneOffset()*1e3),e.setHours(e.getHours()+(window.piwik.timezoneOffset||0)/3600),e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),e}function h(e){if(e instanceof Date)return e;var t=decodeURIComponent(e).trim();if(""===t)throw new Error("Invalid date, empty string.");if("today"===t||"now"===t)return f();if("yesterday"===t||"yesterdaySameTime"===t){var n=f();return n.setDate(n.getDate()-1),n}if(t.match(/last[ -]?week/i)){var r=f();return r.setDate(r.getDate()-7),r}if(t.match(/last[ -]?month/i)){var o=f();return o.setDate(1),o.setMonth(o.getMonth()-1),o}if(t.match(/last[ -]?year/i)){var a=f();return a.setFullYear(a.getFullYear()-1),a}return $.datepicker.parseDate("yy-mm-dd",t)}function b(e){return 2===e.length&&(f()>=e[0]&&f()<=e[1])}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function y(e,t,n){return t&&v(e.prototype,t),n&&v(e,n),e}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */m.addCustomPeriod("day",z);var Z=function(){function e(t){Y(this,e),X(this,"dateInPeriod",void 0),this.dateInPeriod=t}return K(e,[{key:"getPrettyString",value:function(){var e=this.getDateRange(),t=D(e[0]),n=D(e[1]);return C("General_DateRangeFromTo",[t,n])}},{key:"getDateRange",value:function(){var e=(this.dateInPeriod.getDay()+6)%7,t=new Date(this.dateInPeriod.getTime());t.setDate(this.dateInPeriod.getDate()-e);var n=new Date(t.getTime());return n.setDate(t.getDate()+6),[t,n]}},{key:"containsToday",value:function(){return N(this.getDateRange())}}],[{key:"parse",value:function(t){return new e(V(t))}},{key:"getDisplayText",value:function(){return C("Intl_PeriodWeek")}}]),e}();function ee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function te(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ne(e,t,n){return t&&te(e.prototype,t),n&&te(e,n),e}function re(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} + */var j=function(){function e(t){g(this,e),O(this,"dateInPeriod",void 0),this.dateInPeriod=t}return y(e,[{key:"getPrettyString",value:function(){return p(this.dateInPeriod)}},{key:"getDateRange",value:function(){return[new Date(this.dateInPeriod.getTime()),new Date(this.dateInPeriod.getTime())]}},{key:"containsToday",value:function(){return b(this.getDateRange())}}],[{key:"parse",value:function(t){return new e(h(t))}},{key:"getDisplayText",value:function(){return a("Intl_PeriodDay")}}]),e}();function w(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function S(e,t,n){return t&&k(e.prototype,t),n&&k(e,n),e}function C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */m.addCustomPeriod("week",Z);var ie=function(){function e(t){ee(this,e),re(this,"dateInPeriod",void 0),this.dateInPeriod=t}return ne(e,[{key:"getPrettyString",value:function(){var e=C("Intl_Month_Long_StandAlone_".concat(this.dateInPeriod.getMonth()+1));return"".concat(e," ").concat(this.dateInPeriod.getFullYear())}},{key:"getDateRange",value:function(){var e=new Date(this.dateInPeriod.getTime());e.setDate(1);var t=new Date(this.dateInPeriod.getTime());return t.setDate(1),t.setMonth(t.getMonth()+1),t.setDate(0),[e,t]}},{key:"containsToday",value:function(){return N(this.getDateRange())}}],[{key:"parse",value:function(t){return new e(V(t))}},{key:"getDisplayText",value:function(){return C("Intl_PeriodMonth")}}]),e}();function oe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ae(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function le(e,t,n){return t&&ae(e.prototype,t),n&&ae(e,n),e}function ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} + */m.addCustomPeriod("day",j);var E=function(){function e(t){w(this,e),C(this,"dateInPeriod",void 0),this.dateInPeriod=t}return S(e,[{key:"getPrettyString",value:function(){var e=this.getDateRange(),t=p(e[0]),n=p(e[1]);return a("General_DateRangeFromTo",[t,n])}},{key:"getDateRange",value:function(){var e=(this.dateInPeriod.getDay()+6)%7,t=new Date(this.dateInPeriod.getTime());t.setDate(this.dateInPeriod.getDate()-e);var n=new Date(t.getTime());return n.setDate(t.getDate()+6),[t,n]}},{key:"containsToday",value:function(){return b(this.getDateRange())}}],[{key:"parse",value:function(t){return new e(h(t))}},{key:"getDisplayText",value:function(){return a("Intl_PeriodWeek")}}]),e}();function D(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function P(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function T(e,t,n){return t&&P(e.prototype,t),n&&P(e,n),e}function V(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */m.addCustomPeriod("month",ie);var se=function(){function e(t){oe(this,e),ce(this,"dateInPeriod",void 0),this.dateInPeriod=t}return le(e,[{key:"getPrettyString",value:function(){return this.dateInPeriod.getFullYear().toString()}},{key:"getDateRange",value:function(){var e=new Date(this.dateInPeriod.getTime());e.setMonth(0),e.setDate(1);var t=new Date(this.dateInPeriod.getTime());return t.setMonth(12),t.setDate(0),[e,t]}},{key:"containsToday",value:function(){return N(this.getDateRange())}}],[{key:"parse",value:function(t){return new e(V(t))}},{key:"getDisplayText",value:function(){return C("Intl_PeriodYear")}}]),e}(); + */m.addCustomPeriod("week",E);var N=function(){function e(t){D(this,e),V(this,"dateInPeriod",void 0),this.dateInPeriod=t}return T(e,[{key:"getPrettyString",value:function(){var e=a("Intl_Month_Long_StandAlone_".concat(this.dateInPeriod.getMonth()+1));return"".concat(e," ").concat(this.dateInPeriod.getFullYear())}},{key:"getDateRange",value:function(){var e=new Date(this.dateInPeriod.getTime());e.setDate(1);var t=new Date(this.dateInPeriod.getTime());return t.setDate(1),t.setMonth(t.getMonth()+1),t.setDate(0),[e,t]}},{key:"containsToday",value:function(){return b(this.getDateRange())}}],[{key:"parse",value:function(t){return new e(h(t))}},{key:"getDisplayText",value:function(){return a("Intl_PeriodMonth")}}]),e}();function I(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function B(e,t,n){return t&&x(e.prototype,t),n&&x(e,n),e}function A(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,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 ue(e,t){return he(e)||fe(e,t)||me(e,t)||de()}function de(){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 me(e,t){if(e){if("string"===typeof e)return pe(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)?pe(e,t):void 0}}function pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fe(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0)if(o.push(r.value),t&&o.length===t)break}catch(c){l=!0,i=c}finally{try{a||null==n["return"]||n["return"]()}finally{if(l)throw i}}return o}}function he(e){if(Array.isArray(e))return e}function ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ve(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function be(e,t,n){return t&&ve(e.prototype,t),n&&ve(e,n),e}function ye(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} + */m.addCustomPeriod("month",N);var L=function(){function e(t){I(this,e),A(this,"dateInPeriod",void 0),this.dateInPeriod=t}return B(e,[{key:"getPrettyString",value:function(){return this.dateInPeriod.getFullYear().toString()}},{key:"getDateRange",value:function(){var e=new Date(this.dateInPeriod.getTime());e.setMonth(0),e.setDate(1);var t=new Date(this.dateInPeriod.getTime());return t.setMonth(12),t.setDate(0),[e,t]}},{key:"containsToday",value:function(){return b(this.getDateRange())}}],[{key:"parse",value:function(t){return new e(h(t))}},{key:"getDisplayText",value:function(){return a("Intl_PeriodYear")}}]),e}();function M(e,t){return U(e)||H(e,t)||F(e,t)||_()}function _(){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 F(e,t){if(e){if("string"===typeof e)return R(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)?R(e,t):void 0}}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function H(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done);i=!0)if(a.push(r.value),t&&a.length===t)break}catch(c){l=!0,o=c}finally{try{i||null==n["return"]||n["return"]()}finally{if(l)throw o}}return a}}function U(e){if(Array.isArray(e))return e}function q(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function W(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function z(e,t,n){return t&&W(e.prototype,t),n&&W(e,n),e}function G(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */m.addCustomPeriod("year",se);var we=window,Oe=we.piwik,je=we.broadcast;function ke(e,t){try{return m.parse(e,t),!0}catch(n){return!1}}var Se=function(){function e(){var t=this;ge(this,e),ye(this,"url",Object(o["ref"])(null)),ye(this,"urlQuery",Object(o["computed"])((function(){return t.url.value?t.url.value.search.replace(/^\?/,""):""}))),ye(this,"hashQuery",Object(o["computed"])((function(){return t.url.value?t.url.value.hash.replace(/^[#/?]+/,""):""}))),ye(this,"urlParsed",Object(o["computed"])((function(){return Object(o["readonly"])(t.parse(t.urlQuery.value))}))),ye(this,"hashParsed",Object(o["computed"])((function(){return Object(o["readonly"])(t.parse(t.hashQuery.value))}))),ye(this,"parsed",Object(o["computed"])((function(){return Object(o["readonly"])(Object.assign(Object.assign({},t.urlParsed.value),t.hashParsed.value))}))),this.url.value=new URL(window.location.href),S.on("$locationChangeSuccess",(function(e){t.url.value=new URL(e)})),this.updatePeriodParamsFromUrl()}return be(e,[{key:"updateHashToUrl",value:function(e){var t=S.helper.getAngularDependency("$location");t.url(e);var n=S.helper.getAngularDependency("$timeout");n()}},{key:"updateHash",value:function(e){var t=this.getFinalHashParams(e),n=this.stringify(t),r=S.helper.getAngularDependency("$location");r.search(n);var i=S.helper.getAngularDependency("$timeout");i()}},{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=Object.keys(t).length?this.getFinalHashParams(t,e):{},i=this.stringify(r),o="?".concat(n);i.length&&(o="".concat(o,"#?").concat(i)),window.broadcast.propagateNewPage("",void 0,void 0,void 0,o)}},{key:"getFinalHashParams",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="string"!==typeof e?e:this.parse(e),r="string"!==typeof e?t:this.parse(t);return Object.assign({period:r.period||this.parsed.value.period,date:r.date||this.parsed.value.date,segment:r.segment||this.parsed.value.segment},n)}},{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:"parse",value:function(e){return je.getValuesFromUrl("?".concat(e),!0)}},{key:"stringify",value:function(e){var t=Object.fromEntries(Object.entries(e).filter((function(e){var t=ue(e,2),n=t[1];return""!==n&&null!==n&&void 0!==n})));return $.param(t).replace(/%5B%5D/g,"[]").replace(/%2C/g,",").replace(/\+/g,"%20")}},{key:"updatePeriodParamsFromUrl",value:function(){var e=this.getSearchParam("date"),t=this.getSearchParam("period");if(ke(t,e)&&(Oe.period!==t||Oe.currentDateString!==e)){Oe.period=t;var n=m.parse(t,e).getDateRange();Oe.startDateString=D(n[0]),Oe.endDateString=D(n[1]),Oe.updateDateInTitle(e,t),"range"===Oe.period&&(e="".concat(Oe.startDateString,",").concat(Oe.endDateString)),Oe.currentDateString=e}}}]),e}(),Ce=new Se,Ee=Ce; + */m.addCustomPeriod("year",L);var Y=function(){function e(t,n,r){q(this,e),G(this,"startDate",void 0),G(this,"endDate",void 0),G(this,"childPeriodType",void 0),this.startDate=t,this.endDate=n,this.childPeriodType=r}return z(e,[{key:"getPrettyString",value:function(){var e=p(this.startDate),t=p(this.endDate);return a("General_DateRangeFromTo",[e,t])}},{key:"getDateRange",value:function(){return[this.startDate,this.endDate]}},{key:"containsToday",value:function(){return b(this.getDateRange())}},{key:"getDayCount",value:function(){return Math.ceil((this.endDate.getTime()-this.startDate.getTime())/864e5)+1}}],[{key:"getLastNRange",value:function(t,n,r){var o=Math.max(parseInt(n.toString(),10)-1,0);if(Number.isNaN(o))throw new Error("Invalid range strAmount");var a=r?h(r):f(),i=new Date(a.getTime());if("day"===t)i.setDate(i.getDate()-o);else if("week"===t)i.setDate(i.getDate()-7*o);else if("month"===t)i.setDate(1),i.setMonth(i.getMonth()-o);else{if("year"!==t)throw new Error("Unknown period type '".concat(t,"'."));i.setFullYear(i.getFullYear()-o)}if("day"!==t){var l=m.periods[t].parse(i),c=m.periods[t].parse(a),s=l.getDateRange(),u=M(s,1);i=u[0];var d=c.getDateRange(),p=M(d,2);a=p[1]}var b=new Date(1991,7,6);if(i.getTime()-b.getTime()<0)switch(t){case"year":i=new Date(1992,0,1);break;case"month":i=new Date(1991,8,1);break;case"week":i=new Date(1991,8,12);break;case"day":default:i=b;break}return new e(i,a,t)}},{key:"getLastNRangeChild",value:function(t,n,r){var o=n?h(n):f(),a=new Date(o.getTime()),i=new Date(o.getTime());if("day"===t)a.setDate(a.getDate()-r),i.setDate(i.getDate()-r);else if("week"===t)a.setDate(a.getDate()-7*r),i.setDate(i.getDate()-7*r);else if("month"===t)a.setDate(1),a.setMonth(a.getMonth()-r),i.setDate(1),i.setMonth(i.getMonth()-r);else{if("year"!==t)throw new Error("Unknown period type '".concat(t,"'."));a.setFullYear(a.getFullYear()-r),i.setFullYear(i.getFullYear()-r)}if("day"!==t){var l=m.periods[t].parse(a),c=m.periods[t].parse(i),s=l.getDateRange(),u=M(s,1);a=u[0];var d=c.getDateRange(),p=M(d,2);i=p[1]}var b=new Date(1991,7,6);if(a.getTime()-b.getTime()<0)switch(t){case"year":a=new Date(1992,0,1);break;case"month":a=new Date(1991,8,1);break;case"week":a=new Date(1991,8,12);break;case"day":default:a=b;break}return new e(a,i,t)}},{key:"parse",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"day";if(/^previous/.test(t)){var r=e.getLastNRange(n,"2").startDate;return e.getLastNRange(n,t.substring(8),r)}if(/^last/.test(t))return e.getLastNRange(n,t.substring(4));var o=decodeURIComponent(t).split(",");return new e(h(o[0]),h(o[1]),n)}},{key:"getDisplayText",value:function(){return a("General_DateRangeInPeriodList")}}]),e}();m.addCustomPeriod("range",Y);var J,K=n("8bbf");function Q(e){return te(e)||ee(e)||Z(e)||X()}function X(){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 Z(e,t){if(e){if("string"===typeof e)return ne(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)?ne(e,t):void 0}}function ee(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function te(e){if(Array.isArray(e))return ne(e)}function ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -function De(){var e={getSearchParam:Ee.getSearchParam.bind(Ee)};return e} + */var re=window,oe=re.piwik,ae=re.broadcast,ie=re.piwikHelper;oe.helper=ie,oe.broadcast=ae,oe.updateDateInTitle=function(e,t){if($(".top_controls #periodString").length&&(J=J||document.title,0===J.indexOf(oe.siteName))){var n=" - ".concat(m.parse(t,e).getPrettyString()," ");document.title="".concat(oe.siteName).concat(n).concat(J.slice(oe.siteName.length))}},oe.hasUserCapability=function(e){return window.angular.isArray(oe.userCapabilities)&&-1!==oe.userCapabilities.indexOf(e)},oe.on=function(e,t){function n(e){t.apply(void 0,Q(e.detail))}t.wrapper=n,window.addEventListener(e,n)},oe.off=function(e,t){t.wrapper&&window.removeEventListener(e,t.wrapper)},oe.postEvent=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=new CustomEvent(e,{detail:n});window.dispatchEvent(o)};var le=oe,ce=le; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function Pe(){return S}function Ve(e,t){t.$oldEmit=t.$emit,t.$emit=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return S.postEventNoEmit.apply(S,[e].concat(n)),this.$oldEmit.apply(this,[e].concat(n))},t.$oldBroadcast=t.$broadcast,t.$broadcast=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return S.postEventNoEmit.apply(S,[e].concat(n)),this.$oldBroadcast.apply(this,[e].concat(n))},t.$on("$locationChangeSuccess",e.updatePeriodParamsFromUrl)}function Ne(e){return Ne="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ne(e)}function Te(e){return Be(e)||Ie(e)||xe(e)||Ae()}function Ae(){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 xe(e,t){if(e){if("string"===typeof e)return Me(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)?Me(e,t):void 0}}function Ie(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Be(e){if(Array.isArray(e))return Me(e)}function Me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Le(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Fe(e,t,n){return t&&Le(e.prototype,t),n&&Le(e,n),e}function Re(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $e(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ye(e,t)}function He(e){var t=Ge();return function(){var n,r=Qe(e);if(t){var i=Qe(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ue(this,n)}}function Ue(e,t){if(t&&("object"===Ne(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return qe(e)}function qe(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function We(e){var t="function"===typeof Map?new Map:void 0;return We=function(e){if(null===e||!ze(e))return e;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Je(e,arguments,Qe(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Ye(n,e)},We(e)}function Je(e,t,n){return Je=Ge()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=Function.bind.apply(e,r),o=new i;return n&&Ye(o,n.prototype),o},Je.apply(null,arguments)}function Ge(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function ze(e){return-1!==Function.toString.call(e).indexOf("[native code]")}function Ye(e,t){return Ye=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ye(e,t)}function Qe(e){return Qe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Qe(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 Ke(e,t){if("abort"!==t)if("undefined"!==typeof Piwik_Popover){var n=$("#loadingError");Piwik_Popover.isOpen()&&e&&500===e.status?e&&500===e.status&&$(document.body).html(piwikHelper.escape(e.responseText)):n.show()}else console.log("Request failed: ".concat(e.responseText))}Oe.updatePeriodParamsFromUrl=Ce.updatePeriodParamsFromUrl.bind(Ce),window.angular.module("piwikApp.service").service("piwikUrl",De),window.angular.module("piwikApp.service").run(["$location",function(){return null}]),window.angular.module("piwikApp.service").service("piwik",Pe),Ve.$inject=["piwik","$rootScope"],window.angular.module("piwikApp.service").run(Ve),window.globalAjaxQueue=[],window.globalAjaxQueue.active=0,window.globalAjaxQueue.clean=function(){for(var e=this.length;e>=0;e-=1)this[e]&&4!==this[e].readyState||this.splice(e,1)},window.globalAjaxQueue.push=function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.active+=n.length,this.clean(),(e=Array.prototype.push).call.apply(e,[this].concat(n))},window.globalAjaxQueue.abort=function(){this.forEach((function(e){return e&&e.abort&&e.abort()})),this.splice(0,this.length),this.active=0};var Xe=function(e){$e(n,e);var t=He(n);function n(){return _e(this,n),t.apply(this,arguments)}return n}(We(Error)),Ze=function(){function e(){_e(this,e),Re(this,"format","json"),Re(this,"timeout",null),Re(this,"callback",null),Re(this,"useRegularCallbackInCaseOfError",!1),Re(this,"errorCallback",void 0),Re(this,"withToken",!1),Re(this,"completeCallback",void 0),Re(this,"getParams",{}),Re(this,"getUrl","?"),Re(this,"postParams",{}),Re(this,"loadingElement",null),Re(this,"errorElement","#ajaxError"),Re(this,"headers",void 0),Re(this,"requestHandle",null),Re(this,"abortController",null),Re(this,"defaultParams",["idSite","period","date","segment"]),Re(this,"resolveWithHelper",!1),this.errorCallback=Ke}return Fe(e,[{key:"addParams",value:function(e,t){var n=this,r="string"===typeof e?window.broadcast.getValuesFromUrl(e):e,i=["compareSegments","comparePeriods","compareDates"];Object.keys(r).forEach((function(e){var o=r[e];(-1===i.indexOf(e)||o)&&("boolean"===typeof o&&(o=o?1:0),"get"===t.toLowerCase()?n.getParams[e]=o:"post"===t.toLowerCase()&&(n.postParams[e]=o))}))}},{key:"withTokenInUrl",value:function(){this.withToken=!0}},{key:"setUrl",value:function(e){this.addParams(broadcast.getValuesFromUrl(e),"GET")}},{key:"setBulkRequests",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map((function(e){return"string"===typeof e?e:$.param(e)}));this.addParams({module:"API",method:"API.getBulkRequest",urls:r,format:"json"},"post")}},{key:"setTimeout",value:function(e){this.timeout=e}},{key:"setCallback",value:function(e){this.callback=e}},{key:"useCallbackInCaseOfError",value:function(){this.useRegularCallbackInCaseOfError=!0}},{key:"redirectOnSuccess",value:function(e){this.setCallback((function(){piwikHelper.redirect(e)}))}},{key:"setErrorCallback",value:function(e){this.errorCallback=e}},{key:"setCompleteCallback",value:function(e){this.completeCallback=e}},{key:"setFormat",value:function(e){this.format=e}},{key:"setLoadingElement",value:function(e){this.loadingElement=e||"#ajaxLoadingDiv"}},{key:"setErrorElement",value:function(e){e&&(this.errorElement=e)}},{key:"useGETDefaultParameter",value:function(e){if(e&&this.defaultParams)for(var t=0;t<this.defaultParams.length;t+=1)if(this.defaultParams[t]===e)return!0;return!1}},{key:"removeDefaultParameter",value:function(e){if(e&&this.defaultParams)for(var t=0;t<this.defaultParams.length;t+=1)this.defaultParams[t]===e&&this.defaultParams.splice(t,1)}},{key:"send",value:function(){var e=this;$(this.errorElement).length&&$(this.errorElement).hide(),this.loadingElement&&$(this.loadingElement).fadeIn(),this.requestHandle=this.buildAjaxCall(),window.globalAjaxQueue.push(this.requestHandle);var t=null;try{t=S.helper.getAngularDependency("$timeout")}catch(r){}this.abortController&&this.abortController.signal.addEventListener("abort",(function(){e.requestHandle&&e.requestHandle.abort()}));var n=new Promise((function(n,r){e.requestHandle.then((function(t){e.resolveWithHelper?n(e):n(t)})).fail((function(t){if(429===t.status)return console.log("Warning: the '".concat($.param(e.getParams),"' request was rate limited!")),void r(t);"abort"!==t.statusText&&(console.log("Warning: the ".concat($.param(e.getParams)," request failed!")),r(t))})).done((function(){t&&t()}))}));return n}},{key:"abort",value:function(){this.requestHandle&&"function"===typeof this.requestHandle.abort&&(this.requestHandle.abort(),this.requestHandle=null)}},{key:"buildAjaxCall",value:function(){var e=this,t=this,n=this.mixinDefaultGetParams(this.getParams),r=this.getUrl;"?"!==r[r.length-1]&&(r+="&"),n.segment&&(r="".concat(r,"segment=").concat(n.segment,"&"),delete n.segment),n.date&&(r="".concat(r,"date=").concat(decodeURIComponent(n.date.toString()),"&"),delete n.date),r+=$.param(n);var i={type:"POST",async:!0,url:r,dataType:this.format||"json",complete:this.completeCallback,headers:this.headers?this.headers:void 0,error:function(){if(window.globalAjaxQueue.active-=1,t.errorCallback){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.errorCallback.apply(this,n)}},success:function(t,n,r){e.loadingElement&&$(e.loadingElement).hide();var i="API.getBulkRequest"===e.postParams.method&&Array.isArray(t)?t:[t],o=i.filter((function(e){return"error"===e.result})).map((function(e){return e.message})).filter((function(e){return e.length})).reduce((function(e,t){return e[t]=(e[t]||0)+1,e}),{});if(o&&Object.keys(o).length&&!e.useRegularCallbackInCaseOfError){var a="";Object.keys(o).forEach((function(e){a.length&&(a+="<br />"),o[e]>1?a+="".concat(e," (").concat(o[e],"x)"):a+=e}));var l=null,c="toast";$(e.errorElement).length&&a.length&&($(e.errorElement).show(),l=e.errorElement,c=null);var s=!document.querySelector("#login_form");if(a&&s){var u=window["require"]("piwik/UI"),d=new u.Notification;d.show(a,{placeat:l,context:"error",type:c,id:"ajaxHelper"}),d.scrollToNotification()}}else e.callback&&e.callback(t,n,r);window.globalAjaxQueue.active-=1,S.ajaxRequestFinished&&S.ajaxRequestFinished()},data:this.mixinDefaultPostParams(this.postParams),timeout:null!==this.timeout?this.timeout:void 0};return $.ajax(i)}},{key:"isRequestToApiMethod",value:function(){return this.getParams&&"API"===this.getParams.module&&this.getParams.method||this.postParams&&"API"===this.postParams.module&&this.postParams.method}},{key:"isWidgetizedRequest",value:function(){return"Widgetize"===broadcast.getValueFromUrl("module")}},{key:"getDefaultPostParams",value:function(){return this.withToken||this.isRequestToApiMethod()||S.shouldPropagateTokenAuth?{token_auth:S.token_auth,force_api_session:broadcast.isWidgetizeRequestWithoutSession()?0:1}:{}}},{key:"mixinDefaultPostParams",value:function(e){var t=this.getDefaultPostParams(),n=Object.assign(Object.assign({},t),e);return n}},{key:"mixinDefaultGetParams",value:function(e){var t=this,n=Ee.getSearchParam("segment"),r={idSite:S.idSite?S.idSite.toString():broadcast.getValueFromUrl("idSite"),period:S.period||broadcast.getValueFromUrl("period"),segment:n},i=e;return i.token_auth&&(i.token_auth=null,delete i.token_auth),Object.keys(r).forEach((function(e){!t.useGETDefaultParameter(e)||null!==i[e]&&"undefined"!==typeof i[e]&&""!==i[e]||null!==t.postParams[e]&&"undefined"!==typeof t.postParams[e]&&""!==t.postParams[e]||!r[e]||(i[e]=r[e])})),!this.useGETDefaultParameter("date")||i.date||this.postParams.date||(i.date=S.currentDateString),i}},{key:"getRequestHandle",value:function(){return this.requestHandle}}],[{key:"fetch",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new e;n.withTokenInUrl&&r.withTokenInUrl(),n.errorElement&&r.setErrorElement(n.errorElement),n.redirectOnSuccess&&r.redirectOnSuccess(!0!==n.redirectOnSuccess?n.redirectOnSuccess:void 0),r.setFormat(n.format||"json"),Array.isArray(t)?r.setBulkRequests.apply(r,Te(t)):r.addParams(Object.assign(Object.assign({module:"API",format:n.format||"json"},t),{},{segment:t.segment?encodeURIComponent(t.segment):void 0}),"get"),n.postParams&&r.addParams(n.postParams,"post"),n.headers&&(r.headers=n.headers);var i=!0;return"undefined"===typeof n.createErrorNotification||n.createErrorNotification||(r.useCallbackInCaseOfError(),r.setErrorCallback(null),i=!1),n.abortController&&(r.abortController=n.abortController),n.returnResponseObject&&(r.resolveWithHelper=!0),r.send().then((function(t){var n=t instanceof e?t.requestHandle.responseJSON:t,i="API.getBulkRequest"===r.postParams.method&&Array.isArray(n)?n:[n],o=i.filter((function(e){return"error"===e.result})).map((function(e){return e.message}));if(o.length)throw new Xe(o.filter((function(e){return e.length})).join("\n"));return t})).catch((function(e){if(i)throw e;var t="Something went wrong";throw 504===e.status&&(t="Request was possibly aborted"),429===e.status&&(t="Rate Limit was exceed"),new Error(t)}))}},{key:"post",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.fetch(t,Object.assign(Object.assign({},r),{},{postParams:n}))}},{key:"oneAtATime",value:function(t,n){var r=null;return function(i,o){return r&&r.abort(),r=new AbortController,e.post(Object.assign(Object.assign({},i),{},{method:t}),o,Object.assign(Object.assign({},n),{},{abortController:r})).finally((function(){r=null}))}}}]),e}();function et(){return window.globalAjaxQueue}function tt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function rt(e,t,n){return t&&nt(e.prototype,t),n&&nt(e,n),e} -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */window.ajaxHelper=Ze,window.angular.module("piwikApp.service").service("globalAjaxQueue",et);var it=window,ot=it.$,at=function(){function e(){tt(this,e),this.setup()}return rt(e,[{key:"setup",value:function(){var e=this;Object(o["watch"])((function(){return Ee.parsed.value.popover}),(function(){return e.onPopoverParamChanged()})),Ee.parsed.value.popover&&this.onPopoverParamChangedInitial()}},{key:"onPopoverParamChangedInitial",value:function(){var e=this;ot((function(){setTimeout((function(){e.openOrClose()}))}))}},{key:"onPopoverParamChanged",value:function(){var e=this;ot((function(){e.openOrClose()}))}},{key:"openOrClose",value:function(){this.close();var e=Ee.parsed.value.popover;e?this.open(e):window.broadcast.resetPopoverStack()}},{key:"close",value:function(){window.Piwik_Popover.close()}},{key:"open",value:function(e){var t=decodeURIComponent(e);t=t.replace(/\$/g,"%"),t=decodeURIComponent(t);var n=t.split(":"),r=n[0];n.shift();var i=n.join(":");"undefined"===typeof window.broadcast.popoverHandlers[r]||window.broadcast.isLoginPage()||window.broadcast.popoverHandlers[r](i)}}]),e}();new at;function lt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ct(e,t,n,r,i,a){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])(["alert",lt({},"alert-".concat(e.severity),!0)])},[Object(o["renderSlot"])(e.$slots,"default")],2)}var st=Object(o["defineComponent"])({props:{severity:{type:String,required:!0}}});st.render=ct;var ut=st; -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function dt(){var e=o["createApp"].apply(void 0,arguments);return e.config.globalProperties.$sanitize=window.vueSanitize,e.config.globalProperties.translate=C,e.config.globalProperties.translateOrDefault=E,e} -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var mt={},pt=120,ft=50,ht=1e3;function gt(e){if(mt[e])return mt[e];if(window[e])return Promise.resolve(window[e]);var t,n,r,i="?module=Proxy&action=getPluginUmdJs&plugin=".concat(e),o=document.createElement("script");o.charset="utf-8",o.timeout=pt,o.src=i;var a=new Error,l=function(i){o.onerror=null,o.onload=null,clearTimeout(r);var l=0;function c(){if(l+=ft,t&&n)if(window[e]&&n)try{n(window[e])}finally{t=void 0,n=void 0}else if(l>ht)try{var r=i&&("load"===i.type?"missing":i.type),o=i&&i.target&&i.target.src;a.message="Loading plugin ".concat(e," on demand failed.\n(").concat(r,": ").concat(o,")"),a.name="PluginOnDemandLoadError",a.type=r,a.request=o,t(a)}finally{t=void 0,n=void 0}else setTimeout(c,ft)}setTimeout(c,ft)};return r=setTimeout((function(){l({type:"timeout",target:o})}),pt),o.onerror=l,o.onload=l,document.head.appendChild(o),new Promise((function(e,r){n=e,t=r}))} +function se(e,t){return fe(e)||pe(e,t)||de(e,t)||ue()}function ue(){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 de(e,t){if(e){if("string"===typeof e)return me(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)?me(e,t):void 0}}function me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pe(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done);i=!0)if(a.push(r.value),t&&a.length===t)break}catch(c){l=!0,o=c}finally{try{i||null==n["return"]||n["return"]()}finally{if(l)throw o}}return a}}function fe(e){if(Array.isArray(e))return e}function he(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function be(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ge(e,t,n){return t&&be(e.prototype,t),n&&be(e,n),e}function ve(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,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 vt(e,t){return Object(o["defineAsyncComponent"])((function(){return gt(e).then((function(e){return e||resolve(null),e[t]}))}))}function bt(e,t){return kt(e)||jt(e,t)||wt(e,t)||yt()}function yt(){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 wt(e,t){if(e){if("string"===typeof e)return Ot(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)?Ot(e,t):void 0}}function Ot(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jt(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0)if(o.push(r.value),t&&o.length===t)break}catch(c){l=!0,i=c}finally{try{a||null==n["return"]||n["return"]()}finally{if(l)throw i}}return o}}function kt(e){if(Array.isArray(e))return e}function St(e){return St="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},St(e)} + */var ye=window,Oe=ye.piwik,je=ye.broadcast;function we(e,t){try{return m.parse(e,t),!0}catch(n){return!1}}var ke=function(){function e(){var t=this;he(this,e),ve(this,"url",Object(K["ref"])(null)),ve(this,"urlQuery",Object(K["computed"])((function(){return t.url.value?t.url.value.search.replace(/^\?/,""):""}))),ve(this,"hashQuery",Object(K["computed"])((function(){return t.url.value?t.url.value.hash.replace(/^[#/?]+/,""):""}))),ve(this,"urlParsed",Object(K["computed"])((function(){return Object(K["readonly"])(t.parse(t.urlQuery.value))}))),ve(this,"hashParsed",Object(K["computed"])((function(){return Object(K["readonly"])(t.parse(t.hashQuery.value))}))),ve(this,"parsed",Object(K["computed"])((function(){return Object(K["readonly"])(Object.assign(Object.assign({},t.urlParsed.value),t.hashParsed.value))}))),this.url.value=new URL(window.location.href),window.addEventListener("hashchange",(function(e){t.url.value=new URL(e.newURL)})),this.updatePeriodParamsFromUrl()}return ge(e,[{key:"updateHashToUrl",value:function(e){var t="#".concat(e);window.location.hash===t?window.dispatchEvent(new HashChangeEvent("hashchange",{newURL:window.location.href,oldURL:window.location.href})):window.location.hash=t}},{key:"updateHash",value:function(e){var t=this.getFinalHashParams(e),n=this.stringify(t);this.updateHashToUrl("?".concat(n))}},{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=Object.keys(t).length?this.getFinalHashParams(t,e):{},o=this.stringify(r),a="?".concat(n);o.length&&(a="".concat(a,"#?").concat(o)),window.broadcast.propagateNewPage("",void 0,void 0,void 0,a)}},{key:"getFinalHashParams",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="string"!==typeof e?e:this.parse(e),r="string"!==typeof e?t:this.parse(t);return Object.assign({period:r.period||this.parsed.value.period,date:r.date||this.parsed.value.date,segment:r.segment||this.parsed.value.segment},n)}},{key:"updateLocation",value:function(e){ce.helper.isReportingPage()?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:"parse",value:function(e){return je.getValuesFromUrl("?".concat(e),!0)}},{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,",").replace(/\+/g,"%20")}},{key:"updatePeriodParamsFromUrl",value:function(){var e=this.getSearchParam("date"),t=this.getSearchParam("period");if(we(t,e)&&(Oe.period!==t||Oe.currentDateString!==e)){Oe.period=t;var n=m.parse(t,e).getDateRange();Oe.startDateString=p(n[0]),Oe.endDateString=p(n[1]),Oe.updateDateInTitle(e,t),"range"===Oe.period&&(e="".concat(Oe.startDateString,",").concat(Oe.endDateString)),Oe.currentDateString=e}}}]),e}(),Se=new ke,Ce=Se;function Ee(e){return Ee="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ee(e)}function De(e){return Ne(e)||Ve(e)||Te(e)||Pe()}function Pe(){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 Te(e,t){if(e){if("string"===typeof e)return Ie(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)?Ie(e,t):void 0}}function Ve(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Ne(e){if(Array.isArray(e))return Ie(e)}function Ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Be(e,t,n){return t&&xe(e.prototype,t),n&&xe(e,n),e}function Ae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Le(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Me(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&We(e,t)}function _e(e){var t=$e();return function(){var n,r=ze(e);if(t){var o=ze(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Fe(this,n)}}function Fe(e,t){if(t&&("object"===Ee(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Re(e)}function Re(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function He(e){var t="function"===typeof Map?new Map:void 0;return He=function(e){if(null===e||!qe(e))return e;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Ue(e,arguments,ze(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),We(n,e)},He(e)}function Ue(e,t,n){return Ue=$e()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=Function.bind.apply(e,r),a=new o;return n&&We(a,n.prototype),a},Ue.apply(null,arguments)}function $e(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function qe(e){return-1!==Function.toString.call(e).indexOf("[native code]")}function We(e,t){return We=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},We(e,t)}function ze(e){return ze=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ze(e)} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var Ct=0;function Et(e){return e.substring(0,1).toLowerCase()+e.substring(1).replace(/[A-Z]/g,(function(e){return"-".concat(e.toLowerCase())}))}function Dt(e){return e.substring(0,1).toLowerCase()+e.substring(1).replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()}))}function Pt(e){return"object"===St(e)&&null!==e&&Object.getPrototypeOf(e)===Object.prototype?Object.fromEntries(Object.entries(e).filter((function(e){return!/^\$/.test(e[0])}))):e}function Vt(e){var t=e.component,n=e.require,r=e.scope,i=void 0===r?{}:r,a=e.events,l=void 0===a?{}:a,c=e.$inject,s=e.directiveName,u=e.transclude,d=e.mountPointFactory,m=e.postCreate,p=e.noScope,f=e.restrict,h=void 0===f?"A":f,g=e.priority,v=e.replace,b=t;"string"===typeof b.plugin&&(t=vt(b.plugin,b.component));var y=Ct;u&&(Ct+=1);var w={},O={};function j(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];var c={restrict:h,require:n,priority:g,scope:p?void 0:O,compile:function(){return{post:function(e,n,a,c){var s=u?n.find("[ng-transclude][counter=".concat(y,"]")):null,p="<root-component";Object.entries(l).forEach((function(e){var t=bt(e,1),n=t[0];p+=" @".concat(Et(n),"=\"onEventHandler('").concat(n,"', $event)\"")})),Object.entries(i).forEach((function(e){var t=bt(e,2),n=t[1];if("&"===n.angularJsBind||"&?"===n.angularJsBind){var r=Et(n.vue);l[n.vue]||(p+=" @".concat(r,"=\"onEventHandler('").concat(n.vue,"', $event)\""))}else p+=" :".concat(Et(n.vue),'="').concat(n.vue,'"')})),p+=">",u&&(p+='<div ref="transcludeTarget"/>'),p+="</root-component>";var f=dt({template:p,data:function(){var t=this,o={};return Object.entries(i).forEach((function(i){var l=bt(i,2),s=l[0],u=l[1],d=Pt(e[s]);"undefined"===typeof d&&"undefined"!==typeof u.default&&(d=u.default instanceof Function?u.default.apply(u,[e,n,a].concat(r)):u.default),u.transform&&(d=u.transform.apply(u,[d,t,e,n,a,c].concat(r))),o[u.vue]=d})),o},setup:function(){if(u){var e=Object(o["ref"])(null);return{transcludeTarget:e}}},methods:{onEventHandler:function(t,i){var o=Dt(t);o=w[o]||o,e[o]&&e[o](i),l[t]&&l[t].apply(l,[i,this,e,n,a,c].concat(r))}}});f.component("root-component",t);var h=d?d.apply(void 0,[e,n,a].concat(r)):n[0],g=f.mount(h);Object.entries(i).forEach((function(t){var i=bt(t,2),o=i[0],l=i[1];l.angularJsBind&&"&"!==l.angularJsBind&&"&?"!==l.angularJsBind&&e.$watch(o,(function(t,i){if(t!==i||JSON.stringify(g[l.vue])!==JSON.stringify(t)){var o=Pt(t);"undefined"!==typeof l.default&&"undefined"===typeof t&&(o=l.default instanceof Function?l.default.apply(l,[e,n,a].concat(r)):l.default),l.transform&&(o=l.transform.apply(l,[o,g,e,n,a,c].concat(r))),g[l.vue]=o}}),l.deepWatch)})),u&&s&&$(g.transcludeTarget).append(s),m&&m.apply(void 0,[g,e,n,a,c].concat(r)),v&&(Array.from(n[0].attributes).forEach((function(e){i[e.nodeName]||h.firstElementChild&&h.firstElementChild.setAttribute(e.nodeName,e.nodeValue)})),n.replaceWith(window.$(h).children())),n.on("$destroy",(function(){f.unmount()}))}}}};return u&&(c.transclude=!0,c.template='<div ng-transclude counter="'.concat(y,'"/>')),c}return Object.entries(i).forEach((function(e){var t=bt(e,2),n=t[0],r=t[1];r.vue||(r.vue=n),r.angularJsBind&&(O[n]=r.angularJsBind),w[r.vue]=n})),j.$inject=c||[],window.angular.module("piwikApp").directive(s,j),j}function Nt(e){if("undefined"!==typeof e)return"true"===e||!!e&&e>0&&"0"!==e}function Tt(e){if("undefined"!==typeof e)return null===e?null:parseInt(e,10)}function At(e){return"undefined"===typeof e?e:JSON.parse(JSON.stringify(e))}function xt(e){var t=At(e);return S.helper.getAngularDependency("$rootScope").$applyAsync(),t} + */function Ge(e,t){if("abort"!==t)if("undefined"!==typeof Piwik_Popover){var n=$("#loadingError");Piwik_Popover.isOpen()&&e&&500===e.status?e&&500===e.status&&$(document.body).html(piwikHelper.escape(e.responseText)):n.show()}else console.log("Request failed: ".concat(e.responseText))}Oe.updatePeriodParamsFromUrl=Se.updatePeriodParamsFromUrl.bind(Se),window.globalAjaxQueue=[],window.globalAjaxQueue.active=0,window.globalAjaxQueue.clean=function(){for(var e=this.length;e>=0;e-=1)this[e]&&4!==this[e].readyState||this.splice(e,1)},window.globalAjaxQueue.push=function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.active+=n.length,this.clean(),(e=Array.prototype.push).call.apply(e,[this].concat(n))},window.globalAjaxQueue.abort=function(){this.forEach((function(e){return e&&e.abort&&e.abort()})),this.splice(0,this.length),this.active=0};var Ye=function(e){Me(n,e);var t=_e(n);function n(){return Le(this,n),t.apply(this,arguments)}return n}(He(Error)),Je=function(){function e(){Le(this,e),Ae(this,"format","json"),Ae(this,"timeout",null),Ae(this,"callback",null),Ae(this,"useRegularCallbackInCaseOfError",!1),Ae(this,"errorCallback",void 0),Ae(this,"withToken",!1),Ae(this,"completeCallback",void 0),Ae(this,"getParams",{}),Ae(this,"getUrl","?"),Ae(this,"postParams",{}),Ae(this,"loadingElement",null),Ae(this,"errorElement","#ajaxError"),Ae(this,"headers",void 0),Ae(this,"requestHandle",null),Ae(this,"abortController",null),Ae(this,"defaultParams",["idSite","period","date","segment"]),Ae(this,"resolveWithHelper",!1),this.errorCallback=Ge}return Be(e,[{key:"addParams",value:function(e,t){var n=this,r="string"===typeof e?window.broadcast.getValuesFromUrl(e):e,o=["compareSegments","comparePeriods","compareDates"];Object.keys(r).forEach((function(e){var a=r[e];(-1===o.indexOf(e)||a)&&("boolean"===typeof a&&(a=a?1:0),"get"===t.toLowerCase()?n.getParams[e]=a:"post"===t.toLowerCase()&&(n.postParams[e]=a))}))}},{key:"withTokenInUrl",value:function(){this.withToken=!0}},{key:"setUrl",value:function(e){this.addParams(broadcast.getValuesFromUrl(e),"GET")}},{key:"setBulkRequests",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map((function(e){return"string"===typeof e?e:$.param(e)}));this.addParams({module:"API",method:"API.getBulkRequest",urls:r,format:"json"},"post")}},{key:"setTimeout",value:function(e){this.timeout=e}},{key:"setCallback",value:function(e){this.callback=e}},{key:"useCallbackInCaseOfError",value:function(){this.useRegularCallbackInCaseOfError=!0}},{key:"redirectOnSuccess",value:function(e){this.setCallback((function(){piwikHelper.redirect(e)}))}},{key:"setErrorCallback",value:function(e){this.errorCallback=e}},{key:"setCompleteCallback",value:function(e){this.completeCallback=e}},{key:"setFormat",value:function(e){this.format=e}},{key:"setLoadingElement",value:function(e){this.loadingElement=e||"#ajaxLoadingDiv"}},{key:"setErrorElement",value:function(e){e&&(this.errorElement=e)}},{key:"useGETDefaultParameter",value:function(e){if(e&&this.defaultParams)for(var t=0;t<this.defaultParams.length;t+=1)if(this.defaultParams[t]===e)return!0;return!1}},{key:"removeDefaultParameter",value:function(e){if(e&&this.defaultParams)for(var t=0;t<this.defaultParams.length;t+=1)this.defaultParams[t]===e&&this.defaultParams.splice(t,1)}},{key:"send",value:function(){var e=this;$(this.errorElement).length&&$(this.errorElement).hide(),this.loadingElement&&$(this.loadingElement).fadeIn(),this.requestHandle=this.buildAjaxCall(),window.globalAjaxQueue.push(this.requestHandle),this.abortController&&this.abortController.signal.addEventListener("abort",(function(){e.requestHandle&&e.requestHandle.abort()}));var t=new Promise((function(t,n){e.requestHandle.then((function(n){e.resolveWithHelper?t(e):t(n)})).fail((function(t){if(429===t.status)return console.log("Warning: the '".concat($.param(e.getParams),"' request was rate limited!")),void n(t);"abort"!==t.statusText&&(console.log("Warning: the ".concat($.param(e.getParams)," request failed!")),n(t))}))}));return t}},{key:"abort",value:function(){this.requestHandle&&"function"===typeof this.requestHandle.abort&&(this.requestHandle.abort(),this.requestHandle=null)}},{key:"buildAjaxCall",value:function(){var e=this,t=this,n=this.mixinDefaultGetParams(this.getParams),r=this.getUrl;"?"!==r[r.length-1]&&(r+="&"),n.segment&&(r="".concat(r,"segment=").concat(n.segment,"&"),delete n.segment),n.date&&(r="".concat(r,"date=").concat(decodeURIComponent(n.date.toString()),"&"),delete n.date),r+=$.param(n);var o={type:"POST",async:!0,url:r,dataType:this.format||"json",complete:this.completeCallback,headers:this.headers?this.headers:void 0,error:function(){if(window.globalAjaxQueue.active-=1,t.errorCallback){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.errorCallback.apply(this,n)}},success:function(t,n,r){e.loadingElement&&$(e.loadingElement).hide();var o="API.getBulkRequest"===e.postParams.method&&Array.isArray(t)?t:[t],a=o.filter((function(e){return"error"===e.result})).map((function(e){return e.message})).filter((function(e){return e.length})).reduce((function(e,t){return e[t]=(e[t]||0)+1,e}),{});if(a&&Object.keys(a).length&&!e.useRegularCallbackInCaseOfError){var i="";Object.keys(a).forEach((function(e){i.length&&(i+="<br />"),a[e]>1?i+="".concat(e," (").concat(a[e],"x)"):i+=e}));var l=null,c="toast";$(e.errorElement).length&&i.length&&($(e.errorElement).show(),l=e.errorElement,c=null);var s=!document.querySelector("#login_form");if(i&&s){var u=window["require"]("piwik/UI"),d=new u.Notification;d.show(i,{placeat:l,context:"error",type:c,id:"ajaxHelper"}),d.scrollToNotification()}}else e.callback&&e.callback(t,n,r);window.globalAjaxQueue.active-=1,ce.ajaxRequestFinished&&ce.ajaxRequestFinished()},data:this.mixinDefaultPostParams(this.postParams),timeout:null!==this.timeout?this.timeout:void 0};return $.ajax(o)}},{key:"isRequestToApiMethod",value:function(){return this.getParams&&"API"===this.getParams.module&&this.getParams.method||this.postParams&&"API"===this.postParams.module&&this.postParams.method}},{key:"isWidgetizedRequest",value:function(){return"Widgetize"===broadcast.getValueFromUrl("module")}},{key:"getDefaultPostParams",value:function(){return this.withToken||this.isRequestToApiMethod()||ce.shouldPropagateTokenAuth?{token_auth:ce.token_auth,force_api_session:broadcast.isWidgetizeRequestWithoutSession()?0:1}:{}}},{key:"mixinDefaultPostParams",value:function(e){var t=this.getDefaultPostParams(),n=Object.assign(Object.assign({},t),e);return n}},{key:"mixinDefaultGetParams",value:function(e){var t=this,n=Ce.getSearchParam("segment"),r={idSite:ce.idSite?ce.idSite.toString():broadcast.getValueFromUrl("idSite"),period:ce.period||broadcast.getValueFromUrl("period"),segment:n},o=e;return o.token_auth&&(o.token_auth=null,delete o.token_auth),Object.keys(r).forEach((function(e){!t.useGETDefaultParameter(e)||null!==o[e]&&"undefined"!==typeof o[e]&&""!==o[e]||null!==t.postParams[e]&&"undefined"!==typeof t.postParams[e]&&""!==t.postParams[e]||!r[e]||(o[e]=r[e])})),!this.useGETDefaultParameter("date")||o.date||this.postParams.date||(o.date=ce.currentDateString),o}},{key:"getRequestHandle",value:function(){return this.requestHandle}}],[{key:"fetch",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new e;n.withTokenInUrl&&r.withTokenInUrl(),n.errorElement&&r.setErrorElement(n.errorElement),n.redirectOnSuccess&&r.redirectOnSuccess(!0!==n.redirectOnSuccess?n.redirectOnSuccess:void 0),r.setFormat(n.format||"json"),Array.isArray(t)?r.setBulkRequests.apply(r,De(t)):r.addParams(Object.assign(Object.assign({module:"API",format:n.format||"json"},t),{},{segment:t.segment?encodeURIComponent(t.segment):void 0}),"get"),n.postParams&&r.addParams(n.postParams,"post"),n.headers&&(r.headers=n.headers);var o=!0;return"undefined"===typeof n.createErrorNotification||n.createErrorNotification||(r.useCallbackInCaseOfError(),r.setErrorCallback(null),o=!1),n.abortController&&(r.abortController=n.abortController),n.returnResponseObject&&(r.resolveWithHelper=!0),r.send().then((function(t){var n=t instanceof e?t.requestHandle.responseJSON:t,o="API.getBulkRequest"===r.postParams.method&&Array.isArray(n)?n:[n],a=o.filter((function(e){return"error"===e.result})).map((function(e){return e.message}));if(a.length)throw new Ye(a.filter((function(e){return e.length})).join("\n"));return t})).catch((function(e){if(o)throw e;var t="Something went wrong";throw 504===e.status&&(t="Request was possibly aborted"),429===e.status&&(t="Rate Limit was exceed"),new Error(t)}))}},{key:"post",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.fetch(t,Object.assign(Object.assign({},r),{},{postParams:n}))}},{key:"oneAtATime",value:function(t,n){var r=null;return function(o,a){return r&&r.abort(),r=new AbortController,e.post(Object.assign(Object.assign({},o),{},{method:t}),a,Object.assign(Object.assign({},n),{},{abortController:r})).finally((function(){r=null}))}}}]),e}();function Ke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Xe(e,t,n){return t&&Qe(e.prototype,t),n&&Qe(e,n),e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */Vt({component:ut,scope:{severity:{vue:"severity",angularJsBind:"@piwikAlert"}},directiveName:"piwikAlert",transclude:!0}); + */window.ajaxHelper=Je;var Ze=window,et=Ze.$,tt=function(){function e(){Ke(this,e),this.setup()}return Xe(e,[{key:"setup",value:function(){var e=this;Object(K["watch"])((function(){return Ce.parsed.value.popover}),(function(){return e.onPopoverParamChanged()})),Ce.parsed.value.popover&&this.onPopoverParamChangedInitial()}},{key:"onPopoverParamChangedInitial",value:function(){var e=this;et((function(){setTimeout((function(){e.openOrClose()}))}))}},{key:"onPopoverParamChanged",value:function(){var e=this;et((function(){e.openOrClose()}))}},{key:"openOrClose",value:function(){this.close();var e=Ce.parsed.value.popover;e?this.open(e):window.broadcast.resetPopoverStack()}},{key:"close",value:function(){window.Piwik_Popover.close()}},{key:"open",value:function(e){var t=decodeURIComponent(e);t=t.replace(/\$/g,"%"),t=decodeURIComponent(t);var n=t.split(":"),r=n[0];n.shift();var o=n.join(":");"undefined"===typeof window.broadcast.popoverHandlers[r]||window.broadcast.isLoginPage()||window.broadcast.popoverHandlers[r](o)}}]),e}();new tt;function nt(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 rt(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 ot(e){var t=new Date;t.setTime(t.getTime()+-864e5),document.cookie="".concat(e,"=; expires=").concat(t.toUTCString(),"; path=/")} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var It={mounted:function(e,t){var n={};$(e).addClass("matomo-dropdown-menu");var r,i=!!$(e).parent().closest(".dropdown-content").length;i&&(n={hover:!0},$(e).addClass("submenu"),$((null===(r=t.value)||void 0===r?void 0:r.activates)||$(e).data("target")).addClass("submenu-dropdown-content"),$(e).parents(".dropdown-content").addClass("submenu-container"));$(e).dropdown(n)},updated:function(e){Object(o["nextTick"])((function(){$(e).addClass("matomo-dropdown-menu")}))}}; + */var at=window,it=at.$;function lt(){var e=!!parseInt(rt("zenMode"),10),t=it(".top_controls .icon-arrowup");function n(){e?(it("body").addClass("zenMode"),t.addClass("icon-arrowdown").removeClass("icon-arrowup"),t.prop("title",a("CoreHome_ExitZenMode"))):(it("body").removeClass("zenMode"),t.removeClass("icon-arrowdown").addClass("icon-arrowup"),t.prop("title",a("CoreHome_EnterZenMode")))}ce.helper.registerShortcut("z",a("CoreHome_ShortcutZenMode"),(function(t){t.altKey||(e=!e,nt("zenMode",e?"1":"0"),n())})),t.click((function(){window.Mousetrap.trigger("z")})),n()} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function Bt(e){return{restrict:"A",link:function(t,n,r){var i={instance:null,value:{activates:$("#".concat(r.activates))[0]},oldValue:null,modifiers:{},dir:{}};e((function(){It.mounted(n[0],i)}))}}} +function ct(){var e=K["createApp"].apply(void 0,arguments);return e.config.globalProperties.$sanitize=window.vueSanitize,e.config.globalProperties.translate=a,e.config.globalProperties.translateOrDefault=i,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 Mt(e,t,n){var r=t.value.isMouseDown&&t.value.hasScrolled;t.value.isMouseDown=!1,t.value.hasScrolled=!1,r||e.contains(n.target)||t.value&&t.value.blur()}function Lt(e,t){t.value.hasScrolled=!0}function Ft(e,t){t.value.isMouseDown=!0,t.value.hasScrolled=!1}function Rt(e,t,n){27===n.which&&setTimeout((function(){t.value.isMouseDown=!1,t.value.hasScrolled=!1,t.value.blur&&t.value.blur()}),0)}Bt.$inject=["$timeout"],window.angular.module("piwikApp").directive("piwikDropdownMenu",Bt);var _t=document.documentElement,$t={mounted:function(e,t){t.value.isMouseDown=!1,t.value.hasScrolled=!1,t.value.onEscapeHandler=Rt.bind(null,e,t),t.value.onMouseDown=Ft.bind(null,e,t),t.value.onClickOutsideElement=Mt.bind(null,e,t),t.value.onScroll=Lt.bind(null,e,t),_t.addEventListener("keyup",t.value.onEscapeHandler),_t.addEventListener("mousedown",t.value.onMouseDown),_t.addEventListener("mouseup",t.value.onClickOutsideElement),_t.addEventListener("scroll",t.value.onScroll)},unmounted:function(e,t){_t.removeEventListener("keyup",t.value.onEscapeHandler),_t.removeEventListener("mousedown",t.value.onMouseDown),_t.removeEventListener("mouseup",t.value.onClickOutsideElement),_t.removeEventListener("scroll",t.value.onScroll)}}; + */ce.on("Matomo.topControlsRendered",(function(){lt()}));var st={},ut=120,dt=50,mt=1e3;function pt(e){if(st[e])return st[e];if(window[e])return Promise.resolve(window[e]);var t,n,r,o="?module=Proxy&action=getPluginUmdJs&plugin=".concat(e),a=document.createElement("script");a.charset="utf-8",a.timeout=ut,a.src=o;var i=new Error,l=function(o){a.onerror=null,a.onload=null,clearTimeout(r);var l=0;function c(){if(l+=dt,t&&n)if(window[e]&&n)try{n(window[e])}finally{t=void 0,n=void 0}else if(l>mt)try{var r=o&&("load"===o.type?"missing":o.type),a=o&&o.target&&o.target.src;i.message="Loading plugin ".concat(e," on demand failed.\n(").concat(r,": ").concat(a,")"),i.name="PluginOnDemandLoadError",i.type=r,i.request=a,t(i)}finally{t=void 0,n=void 0}else setTimeout(c,dt)}setTimeout(c,dt)};return r=setTimeout((function(){l({type:"timeout",target:a})}),ut),a.onerror=l,a.onload=l,document.head.appendChild(a),new Promise((function(e,r){n=e,t=r}))} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -function Ht(){return{restrict:"A",link:function(e,t,n){var r={instance:null,value:{blur:function(){setTimeout((function(){e.$apply(n.piwikFocusAnywhereButHere)}),0)}},oldValue:null,modifiers:{},dir:{}};$t.mounted(t[0],r),t.on("$destroy",(function(){return $t.unmounted(t[0],r)}))}}} + */function ft(e,t){return Object(K["defineAsyncComponent"])((function(){return pt(e).then((function(e){return e||resolve(null),e[t]}))}))} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -function Ut(e,t){t.arg&&setTimeout((function(){e.focus(),t.value.afterFocus&&t.value.afterFocus()}),5)}window.angular.module("piwikApp.directive").directive("piwikFocusAnywhereButHere",Ht);var qt={mounted:function(e,t){Ut(e,t)},updated:function(e,t){Ut(e,t)}}; + */function ht(e,t){var n;return e instanceof HTMLElement?e:null===(n=t.instance)||void 0===n?void 0:n.$refs[e]}var bt={getRef:ht},gt=300;function vt(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gt;return function(){for(var r=this,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];t&&clearTimeout(t),t=setTimeout((function(){e.call.apply(e,[r].concat(a))}),n)}} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Wt(){return{restrict:"A",link:function(e,t,n){e.$watch(n.piwikFocusIf,(function(n){var r={instance:null,arg:n?"1":void 0,value:{afterFocus:function(){return e.$apply()}},oldValue:null,modifiers:{},dir:{}};qt.updated(t[0],r)}))}}} + */function yt(e,t){var n,r=parseInt(t,10),o=parseInt(e,10)-r;return n=0===o||Number.isNaN(o)?0:0===r||Number.isNaN(r)?100:o/r*100,n}function Ot(e){return"".concat(e>0?ce.numbers.symbolPlus:"").concat(Math.round(e),"}%")}function jt(e,t){var n=yt(e,t);return Ot(n)} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -function Jt(e,t){var n;return e instanceof HTMLElement?e:null===(n=t.instance)||void 0===n?void 0:n.$refs[e]}window.angular.module("piwikApp.directive").directive("piwikFocusIf",Wt);var Gt={getRef:Jt}; -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function zt(e){e.classList.toggle("expanded");var t=e.querySelector(".dropdown.positionInViewport");t&&S.helper.setMarginLeftToBeInViewport(t)}function Yt(e,t,n){var r,i=t.value.isMouseDown&&t.value.hasScrolled;(t.value.isMouseDown=!1,t.value.hasScrolled=!1,i)||(e.contains(n.target)||(e.classList.remove("expanded"),null!==(r=t.value)&&void 0!==r&&r.onClosed&&t.value.onClosed()))}function Qt(e){e.value.hasScrolled=!0}function Kt(e){e.value.isMouseDown=!0,e.value.hasScrolled=!1}function Xt(e,t,n){27===n.which&&(t.value.isMouseDown=!1,t.value.hasScrolled=!1,e.classList.remove("expanded"))}var Zt=document.documentElement,en=window,tn=en.$,nn={mounted:function(e,t){t.value.isMouseDown=!1,t.value.hasScrolled=!1,t.value.onExpand=zt.bind(null,e),t.value.onEscapeHandler=Xt.bind(null,e,t),t.value.onMouseDown=Kt.bind(null,t),t.value.onClickOutsideElement=Yt.bind(null,e,t),t.value.onScroll=Qt.bind(null,t),setTimeout((function(){var e=Gt.getRef(t.value.expander,t);e&&tn(e).on("click",t.value.onExpand)})),Zt.addEventListener("keyup",t.value.onEscapeHandler),Zt.addEventListener("mousedown",t.value.onMouseDown),Zt.addEventListener("mouseup",t.value.onClickOutsideElement),Zt.addEventListener("scroll",t.value.onScroll)},unmounted:function(e,t){var n=Gt.getRef(t.value.expander,t);n&&tn(n).off("click",t.value.onExpand),Zt.removeEventListener("keyup",t.value.onEscapeHandler),Zt.removeEventListener("mousedown",t.value.onMouseDown),Zt.removeEventListener("mouseup",t.value.onClickOutsideElement),Zt.removeEventListener("scroll",t.value.onScroll)}}; + */function wt(e){return"undefined"===typeof e?e:JSON.parse(JSON.stringify(e))}var kt={ref:"root"};function St(e,t,n,r,o,a){return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",kt,[e.componentWrapper?(Object(K["openBlock"])(),Object(K["createBlock"])(Object(K["resolveDynamicComponent"])(e.componentWrapper),{key:0})):Object(K["createCommentVNode"])("",!0)],512)}var Ct=Object(K["defineComponent"])({props:{html:String},mounted:function(){ce.helper.compileVueEntryComponents(this.$refs.root)},beforeUnmount:function(){ce.helper.destroyVueComponent(this.$refs.root)},computed:{componentWrapper:function(){return this.html?Object(K["markRaw"])({template:this.html}):null}}});Ct.render=St;var Et=Ct,Dt={class:"loadingPiwik"},Pt=Object(K["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:""},null,-1);function Tt(e,t,n,r,o,a){return Object(K["withDirectives"])((Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Dt,[Pt,Object(K["createElementVNode"])("span",null,Object(K["toDisplayString"])(e.loadingMessage),1)],512)),[[K["vShow"],e.loading]])}var Vt=Object(K["defineComponent"])({props:{loading:{type:Boolean,required:!0,default:!1},loadingMessage:{type:String,required:!1,default:a("General_LoadingData")}}});Vt.render=Tt;var Nt=Vt;function It(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xt(e,t,n,r,o,a){return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",{class:Object(K["normalizeClass"])(["alert",It({},"alert-".concat(e.severity),!0)])},[Object(K["renderSlot"])(e.$slots,"default")],2)}var Bt=Object(K["defineComponent"])({props:{severity:{type:String,required:!0}}});Bt.render=xt;var At=Bt,Lt={mounted:function(e,t){var n={};$(e).addClass("matomo-dropdown-menu");var r,o=!!$(e).parent().closest(".dropdown-content").length;o&&(n={hover:!0},$(e).addClass("submenu"),$((null===(r=t.value)||void 0===r?void 0:r.activates)||$(e).data("target")).addClass("submenu-dropdown-content"),$(e).parents(".dropdown-content").addClass("submenu-container"));$(e).dropdown(n)},updated:function(e){Object(K["nextTick"])((function(){$(e).addClass("matomo-dropdown-menu")}))}}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function rn(){return{restrict:"A",link:function(e,t){var n={instance:null,value:{expander:t.find(".title").first()[0]},oldValue:null,modifiers:{},dir:{}};nn.mounted(t[0],n),t.on("$destroy",(function(){return nn.unmounted(t[0],n)}))}}} -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -function on(e){e.classList.add("expanded");var t=e.querySelector(".dropdown.positionInViewport");t&&S.helper.setMarginLeftToBeInViewport(t)}function an(e){e.classList.remove("expanded")}function ln(e,t){e.contains(t.target)||e.classList.remove("expanded")}function cn(e,t){27===t.which&&e.classList.remove("expanded")}window.angular.module("piwikApp").directive("piwikExpandOnClick",rn);var sn=document.documentElement,un={mounted:function(e,t){t.value.onMouseEnter=on.bind(null,e),t.value.onMouseLeave=an.bind(null,e),t.value.onClickOutsideElement=ln.bind(null,e),t.value.onEscapeHandler=cn.bind(null,e),setTimeout((function(){var e=Gt.getRef(t.value.expander,t);e&&e.addEventListener("mouseenter",t.value.onMouseEnter)})),e.addEventListener("mouseleave",t.value.onMouseLeave),sn.addEventListener("keyup",t.value.onEscapeHandler),sn.addEventListener("mouseup",t.value.onClickOutsideElement)},unmounted:function(e,t){var n=Gt.getRef(t.value.expander,t);n&&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 dn(){return{restrict:"A",link:function(e,t){var n={instance:null,value:{expander:t.find(".title").first()[0]},oldValue:null,modifiers:{},dir:{}};un.mounted(t[0],n),t.on("$destroy",(function(){return un.unmounted(t[0],n)}))}}}window.angular.module("piwikApp").directive("piwikExpandOnHover",dn); -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -var mn=window,pn=mn.$,fn={mounted:function(e,t){var n=pn(e),r=t.value.sensitiveData,i=t.value.showCharacters||6,o=t.value.clickElementSelector||n,a="";function l(){n.html(r),pn(o).css({cursor:""}),pn(o).tooltip("destroy")}i>0&&(a+=r.slice(0,i)),a+=r.slice(i).replace(/./g,"*"),n.html(a),pn(o).tooltip({content:C("CoreHome_ClickToSeeFullInformation"),items:"*",track:!0}),pn(o).one("click",l),pn(o).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 hn(){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:{}};fn.mounted(t[0],r)}}}window.angular.module("piwikApp").directive("piwikShowSensitiveData",hn); -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -var gn=window,vn=gn.$,bn={mounted:function(e){var t=vn(e);!t.attr("data-target")&&t.attr("data-activates")&&t.attr("data-target",t.attr("data-activates"));var n=t.attr("data-target");n&&vn("#".concat(n)).length&&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 yn(){return{restrict:"C",link:function(e,t){bn.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 wn(e,t){e.value.focusedElement!==t.target&&(e.value.focusedElement=t.target,window.angular.element(t.target).select())}function On(e){var t=document.createRange();t.selectNode(e.target);var n=window.getSelection();n&&n.rangeCount>0&&n.removeAllRanges(),n&&n.addRange(t)}function jn(e){delete e.value.focusedElement}window.angular.module("piwikApp").directive("dropdownButton",yn);var kn={mounted:function(e,t){var n=e.tagName.toLowerCase();t.value.elementSupportsSelect="textarea"===n,t.value.elementSupportsSelect?(t.value.onFocusHandler=wn.bind(null,t),t.value.onBlurHandler=jn.bind(null,t),e.addEventListener("focus",t.value.onFocusHandler),e.addEventListener("blur",t.value.onBlurHandler)):(t.value.onClickHandler=On,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 Sn(){return{restrict:"A",link:function(e,t){var n={instance:null,value:{},oldValue:null,modifiers:{},dir:{}};kn.mounted(t[0],n),t.on("$destroy",(function(){return kn.unmounted(t[0],n)}))}}}window.angular.module("piwikApp").directive("piwikSelectOnFocus",Sn); -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -var Cn=!1,En={mounted:function(e,t){t.value.activator&&setTimeout((function(){if(!Cn){Cn=!0;var n=Gt.getRef(t.value.activator,t);if(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 Dn(e){return{restrict:"A",priority:10,link:function(t,n,r){var i={instance:null,value:{activator:$(r.piwikSideNav)[0]},oldValue:null,modifiers:{},dir:{}};e((function(){En.mounted(n[0],i)}))}}}Dn.$inject=["$timeout"],window.angular.module("piwikApp.directive").directive("piwikSideNav",Dn);var Pn={ref:"root"};function Vn(e,t,n,r,i,a){return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Pn,[Object(o["renderSlot"])(e.$slots,"default")],512)),[[o["vShow"],e.modelValue]])}var Nn=Object(o["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")}}});Nn.render=Vn;var Tn=Nn,An=(Vt({component:Tn,scope:{show:{vue:"modelValue",default:!1},element:{default:function(e,t){return t[0]}}},events:{yes:function(e,t,n,r,i){i.yes&&(n.$eval(i.yes),setTimeout((function(){n.$apply()}),0))},no:function(e,t,n,r,i){i.no&&(n.$eval(i.no),setTimeout((function(){n.$apply()}),0))},validation:function(e,t,n,r,i){i.no&&(n.$eval(i.no),setTimeout((function(){n.$apply()}),0))},close:function(e,t,n,r,i){i.close&&(n.$eval(i.close),setTimeout((function(){n.$apply()}),0))},"update:modelValue":function(e,t,n,r,i,o,a){setTimeout((function(){n.$apply(a(i.piwikDialog).assign(n,e))}),0)}},$inject:["$parse"],directiveName:"piwikDialog",transclude:!0,mountPointFactory:function(e,t){var n=$('<div class="vue-placeholder"/>');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}),{key:0,class:"title",tabindex:"6"}),xn=["href","title"],In={class:"iconsBar"},Bn=["href","title"],Mn=Object(o["createElementVNode"])("span",{class:"icon-help"},null,-1),Ln=[Mn],Fn=["title"],Rn=Object(o["createElementVNode"])("span",{class:"icon-info"},null,-1),_n=[Rn],$n={class:"ratingIcons"},Hn={class:"inlineHelp"},Un=["innerHTML"],qn=["innerHTML"],Wn=["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 Jn(e,t,n,r,i,a){var l=Object(o["resolveComponent"])("RateFeature");return Object(o["openBlock"])(),Object(o["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(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",An,[Object(o["renderSlot"])(e.$slots,"default")])),e.editUrl?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:1,class:"title",href:e.editUrl,title:e.translate("CoreHome_ClickToEditX",e.htmlEntities(e.actualFeatureName))},[Object(o["renderSlot"])(e.$slots,"default")],8,xn)):Object(o["createCommentVNode"])("",!0),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",In,[e.helpUrl&&!e.actualInlineHelp?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:0,rel:"noreferrer noopener",target:"_blank",class:"helpIcon",href:e.helpUrl,title:e.translate("CoreHome_ExternalHelp")},Ln,8,Bn)):Object(o["createCommentVNode"])("",!0),e.actualInlineHelp?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:1,onClick:t[0]||(t[0]=function(t){return e.showInlineHelp=!e.showInlineHelp}),class:Object(o["normalizeClass"])(["helpIcon",{active:e.showInlineHelp}]),title:e.translate(e.reportGenerated?"General_HelpReport":"General_Help")},_n,10,Fn)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",$n,[Object(o["createVNode"])(l,{title:e.actualFeatureName},null,8,["title"])])],512),[[o["vShow"],e.showIcons||e.showInlineHelp]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",Hn,[Object(o["createElementVNode"])("div",{innerHTML:e.$sanitize(e.actualInlineHelp)},null,8,Un),""!=e.reportGenerated?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:"helpDate",innerHTML:e.$sanitize(e.reportGenerated)},null,8,qn)):Object(o["createCommentVNode"])("",!0),e.helpUrl?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:1,rel:"noreferrer noopener",target:"_blank",class:"readMore",href:e.helpUrl},Object(o["toDisplayString"])(e.translate("General_MoreDetails")),9,Wn)):Object(o["createCommentVNode"])("",!0)],512),[[o["vShow"],e.showInlineHelp]])],544)}var Gn=vt("Feedback","RateFeature"),zn=Object(o["defineComponent"])({props:{helpUrl:{type:String,default:""},editUrl:{type:String,default:""},reportGenerated:String,featureName:String,inlineHelp:String},components:{RateFeature:Gn},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 i,o=null===(i=r.getAttribute("data-content"))||void 0===i?void 0:i.trim();o&&o.length&&(e.actualInlineHelp="<p>".concat(o,"</p>"),setTimeout((function(){return r.remove()}),0))}}var a;e.actualFeatureName||(e.actualFeatureName=null===(a=t.querySelector(".title"))||void 0===a?void 0:a.textContent);if(S.period&&S.currentDateString){var l=m.parse(S.period,S.currentDateString);e.reportGenerated&&l.containsToday()&&window.$(t.querySelector(".report-generated")).tooltip({track:!0,content:e.reportGenerated,items:"div",show:!1,hide:!1})}}))},methods:{htmlEntities:function(e){return S.helper.htmlEntities(e)}}});zn.render=Jn;var Yn=zn,Qn=(Vt({component:Yn,scope:{helpUrl:{angularJsBind:"@"},editUrl:{angularJsBind:"@"},reportGenerated:{angularJsBind:"@?"},featureName:{angularJsBind:"@"},inlineHelp:{angularJsBind:"@?"}},directiveName:"piwikEnrichedHeadline",transclude:!0}),{class:"card",ref:"root"}),Kn={class:"card-content"},Xn={key:0,class:"card-title"},Zn={key:1,class:"card-title"},er={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 tr(e,t,n,r,i,a){var l=Object(o["resolveComponent"])("EnrichedHeadline");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Qn,[Object(o["createElementVNode"])("div",Kn,[!e.contentTitle||e.actualFeature||e.helpUrl||e.actualHelpText?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("h2",Xn,Object(o["toDisplayString"])(e.decode(e.contentTitle)),1)),e.contentTitle&&(e.actualFeature||e.helpUrl||e.actualHelpText)?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h2",Zn,[Object(o["createVNode"])(l,{"feature-name":e.actualFeature,"help-url":e.helpUrl,"inline-help":e.actualHelpText},{default:Object(o["withCtx"])((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.decode(e.contentTitle)),1)]})),_:1},8,["feature-name","help-url","inline-help"])])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",er,[Object(o["renderSlot"])(e.$slots,"default")],512)])],512)}var nr=null,rr=window,ir=rr.$,or=Object(o["defineComponent"])({props:{contentTitle:String,feature:String,helpUrl:String,helpText:String,anchor:String},components:{EnrichedHeadline:Yn},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=this,t=this.$refs.root,n=this.$refs.content;if(this.anchor&&t&&t.parentElement){var r=document.createElement("a");r.id=this.anchor,ir(t.parentElement).prepend(r)}setTimeout((function(){var t=n.querySelector(".contentHelp");t&&(e.actualHelpText=t.innerHTML,t.remove())}),0),this.actualFeature&&"true"===this.actualFeature&&(this.actualFeature=this.contentTitle),null===nr&&(nr=document.querySelector("#content.admin"));var i=null;if(nr&&(i=nr.offsetTop),i||0===i){var o=t.closest(".widgetLoader"),a=o?o.offsetTop:t.offsetTop;a-i<17&&(t.style.marginTop="0")}},methods:{decode:function(e){return S.helper.htmlDecode(e)}}});or.render=tr;var ar=or; -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */Vt({component:ar,scope:{contentTitle:{angularJsBind:"@"},feature:{angularJsBind:"@"},helpUrl:{angularJsBind:"@"},helpText:{angularJsBind:"@"},anchor:{angularJsBind:"@?"}},directiveName:"piwikContentBlock",transclude:!0});function lr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function sr(e,t,n){return t&&cr(e.prototype,t),n&&cr(e,n),e}function ur(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var dr=function(){function e(){var t=this;lr(this,e),ur(this,"segmentState",Object(o["reactive"])({availableSegments:[]})),S.on("piwikSegmentationInited",(function(){return t.setSegmentState()}))}return sr(e,[{key:"state",get:function(){return Object(o["readonly"])(this.segmentState)}},{key:"setSegmentState",value:function(){try{var e=$(".segmentEditorPanel").data("uiControlObject");this.segmentState.availableSegments=e.impl.availableSegments||[]}catch(t){}}}]),e}(),mr=new dr;function pr(e){return vr(e)||gr(e)||hr(e)||fr()}function fr(){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 hr(e,t){if(e){if("string"===typeof e)return br(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)?br(e,t):void 0}}function gr(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function vr(e){if(Array.isArray(e))return br(e)}function br(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function yr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Or(e,t,n){return t&&wr(e.prototype,t),n&&wr(e,n),e}function jr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var kr=8,Sr=3;function Cr(e){return e?Array.isArray(e)?e:[e]:[]}var Er=function(){function e(){var t=this;yr(this,e),jr(this,"privateState",Object(o["reactive"])({comparisonsDisabledFor:[]})),jr(this,"state",Object(o["readonly"])(this.privateState)),jr(this,"colors",{}),jr(this,"segmentComparisons",Object(o["computed"])((function(){return t.parseSegmentComparisons()}))),jr(this,"periodComparisons",Object(o["computed"])((function(){return t.parsePeriodComparisons()}))),jr(this,"isEnabled",Object(o["computed"])((function(){return t.checkEnabledForCurrentPage()}))),this.loadComparisonsDisabledFor(),$((function(){t.colors=t.getAllSeriesColors()})),Object(o["watch"])((function(){return t.getComparisons()}),(function(){return S.postEvent("piwikComparisonsChanged")}),{deep:!0})}return Or(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)%kr;if(0===n)return this.colors["series".concat(r)];var i=n%Sr;return this.colors["series".concat(r,"-shade").concat(i)]}},{key:"getSeriesColorName",value:function(e,t){var n="series".concat(e%kr);return t>0&&(n+="-shade".concat(t%Sr)),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(i){t.push({index:n,params:Object.assign(Object.assign({},i.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=pr(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={},i={},o=!1,a=!1;e.forEach((function(e){o?r[e.params.segment]=!0:o=!0})),t.forEach((function(e){a?i["".concat(e.params.period,"|").concat(e.params.date)]=!0:a=!0}));var l=[],c=[];Object.keys(i).forEach((function(e){var t=e.split("|");l.push(t[0]),c.push(t[1])}));var s={compareSegments:Object.keys(r),comparePeriods:l,compareDates:c},u=S.helper.isAngularRenderingThePage()?Ee.hashParsed.value:Ee.urlParsed.value;Ee.updateLocation(Object.assign(Object.assign(Object.assign({},u),s),n))}},{key:"getAllSeriesColors",value:function(){var e=S.ColorManager;if(!e)return[];for(var t=[],n=0;n<kr;n+=1){t.push("series".concat(n));for(var r=0;r<Sr;r+=1)t.push("series".concat(n,"-shade").concat(r))}return e.getColors("comparison-series-color",t)}},{key:"loadComparisonsDisabledFor",value:function(){var e=this,t=Ee.parsed.value.module;window.piwik.installation||"CoreUpdater"===t||"Installation"===t||"Overlay"===t||window.piwik.isPagesComparisonApiDisabled?this.privateState.comparisonsDisabledFor=[]:Ze.fetch({module:"API",method:"API.getPagesComparisonsDisabledFor"}).then((function(t){e.privateState.comparisonsDisabledFor=t}))}},{key:"parseSegmentComparisons",value:function(){var e=mr.state.availableSegments,t=pr(Cr(Ee.parsed.value.compareSegments));t.unshift(Ee.parsed.value.segment||"");var n=[];return t.forEach((function(t,r){var i;e.forEach((function(e){e.definition!==t&&e.definition!==decodeURIComponent(t)&&decodeURIComponent(e.definition)!==t||(i=e)}));var o=i?i.name:C("General_Unknown");""===t.trim()&&(o=C("SegmentEditor_DefaultAllVisits")),n.push({params:{segment:t},title:S.helper.htmlDecode(o),index:r})})),n}},{key:"parsePeriodComparisons",value:function(){var e=pr(Cr(Ee.parsed.value.comparePeriods)),t=pr(Cr(Ee.parsed.value.compareDates));e.unshift(Ee.parsed.value.period),t.unshift(Ee.parsed.value.date);for(var n=[],r=0;r<Math.min(t.length,e.length);r+=1){var i=void 0;try{i=m.parse(e[r],t[r]).getPrettyString()}catch(o){i=C("General_Error")}n.push({params:{date:t[r],period:e[r]},title:i,index:r})}return n}},{key:"checkEnabledForCurrentPage",value:function(){var e=Ee.parsed.value.category||Ee.parsed.value.module,t=Ee.parsed.value.subcategory||Ee.parsed.value.action,n="".concat(e,".").concat(t),r=-1===this.privateState.comparisonsDisabledFor.indexOf(n)&&-1===this.privateState.comparisonsDisabledFor.indexOf("".concat(e,".*"));return document.documentElement.classList.toggle("comparisonsDisabled",!r),r}}]),e}(),Dr=new Er,Pr={key:0,ref:"root",class:"matomo-comparisons"},Vr={class:"comparison-type"},Nr=["title"],Tr=["href"],Ar=["title"],xr={class:"comparison-period-label"},Ir=["onClick"],Br=["title"],Mr={class:"loadingPiwik",style:{display:"none"}},Lr=["alt"];function Fr(e,t,n,r,i,a){var l=Object(o["resolveDirective"])("tooltips");return e.isComparing?Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Pr,[Object(o["createElementVNode"])("h3",null,Object(o["toDisplayString"])(e.translate("General_Comparisons")),1),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.segmentComparisons,(function(t,n){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:"comparison card",key:t.index},[Object(o["createElementVNode"])("div",Vr,Object(o["toDisplayString"])(e.translate("General_Segment")),1),Object(o["createElementVNode"])("div",{class:"title",title:t.title+"<br/>"+decodeURIComponent(t.params.segment)},[Object(o["createElementVNode"])("a",{target:"_blank",href:e.getUrlToSegment(t.params.segment)},Object(o["toDisplayString"])(t.title),9,Tr)],8,Nr),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.periodComparisons,(function(n){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:"comparison-period",key:n.index,title:e.getComparisonTooltip(t,n)},[Object(o["createElementVNode"])("span",{class:"comparison-dot",style:Object(o["normalizeStyle"])({"background-color":e.getSeriesColor(t,n)})},null,4),Object(o["createElementVNode"])("span",xr,Object(o["toDisplayString"])(n.title)+" ("+Object(o["toDisplayString"])(e.getComparisonPeriodType(n))+") ",1)],8,Ar)})),128)),e.segmentComparisons.length>1?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:0,class:"remove-button",onClick:function(t){return e.removeSegmentComparison(n)}},[Object(o["createElementVNode"])("span",{class:"icon icon-close",title:e.translate("General_ClickToRemoveComp")},null,8,Br)],8,Ir)):Object(o["createCommentVNode"])("",!0)])})),128)),Object(o["createElementVNode"])("div",Mr,[Object(o["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:e.translate("General_LoadingData")},null,8,Lr),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_LoadingData")),1)])],512)),[[l,{duration:200,delay:200,content:e.transformTooltipContent}]]):Object(o["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 - */var Rr=window,_r=Rr.$;function $r(){var e=_r(this).attr("title")||"";return window.vueSanitize(e.replace(/\n/g,"<br />"))}function Hr(e,t){var n,r,i,o,a,l;_r(e).tooltip({track:!0,content:(null===(n=t.value)||void 0===n?void 0:n.content)||$r,show:"undefined"!==typeof(null===(r=t.value)||void 0===r?void 0:r.show)?null===(i=t.value)||void 0===i?void 0:i.show:{delay:(null===(o=t.value)||void 0===o?void 0:o.delay)||700,duration:(null===(a=t.value)||void 0===a?void 0:a.duration)||200},hide:!1,tooltipClass:null===(l=t.value)||void 0===l?void 0:l.tooltipClass})}var Ur={mounted:function(e,t){setTimeout((function(){return Hr(e,t)}))},updated:function(e,t){setTimeout((function(){return Hr(e,t)}))},beforeUnmount:function(e){try{window.$(e).tooltip("destroy")}catch(t){}}},qr=Object(o["defineComponent"])({props:{},directives:{Tooltips:Ur},data:function(){return{comparisonTooltips:null}},setup:function(){var e=Object(o["computed"])((function(){return Dr.isComparing()})),t=Object(o["computed"])((function(){return Dr.getSegmentComparisons()})),n=Object(o["computed"])((function(){return Dr.getPeriodComparisons()})),r=Dr.getSeriesColor.bind(Dr);function i(){var e=window.$(this).attr("title");return e?window.vueSanitize(e.replace(/\n/g,"<br />")):e}return{isComparing:e,segmentComparisons:t,periodComparisons:n,getSeriesColor:r,transformTooltipContent:i}},methods:{comparisonHasSegment:function(e){return"undefined"!==typeof e.params.segment},removeSegmentComparison:function(e){window.$(this.$refs.root).tooltip("destroy"),Dr.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=Object.assign({},Ee.hashParsed.value);return delete t.comparePeriods,delete t.compareDates,delete t.compareSegments,t.segment=e,"".concat(window.location.search,"#?").concat(Ee.stringify(t))},onComparisonsChanged:function(){var e=this;if(this.comparisonTooltips=null,Dr.isComparing()){var t=Dr.getPeriodComparisons(),n=Dr.getSegmentComparisons();Ze.fetch({method:"API.getProcessedReport",apiModule:"VisitsSummary",apiAction:"get",compare:"1",compareSegments:Ee.getSearchParam("compareSegments"),comparePeriods:Ee.getSearchParam("comparePeriods"),compareDates:Ee.getSearchParam("compareDates"),format_metrics:"1"}).then((function(r){e.comparisonTooltips={},t.forEach((function(t){e.comparisonTooltips[t.index]={},n.forEach((function(n){var i=e.generateComparisonTooltip(r,t,n);e.comparisonTooltips[t.index][n.index]=i}))}))}))}},generateComparisonTooltip:function(e,t,n){if(!e.reportData.comparisons)return"";var r=Dr.getComparisonSeriesIndex(t.index,0),i=e.reportData.comparisons[r],o=Dr.getComparisonSeriesIndex(t.index,n.index),a=e.reportData.comparisons[o],l=e.reportData.comparisons[n.index],c='<div class="comparison-card-tooltip">',s=(a.nb_visits/i.nb_visits*100).toFixed(2);return s="".concat(s,"%"),c+=C("General_ComparisonCardTooltip1",["'".concat(a.compareSegmentPretty,"'"),a.comparePeriodPretty,s,a.nb_visits.toString(),i.nb_visits.toString()]),t.index>0&&(c+="<br/><br/>",c+=C("General_ComparisonCardTooltip2",[a.nb_visits_change.toString(),l.compareSegmentPretty,l.comparePeriodPretty])),c+="</div>",c}},mounted:function(){var e=this;S.on("piwikComparisonsChanged",(function(){e.onComparisonsChanged()})),this.onComparisonsChanged()}});qr.render=Fr;var Wr=qr; -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Jr(){return Dr}window.angular.module("piwikApp.service").factory("piwikComparisonsService",Jr);Vt({component:Wr,directiveName:"piwikComparisons",restrict:"E"});var Gr={ref:"root",class:"menuDropdown"},zr=["title"],Yr=["innerHTML"],Qr=Object(o["createElementVNode"])("span",{class:"icon-arrow-bottom"},null,-1),Kr={class:"items"},Xr={key:0,class:"search"},Zr=["placeholder"],ei=["title"],ti=["title"];function ni(e,t,n,r,i,a){var l=Object(o["resolveDirective"])("focus-if"),c=Object(o["resolveDirective"])("focus-anywhere-but-here");return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Gr,[Object(o["createElementVNode"])("span",{class:"title",onClick:t[0]||(t[0]=function(t){return e.showItems=!e.showItems}),title:e.tooltip},[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(this.actualMenuTitle)},null,8,Yr),Qr],8,zr),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",Kr,[e.showSearch&&e.showItems?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Xr,[Object(o["withDirectives"])(Object(o["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,Zr),[[o["vModelText"],e.searchTerm],[l,{},e.showItems]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("img",{class:"search_ico",src:"plugins/Morpheus/images/search_ico.png",title:e.translate("General_Search")},null,8,ei),[[o["vShow"],!e.searchTerm]]),Object(o["withDirectives"])(Object(o["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,ti),[[o["vShow"],e.searchTerm]])])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",{onClick:t[4]||(t[4]=function(t){return e.selectItem(t)})},[Object(o["renderSlot"])(e.$slots,"default")])],512),[[o["vShow"],e.showItems]])],512)),[[c,{blur:e.lostFocus}]])}var ri=window,ii=ri.$,oi=Object(o["defineComponent"])({props:{menuTitle:String,tooltip:String,showSearch:Boolean,menuTitleChangeOnClick:Boolean},directives:{FocusAnywhereButHere:$t,FocusIf:qt},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")||(this.menuTitleChangeOnClick&&(this.actualMenuTitle=(e.target.textContent||"").replace(/[\u0000-\u2666]/g,(function(e){return"&#".concat(e.charCodeAt(0),";")}))),this.showItems=!1,ii(this.$slots.default()[0].el).find(".item").removeClass("active"),t.add("active"),this.$emit("afterSelect",e.target))},onSearchTermKeydown:function(){var e=this;setTimeout((function(){e.searchItems(e.searchTerm)}))},searchItems:function(e){var t=e.toLowerCase();ii(this.$refs.root).find(".item").each((function(e,n){var r=ii(n);-1===r.text().toLowerCase().indexOf(t)?r.hide():r.show()}))}}});oi.render=ni;var ai=oi,li=(Vt({component:ai,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 ci(e,t,n,r,i,a){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",li,null,512)}var si=1,ui=window,di=ui.$,mi=Object(o["defineComponent"])({props:{selectedDateStart:Date,selectedDateEnd:Date,highlightedDateStart:Date,highlightedDateEnd:Date,viewDate:[String,Date],stepMonths:Number,disableMonthDropdown:Boolean,options:Object},emits:["cellHover","cellHoverLeave","dateSelect"],setup:function(e,t){var n=Object(o["ref"])(null);function r(t,n){var r=t.children("a");if(e.selectedDateStart&&e.selectedDateEnd&&n>=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 i=r.length?r:t;i.addClass("ui-state-hover")}else t.removeClass("ui-state-hover"),r.removeClass("ui-state-hover")}function i(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,o=e.parent(),a=o.children("td");if(o.is(":first-child")){var l=o.children("td:not(.ui-datepicker-other-month)").first();return r=i(l,t,n),r.setDate(a.index(e)-a.index(l)+1),r}var c=o.children("td:not(.ui-datepicker-other-month)").last();return r=i(c,t,n),r.setDate(r.getDate()+a.index(e)-a.index(c)),r}function l(){var e=di(n.value),t=e.find("td[data-month]"),r=parseInt(t.attr("data-month"),10),i=parseInt(t.attr("data-year"),10);return[r,i]}function c(){var e=di(n.value),t=e.find(".ui-datepicker-calendar"),o=l(),a=t.find("td"),c=a.first(),s=i(c,o[0],o[1]);a.each((function(){r(di(this),s),s.setDate(s.getDate()+1)}))}function s(){if(!e.viewDate)return!1;var t;if("string"===typeof e.viewDate)try{t=V(e.viewDate)}catch(o){return!1}else t=e.viewDate;var r=di(n.value),i=l();return(i[0]!==t.getMonth()||i[1]!==t.getFullYear())&&(r.datepicker("setDate",t),!0)}function u(){var e=di(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=di(n.value),r=e.stepMonths||si;if(t.datepicker("option","stepMonths")===r)return!1;var i=di(".ui-datepicker-month",t).val(),o=di(".ui-datepicker-year",t).val();return t.datepicker("option","stepMonths",r).datepicker("setDate",new Date(o,i)),u(),!0}function m(){var t=di(n.value),r=t.find(".ui-datepicker-month")[0];r&&(r.disabled=e.disableMonthDropdown)}function p(){if(di(this).hasClass("ui-state-hover")){var e=di(this).parent(),t=e.parent();e.is(":first-child")?t.find("a").first().click():t.find("a").last().click()}}function f(){m(),c()}return Object(o["watch"])((function(){return Object.assign({},e)}),(function(e,t){var n=!1;[function(e){return e.selectedDateStart},function(e){return e.selectedDateEnd},function(e){return e.highlightedDateStart},function(e){return e.highlightedDateEnd}].forEach((function(r){if(!n){var i=r(e),o=r(t);!i&&o&&(n=!0),i&&!o&&(n=!0),i&&o&&i.getTime()!==o.getTime()&&(n=!0)}})),e.viewDate!==t.viewDate&&s()&&(n=!0),e.stepMonths!==t.stepMonths&&d(),e.disableMonthDropdown!==t.disableMonthDropdown&&m(),n&&c()})),Object(o["onMounted"])((function(){var r=di(n.value),o=e.options||{},a=Object.assign(Object.assign(Object.assign({},S.getBaseDatePickerOptions()),o),{},{onChangeMonthYear:function(){setTimeout((function(){u()}))}});r.datepicker(a),r.on("mouseover","tbody td a",(function(e){e.originalEvent&&c()})),r.on("mouseenter","tbody td",(function(){var e=l(),n=di(this),r=i(n,e[0],e[1]);t.emit("cellHover",{date:r,$cell:n})})),r.on("mouseout","tbody td a",(function(){c()})),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",p),r.on("click",(function(e){e.preventDefault();var t=di(e.target).closest("a");(t.is(".ui-datepicker-next")||t.is(".ui-datepicker-prev"))&&f()})),r.on("click","td[data-month]",(function(e){var n=di(e.target).closest("td"),r=parseInt(n.attr("data-month"),10),i=parseInt(n.attr("data-year"),10),o=parseInt(n.children("a,span").text(),10);t.emit("dateSelect",{date:new Date(i,r,o)})}));var h=d();s(),m(),h||u(),c()})),{root:n}}});mi.render=ci;var pi=mi,fi=(Vt({component:pi,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,i,o,a){a()},"cell-hover-leave":function(e,t,n,r,i,o,a){a()},"date-select":function(e,t,n,r,i,o,a){a()}},$inject:["$timeout"]}),{id:"calendarRangeFrom"}),hi={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 gi(e,t,n,r,i,a){var l=Object(o["resolveComponent"])("DatePicker");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",null,[Object(o["createElementVNode"])("div",fi,[Object(o["createElementVNode"])("h6",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_DateRangeFrom"))+" ",1),Object(o["withDirectives"])(Object(o["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),[[o["vModelText"],e.startDateText]])]),Object(o["createVNode"])(l,{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(o["createElementVNode"])("div",hi,[Object(o["createElementVNode"])("h6",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_DateRangeTo"))+" ",1),Object(o["withDirectives"])(Object(o["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),[[o["vModelText"],e.endDateText]])]),Object(o["createVNode"])(l,{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 vi="YYYY-MM-DD",bi=Object(o["defineComponent"])({props:{startDate:String,endDate:String},components:{DatePicker:pi},data:function(){var e=null;try{this.startDate&&(e=V(this.startDate))}catch(n){}var t=null;try{this.endDate&&(t=V(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){this.startDateInvalid=!0;var t=null;try{e&&e.length===vi.length&&(t=V(e))}catch(n){}t&&(this.fromPickerSelectedDates=[t,t],this.startDateInvalid=!1,this.rangeChanged())},setEndRangeDateFromStr:function(e){this.endDateInvalid=!0;var t=null;try{e&&e.length===vi.length&&(t=V(e))}catch(n){}t&&(this.toPickerSelectedDates=[t,t],this.endDateInvalid=!1,this.rangeChanged())},rangeChanged:function(){this.$emit("rangeChange",{start:this.fromPickerSelectedDates[0]?D(this.fromPickerSelectedDates[0]):null,end:this.toPickerSelectedDates[0]?D(this.toPickerSelectedDates[0]):null})}}});bi.render=gi;var yi=bi; -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */Vt({component:yi,scope:{startDate:{angularJsBind:"<"},endDate:{angularJsBind:"<"},rangeChange:{angularJsBind:"&"},submit:{angularJsBind:"&"}},directiveName:"piwikDateRangePicker",restrict:"E"});function wi(e,t,n,r,i,a){var l=Object(o["resolveComponent"])("DatePicker");return Object(o["openBlock"])(),Object(o["createBlock"])(l,{"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 Oi=new Date(S.minDateYear,S.minDateMonth-1,S.minDateDay),ji=new Date(S.maxDateYear,S.maxDateMonth-1,S.maxDateDay),ki=Object(o["defineComponent"])({props:{period:{type:String,required:!0},date:[String,Date]},components:{DatePicker:pi},emits:["select"],setup:function(e,t){var n=Object(o["ref"])(e.date),r=Object(o["ref"])([null,null]),i=Object(o["ref"])([null,null]);function a(t){var n=m.get(e.period).parse(t).getDateRange();return n[0]=Oi<n[0]?n[0]:Oi,n[1]=ji>n[1]?n[1]:ji,n}function l(t,n){var r=t<Oi||t>ji,o=n.hasClass("ui-datepicker-other-month")&&("month"===e.period||"day"===e.period);i.value=r||o?[null,null]:a(t)}function c(){i.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=V(e.date)}return Object(o["watch"])(e,u),u(),{selectedDates:r,highlightedDates:i,viewDate:n,onHoverNormalCell:l,onHoverLeaveNormalCells:c,onDateSelected:s}}});ki.render=wi;var Si=ki,Ci=(Vt({component:Si,scope:{period:{angularJsBind:"<"},date:{angularJsBind:"<"},select:{angularJsBind:"&"}},directiveName:"piwikPeriodDatePicker",restrict:"E"}),["value","name"]),Ei=["title"],Di=["textContent"],Pi={key:1,class:"placeholder"},Vi={class:"dropdown"},Ni={class:"custom_select_search"},Ti=["placeholder"],Ai={key:0},xi={class:"custom_select_container"},Ii=["onClick"],Bi=["innerHTML","href","title"],Mi={class:"ui-autocomplete ui-front ui-menu ui-widget ui-widget-content ui-corner-all\n siteSelect"},Li={class:"ui-menu-item"},Fi={class:"ui-corner-all",tabindex:"-1"},Ri={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 _i(e,t,n,r,i,a){var l,c,s,u,d=Object(o["resolveComponent"])("AllSitesLink"),m=Object(o["resolveDirective"])("focus-if"),p=Object(o["resolveDirective"])("focus-anywhere-but-here");return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])(["siteSelector piwikSelector borderedControl",{expanded:e.showSitesList,disabled:!e.hasMultipleSites}])},[e.name?(Object(o["openBlock"])(),Object(o["createElementBlock"])("input",{key:0,type:"hidden",value:null===(l=e.displayedModelValue)||void 0===l?void 0:l.id,name:e.name},null,8,Ci)):Object(o["createCommentVNode"])("",!0),Object(o["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(o["normalizeClass"])([{loading:e.isLoading},"title"]),tabindex:"4",title:e.selectorLinkTitle},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["icon icon-arrow-bottom",{iconHidden:e.isLoading,collapsed:!e.showSitesList}])},null,2),Object(o["createElementVNode"])("span",null,[null!==(c=e.displayedModelValue)&&void 0!==c&&c.name||!e.placeholder?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,textContent:Object(o["toDisplayString"])((null===(s=e.displayedModelValue)||void 0===s?void 0:s.name)||e.firstSiteName)},null,8,Di)):Object(o["createCommentVNode"])("",!0),null!==(u=e.displayedModelValue)&&void 0!==u&&u.name||!e.placeholder?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",Pi,Object(o["toDisplayString"])(e.placeholder),1))])],42,Ei),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",Vi,[Object(o["withDirectives"])(Object(o["createElementVNode"])("div",Ni,[Object(o["withDirectives"])(Object(o["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,Ti),[[o["vModelText"],e.searchTerm],[m,{},e.shouldFocusOnSearch]]),Object(o["withDirectives"])(Object(o["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),[[o["vShow"],e.searchTerm]])],512),[[o["vShow"],e.autocompleteMinSites<=e.sites.length||e.searchTerm]]),"top"===e.allSitesLocation&&e.showAllSitesItem?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ai,[Object(o["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(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",xi,[Object(o["createElementVNode"])("ul",{class:"custom_select_ul_list",onClick:t[7]||(t[7]=function(t){return e.showSitesList=!1})},[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.sites,(function(n,r){return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{onClick:function(t){return e.switchSite(Object.assign(Object.assign({},n),{},{id:n.idsite}),t)},key:r},[Object(o["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,Bi)],8,Ii)),[[o["vShow"],!(!e.showSelectedSite&&"".concat(e.activeSiteId)==="".concat(n.idsite))]])})),128))]),Object(o["withDirectives"])(Object(o["createElementVNode"])("ul",Mi,[Object(o["createElementVNode"])("li",Li,[Object(o["createElementVNode"])("a",Fi,Object(o["toDisplayString"])(e.translate("SitesManager_NotFound")+" "+e.searchTerm),1)])],512),[[o["vShow"],!e.sites.length&&e.searchTerm]])]),"bottom"===e.allSitesLocation&&e.showAllSitesItem?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ri,[Object(o["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(o["createCommentVNode"])("",!0)],512),[[o["vShow"],e.showSitesList]])],2)),[[p,{blur:e.onBlur}]])}var $i=["innerHTML","href"];function Hi(e,t,n,r,i,a){var l=this;return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{onClick:t[1]||(t[1]=function(e){return l.onClick(e)}),class:"custom_select_all"},[Object(o["createElementVNode"])("a",{onClick:t[0]||(t[0]=function(e){return e.preventDefault()}),innerHTML:e.$sanitize(e.allSitesText),tabindex:"4",href:e.href},null,8,$i)])}var Ui=Object(o["defineComponent"])({props:{href:String,allSitesText:String},emits:["click"],methods:{onClick:function(e){this.$emit("click",e)}}});Ui.render=Hi;var qi=Ui;function Wi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ji(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Gi(e,t,n){return t&&Ji(e.prototype,t),n&&Ji(e,n),e}function zi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var Yi=function(){function e(){var t=this;Wi(this,e),zi(this,"state",Object(o["reactive"])({initialSites:[],isInitialized:!1})),zi(this,"stateFiltered",Object(o["reactive"])({initialSites:[],isInitialized:!1,excludedSites:[]})),zi(this,"currentRequestAbort",null),zi(this,"limitRequest",void 0),zi(this,"initialSites",Object(o["computed"])((function(){return Object(o["readonly"])(t.state.initialSites)}))),zi(this,"initialSitesFiltered",Object(o["computed"])((function(){return Object(o["readonly"])(t.stateFiltered.initialSites)})))}return Gi(e,[{key:"loadInitialSites",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return this.state.isInitialized&&0===n.length?Promise.resolve(Object(o["readonly"])(this.state.initialSites)):this.stateFiltered.isInitialized&&n.length===this.stateFiltered.excludedSites.length&&n.every((function(t,n){return t===e.stateFiltered.excludedSites[n]}))?Promise.resolve(Object(o["readonly"])(this.stateFiltered.initialSites)):(n.length>0&&this.searchSite("%",t,n).then((function(t){e.stateFiltered.isInitialized=!0,e.stateFiltered.excludedSites=n,null!==t&&(e.stateFiltered.initialSites=t)})),this.state.isInitialized?Promise.resolve(Object(o["readonly"])(this.state.initialSites)):this.searchSite("%",t,n).then((function(t){return e.state.isInitialized=!0,null!==t&&(e.state.initialSites=t),t})))}},{key:"loadSite",value:function(e){"all"===e?Ee.updateUrl(Object.assign(Object.assign({},Ee.urlParsed.value),{},{module:"MultiSites",action:"index",date:Ee.parsed.value.date,period:Ee.parsed.value.period})):Ee.updateUrl(Object.assign(Object.assign({},Ee.urlParsed.value),{},{segment:"",idSite:e}),Object.assign(Object.assign({},Ee.hashParsed.value),{},{segment:"",idSite:e}))}},{key:"searchSite",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return e?(this.currentRequestAbort&&this.currentRequestAbort.abort(),this.limitRequest||(this.limitRequest=Ze.fetch({method:"SitesManager.getNumWebsitesToDisplayPerPage"})),this.limitRequest.then((function(i){var o=i.value,a="SitesManager.getPatternMatchSites";return n&&(a="SitesManager.getSitesWithAdminAccess"),t.currentRequestAbort=new AbortController,Ze.fetch({method:a,limit:o,pattern:e,sitesToExclude:r},{abortController:t.currentRequestAbort})})).then((function(e){return e?t.processWebsitesList(e):null})).finally((function(){t.currentRequestAbort=null}))):this.loadInitialSites(n,r)}},{key:"processWebsitesList",value:function(e){var t=e;return t&&t.length?(t=t.map((function(e){return Object.assign(Object.assign({},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:e.name.toLowerCase()>t.name.toLowerCase()?1:0})),t):[]}}]),e}(),Qi=new Yi,Ki=300;function Xi(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ki;return function(){for(var r=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];t&&clearTimeout(t),t=setTimeout((function(){e.call.apply(e,[r].concat(o))}),n)}}var Zi=Object(o["defineComponent"])({props:{modelValue:Object,showSelectedSite:{type:Boolean,default:!1},showAllSitesItem:{type:Boolean,default:!0},switchSiteOnSelect:{type:Boolean,default:!0},onlySitesWithAdminAccess:{type:Boolean,default:!1},name:{type:String,default:""},allSitesText:{type:String,default:C("General_MultiSitesSummary")},allSitesLocation:{type:String,default:"bottom"},placeholder:String,defaultToFirstSite:Boolean,sitesToExclude:{type:Array,default:function(){return[]}}},emits:["update:modelValue","blur"],components:{AllSitesLink:qi},directives:{FocusAnywhereButHere:$t,FocusIf:qt},watch:{searchTerm:function(){this.onSearchTermChanged()}},data:function(){return{searchTerm:"",activeSiteId:"".concat(S.idSite),showSitesList:!1,isLoading:!1,sites:[],autocompleteMinSites:parseInt(S.config.autocomplete_min_sites,10)}},created:function(){this.searchSite=Xi(this.searchSite),!this.modelValue&&S.idSite&&this.$emit("update:modelValue",{id:S.idSite,name:S.helper.htmlDecode(S.siteName)})},mounted:function(){var e=this;window.initTopControls(),this.loadInitialSites().then((function(){e.shouldDefaultToFirstSite&&e.$emit("update:modelValue",{id:e.sites[0].idsite,name:e.sites[0].name})}));var t=C("CoreHome_ShortcutWebsiteSelector");S.helper.registerShortcut("w",t,(function(t){if(!t.altKey){t.preventDefault?t.preventDefault():t.returnValue=!1;var n=e.$refs.selectorLink;n&&(n.click(),n.focus())}}))},computed:{shouldFocusOnSearch:function(){return this.showSitesList&&this.autocompleteMinSites<=this.sites.length||this.searchTerm},selectorLinkTitle:function(){var e;return this.hasMultipleSites?C("CoreHome_ChangeCurrentWebsite",(null===(e=this.modelValue)||void 0===e?void 0:e.name)||this.firstSiteName):""},hasMultipleSites:function(){var e=Qi.initialSitesFiltered.value&&Qi.initialSitesFiltered.value.length?Qi.initialSitesFiltered.value:Qi.initialSites.value;return e&&e.length>1},firstSiteName:function(){var e=Qi.initialSitesFiltered.value&&Qi.initialSitesFiltered.value.length?Qi.initialSitesFiltered.value:Qi.initialSites.value;return e&&e.length>0?e[0].name:""},urlAllSites:function(){var e=Ee.stringify(Object.assign(Object.assign({},Ee.urlParsed.value),{},{module:"MultiSites",action:"index",date:Ee.parsed.value.date,period:Ee.parsed.value.period}));return"?".concat(e)},shouldDefaultToFirstSite:function(){var e;return!(null!==(e=this.modelValue)&&void 0!==e&&e.id)&&(!this.hasMultipleSites||this.defaultToFirstSite)&&this.sites[0]},displayedModelValue:function(){return this.modelValue?this.modelValue:S.idSite?{id:S.idSite,name:S.helper.htmlDecode(S.siteName)}:this.shouldDefaultToFirstSite?{id:this.sites[0].idsite,name:this.sites[0].name}:null}},methods:{onSearchTermChanged:function(){this.searchTerm?(this.isLoading=!0,this.searchSite(this.searchTerm)):(this.isLoading=!1,this.loadInitialSites())},onAllSitesClick:function(e){this.switchSite({id:"all",name:this.$props.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.id,name:e.name}),this.switchSiteOnSelect&&this.activeSiteId!==e.id&&Qi.loadSite(e.id))},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,'<span class="autocompleteMatched">').concat(this.searchTerm,"</span>").concat(r)},loadInitialSites:function(){var e=this;return Qi.loadInitialSites(this.onlySitesWithAdminAccess,this.sitesToExclude?this.sitesToExclude:[]).then((function(t){e.sites=t||[]}))},searchSite:function(e){var t=this;this.isLoading=!0,Qi.searchSite(e,this.onlySitesWithAdminAccess,this.sitesToExclude?this.sitesToExclude:[]).then((function(n){e===t.searchTerm&&n&&(t.sites=n)})).finally((function(){t.isLoading=!1}))},getUrlForSiteId:function(e){var t=Ee.stringify(Object.assign(Object.assign({},Ee.urlParsed.value),{},{segment:"",idSite:e})),n=Ee.stringify(Object.assign(Object.assign({},Ee.hashParsed.value),{},{segment:"",idSite:e}));return"?".concat(t,"#?").concat(n)}}});Zi.render=_i;var eo=Zi; -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */Vt({component:eo,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,i,o,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),o&&(o.$setViewValue(e),o.$render())}))},blur:function(e,t,n){setTimeout((function(){return n.$apply()}))}},postCreate:function(e,t,n,r,i){var a=i;t.$watch("value",(function(t){Object(o["nextTick"])((function(){t!==e.modelValue&&(e.modelValue=t)}))})),r.siteid&&r.sitename?(t.value={id:r.siteid,name:S.helper.htmlDecode(r.sitename)},e.modelValue=t.value):S.idSite&&(t.value={id:S.idSite,name:S.helper.htmlDecode(S.siteName)},e.modelValue=t.value),a&&(a.$setViewValue(e.modelValue),a.$render=function(){Object(o["nextTick"])((function(){Object(o["nextTick"])((function(){window.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 to(){return{get initialSites(){return Qi.initialSites.value},loadSite:Qi.loadSite.bind(Qi),loadInitialSites:function(){return xt(Qi.loadInitialSites())},searchSite:function(){return xt(Qi.searchSite.apply(Qi,arguments))}}}window.angular.module("piwikApp.service").factory("siteSelectorModel",to);var no={ref:"root",class:"quickAccessInside"},ro=["title","placeholder"],io={class:"dropdown"},oo={class:"no-result"},ao=["onClick"],lo=["onMouseenter","onClick"],co={class:"quickAccessMatomoSearch"},so=["onMouseenter","onClick"],uo=["textContent"],mo={class:"quick-access-category helpCategory"},po=["href"];function fo(e,t,n,r,i,a){var l=Object(o["resolveDirective"])("focus-if"),c=Object(o["resolveDirective"])("focus-anywhere-but-here");return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",no,[Object(o["createElementVNode"])("span",{class:"icon-search",onMouseenter:t[0]||(t[0]=function(t){return e.searchActive=!0})},null,32),Object(o["withDirectives"])(Object(o["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,placeholder:e.translate("General_Search"),ref:"input"},null,40,ro),[[o["vModelText"],e.searchTerm],[l,{},e.searchActive]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",io,[Object(o["withDirectives"])(Object(o["createElementVNode"])("ul",null,[Object(o["createElementVNode"])("li",oo,Object(o["toDisplayString"])(e.translate("General_SearchNoResults")),1)],512),[[o["vShow"],!(e.numMenuItems>0||e.sites.length)]]),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.menuItems,(function(t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("ul",{key:t.title},[Object(o["createElementVNode"])("li",{class:"quick-access-category",onClick:function(n){e.searchTerm=t.title,e.searchMenu(e.searchTerm)}},Object(o["toDisplayString"])(t.title),9,ao),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(t.items,(function(t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{class:Object(o["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(o["createElementVNode"])("a",null,Object(o["toDisplayString"])(t.name.trim()),1)],42,lo)})),128))])})),128)),Object(o["createElementVNode"])("ul",co,[Object(o["withDirectives"])(Object(o["createElementVNode"])("li",{class:"quick-access-category websiteCategory"},Object(o["toDisplayString"])(e.translate("SitesManager_Sites")),513),[[o["vShow"],e.hasSitesSelector&&e.sites.length||e.isLoading]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("li",{class:"no-result"},Object(o["toDisplayString"])(e.translate("MultiSites_LoadingWebsites")),513),[[o["vShow"],e.hasSitesSelector&&e.isLoading]]),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.sites,(function(t,n){return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{class:Object(o["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(o["createElementVNode"])("a",{textContent:Object(o["toDisplayString"])(t.name)},null,8,uo)],42,so)),[[o["vShow"],e.hasSitesSelector&&!e.isLoading]])})),128))]),Object(o["createElementVNode"])("ul",null,[Object(o["createElementVNode"])("li",mo,Object(o["toDisplayString"])(e.translate("General_HelpResources")),1),Object(o["createElementVNode"])("li",{class:Object(o["normalizeClass"])([{selected:"help"===e.searchIndex},"quick-access-help"]),onMouseenter:t[4]||(t[4]=function(t){return e.searchIndex="help"})},[Object(o["createElementVNode"])("a",{href:"https://matomo.org?mtm_campaign=App_Help&mtm_source=Matomo_App&mtm_keyword=QuickSearch&s=".concat(encodeURIComponent(e.searchTerm)),target:"_blank"},Object(o["toDisplayString"])(e.translate("CoreHome_SearchOnMatomo",e.searchTerm)),9,po)],34)])],512),[[o["vShow"],e.searchTerm&&e.searchActive]])],512)),[[c,{blur:e.onBlur}]])}function ho(e){var t=e.getBoundingClientRect(),n=window.$(window);return t.top>=0&&t.left>=0&&t.bottom<=n.height()&&t.right<=n.width()}function go(e){e&&e.scrollIntoView&&e.scrollIntoView()}var vo=Object(o["defineComponent"])({directives:{FocusAnywhereButHere:$t,FocusIf:qt},watch:{searchActive:function(e){var t=this.$refs.root;if(t&&t.parentElement){var n=t.parentElement.classList;n.toggle("active",e),n.toggle("expanded",e)}}},mounted:function(){var e=this,t=this.$refs.root;t&&t.parentElement&&t.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(),go(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=Xi(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,i=27===e.which;38===e.which?(this.highlightPreviousItem(),e.preventDefault()):40===e.which?(this.highlightNextItem(),e.preventDefault()):13===e.which?this.clickQuickAccessMenuItem():r&&n||i&&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.input&&this.$refs.input.blur()},makeSureSelectedItemIsInViewport:function(){var e=this.getCurrentlySelectedElement();e&&!ho(e)&&go(e)},getCurrentlySelectedElement:function(){var e=this.$refs.root.querySelectorAll("li.result");if(e&&e.length&&e.item(this.searchIndex))return e.item(this.searchIndex)},searchMenu:function(e){var t=this,n=e.toLowerCase(),r=-1,i={},o=[],a=function(e){var t=Object.assign({},e);r+=1,t.menuIndex=r;var n=t.category;n in i||(o.push({title:n,items:[]}),i[n]=o.length-1);var a=i[n];o[a].items.push(t)};this.resetSearchIndex(),this.hasSitesSelector&&(this.isLoading=!0,Qi.searchSite(n).then((function(e){e&&(t.sites=e)})).finally((function(){t.isLoading=!1})));var l=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 c=this.topMenuItems.filter(l),s=this.leftMenuItems.filter(l),u=this.segmentItems.filter(l);c.forEach(a),s.forEach(a),u.forEach(a),this.numMenuItems=c.length+s.length+u.length,this.menuItems=o},resetSearchIndex:function(){this.searchIndex=0,this.makeSureSelectedItemIsInViewport()},selectSite:function(e){Qi.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 i,o,a=null===(i=r.textContent)||void 0===i?void 0:i.trim();a||(a=null===(o=r.getAttribute("title"))||void 0===o?void 0:o.trim());a&&(n.push({name:a,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,i=window.$(n).find("> .item"),o=(null===(r=i[0])||void 0===r?void 0:r.innerText.trim())||"";o&&-1!==o.lastIndexOf("\n")&&(o=o.slice(0,o.lastIndexOf("\n")).trim()),window.$(n).find("li .item").each((function(n,r){var i,a=null===(i=r.textContent)||void 0===i?void 0:i.trim();a&&(t.push({name:a,category:o,index:e.menuIndexCounter+=1}),r.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 i,o,a=null===(i=r.querySelector(".segname"))||void 0===i||null===(o=i.textContent)||void 0===o?void 0:o.trim();a&&(n.push({name:a,category:t,index:e.menuIndexCounter+=1}),r.setAttribute("quick_access","".concat(e.menuIndexCounter)))})),n}}});vo.render=fo;var bo=vo; -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */Vt({component:bo,directiveName:"piwikQuickAccess",events:{itemSelected:function(e,t,n,r,i,o,a){a()},blur:function(e,t,n){setTimeout((function(){return n.$apply()}))}}});function yo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wo={class:"fieldArray form-group"},Oo={key:0,class:"fieldUiControl"},jo=["onClick","title"];function ko(e,t,n,r,i,a){var l=Object(o["resolveComponent"])("Field");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",wo,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.modelValue,(function(t,n){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])(["fieldArrayTable multiple valign-wrapper",yo({},"fieldArrayTable".concat(n),!0)]),key:n},[e.field.uiControl?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Oo,[Object(o["createVNode"])(l,{"full-width":!0,"model-value":t,options:e.field.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(t,n)},"model-modifiers":e.field.modelModifiers,placeholder:" ",uicontrol:e.field.uiControl,title:e.field.title,name:"".concat(e.name,"-").concat(n),"template-file":e.field.templateFile,component:e.field.component},null,8,["model-value","options","onUpdate:modelValue","model-modifiers","uicontrol","title","name","template-file","component"])])):Object(o["createCommentVNode"])("",!0),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{onClick:function(t){return e.removeEntry(n)},class:"icon-minus valign",title:e.translate("General_Remove")},null,8,jo),[[o["vShow"],n+1!==e.modelValue.length]])],2)})),128))])}function So(e){return Po(e)||Do(e)||Eo(e)||Co()}function Co(){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 Eo(e,t){if(e){if("string"===typeof e)return Vo(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)?Vo(e,t):void 0}}function Do(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Po(e){if(Array.isArray(e))return Vo(e)}function Vo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var No=vt("CorePluginsAdmin","Field"),To=Object(o["defineComponent"])({props:{modelValue:Array,name:String,field:Object},components:{Field:No},emits:["update:modelValue"],watch:{modelValue:function(e){this.checkEmptyModelValue(e)}},mounted:function(){this.checkEmptyModelValue(this.modelValue)},methods:{checkEmptyModelValue:function(e){e&&e.length&&""===e.slice(-1)[0]||this.$emit("update:modelValue",[].concat(So(e||[]),[""]))},onEntryChange:function(e,t){var n=So(this.modelValue||[]);n[t]=e,this.$emit("update:modelValue",n)},removeEntry:function(e){if(e>-1&&this.modelValue){var t=this.modelValue.filter((function(t,n){return n!==e}));this.$emit("update:modelValue",t)}}}});To.render=ko;var Ao=To; -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */Vt({component:Ao,require:"?ngModel",scope:{name:{angularJsBind:"="},field:{angularJsBind:"="}},directiveName:"matomoFieldArray",events:{"update:modelValue":function(e,t,n,r,i,o){e!==t.modelValue&&(r.trigger("change",e),o&&o.$setViewValue(e))}},postCreate:function(e,t,n,r,i){var o=i;o&&(o.$setViewValue(e.modelValue),o.$render=function(){window.angular.isString(o.$viewValue)?e.modelValue=JSON.parse(o.$viewValue):e.modelValue=o.$viewValue})}});function xo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Io={class:"multiPairField form-group"},Bo={key:1,class:"fieldUiControl fieldUiControl2"},Mo={key:2,class:"fieldUiControl fieldUiControl3"},Lo={key:3,class:"fieldUiControl fieldUiControl4"},Fo=["onClick","title"];function Ro(e,t,n,r,i,a){var l=Object(o["resolveComponent"])("Field");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Io,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.modelValue,(function(t,n){var r;return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])(["multiPairFieldTable multiple valign-wrapper",(r={},xo(r,"multiPairFieldTable".concat(n),!0),xo(r,"has".concat(e.fieldCount,"Fields"),!0),r)]),key:n},[e.field1?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:0,class:Object(o["normalizeClass"])(["fieldUiControl fieldUiControl1",{hasMultiFields:e.field1.type&&e.field2.type}])},[Object(o["createVNode"])(l,{"full-width":!0,"model-value":t[e.field1.key],options:e.field1.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field1.key,t)},"model-modifiers":e.field1.modelModifiers,placeholder:" ",uicontrol:e.field1.uiControl,name:"".concat(e.name,"-p1-").concat(n),title:e.field1.title,"template-file":e.field1.templateFile,component:e.field1.component},null,8,["model-value","options","onUpdate:modelValue","model-modifiers","uicontrol","name","title","template-file","component"])],2)):Object(o["createCommentVNode"])("",!0),e.field2?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Bo,[Object(o["createVNode"])(l,{"full-width":!0,options:e.field2.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field2.key,t)},"model-value":t[e.field2.key],"model-modifiers":e.field2.modelModifiers,placeholder:" ",uicontrol:e.field2.uiControl,name:"".concat(e.name,"-p2-").concat(n),title:e.field2.title,"template-file":e.field2.templateFile,component:e.field2.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","name","title","template-file","component"])])):Object(o["createCommentVNode"])("",!0),e.field3?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Mo,[Object(o["createVNode"])(l,{"full-width":!0,options:e.field3.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field3.key,t)},"model-value":t[e.field3.key],"model-modifiers":e.field3.modelModifiers,placeholder:" ",uicontrol:e.field3.uiControl,title:e.field3.title,"template-file":e.field3.templateFile,component:e.field3.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","title","template-file","component"])])):Object(o["createCommentVNode"])("",!0),e.field4?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Lo,[Object(o["createVNode"])(l,{"full-width":!0,options:e.field4.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field4.key,t)},"model-value":t[e.field4.key],"model-modifiers":e.field4.modelModifiers,placeholder:" ",uicontrol:e.field4.uiControl,title:e.field4.title,"template-file":e.field4.templateFile,component:e.field4.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","title","template-file","component"])])):Object(o["createCommentVNode"])("",!0),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{onClick:function(t){return e.removeEntry(n)},class:"icon-minus valign",title:e.translate("General_Remove")},null,8,Fo),[[o["vShow"],n+1!==e.modelValue.length]])],2)})),128))])}function _o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $o(e){return Wo(e)||qo(e)||Uo(e)||Ho()}function Ho(){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 Uo(e,t){if(e){if("string"===typeof e)return Jo(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)?Jo(e,t):void 0}}function qo(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Wo(e){if(Array.isArray(e))return Jo(e)}function Jo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Go=vt("CorePluginsAdmin","Field"),zo=Object(o["defineComponent"])({props:{modelValue:Array,name:String,field1:Object,field2:Object,field3:Object,field4:Object},components:{Field:Go},computed:{fieldCount:function(){return this.field1&&this.field2&&this.field3&&this.field4?4:this.field1&&this.field2&&this.field3?3:this.field1&&this.field2?2:this.field1?1:0}},emits:["update:modelValue"],watch:{modelValue:function(e){this.checkEmptyModelValue(e)}},mounted:function(){this.checkEmptyModelValue(this.modelValue)},methods:{checkEmptyModelValue:function(e){e&&e.length&&!this.isEmptyValue(e.slice(-1)[0])||this.$emit("update:modelValue",[].concat($o(e||[]),[this.makeEmptyValue()]))},onEntryChange:function(e,t,n){var r=$o(this.modelValue);r[e]=Object.assign(Object.assign({},r[e]),{},_o({},t,n)),this.$emit("update:modelValue",r)},removeEntry:function(e){if(e>-1&&this.modelValue){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}}});zo.render=Ro;var Yo=zo,Qo=(Vt({component:Yo,require:"?ngModel",scope:{name:{angularJsBind:"="},field1:{angularJsBind:"="},field2:{angularJsBind:"="},field3:{angularJsBind:"="},field4:{angularJsBind:"="}},directiveName:"matomoMultiPairField",events:{"update:modelValue":function(e,t,n,r,i,o){e!==t.modelValue&&(r.trigger("change",e),o&&o.$setViewValue(e))}},postCreate:function(e,t,n,r,i){var o=i;o&&(o.$setViewValue(e.modelValue),o.$render=function(){window.angular.isString(o.$viewValue)?e.modelValue=JSON.parse(o.$viewValue):e.modelValue=o.$viewValue})}}),{ref:"root",class:"periodSelector piwikSelector"}),Ko=["title"],Xo=Object(o["createElementVNode"])("span",{class:"icon icon-calendar"},null,-1),Zo={id:"periodMore",class:"dropdown"},ea={class:"flex"},ta={key:0,class:"period-date"},na={class:"period-type"},ra={id:"otherPeriods"},ia=["onDblclick","title"],oa=["id","checked","onChange","onDblclick"],aa={key:0,class:"compare-checkbox"},la={id:"comparePeriodToDropdown"},ca={key:1,class:"compare-date-range"},sa={id:"comparePeriodStartDate"},ua=Object(o["createElementVNode"])("span",{class:"compare-dates-separator"},null,-1),da={id:"comparePeriodEndDate"},ma={class:"apply-button-container"},pa=["disabled","value"],fa={key:2,id:"ajaxLoadingCalendar"},ha={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 ga(e,t,n,r,i,a){var l=Object(o["resolveComponent"])("DateRangePicker"),c=Object(o["resolveComponent"])("PeriodDatePicker"),s=Object(o["resolveComponent"])("Field"),u=Object(o["resolveComponent"])("ActivityIndicator"),d=Object(o["resolveDirective"])("expand-on-click");return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Qo,[Object(o["createElementVNode"])("a",{ref:"title",id:"date",class:"title",tabindex:"-1",title:e.translate("General_ChooseDate",e.currentlyViewingText)},[Xo,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.currentlyViewingText),1)],8,Ko),Object(o["createElementVNode"])("div",Zo,[Object(o["createElementVNode"])("div",ea,[Object(o["createElementVNode"])("div",null,[Object(o["withDirectives"])(Object(o["createVNode"])(l,{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"]),[[o["vShow"],"range"===e.selectedPeriod]]),"range"!==e.selectedPeriod?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ta,[Object(o["createVNode"])(c,{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(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",na,[Object(o["createElementVNode"])("h6",null,Object(o["toDisplayString"])(e.translate("General_Period")),1),Object(o["createElementVNode"])("div",ra,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.periodsFiltered,(function(n){return Object(o["openBlock"])(),Object(o["createElementBlock"])("p",{key:n},[Object(o["createElementVNode"])("label",{class:Object(o["normalizeClass"])({"selected-period-label":n===e.selectedPeriod}),onDblclick:function(t){return e.changeViewedPeriod(n)},title:n===e.periodValue?"":e.translate("General_DoubleClickToChangePeriod")},[Object(o["withDirectives"])(Object(o["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),[[o["vModelRadio"],e.selectedPeriod]]),Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.getPeriodDisplayText(n)),1)],42,ia)])})),128))])])]),e.isComparisonEnabled?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",aa,[Object(o["createElementVNode"])("label",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{id:"comparePeriodTo",type:"checkbox","onUpdate:modelValue":t[4]||(t[4]=function(t){return e.isComparing=t})},null,512),[[o["vModelCheckbox"],e.isComparing]]),Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.translate("General_CompareTo")),1)]),Object(o["createElementVNode"])("div",la,[Object(o["createVNode"])(s,{modelValue:e.comparePeriodType,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.comparePeriodType=t}),style:Object(o["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(o["createCommentVNode"])("",!0),e.isComparing&&"custom"===e.comparePeriodType?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ca,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("div",sa,[Object(o["createElementVNode"])("div",null,[Object(o["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"])])]),ua,Object(o["createElementVNode"])("div",da,[Object(o["createElementVNode"])("div",null,[Object(o["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(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",ma,[Object(o["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(o["openBlock"])(),Object(o["createElementBlock"])("div",fa,[Object(o["createVNode"])(u,{loading:!0}),Object(o["createElementVNode"])("div",ha,Object(o["toDisplayString"])(e.translate("SegmentEditor_LoadingSegmentedDataMayTakeSomeTime")),1)])):Object(o["createCommentVNode"])("",!0)])],512)),[[d,{expander:"title"}]])}var va={class:"loadingPiwik"},ba=Object(o["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:""},null,-1);function ya(e,t,n,r,i,a){return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",va,[ba,Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.loadingMessage),1)],512)),[[o["vShow"],e.loading]])}var wa=Object(o["defineComponent"])({props:{loading:{type:Boolean,required:!0,default:!1},loadingMessage:{type:String,required:!1,default:C("General_LoadingData")}}});wa.render=ya;var Oa=wa;function ja(e,t){return Da(e)||Ea(e,t)||Sa(e,t)||ka()}function ka(){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 Sa(e,t){if(e){if("string"===typeof e)return Ca(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)?Ca(e,t):void 0}}function Ca(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ea(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0)if(o.push(r.value),t&&o.length===t)break}catch(c){l=!0,i=c}finally{try{a||null==n["return"]||n["return"]()}finally{if(l)throw i}}return o}}function Da(e){if(Array.isArray(e))return e}var Pa=vt("CorePluginsAdmin","Field"),Va=S.helper.htmlDecode(" "),Na=[{key:"custom",value:C("General_Custom")},{key:"previousPeriod",value:C("General_PreviousPeriod").replace(/\s+/,Va)},{key:"previousYear",value:C("General_PreviousYear").replace(/\s+/,Va)}],Ta=new Date(S.minDateYear,S.minDateMonth-1,S.minDateDay),Aa=new Date(S.maxDateYear,S.maxDateMonth-1,S.maxDateDay);function xa(e){return"[object Date]"===Object.prototype.toString.call(e)&&!Number.isNaN(e.getTime())}var Ia=Object(o["defineComponent"])({props:{periods:Array},components:{DateRangePicker:yi,PeriodDatePicker:Si,Field:Pa,ActivityIndicator:Oa},directives:{ExpandOnClick:nn},data:function(){var e=Ee.parsed.value.period;return{comparePeriodDropdownOptions:Na,periodValue:e,dateValue:null,selectedPeriod:e,startRangeDate:null,endRangeDate:null,isRangeValid:null,isLoadingNewPage:!1,isComparing:null,comparePeriodType:"previousPeriod",compareStartDate:"",compareEndDate:""}},mounted:function(){var e=this;S.on("hidePeriodSelector",(function(){window.$(e.$refs.root).hide()})),S.on("matomoPageChange",(function(){window.$(e.$refs.root).show()})),this.updateSelectedValuesFromHash(),Object(o["watch"])((function(){return Ee.parsed.value}),this.updateSelectedValuesFromHash),this.isComparing=Dr.isComparingPeriods(),Object(o["watch"])((function(){return Dr.isComparingPeriods()}),(function(t){e.isComparing=t})),window.initTopControls(),this.handleZIndexPositionRelativeCompareDropdownIssue()},computed:{currentlyViewingText:function(){var e;if("range"===this.periodValue){if(!this.startRangeDate||!this.endRangeDate)return C("General_Error");e="".concat(this.startRangeDate,",").concat(this.endRangeDate)}else{if(!this.dateValue)return C("General_Error");e=D(this.dateValue)}try{return m.parse(this.periodValue,e).getPrettyString()}catch(t){return C("General_Error")}},isComparisonEnabled:function(){return Dr.isComparisonEnabled()},periodsFiltered:function(){return(this.periods||[]).filter((function(e){return m.isRecognizedPeriod(e)}))},selectedComparisonParams:function(){if(!this.isComparing)return{};if("custom"===this.comparePeriodType)return{comparePeriods:["range"],compareDates:["".concat(this.compareStartDate,",").concat(this.compareEndDate)]};if("previousPeriod"===this.comparePeriodType)return{comparePeriods:[this.selectedPeriod],compareDates:[this.previousPeriodDateToSelectedPeriod]};if("previousYear"===this.comparePeriodType){var e="range"===this.selectedPeriod?"".concat(this.startRangeDate,",").concat(this.endRangeDate):D(this.dateValue),t=m.parse(this.selectedPeriod,e).getDateRange();return t[0].setFullYear(t[0].getFullYear()-1),t[1].setFullYear(t[1].getFullYear()-1),"range"===this.selectedPeriod?{comparePeriods:["range"],compareDates:["".concat(D(t[0]),",").concat(D(t[1]))]}:{comparePeriods:[this.selectedPeriod],compareDates:[D(t[0])]}}return console.warn("Unknown compare period type: ".concat(this.comparePeriodType)),{}},previousPeriodDateToSelectedPeriod:function(){if("range"===this.selectedPeriod){var e=V(this.startRangeDate),t=V(this.endRangeDate),n=H.getLastNRange("day",2,e).startDate,r=Math.floor((t.valueOf()-e.valueOf())/864e5),i=H.getLastNRange("day",1+r,n);return"".concat(D(i.startDate),",").concat(D(i.endDate))}var o=H.getLastNRange(this.selectedPeriod,2,this.dateValue).startDate;return D(o)},selectedDateString:function(){if("range"===this.selectedPeriod){var e=this.startRangeDate,t=this.endRangeDate,n=V(e),r=V(t);return!xa(n)||!xa(r)||n>r?(window.$("#alert").find("h2").text(C("General_InvalidDateRange")),S.helper.modalConfirm("#alert",{}),null):"".concat(e,",").concat(t)}return D(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(e){e!==this.periodValue&&"range"!==e&&this.setPiwikPeriodAndDate(e,this.dateValue)},setPiwikPeriodAndDate:function(e,t){this.periodValue=e,this.selectedPeriod=e,this.dateValue=t;var n=D(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=Ee.hashParsed.value):(this.isLoadingNewPage=!0,n=Ee.parsed.value);var i=Object.assign({},n);delete i.comparePeriods,delete i.compareDates,Ee.updateLocation(Object.assign(Object.assign({},i),{},{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=Ee.parsed.value.date,t=Ee.parsed.value.period;this.periodValue=t,this.selectedPeriod=t,this.dateValue=null,this.startRangeDate=null,this.endRangeDate=null;try{m.parse(t,e)}catch(l){return}if("range"===t){var n=m.get(t).parse(e),r=n.getDateRange(),i=ja(r,2),o=i[0],a=i[1];this.dateValue=o,this.startRangeDate=D(o),this.endRangeDate=D(a)}else this.dateValue=V(e),this.setRangeStartEndFromPeriod(t,e)},setRangeStartEndFromPeriod:function(e,t){var n=m.parse(e,t).getDateRange();this.startRangeDate=D(n[0]<Ta?Ta:n[0]),this.endRangeDate=D(n[1]>Aa?Aa:n[1])},getPeriodDisplayText:function(e){return m.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{V(this.compareStartDate)}catch(e){return!1}try{V(this.compareEndDate)}catch(e){return!1}return!0}}});Ia.render=ga;var Ba=Ia,Ma=(Vt({component:Ba,scope:{periods:{angularJsBind:"<"}},directiveName:"piwikPeriodSelector"}),{class:"reportingMenu"}),La=["aria-label"],Fa=["onClick"],Ra={class:"hidden"},_a={role:"menu"},$a=["href","onClick","title"],Ha=["href","onClick"],Ua=["onClick"],qa=Object(o["createElementVNode"])("span",{class:"icon-help"},null,-1),Wa=[qa],Ja={id:"mobile-left-menu",class:"sidenav hide-on-large-only"},Ga={class:"collapsible collapsible-accordion"},za={class:"collapsible-header"},Ya={class:"collapsible-body"},Qa={key:0},Ka=["onClick","href"],Xa={key:1},Za=["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 el(e,t,n,r,i,a){var l=Object(o["resolveComponent"])("MenuItemsDropdown"),c=Object(o["resolveDirective"])("side-nav");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ma,[Object(o["createElementVNode"])("ul",{class:"navbar hide-on-med-and-down",role:"menu","aria-label":e.translate("CoreHome_MainNavigation")},[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.menu,(function(t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{class:Object(o["normalizeClass"])(["menuTab",{active:t.id===e.activeCategory}]),role:"menuitem",key:t.id},[Object(o["createElementVNode"])("a",{class:"item",tabindex:"5",href:"",onClick:Object(o["withModifiers"])((function(n){return e.loadCategory(t)}),["prevent"])},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])("menu-icon ".concat(t.icon?t.icon:"icon-arrow-right"))},null,2),Object(o["createTextVNode"])(Object(o["toDisplayString"])(t.name)+" ",1),Object(o["createElementVNode"])("span",Ra,Object(o["toDisplayString"])(e.translate("CoreHome_Menu")),1)],8,Fa),Object(o["createElementVNode"])("ul",_a,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(t.subcategories,(function(n){return Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{role:"menuitem",class:Object(o["normalizeClass"])({active:(n.id===e.displayedSubcategory||n.isGroup&&e.activeSubsubcategory===e.displayedSubcategory)&&t.id===e.displayedCategory}),key:n.id},[n.isGroup?(Object(o["openBlock"])(),Object(o["createBlock"])(l,{key:0,"show-search":!0,"menu-title":e.htmlEntities(n.name)},{default:Object(o["withCtx"])((function(){return[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(n.subcategories,(function(r){return Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{class:Object(o["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(o["toDisplayString"])(r.name),11,$a)})),128))]})),_:2},1032,["menu-title"])):Object(o["createCommentVNode"])("",!0),n.isGroup?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:1,href:"#?".concat(e.makeUrl(t,n)),class:"item",onClick:function(r){return e.loadSubcategory(t,n,r)}},Object(o["toDisplayString"])(n.name),9,Ha)),n.help?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:2,class:Object(o["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)}},Wa,10,Ua)):Object(o["createCommentVNode"])("",!0)],2)})),128))])],2)})),128))],8,La),Object(o["createElementVNode"])("ul",Ja,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.menu,(function(t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{class:"no-padding",key:t.id},[Object(o["withDirectives"])(Object(o["createElementVNode"])("ul",Ga,[Object(o["createElementVNode"])("li",null,[Object(o["createElementVNode"])("a",za,[Object(o["createElementVNode"])("i",{class:Object(o["normalizeClass"])(t.icon?t.icon:"icon-arrow-bottom")},null,2),Object(o["createTextVNode"])(Object(o["toDisplayString"])(t.name),1)]),Object(o["createElementVNode"])("div",Ya,[Object(o["createElementVNode"])("ul",null,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(t.subcategories,(function(n){return Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{key:n.id},[n.isGroup?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",Qa,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(n.subcategories,(function(n){return Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{onClick:function(r){return e.loadSubcategory(t,n)},href:"#?".concat(e.makeUrl(t,n)),key:n.id},Object(o["toDisplayString"])(n.name),9,Ka)})),128))])):Object(o["createCommentVNode"])("",!0),n.isGroup?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",Xa,[Object(o["createElementVNode"])("a",{onClick:function(r){return e.loadSubcategory(t,n)},href:"#?".concat(e.makeUrl(t,n))},Object(o["toDisplayString"])(n.name),9,Za)]))])})),128))])])])],512),[[c,{activator:e.sideNavActivator}]])])})),128))])])}var tl={key:0},nl=["data-notification-instance-id"],rl={key:1},il={class:"notification-body"},ol=["innerHTML"],al={key:1};function ll(e,t,n,r,i,a){return Object(o["openBlock"])(),Object(o["createBlock"])(o["Transition"],{name:"toast"===e.type?"slow-fade-out":void 0,onAfterLeave:t[1]||(t[1]=function(t){return e.toastClosed()})},{default:Object(o["withCtx"])((function(){return[e.deleted?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",tl,[Object(o["createVNode"])(o["Transition"],{name:"toast"===e.type?"toast-slide-up":void 0,appear:""},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(o["Transition"],{name:e.animate?"fade-in":void 0,appear:""},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("div",{class:Object(o["normalizeClass"])(["notification system",e.cssClasses]),style:Object(o["normalizeStyle"])(e.style),ref:"root","data-notification-instance-id":e.notificationInstanceId},[e.canClose?(Object(o["openBlock"])(),Object(o["createElementBlock"])("button",{key:0,type:"button",class:"close","data-dismiss":"alert",onClick:t[0]||(t[0]=function(t){return e.closeNotification(t)})}," × ")):Object(o["createCommentVNode"])("",!0),e.title?(Object(o["openBlock"])(),Object(o["createElementBlock"])("strong",rl,Object(o["toDisplayString"])(e.title),1)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",il,[e.message?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:0,innerHTML:e.$sanitize(e.message)},null,8,ol)):Object(o["createCommentVNode"])("",!0),e.message?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",al,[Object(o["renderSlot"])(e.$slots,"default")]))])],14,nl)]})),_:3},8,["name"])])]})),_:3},8,["name"])]))]})),_:3},8,["name"])}var cl=window,sl=cl.$,ul=Object(o["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&&sl(this.$refs.root).css(this.style)},methods:{toastClosed:function(){var e=this;Object(o["nextTick"])((function(){e.$emit("closed")}))},closeNotification:function(e){var t=this;this.canClose&&e&&e.target&&(this.deleted=!0,Object(o["nextTick"])((function(){t.$emit("closed")}))),this.markNotificationAsRead()},markNotificationAsRead:function(){this.notificationId&&Ze.post({module:"CoreHome",action:"markNotificationAsRead"},{notificationId:this.notificationId},{withTokenInUrl:!0})}}});ul.render=ll;var dl=ul; -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */Vt({component:dl,scope:{notificationId:{angularJsBind:"@?"},title:{angularJsBind:"@?notificationTitle"},context:{angularJsBind:"@?"},type:{angularJsBind:"@?"},noclear:{angularJsBind:"@?",transform:Nt},toastLength:{angularJsBind:"@?"}},directiveName:"piwikNotification",transclude:!0});function ml(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function fl(e,t,n){return t&&pl(e.prototype,t),n&&pl(e,n),e}function hl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var gl=window,vl=gl.$,bl=function(){function e(){ml(this,e),hl(this,"privateState",Object(o["reactive"])({notifications:[]})),hl(this,"nextNotificationId",0)}return fl(e,[{key:"state",get:function(){return Object(o["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=vl('[data-role="notification"]'),n=[];t.each((function(e,r){var i=vl(r),o=i.data(),a=i.html();a&&n.push(Object.assign(Object.assign({},o),{},{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",i=document.querySelector(r);i&&(i.querySelector("#modalNotificationContainer")||vl(i).prepend('<div id="modalNotificationContainer"/>'),n="".concat(r," #modalNotificationContainer"),t=this.prependNotification)}var o=e.group||(n?n.toString():"");this.initializeNotificationContainer(n,o);var a=(this.nextNotificationId+=1).toString();return t.call(this,Object.assign(Object.assign({},e),{},{noclear:!!e.noclear,group:o,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?vl(e.placeat):void 0;if(!t||!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=dt({render:function(){return Object(o["createVNode"])(dl,Object.assign(Object.assign({},e),{},{notificationId:e.id,type:"toast",onClosed:function(){r.unmount()}}))}});r.mount(n)}},{key:"initializeNotificationContainer",value:function(e,t){if(e){var n=vl(e);if(!n.children(".notification-group").length){var r=window.CoreHome.NotificationGroup,i=dt({template:'<NotificationGroup :group="group"></NotificationGroup>',data:function(){return{group:t}}});i.component("NotificationGroup",r),i.mount(n[0])}}}},{key:"checkMessage",value:function(e){if(!e)throw new Error("No message given, cannot display notification")}}]),e}(),yl=new bl,wl=yl;vl((function(){return yl.parseNotificationDivs()})), +function Mt(e,t,n){var r=t.value.isMouseDown&&t.value.hasScrolled;t.value.isMouseDown=!1,t.value.hasScrolled=!1,r||e.contains(n.target)||t.value&&t.value.blur()}function _t(e,t){t.value.hasScrolled=!0}function Ft(e,t){t.value.isMouseDown=!0,t.value.hasScrolled=!1}function Rt(e,t,n){27===n.which&&setTimeout((function(){t.value.isMouseDown=!1,t.value.hasScrolled=!1,t.value.blur&&t.value.blur()}),0)}var Ht=document.documentElement,Ut={mounted:function(e,t){t.value.isMouseDown=!1,t.value.hasScrolled=!1,t.value.onEscapeHandler=Rt.bind(null,e,t),t.value.onMouseDown=Ft.bind(null,e,t),t.value.onClickOutsideElement=Mt.bind(null,e,t),t.value.onScroll=_t.bind(null,e,t),Ht.addEventListener("keyup",t.value.onEscapeHandler),Ht.addEventListener("mousedown",t.value.onMouseDown),Ht.addEventListener("mouseup",t.value.onClickOutsideElement),Ht.addEventListener("scroll",t.value.onScroll)},unmounted:function(e,t){Ht.removeEventListener("keyup",t.value.onEscapeHandler),Ht.removeEventListener("mousedown",t.value.onMouseDown),Ht.removeEventListener("mouseup",t.value.onClickOutsideElement),Ht.removeEventListener("scroll",t.value.onScroll)}}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -window.angular.module("piwikApp").factory("notifications",(function(){return wl}));var Ol={class:"notification-group"},jl=["innerHTML"];function kl(e,t,n,r,i,a){var l=Object(o["resolveComponent"])("Notification");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ol,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.notifications,(function(t,n){return Object(o["openBlock"])(),Object(o["createBlock"])(l,{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(o["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(o["withCtx"])((function(){return[Object(o["createElementVNode"])("div",{innerHTML:e.$sanitize(t.message)},null,8,jl)]})),_:2},1032,["notification-id","title","context","type","noclear","toast-length","style","animate","message","notification-instance-id","css-class","onClosed"])})),128))])}var Sl=Object(o["defineComponent"])({props:{group:String},components:{Notification:dl},computed:{notifications:function(){var e=this;return wl.state.notifications.filter((function(t){return e.group?e.group===t.group:!t.group}))}},methods:{removeNotification:function(e){wl.remove(e)}}});Sl.render=kl;var Cl=Sl; +function $t(e,t){t.arg&&setTimeout((function(){e.focus(),t.value.afterFocus&&t.value.afterFocus()}),5)}var qt={mounted:function(e,t){$t(e,t)},updated:function(e,t){$t(e,t)}},Wt=window,zt=Wt.$; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function El(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Pl(e,t,n){return t&&Dl(e.prototype,t),n&&Dl(e,n),e}function Vl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} + */function Gt(){var e=zt(this).attr("title")||"";return window.vueSanitize(e.replace(/\n/g,"<br />"))}function Yt(e,t){var n,r,o,a,i,l;zt(e).tooltip({track:!0,content:(null===(n=t.value)||void 0===n?void 0:n.content)||Gt,show:"undefined"!==typeof(null===(r=t.value)||void 0===r?void 0:r.show)?null===(o=t.value)||void 0===o?void 0:o.show:{delay:(null===(a=t.value)||void 0===a?void 0:a.delay)||700,duration:(null===(i=t.value)||void 0===i?void 0:i.duration)||200},hide:!1,tooltipClass:null===(l=t.value)||void 0===l?void 0:l.tooltipClass})}var Jt={mounted:function(e,t){setTimeout((function(){return Yt(e,t)}))},updated:function(e,t){setTimeout((function(){return Yt(e,t)}))},beforeUnmount:function(e){try{window.$(e).tooltip("destroy")}catch(t){}}},Kt={ref:"root"};function Qt(e,t,n,r,o,a){return Object(K["withDirectives"])((Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Kt,[Object(K["renderSlot"])(e.$slots,"default")],512)),[[K["vShow"],e.modelValue]])}var Xt=Object(K["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;ce.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")}}});Xt.render=Qt;var Zt=Xt; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var Nl=function(){function e(){var t=this;El(this,e),Vl(this,"privateState",Object(o["reactive"])({pages:[]})),Vl(this,"state",Object(o["computed"])((function(){return Object(o["readonly"])(t.privateState)}))),Vl(this,"fetchAllPagesPromise",void 0),Vl(this,"pages",Object(o["computed"])((function(){return t.state.value.pages})))}return Pl(e,[{key:"findPageInCategory",value:function(e){return this.pages.value.find((function(t){return t&&t.category&&t.category.id===e&&t.subcategory&&t.subcategory.id}))}},{key:"findPage",value:function(e,t){return this.pages.value.find((function(n){return n&&n.category&&n.subcategory&&n.category.id===e&&"".concat(n.subcategory.id)===t}))}},{key:"reloadAllPages",value:function(){return delete this.fetchAllPagesPromise,this.getAllPages()}},{key:"getAllPages",value:function(){var e=this;return this.fetchAllPagesPromise||(this.fetchAllPagesPromise=Ze.fetch({method:"API.getReportPagesMetadata",filter_limit:"-1"}).then((function(t){return e.privateState.pages=t,e.pages.value}))),this.fetchAllPagesPromise.then((function(){return e.pages.value}))}}]),e}(),Tl=new Nl;function Al(e){return Ml(e)||Bl(e)||Il(e)||xl()}function xl(){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 Il(e,t){if(e){if("string"===typeof e)return Ll(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)?Ll(e,t):void 0}}function Bl(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Ml(e){if(Array.isArray(e))return Ll(e)}function Ll(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r} -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Fl(e){var t=Al(e||[]);return t.sort((function(e,t){return e.order<t.order?-1:e.order>t.order?1:0})),t} -/*! - * 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(e){var t=e;return t.subcategories?t.subcategories:[]} -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function _l(e){var t=e;return t.subcategories?t.subcategories:[]}function $l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ul(e,t,n){return t&&Hl(e.prototype,t),n&&Hl(e,n),e}function ql(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,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 Wl(e){var t=parseFloat(e);return!Number.isNaN(t)&&Number.isFinite(t)}var Jl=function(){function e(){var t=this;$l(this,e),ql(this,"privateState",Object(o["reactive"])({activeSubcategoryId:null,activeSubsubcategoryId:null})),ql(this,"state",Object(o["computed"])((function(){return Object(o["readonly"])(t.privateState)}))),ql(this,"activeCategory",Object(o["computed"])((function(){return"undefined"!==typeof t.state.value.activeCategoryId?t.state.value.activeCategoryId:Ee.parsed.value.category}))),ql(this,"activeSubcategory",Object(o["computed"])((function(){return t.state.value.activeSubcategoryId||Ee.parsed.value.subcategory}))),ql(this,"activeSubsubcategory",Object(o["computed"])((function(){var e=t.state.value.activeSubsubcategoryId;if(e)return e;var n=t.findSubcategory(t.activeCategory.value,t.activeSubcategory.value);return n.subsubcategory&&n.subsubcategory.id===t.activeSubcategory.value?n.subsubcategory.id:null}))),ql(this,"menu",Object(o["computed"])((function(){return t.buildMenuFromPages()})))}return Ul(e,[{key:"fetchMenuItems",value:function(){var e=this;return Tl.getAllPages().then((function(){return e.menu.value}))}},{key:"reloadMenuItems",value:function(){var e=this;return Tl.reloadAllPages().then((function(){return e.menu.value}))}},{key:"findSubcategory",value:function(e,t){var n=void 0,r=void 0,i=void 0;return this.menu.value.forEach((function(o){o.id===e&&(Rl(o)||[]).forEach((function(e){e.id===t&&(n=o,r=e),e.isGroup&&(_l(e)||[]).forEach((function(a){a.id===t&&(n=o,r=e,i=a)}))}))})),{category:n,subcategory:r,subsubcategory:i}}},{key:"buildMenuFromPages",value:function(){var e=[],t=Ee.parsed.value.category,n=Ee.parsed.value.subcategory,r=Tl.pages.value,i={};return r.forEach((function(o){var a=Object.assign({},o.category),l=a.id,c=l===t;if(!i[l]){i[l]=!0,a.subcategories=[];var s=null,u=r.filter((function(e){return e.category.id===l}));u.forEach((function(e){var t=Object.assign({},e.subcategory),r=t.id===n&&c;if(e.widgets&&e.widgets[0]&&Wl(e.subcategory.id)){s||(s=Object.assign({},t),s.name=C("CoreHome_ChooseX",[a.name]),s.isGroup=!0,s.subcategories=[],s.order=10),r&&(s.name=t.name);var i=t.id;return t.tooltip="".concat(t.name," (id = ").concat(i,")"),void s.subcategories.push(t)}a.subcategories.push(t)})),s&&s.subcategories&&s.subcategories.length<=5?s.subcategories.forEach((function(e){return a.subcategories.push(e)})):s&&a.subcategories.push(s),a.subcategories=Fl(Rl(a)),e.push(a)}})),Fl(e)}},{key:"toggleCategory",value:function(e){return this.privateState.activeSubcategoryId=null,this.privateState.activeSubsubcategoryId=null,this.activeCategory.value===e.id?(this.privateState.activeCategoryId=null,!1):(this.privateState.activeCategoryId=e.id,!0)}},{key:"enterSubcategory",value:function(e,t,n){e&&t&&(this.privateState.activeCategoryId=e.id,this.privateState.activeSubcategoryId=t.id,n&&(this.privateState.activeSubsubcategoryId=n.id))}}]),e}(),Gl=new Jl;function zl(e){return zl="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zl(e)}function Yl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ql(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Kl(e,t,n){return t&&Ql(e.prototype,t),n&&Ql(e,n),e}function Xl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,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 Zl(e){var t=e;return t.widgets?t.widgets:[]}var ec=function(){function e(){var t=this;Yl(this,e),Xl(this,"privateState",Object(o["reactive"])({isFetchedFirstTime:!1,categorizedWidgets:{}})),Xl(this,"state",Object(o["computed"])((function(){return t.privateState.isFetchedFirstTime||t.fetchAvailableWidgets(),Object(o["readonly"])(t.privateState)}))),Xl(this,"widgets",Object(o["computed"])((function(){return t.state.value.categorizedWidgets})))}return Kl(e,[{key:"fetchAvailableWidgets",value:function(){var e=this;return Ee.parsed.value.idSite?(this.privateState.isFetchedFirstTime=!0,new Promise((function(t,n){try{window.widgetsHelper.getAvailableWidgets((function(n){var r=n;e.privateState.categorizedWidgets=r,t(e.widgets.value)}))}catch(r){n(r)}}))):Promise.resolve(this.widgets.value)}},{key:"reloadAvailableWidgets",value:function(){return"object"===zl(window.widgetsHelper)&&window.widgetsHelper.availableWidgets&&delete window.widgetsHelper.availableWidgets,this.fetchAvailableWidgets()}}]),e}(),tc=new ec,nc="reportingmenu-help",rc=Object(o["defineComponent"])({components:{MenuItemsDropdown:ai},directives:{SideNav:En},props:{},data:function(){return{showSubcategoryHelpOnLoad:null,initialLoad:!0,helpShownCategory:null}},computed:{sideNavActivator:function(){return document.querySelector("nav .activateLeftMenu")},menu:function(){return Gl.menu.value},activeCategory:function(){return Gl.activeCategory.value},activeSubcategory:function(){return Gl.activeSubcategory.value},activeSubsubcategory:function(){return Gl.activeSubsubcategory.value},displayedCategory:function(){return Ee.parsed.value.category},displayedSubcategory:function(){return Ee.parsed.value.subcategory}},created:function(){var e=this;Gl.fetchMenuItems().then((function(t){if(!Ee.parsed.value.subcategory){var n=t[0],r=n.subcategories[0];Gl.enterSubcategory(n,r),e.propagateUrlChange(n,r)}})),Object(o["watch"])((function(){return Ee.parsed.value}),(function(e){var t=Gl.findSubcategory(e.category,e.subcategory);Gl.enterSubcategory(t.category,t.subcategory,t.subsubcategory)})),S.on("matomoPageChange",(function(){e.initialLoad||window.globalAjaxQueue.abort(),e.helpShownCategory=null,e.showSubcategoryHelpOnLoad&&(e.showHelp(e.showSubcategoryHelpOnLoad.category,e.showSubcategoryHelpOnLoad.subcategory),e.showSubcategoryHelpOnLoad=null),window.$("#loadingError,#loadingRateLimitError").hide(),e.initialLoad=!1})),S.on("updateReportingMenu",(function(){Gl.reloadMenuItems().then((function(){var e=Ee.parsed.value.category,t=Ee.parsed.value.subcategory;if(e&&t){var n=Gl.findSubcategory(e,t);n.category&&Gl.enterSubcategory(n.category,n.subcategory,n.subsubcategory)}})),tc.reloadAvailableWidgets()}))},methods:{propagateUrlChange:function(e,t){var n=Ee.parsed.value;n.category===e.id&&n.subcategory===t.id?this.loadSubcategory(e,t):Ee.updateHash(Object.assign(Object.assign({},Ee.hashParsed.value),{},{category:e.id,subcategory:t.id}))},loadCategory:function(e){wl.remove(nc);var t=Gl.toggleCategory(e);if(t&&e.subcategories&&1===e.subcategories.length){this.helpShownCategory=null;var n=e.subcategories[0];this.propagateUrlChange(e,n)}},loadSubcategory:function(e,t,n){n&&(n.shiftKey||n.ctrlKey||n.metaKey)||(wl.remove(nc),t&&t.id===this.activeSubcategory&&(this.helpShownCategory=null,setTimeout((function(){S.postEvent("loadPage",e.id,t.id)}))))},makeUrl:function(e,t){var n=Ee.parsed.value,r=n.idSite,i=n.period,o=n.date,a=n.segment,l=n.comparePeriods,c=n.compareDates,s=n.compareSegments;return Ee.stringify({idSite:r,period:i,date:o,segment:a,comparePeriods:l,compareDates:c,compareSegments:s,category:e.id,subcategory:t.id})},htmlEntities:function(e){return S.helper.htmlEntities(e)},showHelp:function(e,t,n){var r=Ee.parsed.value,i=r.category,o=r.subcategory;if((i!==e.id||o!==t.id)&&n)return this.showSubcategoryHelpOnLoad={category:e,subcategory:t},void Ee.updateHash(Object.assign(Object.assign({},Ee.hashParsed.value),{},{category:e.id,subcategory:t.id}));if(this.helpShownCategory&&e.id===this.helpShownCategory.category&&t.id===this.helpShownCategory.subcategory)return wl.remove(nc),void(this.helpShownCategory=null);var a=C("CoreHome_ReportingCategoryHelpPrefix",e.name,t.name),l="<strong>".concat(a,"</strong><br/>");wl.show({context:"info",id:nc,type:"help",noclear:!0,class:"help-notification",message:l+t.help,placeat:"#notificationContainer",prepend:!0}),this.helpShownCategory={category:e.id,subcategory:t.id}}}});rc.render=el;var ic=rc; -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */Vt({component:ic,directiveName:"piwikReportingMenu"}); + */function en(e){e.classList.toggle("expanded");var t=e.querySelector(".dropdown.positionInViewport");t&&ce.helper.setMarginLeftToBeInViewport(t)}function tn(e,t,n){var r,o=t.value.isMouseDown&&t.value.hasScrolled;(t.value.isMouseDown=!1,t.value.hasScrolled=!1,o)||(e.contains(n.target)||(e.classList.remove("expanded"),null!==(r=t.value)&&void 0!==r&&r.onClosed&&t.value.onClosed()))}function nn(e){e.value.hasScrolled=!0}function rn(e){e.value.isMouseDown=!0,e.value.hasScrolled=!1}function on(e,t,n){27===n.which&&(t.value.isMouseDown=!1,t.value.hasScrolled=!1,e.classList.remove("expanded"))}var an=document.documentElement,ln=window,cn=ln.$,sn={mounted:function(e,t){t.value.isMouseDown=!1,t.value.hasScrolled=!1,t.value.onExpand=en.bind(null,e),t.value.onEscapeHandler=on.bind(null,e,t),t.value.onMouseDown=rn.bind(null,t),t.value.onClickOutsideElement=tn.bind(null,e,t),t.value.onScroll=nn.bind(null,t),setTimeout((function(){var e=bt.getRef(t.value.expander,t);e&&cn(e).on("click",t.value.onExpand)})),an.addEventListener("keyup",t.value.onEscapeHandler),an.addEventListener("mousedown",t.value.onMouseDown),an.addEventListener("mouseup",t.value.onClickOutsideElement),an.addEventListener("scroll",t.value.onScroll)},unmounted:function(e,t){var n=bt.getRef(t.value.expander,t);n&&cn(n).off("click",t.value.onExpand),an.removeEventListener("keyup",t.value.onEscapeHandler),an.removeEventListener("mousedown",t.value.onMouseDown),an.removeEventListener("mouseup",t.value.onClickOutsideElement),an.removeEventListener("scroll",t.value.onScroll)}}; /*! * 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){return e.forEach((function(e){e.id===Gl.activeCategory.value&&(e.active=!0,(e.subcategories||[]).forEach((function(e){e.id===Gl.activeSubcategory.value&&(e.active=!0,(e.subcategories||[]).forEach((function(e){e.id===Gl.activeSubsubcategory.value&&(e.active=!0)})))})))})),e}function ac(){return{get menu(){return Gl.menu.value},findSubcategory:Gl.findSubcategory.bind(Gl),reloadMenuItems:function(){return Gl.reloadMenuItems().then((function(e){return oc(xt(e))}))},fetchMenuItems:function(){return Gl.fetchMenuItems().then((function(e){return oc(xt(e))}))}}} +function un(e){e.classList.add("expanded");var t=e.querySelector(".dropdown.positionInViewport");t&&ce.helper.setMarginLeftToBeInViewport(t)}function dn(e){e.classList.remove("expanded")}function mn(e,t){e.contains(t.target)||e.classList.remove("expanded")}function pn(e,t){27===t.which&&e.classList.remove("expanded")}var fn=document.documentElement,hn={mounted:function(e,t){t.value.onMouseEnter=un.bind(null,e),t.value.onMouseLeave=dn.bind(null,e),t.value.onClickOutsideElement=mn.bind(null,e),t.value.onEscapeHandler=pn.bind(null,e),setTimeout((function(){var e=bt.getRef(t.value.expander,t);e&&e.addEventListener("mouseenter",t.value.onMouseEnter)})),e.addEventListener("mouseleave",t.value.onMouseLeave),fn.addEventListener("keyup",t.value.onEscapeHandler),fn.addEventListener("mouseup",t.value.onClickOutsideElement)},unmounted:function(e,t){var n=bt.getRef(t.value.expander,t);n&&n.removeEventListener("mouseenter",t.value.onMouseEnter),e.removeEventListener("mouseleave",t.value.onMouseLeave),document.removeEventListener("keyup",t.value.onEscapeHandler),document.removeEventListener("mouseup",t.value.onClickOutsideElement)}},bn=window,gn=bn.$,vn={mounted:function(e,t){var n=gn(e),r=t.value.sensitiveData,o=t.value.showCharacters||6,i=t.value.clickElementSelector||n,l="";function c(){n.html(r),gn(i).css({cursor:""}),gn(i).tooltip("destroy")}o>0&&(l+=r.slice(0,o)),l+=r.slice(o).replace(/./g,"*"),n.html(l),gn(i).tooltip({content:a("CoreHome_ClickToSeeFullInformation"),items:"*",track:!0}),gn(i).one("click",c),gn(i).css({cursor:"pointer"})}},yn=window,On=yn.$,jn={mounted:function(e){var t=On(e);!t.attr("data-target")&&t.attr("data-activates")&&t.attr("data-target",t.attr("data-activates"));var n=t.attr("data-target");n&&On("#".concat(n)).length&&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 lc(){return{get pages(){return Tl.pages.value},findPageInCategory:function(){return At(Tl.findPageInCategory.apply(Tl,arguments))},findPage:function(){return At(Tl.findPage.apply(Tl,arguments))},reloadAllPages:function(){return Tl.reloadAllPages().then((function(e){return xt(e)}))},getAllPages:function(){return Tl.getAllPages().then((function(e){return xt(e)}))}}}function cc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function uc(e,t,n){return t&&sc(e.prototype,t),n&&sc(e,n),e}function dc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} +function wn(e,t){e.value.focusedElement!==t.target&&(e.value.focusedElement=t.target,window.angular.element(t.target).select())}function kn(e){var t=document.createRange();t.selectNode(e.target);var n=window.getSelection();n&&n.rangeCount>0&&n.removeAllRanges(),n&&n.addRange(t)}function Sn(e){delete e.value.focusedElement}var Cn={mounted:function(e,t){var n=e.tagName.toLowerCase();t.value.elementSupportsSelect="textarea"===n,t.value.elementSupportsSelect?(t.value.onFocusHandler=wn.bind(null,t),t.value.onBlurHandler=Sn.bind(null,t),e.addEventListener("focus",t.value.onFocusHandler),e.addEventListener("blur",t.value.onBlurHandler)):(t.value.onClickHandler=kn,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)}},En={mounted:function(e,t){t.value.activator&&setTimeout((function(){if(!t.value.initialized){t.value.initialized=!0;var n=bt.getRef(t.value.activator,t);if(n){window.$(n).show();var r=n.getAttribute("data-target");window.$("#".concat(r)).sidenav({closeOnClick:!0})}}e.classList.contains("collapsible")&&window.$(e).collapsible()}))}},Dn={key:0,class:"title",tabindex:"6"},Pn=["href","title"],Tn={class:"iconsBar"},Vn=["href","title"],Nn=Object(K["createElementVNode"])("span",{class:"icon-help"},null,-1),In=[Nn],xn=["title"],Bn=Object(K["createElementVNode"])("span",{class:"icon-info"},null,-1),An=[Bn],Ln={class:"ratingIcons"},Mn={class:"inlineHelp"},_n=["innerHTML"],Fn=["innerHTML"],Rn=["href"]; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */window.angular.module("piwikApp.service").factory("reportingMenuModel",ac),window.angular.module("piwikApp.service").factory("reportingPagesModel",lc);var mc=function(){function e(){var t=this;cc(this,e),dc(this,"privateState",Object(o["reactive"])({reports:[]})),dc(this,"state",Object(o["readonly"])(this.privateState)),dc(this,"reports",Object(o["computed"])((function(){return t.state.reports}))),dc(this,"reportsPromise",void 0)}return uc(e,[{key:"findReport",value:function(e,t){return this.reports.value.find((function(n){return n.module===e&&n.action===t}))}},{key:"fetchReportMetadata",value:function(){var e=this;return this.reportsPromise||(this.reportsPromise=Ze.fetch({method:"API.getReportMetadata",filter_limit:"-1",idSite:S.idSite||Ee.parsed.value.idSite}).then((function(t){return e.privateState.reports=t,t}))),this.reportsPromise.then((function(){return e.reports.value}))}}]),e}(),pc=new mc; + */function Hn(e,t,n,r,o,a){var i=Object(K["resolveComponent"])("RateFeature");return Object(K["openBlock"])(),Object(K["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(K["createCommentVNode"])("",!0):(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Dn,[Object(K["renderSlot"])(e.$slots,"default")])),e.editUrl?(Object(K["openBlock"])(),Object(K["createElementBlock"])("a",{key:1,class:"title",href:e.editUrl,title:e.translate("CoreHome_ClickToEditX",e.htmlEntities(e.actualFeatureName))},[Object(K["renderSlot"])(e.$slots,"default")],8,Pn)):Object(K["createCommentVNode"])("",!0),Object(K["withDirectives"])(Object(K["createElementVNode"])("span",Tn,[e.helpUrl&&!e.actualInlineHelp?(Object(K["openBlock"])(),Object(K["createElementBlock"])("a",{key:0,rel:"noreferrer noopener",target:"_blank",class:"helpIcon",href:e.helpUrl,title:e.translate("CoreHome_ExternalHelp")},In,8,Vn)):Object(K["createCommentVNode"])("",!0),e.actualInlineHelp?(Object(K["openBlock"])(),Object(K["createElementBlock"])("a",{key:1,onClick:t[0]||(t[0]=function(t){return e.showInlineHelp=!e.showInlineHelp}),class:Object(K["normalizeClass"])(["helpIcon",{active:e.showInlineHelp}]),title:e.translate(e.reportGenerated?"General_HelpReport":"General_Help")},An,10,xn)):Object(K["createCommentVNode"])("",!0),Object(K["createElementVNode"])("div",Ln,[Object(K["createVNode"])(i,{title:e.actualFeatureName},null,8,["title"])])],512),[[K["vShow"],e.showIcons||e.showInlineHelp]]),Object(K["withDirectives"])(Object(K["createElementVNode"])("div",Mn,[Object(K["createElementVNode"])("div",{innerHTML:e.$sanitize(e.actualInlineHelp)},null,8,_n),""!=e.reportGenerated?(Object(K["openBlock"])(),Object(K["createElementBlock"])("span",{key:0,class:"helpDate",innerHTML:e.$sanitize(e.reportGenerated)},null,8,Fn)):Object(K["createCommentVNode"])("",!0),e.helpUrl?(Object(K["openBlock"])(),Object(K["createElementBlock"])("a",{key:1,rel:"noreferrer noopener",target:"_blank",class:"readMore",href:e.helpUrl},Object(K["toDisplayString"])(e.translate("General_MoreDetails")),9,Rn)):Object(K["createCommentVNode"])("",!0)],512),[[K["vShow"],e.showInlineHelp]])],544)}var Un=ft("Feedback","RateFeature"),$n=Object(K["defineComponent"])({props:{helpUrl:{type:String,default:""},editUrl:{type:String,default:""},reportGenerated:String,featureName:String,inlineHelp:String},components:{RateFeature:Un},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,t=this.$refs.root;if(!this.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,a=null===(o=r.getAttribute("data-content"))||void 0===o?void 0:o.trim();a&&a.length&&(this.actualInlineHelp="<p>".concat(a,"</p>"),setTimeout((function(){return r.remove()}),0))}}this.actualFeatureName||(this.actualFeatureName=null===(e=t.querySelector(".title"))||void 0===e?void 0:e.textContent);if(ce.period&&ce.currentDateString){var i=m.parse(ce.period,ce.currentDateString);this.reportGenerated&&i.containsToday()&&window.$(t.querySelector(".report-generated")).tooltip({track:!0,content:this.reportGenerated,items:"div",show:!1,hide:!1})}},methods:{htmlEntities:function(e){return ce.helper.htmlEntities(e)}}});$n.render=Hn;var qn=$n,Wn={class:"card",ref:"root"},zn={class:"card-content"},Gn={key:0,class:"card-title"},Yn={key:1,class:"card-title"},Jn={ref:"content"};function Kn(e,t,n,r,o,a){var i=Object(K["resolveComponent"])("EnrichedHeadline");return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Wn,[Object(K["createElementVNode"])("div",zn,[!e.contentTitle||e.actualFeature||e.helpUrl||e.actualHelpText?Object(K["createCommentVNode"])("",!0):(Object(K["openBlock"])(),Object(K["createElementBlock"])("h2",Gn,Object(K["toDisplayString"])(e.decode(e.contentTitle)),1)),e.contentTitle&&(e.actualFeature||e.helpUrl||e.actualHelpText)?(Object(K["openBlock"])(),Object(K["createElementBlock"])("h2",Yn,[Object(K["createVNode"])(i,{"feature-name":e.actualFeature,"help-url":e.helpUrl,"inline-help":e.actualHelpText},{default:Object(K["withCtx"])((function(){return[Object(K["createTextVNode"])(Object(K["toDisplayString"])(e.decode(e.contentTitle)),1)]})),_:1},8,["feature-name","help-url","inline-help"])])):Object(K["createCommentVNode"])("",!0),Object(K["createElementVNode"])("div",Jn,[Object(K["renderSlot"])(e.$slots,"default")],512)])],512)}var Qn=null,Xn=window,Zn=Xn.$,er=Object(K["defineComponent"])({props:{contentTitle:String,feature:String,helpUrl:String,helpText:String,anchor:String},components:{EnrichedHeadline:qn},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=this,t=this.$refs.root,n=this.$refs.content;if(this.anchor&&t&&t.parentElement){var r=document.createElement("a");r.id=this.anchor,Zn(t.parentElement).prepend(r)}setTimeout((function(){var t=n.querySelector(".contentHelp");t&&(e.actualHelpText=t.innerHTML,t.remove())}),0),this.actualFeature&&"true"===this.actualFeature&&(this.actualFeature=this.contentTitle),null===Qn&&(Qn=document.querySelector("#content.admin"));var o=null;if(Qn&&(o=Qn.offsetTop),o||0===o){var a=t.closest(".widgetLoader"),i=a?a.offsetTop:t.offsetTop;i-o<17&&(t.style.marginTop="0")}},methods:{decode:function(e){return ce.helper.htmlDecode(e)}}});er.render=Kn;var tr=er,nr={key:0,ref:"root",class:"matomo-comparisons"},rr={class:"comparison-type"},or=["title"],ar=["href"],ir=["title"],lr={class:"comparison-period-label"},cr=["onClick"],sr=["title"],ur={class:"loadingPiwik",style:{display:"none"}},dr=["alt"];function mr(e,t,n,r,o,a){var i=Object(K["resolveDirective"])("tooltips");return e.isComparing?Object(K["withDirectives"])((Object(K["openBlock"])(),Object(K["createElementBlock"])("div",nr,[Object(K["createElementVNode"])("h3",null,Object(K["toDisplayString"])(e.translate("General_Comparisons")),1),(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(e.segmentComparisons,(function(t,n){return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",{class:"comparison card",key:t.index},[Object(K["createElementVNode"])("div",rr,Object(K["toDisplayString"])(e.translate("General_Segment")),1),Object(K["createElementVNode"])("div",{class:"title",title:t.title+"<br/>"+decodeURIComponent(t.params.segment)},[Object(K["createElementVNode"])("a",{target:"_blank",href:e.getUrlToSegment(t.params.segment)},Object(K["toDisplayString"])(t.title),9,ar)],8,or),(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(e.periodComparisons,(function(n){return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",{class:"comparison-period",key:n.index,title:e.getComparisonTooltip(t,n)},[Object(K["createElementVNode"])("span",{class:"comparison-dot",style:Object(K["normalizeStyle"])({"background-color":e.getSeriesColor(t,n)})},null,4),Object(K["createElementVNode"])("span",lr,Object(K["toDisplayString"])(n.title)+" ("+Object(K["toDisplayString"])(e.getComparisonPeriodType(n))+") ",1)],8,ir)})),128)),e.segmentComparisons.length>1?(Object(K["openBlock"])(),Object(K["createElementBlock"])("a",{key:0,class:"remove-button",onClick:function(t){return e.removeSegmentComparison(n)}},[Object(K["createElementVNode"])("span",{class:"icon icon-close",title:e.translate("General_ClickToRemoveComp")},null,8,sr)],8,cr)):Object(K["createCommentVNode"])("",!0)])})),128)),Object(K["createElementVNode"])("div",ur,[Object(K["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:e.translate("General_LoadingData")},null,8,dr),Object(K["createTextVNode"])(" "+Object(K["toDisplayString"])(e.translate("General_LoadingData")),1)])],512)),[[i,{duration:200,delay:200,content:e.transformTooltipContent}]]):Object(K["createCommentVNode"])("",!0)}function pr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function hr(e,t,n){return t&&fr(e.prototype,t),n&&fr(e,n),e}function br(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -window.angular.module("piwikApp.service").factory("reportMetadataModel",(function(){return{get reports(){return pc.reports.value},findReport:pc.findReport.bind(pc),fetchReportMetadata:function(){return pc.fetchReportMetadata().then((function(e){return xt(e)}))}}}));var fc={class:"widgetLoader"},hc={key:0},gc={key:1,class:"notification system notification-error"},vc={key:0,rel:"noreferrer noopener",target:"_blank",href:"https://matomo.org/faq/troubleshooting/faq_19489/"},bc={key:2,class:"notification system notification-error"},yc={class:"theWidgetContent",ref:"widgetContent"};function wc(e,t,n,r,i,a){var l=Object(o["resolveComponent"])("ActivityIndicator");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",fc,[Object(o["createVNode"])(l,{"loading-message":e.loadingMessage,loading:e.loading},null,8,["loading-message","loading"]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[e.widgetName?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h2",hc,Object(o["toDisplayString"])(e.widgetName),1)):Object(o["createCommentVNode"])("",!0),e.loadingFailedRateLimit?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",bc,Object(o["toDisplayString"])(e.translate("General_ErrorRateLimit")),1)):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",gc,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_ErrorRequest","",""))+" ",1),e.hasErrorFaqLink?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",vc,Object(o["toDisplayString"])(e.translate("General_ErrorRequestFaqLink")),1)):Object(o["createCommentVNode"])("",!0)]))],512),[[o["vShow"],e.loadingFailed]]),Object(o["createElementVNode"])("div",yc,null,512)])}var Oc=Object(o["defineComponent"])({props:{widgetParams:Object,widgetName:String},components:{ActivityIndicator:Oa},data:function(){return{loading:!1,loadingFailed:!1,loadingFailedRateLimit:!1,changeCounter:0,currentScope:null,lastWidgetAbortController:null}},watch:{widgetParams:function(e){e&&this.loadWidgetUrl(e,this.changeCounter+=1)}},computed:{loadingMessage:function(){return this.widgetName?C("General_LoadingPopover",this.widgetName):C("General_LoadingData")},hasErrorFaqLink:function(){var e=S.config.enable_general_settings_admin,t=S.config.enable_plugins_admin;return S.hasSuperUserAccess&&(e||t)}},mounted:function(){this.widgetParams&&this.loadWidgetUrl(this.widgetParams,this.changeCounter+=1)},beforeUnmount:function(){this.cleanupLastWidgetContent()},methods:{abortHttpRequestIfNeeded:function(){this.lastWidgetAbortController&&(this.lastWidgetAbortController.abort(),this.lastWidgetAbortController=null)},cleanupLastWidgetContent:function(){var e=this.$refs.widgetContent;S.helper.destroyVueComponent(e),this.currentScope&&this.currentScope.$destroy(),e&&(e.innerHTML="")},getWidgetUrl:function(e){var t=Ee.parsed.value,n=Object.assign({},e||{}),r=Object.keys(Object.assign(Object.assign({},Ee.hashParsed.value),{},{idSite:"",period:"",date:"",segment:"",widget:""}));return r.forEach((function(e){"category"!==e&&"subcategory"!==e&&(e in n||(n[e]=t[e]))})),Dr.isComparisonEnabled()&&(n=Object.assign(Object.assign({},n),{},{comparePeriods:t.comparePeriods,compareDates:t.compareDates,compareSegments:t.compareSegments})),e&&"showtitle"in e||(n.showtitle="1"),S.shouldPropagateTokenAuth&&t.token_auth&&(S.broadcast.isWidgetizeRequestWithoutSession()||(n.force_api_session="1"),n.token_auth=t.token_auth),n.random=Math.floor(1e4*Math.random()),n},loadWidgetUrl:function(e,t){var n=this;this.loading=!0,this.abortHttpRequestIfNeeded(),this.cleanupLastWidgetContent(),this.lastWidgetAbortController=new AbortController,Ze.fetch(this.getWidgetUrl(e),{format:"html",headers:{"X-Requested-With":"XMLHttpRequest"},abortController:this.lastWidgetAbortController}).then((function(r){if(t===n.changeCounter&&r&&"string"===typeof r){n.lastWidgetAbortController=null,n.loading=!1,n.loadingFailed=!1;var i=n.$refs.widgetContent;window.$(i).html(r);var o=window.$(i).children();if(n.widgetName){var a=o.find("> .card-content .card-title");a.length||(a=o.find("> h2")),a.length&&a.html(S.helper.htmlEntities(n.widgetName))}var l=S.helper.getAngularDependency("$rootScope"),c=l.$new();n.currentScope=c,S.helper.compileAngularComponents(o,{scope:c}),S.helper.compileVueEntryComponents(o),wl.parseNotificationDivs(),setTimeout((function(){S.postEvent("widget:loaded",{parameters:e,element:o})}))}})).catch((function(e){t===n.changeCounter&&(n.lastWidgetAbortController=null,n.cleanupLastWidgetContent(),n.loading=!1,"abort"!==e.xhrStatus&&(429===e.status&&(n.loadingFailedRateLimit=!0),n.loadingFailed=!0))}))}}});Oc.render=wc;var jc=Oc; + */var gr=function(){function e(){var t=this;pr(this,e),br(this,"segmentState",Object(K["reactive"])({availableSegments:[]})),ce.on("piwikSegmentationInited",(function(){return t.setSegmentState()}))}return hr(e,[{key:"state",get:function(){return Object(K["readonly"])(this.segmentState)}},{key:"setSegmentState",value:function(){try{var e=$(".segmentEditorPanel").data("uiControlObject");this.segmentState.availableSegments=e.impl.availableSegments||[]}catch(t){}}}]),e}(),vr=new gr;function yr(e){return kr(e)||wr(e)||jr(e)||Or()}function Or(){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 jr(e,t){if(e){if("string"===typeof e)return Sr(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)?Sr(e,t):void 0}}function wr(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function kr(e){if(Array.isArray(e))return Sr(e)}function Sr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Cr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Er(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Dr(e,t,n){return t&&Er(e.prototype,t),n&&Er(e,n),e}function Pr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */Vt({component:jc,scope:{piwikWidgetLoader:{vue:"widgetParams",angularJsBind:"="},widgetName:{angularJsBind:"@"}},directiveName:"piwikWidgetLoader"});function kc(e,t,n,r,i,a){var l=Object(o["resolveComponent"])("Widget");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",null,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.actualContainer,(function(e,t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:t},[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(l,{widget:e,"prevent-recursion":!0},null,8,["widget"])])])})),128))])}function Sc(e){return Dc(e)||Ec(e)||Nc(e)||Cc()}function Cc(){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 Ec(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Dc(e){if(Array.isArray(e))return Tc(e)}function Pc(e,t){return xc(e)||Ac(e,t)||Nc(e,t)||Vc()}function Vc(){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 Nc(e,t){if(e){if("string"===typeof e)return Tc(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)?Tc(e,t):void 0}}function Tc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ac(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0)if(o.push(r.value),t&&o.length===t)break}catch(c){l=!0,i=c}finally{try{a||null==n["return"]||n["return"]()}finally{if(l)throw i}}return o}}function xc(e){if(Array.isArray(e))return e}var Ic=vt("CoreHome","Widget"),Bc=Object(o["defineComponent"])({props:{container:{type:Array,required:!0}},components:{Widget:Ic},computed:{actualContainer:function(){var e,t,n,r=this.container;if(null===r||void 0===r||null===(e=r[0])||void 0===e||!e.parameters)return r;var i=Pc(r,1),o=i[0],a="1"===(null===(t=o.parameters)||void 0===t?void 0:t.widget)||1===(null===(n=o.parameters)||void 0===n?void 0:n.widget),l=a&&"graphEvolution"===o.viewDataTable,c=l?Object.assign(Object.assign({},o),{},{parameters:Object.assign(Object.assign({},o.parameters),{},{showtitle:"0"})}):o;return[c].concat(Sc(r.slice(1)))}}});Bc.render=kc;var Mc=Bc,Lc=(Vt({component:Mc,scope:{container:{angularJsBind:"=piwikWidgetContainer"}},directiveName:"piwikWidgetContainer"}),{class:"reportsByDimensionView"}),Fc={class:"entityList"},Rc={class:"listCircle"},_c=["onClick"],$c={class:"dimension"},Hc={class:"reportContainer"},Uc=Object(o["createElementVNode"])("div",{class:"clear"},null,-1); + */var Tr=8,Vr=3;function Nr(e){return e?Array.isArray(e)?e:[e]:[]}var Ir=function(){function e(){var t=this;Cr(this,e),Pr(this,"privateState",Object(K["reactive"])({comparisonsDisabledFor:[]})),Pr(this,"state",Object(K["readonly"])(this.privateState)),Pr(this,"colors",{}),Pr(this,"segmentComparisons",Object(K["computed"])((function(){return t.parseSegmentComparisons()}))),Pr(this,"periodComparisons",Object(K["computed"])((function(){return t.parsePeriodComparisons()}))),Pr(this,"isEnabled",Object(K["computed"])((function(){return t.checkEnabledForCurrentPage()}))),this.loadComparisonsDisabledFor(),$((function(){t.colors=t.getAllSeriesColors()})),Object(K["watch"])((function(){return t.getComparisons()}),(function(){return ce.postEvent("piwikComparisonsChanged")}),{deep:!0})}return Dr(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)%Tr;if(0===n)return this.colors["series".concat(r)];var o=n%Vr;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%Vr)),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:Object.assign(Object.assign({},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=yr(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={},a=!1,i=!1;e.forEach((function(e){a?r[e.params.segment]=!0:a=!0})),t.forEach((function(e){i?o["".concat(e.params.period,"|").concat(e.params.date)]=!0:i=!0}));var l=[],c=[];Object.keys(o).forEach((function(e){var t=e.split("|");l.push(t[0]),c.push(t[1])}));var s={compareSegments:Object.keys(r),comparePeriods:l,compareDates:c},u=ce.helper.isReportingPage()?Ce.hashParsed.value:Ce.urlParsed.value;Ce.updateLocation(Object.assign(Object.assign(Object.assign({},u),s),n))}},{key:"getAllSeriesColors",value:function(){var e=ce.ColorManager;if(!e)return[];for(var t=[],n=0;n<Tr;n+=1){t.push("series".concat(n));for(var r=0;r<Vr;r+=1)t.push("series".concat(n,"-shade").concat(r))}return e.getColors("comparison-series-color",t)}},{key:"loadComparisonsDisabledFor",value:function(){var e=this,t=Ce.parsed.value.module;window.piwik.installation||"CoreUpdater"===t||"Installation"===t||"Overlay"===t||window.piwik.isPagesComparisonApiDisabled?this.privateState.comparisonsDisabledFor=[]:Je.fetch({module:"API",method:"API.getPagesComparisonsDisabledFor"}).then((function(t){e.privateState.comparisonsDisabledFor=t}))}},{key:"parseSegmentComparisons",value:function(){var e=vr.state.availableSegments,t=yr(Nr(Ce.parsed.value.compareSegments));t.unshift(Ce.parsed.value.segment||"");var n=[];return t.forEach((function(t,r){var o;e.forEach((function(e){e.definition!==t&&e.definition!==decodeURIComponent(t)&&decodeURIComponent(e.definition)!==t||(o=e)}));var i=o?o.name:a("General_Unknown");""===t.trim()&&(i=a("SegmentEditor_DefaultAllVisits")),n.push({params:{segment:t},title:ce.helper.htmlDecode(i),index:r})})),n}},{key:"parsePeriodComparisons",value:function(){var e=yr(Nr(Ce.parsed.value.comparePeriods)),t=yr(Nr(Ce.parsed.value.compareDates));e.unshift(Ce.parsed.value.period),t.unshift(Ce.parsed.value.date);for(var n=[],r=0;r<Math.min(t.length,e.length);r+=1){var o=void 0;try{o=m.parse(e[r],t[r]).getPrettyString()}catch(i){o=a("General_Error")}n.push({params:{date:t[r],period:e[r]},title:o,index:r})}return n}},{key:"checkEnabledForCurrentPage",value:function(){var e=Ce.parsed.value.category||Ce.parsed.value.module,t=Ce.parsed.value.subcategory||Ce.parsed.value.action,n="".concat(e,".").concat(t),r=-1===this.privateState.comparisonsDisabledFor.indexOf(n)&&-1===this.privateState.comparisonsDisabledFor.indexOf("".concat(e,".*"));return document.documentElement.classList.toggle("comparisonsDisabled",!r),r}}]),e}(),xr=new Ir,Br=Object(K["defineComponent"])({props:{},directives:{Tooltips:Jt},data:function(){return{comparisonTooltips:null}},setup:function(){var e=Object(K["computed"])((function(){return xr.isComparing()})),t=Object(K["computed"])((function(){return xr.getSegmentComparisons()})),n=Object(K["computed"])((function(){return xr.getPeriodComparisons()})),r=xr.getSeriesColor.bind(xr);function o(){var e=window.$(this).attr("title");return e?window.vueSanitize(e.replace(/\n/g,"<br />")):e}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"),xr.removeSegmentComparison(e)},getComparisonPeriodType:function(e){var t=e.params.period;if("range"===t)return a("CoreHome_PeriodRange");var n=a("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=Object.assign({},Ce.hashParsed.value);return delete t.comparePeriods,delete t.compareDates,delete t.compareSegments,t.segment=e,"".concat(window.location.search,"#?").concat(Ce.stringify(t))},onComparisonsChanged:function(){var e=this;if(this.comparisonTooltips=null,xr.isComparing()){var t=xr.getPeriodComparisons(),n=xr.getSegmentComparisons();Je.fetch({method:"API.getProcessedReport",apiModule:"VisitsSummary",apiAction:"get",compare:"1",compareSegments:Ce.getSearchParam("compareSegments"),comparePeriods:Ce.getSearchParam("comparePeriods"),compareDates:Ce.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=xr.getComparisonSeriesIndex(t.index,0),o=e.reportData.comparisons[r],i=xr.getComparisonSeriesIndex(t.index,n.index),l=e.reportData.comparisons[i],c=e.reportData.comparisons[n.index],s='<div class="comparison-card-tooltip">',u=(l.nb_visits/o.nb_visits*100).toFixed(2);return u="".concat(u,"%"),s+=a("General_ComparisonCardTooltip1",["'".concat(l.compareSegmentPretty,"'"),l.comparePeriodPretty,u,l.nb_visits.toString(),o.nb_visits.toString()]),t.index>0&&(s+="<br/><br/>",s+=a("General_ComparisonCardTooltip2",[l.nb_visits_change.toString(),c.compareSegmentPretty,c.comparePeriodPretty])),s+="</div>",s}},mounted:function(){var e=this;ce.on("piwikComparisonsChanged",(function(){e.onComparisonsChanged()})),this.onComparisonsChanged()}});Br.render=mr;var Ar=Br,Lr={ref:"root",class:"menuDropdown"},Mr=["title"],_r=["innerHTML"],Fr=Object(K["createElementVNode"])("span",{class:"icon-arrow-bottom"},null,-1),Rr={class:"items"},Hr={key:0,class:"search"},Ur=["placeholder"],$r=["title"],qr=["title"];function Wr(e,t,n,r,o,a){var i=Object(K["resolveDirective"])("focus-if"),l=Object(K["resolveDirective"])("focus-anywhere-but-here");return Object(K["withDirectives"])((Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Lr,[Object(K["createElementVNode"])("span",{class:"title",onClick:t[0]||(t[0]=function(t){return e.showItems=!e.showItems}),title:e.tooltip},[Object(K["createElementVNode"])("span",{innerHTML:e.$sanitize(this.actualMenuTitle)},null,8,_r),Fr],8,Mr),Object(K["withDirectives"])(Object(K["createElementVNode"])("div",Rr,[e.showSearch&&e.showItems?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Hr,[Object(K["withDirectives"])(Object(K["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,Ur),[[K["vModelText"],e.searchTerm],[i,{},e.showItems]]),Object(K["withDirectives"])(Object(K["createElementVNode"])("img",{class:"search_ico",src:"plugins/Morpheus/images/search_ico.png",title:e.translate("General_Search")},null,8,$r),[[K["vShow"],!e.searchTerm]]),Object(K["withDirectives"])(Object(K["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,qr),[[K["vShow"],e.searchTerm]])])):Object(K["createCommentVNode"])("",!0),Object(K["createElementVNode"])("div",{onClick:t[4]||(t[4]=function(t){return e.selectItem(t)})},[Object(K["renderSlot"])(e.$slots,"default")])],512),[[K["vShow"],e.showItems]])],512)),[[l,{blur:e.lostFocus}]])}var zr=window,Gr=zr.$,Yr=Object(K["defineComponent"])({props:{menuTitle:String,tooltip:String,showSearch:Boolean,menuTitleChangeOnClick:Boolean},directives:{FocusAnywhereButHere:Ut,FocusIf:qt},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")||(this.menuTitleChangeOnClick&&(this.actualMenuTitle=(e.target.textContent||"").replace(/[\u0000-\u2666]/g,(function(e){return"&#".concat(e.charCodeAt(0),";")}))),this.showItems=!1,Gr(this.$slots.default()[0].el).find(".item").removeClass("active"),t.add("active"),this.$emit("afterSelect",e.target))},onSearchTermKeydown:function(){var e=this;setTimeout((function(){e.searchItems(e.searchTerm)}))},searchItems:function(e){var t=e.toLowerCase();Gr(this.$refs.root).find(".item").each((function(e,n){var r=Gr(n);-1===r.text().toLowerCase().indexOf(t)?r.hide():r.show()}))}}});Yr.render=Wr;var Jr=Yr,Kr={ref:"root"};function Qr(e,t,n,r,o,a){return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Kr,null,512)}var Xr=1,Zr=window,eo=Zr.$,to=Object(K["defineComponent"])({props:{selectedDateStart:Date,selectedDateEnd:Date,highlightedDateStart:Date,highlightedDateEnd:Date,viewDate:[String,Date],stepMonths:Number,disableMonthDropdown:Boolean,options:Object},emits:["cellHover","cellHoverLeave","dateSelect"],setup:function(e,t){var n=Object(K["ref"])(null);function r(t,n){var r=t.children("a");if(e.selectedDateStart&&e.selectedDateEnd&&n>=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,a=e.parent(),i=a.children("td");if(a.is(":first-child")){var l=a.children("td:not(.ui-datepicker-other-month)").first();return r=o(l,t,n),r.setDate(i.index(e)-i.index(l)+1),r}var c=a.children("td:not(.ui-datepicker-other-month)").last();return r=o(c,t,n),r.setDate(r.getDate()+i.index(e)-i.index(c)),r}function i(){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"),a=i(),l=t.find("td"),c=l.first(),s=o(c,a[0],a[1]);l.each((function(){r(eo(this),s),s.setDate(s.getDate()+1)}))}function c(){if(!e.viewDate)return!1;var t;if("string"===typeof e.viewDate)try{t=h(e.viewDate)}catch(a){return!1}else t=e.viewDate;var r=eo(n.value),o=i();return(o[0]!==t.getMonth()||o[1]!==t.getFullYear())&&(r.datepicker("setDate",t),!0)}function s(){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 u(){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(),a=eo(".ui-datepicker-year",t).val();return t.datepicker("option","stepMonths",r).datepicker("setDate",new Date(a,o)),s(),!0}function d(){var t=eo(n.value),r=t.find(".ui-datepicker-month")[0];r&&(r.disabled=e.disableMonthDropdown)}function m(){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 p(){d(),l()}return Object(K["watch"])((function(){return Object.assign({},e)}),(function(e,t){var n=!1;[function(e){return e.selectedDateStart},function(e){return e.selectedDateEnd},function(e){return e.highlightedDateStart},function(e){return e.highlightedDateEnd}].forEach((function(r){if(!n){var o=r(e),a=r(t);!o&&a&&(n=!0),o&&!a&&(n=!0),o&&a&&o.getTime()!==a.getTime()&&(n=!0)}})),e.viewDate!==t.viewDate&&c()&&(n=!0),e.stepMonths!==t.stepMonths&&u(),e.disableMonthDropdown!==t.disableMonthDropdown&&d(),n&&l()})),Object(K["onMounted"])((function(){var r=eo(n.value),a=e.options||{},f=Object.assign(Object.assign(Object.assign({},ce.getBaseDatePickerOptions()),a),{},{onChangeMonthYear:function(){setTimeout((function(){s()}))}});r.datepicker(f),r.on("mouseover","tbody td a",(function(e){e.originalEvent&&l()})),r.on("mouseenter","tbody td",(function(){var e=i(),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",m),r.on("click",(function(e){e.preventDefault();var t=eo(e.target).closest("a");(t.is(".ui-datepicker-next")||t.is(".ui-datepicker-prev"))&&p()})),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),a=parseInt(n.children("a,span").text(),10);t.emit("dateSelect",{date:new Date(o,r,a)})}));var h=u();c(),d(),h||s(),l()})),{root:n}}});to.render=Qr;var no=to,ro={class:"dateRangePicker"},oo={id:"calendarRangeFrom"},ao={id:"calendarRangeTo"};function io(e,t,n,r,o,a){var i=Object(K["resolveComponent"])("DatePicker");return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",ro,[Object(K["createElementVNode"])("div",oo,[Object(K["createElementVNode"])("h6",null,[Object(K["createTextVNode"])(Object(K["toDisplayString"])(e.translate("General_DateRangeFrom"))+" ",1),Object(K["withDirectives"])(Object(K["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),[[K["vModelText"],e.startDateText]])]),Object(K["createVNode"])(i,{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(K["createElementVNode"])("div",ao,[Object(K["createElementVNode"])("h6",null,[Object(K["createTextVNode"])(Object(K["toDisplayString"])(e.translate("General_DateRangeTo"))+" ",1),Object(K["withDirectives"])(Object(K["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),[[K["vModelText"],e.endDateText]])]),Object(K["createVNode"])(i,{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 lo="YYYY-MM-DD",co=Object(K["defineComponent"])({props:{startDate:String,endDate:String},components:{DatePicker:no},data:function(){var e=null;try{this.startDate&&(e=h(this.startDate))}catch(n){}var t=null;try{this.endDate&&(t=h(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){this.startDateInvalid=!0;var t=null;try{e&&e.length===lo.length&&(t=h(e))}catch(n){}t&&(this.fromPickerSelectedDates=[t,t],this.startDateInvalid=!1,this.rangeChanged())},setEndRangeDateFromStr:function(e){this.endDateInvalid=!0;var t=null;try{e&&e.length===lo.length&&(t=h(e))}catch(n){}t&&(this.toPickerSelectedDates=[t,t],this.endDateInvalid=!1,this.rangeChanged())},rangeChanged:function(){this.$emit("rangeChange",{start:this.fromPickerSelectedDates[0]?p(this.fromPickerSelectedDates[0]):null,end:this.toPickerSelectedDates[0]?p(this.toPickerSelectedDates[0]):null})}}});co.render=io;var so=co;function uo(e,t,n,r,o,a){var i=Object(K["resolveComponent"])("DatePicker");return Object(K["openBlock"])(),Object(K["createBlock"])(i,{"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 mo=new Date(ce.minDateYear,ce.minDateMonth-1,ce.minDateDay),po=new Date(ce.maxDateYear,ce.maxDateMonth-1,ce.maxDateDay),fo=Object(K["defineComponent"])({props:{period:{type:String,required:!0},date:[String,Date]},components:{DatePicker:no},emits:["select"],setup:function(e,t){var n=Object(K["ref"])(e.date),r=Object(K["ref"])([null,null]),o=Object(K["ref"])([null,null]);function a(t){var n=m.get(e.period).parse(t).getDateRange();return n[0]=mo<n[0]?n[0]:mo,n[1]=po>n[1]?n[1]:po,n}function i(t,n){var r=t<mo||t>po,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 c(e){t.emit("select",{date:e})}function s(){if(!e.period||!e.date)return r.value=[null,null],void(n.value=null);r.value=a(e.date),n.value=h(e.date)}return Object(K["watch"])(e,s),s(),{selectedDates:r,highlightedDates:o,viewDate:n,onHoverNormalCell:i,onHoverLeaveNormalCells:l,onDateSelected:c}}});fo.render=uo;var ho=fo,bo={key:0},go=["data-notification-instance-id"],vo={key:1},yo={class:"notification-body"},Oo=["innerHTML"],jo={key:1};function wo(e,t,n,r,o,a){return Object(K["openBlock"])(),Object(K["createBlock"])(K["Transition"],{name:"toast"===e.type?"slow-fade-out":void 0,onAfterLeave:t[1]||(t[1]=function(t){return e.toastClosed()})},{default:Object(K["withCtx"])((function(){return[e.deleted?Object(K["createCommentVNode"])("",!0):(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",bo,[Object(K["createVNode"])(K["Transition"],{name:"toast"===e.type?"toast-slide-up":void 0,appear:""},{default:Object(K["withCtx"])((function(){return[Object(K["createElementVNode"])("div",null,[Object(K["createVNode"])(K["Transition"],{name:e.animate?"fade-in":void 0,appear:""},{default:Object(K["withCtx"])((function(){return[Object(K["createElementVNode"])("div",{class:Object(K["normalizeClass"])(["notification system",e.cssClasses]),style:Object(K["normalizeStyle"])(e.style),ref:"root","data-notification-instance-id":e.notificationInstanceId},[e.canClose?(Object(K["openBlock"])(),Object(K["createElementBlock"])("button",{key:0,type:"button",class:"close","data-dismiss":"alert",onClick:t[0]||(t[0]=function(t){return e.closeNotification(t)})}," × ")):Object(K["createCommentVNode"])("",!0),e.title?(Object(K["openBlock"])(),Object(K["createElementBlock"])("strong",vo,Object(K["toDisplayString"])(e.title),1)):Object(K["createCommentVNode"])("",!0),Object(K["createElementVNode"])("div",yo,[e.message?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",{key:0,innerHTML:e.$sanitize(e.message)},null,8,Oo)):Object(K["createCommentVNode"])("",!0),e.message?Object(K["createCommentVNode"])("",!0):(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",jo,[Object(K["renderSlot"])(e.$slots,"default")]))])],14,go)]})),_:3},8,["name"])])]})),_:3},8,["name"])]))]})),_:3},8,["name"])}var ko=window,So=ko.$,Co=Object(K["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&&So(this.$refs.root).css(this.style)},methods:{toastClosed:function(){var e=this;Object(K["nextTick"])((function(){e.$emit("closed")}))},closeNotification:function(e){var t=this;this.canClose&&e&&e.target&&(this.deleted=!0,Object(K["nextTick"])((function(){t.$emit("closed")}))),this.markNotificationAsRead()},markNotificationAsRead:function(){this.notificationId&&Je.post({module:"CoreHome",action:"markNotificationAsRead"},{notificationId:this.notificationId},{withTokenInUrl:!0})}}});Co.render=wo;var Eo=Co,Do={class:"notification-group"},Po=["innerHTML"];function To(e,t,n,r,o,a){var i=Object(K["resolveComponent"])("Notification");return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Do,[(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(e.notifications,(function(t,n){return Object(K["openBlock"])(),Object(K["createBlock"])(i,{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(K["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(K["withCtx"])((function(){return[Object(K["createElementVNode"])("div",{innerHTML:e.$sanitize(t.message)},null,8,Po)]})),_:2},1032,["notification-id","title","context","type","noclear","toast-length","style","animate","message","notification-instance-id","css-class","onClosed"])})),128))])}function Vo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function No(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Io(e,t,n){return t&&No(e.prototype,t),n&&No(e,n),e}function xo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,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 qc(e,t,n,r,i,a){var l=Object(o["resolveComponent"])("WidgetLoader");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Lc,[Object(o["createElementVNode"])("div",Fc,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.widgetsByCategory,(function(t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:"dimensionCategory",key:t.name},[Object(o["createTextVNode"])(Object(o["toDisplayString"])(t.name)+" ",1),Object(o["createElementVNode"])("ul",Rc,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(t.widgets,(function(t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{class:Object(o["normalizeClass"])(["reportDimension",{activeDimension:e.selectedWidget.uniqueId===t.uniqueId}]),key:t.uniqueId,onClick:function(n){return e.selectWidget(t)}},[Object(o["createElementVNode"])("span",$c,Object(o["toDisplayString"])(t.name),1)],10,_c)})),128))])])})),128))]),Object(o["createElementVNode"])("div",Hc,[e.selectedWidget.parameters?(Object(o["openBlock"])(),Object(o["createBlock"])(l,{key:0,"widget-params":e.selectedWidget.parameters,class:"dimensionReport"},null,8,["widget-params"])):Object(o["createCommentVNode"])("",!0)]),Uc])}function Wc(e,t){return Qc(e)||Yc(e,t)||Gc(e,t)||Jc()}function Jc(){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 Gc(e,t){if(e){if("string"===typeof e)return zc(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)?zc(e,t):void 0}}function zc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Yc(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0)if(o.push(r.value),t&&o.length===t)break}catch(c){l=!0,i=c}finally{try{a||null==n["return"]||n["return"]()}finally{if(l)throw i}}return o}}function Qc(e){if(Array.isArray(e))return e}var Kc=Object(o["defineComponent"])({props:{widgets:Array},components:{WidgetLoader:jc},data:function(){return{selectedWidget:null}},created:function(){var e=Wc(this.widgetsSorted,1);this.selectedWidget=e[0]},computed:{widgetsSorted:function(){return Fl(this.widgets)},widgetsByCategory:function(){var e={};return this.widgetsSorted.forEach((function(t){var n,r=null===(n=t.subcategory)||void 0===n?void 0:n.name;r&&(e[r]||(e[r]={name:r,order:t.order,widgets:[]}),e[r].widgets.push(t))})),Fl(Object.values(e))}},methods:{selectWidget:function(e){this.selectedWidget=Object.assign({},e)}}});Kc.render=qc;var Xc=Kc,Zc=(Vt({component:Xc,scope:{widgets:{angularJsBind:"=piwikWidgetByDimensionContainer",transform:function(e){return e.widgets}}},directiveName:"piwikWidgetByDimensionContainer"}),["id"]),es={key:1},ts={key:2}; + */var Bo=window,Ao=Bo.$,Lo=function(){function e(){Vo(this,e),xo(this,"privateState",Object(K["reactive"])({notifications:[]})),xo(this,"nextNotificationId",0)}return Io(e,[{key:"state",get:function(){return Object(K["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=Ao('[data-role="notification"]'),n=[];t.each((function(e,r){var o=Ao(r),a=o.data(),i=o.html();i&&n.push(Object.assign(Object.assign({},a),{},{message:i,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")||Ao(o).prepend('<div id="modalNotificationContainer"/>'),n="".concat(r," #modalNotificationContainer"),t=this.prependNotification)}var a=e.group||(n?n.toString():"");this.initializeNotificationContainer(n,a);var i=(this.nextNotificationId+=1).toString();return t.call(this,Object.assign(Object.assign({},e),{},{noclear:!!e.noclear,group:a,notificationId:e.id,notificationInstanceId:i,type:e.type||"transient"})),i}},{key:"scrollToNotification",value:function(e){setTimeout((function(){var t=document.querySelector("[data-notification-instance-id='".concat(e,"']"));t&&ce.helper.lazyScrollTo(t,250)}))}},{key:"toast",value:function(e){this.checkMessage(e.message);var t=e.placeat?Ao(e.placeat):void 0;if(!t||!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=ct({render:function(){return Object(K["createVNode"])(Eo,Object.assign(Object.assign({},e),{},{notificationId:e.id,type:"toast",onClosed:function(){r.unmount()}}))}});r.mount(n)}},{key:"initializeNotificationContainer",value:function(e,t){if(e){var n=Ao(e);if(!n.children(".notification-group").length){var r=window.CoreHome.NotificationGroup,o=ct({template:'<NotificationGroup :group="group"></NotificationGroup>',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}(),Mo=new Lo,_o=Mo;Ao((function(){return Mo.parseNotificationDivs()}));var Fo=Object(K["defineComponent"])({props:{group:String},components:{Notification:Eo},computed:{notifications:function(){var e=this;return _o.state.notifications.filter((function(t){return e.group?e.group===t.group:!t.group}))}},methods:{removeNotification:function(e){_o.remove(e)}}});Fo.render=To;var Ro=Fo; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function ns(e,t,n,r,i,a){var l=Object(o["resolveComponent"])("WidgetLoader"),c=Object(o["resolveComponent"])("WidgetContainer"),s=Object(o["resolveComponent"])("WidgetByDimensionContainer"),u=Object(o["resolveDirective"])("tooltips");return e.actualWidget?Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:0,class:Object(o["normalizeClass"])(["matomo-widget",{isFirstWidgetInPage:e.actualWidget.isFirstInPage}]),id:e.actualWidget.uniqueId},[!e.actualWidget.isContainer&&e.actualWidget.parameters?(Object(o["openBlock"])(),Object(o["createBlock"])(l,{key:0,"widget-params":e.actualWidget.parameters,"widget-name":e.actualWidget.name},null,8,["widget-params","widget-name"])):Object(o["createCommentVNode"])("",!0),e.actualWidget.isContainer&&"ByDimension"!==e.actualWidget.layout&&!this.preventRecursion?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",es,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(c,{container:e.actualWidget.widgets},null,8,["container"])])])):Object(o["createCommentVNode"])("",!0),e.actualWidget.isContainer&&"ByDimension"===e.actualWidget.layout?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ts,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(s,{widgets:e.actualWidget.widgets},null,8,["widgets"])])])):Object(o["createCommentVNode"])("",!0)],10,Zc)),[[o["vShow"],e.showWidget],[u,{content:e.tooltipContent}]]):Object(o["createCommentVNode"])("",!0)}function rs(e,t){var n=void 0;return Object.values(e||{}).some((function(e){return n=e.find((function(e){var n;return e&&e.isContainer&&(null===(n=e.parameters)||void 0===n?void 0:n.containerId)===t})),n})),n}var is=Object(o["defineComponent"])({props:{widget:Object,widgetized:Boolean,containerid:String,preventRecursion:Boolean},components:{WidgetLoader:jc,WidgetContainer:Mc,WidgetByDimensionContainer:Xc},directives:{Tooltips:Ur},data:function(){return{showWidget:!1}},setup:function(){function e(){var e=window.$(this);if(""===e.attr("piwik-field")||e.hasClass("matomo-form-field"))return"";var t=window.$(this).attr("title")||"";return window.vueSanitize(t.replace(/\n/g,"<br />"))}return{tooltipContent:e}},created:function(){var e=this,t=this.actualWidget;if(t&&t.middlewareParameters){var n=t.middlewareParameters;Ze.fetch(n).then((function(t){e.showWidget=!!t}))}else this.showWidget=!0},computed:{allWidgets:function(){return tc.widgets.value},actualWidget:function(){var e=this,t=this.widget;if(t){var n=Object.assign({},t);if(t&&t.isReport&&!t.documentation){var r=pc.findReport(t.module,t.action);r&&r.documentation&&(n.documentation=r.documentation)}return t}if(this.containerid){var i=rs(this.allWidgets,this.containerid);if(i){var o=Object.assign({},i);if(this.widgetized){o.isFirstInPage=!0,o.parameters=Object.assign(Object.assign({},o.parameters),{},{widget:"1"});var a=Zl(o);a&&(o.widgets=a.map((function(t){return Object.assign(Object.assign({},t),{},{parameters:Object.assign(Object.assign({},t.parameters),{},{widget:"1",containerId:e.containerid})})})))}return o}}return null}}});is.render=ns;var os=is,as=(Vt({component:os,scope:{widget:{angularJsBind:"=?piwikWidget"},widgetized:{angularJsBind:"=?"},containerid:{angularJsBind:"@"}},directiveName:"piwikWidget"}),{class:"reporting-page"}),ls={key:1,class:"col s12 l6 leftWidgetColumn"},cs={key:2,class:"col s12 l6 rightWidgetColumn"}; + */function Ho(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Uo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $o(e,t,n){return t&&Uo(e.prototype,t),n&&Uo(e,n),e}function qo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,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 ss(e,t,n,r,i,a){var l=Object(o["resolveComponent"])("ActivityIndicator"),c=Object(o["resolveComponent"])("Widget");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",as,[Object(o["createVNode"])(l,{loading:e.loading},null,8,["loading"]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,Object(o["toDisplayString"])(e.translate("CoreHome_NoSuchPage")),513),[[o["vShow"],e.hasNoPage]]),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.widgets,(function(e){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:"row",key:e.uniqueId},[e.group?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createBlock"])(c,{key:0,class:"col s12 fullWidgetColumn",widget:e},null,8,["widget"])),e.group?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ls,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.left,(function(e){return Object(o["openBlock"])(),Object(o["createBlock"])(c,{widget:e,key:e.uniqueId},null,8,["widget"])})),128))])):Object(o["createCommentVNode"])("",!0),e.group?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",cs,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.right,(function(e){return Object(o["openBlock"])(),Object(o["createBlock"])(c,{widget:e,key:e.uniqueId},null,8,["widget"])})),128))])):Object(o["createCommentVNode"])("",!0)])})),128))])}function us(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ds(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ms(e,t,n){return t&&ds(e.prototype,t),n&&ds(e,n),e}function ps(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fs(e){return bs(e)||vs(e)||gs(e)||hs()}function hs(){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 gs(e,t){if(e){if("string"===typeof e)return ys(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)?ys(e,t):void 0}}function vs(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function bs(e){if(Array.isArray(e))return ys(e)}function ys(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r} + */var Wo=function(){function e(){var t=this;Ho(this,e),qo(this,"state",Object(K["reactive"])({initialSites:[],isInitialized:!1})),qo(this,"stateFiltered",Object(K["reactive"])({initialSites:[],isInitialized:!1,excludedSites:[]})),qo(this,"currentRequestAbort",null),qo(this,"limitRequest",void 0),qo(this,"initialSites",Object(K["computed"])((function(){return Object(K["readonly"])(t.state.initialSites)}))),qo(this,"initialSitesFiltered",Object(K["computed"])((function(){return Object(K["readonly"])(t.stateFiltered.initialSites)})))}return $o(e,[{key:"loadInitialSites",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return this.state.isInitialized&&0===n.length?Promise.resolve(Object(K["readonly"])(this.state.initialSites)):this.stateFiltered.isInitialized&&n.length===this.stateFiltered.excludedSites.length&&n.every((function(t,n){return t===e.stateFiltered.excludedSites[n]}))?Promise.resolve(Object(K["readonly"])(this.stateFiltered.initialSites)):(n.length>0&&this.searchSite("%",t,n).then((function(t){e.stateFiltered.isInitialized=!0,e.stateFiltered.excludedSites=n,null!==t&&(e.stateFiltered.initialSites=t)})),this.state.isInitialized?Promise.resolve(Object(K["readonly"])(this.state.initialSites)):this.searchSite("%",t,n).then((function(t){return e.state.isInitialized=!0,null!==t&&(e.state.initialSites=t),t})))}},{key:"loadSite",value:function(e){"all"===e?Ce.updateUrl(Object.assign(Object.assign({},Ce.urlParsed.value),{},{module:"MultiSites",action:"index",date:Ce.parsed.value.date,period:Ce.parsed.value.period})):Ce.updateUrl(Object.assign(Object.assign({},Ce.urlParsed.value),{},{segment:"",idSite:e}),Object.assign(Object.assign({},Ce.hashParsed.value),{},{segment:"",idSite:e}))}},{key:"searchSite",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return e?(this.currentRequestAbort&&this.currentRequestAbort.abort(),this.limitRequest||(this.limitRequest=Je.fetch({method:"SitesManager.getNumWebsitesToDisplayPerPage"})),this.limitRequest.then((function(o){var a=o.value,i="SitesManager.getPatternMatchSites";return n&&(i="SitesManager.getSitesWithAdminAccess"),t.currentRequestAbort=new AbortController,Je.fetch({method:i,limit:a,pattern:e,sitesToExclude:r},{abortController:t.currentRequestAbort})})).then((function(e){return e?t.processWebsitesList(e):null})).finally((function(){t.currentRequestAbort=null}))):this.loadInitialSites(n,r)}},{key:"processWebsitesList",value:function(e){var t=e;return t&&t.length?(t=t.map((function(e){return Object.assign(Object.assign({},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:e.name.toLowerCase()>t.name.toLowerCase()?1:0})),t):[]}}]),e}(),zo=new Wo,Go=["value","name"],Yo=["title"],Jo=["textContent"],Ko={key:1,class:"placeholder"},Qo={class:"dropdown"},Xo={class:"custom_select_search"},Zo=["placeholder"],ea={key:0},ta={class:"custom_select_container"},na=["onClick"],ra=["innerHTML","href","title"],oa={class:"ui-autocomplete ui-front ui-menu ui-widget ui-widget-content ui-corner-all\n siteSelect"},aa={class:"ui-menu-item"},ia={class:"ui-corner-all",tabindex:"-1"},la={key:1};function ca(e,t,n,r,o,a){var i,l,c,s,u=Object(K["resolveComponent"])("AllSitesLink"),d=Object(K["resolveDirective"])("focus-if"),m=Object(K["resolveDirective"])("focus-anywhere-but-here");return Object(K["withDirectives"])((Object(K["openBlock"])(),Object(K["createElementBlock"])("div",{class:Object(K["normalizeClass"])(["siteSelector piwikSelector borderedControl",{expanded:e.showSitesList,disabled:!e.hasMultipleSites}])},[e.name?(Object(K["openBlock"])(),Object(K["createElementBlock"])("input",{key:0,type:"hidden",value:null===(i=e.displayedModelValue)||void 0===i?void 0:i.id,name:e.name},null,8,Go)):Object(K["createCommentVNode"])("",!0),Object(K["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(K["normalizeClass"])([{loading:e.isLoading},"title"]),tabindex:"4",title:e.selectorLinkTitle},[Object(K["createElementVNode"])("span",{class:Object(K["normalizeClass"])(["icon icon-arrow-bottom",{iconHidden:e.isLoading,collapsed:!e.showSitesList}])},null,2),Object(K["createElementVNode"])("span",null,[null!==(l=e.displayedModelValue)&&void 0!==l&&l.name||!e.placeholder?(Object(K["openBlock"])(),Object(K["createElementBlock"])("span",{key:0,textContent:Object(K["toDisplayString"])((null===(c=e.displayedModelValue)||void 0===c?void 0:c.name)||e.firstSiteName)},null,8,Jo)):Object(K["createCommentVNode"])("",!0),null!==(s=e.displayedModelValue)&&void 0!==s&&s.name||!e.placeholder?Object(K["createCommentVNode"])("",!0):(Object(K["openBlock"])(),Object(K["createElementBlock"])("span",Ko,Object(K["toDisplayString"])(e.placeholder),1))])],42,Yo),Object(K["withDirectives"])(Object(K["createElementVNode"])("div",Qo,[Object(K["withDirectives"])(Object(K["createElementVNode"])("div",Xo,[Object(K["withDirectives"])(Object(K["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,Zo),[[K["vModelText"],e.searchTerm],[d,{},e.shouldFocusOnSearch]]),Object(K["withDirectives"])(Object(K["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),[[K["vShow"],e.searchTerm]])],512),[[K["vShow"],e.autocompleteMinSites<=e.sites.length||e.searchTerm]]),"top"===e.allSitesLocation&&e.showAllSitesItem?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",ea,[Object(K["createVNode"])(u,{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(K["createCommentVNode"])("",!0),Object(K["createElementVNode"])("div",ta,[Object(K["createElementVNode"])("ul",{class:"custom_select_ul_list",onClick:t[7]||(t[7]=function(t){return e.showSitesList=!1})},[(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(e.sites,(function(n,r){return Object(K["withDirectives"])((Object(K["openBlock"])(),Object(K["createElementBlock"])("li",{onClick:function(t){return e.switchSite(Object.assign(Object.assign({},n),{},{id:n.idsite}),t)},key:r},[Object(K["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,ra)],8,na)),[[K["vShow"],!(!e.showSelectedSite&&"".concat(e.activeSiteId)==="".concat(n.idsite))]])})),128))]),Object(K["withDirectives"])(Object(K["createElementVNode"])("ul",oa,[Object(K["createElementVNode"])("li",aa,[Object(K["createElementVNode"])("a",ia,Object(K["toDisplayString"])(e.translate("SitesManager_NotFound")+" "+e.searchTerm),1)])],512),[[K["vShow"],!e.sites.length&&e.searchTerm]])]),"bottom"===e.allSitesLocation&&e.showAllSitesItem?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",la,[Object(K["createVNode"])(u,{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(K["createCommentVNode"])("",!0)],512),[[K["vShow"],e.showSitesList]])],2)),[[m,{blur:e.onBlur}]])}var sa=["innerHTML","href"];function ua(e,t,n,r,o,a){var i=this;return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",{onClick:t[1]||(t[1]=function(e){return i.onClick(e)}),class:"custom_select_all"},[Object(K["createElementVNode"])("a",{onClick:t[0]||(t[0]=function(e){return e.preventDefault()}),innerHTML:e.$sanitize(e.allSitesText),tabindex:"4",href:e.href},null,8,sa)])}var da=Object(K["defineComponent"])({props:{href:String,allSitesText:String},emits:["click"],methods:{onClick:function(e){this.$emit("click",e)}}});da.render=ua;var ma=da,pa=Object(K["defineComponent"])({props:{modelValue:Object,showSelectedSite:{type:Boolean,default:!1},showAllSitesItem:{type:Boolean,default:!0},switchSiteOnSelect:{type:Boolean,default:!0},onlySitesWithAdminAccess:{type:Boolean,default:!1},name:{type:String,default:""},allSitesText:{type:String,default:a("General_MultiSitesSummary")},allSitesLocation:{type:String,default:"bottom"},placeholder:String,defaultToFirstSite:Boolean,sitesToExclude:{type:Array,default:function(){return[]}}},emits:["update:modelValue","blur"],components:{AllSitesLink:ma},directives:{FocusAnywhereButHere:Ut,FocusIf:qt},watch:{searchTerm:function(){this.onSearchTermChanged()}},data:function(){return{searchTerm:"",activeSiteId:"".concat(ce.idSite),showSitesList:!1,isLoading:!1,sites:[],autocompleteMinSites:parseInt(ce.config.autocomplete_min_sites,10)}},created:function(){this.searchSite=vt(this.searchSite),!this.modelValue&&ce.idSite&&this.$emit("update:modelValue",{id:ce.idSite,name:ce.helper.htmlDecode(ce.siteName)})},mounted:function(){var e=this;window.initTopControls(),this.loadInitialSites().then((function(){e.shouldDefaultToFirstSite&&e.$emit("update:modelValue",{id:e.sites[0].idsite,name:e.sites[0].name})}));var t=a("CoreHome_ShortcutWebsiteSelector");ce.helper.registerShortcut("w",t,(function(t){if(!t.altKey){t.preventDefault?t.preventDefault():t.returnValue=!1;var n=e.$refs.selectorLink;n&&(n.click(),n.focus())}}))},computed:{shouldFocusOnSearch:function(){return this.showSitesList&&this.autocompleteMinSites<=this.sites.length||this.searchTerm},selectorLinkTitle:function(){var e;return this.hasMultipleSites?a("CoreHome_ChangeCurrentWebsite",(null===(e=this.modelValue)||void 0===e?void 0:e.name)||this.firstSiteName):""},hasMultipleSites:function(){var e=zo.initialSitesFiltered.value&&zo.initialSitesFiltered.value.length?zo.initialSitesFiltered.value:zo.initialSites.value;return e&&e.length>1},firstSiteName:function(){var e=zo.initialSitesFiltered.value&&zo.initialSitesFiltered.value.length?zo.initialSitesFiltered.value:zo.initialSites.value;return e&&e.length>0?e[0].name:""},urlAllSites:function(){var e=Ce.stringify(Object.assign(Object.assign({},Ce.urlParsed.value),{},{module:"MultiSites",action:"index",date:Ce.parsed.value.date,period:Ce.parsed.value.period}));return"?".concat(e)},shouldDefaultToFirstSite:function(){var e;return!(null!==(e=this.modelValue)&&void 0!==e&&e.id)&&(!this.hasMultipleSites||this.defaultToFirstSite)&&this.sites[0]},displayedModelValue:function(){return this.modelValue?this.modelValue:ce.idSite?{id:ce.idSite,name:ce.helper.htmlDecode(ce.siteName)}:this.shouldDefaultToFirstSite?{id:this.sites[0].idsite,name:this.sites[0].name}:null}},methods:{onSearchTermChanged:function(){this.searchTerm?(this.isLoading=!0,this.searchSite(this.searchTerm)):(this.isLoading=!1,this.loadInitialSites())},onAllSitesClick:function(e){this.switchSite({id:"all",name:this.$props.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.id,name:e.name}),this.switchSiteOnSelect&&this.activeSiteId!==e.id&&zo.loadSite(e.id))},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 ce.helper.htmlEntities(e);var n=ce.helper.htmlEntities(e.substring(0,t)),r=ce.helper.htmlEntities(e.substring(t+this.searchTerm.length));return"".concat(n,'<span class="autocompleteMatched">').concat(this.searchTerm,"</span>").concat(r)},loadInitialSites:function(){var e=this;return zo.loadInitialSites(this.onlySitesWithAdminAccess,this.sitesToExclude?this.sitesToExclude:[]).then((function(t){e.sites=t||[]}))},searchSite:function(e){var t=this;this.isLoading=!0,zo.searchSite(e,this.onlySitesWithAdminAccess,this.sitesToExclude?this.sitesToExclude:[]).then((function(n){e===t.searchTerm&&n&&(t.sites=n)})).finally((function(){t.isLoading=!1}))},getUrlForSiteId:function(e){var t=Ce.stringify(Object.assign(Object.assign({},Ce.urlParsed.value),{},{segment:"",idSite:e})),n=Ce.stringify(Object.assign(Object.assign({},Ce.hashParsed.value),{},{segment:"",idSite:e}));return"?".concat(t,"#?").concat(n)}}});pa.render=ca;var fa=pa,ha={ref:"root",class:"quickAccessInside"},ba=["title","placeholder"],ga={class:"dropdown"},va={class:"no-result"},ya=["onClick"],Oa=["onMouseenter","onClick"],ja={class:"quickAccessMatomoSearch"},wa=["onMouseenter","onClick"],ka=["textContent"],Sa={class:"quick-access-category helpCategory"},Ca=["href"];function Ea(e,t,n,r,o,a){var i=Object(K["resolveDirective"])("focus-if"),l=Object(K["resolveDirective"])("focus-anywhere-but-here");return Object(K["withDirectives"])((Object(K["openBlock"])(),Object(K["createElementBlock"])("div",ha,[Object(K["createElementVNode"])("span",{class:"icon-search",onMouseenter:t[0]||(t[0]=function(t){return e.searchActive=!0})},null,32),Object(K["withDirectives"])(Object(K["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,placeholder:e.translate("General_Search"),ref:"input"},null,40,ba),[[K["vModelText"],e.searchTerm],[i,{},e.searchActive]]),Object(K["withDirectives"])(Object(K["createElementVNode"])("div",ga,[Object(K["withDirectives"])(Object(K["createElementVNode"])("ul",null,[Object(K["createElementVNode"])("li",va,Object(K["toDisplayString"])(e.translate("General_SearchNoResults")),1)],512),[[K["vShow"],!(e.numMenuItems>0||e.sites.length)]]),(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(e.menuItems,(function(t){return Object(K["openBlock"])(),Object(K["createElementBlock"])("ul",{key:t.title},[Object(K["createElementVNode"])("li",{class:"quick-access-category",onClick:function(n){e.searchTerm=t.title,e.searchMenu(e.searchTerm)}},Object(K["toDisplayString"])(t.title),9,ya),(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(t.items,(function(t){return Object(K["openBlock"])(),Object(K["createElementBlock"])("li",{class:Object(K["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(K["createElementVNode"])("a",null,Object(K["toDisplayString"])(t.name.trim()),1)],42,Oa)})),128))])})),128)),Object(K["createElementVNode"])("ul",ja,[Object(K["withDirectives"])(Object(K["createElementVNode"])("li",{class:"quick-access-category websiteCategory"},Object(K["toDisplayString"])(e.translate("SitesManager_Sites")),513),[[K["vShow"],e.hasSitesSelector&&e.sites.length||e.isLoading]]),Object(K["withDirectives"])(Object(K["createElementVNode"])("li",{class:"no-result"},Object(K["toDisplayString"])(e.translate("MultiSites_LoadingWebsites")),513),[[K["vShow"],e.hasSitesSelector&&e.isLoading]]),(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(e.sites,(function(t,n){return Object(K["withDirectives"])((Object(K["openBlock"])(),Object(K["createElementBlock"])("li",{class:Object(K["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(K["createElementVNode"])("a",{textContent:Object(K["toDisplayString"])(t.name)},null,8,ka)],42,wa)),[[K["vShow"],e.hasSitesSelector&&!e.isLoading]])})),128))]),Object(K["createElementVNode"])("ul",null,[Object(K["createElementVNode"])("li",Sa,Object(K["toDisplayString"])(e.translate("General_HelpResources")),1),Object(K["createElementVNode"])("li",{class:Object(K["normalizeClass"])([{selected:"help"===e.searchIndex},"quick-access-help"]),onMouseenter:t[4]||(t[4]=function(t){return e.searchIndex="help"})},[Object(K["createElementVNode"])("a",{href:"https://matomo.org?mtm_campaign=App_Help&mtm_source=Matomo_App&mtm_keyword=QuickSearch&s=".concat(encodeURIComponent(e.searchTerm)),target:"_blank"},Object(K["toDisplayString"])(e.translate("CoreHome_SearchOnMatomo",e.searchTerm)),9,Ca)],34)])],512),[[K["vShow"],e.searchTerm&&e.searchActive]])],512)),[[l,{blur:e.onBlur}]])}function Da(e){var t=e.getBoundingClientRect(),n=window.$(window);return t.top>=0&&t.left>=0&&t.bottom<=n.height()&&t.right<=n.width()}function Pa(e){e&&e.scrollIntoView&&e.scrollIntoView()}var Ta=Object(K["defineComponent"])({directives:{FocusAnywhereButHere:Ut,FocusIf:qt},watch:{searchActive:function(e){var t=this.$refs.root;if(t&&t.parentElement){var n=t.parentElement.classList;n.toggle("active",e),n.toggle("expanded",e)}}},mounted:function(){var e=this,t=this.$refs.root;t&&t.parentElement&&t.parentElement.classList.add("quick-access","piwikSelector"),"undefined"!==typeof window.initTopControls&&window.initTopControls&&window.initTopControls(),ce.helper.registerShortcut("f",a("CoreHome_ShortcutSearch"),(function(t){t.altKey||(t.preventDefault(),Pa(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=vt(this.searchMenu.bind(this))},computed:{hasSitesSelector:function(){return!!document.querySelector('.top_controls .siteSelector,.top_controls [vue-entry="CoreHome.SiteSelector"]')},quickAccessTitle:function(){var e="",t=[a("CoreHome_MenuEntries")];this.hasSegmentSelector&&t.push(a("CoreHome_Segments")),this.hasSitesSelector&&t.push(a("SitesManager_Sites"));while(t.length)e+=t.shift(),t.length>=2?e+=", ":1===t.length&&(e+=" ".concat(a("General_And")," "));return a("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.input&&this.$refs.input.blur()},makeSureSelectedItemIsInViewport:function(){var e=this.getCurrentlySelectedElement();e&&!Da(e)&&Pa(e)},getCurrentlySelectedElement:function(){var e=this.$refs.root.querySelectorAll("li.result");if(e&&e.length&&e.item(this.searchIndex))return e.item(this.searchIndex)},searchMenu:function(e){var t=this,n=e.toLowerCase(),r=-1,o={},a=[],i=function(e){var t=Object.assign({},e);r+=1,t.menuIndex=r;var n=t.category;n in o||(a.push({title:n,items:[]}),o[n]=a.length-1);var i=o[n];a[i].items.push(t)};this.resetSearchIndex(),this.hasSitesSelector&&(this.isLoading=!0,zo.searchSite(n).then((function(e){e&&(t.sites=e)})).finally((function(){t.isLoading=!1})));var l=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 c=this.topMenuItems.filter(l),s=this.leftMenuItems.filter(l),u=this.segmentItems.filter(l);c.forEach(i),s.forEach(i),u.forEach(i),this.numMenuItems=c.length+s.length+u.length,this.menuItems=a},resetSearchIndex:function(){this.searchIndex=0,this.makeSureSelectedItemIsInViewport()},selectSite:function(e){zo.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=a("CoreHome_Menu"),n=[];return document.querySelectorAll("nav .sidenav li > a").forEach((function(r){var o,a,i=null===(o=r.textContent)||void 0===o?void 0:o.trim();i||(i=null===(a=r.getAttribute("title"))||void 0===a?void 0:a.trim());i&&(n.push({name:i,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,o=window.$(n).find("> .item"),a=(null===(r=o[0])||void 0===r?void 0:r.innerText.trim())||"";a&&-1!==a.lastIndexOf("\n")&&(a=a.slice(0,a.lastIndexOf("\n")).trim()),window.$(n).find("li .item").each((function(n,r){var o,i=null===(o=r.textContent)||void 0===o?void 0:o.trim();i&&(t.push({name:i,category:a,index:e.menuIndexCounter+=1}),r.setAttribute("quick_access","".concat(e.menuIndexCounter)))}))})),t},getSegmentItems:function(){var e=this;if(!this.hasSegmentSelector)return[];var t=a("CoreHome_Segments"),n=[];return document.querySelectorAll(".segmentList [data-idsegment]").forEach((function(r){var o,a,i=null===(o=r.querySelector(".segname"))||void 0===o||null===(a=o.textContent)||void 0===a?void 0:a.trim();i&&(n.push({name:i,category:t,index:e.menuIndexCounter+=1}),r.setAttribute("quick_access","".concat(e.menuIndexCounter)))})),n}}});Ta.render=Ea;var Va=Ta;function Na(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ia={class:"fieldArray form-group"},xa={key:0,class:"fieldUiControl"},Ba=["onClick","title"];function Aa(e,t,n,r,o,a){var i=Object(K["resolveComponent"])("Field");return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Ia,[(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(e.modelValue,(function(t,n){return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",{class:Object(K["normalizeClass"])(["fieldArrayTable multiple valign-wrapper",Na({},"fieldArrayTable".concat(n),!0)]),key:n},[e.field.uiControl?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",xa,[Object(K["createVNode"])(i,{"full-width":!0,"model-value":t,options:e.field.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(t,n)},"model-modifiers":e.field.modelModifiers,placeholder:" ",uicontrol:e.field.uiControl,title:e.field.title,name:"".concat(e.name,"-").concat(n),"template-file":e.field.templateFile,component:e.field.component},null,8,["model-value","options","onUpdate:modelValue","model-modifiers","uicontrol","title","name","template-file","component"])])):Object(K["createCommentVNode"])("",!0),Object(K["withDirectives"])(Object(K["createElementVNode"])("span",{onClick:function(t){return e.removeEntry(n)},class:"icon-minus valign",title:e.translate("General_Remove")},null,8,Ba),[[K["vShow"],n+1!==e.modelValue.length]])],2)})),128))])}function La(e){return Ra(e)||Fa(e)||_a(e)||Ma()}function Ma(){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 _a(e,t){if(e){if("string"===typeof e)return Ha(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)?Ha(e,t):void 0}}function Fa(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Ra(e){if(Array.isArray(e))return Ha(e)}function Ha(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ua=ft("CorePluginsAdmin","Field"),$a=Object(K["defineComponent"])({props:{modelValue:Array,name:String,field:Object},components:{Field:Ua},emits:["update:modelValue"],watch:{modelValue:function(e){this.checkEmptyModelValue(e)}},mounted:function(){this.checkEmptyModelValue(this.modelValue)},methods:{checkEmptyModelValue:function(e){e&&e.length&&""===e.slice(-1)[0]||this.$emit("update:modelValue",[].concat(La(e||[]),[""]))},onEntryChange:function(e,t){var n=La(this.modelValue||[]);n[t]=e,this.$emit("update:modelValue",n)},removeEntry:function(e){if(e>-1&&this.modelValue){var t=this.modelValue.filter((function(t,n){return n!==e}));this.$emit("update:modelValue",t)}}}});$a.render=Aa;var qa=$a;function Wa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var za={class:"multiPairField form-group"},Ga={key:1,class:"fieldUiControl fieldUiControl2"},Ya={key:2,class:"fieldUiControl fieldUiControl3"},Ja={key:3,class:"fieldUiControl fieldUiControl4"},Ka=["onClick","title"];function Qa(e,t,n,r,o,a){var i=Object(K["resolveComponent"])("Field");return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",za,[(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(e.modelValue,(function(t,n){var r;return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",{class:Object(K["normalizeClass"])(["multiPairFieldTable multiple valign-wrapper",(r={},Wa(r,"multiPairFieldTable".concat(n),!0),Wa(r,"has".concat(e.fieldCount,"Fields"),!0),r)]),key:n},[e.field1?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",{key:0,class:Object(K["normalizeClass"])(["fieldUiControl fieldUiControl1",{hasMultiFields:e.field1.type&&e.field2.type}])},[Object(K["createVNode"])(i,{"full-width":!0,"model-value":t[e.field1.key],options:e.field1.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field1.key,t)},"model-modifiers":e.field1.modelModifiers,placeholder:" ",uicontrol:e.field1.uiControl,name:"".concat(e.name,"-p1-").concat(n),title:e.field1.title,"template-file":e.field1.templateFile,component:e.field1.component},null,8,["model-value","options","onUpdate:modelValue","model-modifiers","uicontrol","name","title","template-file","component"])],2)):Object(K["createCommentVNode"])("",!0),e.field2?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Ga,[Object(K["createVNode"])(i,{"full-width":!0,options:e.field2.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field2.key,t)},"model-value":t[e.field2.key],"model-modifiers":e.field2.modelModifiers,placeholder:" ",uicontrol:e.field2.uiControl,name:"".concat(e.name,"-p2-").concat(n),title:e.field2.title,"template-file":e.field2.templateFile,component:e.field2.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","name","title","template-file","component"])])):Object(K["createCommentVNode"])("",!0),e.field3?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Ya,[Object(K["createVNode"])(i,{"full-width":!0,options:e.field3.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field3.key,t)},"model-value":t[e.field3.key],"model-modifiers":e.field3.modelModifiers,placeholder:" ",uicontrol:e.field3.uiControl,title:e.field3.title,"template-file":e.field3.templateFile,component:e.field3.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","title","template-file","component"])])):Object(K["createCommentVNode"])("",!0),e.field4?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Ja,[Object(K["createVNode"])(i,{"full-width":!0,options:e.field4.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field4.key,t)},"model-value":t[e.field4.key],"model-modifiers":e.field4.modelModifiers,placeholder:" ",uicontrol:e.field4.uiControl,title:e.field4.title,"template-file":e.field4.templateFile,component:e.field4.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","title","template-file","component"])])):Object(K["createCommentVNode"])("",!0),Object(K["withDirectives"])(Object(K["createElementVNode"])("span",{onClick:function(t){return e.removeEntry(n)},class:"icon-minus valign",title:e.translate("General_Remove")},null,8,Ka),[[K["vShow"],n+1!==e.modelValue.length]])],2)})),128))])}function Xa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Za(e){return ri(e)||ni(e)||ti(e)||ei()}function ei(){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 ti(e,t){if(e){if("string"===typeof e)return oi(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)?oi(e,t):void 0}}function ni(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function ri(e){if(Array.isArray(e))return oi(e)}function oi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ai=ft("CorePluginsAdmin","Field"),ii=Object(K["defineComponent"])({props:{modelValue:Array,name:String,field1:Object,field2:Object,field3:Object,field4:Object},components:{Field:ai},computed:{fieldCount:function(){return this.field1&&this.field2&&this.field3&&this.field4?4:this.field1&&this.field2&&this.field3?3:this.field1&&this.field2?2:this.field1?1:0}},emits:["update:modelValue"],watch:{modelValue:function(e){this.checkEmptyModelValue(e)}},mounted:function(){this.checkEmptyModelValue(this.modelValue)},methods:{checkEmptyModelValue:function(e){e&&e.length&&!this.isEmptyValue(e.slice(-1)[0])||this.$emit("update:modelValue",[].concat(Za(e||[]),[this.makeEmptyValue()]))},onEntryChange:function(e,t,n){var r=Za(this.modelValue);r[e]=Object.assign(Object.assign({},r[e]),{},Xa({},t,n)),this.$emit("update:modelValue",r)},removeEntry:function(e){if(e>-1&&this.modelValue){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}}});ii.render=Qa;var li=ii,ci={ref:"root",class:"periodSelector piwikSelector"},si=["title"],ui=Object(K["createElementVNode"])("span",{class:"icon icon-calendar"},null,-1),di={id:"periodMore",class:"dropdown"},mi={class:"flex"},pi={key:0,class:"period-date"},fi={class:"period-type"},hi={id:"otherPeriods"},bi=["onDblclick","title"],gi=["id","checked","onChange","onDblclick"],vi={key:0,class:"compare-checkbox"},yi={id:"comparePeriodToDropdown"},Oi={key:1,class:"compare-date-range"},ji={id:"comparePeriodStartDate"},wi=Object(K["createElementVNode"])("span",{class:"compare-dates-separator"},null,-1),ki={id:"comparePeriodEndDate"},Si={class:"apply-button-container"},Ci=["disabled","value"],Ei={key:2,id:"ajaxLoadingCalendar"},Di={class:"loadingSegment"};function Pi(e,t,n,r,o,a){var i=Object(K["resolveComponent"])("DateRangePicker"),l=Object(K["resolveComponent"])("PeriodDatePicker"),c=Object(K["resolveComponent"])("Field"),s=Object(K["resolveComponent"])("ActivityIndicator"),u=Object(K["resolveDirective"])("expand-on-click");return Object(K["withDirectives"])((Object(K["openBlock"])(),Object(K["createElementBlock"])("div",ci,[Object(K["createElementVNode"])("a",{ref:"title",id:"date",class:"title",tabindex:"-1",title:e.translate("General_ChooseDate",e.currentlyViewingText)},[ui,Object(K["createTextVNode"])(" "+Object(K["toDisplayString"])(e.currentlyViewingText),1)],8,si),Object(K["createElementVNode"])("div",di,[Object(K["createElementVNode"])("div",mi,[Object(K["createElementVNode"])("div",null,[Object(K["withDirectives"])(Object(K["createVNode"])(i,{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"]),[[K["vShow"],"range"===e.selectedPeriod]]),"range"!==e.selectedPeriod?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",pi,[Object(K["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(K["createCommentVNode"])("",!0)]),Object(K["createElementVNode"])("div",fi,[Object(K["createElementVNode"])("h6",null,Object(K["toDisplayString"])(e.translate("General_Period")),1),Object(K["createElementVNode"])("div",hi,[(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(e.periodsFiltered,(function(n){return Object(K["openBlock"])(),Object(K["createElementBlock"])("p",{key:n},[Object(K["createElementVNode"])("label",{class:Object(K["normalizeClass"])({"selected-period-label":n===e.selectedPeriod}),onDblclick:function(t){return e.changeViewedPeriod(n)},title:n===e.periodValue?"":e.translate("General_DoubleClickToChangePeriod")},[Object(K["withDirectives"])(Object(K["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,gi),[[K["vModelRadio"],e.selectedPeriod]]),Object(K["createElementVNode"])("span",null,Object(K["toDisplayString"])(e.getPeriodDisplayText(n)),1)],42,bi)])})),128))])])]),e.isComparisonEnabled?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",vi,[Object(K["createElementVNode"])("label",null,[Object(K["withDirectives"])(Object(K["createElementVNode"])("input",{id:"comparePeriodTo",type:"checkbox","onUpdate:modelValue":t[4]||(t[4]=function(t){return e.isComparing=t})},null,512),[[K["vModelCheckbox"],e.isComparing]]),Object(K["createElementVNode"])("span",null,Object(K["toDisplayString"])(e.translate("General_CompareTo")),1)]),Object(K["createElementVNode"])("div",yi,[Object(K["createVNode"])(c,{modelValue:e.comparePeriodType,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.comparePeriodType=t}),style:Object(K["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(K["createCommentVNode"])("",!0),e.isComparing&&"custom"===e.comparePeriodType?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Oi,[Object(K["createElementVNode"])("div",null,[Object(K["createElementVNode"])("div",ji,[Object(K["createElementVNode"])("div",null,[Object(K["createVNode"])(c,{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"])])]),wi,Object(K["createElementVNode"])("div",ki,[Object(K["createElementVNode"])("div",null,[Object(K["createVNode"])(c,{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(K["createCommentVNode"])("",!0),Object(K["createElementVNode"])("div",Si,[Object(K["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,Ci)]),e.isLoadingNewPage?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Ei,[Object(K["createVNode"])(s,{loading:!0}),Object(K["createElementVNode"])("div",Di,Object(K["toDisplayString"])(e.translate("SegmentEditor_LoadingSegmentedDataMayTakeSomeTime")),1)])):Object(K["createCommentVNode"])("",!0)])],512)),[[u,{expander:"title"}]])}function Ti(e,t){return Bi(e)||xi(e,t)||Ni(e,t)||Vi()}function Vi(){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 Ni(e,t){if(e){if("string"===typeof e)return Ii(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)?Ii(e,t):void 0}}function Ii(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xi(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done);i=!0)if(a.push(r.value),t&&a.length===t)break}catch(c){l=!0,o=c}finally{try{i||null==n["return"]||n["return"]()}finally{if(l)throw o}}return a}}function Bi(e){if(Array.isArray(e))return e}var Ai=ft("CorePluginsAdmin","Field"),Li=ce.helper.htmlDecode(" "),Mi=[{key:"custom",value:a("General_Custom")},{key:"previousPeriod",value:a("General_PreviousPeriod").replace(/\s+/,Li)},{key:"previousYear",value:a("General_PreviousYear").replace(/\s+/,Li)}],_i=new Date(ce.minDateYear,ce.minDateMonth-1,ce.minDateDay),Fi=new Date(ce.maxDateYear,ce.maxDateMonth-1,ce.maxDateDay);function Ri(e){return"[object Date]"===Object.prototype.toString.call(e)&&!Number.isNaN(e.getTime())}var Hi=Object(K["defineComponent"])({props:{periods:Array},components:{DateRangePicker:so,PeriodDatePicker:ho,Field:Ai,ActivityIndicator:Nt},directives:{ExpandOnClick:sn},data:function(){var e=Ce.parsed.value.period;return{comparePeriodDropdownOptions:Mi,periodValue:e,dateValue:null,selectedPeriod:e,startRangeDate:null,endRangeDate:null,isRangeValid:null,isLoadingNewPage:!1,isComparing:null,comparePeriodType:"previousPeriod",compareStartDate:"",compareEndDate:""}},mounted:function(){var e=this;ce.on("hidePeriodSelector",(function(){window.$(e.$refs.root).hide()})),ce.on("matomoPageChange",(function(){window.$(e.$refs.root).show()})),this.updateSelectedValuesFromHash(),Object(K["watch"])((function(){return Ce.parsed.value}),this.updateSelectedValuesFromHash),this.isComparing=xr.isComparingPeriods(),Object(K["watch"])((function(){return xr.isComparingPeriods()}),(function(t){e.isComparing=t})),window.initTopControls(),this.handleZIndexPositionRelativeCompareDropdownIssue()},computed:{currentlyViewingText:function(){var e;if("range"===this.periodValue){if(!this.startRangeDate||!this.endRangeDate)return a("General_Error");e="".concat(this.startRangeDate,",").concat(this.endRangeDate)}else{if(!this.dateValue)return a("General_Error");e=p(this.dateValue)}try{return m.parse(this.periodValue,e).getPrettyString()}catch(t){return a("General_Error")}},isComparisonEnabled:function(){return xr.isComparisonEnabled()},periodsFiltered:function(){return(this.periods||[]).filter((function(e){return m.isRecognizedPeriod(e)}))},selectedComparisonParams:function(){if(!this.isComparing)return{};if("custom"===this.comparePeriodType)return{comparePeriods:["range"],compareDates:["".concat(this.compareStartDate,",").concat(this.compareEndDate)]};if("previousPeriod"===this.comparePeriodType)return{comparePeriods:[this.selectedPeriod],compareDates:[this.previousPeriodDateToSelectedPeriod]};if("previousYear"===this.comparePeriodType){var e="range"===this.selectedPeriod?"".concat(this.startRangeDate,",").concat(this.endRangeDate):p(this.dateValue),t=m.parse(this.selectedPeriod,e).getDateRange();return t[0].setFullYear(t[0].getFullYear()-1),t[1].setFullYear(t[1].getFullYear()-1),"range"===this.selectedPeriod?{comparePeriods:["range"],compareDates:["".concat(p(t[0]),",").concat(p(t[1]))]}:{comparePeriods:[this.selectedPeriod],compareDates:[p(t[0])]}}return console.warn("Unknown compare period type: ".concat(this.comparePeriodType)),{}},previousPeriodDateToSelectedPeriod:function(){if("range"===this.selectedPeriod){var e=h(this.startRangeDate),t=h(this.endRangeDate),n=Y.getLastNRange("day",2,e).startDate,r=Math.floor((t.valueOf()-e.valueOf())/864e5),o=Y.getLastNRange("day",1+r,n);return"".concat(p(o.startDate),",").concat(p(o.endDate))}var a=Y.getLastNRange(this.selectedPeriod,2,this.dateValue).startDate;return p(a)},selectedDateString:function(){if("range"===this.selectedPeriod){var e=this.startRangeDate,t=this.endRangeDate,n=h(e),r=h(t);return!Ri(n)||!Ri(r)||n>r?(window.$("#alert").find("h2").text(a("General_InvalidDateRange")),ce.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(e){e!==this.periodValue&&"range"!==e&&this.setPiwikPeriodAndDate(e,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;ce.helper.isReportingPage()?(this.closePeriodSelector(),n=Ce.hashParsed.value):(this.isLoadingNewPage=!0,n=Ce.parsed.value);var o=Object.assign({},n);delete o.comparePeriods,delete o.compareDates,Ce.updateLocation(Object.assign(Object.assign({},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=Ce.parsed.value.date,t=Ce.parsed.value.period;this.periodValue=t,this.selectedPeriod=t,this.dateValue=null,this.startRangeDate=null,this.endRangeDate=null;try{m.parse(t,e)}catch(l){return}if("range"===t){var n=m.get(t).parse(e),r=n.getDateRange(),o=Ti(r,2),a=o[0],i=o[1];this.dateValue=a,this.startRangeDate=p(a),this.endRangeDate=p(i)}else this.dateValue=h(e),this.setRangeStartEndFromPeriod(t,e)},setRangeStartEndFromPeriod:function(e,t){var n=m.parse(e,t).getDateRange();this.startRangeDate=p(n[0]<_i?_i:n[0]),this.endRangeDate=p(n[1]>Fi?Fi:n[1])},getPeriodDisplayText:function(e){return m.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{h(this.compareStartDate)}catch(e){return!1}try{h(this.compareEndDate)}catch(e){return!1}return!0}}});Hi.render=Pi;var Ui=Hi,$i={class:"reportingMenu"},qi=["aria-label"],Wi=["onClick"],zi={class:"hidden"},Gi={role:"menu"},Yi=["href","onClick","title"],Ji=["href","onClick"],Ki=["onClick"],Qi=Object(K["createElementVNode"])("span",{class:"icon-help"},null,-1),Xi=[Qi],Zi={id:"mobile-left-menu",class:"sidenav hide-on-large-only"},el={class:"collapsible collapsible-accordion"},tl={class:"collapsible-header"},nl={class:"collapsible-body"},rl={key:0},ol=["onClick","href"],al={key:1},il=["onClick","href"];function ll(e,t,n,r,o,a){var i=Object(K["resolveComponent"])("MenuItemsDropdown"),l=Object(K["resolveDirective"])("side-nav");return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",$i,[Object(K["createElementVNode"])("ul",{class:"navbar hide-on-med-and-down",role:"menu","aria-label":e.translate("CoreHome_MainNavigation")},[(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(e.menu,(function(t){return Object(K["openBlock"])(),Object(K["createElementBlock"])("li",{class:Object(K["normalizeClass"])(["menuTab",{active:t.id===e.activeCategory}]),role:"menuitem",key:t.id},[Object(K["createElementVNode"])("a",{class:"item",tabindex:"5",href:"",onClick:Object(K["withModifiers"])((function(n){return e.loadCategory(t)}),["prevent"])},[Object(K["createElementVNode"])("span",{class:Object(K["normalizeClass"])("menu-icon ".concat(t.icon?t.icon:"icon-arrow-right"))},null,2),Object(K["createTextVNode"])(Object(K["toDisplayString"])(t.name)+" ",1),Object(K["createElementVNode"])("span",zi,Object(K["toDisplayString"])(e.translate("CoreHome_Menu")),1)],8,Wi),Object(K["createElementVNode"])("ul",Gi,[(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(t.subcategories,(function(n){return Object(K["openBlock"])(),Object(K["createElementBlock"])("li",{role:"menuitem",class:Object(K["normalizeClass"])({active:(n.id===e.displayedSubcategory||n.isGroup&&e.activeSubsubcategory===e.displayedSubcategory)&&t.id===e.displayedCategory}),key:n.id},[n.isGroup?(Object(K["openBlock"])(),Object(K["createBlock"])(i,{key:0,"show-search":!0,"menu-title":e.htmlEntities(n.name)},{default:Object(K["withCtx"])((function(){return[(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(n.subcategories,(function(r){return Object(K["openBlock"])(),Object(K["createElementBlock"])("a",{class:Object(K["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(K["toDisplayString"])(r.name),11,Yi)})),128))]})),_:2},1032,["menu-title"])):Object(K["createCommentVNode"])("",!0),n.isGroup?Object(K["createCommentVNode"])("",!0):(Object(K["openBlock"])(),Object(K["createElementBlock"])("a",{key:1,href:"#?".concat(e.makeUrl(t,n)),class:"item",onClick:function(r){return e.loadSubcategory(t,n,r)}},Object(K["toDisplayString"])(n.name),9,Ji)),n.help?(Object(K["openBlock"])(),Object(K["createElementBlock"])("a",{key:2,class:Object(K["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)}},Xi,10,Ki)):Object(K["createCommentVNode"])("",!0)],2)})),128))])],2)})),128))],8,qi),Object(K["createElementVNode"])("ul",Zi,[(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(e.menu,(function(t){return Object(K["openBlock"])(),Object(K["createElementBlock"])("li",{class:"no-padding",key:t.id},[Object(K["withDirectives"])(Object(K["createElementVNode"])("ul",el,[Object(K["createElementVNode"])("li",null,[Object(K["createElementVNode"])("a",tl,[Object(K["createElementVNode"])("i",{class:Object(K["normalizeClass"])(t.icon?t.icon:"icon-arrow-bottom")},null,2),Object(K["createTextVNode"])(Object(K["toDisplayString"])(t.name),1)]),Object(K["createElementVNode"])("div",nl,[Object(K["createElementVNode"])("ul",null,[(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(t.subcategories,(function(n){return Object(K["openBlock"])(),Object(K["createElementBlock"])("li",{key:n.id},[n.isGroup?(Object(K["openBlock"])(),Object(K["createElementBlock"])("span",rl,[(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(n.subcategories,(function(n){return Object(K["openBlock"])(),Object(K["createElementBlock"])("a",{onClick:function(r){return e.loadSubcategory(t,n)},href:"#?".concat(e.makeUrl(t,n)),key:n.id},Object(K["toDisplayString"])(n.name),9,ol)})),128))])):Object(K["createCommentVNode"])("",!0),n.isGroup?Object(K["createCommentVNode"])("",!0):(Object(K["openBlock"])(),Object(K["createElementBlock"])("span",al,[Object(K["createElementVNode"])("a",{onClick:function(r){return e.loadSubcategory(t,n)},href:"#?".concat(e.makeUrl(t,n))},Object(K["toDisplayString"])(n.name),9,il)]))])})),128))])])])],512),[[l,{activator:e.sideNavActivator}]])])})),128))])])}function cl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ul(e,t,n){return t&&sl(e.prototype,t),n&&sl(e,n),e}function dl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,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 ws(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 Os(e){if(e&&e[0]){var t=fs(e),n=e[0];return n.group?t[0]=Object.assign(Object.assign({},t[0]),{},{left:Os(n.left||[]),right:Os(n.right||[])}):t[0]=Object.assign(Object.assign({},t[0]),{},{isFirstInPage:!0}),t}return e}var js=function(){function e(){var t=this;us(this,e),ps(this,"privateState",Object(o["reactive"])({})),ps(this,"state",Object(o["computed"])((function(){return Object(o["readonly"])(t.privateState)}))),ps(this,"page",Object(o["computed"])((function(){return t.state.value.page}))),ps(this,"widgets",Object(o["computed"])((function(){var e=t.page.value;if(!e)return[];var n=[],r={},i=function(e){return e.isReport&&r["".concat(e.module,".").concat(e.action)]},o=function(e){if(!e.isReport)return[];var t=pc.findReport(e.module,e.action);return t&&t.relatedReports?t.relatedReports:[]};if((e.widgets||[]).forEach((function(e){i(e)||(o(e).forEach((function(e){r["".concat(e.module,".").concat(e.action)]=!0})),n.push(e))})),n=Fl(n),1===n.length)return Os(n);for(var a=[],l=0;l<n.length;l+=1){var c=n[l];if(ws(c)||n[l+1]&&ws(n[l+1]))a.push(Object.assign(Object.assign({},c),{},{widgets:Fl(Zl(c))}));else{var s=0,u=[c],d=[];while(n[l+1]&&!ws(n[l+1]))l+=1,s+=1,s%2===0?u.push(n[l]):d.push(n[l]);a.push({group:!0,left:u,right:d})}}var m=Os(a);return m})))}return ms(e,[{key:"fetchPage",value:function(e,t){var n=this;return this.resetPage(),Promise.all([Tl.getAllPages(),pc.fetchReportMetadata()]).then((function(){return n.privateState.page=Tl.findPage(e,t),n.page.value}))}},{key:"resetPage",value:function(){this.privateState.page=void 0}}]),e}(),ks=new js;function Ss(){var e="category=General_Visitors&subcategory=Live_VisitorLog",t=window.broadcast.buildReportingUrl(e);wl.show({id:"onlyRawData",animate:!1,context:"info",message:C("CoreHome_PeriodHasOnlyRawData",'<a href="'.concat(t,'">'),"</a>"),type:"transient"})}function Cs(){wl.remove("onlyRawData")}var Es=Object(o["defineComponent"])({components:{ActivityIndicator:Oa,Widget:os},data:function(){return{loading:!1,hasRawData:!1,hasNoVisits:!1,dateLastChecked:null,hasNoPage:!1}},created:function(){var e=this;ks.resetPage(),this.loading=!0,this.renderInitialPage(),Object(o["watch"])((function(){return Ee.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||(Cs(),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 ks.widgets.value}},methods:{renderPage:function(e,t){var n=this;if(!e||!t)return ks.resetPage(),void(this.loading=!1);var r=Ee.parsed.value,i=r.period,o=r.date;try{m.parse(i,o)}catch(l){return wl.show({id:"invalidDate",animate:!1,context:"error",message:C("CoreHome_DateInvalid"),type:"transient"}),ks.resetPage(),void(this.loading=!1)}wl.remove("invalidDate"),S.postEvent("matomoPageChange",{}),wl.clearTransientNotifications(),m.parse(i,o).containsToday()&&this.showOnlyRawDataMessageIfRequired();var a={category:e,subcategory:t};if(S.postEvent("ReportingPage.loadPage",a),a.promise)return this.loading=!0,void Promise.resolve(a.promise).finally((function(){n.loading=!1}));ks.fetchPage(e,t).then((function(){var t=!ks.page.value;if(t){var r=Tl.findPageInCategory(e);if(r&&r.subcategory)return void Ee.updateHash(Object.assign(Object.assign({},Ee.hashParsed.value),{},{subcategory:r.subcategory.id}))}n.hasNoPage=t,n.loading=!1}))},renderInitialPage:function(){var e=Ee.parsed.value;this.renderPage(e.category,e.subcategory)},showOnlyRawDataMessageIfRequired:function(){var e=this;this.hasRawData&&this.hasNoVisits&&Ss();var t=Ee.parsed.value,n=t.segment;if(n)Cs();else{var r=["Live_VisitorLog","General_RealTime","UserCountryMap_RealTimeMap","MediaAnalytics_TypeAudienceLog","MediaAnalytics_TypeRealTime","FormAnalytics_TypeRealTime","Goals_AddNewGoal"],i=["HeatmapSessionRecording_Heatmaps","HeatmapSessionRecording_SessionRecordings","Marketplace_Marketplace"],o=t.subcategory,a=t.category;if(-1===r.indexOf(o)&&-1===i.indexOf(a)&&-1===o.toLowerCase().indexOf("manage")){var l=6e4;this.dateLastChecked&&(new Date).valueOf()-this.dateLastChecked.valueOf()<l||Ze.fetch({method:"VisitsSummary.getVisits"}).then((function(t){return e.dateLastChecked=new Date,t.value>0?(e.hasNoVisits=!1,void Cs()):(e.hasNoVisits=!0,e.hasRawData?void Ss():Ze.fetch({method:"Live.getLastVisitsDetails",filter_limit:1,doNotFetchActions:1}).then((function(t){if(!t||0===t.length)return e.hasRawData=!1,void Cs();e.hasRawData=!0,Ss()})))}))}else Cs()}}}});Es.render=ss;var Ds=Es,Ps=(Vt({component:Ds,directiveName:"piwikReportingPage"}),{class:"report-export-popover row",id:"reportExport"}),Vs={class:"col l6"},Ns={name:"format"},Ts={name:"option_flat"},As={name:"option_expanded"},xs={name:"option_format_metrics"},Is={class:"col l6"},Bs={name:"filter_type"},Ms={class:"filter_limit"},Ls={name:"filter_limit_all"},Fs={key:0,name:"filter_limit"},Rs={key:1,name:"filter_limit"},_s={class:"col l12"},$s=["value"],Hs=Object(o["createTextVNode"])("\n "),Us=[Hs],qs=["innerHTML"],Ws={class:"col l12"},Js=["href","title"]; + */var ml=function(){function e(){var t=this;cl(this,e),dl(this,"privateState",Object(K["reactive"])({pages:[]})),dl(this,"state",Object(K["computed"])((function(){return Object(K["readonly"])(t.privateState)}))),dl(this,"fetchAllPagesPromise",void 0),dl(this,"pages",Object(K["computed"])((function(){return t.state.value.pages})))}return ul(e,[{key:"findPageInCategory",value:function(e){return this.pages.value.find((function(t){return t&&t.category&&t.category.id===e&&t.subcategory&&t.subcategory.id}))}},{key:"findPage",value:function(e,t){return this.pages.value.find((function(n){return n&&n.category&&n.subcategory&&n.category.id===e&&"".concat(n.subcategory.id)===t}))}},{key:"reloadAllPages",value:function(){return delete this.fetchAllPagesPromise,this.getAllPages()}},{key:"getAllPages",value:function(){var e=this;return this.fetchAllPagesPromise||(this.fetchAllPagesPromise=Je.fetch({method:"API.getReportPagesMetadata",filter_limit:"-1"}).then((function(t){return e.privateState.pages=t,e.pages.value}))),this.fetchAllPagesPromise.then((function(){return e.pages.value}))}}]),e}(),pl=new ml;function fl(e){return vl(e)||gl(e)||bl(e)||hl()}function hl(){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 bl(e,t){if(e){if("string"===typeof e)return yl(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)?yl(e,t):void 0}}function gl(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function vl(e){if(Array.isArray(e))return yl(e)}function yl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Gs(e,t,n,r,i,a){var l=Object(o["resolveComponent"])("Field"),c=Object(o["resolveDirective"])("select-on-focus");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ps,[Object(o["createElementVNode"])("div",Vs,[Object(o["createElementVNode"])("div",Ns,[Object(o["createVNode"])(l,{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(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("div",Ts,[Object(o["withDirectives"])(Object(o["createVNode"])(l,{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"]),[[o["vShow"],e.hasSubtables]])])]),Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("div",As,[Object(o["withDirectives"])(Object(o["createVNode"])(l,{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"]),[[o["vShow"],e.hasSubtables&&!e.optionFlat]])])]),Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("div",xs,[Object(o["createVNode"])(l,{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(o["createElementVNode"])("div",Is,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("div",Bs,[Object(o["createVNode"])(l,{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(o["createElementVNode"])("div",Ms,[Object(o["withDirectives"])(Object(o["createElementVNode"])("div",Ls,[Object(o["createVNode"])(l,{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),[[o["vShow"],!e.maxFilterLimit||e.maxFilterLimit<=0]]),"no"===e.reportLimitAll&&e.maxFilterLimit<=0?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Fs,[Object(o["createVNode"])(l,{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(o["createCommentVNode"])("",!0),"no"===e.reportLimitAll&&e.maxFilterLimit>0?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Rs,[Object(o["createVNode"])(l,{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(o["createCommentVNode"])("",!0)])]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",_s,[Object(o["withDirectives"])(Object(o["createElementVNode"])("textarea",{readonly:"",class:"exportFullUrl",value:e.exportLinkWithoutToken},Us,8,$s),[[c,{}]]),Object(o["createElementVNode"])("div",{class:"tooltip",innerHTML:e.$sanitize(e.translate("CoreHome_ExportTooltipWithLink","<a target=_blank href='?module=UsersManager&action=userSecurity'>","</a>","ENTER_YOUR_TOKEN_AUTH_HERE"))},null,8,qs)],512),[[o["vShow"],e.showUrl]]),Object(o["createElementVNode"])("div",Ws,[Object(o["createElementVNode"])("a",{class:"btn",href:e.exportLink,target:"_new",title:e.translate("CoreHome_ExportTooltip")},Object(o["toDisplayString"])(e.translate("General_Export")),9,Js),Object(o["createElementVNode"])("a",{href:"javascript:",onClick:t[8]||(t[8]=function(t){return e.showUrl=!e.showUrl}),class:"toggle-export-url"},[Object(o["withDirectives"])(Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.translate("CoreHome_ShowExportUrl")),513),[[o["vShow"],!e.showUrl]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.translate("CoreHome_HideExportUrl")),513),[[o["vShow"],e.showUrl]])])])])}function zs(e,t){return Zs(e)||Xs(e,t)||Qs(e,t)||Ys()}function Ys(){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 Qs(e,t){if(e){if("string"===typeof e)return Ks(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)?Ks(e,t):void 0}}function Ks(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Xs(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0)if(o.push(r.value),t&&o.length===t)break}catch(c){l=!0,i=c}finally{try{a||null==n["return"]||n["return"]()}finally{if(l)throw i}}return o}}function Zs(e){if(Array.isArray(e))return e}var eu=vt("CorePluginsAdmin","Field"),tu=Object(o["defineComponent"])({components:{Field:eu},directives:{SelectOnFocus:kn},props:{hasSubtables:Boolean,availableReportTypes:Object,availableReportFormats:{type:Object,required:!0},maxFilterLimit:Number,limitAllOptions:Object,dataTable:{type:Object,required:!0},requestParams:[Object,String],apiMethod:{type:String,required:!0},initialReportType:{type:String,default:"default"},initialReportLimit:{type:[String,Number],default:100},initialReportLimitAll:{type:String,default:"yes"},initialOptionFlat:{type:Boolean,default:!1},initialOptionExpanded:{type:Boolean,default:!0},initialOptionFormatMetrics:{type:Boolean,default:!1},initialReportFormat:{type:String,default:"XML"}},data:function(){return{showUrl:!1,reportFormat:this.initialReportFormat,optionFlat:this.initialOptionFlat,optionExpanded:this.initialOptionExpanded,optionFormatMetrics:this.initialOptionFormatMetrics,reportType:this.initialReportType,reportLimitAll:this.initialReportLimitAll,reportLimit:"string"===typeof this.initialReportLimit?parseInt(this.initialReportLimit,10):this.initialReportLimit}},watch:{reportType:function(e){this.availableReportFormats[e][this.reportFormat]||(this.reportFormat="XML")},reportLimit:function(e,t){this.maxFilterLimit&&this.maxFilterLimit>0&&e>this.maxFilterLimit&&(this.reportLimit=t)}},computed:{filterLimitTooltip:function(){var e=C("CoreHome_RowLimit"),t=this.maxFilterLimit?C("General_ComputedMetricMax",this.maxFilterLimit.toString()):"";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.reportFormat,n=this.apiMethod,r=this.reportType,i=this.dataTable;if(t){var o={},a="yes"===this.reportLimitAll?-1:this.reportLimit;this.requestParams&&"string"===typeof this.requestParams&&(o=JSON.parse(this.requestParams));var l=i.param,c=l.segment,s=l.label,u=l.idGoal,d=l.idDimension,m=l.idSite,p=i.param,f=p.date,h=p.period;"RSS"===t&&(f="last10"),"undefined"!==typeof i.param.dateUsedInGraph&&(f=i.param.dateUsedInGraph);var g=S.config.datatable_export_range_as_day.toLowerCase();-1!==g.indexOf(t.toLowerCase())&&"range"===i.param.period&&(h="day"),"range"===i.param.period&&"graphEvolution"===i.param.viewDataTable&&(h="day");var v={module:"API",format:t,idSite:m,period:h,date:f};if("processed"===r){v.method="API.getProcessedReport";var b=n.split("."),y=zs(b,2);v.apiModule=y[0],v.apiAction=y[1]}else v.method=n;if(i.param.compareDates&&i.param.compareDates.length&&(v.compareDates=i.param.compareDates,v.compare="1"),i.param.comparePeriods&&i.param.comparePeriods.length&&(v.comparePeriods=i.param.comparePeriods,v.compare="1"),i.param.compareSegments&&i.param.compareSegments.length&&(v.compareSegments=i.param.compareSegments,v.compare="1"),"undefined"!==typeof i.param.filter_pattern&&(v.filter_pattern=i.param.filter_pattern),"undefined"!==typeof i.param.filter_pattern_recursive&&(v.filter_pattern_recursive=i.param.filter_pattern_recursive),window.$.isPlainObject(o)&&Object.entries(o).forEach((function(e){var t=zs(e,2),n=t[0],r=t[1],i=r;!0===i?i=1:!1===i&&(i=0),v[n]=i})),this.optionFlat&&(v.flat=1,"undefined"!==typeof i.param.include_aggregate_rows&&"1"===i.param.include_aggregate_rows&&(v.include_aggregate_rows=1)),!this.optionFlat&&this.optionExpanded&&(v.expanded=1),this.optionFormatMetrics&&(v.format_metrics=1),i.param.pivotBy&&(v.pivotBy=i.param.pivotBy,v.pivotByColumnLimit=20,i.props.pivot_by_column&&(v.pivotByColumn=i.props.pivot_by_column)),"CSV"!==t&&"TSV"!==t&&"RSS"!==t||(v.translateColumnNames=1,v.language=S.language),"undefined"!==typeof c&&(v.segment=decodeURIComponent(c)),"undefined"!==typeof u&&"-1"!==u&&(v.idGoal=u),"undefined"!==typeof d&&"-1"!==d&&(v.idDimension=d),s){var w=s.split(",");if(w.length>1)v.label=w;else{var O=zs(w,1);v.label=O[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(Ee.stringify(v))}}}});tu.render=Gs;var nu=tu,ru=window,iu=ru.$,ou={mounted:function(e,t){e.addEventListener("click",(function(){var n=Ee.hashParsed.value.popover,r=iu(e).closest("[data-report]").data("uiControlObject"),i=window.Piwik_Popover.showLoading("Export"),o=t.value.reportFormats,a=r.param.filter_limit;t.value.maxFilterLimit>0&&(a=Math.min(a,t.value.maxFilterLimit));var l=!0===r.param.flat||1===r.param.flat||"1"===r.param.flat,c={initialReportType:"default",initialReportLimit:a>0?a:100,initialReportLimitAll:-1===a?"yes":"no",initialOptionFlat:l,initialOptionExpanded:!0,initialOptionFormatMetrics:!1,hasSubtables:l||r.numberOfSubtables>0,availableReportFormats:{default:o,processed:{XML:o.XML,JSON:o.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=dt({template:'\n <popover v-bind="bind"/>',data:function(){return{bind:c}}});s.component("popover",nu);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(){Ee.updateHash(Object.assign(Object.assign({},Ee.hashParsed.value),{},{popover:n})),t.value.onClose&&t.value.onClose()}),100)})),setTimeout((function(){i.dialog(),iu(".exportFullUrl, .btn",i).tooltip({track:!0,show:!1,hide:!1})}),100)}))}}; + */function Ol(e){var t=fl(e||[]);return t.sort((function(e,t){return e.order<t.order?-1:e.order>t.order?1:0})),t} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ + */function jl(e){var t=e;return t.subcategories?t.subcategories:[]} /*! * 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){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(){window.angular.element(document).injector().get("$rootScope").$apply()}),10)}},oldValue:null,modifiers:{},dir:{}};ou.mounted(n[0],r)}}}au.$inject=["$timeout"],window.angular.module("piwikApp").directive("piwikReportExport",au);var lu=["src","width","height"];function cu(e,t,n,r,i,a){return Object(o["openBlock"])(),Object(o["createElementBlock"])("img",{loading:"lazy",alt:"",src:e.sparklineUrl,width:e.width,height:e.height},null,8,lu)}function su(e){return su="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},su(e)}var uu=Object(o["defineComponent"])({props:{seriesIndices:Array,params:[Object,String],width:Number,height:Number},data:function(){return{isWidget:!1}},mounted:function(){this.isWidget=!!this.$el.closest("[widgetId]")},computed:{sparklineUrl:function(){var e=this.seriesIndices,t=this.params,n=S.getSparklineColors();e&&(n.lineColor=n.lineColor.filter((function(t,n){return-1!==e.indexOf(n)})));var r=JSON.stringify(n),i={forceView:"1",viewDataTable:"sparkline",widget:this.isWidget?"1":"0",showtitle:"1",colors:r,random:Date.now(),date:this.defaultDate,segment:Ee.parsed.value.segment},o="object"===su(t)?t:Ee.parse(t.substring(t.indexOf("?")+1)),a=new Ze,l=a.mixinDefaultGetParams(Object.assign(Object.assign({},i),o)),c=Ee.parsed.value.token_auth;return c&&c.length&&S.shouldPropagateTokenAuth&&(l.token_auth=c),"?".concat(Ee.stringify(l))},defaultDate:function(){if("range"===S.period)return"".concat(S.startDateString,",").concat(S.endDateString);var e=H.getLastNRange(S.period,30,S.currentDateString).getDateRange(),t=new Date(S.minDateYear,S.minDateMonth-1,S.minDateDay);e[0]<t&&(e[0]=t);var n=D(e[0]),r=D(e[1]);return"".concat(n,",").concat(r)}}});uu.render=cu;var du=uu,mu=(Vt({component:du,scope:{seriesIndices:{angularJsBind:"<"},params:{angularJsBind:"<"}},directiveName:"piwikSparkline",restrict:"E"}),{class:"progressbar"}),pu={class:"progress"},fu=Object(o["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",style:{"margin-right":"3.5px"}},null,-1),hu=["innerHTML"]; + */function wl(e){var t=e;return t.subcategories?t.subcategories:[]}function kl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Cl(e,t,n){return t&&Sl(e.prototype,t),n&&Sl(e,n),e}function El(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,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 gu(e,t,n,r,i,a){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",mu,[Object(o["createElementVNode"])("div",pu,[Object(o["createElementVNode"])("div",{class:"determinate",style:Object(o["normalizeStyle"])([{width:"0"},{width:"".concat(e.actualProgress,"%")}])},null,4)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",null,[fu,Object(o["createElementVNode"])("span",{class:"label",innerHTML:e.$sanitize(e.label)},null,8,hu)],512),[[o["vShow"],!!e.label]])])}var vu=Object(o["defineComponent"])({props:{progress:{type:Number,required:!0},label:String},computed:{actualProgress:function(){return this.progress>100?100:this.progress<0?0:this.progress}}});vu.render=gu;var bu=vu,yu=(Vt({component:bu,scope:{progress:{angularJsBind:"="},label:{angularJsBind:"="}},directiveName:"piwikProgressbar"}),{mounted:function(e){e.classList.add("piwik-content-intro")},updated:function(e){Object(o["nextTick"])((function(){e.classList.add("piwik-content-intro")}))}}); + */function Dl(e){var t=parseFloat(e);return!Number.isNaN(t)&&Number.isFinite(t)}var Pl=function(){function e(){var t=this;kl(this,e),El(this,"privateState",Object(K["reactive"])({activeSubcategoryId:null,activeSubsubcategoryId:null})),El(this,"state",Object(K["computed"])((function(){return Object(K["readonly"])(t.privateState)}))),El(this,"activeCategory",Object(K["computed"])((function(){return"undefined"!==typeof t.state.value.activeCategoryId?t.state.value.activeCategoryId:Ce.parsed.value.category}))),El(this,"activeSubcategory",Object(K["computed"])((function(){return t.state.value.activeSubcategoryId||Ce.parsed.value.subcategory}))),El(this,"activeSubsubcategory",Object(K["computed"])((function(){var e=t.state.value.activeSubsubcategoryId;if(e)return e;var n=t.findSubcategory(t.activeCategory.value,t.activeSubcategory.value);return n.subsubcategory&&n.subsubcategory.id===t.activeSubcategory.value?n.subsubcategory.id:null}))),El(this,"menu",Object(K["computed"])((function(){return t.buildMenuFromPages()})))}return Cl(e,[{key:"fetchMenuItems",value:function(){var e=this;return pl.getAllPages().then((function(){return e.menu.value}))}},{key:"reloadMenuItems",value:function(){var e=this;return pl.reloadAllPages().then((function(){return e.menu.value}))}},{key:"findSubcategory",value:function(e,t){var n=void 0,r=void 0,o=void 0;return this.menu.value.forEach((function(a){a.id===e&&(jl(a)||[]).forEach((function(e){e.id===t&&(n=a,r=e),e.isGroup&&(wl(e)||[]).forEach((function(i){i.id===t&&(n=a,r=e,o=i)}))}))})),{category:n,subcategory:r,subsubcategory:o}}},{key:"buildMenuFromPages",value:function(){var e=[],t=Ce.parsed.value.category,n=Ce.parsed.value.subcategory,r=pl.pages.value,o={};return r.forEach((function(i){var l=Object.assign({},i.category),c=l.id,s=c===t;if(!o[c]){o[c]=!0,l.subcategories=[];var u=null,d=r.filter((function(e){return e.category.id===c}));d.forEach((function(e){var t=Object.assign({},e.subcategory),r=t.id===n&&s;if(e.widgets&&e.widgets[0]&&Dl(e.subcategory.id)){u||(u=Object.assign({},t),u.name=a("CoreHome_ChooseX",[l.name]),u.isGroup=!0,u.subcategories=[],u.order=10),r&&(u.name=t.name);var o=t.id;return t.tooltip="".concat(t.name," (id = ").concat(o,")"),void u.subcategories.push(t)}l.subcategories.push(t)})),u&&u.subcategories&&u.subcategories.length<=5?u.subcategories.forEach((function(e){return l.subcategories.push(e)})):u&&l.subcategories.push(u),l.subcategories=Ol(jl(l)),e.push(l)}})),Ol(e)}},{key:"toggleCategory",value:function(e){return this.privateState.activeSubcategoryId=null,this.privateState.activeSubsubcategoryId=null,this.activeCategory.value===e.id?(this.privateState.activeCategoryId=null,!1):(this.privateState.activeCategoryId=e.id,!0)}},{key:"enterSubcategory",value:function(e,t,n){e&&t&&(this.privateState.activeCategoryId=e.id,this.privateState.activeSubcategoryId=t.id,n&&(this.privateState.activeSubsubcategoryId=n.id))}}]),e}(),Tl=new Pl;function Vl(e){return Vl="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vl(e)}function Nl(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<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function xl(e,t,n){return t&&Il(e.prototype,t),n&&Il(e,n),e}function Bl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,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 Al(e){var t=e;return t.widgets?t.widgets:[]}var Ll=function(){function e(){var t=this;Nl(this,e),Bl(this,"privateState",Object(K["reactive"])({isFetchedFirstTime:!1,categorizedWidgets:{}})),Bl(this,"state",Object(K["computed"])((function(){return t.privateState.isFetchedFirstTime||t.fetchAvailableWidgets(),Object(K["readonly"])(t.privateState)}))),Bl(this,"widgets",Object(K["computed"])((function(){return t.state.value.categorizedWidgets})))}return xl(e,[{key:"fetchAvailableWidgets",value:function(){var e=this;return Ce.parsed.value.idSite?(this.privateState.isFetchedFirstTime=!0,new Promise((function(t,n){try{window.widgetsHelper.getAvailableWidgets((function(n){var r=n;e.privateState.categorizedWidgets=r,t(e.widgets.value)}))}catch(r){n(r)}}))):Promise.resolve(this.widgets.value)}},{key:"reloadAvailableWidgets",value:function(){return"object"===Vl(window.widgetsHelper)&&window.widgetsHelper.availableWidgets&&delete window.widgetsHelper.availableWidgets,this.fetchAvailableWidgets()}}]),e}(),Ml=new Ll,_l="reportingmenu-help",Fl=Object(K["defineComponent"])({components:{MenuItemsDropdown:Jr},directives:{SideNav:En},props:{},data:function(){return{showSubcategoryHelpOnLoad:null,initialLoad:!0,helpShownCategory:null}},computed:{sideNavActivator:function(){return document.querySelector("nav .activateLeftMenu")},menu:function(){return Tl.menu.value},activeCategory:function(){return Tl.activeCategory.value},activeSubcategory:function(){return Tl.activeSubcategory.value},activeSubsubcategory:function(){return Tl.activeSubsubcategory.value},displayedCategory:function(){return Ce.parsed.value.category},displayedSubcategory:function(){return Ce.parsed.value.subcategory}},created:function(){var e=this;Tl.fetchMenuItems().then((function(t){if(!Ce.parsed.value.subcategory){var n=t[0],r=n.subcategories[0];Tl.enterSubcategory(n,r),e.propagateUrlChange(n,r)}})),Object(K["watch"])((function(){return Ce.parsed.value}),(function(e){var t=Tl.findSubcategory(e.category,e.subcategory);Tl.enterSubcategory(t.category,t.subcategory,t.subsubcategory)})),ce.on("matomoPageChange",(function(){e.initialLoad||window.globalAjaxQueue.abort(),e.helpShownCategory=null,e.showSubcategoryHelpOnLoad&&(e.showHelp(e.showSubcategoryHelpOnLoad.category,e.showSubcategoryHelpOnLoad.subcategory),e.showSubcategoryHelpOnLoad=null),window.$("#loadingError,#loadingRateLimitError").hide(),e.initialLoad=!1})),ce.on("updateReportingMenu",(function(){Tl.reloadMenuItems().then((function(){var e=Ce.parsed.value.category,t=Ce.parsed.value.subcategory;if(e&&t){var n=Tl.findSubcategory(e,t);n.category&&Tl.enterSubcategory(n.category,n.subcategory,n.subsubcategory)}})),Ml.reloadAvailableWidgets()}))},methods:{propagateUrlChange:function(e,t){var n=Ce.parsed.value;n.category===e.id&&n.subcategory===t.id?this.loadSubcategory(e,t):Ce.updateHash(Object.assign(Object.assign({},Ce.hashParsed.value),{},{category:e.id,subcategory:t.id}))},loadCategory:function(e){_o.remove(_l);var t=Tl.toggleCategory(e);if(t&&e.subcategories&&1===e.subcategories.length){this.helpShownCategory=null;var n=e.subcategories[0];this.propagateUrlChange(e,n)}},loadSubcategory:function(e,t,n){n&&(n.shiftKey||n.ctrlKey||n.metaKey)||(_o.remove(_l),t&&t.id===this.activeSubcategory&&(this.helpShownCategory=null,setTimeout((function(){ce.postEvent("loadPage",e.id,t.id)}))))},makeUrl:function(e,t){var n=Ce.parsed.value,r=n.idSite,o=n.period,a=n.date,i=n.segment,l=n.comparePeriods,c=n.compareDates,s=n.compareSegments;return Ce.stringify({idSite:r,period:o,date:a,segment:i,comparePeriods:l,compareDates:c,compareSegments:s,category:e.id,subcategory:t.id})},htmlEntities:function(e){return ce.helper.htmlEntities(e)},showHelp:function(e,t,n){var r=Ce.parsed.value,o=r.category,i=r.subcategory;if((o!==e.id||i!==t.id)&&n)return this.showSubcategoryHelpOnLoad={category:e,subcategory:t},void Ce.updateHash(Object.assign(Object.assign({},Ce.hashParsed.value),{},{category:e.id,subcategory:t.id}));if(this.helpShownCategory&&e.id===this.helpShownCategory.category&&t.id===this.helpShownCategory.subcategory)return _o.remove(_l),void(this.helpShownCategory=null);var l=a("CoreHome_ReportingCategoryHelpPrefix",e.name,t.name),c="<strong>".concat(l,"</strong><br/>");_o.show({context:"info",id:_l,type:"help",noclear:!0,class:"help-notification",message:c+t.help,placeat:"#notificationContainer",prepend:!0}),this.helpShownCategory={category:e.id,subcategory:t.id}}}});Fl.render=ll;var Rl=Fl;function Hl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ul(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $l(e,t,n){return t&&Ul(e.prototype,t),n&&Ul(e,n),e}function ql(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,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 wu(){return{restrict:"A",link:function(e,t){yu.mounted(t[0])}}}window.angular.module("piwikApp").directive("piwikContentIntro",wu); + */var Wl=function(){function e(){var t=this;Hl(this,e),ql(this,"privateState",Object(K["reactive"])({reports:[]})),ql(this,"state",Object(K["readonly"])(this.privateState)),ql(this,"reports",Object(K["computed"])((function(){return t.state.reports}))),ql(this,"reportsPromise",void 0)}return $l(e,[{key:"findReport",value:function(e,t){return this.reports.value.find((function(n){return n.module===e&&n.action===t}))}},{key:"fetchReportMetadata",value:function(){var e=this;return this.reportsPromise||(this.reportsPromise=Je.fetch({method:"API.getReportMetadata",filter_limit:"-1",idSite:ce.idSite||Ce.parsed.value.idSite}).then((function(t){return e.privateState.reports=t,t}))),this.reportsPromise.then((function(){return e.reports.value}))}}]),e}(),zl=new Wl,Gl={class:"widgetLoader"},Yl={key:0},Jl={key:1,class:"notification system notification-error"},Kl={key:0,rel:"noreferrer noopener",target:"_blank",href:"https://matomo.org/faq/troubleshooting/faq_19489/"},Ql={key:2,class:"notification system notification-error"},Xl={class:"theWidgetContent",ref:"widgetContent"};function Zl(e,t,n,r,o,a){var i=Object(K["resolveComponent"])("ActivityIndicator");return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Gl,[Object(K["createVNode"])(i,{"loading-message":e.loadingMessage,loading:e.loading},null,8,["loading-message","loading"]),Object(K["withDirectives"])(Object(K["createElementVNode"])("div",null,[e.widgetName?(Object(K["openBlock"])(),Object(K["createElementBlock"])("h2",Yl,Object(K["toDisplayString"])(e.widgetName),1)):Object(K["createCommentVNode"])("",!0),e.loadingFailedRateLimit?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Ql,Object(K["toDisplayString"])(e.translate("General_ErrorRateLimit")),1)):(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Jl,[Object(K["createTextVNode"])(Object(K["toDisplayString"])(e.translate("General_ErrorRequest","",""))+" ",1),e.hasErrorFaqLink?(Object(K["openBlock"])(),Object(K["createElementBlock"])("a",Kl,Object(K["toDisplayString"])(e.translate("General_ErrorRequestFaqLink")),1)):Object(K["createCommentVNode"])("",!0)]))],512),[[K["vShow"],e.loadingFailed]]),Object(K["createElementVNode"])("div",Xl,null,512)])}var ec=Object(K["defineComponent"])({props:{widgetParams:Object,widgetName:String},components:{ActivityIndicator:Nt},data:function(){return{loading:!1,loadingFailed:!1,loadingFailedRateLimit:!1,changeCounter:0,lastWidgetAbortController:null}},watch:{widgetParams:function(e){e&&this.loadWidgetUrl(e,this.changeCounter+=1)}},computed:{loadingMessage:function(){return this.widgetName?a("General_LoadingPopover",this.widgetName):a("General_LoadingData")},hasErrorFaqLink:function(){var e=ce.config.enable_general_settings_admin,t=ce.config.enable_plugins_admin;return ce.hasSuperUserAccess&&(e||t)}},mounted:function(){this.widgetParams&&this.loadWidgetUrl(this.widgetParams,this.changeCounter+=1)},beforeUnmount:function(){this.cleanupLastWidgetContent()},methods:{abortHttpRequestIfNeeded:function(){this.lastWidgetAbortController&&(this.lastWidgetAbortController.abort(),this.lastWidgetAbortController=null)},cleanupLastWidgetContent:function(){var e=this.$refs.widgetContent;ce.helper.destroyVueComponent(e),e&&(e.innerHTML="")},getWidgetUrl:function(e){var t=Ce.parsed.value,n=Object.assign({},e||{}),r=Object.keys(Object.assign(Object.assign({},Ce.hashParsed.value),{},{idSite:"",period:"",date:"",segment:"",widget:""}));return r.forEach((function(e){"category"!==e&&"subcategory"!==e&&(e in n||(n[e]=t[e]))})),xr.isComparisonEnabled()&&(n=Object.assign(Object.assign({},n),{},{comparePeriods:t.comparePeriods,compareDates:t.compareDates,compareSegments:t.compareSegments})),e&&"showtitle"in e||(n.showtitle="1"),ce.shouldPropagateTokenAuth&&t.token_auth&&(ce.broadcast.isWidgetizeRequestWithoutSession()||(n.force_api_session="1"),n.token_auth=t.token_auth),n.random=Math.floor(1e4*Math.random()),n},loadWidgetUrl:function(e,t){var n=this;this.loading=!0,this.abortHttpRequestIfNeeded(),this.cleanupLastWidgetContent(),this.lastWidgetAbortController=new AbortController,Je.fetch(this.getWidgetUrl(e),{format:"html",headers:{"X-Requested-With":"XMLHttpRequest"},abortController:this.lastWidgetAbortController}).then((function(r){if(t===n.changeCounter&&r&&"string"===typeof r){n.lastWidgetAbortController=null,n.loading=!1,n.loadingFailed=!1;var o=n.$refs.widgetContent;window.$(o).html(r);var a=window.$(o).children();if(n.widgetName){var i=a.find("> .card-content .card-title");i.length||(i=a.find("> h2")),i.length&&i.html(ce.helper.htmlEntities(n.widgetName))}ce.helper.compileVueEntryComponents(a),_o.parseNotificationDivs(),setTimeout((function(){ce.postEvent("widget:loaded",{parameters:e,element:a})}))}})).catch((function(e){t===n.changeCounter&&(n.lastWidgetAbortController=null,n.cleanupLastWidgetContent(),n.loading=!1,"abort"!==e.xhrStatus&&(429===e.status&&(n.loadingFailedRateLimit=!0),n.loadingFailed=!0))}))}}});ec.render=Zl;var tc=ec,nc={class:"widget-container"};function rc(e,t,n,r,o,a){var i=Object(K["resolveComponent"])("Widget");return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",nc,[(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(e.actualContainer,(function(e,t){return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",{key:t},[Object(K["createElementVNode"])("div",null,[Object(K["createVNode"])(i,{widget:e,"prevent-recursion":!0},null,8,["widget"])])])})),128))])}function oc(e){return lc(e)||ic(e)||uc(e)||ac()}function ac(){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 ic(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function lc(e){if(Array.isArray(e))return dc(e)}function cc(e,t){return pc(e)||mc(e,t)||uc(e,t)||sc()}function sc(){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 uc(e,t){if(e){if("string"===typeof e)return dc(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)?dc(e,t):void 0}}function dc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function mc(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done);i=!0)if(a.push(r.value),t&&a.length===t)break}catch(c){l=!0,o=c}finally{try{i||null==n["return"]||n["return"]()}finally{if(l)throw o}}return a}}function pc(e){if(Array.isArray(e))return e}var fc=ft("CoreHome","Widget"),hc=Object(K["defineComponent"])({props:{container:{type:Array,required:!0}},components:{Widget:fc},computed:{actualContainer:function(){var e,t,n,r=this.container;if(null===r||void 0===r||null===(e=r[0])||void 0===e||!e.parameters)return r;var o=cc(r,1),a=o[0],i="1"===(null===(t=a.parameters)||void 0===t?void 0:t.widget)||1===(null===(n=a.parameters)||void 0===n?void 0:n.widget),l=i&&"graphEvolution"===a.viewDataTable,c=l?Object.assign(Object.assign({},a),{},{parameters:Object.assign(Object.assign({},a.parameters),{},{showtitle:"0"})}):a;return[c].concat(oc(r.slice(1)))}}});hc.render=rc;var bc=hc,gc={class:"reportsByDimensionView"},vc={class:"entityList"},yc={class:"listCircle"},Oc=["onClick"],jc={class:"dimension"},wc={class:"reportContainer"},kc=Object(K["createElementVNode"])("div",{class:"clear"},null,-1);function Sc(e,t,n,r,o,a){var i=Object(K["resolveComponent"])("WidgetLoader");return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",gc,[Object(K["createElementVNode"])("div",vc,[(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(e.widgetsByCategory,(function(t){return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",{class:"dimensionCategory",key:t.name},[Object(K["createTextVNode"])(Object(K["toDisplayString"])(t.name)+" ",1),Object(K["createElementVNode"])("ul",yc,[(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(t.widgets,(function(t){return Object(K["openBlock"])(),Object(K["createElementBlock"])("li",{class:Object(K["normalizeClass"])(["reportDimension",{activeDimension:e.selectedWidget.uniqueId===t.uniqueId}]),key:t.uniqueId,onClick:function(n){return e.selectWidget(t)}},[Object(K["createElementVNode"])("span",jc,Object(K["toDisplayString"])(t.name),1)],10,Oc)})),128))])])})),128))]),Object(K["createElementVNode"])("div",wc,[e.selectedWidget.parameters?(Object(K["openBlock"])(),Object(K["createBlock"])(i,{key:0,"widget-params":e.selectedWidget.parameters,class:"dimensionReport"},null,8,["widget-params"])):Object(K["createCommentVNode"])("",!0)]),kc])}function Cc(e,t){return Vc(e)||Tc(e,t)||Dc(e,t)||Ec()}function Ec(){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 Dc(e,t){if(e){if("string"===typeof e)return Pc(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)?Pc(e,t):void 0}}function Pc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Tc(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done);i=!0)if(a.push(r.value),t&&a.length===t)break}catch(c){l=!0,o=c}finally{try{i||null==n["return"]||n["return"]()}finally{if(l)throw o}}return a}}function Vc(e){if(Array.isArray(e))return e}var Nc=Object(K["defineComponent"])({props:{widgets:Array},components:{WidgetLoader:tc},data:function(){return{selectedWidget:null}},created:function(){var e=Cc(this.widgetsSorted,1);this.selectedWidget=e[0]},computed:{widgetsSorted:function(){return Ol(this.widgets)},widgetsByCategory:function(){var e={};return this.widgetsSorted.forEach((function(t){var n,r=null===(n=t.subcategory)||void 0===n?void 0:n.name;r&&(e[r]||(e[r]={name:r,order:t.order,widgets:[]}),e[r].widgets.push(t))})),Ol(Object.values(e))}},methods:{selectWidget:function(e){this.selectedWidget=Object.assign({},e)}}});Nc.render=Sc;var Ic=Nc,xc=["id"],Bc={key:1},Ac={key:2};function Lc(e,t,n,r,o,a){var i=Object(K["resolveComponent"])("WidgetLoader"),l=Object(K["resolveComponent"])("WidgetContainer"),c=Object(K["resolveComponent"])("WidgetByDimensionContainer"),s=Object(K["resolveDirective"])("tooltips");return e.actualWidget?Object(K["withDirectives"])((Object(K["openBlock"])(),Object(K["createElementBlock"])("div",{key:0,class:Object(K["normalizeClass"])(["matomo-widget",{isFirstWidgetInPage:e.actualWidget.isFirstInPage}]),id:e.actualWidget.uniqueId},[!e.actualWidget.isContainer&&e.actualWidget.parameters?(Object(K["openBlock"])(),Object(K["createBlock"])(i,{key:0,"widget-params":e.actualWidget.parameters,"widget-name":e.actualWidget.name},null,8,["widget-params","widget-name"])):Object(K["createCommentVNode"])("",!0),e.actualWidget.isContainer&&"ByDimension"!==e.actualWidget.layout&&!this.preventRecursion?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Bc,[Object(K["createElementVNode"])("div",null,[Object(K["createVNode"])(l,{container:e.actualWidget.widgets},null,8,["container"])])])):Object(K["createCommentVNode"])("",!0),e.actualWidget.isContainer&&"ByDimension"===e.actualWidget.layout?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Ac,[Object(K["createElementVNode"])("div",null,[Object(K["createVNode"])(c,{widgets:e.actualWidget.widgets},null,8,["widgets"])])])):Object(K["createCommentVNode"])("",!0)],10,xc)),[[K["vShow"],e.showWidget],[s,{content:e.tooltipContent}]]):Object(K["createCommentVNode"])("",!0)}function Mc(e,t){var n=void 0;return Object.values(e||{}).some((function(e){return n=e.find((function(e){var n;return e&&e.isContainer&&(null===(n=e.parameters)||void 0===n?void 0:n.containerId)===t})),n})),n}var _c=Object(K["defineComponent"])({props:{widget:Object,widgetized:Boolean,containerid:String,preventRecursion:Boolean},components:{WidgetLoader:tc,WidgetContainer:bc,WidgetByDimensionContainer:Ic},directives:{Tooltips:Jt},data:function(){return{showWidget:!1}},setup:function(){function e(){var e=window.$(this);if(e.hasClass("matomo-form-field"))return"";var t=window.$(this).attr("title")||"";return window.vueSanitize(t.replace(/\n/g,"<br />"))}return{tooltipContent:e}},created:function(){var e=this,t=this.actualWidget;if(t&&t.middlewareParameters){var n=t.middlewareParameters;Je.fetch(n).then((function(t){e.showWidget=!!t}))}else this.showWidget=!0},computed:{allWidgets:function(){return Ml.widgets.value},actualWidget:function(){var e=this,t=this.widget;if(t){var n=Object.assign({},t);if(t&&t.isReport&&!t.documentation){var r=zl.findReport(t.module,t.action);r&&r.documentation&&(n.documentation=r.documentation)}return t}if(this.containerid){var o=Mc(this.allWidgets,this.containerid);if(o){var a=Object.assign({},o);if(this.widgetized){a.isFirstInPage=!0,a.parameters=Object.assign(Object.assign({},a.parameters),{},{widget:"1"});var i=Al(a);i&&(a.widgets=i.map((function(t){return Object.assign(Object.assign({},t),{},{parameters:Object.assign(Object.assign({},t.parameters),{},{widget:"1",containerId:e.containerid})})})))}return a}}return null}}});_c.render=Lc;var Fc=_c,Rc={class:"reporting-page"},Hc={key:1,class:"col s12 l6 leftWidgetColumn"},Uc={key:2,class:"col s12 l6 rightWidgetColumn"};function $c(e,t,n,r,o,a){var i=Object(K["resolveComponent"])("ActivityIndicator"),l=Object(K["resolveComponent"])("Widget");return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Rc,[Object(K["createVNode"])(i,{loading:e.loading},null,8,["loading"]),Object(K["withDirectives"])(Object(K["createElementVNode"])("div",null,Object(K["toDisplayString"])(e.translate("CoreHome_NoSuchPage")),513),[[K["vShow"],e.hasNoPage]]),(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(e.widgets,(function(e){return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",{class:"row",key:e.uniqueId},[e.group?Object(K["createCommentVNode"])("",!0):(Object(K["openBlock"])(),Object(K["createBlock"])(l,{key:0,class:"col s12 fullWidgetColumn",widget:e},null,8,["widget"])),e.group?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Hc,[(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(e.left,(function(e){return Object(K["openBlock"])(),Object(K["createBlock"])(l,{widget:e,key:e.uniqueId},null,8,["widget"])})),128))])):Object(K["createCommentVNode"])("",!0),e.group?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Uc,[(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(e.right,(function(e){return Object(K["openBlock"])(),Object(K["createBlock"])(l,{widget:e,key:e.uniqueId},null,8,["widget"])})),128))])):Object(K["createCommentVNode"])("",!0)])})),128))])}function qc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function zc(e,t,n){return t&&Wc(e.prototype,t),n&&Wc(e,n),e}function Gc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yc(e){return Xc(e)||Qc(e)||Kc(e)||Jc()}function Jc(){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 Kc(e,t){if(e){if("string"===typeof e)return Zc(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)?Zc(e,t):void 0}}function Qc(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Xc(e){if(Array.isArray(e))return Zc(e)}function Zc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var Ou={mounted:function(e,t){var n;null!==t&&void 0!==t&&null!==(n=t.value)&&void 0!==n&&n.off||e.classList.add("card","card-table","entityTable")},updated:function(e,t){var n;null!==t&&void 0!==t&&null!==(n=t.value)&&void 0!==n&&n.off||Object(o["nextTick"])((function(){e.classList.add("card","card-table","entityTable")}))}}; + */function es(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 ts(e){if(e&&e[0]){var t=Yc(e),n=e[0];return n.group?t[0]=Object.assign(Object.assign({},t[0]),{},{left:ts(n.left||[]),right:ts(n.right||[])}):t[0]=Object.assign(Object.assign({},t[0]),{},{isFirstInPage:!0}),t}return e}var ns=function(){function e(){var t=this;qc(this,e),Gc(this,"privateState",Object(K["reactive"])({})),Gc(this,"state",Object(K["computed"])((function(){return Object(K["readonly"])(t.privateState)}))),Gc(this,"page",Object(K["computed"])((function(){return t.state.value.page}))),Gc(this,"widgets",Object(K["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)]},a=function(e){if(!e.isReport)return[];var t=zl.findReport(e.module,e.action);return t&&t.relatedReports?t.relatedReports:[]};if((e.widgets||[]).forEach((function(e){o(e)||(a(e).forEach((function(e){r["".concat(e.module,".").concat(e.action)]=!0})),n.push(e))})),n=Ol(n),1===n.length)return ts(n);for(var i=[],l=0;l<n.length;l+=1){var c=n[l];if(es(c)||n[l+1]&&es(n[l+1]))i.push(Object.assign(Object.assign({},c),{},{widgets:Ol(Al(c))}));else{var s=0,u=[c],d=[];while(n[l+1]&&!es(n[l+1]))l+=1,s+=1,s%2===0?u.push(n[l]):d.push(n[l]);i.push({group:!0,left:u,right:d})}}var m=ts(i);return m})))}return zc(e,[{key:"fetchPage",value:function(e,t){var n=this;return this.resetPage(),Promise.all([pl.getAllPages(),zl.fetchReportMetadata()]).then((function(){return n.privateState.page=pl.findPage(e,t),n.page.value}))}},{key:"resetPage",value:function(){this.privateState.page=void 0}}]),e}(),rs=new ns;function os(){var e="category=General_Visitors&subcategory=Live_VisitorLog",t=window.broadcast.buildReportingUrl(e);_o.show({id:"onlyRawData",animate:!1,context:"info",message:a("CoreHome_PeriodHasOnlyRawData",'<a href="'.concat(t,'">'),"</a>"),type:"transient"})}function as(){_o.remove("onlyRawData")}var is=Object(K["defineComponent"])({components:{ActivityIndicator:Nt,Widget:Fc},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(K["watch"])((function(){return Ce.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||(as(),e.dateLastChecked=null,e.hasRawData=!1,e.hasNoVisits=!1),e.renderPage(t.category,t.subcategory))})),ce.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=Ce.parsed.value,o=r.period,i=r.date;try{m.parse(o,i)}catch(c){return _o.show({id:"invalidDate",animate:!1,context:"error",message:a("CoreHome_DateInvalid"),type:"transient"}),rs.resetPage(),void(this.loading=!1)}_o.remove("invalidDate"),ce.postEvent("matomoPageChange",{}),_o.clearTransientNotifications(),m.parse(o,i).containsToday()&&this.showOnlyRawDataMessageIfRequired();var l={category:e,subcategory:t};if(ce.postEvent("ReportingPage.loadPage",l),l.promise)return this.loading=!0,void Promise.resolve(l.promise).finally((function(){n.loading=!1}));rs.fetchPage(e,t).then((function(){var t=!rs.page.value;if(t){var r=pl.findPageInCategory(e);if(r&&r.subcategory)return void Ce.updateHash(Object.assign(Object.assign({},Ce.hashParsed.value),{},{subcategory:r.subcategory.id}))}n.hasNoPage=t,n.loading=!1}))},renderInitialPage:function(){var e=Ce.parsed.value;this.renderPage(e.category,e.subcategory)},showOnlyRawDataMessageIfRequired:function(){var e=this;this.hasRawData&&this.hasNoVisits&&os();var t=Ce.parsed.value,n=t.segment;if(n)as();else{var r=["Live_VisitorLog","General_RealTime","UserCountryMap_RealTimeMap","MediaAnalytics_TypeAudienceLog","MediaAnalytics_TypeRealTime","FormAnalytics_TypeRealTime","Goals_AddNewGoal"],o=["HeatmapSessionRecording_Heatmaps","HeatmapSessionRecording_SessionRecordings","Marketplace_Marketplace"],a=t.subcategory,i=t.category;if(-1===r.indexOf(a)&&-1===o.indexOf(i)&&-1===a.toLowerCase().indexOf("manage")){var l=6e4;this.dateLastChecked&&(new Date).valueOf()-this.dateLastChecked.valueOf()<l||Je.fetch({method:"VisitsSummary.getVisits"}).then((function(t){return e.dateLastChecked=new Date,t.value>0?(e.hasNoVisits=!1,void as()):(e.hasNoVisits=!0,e.hasRawData?void os():Je.fetch({method:"Live.getLastVisitsDetails",filter_limit:1,doNotFetchActions:1}).then((function(t){if(!t||0===t.length)return e.hasRawData=!1,void as();e.hasRawData=!0,os()})))}))}else as()}}}});is.render=$c;var ls=is,cs={class:"report-export-popover row",id:"reportExport"},ss={class:"col l6"},us={name:"format"},ds={name:"option_flat"},ms={name:"option_expanded"},ps={name:"option_format_metrics"},fs={class:"col l6"},hs={name:"filter_type"},bs={class:"filter_limit"},gs={name:"filter_limit_all"},vs={key:0,name:"filter_limit"},ys={key:1,name:"filter_limit"},Os={class:"col l12"},js=["value"],ws=Object(K["createTextVNode"])("\n "),ks=[ws],Ss=["innerHTML"],Cs={class:"col l12"},Es=["href","title"];function Ds(e,t,n,r,o,a){var i=Object(K["resolveComponent"])("Field"),l=Object(K["resolveDirective"])("select-on-focus");return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",cs,[Object(K["createElementVNode"])("div",ss,[Object(K["createElementVNode"])("div",us,[Object(K["createVNode"])(i,{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(K["createElementVNode"])("div",null,[Object(K["createElementVNode"])("div",ds,[Object(K["withDirectives"])(Object(K["createVNode"])(i,{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"]),[[K["vShow"],e.hasSubtables]])])]),Object(K["createElementVNode"])("div",null,[Object(K["createElementVNode"])("div",ms,[Object(K["withDirectives"])(Object(K["createVNode"])(i,{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"]),[[K["vShow"],e.hasSubtables&&!e.optionFlat]])])]),Object(K["createElementVNode"])("div",null,[Object(K["createElementVNode"])("div",ps,[Object(K["createVNode"])(i,{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(K["createElementVNode"])("div",fs,[Object(K["createElementVNode"])("div",null,[Object(K["createElementVNode"])("div",hs,[Object(K["createVNode"])(i,{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(K["createElementVNode"])("div",bs,[Object(K["withDirectives"])(Object(K["createElementVNode"])("div",gs,[Object(K["createVNode"])(i,{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),[[K["vShow"],!e.maxFilterLimit||e.maxFilterLimit<=0]]),"no"===e.reportLimitAll&&e.maxFilterLimit<=0?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",vs,[Object(K["createVNode"])(i,{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(K["createCommentVNode"])("",!0),"no"===e.reportLimitAll&&e.maxFilterLimit>0?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",ys,[Object(K["createVNode"])(i,{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(K["createCommentVNode"])("",!0)])]),Object(K["withDirectives"])(Object(K["createElementVNode"])("div",Os,[Object(K["withDirectives"])(Object(K["createElementVNode"])("textarea",{readonly:"",class:"exportFullUrl",value:e.exportLinkWithoutToken},ks,8,js),[[l,{}]]),Object(K["createElementVNode"])("div",{class:"tooltip",innerHTML:e.$sanitize(e.translate("CoreHome_ExportTooltipWithLink","<a target=_blank href='?module=UsersManager&action=userSecurity'>","</a>","ENTER_YOUR_TOKEN_AUTH_HERE"))},null,8,Ss)],512),[[K["vShow"],e.showUrl]]),Object(K["createElementVNode"])("div",Cs,[Object(K["createElementVNode"])("a",{class:"btn",href:e.exportLink,target:"_new",title:e.translate("CoreHome_ExportTooltip")},Object(K["toDisplayString"])(e.translate("General_Export")),9,Es),Object(K["createElementVNode"])("a",{href:"javascript:",onClick:t[8]||(t[8]=function(t){return e.showUrl=!e.showUrl}),class:"toggle-export-url"},[Object(K["withDirectives"])(Object(K["createElementVNode"])("span",null,Object(K["toDisplayString"])(e.translate("CoreHome_ShowExportUrl")),513),[[K["vShow"],!e.showUrl]]),Object(K["withDirectives"])(Object(K["createElementVNode"])("span",null,Object(K["toDisplayString"])(e.translate("CoreHome_HideExportUrl")),513),[[K["vShow"],e.showUrl]])])])])}function Ps(e,t){return xs(e)||Is(e,t)||Vs(e,t)||Ts()}function Ts(){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 Vs(e,t){if(e){if("string"===typeof e)return Ns(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)?Ns(e,t):void 0}}function Ns(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Is(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done);i=!0)if(a.push(r.value),t&&a.length===t)break}catch(c){l=!0,o=c}finally{try{i||null==n["return"]||n["return"]()}finally{if(l)throw o}}return a}}function xs(e){if(Array.isArray(e))return e}var Bs=ft("CorePluginsAdmin","Field"),As=Object(K["defineComponent"])({components:{Field:Bs},directives:{SelectOnFocus:Cn},props:{hasSubtables:Boolean,availableReportTypes:Object,availableReportFormats:{type:Object,required:!0},maxFilterLimit:Number,limitAllOptions:Object,dataTable:{type:Object,required:!0},requestParams:[Object,String],apiMethod:{type:String,required:!0},initialReportType:{type:String,default:"default"},initialReportLimit:{type:[String,Number],default:100},initialReportLimitAll:{type:String,default:"yes"},initialOptionFlat:{type:Boolean,default:!1},initialOptionExpanded:{type:Boolean,default:!0},initialOptionFormatMetrics:{type:Boolean,default:!1},initialReportFormat:{type:String,default:"XML"}},data:function(){return{showUrl:!1,reportFormat:this.initialReportFormat,optionFlat:this.initialOptionFlat,optionExpanded:this.initialOptionExpanded,optionFormatMetrics:this.initialOptionFormatMetrics,reportType:this.initialReportType,reportLimitAll:this.initialReportLimitAll,reportLimit:"string"===typeof this.initialReportLimit?parseInt(this.initialReportLimit,10):this.initialReportLimit}},watch:{reportType:function(e){this.availableReportFormats[e][this.reportFormat]||(this.reportFormat="XML")},reportLimit:function(e,t){this.maxFilterLimit&&this.maxFilterLimit>0&&e>this.maxFilterLimit&&(this.reportLimit=t)}},computed:{filterLimitTooltip:function(){var e=a("CoreHome_RowLimit"),t=this.maxFilterLimit?a("General_ComputedMetricMax",this.maxFilterLimit.toString()):"";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.reportFormat,n=this.apiMethod,r=this.reportType,o=this.dataTable;if(t){var a={},i="yes"===this.reportLimitAll?-1:this.reportLimit;this.requestParams&&"string"===typeof this.requestParams&&(a=JSON.parse(this.requestParams));var l=o.param,c=l.segment,s=l.label,u=l.idGoal,d=l.idDimension,m=l.idSite,p=o.param,f=p.date,h=p.period;"RSS"===t&&(f="last10"),"undefined"!==typeof o.param.dateUsedInGraph&&(f=o.param.dateUsedInGraph);var b=ce.config.datatable_export_range_as_day.toLowerCase();-1!==b.indexOf(t.toLowerCase())&&"range"===o.param.period&&(h="day"),"range"===o.param.period&&"graphEvolution"===o.param.viewDataTable&&(h="day");var g={module:"API",format:t,idSite:m,period:h,date:f};if("processed"===r){g.method="API.getProcessedReport";var v=n.split("."),y=Ps(v,2);g.apiModule=y[0],g.apiAction=y[1]}else g.method=n;if(o.param.compareDates&&o.param.compareDates.length&&(g.compareDates=o.param.compareDates,g.compare="1"),o.param.comparePeriods&&o.param.comparePeriods.length&&(g.comparePeriods=o.param.comparePeriods,g.compare="1"),o.param.compareSegments&&o.param.compareSegments.length&&(g.compareSegments=o.param.compareSegments,g.compare="1"),"undefined"!==typeof o.param.filter_pattern&&(g.filter_pattern=o.param.filter_pattern),"undefined"!==typeof o.param.filter_pattern_recursive&&(g.filter_pattern_recursive=o.param.filter_pattern_recursive),window.$.isPlainObject(a)&&Object.entries(a).forEach((function(e){var t=Ps(e,2),n=t[0],r=t[1],o=r;!0===o?o=1:!1===o&&(o=0),g[n]=o})),this.optionFlat&&(g.flat=1,"undefined"!==typeof o.param.include_aggregate_rows&&"1"===o.param.include_aggregate_rows&&(g.include_aggregate_rows=1)),!this.optionFlat&&this.optionExpanded&&(g.expanded=1),this.optionFormatMetrics&&(g.format_metrics=1),o.param.pivotBy&&(g.pivotBy=o.param.pivotBy,g.pivotByColumnLimit=20,o.props.pivot_by_column&&(g.pivotByColumn=o.props.pivot_by_column)),"CSV"!==t&&"TSV"!==t&&"RSS"!==t||(g.translateColumnNames=1,g.language=ce.language),"undefined"!==typeof c&&(g.segment=decodeURIComponent(c)),"undefined"!==typeof u&&"-1"!==u&&(g.idGoal=u),"undefined"!==typeof d&&"-1"!==d&&(g.idDimension=d),s){var O=s.split(",");if(O.length>1)g.label=O;else{var j=Ps(O,1);g.label=j[0]}}g.token_auth="ENTER_YOUR_TOKEN_AUTH_HERE",!0===e&&(g.token_auth=ce.token_auth,g.force_api_session=1),g.filter_limit=i;var w=window.location.href.split("?")[0];return"".concat(w,"?").concat(Ce.stringify(g))}}}});As.render=Ds;var Ls=As,Ms=window,_s=Ms.$,Fs={mounted:function(e,t){e.addEventListener("click",(function(){var n=Ce.hashParsed.value.popover,r=_s(e).closest("[data-report]").data("uiControlObject"),o=window.Piwik_Popover.showLoading("Export"),i=t.value.reportFormats,l=r.param.filter_limit;t.value.maxFilterLimit>0&&(l=Math.min(l,t.value.maxFilterLimit));var c=!0===r.param.flat||1===r.param.flat||"1"===r.param.flat,s={initialReportType:"default",initialReportLimit:l>0?l:100,initialReportLimitAll:-1===l?"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:a("CoreHome_StandardReport"),processed:a("CoreHome_ReportWithMetadata")},limitAllOptions:{yes:a("General_All"),no:a("CoreHome_CustomLimit")},maxFilterLimit:t.value.maxFilterLimit,dataTable:r,requestParams:t.value.requestParams,apiMethod:t.value.apiMethod},u=ct({template:'\n <popover v-bind="bind"/>',data:function(){return{bind:s}}});u.component("popover",Ls);var d=document.createElement("div");u.mount(d);var m=t.value.reportTitle;window.Piwik_Popover.setTitle("".concat(a("General_Export")," ").concat(ce.helper.htmlEntities(m))),window.Piwik_Popover.setContent(d),window.Piwik_Popover.onClose((function(){u.unmount(),""!==n&&setTimeout((function(){Ce.updateHash(Object.assign(Object.assign({},Ce.hashParsed.value),{},{popover:n})),t.value.onClose&&t.value.onClose()}),100)})),setTimeout((function(){o.dialog(),_s(".exportFullUrl, .btn",o).tooltip({track:!0,show:!1,hide:!1})}),100)}))}},Rs=["src","width","height"]; /*! * 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(){return{restrict:"A",link:function(e,t){Ou.mounted(t[0])}}}window.angular.module("piwikApp").directive("piwikContentTable",ju);var ku={ref:"root"};function Su(e,t,n,r,i,a){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ku,[Object(o["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 Cu=window,Eu=Cu.$,Du=Object(o["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;Eu(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,Ze.post({module:"API",method:this.submitApiMethod},t,{createErrorNotification:!this.noErrorNotification}).then((function(t){if(e.successfulPostResponse=t,!e.noSuccessNotification){var n=wl.show({message:C("General_YourChangesHaveBeenSaved"),context:"success",type:"toast",id:"ajaxHelper"});wl.scrollToNotification(n)}})).catch((function(t){e.errorPostResponse=t.message})).finally((function(){e.isSubmitting=!1}))}}});Du.render=Su;var Pu=Du,Vu=window,Nu=Vu.$; + */function Hs(e,t,n,r,o,a){return Object(K["openBlock"])(),Object(K["createElementBlock"])("img",{class:"sparklineImg",loading:"lazy",alt:"",src:e.sparklineUrl,width:e.width,height:e.height},null,8,Rs)}function Us(e){return Us="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Us(e)}var $s=Object(K["defineComponent"])({props:{seriesIndices:Array,params:[Object,String],width:Number,height:Number},data:function(){return{isWidget:!1}},mounted:function(){this.isWidget=!!this.$el.closest("[widgetId]")},computed:{sparklineUrl:function(){var e=this.seriesIndices,t=this.params,n=ce.getSparklineColors();e&&(n.lineColor=n.lineColor.filter((function(t,n){return-1!==e.indexOf(n)})));var r=JSON.stringify(n),o={forceView:"1",viewDataTable:"sparkline",widget:this.isWidget?"1":"0",showtitle:"1",colors:r,random:Date.now(),date:this.defaultDate,segment:Ce.parsed.value.segment},a="object"===Us(t)?t:Ce.parse(t.substring(t.indexOf("?")+1)),i=new Je,l=i.mixinDefaultGetParams(Object.assign(Object.assign({},o),a)),c=Ce.parsed.value.token_auth;return c&&c.length&&ce.shouldPropagateTokenAuth&&(l.token_auth=c),"?".concat(Ce.stringify(l))},defaultDate:function(){if("range"===ce.period)return"".concat(ce.startDateString,",").concat(ce.endDateString);var e=Y.getLastNRange(ce.period,30,ce.currentDateString).getDateRange(),t=new Date(ce.minDateYear,ce.minDateMonth-1,ce.minDateDay);e[0]<t&&(e[0]=t);var n=p(e[0]),r=p(e[1]);return"".concat(n,",").concat(r)}}});$s.render=Hs;var qs=$s,Ws={class:"progressbar"},zs={class:"progress"},Gs=Object(K["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",style:{"margin-right":"3.5px"}},null,-1),Ys=["innerHTML"];function Js(e,t,n,r,o,a){return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",Ws,[Object(K["createElementVNode"])("div",zs,[Object(K["createElementVNode"])("div",{class:"determinate",style:Object(K["normalizeStyle"])([{width:"0"},{width:"".concat(e.actualProgress,"%")}])},null,4)]),Object(K["withDirectives"])(Object(K["createElementVNode"])("span",null,[Gs,Object(K["createElementVNode"])("span",{class:"label",innerHTML:e.$sanitize(e.label)},null,8,Ys)],512),[[K["vShow"],!!e.label]])])}var Ks=Object(K["defineComponent"])({props:{progress:{type:Number,required:!0},label:String},computed:{actualProgress:function(){return this.progress>100?100:this.progress<0?0:this.progress}}});Ks.render=Js;var Qs=Ks,Xs={mounted:function(e){e.classList.add("piwik-content-intro")},updated:function(e){Object(K["nextTick"])((function(){e.classList.add("piwik-content-intro")}))}},Zs={mounted:function(e,t){var n;null!==t&&void 0!==t&&null!==(n=t.value)&&void 0!==n&&n.off||e.classList.add("card","card-table","entityTable")},updated:function(e,t){var n;null!==t&&void 0!==t&&null!==(n=t.value)&&void 0!==n&&n.off||Object(K["nextTick"])((function(){e.classList.add("card","card-table","entityTable")}))}},eu={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 Tu(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,i,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={},i){var l=e(r.ngModel);t.ajaxForm.data=l(t.$parent)}var c={mounted:function(e,n){t.ajaxForm.submitForm=n.value.submitForm}},s='\n <AjaxForm\n :form-data="data"\n :submit-api-method="submitApiMethod"\n :send-json-payload="sendJsonPayload"\n :no-error-notification="noErrorNotification"\n :no-success-notification="noSuccessNotification"\n >\n <template v-slot:default="ajaxFormVue">\n <div\n ref="transcludeTarget"\n v-special-bind-directive="{ submitForm: ajaxFormVue.submitForm }"\n />\n </template>\n </AjaxForm>',u=dt({template:s,data:function(){return t.ajaxForm},setup:function(){var e=Object(o["ref"])(null);return{transcludeTarget:e}}});u.component("AjaxForm",Pu),u.directive("SpecialBindDirective",c);var d=u.mount(n[0]);function m(e,n){var r,i=Nu(e).attr("name");r="checkbox"===Nu(e).attr("type")?Nu(e).is(":checked"):Nu(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){m(e.target)})),a(t,(function(e,t){if(!t.useCustomDataBinding){var n=e.find("input,select").not("[type=submit]");n.each((function(){m(this,!0)}))}Nu(d.transcludeTarget).append(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 Au(e,t){var n,r=parseInt(t,10),i=parseInt(e,10)-r;return n=0===i||Number.isNaN(i)?0:0===r||Number.isNaN(r)?100:i/r*100,n}function xu(e){return"".concat(e>0?S.numbers.symbolPlus:"").concat(Math.round(e),"}%")}function Iu(e,t){var n=Au(e,t);return xu(n)}Tu.$inject=["$parse"],window.angular.module("piwikApp").directive("piwikAjaxForm",Tu);var Bu={ref:"root"};function Mu(e,t,n,r,i,a){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Bu,[e.componentWrapper?(Object(o["openBlock"])(),Object(o["createBlock"])(Object(o["resolveDynamicComponent"])(e.componentWrapper),{key:0})):Object(o["createCommentVNode"])("",!0)],512)}var Lu=Object(o["defineComponent"])({props:{html:String},mounted:function(){S.helper.compileVueEntryComponents(this.$refs.root)},beforeUnmount:function(){S.helper.destroyVueComponent(this.$refs.root)},computed:{componentWrapper:function(){return this.html?Object(o["markRaw"])({template:this.html}):null}}});Lu.render=Mu;var Fu=Lu,Ru=Vt({component:Oa,scope:{loading:{vue:"loading",angularJsBind:"<"},loadingMessage:{vue:"loadingMessage",angularJsBind:"<",default:function(){return C("General_LoadingData")}}},$inject:[],directiveName:"piwikActivityIndicator"}); + */function tu(e,t,n,r,o,a){return Object(K["openBlock"])(),Object(K["createElementBlock"])("div",eu,[Object(K["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 nu=window,ru=nu.$,ou=Object(K["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;ru(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,Je.post({module:"API",method:this.submitApiMethod},t,{createErrorNotification:!this.noErrorNotification}).then((function(t){if(e.successfulPostResponse=t,!e.noSuccessNotification){var n=_o.show({message:a("General_YourChangesHaveBeenSaved"),context:"success",type:"toast",id:"ajaxHelper"});_o.scrollToNotification(n)}})).catch((function(t){e.errorPostResponse=t.message})).finally((function(){e.isSubmitting=!1}))}}});ou.render=tu;var au=ou;function iu(e,t,n,r,o,a){return Object(K["renderSlot"])(e.$slots,"default")}var lu=Object(K["defineComponent"])({});lu.render=iu;var cu=lu,su={key:0},uu=["data-target"],du=Object(K["createElementVNode"])("span",{class:"icon-configure"},null,-1),mu=[du],pu=["data-target"],fu=["title"],hu=["title","src"],bu=["id"],gu=["data-footer-icon-id"],vu=["title"],yu=["title","src"],Ou={key:2},ju=Object(K["createElementVNode"])("li",{class:"divider"},null,-1),wu=Object(K["createElementVNode"])("li",{class:"divider"},null,-1),ku=["title"],Su=Object(K["createElementVNode"])("span",{class:"icon-export"},null,-1),Cu=[Su],Eu=["title"],Du=Object(K["createElementVNode"])("span",{class:"icon-image"},null,-1),Pu=[Du],Tu=["title"],Vu=Object(K["createElementVNode"])("span",{class:"icon-annotation"},null,-1),Nu=[Vu],Iu=["title"],xu=Object(K["createElementVNode"])("span",{class:"icon-search"},null,-1),Bu=["title"],Au=["id","title"],Lu=["title"],Mu=["title","src"],_u=["id"],Fu={key:0},Ru=["innerHTML"],Hu={key:1},Uu=["innerHTML"],$u={key:2},qu=["innerHTML"],Wu={key:3},zu=["innerHTML"],Gu={key:4},Yu=["innerHTML"],Ju={key:5},Ku=["innerHTML"],Qu=["title","data-target"],Xu=Object(K["createElementVNode"])("span",{class:"icon-calendar"},null,-1),Zu={class:"periodName"},ed=["id"],td=["data-period"];function nd(e,t,n,r,o,a){var i=Object(K["resolveComponent"])("Passthrough"),l=Object(K["resolveDirective"])("dropdown-button"),c=Object(K["resolveDirective"])("report-export");return e.showFooter&&e.showFooterIcons?(Object(K["openBlock"])(),Object(K["createElementBlock"])("div",su,[e.hasConfigItems&&(e.isAnyConfigureIconHighlighted||e.isTableView)?Object(K["withDirectives"])((Object(K["openBlock"])(),Object(K["createElementBlock"])("a",{key:0,class:Object(K["normalizeClass"])(["dropdown-button dropdownConfigureIcon dataTableAction",{highlighted:e.isAnyConfigureIconHighlighted}]),href:"",onClick:t[0]||(t[0]=Object(K["withModifiers"])((function(){}),["prevent"])),"data-target":"dropdownConfigure".concat(e.randomIdForDropdown),style:{"margin-right":"3.5px"}},mu,10,uu)),[[l]]):Object(K["createCommentVNode"])("",!0),e.hasFooterIconsToShow?Object(K["withDirectives"])((Object(K["openBlock"])(),Object(K["createElementBlock"])("a",{key:1,class:"dropdown-button dataTableAction activateVisualizationSelection",href:"","data-target":"dropdownVisualizations".concat(e.randomIdForDropdown),style:{"margin-right":"3.5px"},onClick:t[1]||(t[1]=Object(K["withModifiers"])((function(){}),["prevent"]))},[/^icon-/.test(e.activeFooterIcon||"")?(Object(K["openBlock"])(),Object(K["createElementBlock"])("span",{key:0,title:e.translate("CoreHome_ChangeVisualization"),class:Object(K["normalizeClass"])(e.activeFooterIcon)},null,10,fu)):(Object(K["openBlock"])(),Object(K["createElementBlock"])("img",{key:1,title:e.translate("CoreHome_ChangeVisualization"),width:"16",height:"16",src:e.activeFooterIcon},null,8,hu))],8,pu)),[[l]]):Object(K["createCommentVNode"])("",!0),e.showFooterIcons?(Object(K["openBlock"])(),Object(K["createElementBlock"])("ul",{key:2,id:"dropdownVisualizations".concat(e.randomIdForDropdown),class:"dropdown-content dataTableFooterIcons"},[(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(e.footerIcons,(function(t,n){return Object(K["openBlock"])(),Object(K["createBlock"])(i,{key:n},{default:Object(K["withCtx"])((function(){return[(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(t.buttons.filter((function(e){return!!e.icon})),(function(n){return Object(K["openBlock"])(),Object(K["createElementBlock"])("li",{key:n.id},[Object(K["createElementVNode"])("a",{class:Object(K["normalizeClass"])("".concat(t.class," tableIcon\n ").concat(-1!==e.activeFooterIconIds.indexOf(n.id)?"activeIcon":"")),"data-footer-icon-id":n.id},[/^icon-/.test(n.icon||"")?(Object(K["openBlock"])(),Object(K["createElementBlock"])("span",{key:0,title:n.title,class:Object(K["normalizeClass"])(n.icon),style:{"margin-right":"5.5px"}},null,10,vu)):(Object(K["openBlock"])(),Object(K["createElementBlock"])("img",{key:1,width:"16",height:"16",title:n.title,src:n.icon,style:{"margin-right":"5.5px"}},null,8,yu)),n.title?(Object(K["openBlock"])(),Object(K["createElementBlock"])("span",Ou,Object(K["toDisplayString"])(n.title),1)):Object(K["createCommentVNode"])("",!0)],10,gu)])})),128)),ju]})),_:2},1024)})),128)),wu],8,bu)):Object(K["createCommentVNode"])("",!0),e.showExport?Object(K["withDirectives"])((Object(K["openBlock"])(),Object(K["createElementBlock"])("a",{key:3,class:"dataTableAction activateExportSelection",title:e.translate("General_ExportThisReport"),href:"",style:{"margin-right":"3.5px"},onClick:t[2]||(t[2]=Object(K["withModifiers"])((function(){}),["prevent"]))},Cu,8,ku)),[[c,{reportTitle:e.reportTitle,requestParams:e.requestParams,apiMethod:e.apiMethodToRequestDataTable,reportFormats:e.reportFormats,maxFilterLimit:e.maxFilterLimit}]]):Object(K["createCommentVNode"])("",!0),e.showExportAsImageIcon?(Object(K["openBlock"])(),Object(K["createElementBlock"])("a",{key:4,class:"dataTableAction tableIcon",href:"",id:"dataTableFooterExportAsImageIcon",onClick:t[3]||(t[3]=Object(K["withModifiers"])((function(t){return e.showExportImage(t)}),["prevent"])),title:e.translate("General_ExportAsImage"),style:{"margin-right":"3.5px"}},Pu,8,Eu)):Object(K["createCommentVNode"])("",!0),e.showAnnotations?(Object(K["openBlock"])(),Object(K["createElementBlock"])("a",{key:5,class:"dataTableAction annotationView",href:"",title:e.translate("Annotations_Annotations"),onClick:t[4]||(t[4]=Object(K["withModifiers"])((function(){}),["prevent"])),style:{"margin-right":"3.5px"}},Nu,8,Tu)):Object(K["createCommentVNode"])("",!0),e.showSearch?(Object(K["openBlock"])(),Object(K["createElementBlock"])("a",{key:6,class:"dropdown-button dataTableAction searchAction",href:"",title:e.translate("General_Search"),style:{"margin-right":"3.5px"},onClick:t[5]||(t[5]=Object(K["withModifiers"])((function(){}),["prevent"]))},[xu,Object(K["createElementVNode"])("span",{class:"icon-close",title:e.translate("CoreHome_CloseSearch")},null,8,Bu),Object(K["createElementVNode"])("input",{id:"widgetSearch_".concat(e.reportId),title:e.translate("CoreHome_DataTableHowToSearch"),type:"text",class:"dataTableSearchInput"},null,8,Au)],8,Iu)):Object(K["createCommentVNode"])("",!0),(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(e.dataTableActions,(function(e){return Object(K["openBlock"])(),Object(K["createElementBlock"])("a",{key:e.id,class:Object(K["normalizeClass"])("dataTableAction ".concat(e.id)),href:"",onClick:t[6]||(t[6]=Object(K["withModifiers"])((function(){}),["prevent"])),title:e.title,style:{"margin-right":"3.5px"}},[/^icon-/.test(e.icon||"")?(Object(K["openBlock"])(),Object(K["createElementBlock"])("span",{key:0,class:Object(K["normalizeClass"])(e.icon)},null,2)):(Object(K["openBlock"])(),Object(K["createElementBlock"])("img",{key:1,width:"16",height:"16",title:e.title,src:e.icon},null,8,Mu))],10,Lu)})),128)),Object(K["createElementVNode"])("ul",{id:"dropdownConfigure".concat(e.randomIdForDropdown),class:"dropdown-content tableConfiguration"},[e.showFlattenTable?(Object(K["openBlock"])(),Object(K["createElementBlock"])("li",Fu,[Object(K["createElementVNode"])("div",{class:"configItem dataTableFlatten",innerHTML:e.$sanitize(e.flattenItemText)},null,8,Ru)])):Object(K["createCommentVNode"])("",!0),e.showDimensionsConfigItem?(Object(K["openBlock"])(),Object(K["createElementBlock"])("li",Hu,[Object(K["createElementVNode"])("div",{class:"configItem dataTableShowDimensions",innerHTML:e.$sanitize(e.showDimensionsText)},null,8,Uu)])):Object(K["createCommentVNode"])("",!0),e.showFlatConfigItem?(Object(K["openBlock"])(),Object(K["createElementBlock"])("li",$u,[Object(K["createElementVNode"])("div",{class:"configItem dataTableIncludeAggregateRows",innerHTML:e.$sanitize(e.includeAggregateRowsText)},null,8,qu)])):Object(K["createCommentVNode"])("",!0),e.showTotalsConfigItem?(Object(K["openBlock"])(),Object(K["createElementBlock"])("li",Wu,[Object(K["createElementVNode"])("div",{class:"configItem dataTableShowTotalsRow",innerHTML:e.$sanitize(e.keepTotalsRowText)},null,8,zu)])):Object(K["createCommentVNode"])("",!0),e.showExcludeLowPopulation?(Object(K["openBlock"])(),Object(K["createElementBlock"])("li",Gu,[Object(K["createElementVNode"])("div",{class:"configItem dataTableExcludeLowPopulation",innerHTML:e.$sanitize(e.excludeLowPopText)},null,8,Yu)])):Object(K["createCommentVNode"])("",!0),e.showPivotBySubtable?(Object(K["openBlock"])(),Object(K["createElementBlock"])("li",Ju,[Object(K["createElementVNode"])("div",{class:"configItem dataTablePivotBySubtable",innerHTML:e.$sanitize(e.pivotByText)},null,8,Ku)])):Object(K["createCommentVNode"])("",!0)],8,_u),e.showPeriods?Object(K["withDirectives"])((Object(K["openBlock"])(),Object(K["createElementBlock"])("a",{key:7,class:"dropdown-button dataTableAction activatePeriodsSelection",href:"",onClick:t[7]||(t[7]=Object(K["withModifiers"])((function(){}),["prevent"])),title:e.translate("CoreHome_ChangePeriod"),"data-target":"dropdownPeriods".concat(e.randomIdForDropdown)},[Object(K["createElementVNode"])("div",null,[Xu,Object(K["createElementVNode"])("span",Zu,Object(K["toDisplayString"])(e.translations[e.clientSideParameters.period]||e.clientSideParameters.period),1)])],8,Qu)),[[l]]):Object(K["createCommentVNode"])("",!0),e.showPeriods?(Object(K["openBlock"])(),Object(K["createElementBlock"])("ul",{key:8,id:"dropdownPeriods".concat(e.randomIdForDropdown),class:"dropdown-content dataTablePeriods"},[(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(e.selectablePeriods,(function(t){return Object(K["openBlock"])(),Object(K["createElementBlock"])("li",{key:t},[Object(K["createElementVNode"])("a",{"data-period":t,class:Object(K["normalizeClass"])("tableIcon ".concat(e.clientSideParameters.period===t?"activeIcon":""))},[Object(K["createElementVNode"])("span",null,Object(K["toDisplayString"])(e.translations[t]||t),1)],10,td)])})),128))],8,ed)):Object(K["createCommentVNode"])("",!0)])):Object(K["createCommentVNode"])("",!0)}function rd(e){return ld(e)||id(e)||ad(e)||od()}function od(){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 ad(e,t){if(e){if("string"===typeof e)return cd(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)?cd(e,t):void 0}}function id(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function ld(e){if(Array.isArray(e))return cd(e)}function cd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var sd=window,ud=sd.$;function dd(e,t,n){if(/(%(.\$)?s+)/g.test(a(e))){var r=['<br /><span class="action">'];n&&r.push(n);var o=a.apply(void 0,[e].concat(r));return t&&(o+=" (".concat(a("CoreHome_Default"),")")),o+="</span>",o}return a(e)}function md(e,t,n){return e?dd(t,!0):dd(n)}function pd(e){return!!e&&"0"!==e}var fd=Object(K["defineComponent"])({props:{showPeriods:Boolean,showFooter:Boolean,showFooterIcons:Boolean,showSearch:Boolean,showFlattenTable:Boolean,footerIcons:{type:Array,required:!0},viewDataTable:{type:String,required:!0},reportTitle:String,requestParams:{type:Object,required:!0},apiMethodToRequestDataTable:{type:String,required:!0},maxFilterLimit:{type:Number,required:!0},showExport:Boolean,showExportAsImageIcon:Boolean,showAnnotations:Boolean,reportId:{type:String,required:!0},dataTableActions:{type:Array,required:!0},clientSideParameters:{type:Object,required:!0},hasMultipleDimensions:Boolean,isDataTableEmpty:Boolean,showTotalsRow:Boolean,showExcludeLowPopulation:Boolean,showPivotBySubtable:Boolean,selectablePeriods:Array,translations:{type:Object,required:!0},pivotDimensionName:String},components:{Passthrough:cu},directives:{DropdownButton:jn,ReportExport:Fs},methods:{showExportImage:function(e){ud(e.target).closest(".dataTable").find("div.jqplot-target").trigger("piwikExportAsImage")}},computed:{randomIdForDropdown:function(){return Math.floor(999999*Math.random())},allFooterIcons:function(){return this.footerIcons.reduce((function(e,t){return e.push.apply(e,rd(t.buttons)),e}),[])},activeFooterIcons:function(){var e=this,t=this.clientSideParameters,n=[this.viewDataTable];return 0===t.abandonedCarts||"0"===t.abandonedCarts?n.push("ecommerceOrder"):1!==t.abandonedCarts&&"1"!==t.abandonedCarts||n.push("ecommerceAbandonedCart"),n.map((function(t){return e.allFooterIcons.find((function(e){return e.id===t}))})).filter((function(e){return!!e}))},activeFooterIcon:function(){var e;return null===(e=this.activeFooterIcons[0])||void 0===e?void 0:e.icon},activeFooterIconIds:function(){return this.activeFooterIcons.map((function(e){return e.id}))},numIcons:function(){return this.allFooterIcons.length},hasFooterIconsToShow:function(){return!!this.activeFooterIcons.length&&this.numIcons>1},reportFormats:function(){var e={CSV:"CSV",TSV:"TSV (Excel)",XML:"XML",JSON:"Json",HTML:"HTML",RSS:"RSS"};return e},showDimensionsConfigItem:function(){return this.showFlattenTable&&"1"==="".concat(this.clientSideParameters.flat)&&this.hasMultipleDimensions},showFlatConfigItem:function(){return this.showFlattenTable&&"1"==="".concat(this.clientSideParameters.flat)},showTotalsConfigItem:function(){return!this.isDataTableEmpty&&this.showTotalsRow},hasConfigItems:function(){return this.showFlattenTable||this.showDimensionsConfigItem||this.showFlatConfigItem||this.showTotalsConfigItem||this.showExcludeLowPopulation||this.showPivotBySubtable},flattenItemText:function(){var e=this.clientSideParameters;return md(pd(e.flat),"CoreHome_UnFlattenDataTable","CoreHome_FlattenDataTable")},keepTotalsRowText:function(){var e=this.clientSideParameters;return md(pd(e.keep_totals_row),"CoreHome_RemoveTotalsRowDataTable","CoreHome_AddTotalsRowDataTable")},includeAggregateRowsText:function(){var e=this.clientSideParameters;return md(pd(e.include_aggregate_rows),"CoreHome_DataTableExcludeAggregateRows","CoreHome_DataTableIncludeAggregateRows")},showDimensionsText:function(){var e=this.clientSideParameters;return md(pd(e.show_dimensions),"CoreHome_DataTableCombineDimensions","CoreHome_DataTableShowDimensions")},pivotByText:function(){var e=this.clientSideParameters;return pd(e.pivotBy)?dd("CoreHome_UndoPivotBySubtable",!0):dd("CoreHome_PivotBySubtable",!1,this.pivotDimensionName)},excludeLowPopText:function(){var e=this.clientSideParameters;return md(pd(e.enable_filter_excludelowpop),"CoreHome_IncludeRowsWithLowPopulation","CoreHome_ExcludeRowsWithLowPopulation")},isAnyConfigureIconHighlighted:function(){var e=this.clientSideParameters;return pd(e.flat)||pd(e.keep_totals_row)||pd(e.include_aggregate_rows)||pd(e.show_dimensions)||pd(e.pivotBy)||pd(e.enable_filter_excludelowpop)},isTableView:function(){return"table"===this.viewDataTable||"tableAllColumns"===this.viewDataTable||"tableGoals"===this.viewDataTable}}});fd.render=nd;var hd=fd,bd={key:0,class:"title",style:{cursor:"pointer"},ref:"expander"},gd=Object(K["createElementVNode"])("span",{class:"icon-warning"},null,-1),vd={key:1,class:"title",href:"?module=CoreUpdater&action=newVersionAvailable",style:{cursor:"pointer"}},yd=Object(K["createElementVNode"])("span",{class:"icon-warning"},null,-1),Od=["innerHTML"],jd={key:1,class:"title",href:"https://matomo.org/changelog/",target:"_blank",rel:"noreferrer noopener"},wd={id:"updateCheckLinkContainer"},kd={class:"dropdown positionInViewport"},Sd=["innerHTML"],Cd=["innerHTML"];function Ed(e,t,n,r,o,a){var i=Object(K["resolveComponent"])("Passthrough"),l=Object(K["resolveDirective"])("expand-on-hover");return Object(K["withDirectives"])((Object(K["openBlock"])(),Object(K["createElementBlock"])("div",{id:"header_message",class:Object(K["normalizeClass"])(["piwikSelector borderedControl piwikTopControl",{header_info:!e.latestVersionAvailable,update_available:e.latestVersionAvailable}])},[e.latestVersionAvailable&&!e.isPiwikDemo?(Object(K["openBlock"])(),Object(K["createBlock"])(i,{key:0},{default:Object(K["withCtx"])((function(){return[e.isMultiServerEnvironment?(Object(K["openBlock"])(),Object(K["createElementBlock"])("span",bd,[Object(K["createTextVNode"])(Object(K["toDisplayString"])(e.translate("General_NewUpdatePiwikX",e.latestVersionAvailable))+" ",1),gd],512)):(Object(K["openBlock"])(),Object(K["createElementBlock"])("a",vd,[Object(K["createTextVNode"])(Object(K["toDisplayString"])(e.translate("General_NewUpdatePiwikX",e.latestVersionAvailable))+" ",1),yd]))]})),_:1})):e.isSuperUser&&e.isAdminArea?(Object(K["openBlock"])(),Object(K["createBlock"])(i,{key:1},{default:Object(K["withCtx"])((function(){return[e.isInternetEnabled?(Object(K["openBlock"])(),Object(K["createElementBlock"])("a",{key:0,class:"title",innerHTML:e.$sanitize(e.updateCheck)},null,8,Od)):(Object(K["openBlock"])(),Object(K["createElementBlock"])("a",jd,[Object(K["createElementVNode"])("span",wd,Object(K["toDisplayString"])(e.translate("CoreHome_SeeAvailableVersions")),1)]))]})),_:1})):Object(K["createCommentVNode"])("",!0),Object(K["createElementVNode"])("div",kd,[e.latestVersionAvailable&&e.isSuperUser?(Object(K["openBlock"])(),Object(K["createElementBlock"])("span",{key:0,innerHTML:e.$sanitize(e.updateNowText)},null,8,Sd)):e.latestVersionAvailable&&!e.isPiwikDemo&&e.hasSomeViewAccess&&!e.isAnonymous?(Object(K["openBlock"])(),Object(K["createElementBlock"])("span",{key:1,innerHTML:e.$sanitize(e.updateAvailableText)},null,8,Cd)):Object(K["createCommentVNode"])("",!0),Object(K["createTextVNode"])(" "+Object(K["toDisplayString"])(e.translate("General_YouAreCurrentlyUsing",e.piwikVersion)),1)])],2)),[[l,{expander:"expander"}]])}var Dd=Object(K["defineComponent"])({props:{isMultiServerEnvironment:Boolean,latestVersionAvailable:String,isPiwikDemo:Boolean,isSuperUser:Boolean,isAdminArea:Boolean,isInternetEnabled:Boolean,updateCheck:String,isAnonymous:Boolean,hasSomeViewAccess:Boolean,contactEmail:String,piwikVersion:String},components:{Passthrough:cu},directives:{ExpandOnHover:hn},computed:{updateNowText:function(){var e="";if(this.isMultiServerEnvironment){var t="https://builds.matomo.org/piwik-".concat(this.latestVersionAvailable,".zip");e=a("CoreHome_OneClickUpdateNotPossibleAsMultiServerEnvironment",'<a rel="noreferrer noopener" href="'.concat(t,'">builds.matomo.org</a>'))}else e=a("General_PiwikXIsAvailablePleaseUpdateNow",this.latestVersionAvailable||"",'<br /><a href="index.php?module=CoreUpdater&action=newVersionAvailable">',"</a>",'<a target="_blank" rel="noreferrer noopener" href="https://matomo.org/changelog/">',"</a>");return"".concat(e,"<br/>")},updateAvailableText:function(){var e=a("General_NewUpdatePiwikX",this.latestVersionAvailable||""),t='<a target="_blank" rel="noreferrer noopener" href="https://matomo.org/">Matomo</a>',n='<a target="_blank" rel="noreferrer noopener" href="https://matomo.org/changelog/">',r=a("General_PiwikXIsAvailablePleaseNotifyPiwikAdmin","".concat(t," ").concat(n).concat(this.latestVersionAvailable,"</a>"),'<a href="mailto:'.concat(this.contactEmail,"?subject=").concat(encodeURIComponent(e),'">'),"</a>");return"".concat(r,"<br />")}}});Dd.render=Ed;var Pd=Dd;function Td(e,t){return Bd(e)||xd(e,t)||Nd(e,t)||Vd()}function Vd(){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 Nd(e,t){if(e){if("string"===typeof e)return Id(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)?Id(e,t):void 0}}function Id(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xd(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done);i=!0)if(a.push(r.value),t&&a.length===t)break}catch(c){l=!0,o=c}finally{try{i||null==n["return"]||n["return"]()}finally{if(l)throw o}}return a}}function Bd(e){if(Array.isArray(e))return e}var Ad={id:"mobile-left-menu",class:"sidenav hide-on-large-only"},Ld={class:"collapsible collapsible-accordion"},Md={class:"collapsible-header"},_d={class:"collapsible-body"},Fd=["title","href"];function Rd(e,t,n,r,o,a){var i=Object(K["resolveDirective"])("side-nav");return Object(K["openBlock"])(),Object(K["createElementBlock"])("ul",Ad,[(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(e.menuWithSubmenuItems,(function(t,n){return Object(K["openBlock"])(),Object(K["createElementBlock"])("li",{class:"no-padding",key:n},[Object(K["withDirectives"])(Object(K["createElementVNode"])("ul",Ld,[Object(K["createElementVNode"])("li",null,[Object(K["createElementVNode"])("a",Md,[Object(K["createTextVNode"])(Object(K["toDisplayString"])(e.translate(n)),1),Object(K["createElementVNode"])("i",{class:Object(K["normalizeClass"])(t._icon||"icon-arrow-down")},null,2)]),Object(K["createElementVNode"])("div",_d,[Object(K["createElementVNode"])("ul",null,[(Object(K["openBlock"])(!0),Object(K["createElementBlock"])(K["Fragment"],null,Object(K["renderList"])(Object.entries(t).filter((function(e){var t=Td(e,1),n=t[0];return"_"!==n[0]})),(function(t){var n=Td(t,2),r=n[0],o=n[1];return Object(K["openBlock"])(),Object(K["createElementBlock"])("li",{key:r},[Object(K["createElementVNode"])("a",{title:o._tooltip?e.translate(o._tooltip):"",target:"_self",href:e.getMenuUrl(o._url)},Object(K["toDisplayString"])(e.translate(r)),9,Fd)])})),128))])])])],512),[[i,{activator:e.activateLeftMenu}]])])})),128))])}function Hd(e,t){return zd(e)||Wd(e,t)||$d(e,t)||Ud()}function Ud(){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 $d(e,t){if(e){if("string"===typeof e)return qd(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)?qd(e,t):void 0}}function qd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Wd(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done);i=!0)if(a.push(r.value),t&&a.length===t)break}catch(c){l=!0,o=c}finally{try{i||null==n["return"]||n["return"]()}finally{if(l)throw o}}return a}}function zd(e){if(Array.isArray(e))return e}var Gd=window,Yd=Gd.$,Jd=Object(K["defineComponent"])({props:{menu:{type:Object,required:!0}},directives:{SideNav:En},methods:{getMenuUrl:function(e){return"?".concat(Ce.stringify(Object.assign(Object.assign({},Ce.urlParsed.value),e)))}},computed:{menuWithSubmenuItems:function(){var e=this.menu||{};return Object.fromEntries(Object.entries(e).filter((function(e){var t=Hd(e,2),n=t[1],r=Object.entries(n).filter((function(e){var t=Hd(e,1),n=t[0];return"_"!==n[0]}));return Object.keys(r).length})))},activateLeftMenu:function(){return Yd("nav .activateLeftMenu")[0]}}});Jd.render=Rd;var Kd=Jd,Qd=window,Xd=Qd.$; /*! * 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(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 $u(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 Hu(e){var t=new Date;t.setTime(t.getTime()+-864e5),document.cookie="".concat(e,"=; expires=").concat(t.toUTCString(),"; path=/")}function Uu(e,t,n,r,i,a){return Object(o["renderSlot"])(e.$slots,"default")}var qu=Object(o["defineComponent"])({});qu.render=Uu;var Wu=qu; + */function Zd(e){Xd.scrollTo(e,20)}function em(e){e&&e.preventDefault()}function tm(e,t){var n,r;if(e&&-1===e.indexOf("&")){var o=null;try{o=Xd("#".concat(e))}catch(a){return}if(null!==(n=o)&&void 0!==n&&n.length)return Zd(o),void em(t);o=Xd("a[name=".concat(e,"]")),null!==(r=o)&&void 0!==r&&r.length&&(Zd(o),em(t))}}function nm(e,t){return(!e||!e.origin||-1!==t.indexOf(e.origin))&&((!e||!e.pathname||-1!==t.indexOf(e.pathname))&&(!e||!e.search||-1!==t.indexOf(e.search)))}function rm(){if("#/"===window.location.hash.slice(0,2)){var e=window.location.hash.slice(2);tm(e,null)}}function om(){Object(K["watch"])((function(){return Ce.url.value}),(function(e,t){if(e){var n=e.href.indexOf("#/");if(-1!==n&&(!t||nm(t,e.href))){var r=e.href.slice(n+2);tm(r,null)}}}))}function am(){Object(K["nextTick"])(rm)} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */}})})); + */om(),Xd(rm)}})})); //# sourceMappingURL=CoreHome.umd.min.js.map
\ No newline at end of file diff --git a/plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.adapter.ts b/plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.adapter.ts deleted file mode 100644 index 614d128056..0000000000 --- a/plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.adapter.ts +++ /dev/null @@ -1,27 +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 - */ - -import ActivityIndicator from './ActivityIndicator.vue'; -import { translate } from '../translate'; -import createAngularJsAdapter from '../createAngularJsAdapter'; - -export default createAngularJsAdapter({ - component: ActivityIndicator, - scope: { - loading: { - vue: 'loading', - angularJsBind: '<', - }, - loadingMessage: { - vue: 'loadingMessage', - angularJsBind: '<', - default: () => translate('General_LoadingData'), - }, - }, - $inject: [], - directiveName: 'piwikActivityIndicator', -}); diff --git a/plugins/CoreHome/vue/src/AjaxForm/AjaxForm.adapter.ts b/plugins/CoreHome/vue/src/AjaxForm/AjaxForm.adapter.ts deleted file mode 100644 index a998f1403b..0000000000 --- a/plugins/CoreHome/vue/src/AjaxForm/AjaxForm.adapter.ts +++ /dev/null @@ -1,193 +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 - */ - -import { DirectiveBinding, ref } from 'vue'; -import { IDirective, IDirectiveLinkFn, IParseService } from 'angular'; -import createVueApp from '../createVueApp'; -import AjaxForm from './AjaxForm.vue'; - -const { $ } = window; - -/** - * AngularJS directive that manages an AJAX form. - * - * This directive will detect inputs & selects defined within an element and when a - * submit button is clicked, will post data from the inputs & selects to a Piwik API method. - * - * When the POST request is finished the result will, by default, be displayed as a - * notification. - * - * This directive accepts the following attributes: - * - * - **submit-api-method**: **required** The Piwik API method that handles the POST request. - * - **send-json-payload**: Whether to send the data as a form encoded URL or to send it as JSON. - * If sending as JSON, the payload will still be a form encoded value, - * but will contain a JSON object like `{data: {...form data...}}`. - * - * This is for forms with lots of fields where having the same number - * of parameters in an API method would not be desired. - * - **no-error-notification**: If true, does not display an error notification if the AJAX post - * fails. - * - **no-success-notification**: If true, does not display an error notification if the AJAX - * results in success. - * - * **Custom Success/Error Handling** - * - * On success/failure, the response will be stored in controller scope. Child elements of a - * piwik-ajax-form element can access this data, and thus, can customize what happens when - * a form submit succeeds/fails. - * - * See the ajax-form.controller.js file for more info. - * - * Usage: - * - * <div piwik-ajax-form - * submit-api-method="'MyPlugin.myFormSaveMethod'" - * send-json-payload="true" - * ng-model="myFormData"> - * - * <h2>My Form</h2> - * <input name="myOption" value="myDefaultValue" type="text" /> - * <input name="myOtherOption" type="checkbox" checked="checked" /> - * <input type="submit" value="Submit" ng-disabled="ajaxForm.isSubmitting" /> - * - * <div piwik-notification context='error' ng-show="errorPostResponse">ERROR!</div> - * </div> - * @deprecated - */ - -function piwikAjaxForm($parse: IParseService): IDirective { - return { - restrict: 'A', - scope: { - submitApiMethod: '=', - sendJsonPayload: '=', - noErrorNotification: '=', - noSuccessNotification: '=', - useCustomDataBinding: '=', - }, - require: '?ngModel', - transclude: true, - compile: function piwikAjaxFormCompile(compileElement, compileAttrs): IDirectiveLinkFn { - compileAttrs.noErrorNotification = !!compileAttrs.noErrorNotification; - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return function piwikAjaxFormLink(scope: any, element, attrs, ngModel, transclude) { - if (!scope.submitApiMethod) { - throw new Error('submitApiMethod is required'); - } - - scope.ajaxForm = {}; - scope.ajaxForm.submitApiMethod = scope.submitApiMethod; - scope.ajaxForm.sendJsonPayload = scope.sendJsonPayload; - scope.ajaxForm.noErrorNotification = scope.noErrorNotification; - scope.ajaxForm.noSuccessNotification = scope.noSuccessNotification; - - scope.ajaxForm.data = {}; - - // if a model is supplied, initiate form data w/ model value - if (ngModel) { - // probably redundant, but I cannot find another way to get the ng model value here - const ngModelGetter = $parse(attrs.ngModel); - scope.ajaxForm.data = ngModelGetter(scope.$parent); - } - - interface SpecialDirectiveBinding { - submitForm: () => void; - } - - const specialBindDirective = { - mounted(el: HTMLElement, binding: DirectiveBinding<SpecialDirectiveBinding>) { - scope.ajaxForm.submitForm = binding.value.submitForm; - }, - }; - - const rootTemplate = ` - <AjaxForm - :form-data="data" - :submit-api-method="submitApiMethod" - :send-json-payload="sendJsonPayload" - :no-error-notification="noErrorNotification" - :no-success-notification="noSuccessNotification" - > - <template v-slot:default="ajaxFormVue"> - <div - ref="transcludeTarget" - v-special-bind-directive="{ submitForm: ajaxFormVue.submitForm }" - /> - </template> - </AjaxForm>`; - - const app = createVueApp({ - template: rootTemplate, - data() { - return scope.ajaxForm; - }, - setup() { - const transcludeTarget = ref(null); - return { - transcludeTarget, - }; - }, - }); - app.component('AjaxForm', AjaxForm); - app.directive('SpecialBindDirective', specialBindDirective); - const vm = app.mount(element[0]); - - element.on('$destroy', () => { - app.unmount(); - }); - - function setFormValueFromInput(inputElement: HTMLElement, skipScopeApply?: boolean) { - const name = $(inputElement).attr('name')!; - let val; - - if ($(inputElement).attr('type') === 'checkbox') { - val = $(inputElement).is(':checked'); - } else { - val = $(inputElement).val(); - } - - scope.ajaxForm.data[name] = val; - - if (!skipScopeApply) { - setTimeout(() => { - scope.$apply(); - }, 0); - } - } - - // on change of any input, change appropriate value in model, but only if requested - if (!scope.useCustomDataBinding) { - element.on('change', 'input,select', (event) => { - setFormValueFromInput(event.target as HTMLElement); - }); - } - - // make sure child elements can access this directive's scope - // eslint-disable-next-line @typescript-eslint/no-explicit-any - transclude!(scope, (clone, transcludeScope: any) => { - if (!transcludeScope.useCustomDataBinding) { - const $inputs = clone!.find('input,select').not('[type=submit]'); - - // initialize form data to input values (include <select>s - $inputs.each(function inputEach() { - setFormValueFromInput(this, true); - }); - } - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - $((vm as any).transcludeTarget as HTMLElement).append(clone!); - }); - }; - }, - }; -} - -piwikAjaxForm.$inject = ['$parse']; - -window.angular.module('piwikApp').directive('piwikAjaxForm', piwikAjaxForm); diff --git a/plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.adapter.ts b/plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.adapter.ts index 59bc1db685..f9f4979e40 100644 --- a/plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.adapter.ts +++ b/plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.adapter.ts @@ -7,9 +7,3 @@ declare global { } window.ajaxHelper = AjaxHelper; - -function ajaxQueue() { - return window.globalAjaxQueue; -} - -window.angular.module('piwikApp.service').service('globalAjaxQueue', ajaxQueue); diff --git a/plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts b/plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts index 6894e4e663..f339a3534a 100644 --- a/plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts +++ b/plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts @@ -7,7 +7,6 @@ /* eslint-disable max-classes-per-file */ -import { ITimeoutService } from 'angular'; import jqXHR = JQuery.jqXHR; import MatomoUrl from '../MatomoUrl/MatomoUrl'; import Matomo from '../Matomo/Matomo'; @@ -500,13 +499,6 @@ export default class AjaxHelper<T = any> { // eslint-disable-line this.requestHandle = this.buildAjaxCall(); window.globalAjaxQueue.push(this.requestHandle); - let $timeout: ITimeoutService|null = null; - try { - $timeout = Matomo.helper.getAngularDependency('$timeout'); - } catch (e) { - // ignore - } - if (this.abortController) { this.abortController.signal.addEventListener('abort', () => { if (this.requestHandle) { @@ -538,10 +530,6 @@ export default class AjaxHelper<T = any> { // eslint-disable-line console.log(`Warning: the ${$.param(this.getParams)} request failed!`); reject(xhr); - }).done(() => { - if ($timeout) { - $timeout(); // trigger digest - } }); }); diff --git a/plugins/CoreHome/vue/src/Alert/Alert.adapter.ts b/plugins/CoreHome/vue/src/Alert/Alert.adapter.ts deleted file mode 100644 index c100116645..0000000000 --- a/plugins/CoreHome/vue/src/Alert/Alert.adapter.ts +++ /dev/null @@ -1,21 +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 - */ - -import Alert from './Alert.vue'; -import createAngularJsAdapter from '../createAngularJsAdapter'; - -export default createAngularJsAdapter({ - component: Alert, - scope: { - severity: { - vue: 'severity', - angularJsBind: '@piwikAlert', - }, - }, - directiveName: 'piwikAlert', - transclude: true, -}); diff --git a/plugins/CoreHome/vue/src/Comparisons/Comparisons.adapter.ts b/plugins/CoreHome/vue/src/Comparisons/Comparisons.adapter.ts deleted file mode 100644 index c2133ed48d..0000000000 --- a/plugins/CoreHome/vue/src/Comparisons/Comparisons.adapter.ts +++ /dev/null @@ -1,22 +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 - */ - -import createAngularJsAdapter from '../createAngularJsAdapter'; -import ComparisonsStoreInstance from './Comparisons.store.instance'; -import Comparisons from './Comparisons.vue'; - -function ComparisonFactory() { - return ComparisonsStoreInstance; -} - -window.angular.module('piwikApp.service').factory('piwikComparisonsService', ComparisonFactory); - -export default createAngularJsAdapter({ - component: Comparisons, - directiveName: 'piwikComparisons', - restrict: 'E', -}); diff --git a/plugins/CoreHome/vue/src/Comparisons/Comparisons.store.spec.ts b/plugins/CoreHome/vue/src/Comparisons/Comparisons.store.spec.ts index 69f2991ec7..b6f5eed577 100644 --- a/plugins/CoreHome/vue/src/Comparisons/Comparisons.store.spec.ts +++ b/plugins/CoreHome/vue/src/Comparisons/Comparisons.store.spec.ts @@ -10,7 +10,6 @@ import '../Periods/Week'; import '../Periods/Month'; import '../Periods/Year'; import '../Periods/Range'; -import '../Matomo/Matomo.adapter'; // for $rootScope.$oldEmit import ComparisonsStore from './Comparisons.store'; import MatomoUrl from '../MatomoUrl/MatomoUrl'; @@ -54,7 +53,7 @@ describe('CoreHome/Comparisons.store', () => { .reply(200, JSON.stringify(DISABLED_PAGES)); }); beforeAll(() => { - // so piwikHelper.isAngularRenderingThePage will return true + // so piwikHelper.isReportingPage will return true document.body.innerHTML = document.body.innerHTML + '<div class="reporting-page" />'; }); beforeAll(async () => { @@ -177,7 +176,7 @@ describe('CoreHome/Comparisons.store', () => { angularApply(); await wait(); - expect(window.location.href).toEqual('http://localhost/#?period=day&date=2018-01-02&segment=abcdefg&category=MyModule1&subcategory=enabledPage&compareDates%5B%5D=2018-03-04&comparePeriods%5B%5D=week&compareSegments%5B%5D='); + expect(window.location.href).toEqual('http://localhost/#?period=day&date=2018-01-02&segment=abcdefg&category=MyModule1&subcategory=enabledPage&compareDates[]=2018-03-04&comparePeriods[]=week&compareSegments[]='); }); it('should change the base comparison if the first segment is removed', async () => { @@ -187,7 +186,7 @@ describe('CoreHome/Comparisons.store', () => { angularApply(); await wait(); - expect(window.location.href).toEqual('http://localhost/#?period=day&date=2018-01-02&segment=comparedsegment&category=MyModule1&subcategory=enabledPage&compareDates%5B%5D=2018-03-04&comparePeriods%5B%5D=week&compareSegments%5B%5D='); + expect(window.location.href).toEqual('http://localhost/#?period=day&date=2018-01-02&segment=comparedsegment&category=MyModule1&subcategory=enabledPage&compareDates[]=2018-03-04&comparePeriods[]=week&compareSegments[]='); }); }); diff --git a/plugins/CoreHome/vue/src/Comparisons/Comparisons.store.ts b/plugins/CoreHome/vue/src/Comparisons/Comparisons.store.ts index 1e29790099..d727ac4a27 100644 --- a/plugins/CoreHome/vue/src/Comparisons/Comparisons.store.ts +++ b/plugins/CoreHome/vue/src/Comparisons/Comparisons.store.ts @@ -262,7 +262,7 @@ export default class ComparisonsStore { }; // change the page w/ these new param values - const baseParams = Matomo.helper.isAngularRenderingThePage() + const baseParams = Matomo.helper.isReportingPage() ? MatomoUrl.hashParsed.value : MatomoUrl.urlParsed.value; MatomoUrl.updateLocation({ diff --git a/plugins/CoreHome/vue/src/ContentBlock/ContentBlock.adapter.ts b/plugins/CoreHome/vue/src/ContentBlock/ContentBlock.adapter.ts deleted file mode 100644 index 8bdbf2e300..0000000000 --- a/plugins/CoreHome/vue/src/ContentBlock/ContentBlock.adapter.ts +++ /dev/null @@ -1,32 +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 - */ - -import createAngularJsAdapter from '../createAngularJsAdapter'; -import ContentBlock from './ContentBlock.vue'; - -export default createAngularJsAdapter({ - component: ContentBlock, - scope: { - contentTitle: { - angularJsBind: '@', - }, - feature: { - angularJsBind: '@', - }, - helpUrl: { - angularJsBind: '@', - }, - helpText: { - angularJsBind: '@', - }, - anchor: { - angularJsBind: '@?', - }, - }, - directiveName: 'piwikContentBlock', - transclude: true, -}); diff --git a/plugins/CoreHome/vue/src/ContentIntro/ContentIntro.adapter.ts b/plugins/CoreHome/vue/src/ContentIntro/ContentIntro.adapter.ts deleted file mode 100644 index 8669a29b52..0000000000 --- a/plugins/CoreHome/vue/src/ContentIntro/ContentIntro.adapter.ts +++ /dev/null @@ -1,20 +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 - */ - -import { IDirective, IScope } from 'angular'; -import ContentIntro from './ContentIntro'; - -export default function piwikContentIntro(): IDirective { - return { - restrict: 'A', - link: function piwikContentIntroLink(scope: IScope, element: JQuery) { - ContentIntro.mounted(element[0]); - }, - }; -} - -window.angular.module('piwikApp').directive('piwikContentIntro', piwikContentIntro); diff --git a/plugins/CoreHome/vue/src/ContentTable/ContentTable.adapter.ts b/plugins/CoreHome/vue/src/ContentTable/ContentTable.adapter.ts deleted file mode 100644 index a57d53ed4d..0000000000 --- a/plugins/CoreHome/vue/src/ContentTable/ContentTable.adapter.ts +++ /dev/null @@ -1,20 +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 - */ - -import { IDirective, IScope } from 'angular'; -import ContentTable from './ContentTable'; - -export default function piwikContentTable(): IDirective { - return { - restrict: 'A', - link: function piwikContentTableLink(scope: IScope, element: JQuery) { - ContentTable.mounted(element[0]); - }, - }; -} - -window.angular.module('piwikApp').directive('piwikContentTable', piwikContentTable); diff --git a/plugins/CoreHome/vue/src/CookieHelper/CookieHelper.ts b/plugins/CoreHome/vue/src/CookieHelper/CookieHelper.ts index 78855f3be2..6644b7db3c 100644 --- a/plugins/CoreHome/vue/src/CookieHelper/CookieHelper.ts +++ b/plugins/CoreHome/vue/src/CookieHelper/CookieHelper.ts @@ -3,7 +3,7 @@ */ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -export function setCookie(name: string, val: string, seconds: number) { +export function setCookie(name: string, val: string, seconds?: number) { const date = new Date(); // set default day to 3 days diff --git a/plugins/CoreHome/vue/src/DataTable/DataTableActions.vue b/plugins/CoreHome/vue/src/DataTable/DataTableActions.vue new file mode 100644 index 0000000000..a25fdf5221 --- /dev/null +++ b/plugins/CoreHome/vue/src/DataTable/DataTableActions.vue @@ -0,0 +1,474 @@ +<!-- + Matomo - free/libre analytics platform + @link https://matomo.org + @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later +--> + +<template> + <div v-if="showFooter && showFooterIcons"> + <a + v-dropdown-button + class="dropdown-button dropdownConfigureIcon dataTableAction" + :class="{highlighted: isAnyConfigureIconHighlighted}" + href + @click.prevent + :data-target="`dropdownConfigure${randomIdForDropdown}`" + style="margin-right:3.5px" + v-if="hasConfigItems && (isAnyConfigureIconHighlighted || isTableView)" + > + <span class="icon-configure"></span> + </a> + + <a v-if="hasFooterIconsToShow" + class="dropdown-button dataTableAction activateVisualizationSelection" + v-dropdown-button + href + :data-target="`dropdownVisualizations${randomIdForDropdown}`" + style="margin-right:3.5px" + @click.prevent + > + <span + v-if="/^icon-/.test(activeFooterIcon || '')" + :title="translate('CoreHome_ChangeVisualization')" + :class="activeFooterIcon" + ></span> + <img + v-else + :title="translate('CoreHome_ChangeVisualization')" + width="16" + height="16" + :src="activeFooterIcon" + /> + </a> + + <ul + v-if="showFooterIcons" + :id="`dropdownVisualizations${randomIdForDropdown}`" + class="dropdown-content dataTableFooterIcons" + > + <Passthrough v-for="(footerIconGroup, index) in footerIcons" :key="index"> + <li + v-for="footerIcon in footerIconGroup.buttons.filter((i) => !!i.icon)" + :key="footerIcon.id" + > + <a + :class="`${footerIconGroup.class} tableIcon + ${activeFooterIconIds.indexOf(footerIcon.id) !== -1 ? 'activeIcon' : ''}`" + :data-footer-icon-id="footerIcon.id" + > + <span + v-if="/^icon-/.test(footerIcon.icon || '')" + :title="footerIcon.title" + :class="footerIcon.icon" + style="margin-right:5.5px" + ></span> + <img + v-else + width="16" + height="16" + :title="footerIcon.title" + :src="footerIcon.icon" + style="margin-right:5.5px" + /> + <span v-if="footerIcon.title">{{ footerIcon.title }}</span> + </a> + </li> + <li class="divider"></li> + </Passthrough> + <li class="divider"></li> + </ul> + + <a + v-if="showExport" + class="dataTableAction activateExportSelection" + v-report-export="{ + reportTitle, + requestParams, + apiMethod: apiMethodToRequestDataTable, + reportFormats, + maxFilterLimit, + }" + :title="translate('General_ExportThisReport')" + href="" + style="margin-right:3.5px" + @click.prevent + ><span class="icon-export"></span></a> + + <a + v-if="showExportAsImageIcon" + class="dataTableAction tableIcon" + href + id="dataTableFooterExportAsImageIcon" + @click.prevent="showExportImage($event)" + :title="translate('General_ExportAsImage')" + style="margin-right:3.5px" + > + <span class="icon-image"></span> + </a> + + <a + v-if="showAnnotations" + class="dataTableAction annotationView" + href + :title="translate('Annotations_Annotations')" + @click.prevent + style="margin-right:3.5px" + ><span class="icon-annotation"></span></a> + + <a + v-if="showSearch" + class="dropdown-button dataTableAction searchAction" + href + :title="translate('General_Search')" + style="margin-right:3.5px" + @click.prevent + > + <span class="icon-search"></span> + <span class="icon-close" :title="translate('CoreHome_CloseSearch')"></span> + <input + :id="`widgetSearch_${reportId}`" + :title="translate('CoreHome_DataTableHowToSearch')" + type="text" + class="dataTableSearchInput" + /> + </a> + + <a + v-for="action in dataTableActions" + :key="action.id" + :class="`dataTableAction ${action.id}`" + href + @click.prevent + :title="action.title" + style="margin-right:3.5px" + > + <span v-if="/^icon-/.test(action.icon || '')" :class="action.icon"></span> + <img v-else width="16" height="16" :title="action.title" :src="action.icon"/> + </a> + + <ul + :id="`dropdownConfigure${randomIdForDropdown}`" + class="dropdown-content tableConfiguration" + > + <li v-if="showFlattenTable"> + <div + class="configItem dataTableFlatten" + v-html="$sanitize(flattenItemText)" + ></div> + </li> + <li + v-if="showDimensionsConfigItem" + > + <div + class="configItem dataTableShowDimensions" + v-html="$sanitize(showDimensionsText)" + ></div> + </li> + <li v-if="showFlatConfigItem"> + <div + class="configItem dataTableIncludeAggregateRows" + v-html="$sanitize(includeAggregateRowsText)" + ></div> + </li> + <li v-if="showTotalsConfigItem"> + <div + class="configItem dataTableShowTotalsRow" + v-html="$sanitize(keepTotalsRowText)" + ></div> + </li> + <li v-if="showExcludeLowPopulation"> + <div + class="configItem dataTableExcludeLowPopulation" + v-html="$sanitize(excludeLowPopText)" + ></div> + </li> + <li v-if="showPivotBySubtable"> + <div + class="configItem dataTablePivotBySubtable" + v-html="$sanitize(pivotByText)" + ></div> + </li> + </ul> + + <a + v-if="showPeriods" + v-dropdown-button + class="dropdown-button dataTableAction activatePeriodsSelection" + href="" + @click.prevent + :title="translate('CoreHome_ChangePeriod')" + :data-target="`dropdownPeriods${randomIdForDropdown}`" + > + <div> + <span class="icon-calendar"></span> + <span class="periodName"> + {{ translations[clientSideParameters.period] || clientSideParameters.period }} + </span> + </div> + </a> + <ul + v-if="showPeriods" + :id="`dropdownPeriods${randomIdForDropdown}`" + class="dropdown-content dataTablePeriods" + > + <li v-for="selectablePeriod in selectablePeriods" :key="selectablePeriod"> + <a + :data-period="selectablePeriod" + :class="`tableIcon ${clientSideParameters.period === selectablePeriod + ? 'activeIcon' : ''}`" + > + <span>{{ translations[selectablePeriod] || selectablePeriod }}</span> + </a> + </li> + </ul> + </div> +</template> + +<script lang="ts"> +import { defineComponent } from 'vue'; +import Passthrough from '../Passthrough/Passthrough.vue'; +import DropdownButton from '../DropdownButton/DropdownButton'; +import ReportExport from '../ReportExport/ReportExport'; +import { translate } from '../translate'; + +interface FooterIcon { + id: string; + icon?: string; +} + +interface FooterIconGroup { + buttons: FooterIcon[]; +} + +const { $ } = window; + +function getSingleStateIconText(text: string, addDefault?: boolean, replacement?: string) { + if (/(%(.\$)?s+)/g.test(translate(text))) { + const values = ['<br /><span class="action">']; + if (replacement) { + values.push(replacement); + } + let result = translate(text, ...values); + if (addDefault) { + result += ` (${translate('CoreHome_Default')})`; + } + result += '</span>'; + return result; + } + + return translate(text); +} + +function getToggledIconText(toggled: boolean, textToggled: string, textUntoggled: string) { + if (toggled) { + return getSingleStateIconText(textToggled, true); + } + + return getSingleStateIconText(textUntoggled); +} + +function isBooleanLikeSet(value: number|string|boolean) { + return !!value && value !== '0'; +} + +export default defineComponent({ + props: { + showPeriods: Boolean, + showFooter: Boolean, + showFooterIcons: Boolean, + showSearch: Boolean, + showFlattenTable: Boolean, + footerIcons: { + type: Array, + required: true, + }, + viewDataTable: { + type: String, + required: true, + }, + reportTitle: String, + requestParams: { + type: Object, + required: true, + }, + apiMethodToRequestDataTable: { + type: String, + required: true, + }, + maxFilterLimit: { + type: Number, + required: true, + }, + showExport: Boolean, + showExportAsImageIcon: Boolean, + showAnnotations: Boolean, + reportId: { + type: String, + required: true, + }, + dataTableActions: { + type: Array, + required: true, + }, + clientSideParameters: { + type: Object, + required: true, + }, + hasMultipleDimensions: Boolean, + isDataTableEmpty: Boolean, + showTotalsRow: Boolean, + showExcludeLowPopulation: Boolean, + showPivotBySubtable: Boolean, + selectablePeriods: Array, + translations: { + type: Object, + required: true, + }, + pivotDimensionName: String, + }, + components: { + Passthrough, + }, + directives: { + DropdownButton, + ReportExport, + }, + methods: { + showExportImage(event: Event) { + $(event.target as HTMLElement) + .closest('.dataTable') + .find('div.jqplot-target') + .trigger('piwikExportAsImage'); + }, + }, + computed: { + randomIdForDropdown(): number { + return Math.floor(Math.random() * 999999); + }, + allFooterIcons(): FooterIcon[] { + return (this.footerIcons as FooterIconGroup[]).reduce((icons, footerIcon) => { + icons.push(...footerIcon.buttons); + return icons; + }, [] as FooterIcon[]); + }, + activeFooterIcons(): FooterIcon[] { + const params = this.clientSideParameters as Record<string, string|number|boolean>; + + const result = [this.viewDataTable]; + if (params.abandonedCarts === 0 || params.abandonedCarts === '0') { + result.push('ecommerceOrder'); + } else if (params.abandonedCarts === 1 || params.abandonedCarts === '1') { + result.push('ecommerceAbandonedCart'); + } + + return result + .map((id) => this.allFooterIcons.find((button) => button.id === id)) + .filter((icon) => !!icon) as FooterIcon[]; + }, + activeFooterIcon(): string|undefined { + return this.activeFooterIcons[0]?.icon; + }, + activeFooterIconIds(): string[] { + return this.activeFooterIcons.map((icon) => icon.id); + }, + numIcons(): number { + return this.allFooterIcons.length; + }, + hasFooterIconsToShow(): boolean { + return !!this.activeFooterIcons.length && this.numIcons > 1; + }, + reportFormats(): Record<string, string> { + const formats: Record<string, string> = { + CSV: 'CSV', + TSV: 'TSV (Excel)', + XML: 'XML', + JSON: 'Json', + HTML: 'HTML', + }; + formats.RSS = 'RSS'; + return formats; + }, + showDimensionsConfigItem() { + return this.showFlattenTable + && `${this.clientSideParameters.flat}` === '1' + && this.hasMultipleDimensions; + }, + showFlatConfigItem() { + return this.showFlattenTable && `${this.clientSideParameters.flat}` === '1'; + }, + showTotalsConfigItem() { + return !this.isDataTableEmpty && this.showTotalsRow; + }, + hasConfigItems() { + return this.showFlattenTable + || this.showDimensionsConfigItem + || this.showFlatConfigItem + || this.showTotalsConfigItem + || this.showExcludeLowPopulation + || this.showPivotBySubtable; + }, + flattenItemText() { + const params = this.clientSideParameters as Record<string, string|number|boolean>; + return getToggledIconText( + isBooleanLikeSet(params.flat), + 'CoreHome_UnFlattenDataTable', + 'CoreHome_FlattenDataTable', + ); + }, + keepTotalsRowText() { + const params = this.clientSideParameters as Record<string, string|number|boolean>; + return getToggledIconText( + isBooleanLikeSet(params.keep_totals_row), + 'CoreHome_RemoveTotalsRowDataTable', + 'CoreHome_AddTotalsRowDataTable', + ); + }, + includeAggregateRowsText() { + const params = this.clientSideParameters as Record<string, string|number|boolean>; + return getToggledIconText( + isBooleanLikeSet(params.include_aggregate_rows), + 'CoreHome_DataTableExcludeAggregateRows', + 'CoreHome_DataTableIncludeAggregateRows', + ); + }, + showDimensionsText() { + const params = this.clientSideParameters as Record<string, string|number|boolean>; + return getToggledIconText( + isBooleanLikeSet(params.show_dimensions), + 'CoreHome_DataTableCombineDimensions', + 'CoreHome_DataTableShowDimensions', + ); + }, + pivotByText() { + const params = this.clientSideParameters as Record<string, string|number|boolean>; + if (isBooleanLikeSet(params.pivotBy)) { + return getSingleStateIconText('CoreHome_UndoPivotBySubtable', true); + } + + return getSingleStateIconText('CoreHome_PivotBySubtable', false, this.pivotDimensionName); + }, + excludeLowPopText() { + const params = this.clientSideParameters as Record<string, string|number|boolean>; + return getToggledIconText( + isBooleanLikeSet(params.enable_filter_excludelowpop), + 'CoreHome_IncludeRowsWithLowPopulation', + 'CoreHome_ExcludeRowsWithLowPopulation', + ); + }, + isAnyConfigureIconHighlighted() { + const params = this.clientSideParameters as Record<string, string|number|boolean>; + return isBooleanLikeSet(params.flat) + || isBooleanLikeSet(params.keep_totals_row) + || isBooleanLikeSet(params.include_aggregate_rows) + || isBooleanLikeSet(params.show_dimensions) + || isBooleanLikeSet(params.pivotBy) + || isBooleanLikeSet(params.enable_filter_excludelowpop); + }, + isTableView() { + return this.viewDataTable === 'table' + || this.viewDataTable === 'tableAllColumns' + || this.viewDataTable === 'tableGoals'; + }, + }, +}); +</script> diff --git a/plugins/CoreHome/vue/src/DatePicker/DatePicker.adapter.ts b/plugins/CoreHome/vue/src/DatePicker/DatePicker.adapter.ts deleted file mode 100644 index e276e59dc3..0000000000 --- a/plugins/CoreHome/vue/src/DatePicker/DatePicker.adapter.ts +++ /dev/null @@ -1,62 +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 - */ - -import { ITimeoutService } from 'angular'; -import createAngularJsAdapter from '../createAngularJsAdapter'; -import DatePicker from './DatePicker.vue'; - -export default createAngularJsAdapter<[ITimeoutService]>({ - component: DatePicker, - 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': (event, vm, scope, element, attrs, controller, $timeout) => { - $timeout(); // trigger new digest - }, - 'cell-hover-leave': (event, vm, scope, element, attrs, controller, $timeout) => { - $timeout(); // trigger new digest - }, - 'date-select': (event, vm, scope, element, attrs, controller, $timeout) => { - $timeout(); // trigger new digest - }, - }, - $inject: ['$timeout'], -}); diff --git a/plugins/CoreHome/vue/src/DateRangePicker/DateRangePicker.adapter.ts b/plugins/CoreHome/vue/src/DateRangePicker/DateRangePicker.adapter.ts deleted file mode 100644 index 12fda3b240..0000000000 --- a/plugins/CoreHome/vue/src/DateRangePicker/DateRangePicker.adapter.ts +++ /dev/null @@ -1,29 +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 - */ - -import createAngularJsAdapter from '../createAngularJsAdapter'; -import DateRangePicker from './DateRangePicker.vue'; - -export default createAngularJsAdapter({ - component: DateRangePicker, - scope: { - startDate: { - angularJsBind: '<', - }, - endDate: { - angularJsBind: '<', - }, - rangeChange: { - angularJsBind: '&', - }, - submit: { - angularJsBind: '&', - }, - }, - directiveName: 'piwikDateRangePicker', - restrict: 'E', -}); diff --git a/plugins/CoreHome/vue/src/DateRangePicker/DateRangePicker.less b/plugins/CoreHome/vue/src/DateRangePicker/DateRangePicker.less index f380d44ac5..6196e508ea 100644 --- a/plugins/CoreHome/vue/src/DateRangePicker/DateRangePicker.less +++ b/plugins/CoreHome/vue/src/DateRangePicker/DateRangePicker.less @@ -1,3 +1,3 @@ -piwik-date-range-picker { +.dateRangePicker { display: block; }
\ No newline at end of file diff --git a/plugins/CoreHome/vue/src/DateRangePicker/DateRangePicker.vue b/plugins/CoreHome/vue/src/DateRangePicker/DateRangePicker.vue index 0a5608d2aa..0b9f3bc0f4 100644 --- a/plugins/CoreHome/vue/src/DateRangePicker/DateRangePicker.vue +++ b/plugins/CoreHome/vue/src/DateRangePicker/DateRangePicker.vue @@ -5,7 +5,7 @@ --> <template> - <div> + <div class="dateRangePicker"> <div id="calendarRangeFrom"> <h6> {{ translate('General_DateRangeFrom') }} diff --git a/plugins/CoreHome/vue/src/DropdownButton/DropdownButton.adapter.ts b/plugins/CoreHome/vue/src/DropdownButton/DropdownButton.adapter.ts deleted file mode 100644 index 24cbb668e8..0000000000 --- a/plugins/CoreHome/vue/src/DropdownButton/DropdownButton.adapter.ts +++ /dev/null @@ -1,20 +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 - */ - -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]); - }, - }; -} - -window.angular.module('piwikApp').directive('dropdownButton', piwikDropdownButton); diff --git a/plugins/CoreHome/vue/src/DropdownMenu/DropdownMenu.adapter.ts b/plugins/CoreHome/vue/src/DropdownMenu/DropdownMenu.adapter.ts deleted file mode 100644 index fa50cbcce1..0000000000 --- a/plugins/CoreHome/vue/src/DropdownMenu/DropdownMenu.adapter.ts +++ /dev/null @@ -1,34 +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 - */ - -import { IDirective, ITimeoutService } from 'angular'; -import DropdownMenu from './DropdownMenu'; - -function piwikDropdownMenu($timeout: ITimeoutService): IDirective { - return { - restrict: 'A', - link: function piwikDropdownMenuLink(scope, element, attrs) { - const binding = { - instance: null, - value: { - activates: $(`#${attrs.activates}`)[0], - }, - oldValue: null, - modifiers: {}, - dir: {}, - }; - - $timeout(() => { - DropdownMenu.mounted(element[0], binding); - }); - }, - }; -} - -piwikDropdownMenu.$inject = ['$timeout']; - -window.angular.module('piwikApp').directive('piwikDropdownMenu', piwikDropdownMenu); diff --git a/plugins/CoreHome/vue/src/DropdownMenu/DropdownMenu.less b/plugins/CoreHome/vue/src/DropdownMenu/DropdownMenu.less index ad5bbf948d..23c5f750e8 100644 --- a/plugins/CoreHome/vue/src/DropdownMenu/DropdownMenu.less +++ b/plugins/CoreHome/vue/src/DropdownMenu/DropdownMenu.less @@ -1,4 +1,4 @@ -[piwik-dropdown-menu],.matomo-dropdown-menu { +.matomo-dropdown-menu { position: relative; &::after { diff --git a/plugins/CoreHome/vue/src/EnrichedHeadline/EnrichedHeadline.adapter.ts b/plugins/CoreHome/vue/src/EnrichedHeadline/EnrichedHeadline.adapter.ts deleted file mode 100644 index e730605e59..0000000000 --- a/plugins/CoreHome/vue/src/EnrichedHeadline/EnrichedHeadline.adapter.ts +++ /dev/null @@ -1,32 +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 - */ - -import createAngularJsAdapter from '../createAngularJsAdapter'; -import EnrichedHeadline from './EnrichedHeadline.vue'; - -export default createAngularJsAdapter({ - component: EnrichedHeadline, - scope: { - helpUrl: { - angularJsBind: '@', - }, - editUrl: { - angularJsBind: '@', - }, - reportGenerated: { - angularJsBind: '@?', - }, - featureName: { - angularJsBind: '@', - }, - inlineHelp: { - angularJsBind: '@?', - }, - }, - directiveName: 'piwikEnrichedHeadline', - transclude: true, -}); diff --git a/plugins/CoreHome/vue/src/EnrichedHeadline/EnrichedHeadline.vue b/plugins/CoreHome/vue/src/EnrichedHeadline/EnrichedHeadline.vue index cf827bea5f..0bed38251c 100644 --- a/plugins/CoreHome/vue/src/EnrichedHeadline/EnrichedHeadline.vue +++ b/plugins/CoreHome/vue/src/EnrichedHeadline/EnrichedHeadline.vue @@ -90,30 +90,30 @@ interface EnrichedHeadlineData { /** * Usage: * - * <h2 piwik-enriched-headline>All Websites Dashboard</h2> + * <h2><EnrichedHeadline>All Websites Dashboard</EnrichedHeadline></h2> * -> uses "All Websites Dashboard" as featurename * - * <h2 piwik-enriched-headline feature-name="All Websites Dashboard">All Websites Dashboard (Total: - * 309 Visits)</h2> + * <h2><EnrichedHeadline feature-name="All Websites Dashboard">All Websites Dashboard (Total: + * 309 Visits)</EnrichedHeadline></h2> * -> custom featurename * - * <h2 piwik-enriched-headline help-url="http://piwik.org/guide">All Websites Dashboard</h2> + * <h2><EnrichedHeadline help-url="http://piwik.org/guide">All Websites Dashboard</EnrichedHeadline></h2> * -> shows help icon and links to external url * - * <h2 piwik-enriched-headline edit-url="index.php?module=Foo&action=bar&id=4">All Websites - * Dashboard</h2> + * <h2><EnrichedHeadline edit-url="index.php?module=Foo&action=bar&id=4">All Websites + * Dashboard</EnrichedHeadline></h2> * -> makes the headline clickable linking to the specified url * - * <h2 piwik-enriched-headline inline-help="inlineHelp">Pages report</h2> + * <h2><EnrichedHeadline inline-help="inlineHelp">Pages report</EnrichedHeadline></h2> * -> inlineHelp specified via a attribute shows help icon on headline hover * - * <h2 piwik-enriched-headline>All Websites Dashboard + * <h2><EnrichedHeadline>All Websites Dashboard * <div class="inlineHelp">My <strong>inline help</strong></div> - * </h2> + * </EnrichedHeadline></h2> * -> alternative definition for inline help * -> shows help icon to display inline help on click. Note: You can combine inlinehelp and help-url * - * * <h2 piwik-enriched-headline report-generated="generated time">Pages report</h2> + * * <h2><EnrichedHeadline report-generated="generated time">Pages report</EnrichedHeadline></h2> * -> reportGenerated specified via this attribute shows a clock icon with a tooltip which * activated by hover * -> the tooltip shows the value of the attribute @@ -154,51 +154,48 @@ export default defineComponent({ mounted() { const root = this.$refs.root as HTMLElement; - // timeout used since angularjs does not fill out the transclude at this point - setTimeout(() => { - if (!this.actualInlineHelp) { - let helpNode = root.querySelector('.title .inlineHelp'); - if (!helpNode && root.parentElement?.nextElementSibling) { - // hack for reports :( - helpNode = (root.parentElement.nextElementSibling as HTMLElement) - .querySelector('.reportDocumentation'); - } + if (!this.actualInlineHelp) { + let helpNode = root.querySelector('.title .inlineHelp'); + if (!helpNode && root.parentElement?.nextElementSibling) { + // hack for reports :( + helpNode = (root.parentElement.nextElementSibling as HTMLElement) + .querySelector('.reportDocumentation'); + } - if (helpNode) { - // hackish solution to get binded html of p tag within the help node - // at this point the ng-bind-html is not yet converted into html when report is not - // initially loaded. Using $compile doesn't work. So get and set it manually - const helpDocs = helpNode.getAttribute('data-content')?.trim(); - if (helpDocs && helpDocs.length) { - this.actualInlineHelp = `<p>${helpDocs}</p>`; - setTimeout(() => helpNode!.remove(), 0); - } + if (helpNode) { + // hackish solution to get binded html of p tag within the help node + // at this point the ng-bind-html is not yet converted into html when report is not + // initially loaded. Using $compile doesn't work. So get and set it manually + const helpDocs = helpNode.getAttribute('data-content')?.trim(); + if (helpDocs && helpDocs.length) { + this.actualInlineHelp = `<p>${helpDocs}</p>`; + setTimeout(() => helpNode!.remove(), 0); } } + } - if (!this.actualFeatureName) { - this.actualFeatureName = root.querySelector('.title')?.textContent; - } + if (!this.actualFeatureName) { + this.actualFeatureName = root.querySelector('.title')?.textContent; + } - if (Matomo.period && Matomo.currentDateString) { - const currentPeriod = Periods.parse( - Matomo.period as string, - Matomo.currentDateString as string, - ); + if (Matomo.period && Matomo.currentDateString) { + const currentPeriod = Periods.parse( + Matomo.period as string, + Matomo.currentDateString as string, + ); - if (this.reportGenerated - && currentPeriod.containsToday() - ) { - window.$(root.querySelector('.report-generated')!).tooltip({ - track: true, - content: this.reportGenerated, - items: 'div', - show: false, - hide: false, - }); - } + if (this.reportGenerated + && currentPeriod.containsToday() + ) { + window.$(root.querySelector('.report-generated')!).tooltip({ + track: true, + content: this.reportGenerated, + items: 'div', + show: false, + hide: false, + }); } - }); + } }, methods: { htmlEntities(v: string) { diff --git a/plugins/CoreHome/vue/src/ExpandOnClick/ExpandOnClick.adapter.ts b/plugins/CoreHome/vue/src/ExpandOnClick/ExpandOnClick.adapter.ts deleted file mode 100644 index f4aa4bf46f..0000000000 --- a/plugins/CoreHome/vue/src/ExpandOnClick/ExpandOnClick.adapter.ts +++ /dev/null @@ -1,31 +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 - */ - -import { IDirective, IScope } from 'angular'; -import ExpandOnClick from './ExpandOnClick'; - -export default function piwikExpandOnClick(): IDirective { - return { - restrict: 'A', - link: function expandOnClickLink(scope: IScope, element: JQuery) { - const binding = { - instance: null, - value: { - expander: element.find('.title').first()[0], - }, - oldValue: null, - modifiers: {}, - dir: {}, - }; - - ExpandOnClick.mounted(element[0], binding); - element.on('$destroy', () => ExpandOnClick.unmounted(element[0], binding)); - }, - }; -} - -window.angular.module('piwikApp').directive('piwikExpandOnClick', piwikExpandOnClick); diff --git a/plugins/CoreHome/vue/src/ExpandOnHover/ExpandOnHover.adapter.ts b/plugins/CoreHome/vue/src/ExpandOnHover/ExpandOnHover.adapter.ts deleted file mode 100644 index 5dee0e351b..0000000000 --- a/plugins/CoreHome/vue/src/ExpandOnHover/ExpandOnHover.adapter.ts +++ /dev/null @@ -1,31 +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 - */ - -import { IScope } from 'angular'; -import ExpandOnHover from './ExpandOnHover'; - -function piwikExpandOnHover() { - return { - restrict: 'A', - link: function expandOnHoverLink(scope: IScope, element: JQLite) { - const binding = { - instance: null, - value: { - expander: element.find('.title').first()[0], - }, - oldValue: null, - modifiers: {}, - dir: {}, - }; - - ExpandOnHover.mounted(element[0], binding); - element.on('$destroy', () => ExpandOnHover.unmounted(element[0], binding)); - }, - }; -} - -window.angular.module('piwikApp').directive('piwikExpandOnHover', piwikExpandOnHover); diff --git a/plugins/CoreHome/vue/src/FieldArray/FieldArray.adapter.ts b/plugins/CoreHome/vue/src/FieldArray/FieldArray.adapter.ts deleted file mode 100644 index 43b533806e..0000000000 --- a/plugins/CoreHome/vue/src/FieldArray/FieldArray.adapter.ts +++ /dev/null @@ -1,51 +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 - */ - -import { INgModelController } from 'angular'; -import createAngularJsAdapter from '../createAngularJsAdapter'; -import FieldArray from './FieldArray.vue'; - -export default createAngularJsAdapter({ - component: FieldArray, - require: '?ngModel', - scope: { - name: { - angularJsBind: '=', - }, - field: { - angularJsBind: '=', - }, - }, - directiveName: 'matomoFieldArray', - events: { - 'update:modelValue': (newValue, vm, scope, element, attrs, ngModel) => { - if (newValue !== vm.modelValue) { - element.trigger('change', newValue); - - if (ngModel) { - ngModel.$setViewValue(newValue); - } - } - }, - }, - postCreate(vm, scope, element, attrs, controller) { - const ngModel = controller as INgModelController; - - // setup ng-model mapping - if (ngModel) { - ngModel.$setViewValue(vm.modelValue); - - ngModel.$render = () => { - if (window.angular.isString(ngModel.$viewValue)) { - vm.modelValue = JSON.parse(ngModel.$viewValue); - } else { - vm.modelValue = ngModel.$viewValue; - } - }; - } - }, -}); diff --git a/plugins/CoreHome/vue/src/FocusAnywhereButHere/FocusAnywhereButHere.adapter.ts b/plugins/CoreHome/vue/src/FocusAnywhereButHere/FocusAnywhereButHere.adapter.ts deleted file mode 100644 index 5e272d6643..0000000000 --- a/plugins/CoreHome/vue/src/FocusAnywhereButHere/FocusAnywhereButHere.adapter.ts +++ /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 - */ - -import { IDirective } from 'angular'; -import FocusAnywhereButHere from './FocusAnywhereButHere'; - -/** - * The given expression will be executed when the user presses either escape or presses something - * outside of this element - * - * Example: - * <div piwik-focus-anywhere-but-here="closeDialog()">my dialog</div> - */ -function piwikFocusAnywhereButHere(): IDirective { - return { - restrict: 'A', - link: function focusAnywhereButHereLink(scope, element, attr) { - const binding = { - instance: null, - value: { - blur: () => { - setTimeout(() => { - scope.$apply(attr.piwikFocusAnywhereButHere); - }, 0); - }, - }, - oldValue: null, - modifiers: {}, - dir: {}, - }; - - FocusAnywhereButHere.mounted(element[0], binding); - element.on('$destroy', () => FocusAnywhereButHere.unmounted(element[0], binding)); - }, - }; -} - -window.angular.module('piwikApp.directive').directive( - 'piwikFocusAnywhereButHere', - piwikFocusAnywhereButHere, -); diff --git a/plugins/CoreHome/vue/src/FocusIf/FocusIf.adapter.ts b/plugins/CoreHome/vue/src/FocusIf/FocusIf.adapter.ts deleted file mode 100644 index e02ef6c021..0000000000 --- a/plugins/CoreHome/vue/src/FocusIf/FocusIf.adapter.ts +++ /dev/null @@ -1,39 +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 - */ - -import { IDirective } from 'angular'; -import FocusIf from './FocusIf'; - -/** - * If the given expression evaluates to true the element will be focused - * - * Example: - * <input type="text" piwik-focus-if="view.editName"> - */ -function piwikFocusIf(): IDirective { - return { - restrict: 'A', - link: function focusIfLink(scope, element, attrs) { - scope.$watch(attrs.piwikFocusIf, (newValue) => { - const binding = { - instance: null, - arg: newValue ? '1' : undefined, - value: { - afterFocus: () => scope.$apply(), - }, - oldValue: null, - modifiers: {}, - dir: {}, - }; - - FocusIf.updated(element[0], binding); - }); - }, - }; -} - -window.angular.module('piwikApp.directive').directive('piwikFocusIf', piwikFocusIf); diff --git a/plugins/CoreHome/vue/src/Matomo/Matomo.adapter.ts b/plugins/CoreHome/vue/src/Matomo/Matomo.adapter.ts deleted file mode 100644 index 9a6da109da..0000000000 --- a/plugins/CoreHome/vue/src/Matomo/Matomo.adapter.ts +++ /dev/null @@ -1,36 +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 - */ - -import { IAngularEvent, IRootScopeService } from 'angular'; -import Matomo from './Matomo'; - -function piwikService() { - return Matomo; -} - -window.angular.module('piwikApp.service').service('piwik', piwikService); - -function initPiwikService(piwik: PiwikGlobal, $rootScope: IRootScopeService) { - // overwrite $rootScope so all events also go through Matomo.postEvent(...) too. - ($rootScope as any).$oldEmit = $rootScope.$emit; // eslint-disable-line - $rootScope.$emit = function emitWrapper(name: string, ...args: any[]): IAngularEvent { // eslint-disable-line - Matomo.postEventNoEmit(name, ...args); - return (this as any).$oldEmit(name, ...args); // eslint-disable-line - }; - - ($rootScope as any).$oldBroadcast = $rootScope.$broadcast; // eslint-disable-line - $rootScope.$broadcast = function broadcastWrapper(name: string, ...args: any[]): IAngularEvent { // eslint-disable-line - Matomo.postEventNoEmit(name, ...args); - return (this as any).$oldBroadcast(name, ...args); // eslint-disable-line - }; - - $rootScope.$on('$locationChangeSuccess', piwik.updatePeriodParamsFromUrl); -} - -initPiwikService.$inject = ['piwik', '$rootScope']; - -window.angular.module('piwikApp.service').run(initPiwikService); diff --git a/plugins/CoreHome/vue/src/Matomo/Matomo.ts b/plugins/CoreHome/vue/src/Matomo/Matomo.ts index 5db37c0882..5e6281c892 100644 --- a/plugins/CoreHome/vue/src/Matomo/Matomo.ts +++ b/plugins/CoreHome/vue/src/Matomo/Matomo.ts @@ -49,7 +49,7 @@ piwik.off = function removeMatomoEventListener(eventName: string, listener: Wrap } }; -piwik.postEventNoEmit = function postEventNoEmit( +piwik.postEvent = function postMatomoEvent( eventName: string, ...args: any[] // eslint-disable-line ): void { @@ -57,18 +57,5 @@ piwik.postEventNoEmit = function postEventNoEmit( window.dispatchEvent(event); }; -piwik.postEvent = function postMatomoEvent( - eventName: string, - ...args: any[] // eslint-disable-line -): void { - piwik.postEventNoEmit(eventName, ...args); - - // required until angularjs is removed - window.angular.element(() => { - const $rootScope = piwik.helper.getAngularDependency('$rootScope') as any; // eslint-disable-line - $rootScope.$oldEmit(eventName, ...args); - }); -}; - const Matomo = piwik; export default Matomo; diff --git a/plugins/CoreHome/vue/src/MatomoDialog/MatomoDialog.adapter.ts b/plugins/CoreHome/vue/src/MatomoDialog/MatomoDialog.adapter.ts deleted file mode 100644 index 687bbabfc0..0000000000 --- a/plugins/CoreHome/vue/src/MatomoDialog/MatomoDialog.adapter.ts +++ /dev/null @@ -1,70 +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 - */ - -import { IParseService, IScope } from 'angular'; -import MatomoDialog from './MatomoDialog.vue'; -import createAngularJsAdapter from '../createAngularJsAdapter'; - -export default createAngularJsAdapter<[IParseService]>({ - component: MatomoDialog, - scope: { - show: { - vue: 'modelValue', - default: false, - }, - element: { - default: (scope: IScope, element: JQLite) => element[0], - }, - }, - events: { - yes: ($event, vm, scope, element, attrs) => { - if (attrs.yes) { - scope.$eval(attrs.yes); - setTimeout(() => { scope.$apply(); }, 0); - } - }, - no: ($event, vm, scope, element, attrs) => { - if (attrs.no) { - scope.$eval(attrs.no); - setTimeout(() => { scope.$apply(); }, 0); - } - }, - validation: ($event, vm, scope, element, attrs) => { - if (attrs.no) { - scope.$eval(attrs.no); - setTimeout(() => { scope.$apply(); }, 0); - } - }, - close: ($event, vm, scope, element, attrs) => { - if (attrs.close) { - scope.$eval(attrs.close); - setTimeout(() => { scope.$apply(); }, 0); - } - }, - 'update:modelValue': (newValue, vm, scope, element, attrs, controller, $parse: IParseService) => { - setTimeout(() => { - scope.$apply($parse(attrs.piwikDialog).assign(scope, newValue)); - }, 0); - }, - }, - $inject: ['$parse'], - directiveName: 'piwikDialog', - transclude: true, - mountPointFactory: (scope, element) => { - const vueRootPlaceholder = $('<div class="vue-placeholder"/>'); - vueRootPlaceholder.appendTo(element); - return vueRootPlaceholder[0]; - }, - postCreate: (vm, scope, element, attrs) => { - scope.$watch(attrs.piwikDialog, (newValue: boolean, oldValue: boolean) => { - if (oldValue !== newValue) { - vm.modelValue = newValue || false; - } - }); - }, - noScope: true, -}); diff --git a/plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.adapter.ts b/plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.adapter.ts deleted file mode 100644 index 2e3d69ccab..0000000000 --- a/plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.adapter.ts +++ /dev/null @@ -1,20 +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 - */ -import MatomoUrl from './MatomoUrl'; - -function piwikUrl() { - const model = { - getSearchParam: MatomoUrl.getSearchParam.bind(MatomoUrl), - }; - - return model; -} - -window.angular.module('piwikApp.service').service('piwikUrl', piwikUrl); - -// make sure $location is initialized early -window.angular.module('piwikApp.service').run(['$location', () => null]); diff --git a/plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts b/plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts index 7dda81e484..e928ec585f 100644 --- a/plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts +++ b/plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts @@ -5,7 +5,6 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -import { ILocationService, ITimeoutService } from 'angular'; import { computed, ref, readonly } from 'vue'; import Matomo from '../Matomo/Matomo'; import { Periods, format } from '../Periods'; // important to load all periods here @@ -54,33 +53,31 @@ class MatomoUrl { constructor() { this.url.value = new URL(window.location.href); - // $locationChangeSuccess is triggered before angularjs changes actual window the hash, so we - // have to hook into this method if we want our event handlers to execute before other angularjs - // handlers (like the reporting page one) - Matomo.on('$locationChangeSuccess', (absUrl: string) => { - this.url.value = new URL(absUrl); + window.addEventListener('hashchange', (event) => { + this.url.value = new URL(event.newURL); }); this.updatePeriodParamsFromUrl(); } - updateHashToUrl(url: string) { - const $location: ILocationService = Matomo.helper.getAngularDependency('$location'); - $location.url(url); + updateHashToUrl(urlWithoutLeadingHash: string) { + const wholeHash = `#${urlWithoutLeadingHash}`; - const $timeout: ITimeoutService = Matomo.helper.getAngularDependency('$timeout'); - $timeout(); + if (window.location.hash === wholeHash) { // trigger event manually since the url is the same + window.dispatchEvent(new HashChangeEvent('hashchange', { + newURL: window.location.href, + oldURL: window.location.href, + })); + } else { + window.location.hash = wholeHash; + } } updateHash(params: QueryParameters|string) { const modifiedParams = this.getFinalHashParams(params); const serializedParams = this.stringify(modifiedParams); - const $location: ILocationService = Matomo.helper.getAngularDependency('$location'); - $location.search(serializedParams); - - const $timeout: ITimeoutService = Matomo.helper.getAngularDependency('$timeout'); - $timeout(); + this.updateHashToUrl(`?${serializedParams}`); } updateUrl(params: QueryParameters|string, hashParams: QueryParameters|string = {}) { @@ -124,7 +121,7 @@ class MatomoUrl { // if we're in an embedded context, loads an entire new URL, otherwise updates the hash updateLocation(params: QueryParameters|string) { - if (Matomo.helper.isAngularRenderingThePage()) { + if (Matomo.helper.isReportingPage()) { this.updateHash(params); return; } @@ -159,11 +156,10 @@ class MatomoUrl { Object.entries(search).filter(([, value]) => value !== '' && value !== null && value !== undefined), ); - // TODO: using $ since URLSearchParams does not handle array params the way Matomo uses them + // using jQuery since URLSearchParams does not handle array params the way Matomo uses them return $.param(searchWithoutEmpty).replace(/%5B%5D/g, '[]') // some browsers treat URLs w/ date=a,b differently from date=a%2Cb, causing multiple - // entries to show up in the browser history. this has a compounding effect w/ angular.js, - // which when the back button is pressed to effectively abort the back navigation. + // entries to show up in the browser history. .replace(/%2C/g, ',') // jquery seems to encode space characters as '+', but certain parts of matomo won't // decode it correctly, so we make sure to use %20 instead diff --git a/plugins/CoreHome/vue/src/MenuItemsDropdown/MenuItemsDropdown.adapter.ts b/plugins/CoreHome/vue/src/MenuItemsDropdown/MenuItemsDropdown.adapter.ts deleted file mode 100644 index 99fa4dcaff..0000000000 --- a/plugins/CoreHome/vue/src/MenuItemsDropdown/MenuItemsDropdown.adapter.ts +++ /dev/null @@ -1,36 +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 - */ - -import createAngularJsAdapter from '../createAngularJsAdapter'; -import MenuItemsDropdown from './MenuItemsDropdown.vue'; - -export default createAngularJsAdapter({ - component: MenuItemsDropdown, - scope: { - menuTitle: { - angularJsBind: '@', - }, - tooltip: { - angularJsBind: '@', - }, - showSearch: { - angularJsBind: '=', - }, - menuTitleChangeOnClick: { - angularJsBind: '=', - }, - }, - directiveName: 'piwikMenudropdown', - transclude: true, - events: { - 'after-select': ($event, vm, scope) => { - setTimeout(() => { - scope.$apply(); - }, 0); - }, - }, -}); diff --git a/plugins/CoreHome/vue/src/MobileLeftMenu/MobileLeftMenu.vue b/plugins/CoreHome/vue/src/MobileLeftMenu/MobileLeftMenu.vue new file mode 100644 index 0000000000..88c86c161d --- /dev/null +++ b/plugins/CoreHome/vue/src/MobileLeftMenu/MobileLeftMenu.vue @@ -0,0 +1,88 @@ +<!-- + Matomo - free/libre analytics platform + @link https://matomo.org + @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later +--> + +<template> + <ul id="mobile-left-menu" class="sidenav hide-on-large-only"> + <li class="no-padding" v-for="(level2, level1) in menuWithSubmenuItems" :key="level1"> + <ul class="collapsible collapsible-accordion" v-side-nav="{activator: activateLeftMenu}"> + <li> + <a class="collapsible-header"> + {{ translate(level1) }}<i :class="level2._icon || 'icon-arrow-down'"></i> + </a> + + <div class="collapsible-body"> + <ul> + <li + v-for="([name, params]) in Object.entries(level2).filter(([n]) => n[0] !== '_')" + :key="name" + > + <a + :title="params._tooltip ? translate(params._tooltip) : ''" + target="_self" + :href="getMenuUrl(params._url)" + > + {{ translate(name) }} + </a> + </li> + </ul> + </div> + </li> + </ul> + </li> + </ul> +</template> + +<script lang="ts"> +import { defineComponent } from 'vue'; +import MatomoUrl from '../MatomoUrl/MatomoUrl'; +import SideNav from '../SideNav/SideNav'; + +interface UrlParamsInfo { + _tooltip: string; + _url: QueryParameters; +} + +type Menu = Record<string, Record<string, UrlParamsInfo>>; + +const { $ } = window; + +export default defineComponent({ + props: { + menu: { + type: Object, + required: true, + }, + }, + directives: { + SideNav, + }, + methods: { + getMenuUrl(params: QueryParameters) { + return `?${MatomoUrl.stringify({ + ...MatomoUrl.urlParsed.value, + ...params, + })}`; + }, + }, + computed: { + menuWithSubmenuItems() { + const menu = (this.menu || {}) as Menu; + return Object.fromEntries( + Object.entries(menu) + // remove submenus that have no items that do not start w/ '_' + .filter(([, level2]) => { + const itemsWithoutUnderscore = Object.entries(level2) + .filter(([name]) => name[0] !== '_'); + return Object.keys(itemsWithoutUnderscore).length; + }), + ); + }, + activateLeftMenu() { + return $('nav .activateLeftMenu')[0]; + }, + }, +}); +</script> diff --git a/plugins/CoreHome/vue/src/MultiPairField/MultiPairField.adapter.ts b/plugins/CoreHome/vue/src/MultiPairField/MultiPairField.adapter.ts deleted file mode 100644 index 3313d4c65e..0000000000 --- a/plugins/CoreHome/vue/src/MultiPairField/MultiPairField.adapter.ts +++ /dev/null @@ -1,60 +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 - */ - -import { INgModelController } from 'angular'; -import createAngularJsAdapter from '../createAngularJsAdapter'; -import MultiPairField from './MultiPairField.vue'; - -export default createAngularJsAdapter({ - component: MultiPairField, - require: '?ngModel', - scope: { - name: { - angularJsBind: '=', - }, - field1: { - angularJsBind: '=', - }, - field2: { - angularJsBind: '=', - }, - field3: { - angularJsBind: '=', - }, - field4: { - angularJsBind: '=', - }, - }, - directiveName: 'matomoMultiPairField', - events: { - 'update:modelValue': (newValue, vm, scope, element, attrs, ngModel) => { - if (newValue !== vm.modelValue) { - element.trigger('change', newValue); - - if (ngModel) { - ngModel.$setViewValue(newValue); - } - } - }, - }, - postCreate(vm, scope, element, attrs, controller) { - const ngModel = controller as INgModelController; - - // setup ng-model mapping - if (ngModel) { - ngModel.$setViewValue(vm.modelValue); - - ngModel.$render = () => { - if (window.angular.isString(ngModel.$viewValue)) { - vm.modelValue = JSON.parse(ngModel.$viewValue); - } else { - vm.modelValue = ngModel.$viewValue; - } - }; - } - }, -}); diff --git a/plugins/CoreHome/vue/src/Notification/Notification.adapter.ts b/plugins/CoreHome/vue/src/Notification/Notification.adapter.ts deleted file mode 100644 index 4ff27943e9..0000000000 --- a/plugins/CoreHome/vue/src/Notification/Notification.adapter.ts +++ /dev/null @@ -1,36 +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 - */ - -import createAngularJsAdapter, { transformAngularJsBoolAttr } from '../createAngularJsAdapter'; -import Notification from './Notification.vue'; - -export default createAngularJsAdapter({ - component: Notification, - scope: { - notificationId: { - angularJsBind: '@?', - }, - title: { - angularJsBind: '@?notificationTitle', - }, - context: { - angularJsBind: '@?', - }, - type: { - angularJsBind: '@?', - }, - noclear: { - angularJsBind: '@?', - transform: transformAngularJsBoolAttr, - }, - toastLength: { - angularJsBind: '@?', - }, - }, - directiveName: 'piwikNotification', - transclude: true, -}); diff --git a/plugins/CoreHome/vue/src/Notification/index.ts b/plugins/CoreHome/vue/src/Notification/index.ts index a7a929a5bb..2951a317ee 100644 --- a/plugins/CoreHome/vue/src/Notification/index.ts +++ b/plugins/CoreHome/vue/src/Notification/index.ts @@ -4,8 +4,6 @@ * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -import './Notification.adapter'; -import './Notifications.store.adapter'; export { default as Notification } from './Notification.vue'; export { default as NotificationGroup } from './NotificationGroup.vue'; diff --git a/plugins/CoreHome/vue/src/PeriodDatePicker/PeriodDatePicker.adapter.ts b/plugins/CoreHome/vue/src/PeriodDatePicker/PeriodDatePicker.adapter.ts deleted file mode 100644 index b622973309..0000000000 --- a/plugins/CoreHome/vue/src/PeriodDatePicker/PeriodDatePicker.adapter.ts +++ /dev/null @@ -1,26 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -import createAngularJsAdapter from '../createAngularJsAdapter'; -import PeriodDatePicker from './PeriodDatePicker.vue'; - -export default createAngularJsAdapter({ - component: PeriodDatePicker, - scope: { - period: { - angularJsBind: '<', - }, - date: { - angularJsBind: '<', - }, - select: { - angularJsBind: '&', - }, - }, - directiveName: 'piwikPeriodDatePicker', - restrict: 'E', -}); diff --git a/plugins/CoreHome/vue/src/PeriodSelector/PeriodSelector.adapter.ts b/plugins/CoreHome/vue/src/PeriodSelector/PeriodSelector.adapter.ts deleted file mode 100644 index 6fa84325a2..0000000000 --- a/plugins/CoreHome/vue/src/PeriodSelector/PeriodSelector.adapter.ts +++ /dev/null @@ -1,19 +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 - */ - -import createAngularJsAdapter from '../createAngularJsAdapter'; -import PeriodSelector from './PeriodSelector.vue'; - -export default createAngularJsAdapter({ - component: PeriodSelector, - scope: { - periods: { - angularJsBind: '<', - }, - }, - directiveName: 'piwikPeriodSelector', -}); diff --git a/plugins/CoreHome/vue/src/PeriodSelector/PeriodSelector.less b/plugins/CoreHome/vue/src/PeriodSelector/PeriodSelector.less index 257c8753d5..9677a63b5e 100644 --- a/plugins/CoreHome/vue/src/PeriodSelector/PeriodSelector.less +++ b/plugins/CoreHome/vue/src/PeriodSelector/PeriodSelector.less @@ -1,4 +1,4 @@ -[piwik-period-selector],.periodSelector { +.periodSelector { display: inline-block; &.compare-dropdown-open { diff --git a/plugins/CoreHome/vue/src/PeriodSelector/PeriodSelector.vue b/plugins/CoreHome/vue/src/PeriodSelector/PeriodSelector.vue index e61ffc0405..cd94ddaf7e 100644 --- a/plugins/CoreHome/vue/src/PeriodSelector/PeriodSelector.vue +++ b/plugins/CoreHome/vue/src/PeriodSelector/PeriodSelector.vue @@ -429,7 +429,7 @@ export default defineComponent({ const compareParams = this.selectedComparisonParams; let baseParams: Record<string, unknown>; - if (Matomo.helper.isAngularRenderingThePage()) { + if (Matomo.helper.isReportingPage()) { this.closePeriodSelector(); baseParams = MatomoUrl.hashParsed.value; } else { diff --git a/plugins/CoreHome/vue/src/Periods/Periods.adapter.ts b/plugins/CoreHome/vue/src/Periods/Periods.adapter.ts deleted file mode 100644 index aff5d6c4f1..0000000000 --- a/plugins/CoreHome/vue/src/Periods/Periods.adapter.ts +++ /dev/null @@ -1,27 +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 - */ - -import Periods from './Periods'; -import RangePeriod from './Range'; -import { parseDate, format, todayIsInRange } from './utilities'; - -window.piwik.addCustomPeriod = Periods.addCustomPeriod.bind(Periods); - -function piwikPeriods() { - return { - getAllLabels: Periods.getAllLabels.bind(Periods), - isRecognizedPeriod: Periods.isRecognizedPeriod.bind(Periods), - get: Periods.get.bind(Periods), - parse: Periods.parse.bind(Periods), - parseDate, - format, - RangePeriod, - todayIsInRange, - }; -} - -window.angular.module('piwikApp.service').factory('piwikPeriods', piwikPeriods); diff --git a/plugins/CoreHome/vue/src/Periods/index.ts b/plugins/CoreHome/vue/src/Periods/index.ts index c1a265b4dc..7e04ee74a6 100644 --- a/plugins/CoreHome/vue/src/Periods/index.ts +++ b/plugins/CoreHome/vue/src/Periods/index.ts @@ -4,7 +4,6 @@ * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -import './Periods.adapter'; export { default as Periods } from './Periods'; export { default as Day } from './Day'; diff --git a/plugins/CoreHome/vue/src/Progressbar/Progressbar.adapter.ts b/plugins/CoreHome/vue/src/Progressbar/Progressbar.adapter.ts deleted file mode 100644 index 79cb2049b3..0000000000 --- a/plugins/CoreHome/vue/src/Progressbar/Progressbar.adapter.ts +++ /dev/null @@ -1,22 +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 - */ - -import createAngularJsAdapter from '../createAngularJsAdapter'; -import Progressbar from './Progressbar.vue'; - -export default createAngularJsAdapter({ - component: Progressbar, - scope: { - progress: { - angularJsBind: '=', - }, - label: { - angularJsBind: '=', - }, - }, - directiveName: 'piwikProgressbar', -}); diff --git a/plugins/CoreHome/vue/src/QuickAccess/QuickAccess.adapter.ts b/plugins/CoreHome/vue/src/QuickAccess/QuickAccess.adapter.ts deleted file mode 100644 index 2818deff0a..0000000000 --- a/plugins/CoreHome/vue/src/QuickAccess/QuickAccess.adapter.ts +++ /dev/null @@ -1,23 +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 - */ - -import { ITimeoutService } from 'angular'; -import createAngularJsAdapter from '../createAngularJsAdapter'; -import QuickAccess from './QuickAccess.vue'; - -export default createAngularJsAdapter<[ITimeoutService]>({ - component: QuickAccess, - directiveName: 'piwikQuickAccess', - events: { - itemSelected(event, vm, scope, elem, attrs, controller, $timeout: ITimeoutService) { - $timeout(); - }, - blur(event, vm, scope) { - setTimeout(() => scope.$apply()); - }, - }, -}); diff --git a/plugins/CoreHome/vue/src/QuickAccess/QuickAccess.vue b/plugins/CoreHome/vue/src/QuickAccess/QuickAccess.vue index d7812cd992..b5dfecaf27 100644 --- a/plugins/CoreHome/vue/src/QuickAccess/QuickAccess.vue +++ b/plugins/CoreHome/vue/src/QuickAccess/QuickAccess.vue @@ -171,8 +171,7 @@ export default defineComponent({ mounted() { const root = this.$refs.root as HTMLElement; - // TODO: temporary, remove after angularjs is removed. - // this is currently needed since angularjs will render a div, then vue will render a div + // this is currently needed since vue-entry code will render a div, then vue will render a div // within it, but the top controls and CSS expect to have certain CSS classes in the root // element. // same applies to above watch for searchActive() @@ -219,7 +218,9 @@ export default defineComponent({ }, computed: { hasSitesSelector() { - return !!document.querySelector('.top_controls [piwik-siteselector]'); + return !!document.querySelector( + '.top_controls .siteSelector,.top_controls [vue-entry="CoreHome.SiteSelector"]', + ); }, quickAccessTitle() { let searchAreasTitle = ''; diff --git a/plugins/CoreHome/vue/src/ReportExport/ReportExport.adapter.ts b/plugins/CoreHome/vue/src/ReportExport/ReportExport.adapter.ts deleted file mode 100644 index a949af3a80..0000000000 --- a/plugins/CoreHome/vue/src/ReportExport/ReportExport.adapter.ts +++ /dev/null @@ -1,51 +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 - */ - -import { IDirective, ITimeoutService } from 'angular'; -import ReportExport from './ReportExport'; - -export default function piwikReportExport($timeout: ITimeoutService): IDirective { - return { - restrict: 'A', - scope: { - reportTitle: '@', - requestParams: '@', - reportFormats: '@', - apiMethod: '@', - maxFilterLimit: '@', - }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - link: function piwikReportExportLink(scope: any, element: JQuery) { - const binding = { - instance: null, - value: { - reportTitle: scope.reportTitle, - requestParams: scope.requestParams, - reportFormats: typeof scope.reportFormats === 'string' - ? JSON.parse(scope.reportFormats) - : scope.reportFormats, - apiMethod: scope.apiMethod, - maxFilterLimit: parseInt(scope.maxFilterLimit, 10), - onClose: () => { - $timeout(() => { - window.angular.element(document).injector().get('$rootScope').$apply(); - }, 10); - }, - }, - oldValue: null, - modifiers: {}, - dir: {}, - }; - - ReportExport.mounted(element[0], binding); - }, - }; -} - -piwikReportExport.$inject = ['$timeout']; - -window.angular.module('piwikApp').directive('piwikReportExport', piwikReportExport); diff --git a/plugins/CoreHome/vue/src/ReportMetadata/ReportMetadata.store.adapter.ts b/plugins/CoreHome/vue/src/ReportMetadata/ReportMetadata.store.adapter.ts deleted file mode 100644 index bc1c37f6fe..0000000000 --- a/plugins/CoreHome/vue/src/ReportMetadata/ReportMetadata.store.adapter.ts +++ /dev/null @@ -1,19 +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 - */ - -import ReportMetadataStoreInstance from './ReportMetadata.store'; -import { cloneThenApply } from '../createAngularJsAdapter'; - -window.angular.module('piwikApp.service').factory('reportMetadataModel', () => ({ - get reports() { - return ReportMetadataStoreInstance.reports.value; - }, - findReport: - ReportMetadataStoreInstance.findReport.bind(ReportMetadataStoreInstance), - fetchReportMetadata: () => ReportMetadataStoreInstance.fetchReportMetadata() - .then((m) => cloneThenApply(m)), -})); diff --git a/plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.adapter.ts b/plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.adapter.ts deleted file mode 100644 index 8de6fd465c..0000000000 --- a/plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.adapter.ts +++ /dev/null @@ -1,14 +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 - */ - -import createAngularJsAdapter from '../createAngularJsAdapter'; -import ReportingMenu from './ReportingMenu.vue'; - -export default createAngularJsAdapter({ - component: ReportingMenu, - directiveName: 'piwikReportingMenu', -}); diff --git a/plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.store.adapter.ts b/plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.store.adapter.ts deleted file mode 100644 index 3407fb6948..0000000000 --- a/plugins/CoreHome/vue/src/ReportingMenu/ReportingMenu.store.adapter.ts +++ /dev/null @@ -1,50 +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 - */ - -import ReportingMenuStoreInstance from './ReportingMenu.store'; -import { cloneThenApply } from '../createAngularJsAdapter'; -import { CategoryContainer } from './Category'; -import { SubcategoryContainer } from './Subcategory'; - -// removed boolean active property from objects in vue so we can keep the store immutable, but, -// angularjs version should still have them -function addActiveMenuItems(menu: typeof ReportingMenuStoreInstance.menu.value) { - menu.forEach((category) => { - if (category.id === ReportingMenuStoreInstance.activeCategory.value) { - category.active = true; - - ((category as CategoryContainer).subcategories || []).forEach((subcat) => { - if (subcat.id === ReportingMenuStoreInstance.activeSubcategory.value) { - subcat.active = true; - - ((subcat as SubcategoryContainer).subcategories || []).forEach((subsubcat) => { - if (subsubcat.id === ReportingMenuStoreInstance.activeSubsubcategory.value) { - subsubcat.active = true; - } - }); - } - }); - } - }); - return menu; -} - -function reportingMenuModelAdapter() { - return { - get menu() { - return ReportingMenuStoreInstance.menu.value; - }, - findSubcategory: - ReportingMenuStoreInstance.findSubcategory.bind(ReportingMenuStoreInstance), - reloadMenuItems: () => ReportingMenuStoreInstance.reloadMenuItems() - .then((p) => addActiveMenuItems(cloneThenApply(p))), - fetchMenuItems: () => ReportingMenuStoreInstance.fetchMenuItems() - .then((p) => addActiveMenuItems(cloneThenApply(p))), - }; -} - -window.angular.module('piwikApp.service').factory('reportingMenuModel', reportingMenuModelAdapter); diff --git a/plugins/CoreHome/vue/src/ReportingPage/ReportingPage.adapter.ts b/plugins/CoreHome/vue/src/ReportingPage/ReportingPage.adapter.ts deleted file mode 100644 index f54501f8ee..0000000000 --- a/plugins/CoreHome/vue/src/ReportingPage/ReportingPage.adapter.ts +++ /dev/null @@ -1,14 +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 - */ - -import createAngularJsAdapter from '../createAngularJsAdapter'; -import ReportingPage from './ReportingPage.vue'; - -export default createAngularJsAdapter({ - component: ReportingPage, - directiveName: 'piwikReportingPage', -}); diff --git a/plugins/CoreHome/vue/src/ReportingPage/ReportingPage.store.adapter.ts b/plugins/CoreHome/vue/src/ReportingPage/ReportingPage.store.adapter.ts deleted file mode 100644 index e9feb23393..0000000000 --- a/plugins/CoreHome/vue/src/ReportingPage/ReportingPage.store.adapter.ts +++ /dev/null @@ -1,23 +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 - */ - -import ReportingPageStoreInstance from './ReportingPage.store'; - -function reportingPageModelAdapter() { - return { - get page() { - return ReportingPageStoreInstance.page.value; - }, - get widgets() { - return ReportingPageStoreInstance.widgets.value; - }, - resetPage: ReportingPageStoreInstance.resetPage.bind(ReportingPageStoreInstance), - fetchPage: ReportingPageStoreInstance.fetchPage.bind(ReportingPageStoreInstance), - }; -} - -window.angular.module('piwikApp.service').factory('reportingPageModel', reportingPageModelAdapter); diff --git a/plugins/CoreHome/vue/src/ReportingPages/ReportingPages.store.adapter.ts b/plugins/CoreHome/vue/src/ReportingPages/ReportingPages.store.adapter.ts deleted file mode 100644 index 0c1981badb..0000000000 --- a/plugins/CoreHome/vue/src/ReportingPages/ReportingPages.store.adapter.ts +++ /dev/null @@ -1,29 +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 - */ - -import ReportingPagesStoreInstance from './ReportingPages.store'; -import { cloneThenApply, clone } from '../createAngularJsAdapter'; - -function reportingPagesModelAdapter() { - return { - get pages() { - return ReportingPagesStoreInstance.pages.value; - }, - findPageInCategory: ( - ...args: Parameters<typeof ReportingPagesStoreInstance.findPageInCategory> - ) => clone(ReportingPagesStoreInstance.findPageInCategory(...args)), - findPage: (...args: Parameters<typeof ReportingPagesStoreInstance.findPage>) => clone( - ReportingPagesStoreInstance.findPage(...args), - ), - reloadAllPages: () => ReportingPagesStoreInstance.reloadAllPages() - .then((p) => cloneThenApply(p)), - getAllPages: () => ReportingPagesStoreInstance.getAllPages() - .then((p) => cloneThenApply(p)), - }; -} - -window.angular.module('piwikApp.service').factory('reportingPagesModel', reportingPagesModelAdapter); diff --git a/plugins/CoreHome/vue/src/SelectOnFocus/SelectOnFocus.adapter.ts b/plugins/CoreHome/vue/src/SelectOnFocus/SelectOnFocus.adapter.ts deleted file mode 100644 index 9a8fac6a76..0000000000 --- a/plugins/CoreHome/vue/src/SelectOnFocus/SelectOnFocus.adapter.ts +++ /dev/null @@ -1,29 +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 - */ - -import { IDirective, IScope } from 'angular'; -import SelectOnFocus from './SelectOnFocus'; - -export default function piwikSelectOnFocus(): IDirective { - return { - restrict: 'A', - link: function piwikSelectOnFocusLink(scope: IScope, element: JQuery) { - const binding = { - instance: null, - value: {}, - oldValue: null, - modifiers: {}, - dir: {}, - }; - - SelectOnFocus.mounted(element[0], binding); - element.on('$destroy', () => SelectOnFocus.unmounted(element[0], binding)); - }, - }; -} - -window.angular.module('piwikApp').directive('piwikSelectOnFocus', piwikSelectOnFocus); diff --git a/plugins/CoreHome/vue/src/ShowSensitiveData/ShowSensitiveData.adapter.ts b/plugins/CoreHome/vue/src/ShowSensitiveData/ShowSensitiveData.adapter.ts deleted file mode 100644 index 24f8186cb8..0000000000 --- a/plugins/CoreHome/vue/src/ShowSensitiveData/ShowSensitiveData.adapter.ts +++ /dev/null @@ -1,32 +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 - */ - -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 as string, - }, - oldValue: null, - modifiers: {}, - dir: {}, - }; - - ShowSensitiveData.mounted(element[0], binding); - }, - }; -} - -window.angular.module('piwikApp').directive('piwikShowSensitiveData', piwikShowSensitiveData); diff --git a/plugins/CoreHome/vue/src/SideNav/SideNav.adapter.ts b/plugins/CoreHome/vue/src/SideNav/SideNav.adapter.ts deleted file mode 100644 index 3778689d94..0000000000 --- a/plugins/CoreHome/vue/src/SideNav/SideNav.adapter.ts +++ /dev/null @@ -1,35 +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 - */ - -import { IDirective, ITimeoutService } from 'angular'; -import SideNav from './SideNav'; - -export default function piwikSideNav($timeout: ITimeoutService): IDirective { - return { - restrict: 'A', - priority: 10, - link: function linkPiwikSideNav(scope, element, attr) { - const binding = { - instance: null, - value: { - activator: $(attr.piwikSideNav)[0], - }, - oldValue: null, - modifiers: {}, - dir: {}, - }; - - $timeout(() => { - SideNav.mounted(element[0], binding); - }); - }, - }; -} - -piwikSideNav.$inject = ['$timeout']; - -window.angular.module('piwikApp.directive').directive('piwikSideNav', piwikSideNav); diff --git a/plugins/CoreHome/vue/src/SideNav/SideNav.ts b/plugins/CoreHome/vue/src/SideNav/SideNav.ts index ba98585066..da52b815da 100644 --- a/plugins/CoreHome/vue/src/SideNav/SideNav.ts +++ b/plugins/CoreHome/vue/src/SideNav/SideNav.ts @@ -12,9 +12,10 @@ import DirectiveUtilities from '../directiveUtilities'; interface SideNavArgs { activator: HTMLElement | string; -} -let initialized = false; + // directive state + initialized?: boolean; +} /** * Will activate the materialize side nav feature once rendered. We use this directive as @@ -32,8 +33,8 @@ export default { } setTimeout(() => { - if (!initialized) { - initialized = true; + if (!binding.value.initialized) { + binding.value.initialized = true; const sideNavActivator = DirectiveUtilities.getRef(binding.value.activator, binding); if (sideNavActivator) { diff --git a/plugins/CoreHome/vue/src/SiteSelector/SiteSelector.adapter.ts b/plugins/CoreHome/vue/src/SiteSelector/SiteSelector.adapter.ts deleted file mode 100644 index 68edc0d5ff..0000000000 --- a/plugins/CoreHome/vue/src/SiteSelector/SiteSelector.adapter.ts +++ /dev/null @@ -1,128 +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 - */ - -import { - IAttributes, - INgModelController, - IScope, - ITimeoutService, -} from 'angular'; -import { nextTick } from 'vue'; -import createAngularJsAdapter from '../createAngularJsAdapter'; -import SiteSelector from './SiteSelector.vue'; -import Matomo from '../Matomo/Matomo'; - -export default createAngularJsAdapter<[ITimeoutService]>({ - component: SiteSelector, - require: '?ngModel', - scope: { - showSelectedSite: { - angularJsBind: '=', - }, - showAllSitesItem: { - angularJsBind: '=', - }, - switchSiteOnSelect: { - angularJsBind: '=', - }, - onlySitesWithAdminAccess: { - angularJsBind: '=', - }, - name: { - angularJsBind: '@', - }, - allSitesText: { - angularJsBind: '@', - }, - allSitesLocation: { - angularJsBind: '@', - }, - placeholder: { - angularJsBind: '@', - }, - modelValue: { - default(scope: IScope, element: JQLite, attrs: IAttributes) { - if (attrs.siteid && attrs.sitename) { - return { id: attrs.siteid, name: Matomo.helper.htmlDecode(attrs.sitename) }; - } - - if (Matomo.idSite) { - return { - id: Matomo.idSite, - name: Matomo.helper.htmlDecode(Matomo.siteName), - }; - } - - return undefined; - }, - }, - }, - $inject: ['$timeout'], - directiveName: 'piwikSiteselector', - events: { - 'update:modelValue': (newValue, vm, scope, element, attrs, ngModel, $timeout) => { - if ((newValue && !vm.modelValue) - || (!newValue && vm.modelValue) - || newValue.id !== vm.modelValue.id - ) { - $timeout(() => { - scope.value = newValue; - - element.attr('siteid', newValue.id); - element.trigger('change', newValue); - - if (ngModel) { - ngModel.$setViewValue(newValue); - ngModel.$render(); // not called automatically by the digest - } - }); - } - }, - blur(event, vm, scope) { - setTimeout(() => scope.$apply()); - }, - }, - postCreate(vm, scope, element, attrs, controller) { - const ngModel = controller as INgModelController; - - scope.$watch('value', (newVal: unknown) => { - nextTick(() => { - if (newVal !== vm.modelValue) { - vm.modelValue = newVal; - } - }); - }); - - if (attrs.siteid && attrs.sitename) { - scope.value = { id: attrs.siteid, name: Matomo.helper.htmlDecode(attrs.sitename) }; - vm.modelValue = scope.value; - } else if (Matomo.idSite) { - scope.value = { - id: Matomo.idSite, - name: Matomo.helper.htmlDecode(Matomo.siteName), - }; - vm.modelValue = scope.value; - } - - // setup ng-model mapping - if (ngModel) { - ngModel.$setViewValue(vm.modelValue); - - ngModel.$render = () => { - nextTick(() => { - nextTick(() => { - if (window.angular.isString(ngModel.$viewValue)) { - vm.modelValue = JSON.parse(ngModel.$viewValue); - } else { - vm.modelValue = ngModel.$viewValue; - } - }); - }); - }; - } - }, -}); diff --git a/plugins/CoreHome/vue/src/SiteSelector/SitesStore.adapter.ts b/plugins/CoreHome/vue/src/SiteSelector/SitesStore.adapter.ts deleted file mode 100644 index c454d60625..0000000000 --- a/plugins/CoreHome/vue/src/SiteSelector/SitesStore.adapter.ts +++ /dev/null @@ -1,24 +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 - */ - -import SitesStore from './SitesStore'; -import { cloneThenApply } from '../createAngularJsAdapter'; - -function siteSelectorModelAdapter() { - return { - get initialSites() { - return SitesStore.initialSites.value; - }, - loadSite: SitesStore.loadSite.bind(SitesStore), - loadInitialSites: () => cloneThenApply(SitesStore.loadInitialSites()), - searchSite: (...args: Parameters<typeof SitesStore['searchSite']>) => cloneThenApply( - SitesStore.searchSite(...args), - ), - }; -} - -window.angular.module('piwikApp.service').factory('siteSelectorModel', siteSelectorModelAdapter); diff --git a/plugins/CoreHome/vue/src/Sparkline/Sparkline.adapter.ts b/plugins/CoreHome/vue/src/Sparkline/Sparkline.adapter.ts deleted file mode 100644 index 70dacd306e..0000000000 --- a/plugins/CoreHome/vue/src/Sparkline/Sparkline.adapter.ts +++ /dev/null @@ -1,23 +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 - */ - -import createAngularJsAdapter from '../createAngularJsAdapter'; -import Sparkline from './Sparkline.vue'; - -export default createAngularJsAdapter({ - component: Sparkline, - scope: { - seriesIndices: { - angularJsBind: '<', - }, - params: { - angularJsBind: '<', - }, - }, - directiveName: 'piwikSparkline', - restrict: 'E', -}); diff --git a/plugins/CoreHome/vue/src/Sparkline/Sparkline.less b/plugins/CoreHome/vue/src/Sparkline/Sparkline.less index a31d68547e..2dfcf64c15 100644 --- a/plugins/CoreHome/vue/src/Sparkline/Sparkline.less +++ b/plugins/CoreHome/vue/src/Sparkline/Sparkline.less @@ -1,8 +1,4 @@ -[piwik-sparkline] { - display: inline-block; - - img { - width: 100px; - height: 25px; - } -}
\ No newline at end of file +img.sparklineImg { + width: 100px; + height: 25px; +} diff --git a/plugins/CoreHome/vue/src/Sparkline/Sparkline.vue b/plugins/CoreHome/vue/src/Sparkline/Sparkline.vue index ca6844506e..7466549966 100644 --- a/plugins/CoreHome/vue/src/Sparkline/Sparkline.vue +++ b/plugins/CoreHome/vue/src/Sparkline/Sparkline.vue @@ -5,7 +5,14 @@ --> <template> - <img loading="lazy" alt="" :src="sparklineUrl" :width="width" :height="height" /> + <img + class="sparklineImg" + loading="lazy" + alt="" + :src="sparklineUrl" + :width="width" + :height="height" + /> </template> <script lang="ts"> diff --git a/plugins/CoreHome/vue/src/VersionInfoHeaderMessage/VersionInfoHeaderMessage.vue b/plugins/CoreHome/vue/src/VersionInfoHeaderMessage/VersionInfoHeaderMessage.vue new file mode 100644 index 0000000000..e15a6f9121 --- /dev/null +++ b/plugins/CoreHome/vue/src/VersionInfoHeaderMessage/VersionInfoHeaderMessage.vue @@ -0,0 +1,129 @@ +<!-- + Matomo - free/libre analytics platform + @link https://matomo.org + @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later +--> + +<template> + <div + v-expand-on-hover="{expander: 'expander'}" + id="header_message" + class="piwikSelector borderedControl piwikTopControl" + :class="{header_info: !latestVersionAvailable, update_available: latestVersionAvailable}" + > + <Passthrough v-if="latestVersionAvailable && !isPiwikDemo"> + <span + v-if="isMultiServerEnvironment" + class="title" + style="cursor:pointer;" + ref="expander" + > + {{ translate('General_NewUpdatePiwikX', latestVersionAvailable) }} + <span class="icon-warning"></span> + </span> + <a + v-else + class="title" + href="?module=CoreUpdater&action=newVersionAvailable" + style="cursor:pointer;" + > + {{ translate('General_NewUpdatePiwikX', latestVersionAvailable) }} + <span class="icon-warning"></span> + </a> + </Passthrough> + <Passthrough v-else-if="isSuperUser && isAdminArea"> + <a v-if="isInternetEnabled" class="title" v-html="$sanitize(updateCheck)"></a> + <a + v-else + class="title" + href="https://matomo.org/changelog/" + target="_blank" + rel="noreferrer noopener" + > + <span id="updateCheckLinkContainer"> + {{ translate('CoreHome_SeeAvailableVersions') }} + </span> + </a> + </Passthrough> + + <div class="dropdown positionInViewport"> + <span v-if="latestVersionAvailable && isSuperUser" v-html="$sanitize(updateNowText)"></span> + <span + v-else-if="latestVersionAvailable && !isPiwikDemo && hasSomeViewAccess && !isAnonymous" + v-html="$sanitize(updateAvailableText)" + ></span> + + {{ translate('General_YouAreCurrentlyUsing', piwikVersion) }} + </div> + </div> +</template> + +<script lang="ts"> +import { defineComponent } from 'vue'; +import { translate } from '../translate'; +import ExpandOnHover from '../ExpandOnHover/ExpandOnHover'; +import Passthrough from '../Passthrough/Passthrough.vue'; + +export default defineComponent({ + props: { + isMultiServerEnvironment: Boolean, + latestVersionAvailable: String, + isPiwikDemo: Boolean, + isSuperUser: Boolean, + isAdminArea: Boolean, + isInternetEnabled: Boolean, + updateCheck: String, + isAnonymous: Boolean, + hasSomeViewAccess: Boolean, + contactEmail: String, + piwikVersion: String, + }, + components: { + Passthrough, + }, + directives: { + ExpandOnHover, + }, + computed: { + updateNowText() { + let text = ''; + + if (this.isMultiServerEnvironment) { + const link = `https://builds.matomo.org/piwik-${this.latestVersionAvailable}.zip`; + text = translate( + 'CoreHome_OneClickUpdateNotPossibleAsMultiServerEnvironment', + `<a rel="noreferrer noopener" href="${link}">builds.matomo.org</a>`, + ); + } else { + text = translate( + 'General_PiwikXIsAvailablePleaseUpdateNow', + this.latestVersionAvailable || '', + '<br /><a href="index.php?module=CoreUpdater&action=newVersionAvailable">', + '</a>', + '<a target="_blank" rel="noreferrer noopener" href="https://matomo.org/changelog/">', + '</a>', + ); + } + + return `${text}<br/>`; + }, + updateAvailableText() { + const updateSubject = translate( + 'General_NewUpdatePiwikX', + this.latestVersionAvailable || '', + ); + const matomoLink = '<a target="_blank" rel="noreferrer noopener" href="https://matomo.org/">Matomo</a>'; + const changelogLinkStart = '<a target="_blank" rel="noreferrer noopener" href="https://matomo.org/changelog/">'; + + const text = translate( + 'General_PiwikXIsAvailablePleaseNotifyPiwikAdmin', + `${matomoLink} ${changelogLinkStart}${this.latestVersionAvailable}</a>`, + `<a href="mailto:${this.contactEmail}?subject=${encodeURIComponent(updateSubject)}">`, + '</a>', + ); + + return `${text}<br />`; + }, + }, +}); +</script> diff --git a/plugins/CoreHome/vue/src/Widget/Widget.adapter.ts b/plugins/CoreHome/vue/src/Widget/Widget.adapter.ts deleted file mode 100644 index c33934c04a..0000000000 --- a/plugins/CoreHome/vue/src/Widget/Widget.adapter.ts +++ /dev/null @@ -1,25 +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 - */ - -import createAngularJsAdapter from '../createAngularJsAdapter'; -import Widget from './Widget.vue'; - -export default createAngularJsAdapter({ - component: Widget, - scope: { - widget: { - angularJsBind: '=?piwikWidget', - }, - widgetized: { - angularJsBind: '=?', - }, - containerid: { - angularJsBind: '@', - }, - }, - directiveName: 'piwikWidget', -}); diff --git a/plugins/CoreHome/vue/src/Widget/Widget.vue b/plugins/CoreHome/vue/src/Widget/Widget.vue index 720970109e..eb9118fe63 100644 --- a/plugins/CoreHome/vue/src/Widget/Widget.vue +++ b/plugins/CoreHome/vue/src/Widget/Widget.vue @@ -109,7 +109,7 @@ export default defineComponent({ setup() { function tooltipContent(this: HTMLElement) { const $this = window.$(this) as JQuery; - if ($this.attr('piwik-field') === '' || $this.hasClass('matomo-form-field')) { + if ($this.hasClass('matomo-form-field')) { // do not show it for form fields return ''; } diff --git a/plugins/CoreHome/vue/src/WidgetByDimensionContainer/WidgetByDimensionContainer.adapter.ts b/plugins/CoreHome/vue/src/WidgetByDimensionContainer/WidgetByDimensionContainer.adapter.ts deleted file mode 100644 index 7f3f2bfb65..0000000000 --- a/plugins/CoreHome/vue/src/WidgetByDimensionContainer/WidgetByDimensionContainer.adapter.ts +++ /dev/null @@ -1,23 +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 - */ - -import createAngularJsAdapter from '../createAngularJsAdapter'; -import WidgetByDimensionContainer from './WidgetByDimensionContainer.vue'; -import { Widget } from '../Widget/types'; - -export default createAngularJsAdapter({ - component: WidgetByDimensionContainer, - scope: { - widgets: { - angularJsBind: '=piwikWidgetByDimensionContainer', - transform(v) { - return (v as { widgets: Widget[] }).widgets; - }, - }, - }, - directiveName: 'piwikWidgetByDimensionContainer', -}); diff --git a/plugins/CoreHome/vue/src/WidgetContainer/WidgetContainer.adapter.ts b/plugins/CoreHome/vue/src/WidgetContainer/WidgetContainer.adapter.ts deleted file mode 100644 index 3a8a714823..0000000000 --- a/plugins/CoreHome/vue/src/WidgetContainer/WidgetContainer.adapter.ts +++ /dev/null @@ -1,19 +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 - */ - -import createAngularJsAdapter from '../createAngularJsAdapter'; -import WidgetContainer from './WidgetContainer.vue'; - -export default createAngularJsAdapter({ - component: WidgetContainer, - scope: { - container: { - angularJsBind: '=piwikWidgetContainer', - }, - }, - directiveName: 'piwikWidgetContainer', -}); diff --git a/plugins/CoreHome/vue/src/WidgetContainer/WidgetContainer.vue b/plugins/CoreHome/vue/src/WidgetContainer/WidgetContainer.vue index 5f294cbc0b..5c1da4103a 100644 --- a/plugins/CoreHome/vue/src/WidgetContainer/WidgetContainer.vue +++ b/plugins/CoreHome/vue/src/WidgetContainer/WidgetContainer.vue @@ -5,7 +5,7 @@ --> <template> - <div> + <div class="widget-container"> <div v-for="(widget, index) in actualContainer" :key="index" diff --git a/plugins/CoreHome/vue/src/WidgetLoader/WidgetLoader.adapter.ts b/plugins/CoreHome/vue/src/WidgetLoader/WidgetLoader.adapter.ts deleted file mode 100644 index 9ec44f3174..0000000000 --- a/plugins/CoreHome/vue/src/WidgetLoader/WidgetLoader.adapter.ts +++ /dev/null @@ -1,23 +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 - */ - -import createAngularJsAdapter from '../createAngularJsAdapter'; -import WidgetLoader from './WidgetLoader.vue'; - -export default createAngularJsAdapter({ - component: WidgetLoader, - scope: { - piwikWidgetLoader: { - vue: 'widgetParams', - angularJsBind: '=', - }, - widgetName: { - angularJsBind: '@', - }, - }, - directiveName: 'piwikWidgetLoader', -}); diff --git a/plugins/CoreHome/vue/src/WidgetLoader/WidgetLoader.vue b/plugins/CoreHome/vue/src/WidgetLoader/WidgetLoader.vue index 947f2bfeba..8495a3c4ac 100644 --- a/plugins/CoreHome/vue/src/WidgetLoader/WidgetLoader.vue +++ b/plugins/CoreHome/vue/src/WidgetLoader/WidgetLoader.vue @@ -32,7 +32,6 @@ </template> <script lang="ts"> -import { IRootScopeService, IScope } from 'angular'; import { defineComponent } from 'vue'; import ActivityIndicator from '../ActivityIndicator/ActivityIndicator.vue'; import { translate } from '../translate'; @@ -47,7 +46,6 @@ interface WidgetLoaderState { loadingFailed: boolean; loadingFailedRateLimit: boolean; changeCounter: number; - currentScope: null|IScope; lastWidgetAbortController: null|AbortController; } @@ -77,7 +75,6 @@ export default defineComponent({ loadingFailed: false, loadingFailedRateLimit: false, changeCounter: 0, - currentScope: null, lastWidgetAbortController: null, }; }, @@ -123,9 +120,6 @@ export default defineComponent({ cleanupLastWidgetContent() { const widgetContent = this.$refs.widgetContent as HTMLElement; Matomo.helper.destroyVueComponent(widgetContent); - if (this.currentScope) { - this.currentScope.$destroy(); - } if (widgetContent) { widgetContent.innerHTML = ''; } @@ -221,13 +215,6 @@ export default defineComponent({ } } - const $rootScope: IRootScopeService = Matomo.helper.getAngularDependency('$rootScope'); - const scope = $rootScope.$new(); - this.currentScope = scope; - - // compile angularjs first since it will modify all dom nodes, breaking vue bindings - // if they are present - Matomo.helper.compileAngularComponents($content, { scope }); Matomo.helper.compileVueEntryComponents($content); NotificationsStore.parseNotificationDivs(); diff --git a/plugins/CoreHome/vue/src/Notification/Notifications.store.adapter.ts b/plugins/CoreHome/vue/src/clone.ts index e759836e4c..774f8c4828 100644 --- a/plugins/CoreHome/vue/src/Notification/Notifications.store.adapter.ts +++ b/plugins/CoreHome/vue/src/clone.ts @@ -5,6 +5,10 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -import NotificationsStore from './Notifications.store'; +export default function clone<T>(p: T): T { + if (typeof p === 'undefined') { + return p; + } -window.angular.module('piwikApp').factory('notifications', () => NotificationsStore); + return JSON.parse(JSON.stringify(p)) as T; +} diff --git a/plugins/CoreHome/vue/src/createAngularJsAdapter.ts b/plugins/CoreHome/vue/src/createAngularJsAdapter.ts deleted file mode 100644 index e8db6df7b9..0000000000 --- a/plugins/CoreHome/vue/src/createAngularJsAdapter.ts +++ /dev/null @@ -1,382 +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 - */ - -/* eslint-disable @typescript-eslint/no-explicit-any */ - -import { - defineComponent, - ref, -} from 'vue'; -import { IDirectiveFactory, IDirectivePrePost, Injectable } from 'angular'; -import Matomo from './Matomo/Matomo'; -import createVueApp from './createVueApp'; -import useExternalPluginComponent from './useExternalPluginComponent'; - -interface SingleScopeVarInfo<InjectTypes extends unknown[]> { - vue?: string; - default?: any; - transform?: ( - v: unknown, - vm: any, - scope: any, - element: ng.IAugmentedJQuery, - attrs: ng.IAttributes, - otherController?: ng.IController, - ...injected: InjectTypes - ) => unknown; - angularJsBind?: string; - deepWatch?: boolean; -} - -type ScopeMapping<InjectTypes extends unknown[]> = { - [scopeVarName: string]: SingleScopeVarInfo<InjectTypes>, -}; - -type AdapterFunction<InjectTypes extends unknown[], R = void> = ( - scope: any, - element: ng.IAugmentedJQuery, - attrs: ng.IAttributes, - ...injected: InjectTypes -) => R; - -type EventAdapterFunction<InjectTypes extends unknown[], R = void> = ( - $event: any, - vm: any, - scope: any, - element: ng.IAugmentedJQuery, - attrs: ng.IAttributes, - otherController?: ng.IController, - ...injected: InjectTypes -) => R; - -type PostCreateFunction<InjectTypes extends unknown[], R = void> = ( - vm: any, - scope: any, - element: ng.IAugmentedJQuery, - attrs: ng.IAttributes, - otherController?: ng.IController, - ...injected: InjectTypes -) => R; - -type EventMapping<InjectTypes extends unknown[]> = { - [vueEventName: string]: EventAdapterFunction<InjectTypes>, -}; - -type ComponentType = ReturnType<typeof defineComponent>; - -let transcludeCounter = 0; - -function toKebabCase(arg: string): string { - return arg.substring(0, 1).toLowerCase() + arg.substring(1) - .replace(/[A-Z]/g, (s) => `-${s.toLowerCase()}`); -} - -function toAngularJsCamelCase(arg: string): string { - return arg.substring(0, 1).toLowerCase() + arg.substring(1) - .replace(/-([a-z])/g, (s, p) => p.toUpperCase()); -} - -export function removeAngularJsSpecificProperties<T>(newValue: T): T { - if (typeof newValue === 'object' - && newValue !== null - && Object.getPrototypeOf(newValue) === Object.prototype - ) { - return Object.fromEntries(Object.entries(newValue).filter((pair) => !/^\$/.test(pair[0]))) as T; - } - - return newValue; -} - -interface ComponentReference { - plugin: string; - component: string; -} - -export default function createAngularJsAdapter<InjectTypes extends unknown[] = []>(options: { - component: ComponentType | ComponentReference, - require?: string, - scope?: ScopeMapping<InjectTypes>, - directiveName: string, - events?: EventMapping<InjectTypes>, - $inject?: string[], - transclude?: boolean, - mountPointFactory?: AdapterFunction<InjectTypes, HTMLElement>, - postCreate?: PostCreateFunction<InjectTypes>, - noScope?: boolean, - restrict?: string, - priority?: number, - replace?: boolean, -}): Injectable<ng.IDirectiveFactory> { - let { component } = options; - const { - require, - scope = {}, - events = {}, - $inject, - directiveName, - transclude, - mountPointFactory, - postCreate, - noScope, - restrict = 'A', - priority, - replace, - } = options; - - const componentRef = component as ComponentReference; - if (typeof componentRef.plugin === 'string') { - component = useExternalPluginComponent(componentRef.plugin, componentRef.component); - } - - const currentTranscludeCounter = transcludeCounter; - if (transclude) { - transcludeCounter += 1; - } - - const vueToAngular: Record<string, string> = {}; - const angularJsScope: Record<string, string> = {}; - Object.entries(scope).forEach(([scopeVarName, info]) => { - if (!info.vue) { - info.vue = scopeVarName; - } - if (info.angularJsBind) { - angularJsScope[scopeVarName] = info.angularJsBind; - } - vueToAngular[info.vue] = scopeVarName; - }); - - function angularJsAdapter(...injectedServices: InjectTypes): ng.IDirective|undefined { - const adapter: ng.IDirective = { - restrict, - require, - priority, - scope: noScope ? undefined : angularJsScope, - compile: function angularJsAdapterCompile(): IDirectivePrePost { - return { - post: function angularJsAdapterLink( - ngScope: any, - ngElement: ng.IAugmentedJQuery, - ngAttrs: ng.IAttributes, - ngController?: ng.IController, - ) { - const transcludeClone = transclude - ? ngElement.find(`[ng-transclude][counter=${currentTranscludeCounter}]`) - : null; - - // build the root vue template - let rootVueTemplate = '<root-component'; - Object.entries(events).forEach((info) => { - const [eventName] = info; - rootVueTemplate += ` @${toKebabCase(eventName)}="onEventHandler('${eventName}', $event)"`; - }); - Object.entries(scope).forEach(([, info]) => { - if (info.angularJsBind === '&' || info.angularJsBind === '&?') { - const eventName = toKebabCase(info.vue!); - if (!events[info.vue!]) { // pass through scope & w/o a custom event handler - rootVueTemplate += ` @${eventName}="onEventHandler('${info.vue!}', $event)"`; - } - } else { - rootVueTemplate += ` :${toKebabCase(info.vue!)}="${info.vue}"`; - } - }); - rootVueTemplate += '>'; - if (transclude) { - rootVueTemplate += '<div ref="transcludeTarget"/>'; - } - rootVueTemplate += '</root-component>'; - - // build the vue app - const app = createVueApp({ - template: rootVueTemplate, - data() { - const initialData: Record<string, unknown> = {}; - Object.entries(scope).forEach(([scopeVarName, info]) => { - let value = removeAngularJsSpecificProperties(ngScope[scopeVarName]); - if (typeof value === 'undefined' && typeof info.default !== 'undefined') { - value = info.default instanceof Function - ? info.default(ngScope, ngElement, ngAttrs, ...injectedServices) - : info.default; - } - if (info.transform) { - value = info.transform( - value, - this, - ngScope, - ngElement, - ngAttrs, - ngController, - ...injectedServices, - ); - } - initialData[info.vue!] = value; - }); - return initialData; - }, - setup() { - if (transclude) { - const transcludeTarget = ref(null); - return { - transcludeTarget, - }; - } - - return undefined; - }, - methods: { - onEventHandler(name: string, $event: any) { - let scopePropertyName = toAngularJsCamelCase(name); - scopePropertyName = vueToAngular[scopePropertyName] || scopePropertyName; - if (ngScope[scopePropertyName]) { - ngScope[scopePropertyName]($event); - } - - if (events[name]) { - events[name]( - $event, - this, - ngScope, - ngElement, - ngAttrs, - ngController, - ...injectedServices, - ); - } - }, - }, - }); - app.component('root-component', component); - - // mount the app - const mountPoint = mountPointFactory - ? mountPointFactory(ngScope, ngElement, ngAttrs, ...injectedServices) - : ngElement[0]; - const vm: any = app.mount(mountPoint); - - // setup watches to bind between angularjs + vue - Object.entries(scope).forEach(([scopeVarName, info]) => { - if (!info.angularJsBind || info.angularJsBind === '&' || info.angularJsBind === '&?') { - return; - } - - ngScope.$watch(scopeVarName, (newValue: any, oldValue: any) => { - if (newValue === oldValue - && JSON.stringify(vm[info.vue!]) === JSON.stringify(newValue) - ) { - return; // initial - } - - let newValueFinal = removeAngularJsSpecificProperties(newValue); - if (typeof info.default !== 'undefined' && typeof newValue === 'undefined') { - newValueFinal = info.default instanceof Function - ? info.default(ngScope, ngElement, ngAttrs, ...injectedServices) - : info.default; - } - if (info.transform) { - newValueFinal = info.transform( - newValueFinal, - vm, - ngScope, - ngElement, - ngAttrs, - ngController, - ...injectedServices, - ); - } - - vm[info.vue!] = newValueFinal; - }, info.deepWatch); - }); - - if (transclude && transcludeClone) { - $(vm.transcludeTarget).append(transcludeClone); - } - - if (postCreate) { - postCreate(vm, ngScope, ngElement, ngAttrs, ngController, ...injectedServices); - } - - // specifying replace: true on the directive does nothing w/ vue inside, so - // handle it here. - if (replace) { - // transfer attributes from angularjs element that are not in scope to - // mount point element - Array.from(ngElement[0].attributes).forEach((attr) => { - if (scope[attr.nodeName]) { - return; - } - if (mountPoint.firstElementChild) { - mountPoint.firstElementChild.setAttribute(attr.nodeName, attr.nodeValue!); - } - }); - - ngElement.replaceWith(window.$(mountPoint).children()); - } - - ngElement.on('$destroy', () => { - app.unmount(); - }); - }, - }; - }, - }; - - if (transclude) { - adapter.transclude = true; - adapter.template = `<div ng-transclude counter="${currentTranscludeCounter}"/>`; - } - - return adapter; - } - - angularJsAdapter.$inject = $inject || []; - - window.angular.module('piwikApp').directive( - directiveName, - angularJsAdapter as unknown as Injectable<IDirectiveFactory>, - ); - - return angularJsAdapter as unknown as Injectable<IDirectiveFactory>; -} - -export function transformAngularJsBoolAttr(v: unknown): boolean|undefined { - if (typeof v === 'undefined') { - return undefined; - } - - if (v === 'true') { - return true; - } - - return !!v && v as number > 0 && v !== '0'; -} - -export function transformAngularJsIntAttr(v: unknown): number|undefined|null { - if (typeof v === 'undefined') { - return undefined; - } - - if (v === null) { - return null; - } - - return parseInt(v as string, 10); -} - -// utility function for service adapters -export function clone<T>(p: T): T { - if (typeof p === 'undefined') { - return p; - } - - return JSON.parse(JSON.stringify(p)) as T; -} - -export function cloneThenApply<T>(p: T): T { - const result = clone(p); - Matomo.helper.getAngularDependency('$rootScope').$applyAsync(); - return result; -} diff --git a/plugins/CoreHome/vue/src/index.ts b/plugins/CoreHome/vue/src/index.ts index 8e88e6a8a7..794a9ae111 100644 --- a/plugins/CoreHome/vue/src/index.ts +++ b/plugins/CoreHome/vue/src/index.ts @@ -6,57 +6,15 @@ */ import './noAdblockFlag'; -import './MatomoUrl/MatomoUrl.adapter'; -import './Matomo/Matomo.adapter'; import './Periods/Day'; import './Periods/Week'; import './Periods/Month'; import './Periods/Year'; import './Periods/Range'; -import './Periods/Periods.adapter'; import './AjaxHelper/AjaxHelper.adapter'; import './PopoverHandler/PopoverHandler'; -import './Alert/Alert.adapter'; -import './DropdownMenu/DropdownMenu.adapter'; -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'; -import './EnrichedHeadline/EnrichedHeadline.adapter'; -import './ContentBlock/ContentBlock.adapter'; -import './Comparisons/Comparisons.adapter'; -import './MenuItemsDropdown/MenuItemsDropdown.adapter'; -import './DatePicker/DatePicker.adapter'; -import './DateRangePicker/DateRangePicker.adapter'; -import './PeriodDatePicker/PeriodDatePicker.adapter'; -import './SiteSelector/SiteSelector.adapter'; -import './SiteSelector/SitesStore.adapter'; -import './QuickAccess/QuickAccess.adapter'; -import './FieldArray/FieldArray.adapter'; -import './MultiPairField/MultiPairField.adapter'; -import './PeriodSelector/PeriodSelector.adapter'; -import './ReportingMenu/ReportingMenu.adapter'; -import './ReportingMenu/ReportingMenu.store.adapter'; -import './ReportingPages/ReportingPages.store.adapter'; -import './ReportMetadata/ReportMetadata.store.adapter'; -import './WidgetLoader/WidgetLoader.adapter'; -import './WidgetContainer/WidgetContainer.adapter'; -import './WidgetByDimensionContainer/WidgetByDimensionContainer.adapter'; -import './Widget/Widget.adapter'; -import './ReportingPage/ReportingPage.adapter'; -import './ReportExport/ReportExport.adapter'; -import './Sparkline/Sparkline.adapter'; -import './Progressbar/Progressbar.adapter'; -import './ContentIntro/ContentIntro.adapter'; -import './ContentTable/ContentTable.adapter'; -import './AjaxForm/AjaxForm.adapter'; +import './zenMode'; import Matomo from './Matomo/Matomo'; -import createAngularJsAdapter from './createAngularJsAdapter'; export { default as createVueApp } from './createVueApp'; export { default as importPluginUmd } from './importPluginUmd'; @@ -64,16 +22,8 @@ export { default as useExternalPluginComponent } from './useExternalPluginCompon export { default as DirectiveUtilities } from './directiveUtilities'; export { default as debounce } from './debounce'; export { default as getFormattedEvolution } from './getFormattedEvolution'; -export { createAngularJsAdapter }; -export { - transformAngularJsBoolAttr, - transformAngularJsIntAttr, - removeAngularJsSpecificProperties, - clone, - cloneThenApply, -} from './createAngularJsAdapter'; +export { default as clone } from './clone'; export { default as VueEntryContainer } from './VueEntryContainer/VueEntryContainer.vue'; -export { default as activityIndicatorAdapter } from './ActivityIndicator/ActivityIndicator.adapter'; export { default as ActivityIndicator } from './ActivityIndicator/ActivityIndicator.vue'; export * from './translate'; export { default as Alert } from './Alert/Alert.vue'; @@ -135,3 +85,9 @@ export { default as ContentIntro } from './ContentIntro/ContentIntro'; export { default as ContentTable } from './ContentTable/ContentTable'; export { default as AjaxForm } from './AjaxForm/AjaxForm.vue'; export { default as Passthrough } from './Passthrough/Passthrough.vue'; +export { default as DataTableActions } from './DataTable/DataTableActions.vue'; +export { + default as VersionInfoHeaderMessage, +} from './VersionInfoHeaderMessage/VersionInfoHeaderMessage.vue'; +export { default as MobileLeftMenu } from './MobileLeftMenu/MobileLeftMenu.vue'; +export { default as scrollToAnchorInUrl } from './scrollToAnchorInUrl'; diff --git a/plugins/CoreHome/vue/src/scrollToAnchorInUrl.ts b/plugins/CoreHome/vue/src/scrollToAnchorInUrl.ts new file mode 100644 index 0000000000..a00b849642 --- /dev/null +++ b/plugins/CoreHome/vue/src/scrollToAnchorInUrl.ts @@ -0,0 +1,109 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import { nextTick, watch } from 'vue'; +import MatomoUrl from './MatomoUrl/MatomoUrl'; + +const { $ } = window; + +function scrollToAnchorNode($node: HTMLElement|JQuery|string) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ($ as any).scrollTo($node, 20); +} + +function preventDefaultIfEventExists(event: Event|null) { + if (event) { + event.preventDefault(); + } +} + +function scrollToAnchorIfPossible(hash: string, event: Event|null) { + if (!hash) { + return; + } + + if (hash.indexOf('&') !== -1) { + return; + } + + let $node: JQuery|null = null; + try { + $node = $(`#${hash}`); + } catch (err) { + // on jquery syntax error, ignore so nothing is logged to the console + return; + } + + if ($node?.length) { + scrollToAnchorNode($node); + preventDefaultIfEventExists(event); + return; + } + + $node = $(`a[name=${hash}]`); + + if ($node?.length) { + scrollToAnchorNode($node); + preventDefaultIfEventExists(event); + } +} + +function isLinkWithinSamePage(location: URL, newUrl: string) { + if (location && location.origin && newUrl.indexOf(location.origin) === -1) { + // link to different domain + return false; + } + + if (location && location.pathname && newUrl.indexOf(location.pathname) === -1) { + // link to different path + return false; + } + + if (location && location.search && newUrl.indexOf(location.search) === -1) { + // link with different search + return false; + } + + return true; +} + +function handleScrollToAnchorIfPresentOnPageLoad() { + if (window.location.hash.slice(0, 2) === '#/') { + const hash = window.location.hash.slice(2); + scrollToAnchorIfPossible(hash, null); + } +} + +function handleScrollToAnchorAfterPageLoad() { + watch(() => MatomoUrl.url.value, (newUrl, oldUrl) => { + if (!newUrl) { + return; + } + + const hashPos = newUrl.href.indexOf('#/'); + if (hashPos === -1) { + return; + } + + if (oldUrl && !isLinkWithinSamePage(oldUrl, newUrl.href)) { + return; + } + + const hash = newUrl.href.slice(hashPos + 2); + + scrollToAnchorIfPossible(hash, null); + }); +} + +handleScrollToAnchorAfterPageLoad(); +$(handleScrollToAnchorIfPresentOnPageLoad); + +export default function scrollToAnchorInUrl(): void { + // may be called when page is only fully loaded after some additional requests + // timeout needed to ensure Vue rendered fully + nextTick(handleScrollToAnchorIfPresentOnPageLoad); +} diff --git a/plugins/CoreHome/vue/src/zenMode.ts b/plugins/CoreHome/vue/src/zenMode.ts new file mode 100644 index 0000000000..7b2a79d34f --- /dev/null +++ b/plugins/CoreHome/vue/src/zenMode.ts @@ -0,0 +1,49 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import { translate } from './translate'; +import Matomo from './Matomo/Matomo'; +import { setCookie, getCookie } from './CookieHelper/CookieHelper'; + +const { $ } = window; + +function handleZenMode() { + let zenMode = !!parseInt(getCookie('zenMode')!, 10); + const iconSwitcher = $('.top_controls .icon-arrowup'); + + function updateZenMode() { + if (zenMode) { + $('body').addClass('zenMode'); + iconSwitcher.addClass('icon-arrowdown').removeClass('icon-arrowup'); + iconSwitcher.prop('title', translate('CoreHome_ExitZenMode')); + } else { + $('body').removeClass('zenMode'); + iconSwitcher.removeClass('icon-arrowdown').addClass('icon-arrowup'); + iconSwitcher.prop('title', translate('CoreHome_EnterZenMode')); + } + } + + Matomo.helper.registerShortcut('z', translate('CoreHome_ShortcutZenMode'), (event) => { + if (event.altKey) { + return; + } + + zenMode = !zenMode; + setCookie('zenMode', zenMode ? '1' : '0'); + updateZenMode(); + }); + + iconSwitcher.click(() => { + window.Mousetrap.trigger('z'); + }); + + updateZenMode(); +} + +Matomo.on('Matomo.topControlsRendered', () => { + handleZenMode(); +}); diff --git a/plugins/CorePluginsAdmin/CorePluginsAdmin.php b/plugins/CorePluginsAdmin/CorePluginsAdmin.php index d398a26d7b..3d570e4d98 100644 --- a/plugins/CorePluginsAdmin/CorePluginsAdmin.php +++ b/plugins/CorePluginsAdmin/CorePluginsAdmin.php @@ -150,6 +150,10 @@ class CorePluginsAdmin extends Plugin $translations[] = 'CorePluginsAdmin_InstallNewPlugins'; $translations[] = 'CorePluginsAdmin_AlwaysActivatedPluginsList'; $translations[] = 'CorePluginsAdmin_PluginsManagement'; + $translations[] = 'CorePluginsAdmin_ThemesDescription'; + $translations[] = 'CorePluginsAdmin_TeaserExtendPiwikByTheme'; + $translations[] = 'CorePluginsAdmin_InfoThemeIsUsedByOtherUsersAsWell'; + $translations[] = 'CorePluginsAdmin_ThemesManagement'; $translations[] = 'CorePluginsAdmin_NUpdatesAvailable'; } diff --git a/plugins/CorePluginsAdmin/templates/tagManagerTeaser.twig b/plugins/CorePluginsAdmin/templates/tagManagerTeaser.twig index 83995bc7af..e9049e9af0 100644 --- a/plugins/CorePluginsAdmin/templates/tagManagerTeaser.twig +++ b/plugins/CorePluginsAdmin/templates/tagManagerTeaser.twig @@ -34,7 +34,7 @@ {{ actionBlock|raw }} <div class="row"> <div class="col {% if isSuperUser %}l4{% else %}l6{% endif %} m12 s12"> - <div piwik-content-block content-title="{{ 'CorePluginsAdmin_WhatIsTagManager'|translate }}"> + <div vue-entry="CoreHome.ContentBlock" content-title="{{ 'CorePluginsAdmin_WhatIsTagManager'|translate }}"> <p> {{ 'CorePluginsAdmin_WhatIsTagManagerDetails1'|translate }}<br /><br /> {{ 'CorePluginsAdmin_WhatIsTagManagerDetails2'|translate }}<br /><br /> @@ -43,7 +43,7 @@ </div> </div> <div class="col {% if isSuperUser %}l4{% else %}l6{% endif %} m12 s12"> - <div piwik-content-block content-title="{{ 'CorePluginsAdmin_WhyUsingATagManager'|translate }}"> + <div vue-entry="CoreHome.ContentBlock" content-title="{{ 'CorePluginsAdmin_WhyUsingATagManager'|translate }}"> <p> {{ 'CorePluginsAdmin_WhyUsingATagManagerDetails1'|translate }} <br /><br /> @@ -57,7 +57,7 @@ </div> {% if isSuperUser %} <div class="col l4 m12 s12"> - <div piwik-content-block content-title="{{ 'CorePluginsAdmin_AreThereAnyRisks'|translate }}"> + <div vue-entry="CoreHome.ContentBlock" content-title="{{ 'CorePluginsAdmin_AreThereAnyRisks'|translate }}"> {{ 'CorePluginsAdmin_AreThereAnyRisksDetails1'|translate('<a rel="noreferrer noopener" href="https://en.wikipedia.org/wiki/Cross-site_scripting">', '</a>')|raw }} <br /><br /> diff --git a/plugins/CorePluginsAdmin/templates/themes.twig b/plugins/CorePluginsAdmin/templates/themes.twig index cbe028c57f..05e589c3d8 100644 --- a/plugins/CorePluginsAdmin/templates/themes.twig +++ b/plugins/CorePluginsAdmin/templates/themes.twig @@ -6,27 +6,13 @@ {% block content %} -<div piwik-content-intro> - <h2 piwik-enriched-headline> - {{ title }} - </h2> - - <p> - {{ 'CorePluginsAdmin_ThemesDescription'|translate }} - - {% if isMarketplaceEnabled %} - {{ 'CorePluginsAdmin_TeaserExtendPiwikByTheme'|translate('<a href="' ~ linkTo({'module': 'Marketplace','action':'overview', 'sort': '', 'show': 'themes'}) ~ '">', '</a>')|raw }} - {% endif %} - - {% if otherUsersCount > 0 %} - <br/> {{ 'CorePluginsAdmin_InfoThemeIsUsedByOtherUsersAsWell'|translate(otherUsersCount, themeEnabled) }} - {% endif %} - {% if not isPluginsAdminEnabled %} - <br/>{{ 'CorePluginsAdmin_DoMoreContactPiwikAdmins'|translate }} - {% endif %} - - </p> -</div> +<div + vue-entry="CorePluginsAdmin.ThemesIntro" + is-marketplace-enabled="{{ isMarketplaceEnabled|json_encode }}" + other-users-count="{{ otherUsersCount|default(null)|json_encode }}" + theme-enabled="{{ themeEnabled|json_encode }}" + is-plugins-admin-enabled="{{ isPluginsAdminEnabled|json_encode }}" +></div> <div vue-entry="CorePluginsAdmin.PluginsTable" diff --git a/plugins/CorePluginsAdmin/tests/UI/TagManagerTeaser_spec.js b/plugins/CorePluginsAdmin/tests/UI/TagManagerTeaser_spec.js index 752c2fed50..ef7e6199d7 100644 --- a/plugins/CorePluginsAdmin/tests/UI/TagManagerTeaser_spec.js +++ b/plugins/CorePluginsAdmin/tests/UI/TagManagerTeaser_spec.js @@ -52,6 +52,7 @@ describe("TagManagerTeaser", function () { it('should show teaser to super user', async function () { unloadTagManager(); await page.goto(urlBase); + await page.waitForSelector('.activateTagManager'); expect(await page.screenshotSelector(pageSelector)).to.matchImage('superuser_page'); }); @@ -62,6 +63,7 @@ describe("TagManagerTeaser", function () { await page.type('#login_form_password', 'superUserPass'); await page.click('#login_form_submit'); + await page.waitForSelector('.tagManagerGettingStarted'); await page.waitForNetworkIdle(); await page.waitForTimeout(250); @@ -85,4 +87,4 @@ describe("TagManagerTeaser", function () { expect(await page.screenshotSelector('.pageWrap')).to.matchImage('admin_page_disable'); }); -});
\ No newline at end of file +}); diff --git a/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.js b/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.js index 5313d2df22..07e6b04c92 100644 --- a/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.js +++ b/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.js @@ -1720,8 +1720,9 @@ __webpack_require__.d(__webpack_exports__, "PluginUpload", function() { return / __webpack_require__.d(__webpack_exports__, "SaveButton", function() { return /* reexport */ SaveButton; }); __webpack_require__.d(__webpack_exports__, "Form", function() { return /* reexport */ Form; }); __webpack_require__.d(__webpack_exports__, "GroupedSettings", function() { return /* reexport */ GroupedSettings; }); -__webpack_require__.d(__webpack_exports__, "PasswordConfirmation", function() { return /* reexport */ PasswordConfirmation; }); __webpack_require__.d(__webpack_exports__, "PluginsIntro", function() { return /* reexport */ PluginsIntro; }); +__webpack_require__.d(__webpack_exports__, "ThemesIntro", function() { return /* reexport */ ThemesIntro; }); +__webpack_require__.d(__webpack_exports__, "PasswordConfirmation", function() { return /* reexport */ PasswordConfirmation; }); __webpack_require__.d(__webpack_exports__, "PluginName", function() { return /* reexport */ PluginName; }); __webpack_require__.d(__webpack_exports__, "PluginsTable", function() { return /* reexport */ PluginsTable; }); __webpack_require__.d(__webpack_exports__, "PluginsTableWithUpdates", function() { return /* reexport */ PluginsTableWithUpdates; }); @@ -1743,2750 +1744,6 @@ if (typeof window !== 'undefined') { // Indicate to webpack that this file can be concatenated /* harmony default export */ var setPublicPath = (null); -// EXTERNAL MODULE: external "CoreHome" -var external_CoreHome_ = __webpack_require__("19dc"); - -// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"} -var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf"); - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FormField.vue?vue&type=template&id=d6991e4e - -var _hoisted_1 = { - class: "form-group row matomo-form-field" -}; -var _hoisted_2 = { - key: 0, - class: "col s12" -}; -var _hoisted_3 = { - key: 0, - class: "form-help" -}; -var _hoisted_4 = { - key: 0, - class: "inline-help", - ref: "inlineHelp" -}; - -var _hoisted_5 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); - -function render(_ctx, _cache, $props, $setup, $data, $options) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_1, [_ctx.formField.introduction ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("h3", _hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.formField.introduction), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { - class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["col s12", { - 'input-field': _ctx.formField.uiControl !== 'checkbox' && _ctx.formField.uiControl !== 'radio', - 'file-field': _ctx.formField.uiControl === 'file', - 'm6': !_ctx.formField.fullWidth - }]) - }, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDynamicComponent"])(_ctx.childComponent), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])(Object.assign(Object.assign({ - formField: _ctx.formField - }, _ctx.formField), {}, { - modelValue: _ctx.processedModelValue, - modelModifiers: _ctx.modelModifiers, - availableOptions: _ctx.availableOptions - }, _ctx.extraChildComponentParams), { - "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { - return _ctx.onChange($event); - }) - }), null, 16))], 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { - class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["col s12", { - 'm6': !_ctx.formField.fullWidth - }]) - }, [_ctx.showFormHelp ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { - class: "form-description" - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.formField.description), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.formField.description]]), _ctx.formField.inlineHelp || _ctx.hasInlineHelpSlot ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", _hoisted_4, [_ctx.inlineHelpComponent ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDynamicComponent"])(_ctx.inlineHelpComponent), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeProps"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ - key: 0 - }, _ctx.inlineHelpBind)), null, 16)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "inline-help")], 512)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, [_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Default')) + ": ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.defaultValuePrettyTruncated), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showDefaultValue]])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 2)], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showField]]); -} -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FormField.vue?vue&type=template&id=d6991e4e - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckbox.vue?vue&type=template&id=2988a0eb - -var FieldCheckboxvue_type_template_id_2988a0eb_hoisted_1 = { - class: "checkbox" -}; -var FieldCheckboxvue_type_template_id_2988a0eb_hoisted_2 = ["checked", "id", "name"]; -var FieldCheckboxvue_type_template_id_2988a0eb_hoisted_3 = ["innerHTML"]; -function FieldCheckboxvue_type_template_id_2988a0eb_render(_ctx, _cache, $props, $setup, $data, $options) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", FieldCheckboxvue_type_template_id_2988a0eb_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ - onChange: _cache[0] || (_cache[0] = function ($event) { - return _ctx.onChange($event); - }) - }, _ctx.uiControlAttributes, { - value: 1, - checked: _ctx.isChecked, - type: "checkbox", - id: _ctx.name, - name: _ctx.name - }), null, 16, FieldCheckboxvue_type_template_id_2988a0eb_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - innerHTML: _ctx.$sanitize(_ctx.title) - }, null, 8, FieldCheckboxvue_type_template_id_2988a0eb_hoisted_3)])]); -} -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckbox.vue?vue&type=template&id=2988a0eb - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckbox.vue?vue&type=script&lang=ts - -/* harmony default export */ var FieldCheckboxvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - modelValue: [Boolean, Number, String], - modelModifiers: Object, - uiControlAttributes: Object, - name: String, - title: String - }, - inheritAttrs: false, - emits: ['update:modelValue'], - methods: { - onChange: function onChange(event) { - var newValue = event.target.checked; - - if (this.modelValue !== newValue) { - var _this$modelModifiers; - - if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { - this.$emit('update:modelValue', newValue); - return; - } - - var emitEventData = { - value: newValue, - abort: function abort() { - event.target.checked = !newValue; - } - }; - this.$emit('update:modelValue', emitEventData); - } - } - }, - computed: { - isChecked: function isChecked() { - return !!this.modelValue && this.modelValue !== '0'; - } - } -})); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckbox.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckbox.vue - - - -FieldCheckboxvue_type_script_lang_ts.render = FieldCheckboxvue_type_template_id_2988a0eb_render - -/* harmony default export */ var FieldCheckbox = (FieldCheckboxvue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckboxArray.vue?vue&type=template&id=18154c64 - -var FieldCheckboxArrayvue_type_template_id_18154c64_hoisted_1 = { - ref: "root" -}; -var FieldCheckboxArrayvue_type_template_id_18154c64_hoisted_2 = ["value", "checked", "onChange", "id", "name"]; -function FieldCheckboxArrayvue_type_template_id_18154c64_render(_ctx, _cache, $props, $setup, $data, $options) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", FieldCheckboxArrayvue_type_template_id_18154c64_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { - class: "fieldRadioTitle" - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.title), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.title]]), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.availableOptions, function (checkboxModel, $index) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", { - key: $index, - class: "checkbox" - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ - value: checkboxModel.key, - checked: !!_ctx.checkboxStates[$index], - onChange: function onChange($event) { - return _ctx.onChange($index); - } - }, _ctx.uiControlAttributes, { - type: "checkbox", - id: "".concat(_ctx.name).concat(checkboxModel.key), - name: checkboxModel.name - }), null, 16, FieldCheckboxArrayvue_type_template_id_18154c64_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(checkboxModel.value), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - class: "form-description" - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(checkboxModel.description), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], checkboxModel.description]])])]); - }), 128))], 512); -} -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckboxArray.vue?vue&type=template&id=18154c64 - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckboxArray.vue?vue&type=script&lang=ts -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } - -function _nonIterableSpread() { 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 _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } - -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } - -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } - - - -function getCheckboxStates(availableOptions, modelValue) { - return (availableOptions || []).map(function (o) { - return modelValue && modelValue.indexOf(o.key) !== -1; - }); -} - -/* harmony default export */ var FieldCheckboxArrayvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - modelValue: Array, - modelModifiers: Object, - name: String, - title: String, - availableOptions: Array, - uiControlAttributes: Object, - type: String - }, - inheritAttrs: false, - emits: ['update:modelValue'], - computed: { - checkboxStates: function checkboxStates() { - return getCheckboxStates(this.availableOptions, this.modelValue); - } - }, - mounted: function mounted() { - window.Materialize.updateTextFields(); - }, - methods: { - onChange: function onChange(changedIndex) { - var _this$modelModifiers, - _this = this; - - var checkboxStates = _toConsumableArray(this.checkboxStates); - - checkboxStates[changedIndex] = !checkboxStates[changedIndex]; - var availableOptions = this.availableOptions || {}; - var newValue = []; - Object.values(availableOptions).forEach(function (option, index) { - if (checkboxStates[index]) { - newValue.push(option.key); - } - }); - - if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { - this.$emit('update:modelValue', newValue); - return; - } - - var emitEventData = { - value: newValue, - abort: function abort() { - // undo checked changes since we want the parent component to decide if it should go - // through - var item = _this.$refs.root.querySelectorAll('input').item(changedIndex); - - item.checked = !item.checked; - } - }; - this.$emit('update:modelValue', emitEventData); - } - } -})); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckboxArray.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckboxArray.vue - - - -FieldCheckboxArrayvue_type_script_lang_ts.render = FieldCheckboxArrayvue_type_template_id_18154c64_render - -/* harmony default export */ var FieldCheckboxArray = (FieldCheckboxArrayvue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldExpandableSelect.vue?vue&type=template&id=300528d8 - -var FieldExpandableSelectvue_type_template_id_300528d8_hoisted_1 = { - class: "expandableSelector" -}; - -var FieldExpandableSelectvue_type_template_id_300528d8_hoisted_2 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("svg", { - class: "caret", - height: "24", - viewBox: "0 0 24 24", - width: "24", - xmlns: "http://www.w3.org/2000/svg" -}, [/*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("path", { - d: "M7 10l5 5 5-5z" -}), /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("path", { - d: "M0 0h24v24H0z", - fill: "none" -})], -1); - -var FieldExpandableSelectvue_type_template_id_300528d8_hoisted_3 = ["value"]; -var FieldExpandableSelectvue_type_template_id_300528d8_hoisted_4 = { - class: "expandableList z-depth-2" -}; -var FieldExpandableSelectvue_type_template_id_300528d8_hoisted_5 = { - class: "searchContainer" -}; -var _hoisted_6 = { - class: "collection firstLevel" -}; -var _hoisted_7 = ["onClick"]; -var _hoisted_8 = { - class: "collection secondLevel" -}; -var _hoisted_9 = ["onClick"]; -var _hoisted_10 = { - class: "primary-content" -}; -var _hoisted_11 = ["title"]; -function FieldExpandableSelectvue_type_template_id_300528d8_render(_ctx, _cache, $props, $setup, $data, $options) { - var _directive_focus_if = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("focus-if"); - - var _directive_focus_anywhere_but_here = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("focus-anywhere-but-here"); - - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", FieldExpandableSelectvue_type_template_id_300528d8_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { - onClick: _cache[0] || (_cache[0] = function ($event) { - return _ctx.showSelect = !_ctx.showSelect; - }), - class: "select-wrapper" - }, [FieldExpandableSelectvue_type_template_id_300528d8_hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - type: "text", - class: "select-dropdown", - readonly: "readonly", - value: _ctx.modelValueText - }, null, 8, FieldExpandableSelectvue_type_template_id_300528d8_hoisted_3)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", FieldExpandableSelectvue_type_template_id_300528d8_hoisted_4, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", FieldExpandableSelectvue_type_template_id_300528d8_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - type: "text", - placeholder: "Search", - "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) { - return _ctx.searchTerm = $event; - }), - class: "expandableSearch browser-default" - }, null, 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelText"], _ctx.searchTerm], [_directive_focus_if, _ctx.showSelect]])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", _hoisted_6, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.availableOptions, function (options, index) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { - class: "collection-item", - key: index - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h4", { - class: "expandableListCategory", - onClick: function onClick($event) { - return _ctx.onCategoryClicked(options); - } - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(options.group) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["secondary-content", { - "icon-arrow-right": _ctx.showCategory !== options.group, - "icon-arrow-bottom": _ctx.showCategory === options.group - }]) - }, null, 2)], 8, _hoisted_7), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", _hoisted_8, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(options.values.filter(function (x) { - return x.value.toLowerCase().indexOf(_ctx.searchTerm.toLowerCase()) !== -1; - }), function (children) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { - class: "expandableListItem collection-item valign-wrapper", - key: children.key, - onClick: function onClick($event) { - return _ctx.onValueClicked(children); - } - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_10, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(children.value), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - title: children.tooltip, - class: "secondary-content icon-help" - }, null, 8, _hoisted_11), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], children.tooltip]])], 8, _hoisted_9); - }), 128))], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showCategory === options.group || _ctx.searchTerm]])], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], options.values.filter(function (x) { - return x.value.toLowerCase().indexOf(_ctx.searchTerm.toLowerCase()) !== -1; - }).length]]); - }), 128))])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showSelect]])], 512)), [[_directive_focus_anywhere_but_here, { - blur: _ctx.onBlur - }]]); -} -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldExpandableSelect.vue?vue&type=template&id=300528d8 - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldExpandableSelect.vue?vue&type=script&lang=ts - - -function getAvailableOptions(availableValues) { - var flatValues = []; - - if (!availableValues) { - return flatValues; - } - - var groups = {}; - Object.values(availableValues).forEach(function (uncastedValue) { - var value = uncastedValue; - var group = value.group || ''; - - if (!(group in groups) || !groups[group]) { - groups[group] = { - values: [], - group: group - }; - } - - var formatted = { - key: value.key, - value: value.value - }; - - if ('tooltip' in value && value.tooltip) { - formatted.tooltip = value.tooltip; - } - - groups[group].values.push(formatted); - }); - Object.values(groups).forEach(function (group) { - if (group.values.length) { - flatValues.push(group); - } - }); - return flatValues; -} -/* harmony default export */ var FieldExpandableSelectvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - modelValue: [Number, String], - modelModifiers: Object, - availableOptions: Array, - title: String - }, - directives: { - FocusAnywhereButHere: external_CoreHome_["FocusAnywhereButHere"], - FocusIf: external_CoreHome_["FocusIf"] - }, - inheritAttrs: false, - emits: ['update:modelValue'], - data: function data() { - return { - showSelect: false, - searchTerm: '', - showCategory: '' - }; - }, - computed: { - modelValueText: function modelValueText() { - if (this.title) { - return this.title; - } - - var key = this.modelValue; - var availableOptions = this.availableOptions || []; - var keyItem; - availableOptions.some(function (option) { - keyItem = option.values.find(function (item) { - return item.key === key; - }); - return keyItem; // stop iterating if found - }); - - if (keyItem) { - return keyItem.value ? "".concat(keyItem.value) : ''; - } - - return key ? "".concat(key) : ''; - } - }, - methods: { - onBlur: function onBlur() { - this.showSelect = false; - }, - onCategoryClicked: function onCategoryClicked(options) { - if (this.showCategory === options.group) { - this.showCategory = ''; - } else { - this.showCategory = options.group; - } - }, - onValueClicked: function onValueClicked(selectedValue) { - var _this$modelModifiers; - - this.showSelect = false; - - if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { - this.$emit('update:modelValue', selectedValue.key); - return; - } - - var emitEventData = { - value: selectedValue.key, - abort: function abort() {// empty (not necessary to reset anything since the DOM will not change for this UI - // element until modelValue does) - } - }; - this.$emit('update:modelValue', emitEventData); - } - } -})); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldExpandableSelect.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldExpandableSelect.vue - - - -FieldExpandableSelectvue_type_script_lang_ts.render = FieldExpandableSelectvue_type_template_id_300528d8_render - -/* harmony default export */ var FieldExpandableSelect = (FieldExpandableSelectvue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldFieldArray.vue?vue&type=template&id=58341ca6 - -var FieldFieldArrayvue_type_template_id_58341ca6_hoisted_1 = ["for", "innerHTML"]; -function FieldFieldArrayvue_type_template_id_58341ca6_render(_ctx, _cache, $props, $setup, $data, $options) { - var _component_FieldArray = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("FieldArray"); - - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { - for: _ctx.name, - innerHTML: _ctx.$sanitize(_ctx.title) - }, null, 8, FieldFieldArrayvue_type_template_id_58341ca6_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_FieldArray, { - name: _ctx.name, - "model-value": _ctx.modelValue, - "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { - return _ctx.onValueUpdate($event); - }), - "model-modifiers": _ctx.modelModifiers, - field: _ctx.uiControlAttributes.field - }, null, 8, ["name", "model-value", "model-modifiers", "field"])]); -} -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldFieldArray.vue?vue&type=template&id=58341ca6 - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldFieldArray.vue?vue&type=script&lang=ts - - -/* harmony default export */ var FieldFieldArrayvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - components: { - FieldArray: external_CoreHome_["FieldArray"] - }, - props: { - name: String, - title: String, - modelValue: null, - modelModifiers: Object, - uiControlAttributes: Object - }, - inheritAttrs: false, - emits: ['update:modelValue'], - methods: { - onValueUpdate: function onValueUpdate(newValue) { - this.$emit('update:modelValue', newValue); - } - } -})); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldFieldArray.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldFieldArray.vue - - - -FieldFieldArrayvue_type_script_lang_ts.render = FieldFieldArrayvue_type_template_id_58341ca6_render - -/* harmony default export */ var FieldFieldArray = (FieldFieldArrayvue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldFile.vue?vue&type=template&id=2903f7cf - -var FieldFilevue_type_template_id_2903f7cf_hoisted_1 = { - class: "btn" -}; -var FieldFilevue_type_template_id_2903f7cf_hoisted_2 = ["for", "innerHTML"]; -var FieldFilevue_type_template_id_2903f7cf_hoisted_3 = ["name", "id"]; -var FieldFilevue_type_template_id_2903f7cf_hoisted_4 = { - class: "file-path-wrapper" -}; -var FieldFilevue_type_template_id_2903f7cf_hoisted_5 = ["value"]; -function FieldFilevue_type_template_id_2903f7cf_render(_ctx, _cache, $props, $setup, $data, $options) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", FieldFilevue_type_template_id_2903f7cf_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - for: _ctx.name, - innerHTML: _ctx.$sanitize(_ctx.title) - }, null, 8, FieldFilevue_type_template_id_2903f7cf_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - ref: "fileInput", - name: _ctx.name, - type: "file", - id: _ctx.name, - onChange: _cache[0] || (_cache[0] = function ($event) { - return _ctx.onChange($event); - }) - }, null, 40, FieldFilevue_type_template_id_2903f7cf_hoisted_3)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", FieldFilevue_type_template_id_2903f7cf_hoisted_4, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - class: "file-path validate", - value: _ctx.filePath, - type: "text" - }, null, 8, FieldFilevue_type_template_id_2903f7cf_hoisted_5)])]); -} -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldFile.vue?vue&type=template&id=2903f7cf - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldFile.vue?vue&type=script&lang=ts - -/* harmony default export */ var FieldFilevue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - name: String, - title: String, - modelValue: [String, File], - modelModifiers: Object - }, - inheritAttrs: false, - emits: ['update:modelValue'], - watch: { - modelValue: function modelValue(v) { - if (!v || v === '') { - var fileInputElement = this.$refs.fileInput; - fileInputElement.value = ''; - } - } - }, - methods: { - onChange: function onChange(event) { - var _this$modelModifiers; - - var files = event.target.files; - - if (!files) { - return; - } - - var file = files.item(0); - - if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { - this.$emit('update:modelValue', file); - return; - } - - var emitEventData = { - value: file, - abort: function abort() {// not supported - } - }; - this.$emit('update:modelValue', emitEventData); - } - }, - computed: { - filePath: function filePath() { - if (this.modelValue instanceof File) { - return this.$refs.fileInput.value; - } - - return undefined; - } - } -})); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldFile.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldFile.vue - - - -FieldFilevue_type_script_lang_ts.render = FieldFilevue_type_template_id_2903f7cf_render - -/* harmony default export */ var FieldFile = (FieldFilevue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldHidden.vue?vue&type=template&id=1cc21994 - -var FieldHiddenvue_type_template_id_1cc21994_hoisted_1 = ["type", "name", "value"]; -function FieldHiddenvue_type_template_id_1cc21994_render(_ctx, _cache, $props, $setup, $data, $options) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - type: _ctx.uiControl, - name: _ctx.name, - value: _ctx.modelValue, - onChange: _cache[0] || (_cache[0] = function ($event) { - return _ctx.onChange($event); - }) - }, null, 40, FieldHiddenvue_type_template_id_1cc21994_hoisted_1)]); -} -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldHidden.vue?vue&type=template&id=1cc21994 - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldHidden.vue?vue&type=script&lang=ts - -/* harmony default export */ var FieldHiddenvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - modelValue: null, - modelModifiers: Object, - uiControl: String, - name: String - }, - inheritAttrs: false, - emits: ['update:modelValue'], - methods: { - onChange: function onChange(event) { - this.$emit('update:modelValue', event.target.value); - } - } -})); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldHidden.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldHidden.vue - - - -FieldHiddenvue_type_script_lang_ts.render = FieldHiddenvue_type_template_id_1cc21994_render - -/* harmony default export */ var FieldHidden = (FieldHiddenvue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldMultituple.vue?vue&type=template&id=6abda7e4 - -var FieldMultituplevue_type_template_id_6abda7e4_hoisted_1 = { - class: "fieldMultiTuple" -}; -var FieldMultituplevue_type_template_id_6abda7e4_hoisted_2 = ["for", "innerHTML"]; -function FieldMultituplevue_type_template_id_6abda7e4_render(_ctx, _cache, $props, $setup, $data, $options) { - var _component_MultiPairField = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("MultiPairField"); - - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", FieldMultituplevue_type_template_id_6abda7e4_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { - for: _ctx.name, - innerHTML: _ctx.$sanitize(_ctx.title) - }, null, 8, FieldMultituplevue_type_template_id_6abda7e4_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_MultiPairField, { - name: _ctx.name, - "model-value": _ctx.modelValue, - "onUpdate:modelValue": _ctx.onUpdateValue, - "model-modifiers": _ctx.modelModifiers, - field1: _ctx.uiControlAttributes.field1, - field2: _ctx.uiControlAttributes.field2, - field3: _ctx.uiControlAttributes.field3, - field4: _ctx.uiControlAttributes.field4 - }, null, 8, ["name", "model-value", "onUpdate:modelValue", "model-modifiers", "field1", "field2", "field3", "field4"])]); -} -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldMultituple.vue?vue&type=template&id=6abda7e4 - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldMultituple.vue?vue&type=script&lang=ts - - -/* harmony default export */ var FieldMultituplevue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - name: String, - title: String, - modelValue: null, - modelModifiers: Object, - uiControlAttributes: Object - }, - inheritAttrs: false, - components: { - MultiPairField: external_CoreHome_["MultiPairField"] - }, - emits: ['update:modelValue'], - methods: { - onUpdateValue: function onUpdateValue(newValue) { - this.$emit('update:modelValue', newValue); - } - } -})); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldMultituple.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldMultituple.vue - - - -FieldMultituplevue_type_script_lang_ts.render = FieldMultituplevue_type_template_id_6abda7e4_render - -/* harmony default export */ var FieldMultituple = (FieldMultituplevue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldNumber.vue?vue&type=template&id=70811ee5 - -var FieldNumbervue_type_template_id_70811ee5_hoisted_1 = ["type", "id", "name", "value"]; -var FieldNumbervue_type_template_id_70811ee5_hoisted_2 = ["for", "innerHTML"]; -function FieldNumbervue_type_template_id_70811ee5_render(_ctx, _cache, $props, $setup, $data, $options) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ - class: "control_".concat(_ctx.uiControl), - type: _ctx.uiControl, - id: _ctx.name, - name: _ctx.name, - value: _ctx.modelValueFormatted, - onKeydown: _cache[0] || (_cache[0] = function ($event) { - return _ctx.onChange($event); - }), - onChange: _cache[1] || (_cache[1] = function ($event) { - return _ctx.onChange($event); - }) - }, _ctx.uiControlAttributes), null, 16, FieldNumbervue_type_template_id_70811ee5_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { - for: _ctx.name, - innerHTML: _ctx.$sanitize(_ctx.title) - }, null, 8, FieldNumbervue_type_template_id_70811ee5_hoisted_2)], 64); -} -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldNumber.vue?vue&type=template&id=70811ee5 - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldNumber.vue?vue&type=script&lang=ts - - -/* harmony default export */ var FieldNumbervue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - uiControl: String, - name: String, - title: String, - modelValue: [Number, String], - modelModifiers: Object, - uiControlAttributes: Object - }, - inheritAttrs: false, - emits: ['update:modelValue'], - created: function created() { - this.onChange = Object(external_CoreHome_["debounce"])(this.onChange.bind(this), 50); - }, - methods: { - onChange: function onChange(event) { - var _this = this; - - var value = parseFloat(event.target.value); - - if (value !== this.modelValue) { - var _this$modelModifiers; - - if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { - this.$emit('update:modelValue', value); - return; - } - - var emitEventData = { - value: value, - abort: function abort() { - if (event.target.value !== _this.modelValueFormatted) { - // change to previous value if the parent component did not update the model value - // (done manually because Vue will not notice if a value does NOT change) - event.target.value = _this.modelValueFormatted; - } - } - }; - this.$emit('update:modelValue', emitEventData); - } - } - }, - mounted: function mounted() { - window.Materialize.updateTextFields(); - }, - watch: { - modelValue: function modelValue() { - setTimeout(function () { - window.Materialize.updateTextFields(); - }); - } - }, - computed: { - modelValueFormatted: function modelValueFormatted() { - return (this.modelValue || '').toString(); - } - } -})); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldNumber.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldNumber.vue - - - -FieldNumbervue_type_script_lang_ts.render = FieldNumbervue_type_template_id_70811ee5_render - -/* harmony default export */ var FieldNumber = (FieldNumbervue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldRadio.vue?vue&type=template&id=5ab171cb - -var FieldRadiovue_type_template_id_5ab171cb_hoisted_1 = { - ref: "root" -}; -var FieldRadiovue_type_template_id_5ab171cb_hoisted_2 = ["value", "id", "name", "disabled", "checked"]; -function FieldRadiovue_type_template_id_5ab171cb_render(_ctx, _cache, $props, $setup, $data, $options) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", FieldRadiovue_type_template_id_5ab171cb_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { - class: "fieldRadioTitle" - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.title), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.title]]), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.availableOptions || [], function (radioModel) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", { - key: radioModel.key, - class: "radio" - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ - value: radioModel.key, - onChange: _cache[0] || (_cache[0] = function ($event) { - return _ctx.onChange($event); - }), - type: "radio", - id: "".concat(_ctx.name).concat(radioModel.key), - name: _ctx.name, - disabled: radioModel.disabled || _ctx.disabled - }, _ctx.uiControlAttributes, { - checked: _ctx.modelValue === radioModel.key || "".concat(_ctx.modelValue) === radioModel.key - }), null, 16, FieldRadiovue_type_template_id_5ab171cb_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(radioModel.value) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { - class: "form-description" - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(radioModel.description), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], radioModel.description]])])])]); - }), 128))], 512); -} -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldRadio.vue?vue&type=template&id=5ab171cb - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldRadio.vue?vue&type=script&lang=ts - -/* harmony default export */ var FieldRadiovue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - title: String, - availableOptions: Array, - name: String, - disabled: Boolean, - uiControlAttributes: Object, - modelValue: [String, Number], - modelModifiers: Object - }, - inheritAttrs: false, - emits: ['update:modelValue'], - methods: { - onChange: function onChange(event) { - var _this$modelModifiers, - _this = this; - - if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { - this.$emit('update:modelValue', event.target.value); - return; - } - - var reset = function reset() { - // change to previous value so the parent component can determine if this change should - // go through - _this.$refs.root.querySelectorAll('input').forEach(function (inp, i) { - var _this$availableOption; - - if (!((_this$availableOption = _this.availableOptions) !== null && _this$availableOption !== void 0 && _this$availableOption[i])) { - return; - } - - var key = _this.availableOptions[i].key; - inp.checked = _this.modelValue === key || "".concat(_this.modelValue) === key; - }); - }; - - var emitEventData = { - value: event.target.value, - abort: function abort() { - reset(); - } - }; - this.$emit('update:modelValue', emitEventData); - } - } -})); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldRadio.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldRadio.vue - - - -FieldRadiovue_type_script_lang_ts.render = FieldRadiovue_type_template_id_5ab171cb_render - -/* harmony default export */ var FieldRadio = (FieldRadiovue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldSelect.vue?vue&type=template&id=32fc626c -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || FieldSelectvue_type_template_id_32fc626c_unsupportedIterableToArray(arr, i) || _nonIterableRest(); } - -function _nonIterableRest() { 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 FieldSelectvue_type_template_id_32fc626c_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return FieldSelectvue_type_template_id_32fc626c_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return FieldSelectvue_type_template_id_32fc626c_arrayLikeToArray(o, minLen); } - -function FieldSelectvue_type_template_id_32fc626c_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } - -function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - - -var FieldSelectvue_type_template_id_32fc626c_hoisted_1 = { - key: 0, - class: "matomo-field-select" -}; -var FieldSelectvue_type_template_id_32fc626c_hoisted_2 = ["multiple", "name"]; -var FieldSelectvue_type_template_id_32fc626c_hoisted_3 = ["label"]; -var FieldSelectvue_type_template_id_32fc626c_hoisted_4 = ["value", "selected", "disabled"]; -var FieldSelectvue_type_template_id_32fc626c_hoisted_5 = ["for", "innerHTML"]; -var FieldSelectvue_type_template_id_32fc626c_hoisted_6 = { - key: 1, - class: "matomo-field-select" -}; -var FieldSelectvue_type_template_id_32fc626c_hoisted_7 = ["multiple", "name"]; -var FieldSelectvue_type_template_id_32fc626c_hoisted_8 = ["value", "selected", "disabled"]; -var FieldSelectvue_type_template_id_32fc626c_hoisted_9 = ["for", "innerHTML"]; -function FieldSelectvue_type_template_id_32fc626c_render(_ctx, _cache, $props, $setup, $data, $options) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, [_ctx.groupedOptions ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", FieldSelectvue_type_template_id_32fc626c_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("select", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ - ref: "select", - class: "grouped", - multiple: _ctx.multiple, - name: _ctx.name, - onChange: _cache[0] || (_cache[0] = function ($event) { - return _ctx.onChange($event); - }) - }, _ctx.uiControlAttributes), [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.groupedOptions, function (_ref) { - var _ref2 = _slicedToArray(_ref, 2), - group = _ref2[0], - options = _ref2[1]; - - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("optgroup", { - key: group, - label: group - }, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(options, function (option) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("option", { - key: option.key, - value: "string:".concat(option.key), - selected: _ctx.multiple ? _ctx.modelValue && _ctx.modelValue.indexOf(option.key) !== -1 : _ctx.modelValue === option.key, - disabled: option.disabled - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(option.value), 9, FieldSelectvue_type_template_id_32fc626c_hoisted_4); - }), 128))], 8, FieldSelectvue_type_template_id_32fc626c_hoisted_3); - }), 128))], 16, FieldSelectvue_type_template_id_32fc626c_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { - for: _ctx.name, - innerHTML: _ctx.$sanitize(_ctx.title) - }, null, 8, FieldSelectvue_type_template_id_32fc626c_hoisted_5)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !_ctx.groupedOptions && _ctx.options ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", FieldSelectvue_type_template_id_32fc626c_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("select", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ - class: "ungrouped", - ref: "select", - multiple: _ctx.multiple, - name: _ctx.name, - onChange: _cache[1] || (_cache[1] = function ($event) { - return _ctx.onChange($event); - }) - }, _ctx.uiControlAttributes), [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.options, function (option) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("option", { - key: option.key, - value: "string:".concat(option.key), - selected: _ctx.multiple ? _ctx.modelValue && _ctx.modelValue.indexOf(option.key) !== -1 : _ctx.modelValue === option.key, - disabled: option.disabled - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(option.value), 9, FieldSelectvue_type_template_id_32fc626c_hoisted_8); - }), 128))], 16, FieldSelectvue_type_template_id_32fc626c_hoisted_7), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { - for: _ctx.name, - innerHTML: _ctx.$sanitize(_ctx.title) - }, null, 8, FieldSelectvue_type_template_id_32fc626c_hoisted_9)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 64); -} -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldSelect.vue?vue&type=template&id=32fc626c - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldSelect.vue?vue&type=script&lang=ts -function FieldSelectvue_type_script_lang_ts_toConsumableArray(arr) { return FieldSelectvue_type_script_lang_ts_arrayWithoutHoles(arr) || FieldSelectvue_type_script_lang_ts_iterableToArray(arr) || FieldSelectvue_type_script_lang_ts_unsupportedIterableToArray(arr) || FieldSelectvue_type_script_lang_ts_nonIterableSpread(); } - -function FieldSelectvue_type_script_lang_ts_nonIterableSpread() { 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 FieldSelectvue_type_script_lang_ts_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } - -function FieldSelectvue_type_script_lang_ts_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return FieldSelectvue_type_script_lang_ts_arrayLikeToArray(arr); } - -function FieldSelectvue_type_script_lang_ts_slicedToArray(arr, i) { return FieldSelectvue_type_script_lang_ts_arrayWithHoles(arr) || FieldSelectvue_type_script_lang_ts_iterableToArrayLimit(arr, i) || FieldSelectvue_type_script_lang_ts_unsupportedIterableToArray(arr, i) || FieldSelectvue_type_script_lang_ts_nonIterableRest(); } - -function FieldSelectvue_type_script_lang_ts_nonIterableRest() { 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 FieldSelectvue_type_script_lang_ts_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return FieldSelectvue_type_script_lang_ts_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return FieldSelectvue_type_script_lang_ts_arrayLikeToArray(o, minLen); } - -function FieldSelectvue_type_script_lang_ts_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } - -function FieldSelectvue_type_script_lang_ts_iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - -function FieldSelectvue_type_script_lang_ts_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - - - -function initMaterialSelect(select, modelValue, placeholder) { - var uiControlOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - var multiple = arguments.length > 4 ? arguments[4] : undefined; - - if (!select) { - return; - } - - var $select = window.$(select); // reset selected since materialize removes them - - Array.from(select.options).forEach(function (opt) { - if (multiple) { - opt.selected = !!modelValue && modelValue.indexOf(opt.value.replace(/^string:/, '')) !== -1; - } else { - opt.selected = "string:".concat(modelValue) === opt.value; - } - }); - $select.formSelect(uiControlOptions); // add placeholder to input - - if (placeholder) { - var $materialInput = $select.closest('.select-wrapper').find('input'); - $materialInput.attr('placeholder', placeholder); - } -} - -function hasGroupedValues(availableValues) { - if (Array.isArray(availableValues) || !(_typeof(availableValues) === 'object')) { - return false; - } - - return Object.values(availableValues).some(function (v) { - return _typeof(v) === 'object'; - }); -} - -function hasOption(flatValues, key) { - return flatValues.some(function (f) { - return f.key === key; - }); -} - -function FieldSelectvue_type_script_lang_ts_getAvailableOptions(givenAvailableValues, type, uiControlAttributes) { - if (!givenAvailableValues) { - return []; - } - - var hasGroups = true; - var availableValues = givenAvailableValues; - - if (!hasGroupedValues(availableValues)) { - availableValues = { - '': givenAvailableValues - }; - hasGroups = false; - } - - var flatValues = []; - Object.entries(availableValues).forEach(function (_ref) { - var _ref2 = FieldSelectvue_type_script_lang_ts_slicedToArray(_ref, 2), - group = _ref2[0], - values = _ref2[1]; - - Object.entries(values).forEach(function (_ref3) { - var _ref4 = FieldSelectvue_type_script_lang_ts_slicedToArray(_ref3, 2), - valueObjKey = _ref4[0], - value = _ref4[1]; - - if (value && _typeof(value) === 'object' && typeof value.key !== 'undefined') { - flatValues.push(value); - return; - } - - var key = valueObjKey; - - if (type === 'integer' && typeof valueObjKey === 'string') { - key = parseInt(valueObjKey, 10); - } - - flatValues.push({ - group: hasGroups ? group : undefined, - key: key, - value: value - }); - }); - }); // for selects w/ a placeholder, add an option to unset the select - - if (uiControlAttributes !== null && uiControlAttributes !== void 0 && uiControlAttributes.placeholder && !hasOption(flatValues, '')) { - return [{ - key: '', - value: '' - }].concat(flatValues); - } - - return flatValues; -} - -function handleOldAngularJsValues(value) { - if (typeof value === 'string') { - return value.replace(/^string:/, ''); - } - - return value; -} - -/* harmony default export */ var FieldSelectvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - modelValue: null, - modelModifiers: Object, - multiple: Boolean, - name: String, - title: String, - availableOptions: Array, - uiControlAttributes: Object, - uiControlOptions: Object - }, - inheritAttrs: false, - emits: ['update:modelValue'], - computed: { - options: function options() { - // if modelValue is empty, but there is no empty value allowed in availableOptions, - // add one temporarily until something is set - var availableOptions = this.availableOptions; - - if (availableOptions && !hasOption(availableOptions, '') && (typeof this.modelValue === 'undefined' || this.modelValue === null || this.modelValue === '')) { - return [{ - key: '', - value: this.modelValue, - group: this.hasGroups ? '' : undefined - }].concat(FieldSelectvue_type_script_lang_ts_toConsumableArray(availableOptions)); - } - - return availableOptions; - }, - hasGroups: function hasGroups() { - var availableOptions = this.availableOptions; - return availableOptions && availableOptions[0] && typeof availableOptions[0].group !== 'undefined'; - }, - groupedOptions: function groupedOptions() { - var options = this.options; - - if (!this.hasGroups || !options) { - return null; - } - - var groups = {}; - options.forEach(function (entry) { - var group = entry.group; - groups[group] = groups[group] || []; - groups[group].push(entry); - }); - var result = Object.entries(groups); - result.sort(function (lhs, rhs) { - if (lhs[0] < rhs[0]) { - return -1; - } - - if (lhs[0] > rhs[0]) { - return 1; - } - - return 0; - }); - return result; - } - }, - methods: { - onChange: function onChange(event) { - var _this$modelModifiers, - _this = this; - - var element = event.target; - var newValue; - - if (this.multiple) { - newValue = Array.from(element.options).filter(function (e) { - return e.selected; - }).map(function (e) { - return e.value; - }); - newValue = newValue.map(function (x) { - return handleOldAngularJsValues(x); - }); - } else { - newValue = element.value; - newValue = handleOldAngularJsValues(newValue); - } - - if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { - this.$emit('update:modelValue', newValue); - return; - } - - var emitEventData = { - value: newValue, - abort: function abort() { - _this.onModelValueChange(_this.modelValue); - } - }; - this.$emit('update:modelValue', emitEventData); - }, - onModelValueChange: function onModelValueChange(newVal) { - var _this2 = this; - - window.$(this.$refs.select).val(newVal); - setTimeout(function () { - var _this2$uiControlAttri; - - initMaterialSelect(_this2.$refs.select, newVal, (_this2$uiControlAttri = _this2.uiControlAttributes) === null || _this2$uiControlAttri === void 0 ? void 0 : _this2$uiControlAttri.placeholder, _this2.uiControlOptions, _this2.multiple); - }); - } - }, - watch: { - modelValue: function modelValue(newVal) { - this.onModelValueChange(newVal); - }, - 'uiControlAttributes.disabled': { - handler: function handler(newVal, oldVal) { - var _this3 = this; - - setTimeout(function () { - if (newVal !== oldVal) { - var _this3$uiControlAttri; - - initMaterialSelect(_this3.$refs.select, _this3.modelValue, (_this3$uiControlAttri = _this3.uiControlAttributes) === null || _this3$uiControlAttri === void 0 ? void 0 : _this3$uiControlAttri.placeholder, _this3.uiControlOptions, _this3.multiple); - } - }); - } - }, - availableOptions: function availableOptions(newVal, oldVal) { - var _this4 = this; - - if (newVal !== oldVal) { - setTimeout(function () { - var _this4$uiControlAttri; - - initMaterialSelect(_this4.$refs.select, _this4.modelValue, (_this4$uiControlAttri = _this4.uiControlAttributes) === null || _this4$uiControlAttri === void 0 ? void 0 : _this4$uiControlAttri.placeholder, _this4.uiControlOptions, _this4.multiple); - }); - } - } - }, - mounted: function mounted() { - var _this5 = this; - - setTimeout(function () { - var _this5$uiControlAttri; - - initMaterialSelect(_this5.$refs.select, _this5.modelValue, (_this5$uiControlAttri = _this5.uiControlAttributes) === null || _this5$uiControlAttri === void 0 ? void 0 : _this5$uiControlAttri.placeholder, _this5.uiControlOptions, _this5.multiple); - }); - } -})); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldSelect.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldSelect.vue - - - -FieldSelectvue_type_script_lang_ts.render = FieldSelectvue_type_template_id_32fc626c_render - -/* harmony default export */ var FieldSelect = (FieldSelectvue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldSite.vue?vue&type=template&id=4680911e - -var FieldSitevue_type_template_id_4680911e_hoisted_1 = ["for", "innerHTML"]; -var FieldSitevue_type_template_id_4680911e_hoisted_2 = { - class: "sites_autocomplete" -}; -function FieldSitevue_type_template_id_4680911e_render(_ctx, _cache, $props, $setup, $data, $options) { - var _component_SiteSelector = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("SiteSelector"); - - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { - for: _ctx.name, - class: "siteSelectorLabel", - innerHTML: _ctx.$sanitize(_ctx.title) - }, null, 8, FieldSitevue_type_template_id_4680911e_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", FieldSitevue_type_template_id_4680911e_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_SiteSelector, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ - "model-value": _ctx.modelValue, - "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { - return _ctx.onChange($event); - }), - id: _ctx.name, - "show-all-sites-item": _ctx.uiControlAttributes.showAllSitesItem || false, - "switch-site-on-select": false, - "show-selected-site": true, - "only-sites-with-admin-access": _ctx.uiControlAttributes.onlySitesWithAdminAccess || false - }, _ctx.uiControlAttributes), null, 16, ["model-value", "id", "show-all-sites-item", "only-sites-with-admin-access"])])]); -} -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldSite.vue?vue&type=template&id=4680911e - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldSite.vue?vue&type=script&lang=ts - - -/* harmony default export */ var FieldSitevue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - name: String, - title: String, - modelValue: Object, - modelModifiers: Object, - uiControlAttributes: Object - }, - inheritAttrs: false, - components: { - SiteSelector: external_CoreHome_["SiteSelector"] - }, - emits: ['update:modelValue'], - methods: { - onChange: function onChange(newValue) { - var _this$modelModifiers; - - if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { - this.$emit('update:modelValue', newValue); - return; - } - - var emitEventData = { - value: newValue, - abort: function abort() {// empty (not necessary to reset anything since the DOM will not change for this UI - // element until modelValue does) - } - }; - this.$emit('update:modelValue', emitEventData); - } - } -})); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldSite.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldSite.vue - - - -FieldSitevue_type_script_lang_ts.render = FieldSitevue_type_template_id_4680911e_render - -/* harmony default export */ var FieldSite = (FieldSitevue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue?vue&type=template&id=518c87fe - -var FieldTextvue_type_template_id_518c87fe_hoisted_1 = ["type", "id", "name", "value"]; -var FieldTextvue_type_template_id_518c87fe_hoisted_2 = ["for", "innerHTML"]; -function FieldTextvue_type_template_id_518c87fe_render(_ctx, _cache, $props, $setup, $data, $options) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ - class: "control_".concat(_ctx.uiControl), - type: _ctx.uiControl, - id: _ctx.name, - name: _ctx.name, - value: _ctx.modelValueText, - onKeydown: _cache[0] || (_cache[0] = function ($event) { - return _ctx.onKeydown($event); - }), - onChange: _cache[1] || (_cache[1] = function ($event) { - return _ctx.onKeydown($event); - }) - }, _ctx.uiControlAttributes), null, 16, FieldTextvue_type_template_id_518c87fe_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { - for: _ctx.name, - innerHTML: _ctx.$sanitize(_ctx.title) - }, null, 8, FieldTextvue_type_template_id_518c87fe_hoisted_2)], 64); -} -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue?vue&type=template&id=518c87fe - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue?vue&type=script&lang=ts - - -/* harmony default export */ var FieldTextvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - title: String, - name: String, - uiControlAttributes: Object, - modelValue: [String, Number], - modelModifiers: Object, - uiControl: String - }, - inheritAttrs: false, - emits: ['update:modelValue'], - computed: { - modelValueText: function modelValueText() { - if (typeof this.modelValue === 'undefined' || this.modelValue === null) { - return ''; - } - - return this.modelValue.toString(); - } - }, - created: function created() { - // debounce because puppeteer types reeaally fast - this.onKeydown = Object(external_CoreHome_["debounce"])(this.onKeydown.bind(this), 50); - }, - mounted: function mounted() { - setTimeout(function () { - window.Materialize.updateTextFields(); - }); - }, - watch: { - modelValue: function modelValue() { - setTimeout(function () { - window.Materialize.updateTextFields(); - }); - } - }, - methods: { - onKeydown: function onKeydown(event) { - var _this = this; - - var newValue = event.target.value; - - if (this.modelValue !== newValue) { - var _this$modelModifiers; - - if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { - this.$emit('update:modelValue', newValue); - return; - } - - var emitEventData = { - value: newValue, - abort: function abort() { - // change to previous value if the parent component did not update the model value - // (done manually because Vue will not notice if a value does NOT change) - if (event.target.value !== _this.modelValueText) { - event.target.value = _this.modelValueText; - } - } - }; - this.$emit('update:modelValue', emitEventData); - } - } - } -})); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue - - - -FieldTextvue_type_script_lang_ts.render = FieldTextvue_type_template_id_518c87fe_render - -/* harmony default export */ var FieldText = (FieldTextvue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue?vue&type=template&id=72853163 - -var FieldTextArrayvue_type_template_id_72853163_hoisted_1 = ["for", "innerHTML"]; -var FieldTextArrayvue_type_template_id_72853163_hoisted_2 = ["type", "name", "value"]; -function FieldTextArrayvue_type_template_id_72853163_render(_ctx, _cache, $props, $setup, $data, $options) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { - for: _ctx.name, - innerHTML: _ctx.$sanitize(_ctx.title) - }, null, 8, FieldTextArrayvue_type_template_id_72853163_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ - class: "control_".concat(_ctx.uiControl), - type: _ctx.uiControl, - name: _ctx.name, - onKeydown: _cache[0] || (_cache[0] = function ($event) { - return _ctx.onKeydown($event); - }), - onChange: _cache[1] || (_cache[1] = function ($event) { - return _ctx.onKeydown($event); - }), - value: _ctx.concattedValues - }, _ctx.uiControlAttributes), null, 16, FieldTextArrayvue_type_template_id_72853163_hoisted_2)]); -} -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue?vue&type=template&id=72853163 - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue?vue&type=script&lang=ts - - -/* harmony default export */ var FieldTextArrayvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - name: String, - title: String, - uiControl: String, - modelValue: Array, - modelModifiers: Object, - uiControlAttributes: Object - }, - inheritAttrs: false, - computed: { - concattedValues: function concattedValues() { - if (typeof this.modelValue === 'string') { - return this.modelValue; - } - - return (this.modelValue || []).join(', '); - } - }, - emits: ['update:modelValue'], - created: function created() { - // debounce because puppeteer types reeaally fast - this.onKeydown = Object(external_CoreHome_["debounce"])(this.onKeydown.bind(this), 50); - }, - methods: { - onKeydown: function onKeydown(event) { - var _this = this; - - var values = event.target.value.split(',').map(function (v) { - return v.trim(); - }); - - if (values.join(', ') !== this.concattedValues) { - var _this$modelModifiers; - - if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { - this.$emit('update:modelValue', values); - return; - } - - var emitEventData = { - value: values, - abort: function abort() { - if (event.target.value !== _this.concattedValues) { - event.target.value = _this.concattedValues; - } - } - }; - this.$emit('update:modelValue', emitEventData); - } - } - } -})); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue - - - -FieldTextArrayvue_type_script_lang_ts.render = FieldTextArrayvue_type_template_id_72853163_render - -/* harmony default export */ var FieldTextArray = (FieldTextArrayvue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextarea.vue?vue&type=template&id=f0327bcc - -var FieldTextareavue_type_template_id_f0327bcc_hoisted_1 = ["name", "id", "value"]; -var FieldTextareavue_type_template_id_f0327bcc_hoisted_2 = ["for", "innerHTML"]; -function FieldTextareavue_type_template_id_f0327bcc_render(_ctx, _cache, $props, $setup, $data, $options) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("textarea", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ - name: _ctx.name - }, _ctx.uiControlAttributes, { - id: _ctx.name, - value: _ctx.modelValueText, - onKeydown: _cache[0] || (_cache[0] = function ($event) { - return _ctx.onKeydown($event); - }), - onChange: _cache[1] || (_cache[1] = function ($event) { - return _ctx.onKeydown($event); - }), - class: "materialize-textarea", - ref: "textarea" - }), null, 16, FieldTextareavue_type_template_id_f0327bcc_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { - for: _ctx.name, - innerHTML: _ctx.$sanitize(_ctx.title) - }, null, 8, FieldTextareavue_type_template_id_f0327bcc_hoisted_2)], 64); -} -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextarea.vue?vue&type=template&id=f0327bcc - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextarea.vue?vue&type=script&lang=ts - - -/* harmony default export */ var FieldTextareavue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - name: String, - uiControlAttributes: Object, - modelValue: String, - modelModifiers: Object, - title: String - }, - inheritAttrs: false, - emits: ['update:modelValue'], - created: function created() { - this.onKeydown = Object(external_CoreHome_["debounce"])(this.onKeydown.bind(this), 50); - }, - methods: { - onKeydown: function onKeydown(event) { - var _this = this; - - var newValue = event.target.value; - - if (newValue !== this.modelValue) { - var _this$modelModifiers; - - if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { - this.$emit('update:modelValue', newValue); - return; - } - - var emitEventData = { - value: newValue, - abort: function abort() { - if (event.target.value !== _this.modelValue) { - event.target.value = _this.modelValueText; - } - } - }; - this.$emit('update:modelValue', emitEventData); - } - } - }, - computed: { - modelValueText: function modelValueText() { - return this.modelValue || ''; - } - }, - watch: { - modelValue: function modelValue() { - var _this2 = this; - - setTimeout(function () { - window.Materialize.textareaAutoResize(_this2.$refs.textarea); - window.Materialize.updateTextFields(); - }); - } - }, - mounted: function mounted() { - var _this3 = this; - - setTimeout(function () { - window.Materialize.textareaAutoResize(_this3.$refs.textarea); - window.Materialize.updateTextFields(); - }); - } -})); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextarea.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextarea.vue - - - -FieldTextareavue_type_script_lang_ts.render = FieldTextareavue_type_template_id_f0327bcc_render - -/* harmony default export */ var FieldTextarea = (FieldTextareavue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue?vue&type=template&id=72695c4b - -var FieldTextareaArrayvue_type_template_id_72695c4b_hoisted_1 = ["for", "innerHTML"]; -var FieldTextareaArrayvue_type_template_id_72695c4b_hoisted_2 = ["name", "value"]; -function FieldTextareaArrayvue_type_template_id_72695c4b_render(_ctx, _cache, $props, $setup, $data, $options) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { - for: _ctx.name, - innerHTML: _ctx.$sanitize(_ctx.title) - }, null, 8, FieldTextareaArrayvue_type_template_id_72695c4b_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("textarea", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ - ref: "textarea", - name: _ctx.name - }, _ctx.uiControlAttributes, { - value: _ctx.concattedValue, - onKeydown: _cache[0] || (_cache[0] = function ($event) { - return _ctx.onKeydown($event); - }), - onChange: _cache[1] || (_cache[1] = function ($event) { - return _ctx.onKeydown($event); - }), - class: "materialize-textarea" - }), null, 16, FieldTextareaArrayvue_type_template_id_72695c4b_hoisted_2)]); -} -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue?vue&type=template&id=72695c4b - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue?vue&type=script&lang=ts - - -var SEPARATOR = '\n'; -/* harmony default export */ var FieldTextareaArrayvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - name: String, - title: String, - uiControlAttributes: Object, - modelValue: [Array, String], - modelModifiers: Object - }, - inheritAttrs: false, - emits: ['update:modelValue'], - computed: { - concattedValue: function concattedValue() { - if (typeof this.modelValue === 'string') { - return this.modelValue; - } - - return (this.modelValue || []).join(SEPARATOR); - } - }, - created: function created() { - this.onKeydown = Object(external_CoreHome_["debounce"])(this.onKeydown.bind(this), 50); - }, - methods: { - onKeydown: function onKeydown(event) { - var _this = this; - - var value = event.target.value.split(SEPARATOR); - - if (value.join(SEPARATOR) !== this.concattedValue) { - var _this$modelModifiers; - - if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { - this.$emit('update:modelValue', value); - return; - } - - var emitEventData = { - value: value, - abort: function abort() { - if (event.target.value !== _this.concattedValue) { - // change to previous value if the parent component did not update the model value - // (done manually because Vue will not notice if a value does NOT change) - event.target.value = _this.concattedValue; - } - } - }; - this.$emit('update:modelValue', emitEventData); - } - } - }, - watch: { - modelValue: function modelValue(newVal, oldVal) { - var _this2 = this; - - if (newVal !== oldVal) { - setTimeout(function () { - if (_this2.$refs.textarea) { - window.Materialize.textareaAutoResize(_this2.$refs.textarea); - } - - window.Materialize.updateTextFields(); - }); - } - } - }, - mounted: function mounted() { - var _this3 = this; - - setTimeout(function () { - if (_this3.$refs.textarea) { - window.Materialize.textareaAutoResize(_this3.$refs.textarea); - } - - window.Materialize.updateTextFields(); - }); - } -})); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue - - - -FieldTextareaArrayvue_type_script_lang_ts.render = FieldTextareaArrayvue_type_template_id_72695c4b_render - -/* harmony default export */ var FieldTextareaArray = (FieldTextareaArrayvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/utilities.ts -function utilities_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { utilities_typeof = function _typeof(obj) { return typeof obj; }; } else { utilities_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return utilities_typeof(obj); } - -function utilities_slicedToArray(arr, i) { return utilities_arrayWithHoles(arr) || utilities_iterableToArrayLimit(arr, i) || utilities_unsupportedIterableToArray(arr, i) || utilities_nonIterableRest(); } - -function utilities_nonIterableRest() { 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 utilities_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return utilities_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return utilities_arrayLikeToArray(o, minLen); } - -function utilities_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } - -function utilities_iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - -function utilities_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -function processCheckboxAndRadioAvailableValues(availableValues, type) { - if (!availableValues) { - return []; - } - - var flatValues = []; - Object.entries(availableValues).forEach(function (_ref) { - var _ref2 = utilities_slicedToArray(_ref, 2), - valueObjKey = _ref2[0], - value = _ref2[1]; - - if (value && utilities_typeof(value) === 'object' && typeof value.key !== 'undefined') { - flatValues.push(value); - return; - } - - var key = valueObjKey; - - if (type === 'integer' && typeof valueObjKey === 'string') { - key = parseInt(key, 10); - } - - flatValues.push({ - key: key, - value: value - }); - }); - return flatValues; -} -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldAngularJsTemplate.vue?vue&type=template&id=3f63d972 - -var FieldAngularJsTemplatevue_type_template_id_3f63d972_hoisted_1 = { - ref: "root" -}; -function FieldAngularJsTemplatevue_type_template_id_3f63d972_render(_ctx, _cache, $props, $setup, $data, $options) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", FieldAngularJsTemplatevue_type_template_id_3f63d972_hoisted_1, null, 512); -} -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldAngularJsTemplate.vue?vue&type=template&id=3f63d972 - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldAngularJsTemplate.vue?vue&type=script&lang=ts - - - -function clone(obj) { - if (typeof obj === 'undefined') { - return undefined; - } - - return JSON.parse(JSON.stringify(obj)); -} - -/* harmony default export */ var FieldAngularJsTemplatevue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - modelValue: null, - formField: { - type: null, - required: true - }, - templateFile: { - type: String, - required: true - } - }, - emits: ['update:modelValue'], - inheritAttrs: false, - setup: function setup(props, context) { - var root = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(null); - var $element = window.$("<div ng-include=\"'".concat(props.templateFile, "?cb=").concat(external_CoreHome_["Matomo"].cacheBuster, "'\"></div>")); - var $timeout = external_CoreHome_["Matomo"].helper.getAngularDependency('$timeout'); - var $rootScope = external_CoreHome_["Matomo"].helper.getAngularDependency('$rootScope'); - var scope = $rootScope.$new(); - scope.formField = Object.assign(Object.assign({}, clone(props.formField)), {}, { - value: clone(props.modelValue) - }); - scope.$watch('formField.value', function (newValue, oldValue) { - if (newValue !== oldValue && JSON.stringify(newValue) !== JSON.stringify(props.modelValue)) { - context.emit('update:modelValue', clone(newValue)); - } - }); - Object(external_commonjs_vue_commonjs2_vue_root_Vue_["watch"])(function () { - return props.modelValue; - }, function (newValue) { - if (JSON.stringify(newValue) !== JSON.stringify(scope.formField.value)) { - $timeout(function () { - scope.formField.value = newValue; - }); - } - }); - Object(external_commonjs_vue_commonjs2_vue_root_Vue_["watch"])(function () { - return props.formField; - }, function (newValue) { - $timeout(function () { - var currentValue = scope.formField.value; - scope.formField = Object.assign(Object.assign({}, clone(newValue)), {}, { - value: currentValue - }); - }); - }, { - deep: true - }); // append on mount - - Object(external_commonjs_vue_commonjs2_vue_root_Vue_["onMounted"])(function () { - window.$(root.value).append($element); - external_CoreHome_["Matomo"].helper.compileAngularComponents($element, { - scope: scope, - params: { - formField: Object.assign(Object.assign({}, clone(props.formField)), {}, { - value: props.modelValue - }) - } - }); - }); - return { - root: root - }; - } -})); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldAngularJsTemplate.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldAngularJsTemplate.vue - - - -FieldAngularJsTemplatevue_type_script_lang_ts.render = FieldAngularJsTemplatevue_type_template_id_3f63d972_render - -/* harmony default export */ var FieldAngularJsTemplate = (FieldAngularJsTemplatevue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FormField.vue?vue&type=script&lang=ts -function FormFieldvue_type_script_lang_ts_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FormFieldvue_type_script_lang_ts_typeof = function _typeof(obj) { return typeof obj; }; } else { FormFieldvue_type_script_lang_ts_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FormFieldvue_type_script_lang_ts_typeof(obj); } - - - - - - - - - - - - - - - - - - - - -var TEXT_CONTROLS = ['password', 'url', 'search', 'email']; -var CONTROLS_SUPPORTING_ARRAY = ['textarea', 'checkbox', 'text']; -var CONTROL_TO_COMPONENT_MAP = { - checkbox: 'FieldCheckbox', - 'expandable-select': 'FieldExpandableSelect', - 'field-array': 'FieldFieldArray', - file: 'FieldFile', - hidden: 'FieldHidden', - multiselect: 'FieldSelect', - multituple: 'FieldMultituple', - number: 'FieldNumber', - radio: 'FieldRadio', - select: 'FieldSelect', - site: 'FieldSite', - text: 'FieldText', - textarea: 'FieldTextarea' -}; -var CONTROL_TO_AVAILABLE_OPTION_PROCESSOR = { - FieldSelect: FieldSelectvue_type_script_lang_ts_getAvailableOptions, - FieldCheckboxArray: processCheckboxAndRadioAvailableValues, - FieldRadio: processCheckboxAndRadioAvailableValues, - FieldExpandableSelect: getAvailableOptions -}; -/* harmony default export */ var FormFieldvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - modelValue: null, - modelModifiers: Object, - formField: { - type: Object, - required: true - } - }, - emits: ['update:modelValue'], - components: { - FieldCheckbox: FieldCheckbox, - FieldCheckboxArray: FieldCheckboxArray, - FieldExpandableSelect: FieldExpandableSelect, - FieldFieldArray: FieldFieldArray, - FieldFile: FieldFile, - FieldHidden: FieldHidden, - FieldMultituple: FieldMultituple, - FieldNumber: FieldNumber, - FieldRadio: FieldRadio, - FieldSelect: FieldSelect, - FieldSite: FieldSite, - FieldText: FieldText, - FieldTextArray: FieldTextArray, - FieldTextarea: FieldTextarea, - FieldTextareaArray: FieldTextareaArray - }, - setup: function setup(props) { - var inlineHelpNode = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(null); - - var setInlineHelp = function setInlineHelp(newVal) { - var toAppend; - - if (!newVal || !inlineHelpNode.value || typeof newVal.render === 'function') { - return; - } - - if (typeof newVal === 'string') { - if (newVal.indexOf('#') === 0) { - toAppend = window.$(newVal); - } else { - toAppend = window.vueSanitize(newVal); - } - } else { - toAppend = newVal; - } - - window.$(inlineHelpNode.value).html('').append(toAppend); - }; - - Object(external_commonjs_vue_commonjs2_vue_root_Vue_["watch"])(function () { - return props.formField.inlineHelp; - }, setInlineHelp); - Object(external_commonjs_vue_commonjs2_vue_root_Vue_["onMounted"])(function () { - setInlineHelp(props.formField.inlineHelp); - }); - return { - inlineHelp: inlineHelpNode - }; - }, - computed: { - inlineHelpComponent: function inlineHelpComponent() { - var formField = this.formField; - var inlineHelpRecord = formField.inlineHelp; - - if (inlineHelpRecord && typeof inlineHelpRecord.render === 'function') { - return formField.inlineHelp; - } - - return undefined; - }, - inlineHelpBind: function inlineHelpBind() { - return this.inlineHelpComponent ? this.formField.inlineHelpBind : undefined; - }, - childComponent: function childComponent() { - var formField = this.formField; - - if (formField.component) { - var component = formField.component; - - if (formField.component.plugin) { - var _formField$component = formField.component, - plugin = _formField$component.plugin, - name = _formField$component.name; - - if (!plugin || !name) { - throw new Error('Invalid component property given to piwik-field directive, must be ' + '{plugin: \'...\',name: \'...\'}'); - } - - component = Object(external_CoreHome_["useExternalPluginComponent"])(plugin, name); - } - - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["markRaw"])(component); - } // backwards compatibility w/ settings that use templateFile property - - - if (formField.templateFile) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["markRaw"])(FieldAngularJsTemplate); - } - - var uiControl = formField.uiControl; - var control = CONTROL_TO_COMPONENT_MAP[uiControl]; - - if (TEXT_CONTROLS.indexOf(uiControl) !== -1) { - control = 'FieldText'; // we use same template for text and password both - } - - if (this.formField.type === 'array' && CONTROLS_SUPPORTING_ARRAY.indexOf(uiControl) !== -1) { - control = "".concat(control, "Array"); - } - - return control; - }, - extraChildComponentParams: function extraChildComponentParams() { - if (this.formField.uiControl === 'multiselect') { - return { - multiple: true - }; - } - - return {}; - }, - showFormHelp: function showFormHelp() { - return this.formField.description || this.formField.inlineHelp || this.showDefaultValue || this.hasInlineHelpSlot; - }, - showDefaultValue: function showDefaultValue() { - return this.defaultValuePretty && this.formField.uiControl !== 'checkbox' && this.formField.uiControl !== 'radio'; - }, - - /** - * @deprecated here for angularjs BC support. shouldn't be used directly, instead use - * GroupedSetting.vue. - */ - showField: function showField() { - if (!this.formField || !this.formField.condition || !(this.formField.condition instanceof Function)) { - return true; - } - - return this.formField.condition(); - }, - processedModelValue: function processedModelValue() { - var field = this.formField; // convert boolean values since angular 1.6 uses strict equals when determining if a model - // value matches the ng-value of an input. - - if (field.type === 'boolean') { - var valueIsTruthy = this.modelValue && this.modelValue > 0 && this.modelValue !== '0'; // for checkboxes, the value MUST be either true or false - - if (field.uiControl === 'checkbox') { - return valueIsTruthy; - } - - if (field.uiControl === 'radio') { - return valueIsTruthy ? '1' : '0'; - } - } - - return this.modelValue; - }, - defaultValue: function defaultValue() { - var defaultValue = this.formField.defaultValue; - - if (Array.isArray(defaultValue)) { - return defaultValue.join(','); - } - - return defaultValue; - }, - availableOptions: function availableOptions() { - var childComponent = this.childComponent; - - if (typeof childComponent !== 'string') { - return null; - } - - var formField = this.formField; - - if (!formField.availableValues || !CONTROL_TO_AVAILABLE_OPTION_PROCESSOR[childComponent]) { - return null; - } - - return CONTROL_TO_AVAILABLE_OPTION_PROCESSOR[childComponent](formField.availableValues, formField.type, formField.uiControlAttributes); - }, - defaultValuePretty: function defaultValuePretty() { - var formField = this.formField; - var defaultValue = formField.defaultValue; - var availableOptions = this.availableOptions; - - if (typeof defaultValue === 'string' && defaultValue) { - // eg default value for multi tuple - var defaultParsed = null; - - try { - defaultParsed = JSON.parse(defaultValue); - } catch (e) {// invalid JSON - } - - if (defaultParsed !== null && FormFieldvue_type_script_lang_ts_typeof(defaultParsed) === 'object') { - return ''; - } - } - - if (!Array.isArray(availableOptions)) { - if (Array.isArray(defaultValue)) { - return ''; - } - - return defaultValue ? "".concat(defaultValue) : ''; - } - - var prettyValues = []; - - if (!Array.isArray(defaultValue)) { - defaultValue = [defaultValue]; - } - - (availableOptions || []).forEach(function (value) { - if (typeof value.value !== 'undefined' && defaultValue.indexOf(value.key) !== -1) { - prettyValues.push(value.value); - } - }); - return prettyValues.join(', '); - }, - defaultValuePrettyTruncated: function defaultValuePrettyTruncated() { - return this.defaultValuePretty.substring(0, 50); - }, - hasInlineHelpSlot: function hasInlineHelpSlot() { - var _inlineHelpSlot$, _inlineHelpSlot$$chil; - - if (!this.$slots['inline-help']) { - return false; - } - - var inlineHelpSlot = this.$slots['inline-help'](); - return !!(inlineHelpSlot !== null && inlineHelpSlot !== void 0 && (_inlineHelpSlot$ = inlineHelpSlot[0]) !== null && _inlineHelpSlot$ !== void 0 && (_inlineHelpSlot$$chil = _inlineHelpSlot$.children) !== null && _inlineHelpSlot$$chil !== void 0 && _inlineHelpSlot$$chil.length); - } - }, - methods: { - onChange: function onChange(newValue) { - this.$emit('update:modelValue', newValue); - } - } -})); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FormField.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FormField.vue - - - -FormFieldvue_type_script_lang_ts.render = render - -/* harmony default export */ var FormField = (FormFieldvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FormField.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 transformVueComponentRef(value) { - if (!value) { - return undefined; - } - - var plugin = value.plugin, - name = value.name; - - if (!plugin || !name) { - throw new Error('Invalid component property given to piwik-field directive, must be ' + '{plugin: \'...\',name: \'...\'}'); - } - - return Object(external_CoreHome_["useExternalPluginComponent"])(plugin, name); -} // eslint-disable-next-line @typescript-eslint/no-explicit-any - - -function conditionFn(scope, condition) { - var values = {}; - Object.values(scope.allSettings || {}).forEach(function (setting) { - if (setting.value === '0') { - values[setting.name] = 0; - } else { - values[setting.name] = setting.value; - } - }); - return scope.$eval(condition, values); -} - -/* harmony default export */ var FormField_adapter = (Object(external_CoreHome_["createAngularJsAdapter"])({ - component: FormField, - scope: { - modelValue: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - default: function _default(scope) { - var field = scope.piwikFormField; // vue components expect object data as input, so we parse JSON data - // for angularjs directives that use JSON. - - if (typeof field.value === 'string' && field.value && (field.type === 'array' || field.uiControl === 'multituple' || field.uiControl === 'field-array' || field.uiControl === 'multiselect' || field.uiControl === 'site')) { - field.value = JSON.parse(field.value); - } - - if (field.uiControl === 'checkbox') { - return Object(external_CoreHome_["transformAngularJsBoolAttr"])(field.value); - } - - return field.value; - } - }, - piwikFormField: { - vue: 'formField', - angularJsBind: '=', - transform: function transform(v, vm, scope) { - var value = v; - - function getComponent() { - if (value.templateFile) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["markRaw"])(FieldAngularJsTemplate); - } - - var comp = transformVueComponentRef(value.component); - - if (!comp) { - return undefined; - } - - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["markRaw"])(comp); - } - - return Object.assign(Object.assign({}, value), {}, { - condition: value.condition ? conditionFn.bind(null, scope, value.condition) : value.condition, - disabled: Object(external_CoreHome_["transformAngularJsBoolAttr"])(value.disabled), - autocomplete: Object(external_CoreHome_["transformAngularJsBoolAttr"])(value.autocomplete), - autofocus: Object(external_CoreHome_["transformAngularJsBoolAttr"])(value.autofocus), - tabindex: Object(external_CoreHome_["transformAngularJsIntAttr"])(value.tabindex), - fullWidth: Object(external_CoreHome_["transformAngularJsBoolAttr"])(value.fullWidth), - maxlength: Object(external_CoreHome_["transformAngularJsIntAttr"])(value.maxlength), - required: Object(external_CoreHome_["transformAngularJsBoolAttr"])(value.required), - rows: Object(external_CoreHome_["transformAngularJsIntAttr"])(value.rows), - min: Object(external_CoreHome_["transformAngularJsIntAttr"])(value.min), - max: Object(external_CoreHome_["transformAngularJsIntAttr"])(value.max), - component: getComponent() - }); - } - }, - allSettings: { - angularJsBind: '=' - } - }, - directiveName: 'piwikFormField', - events: { - 'update:modelValue': function updateModelValue(newValue, vm, scope, element, attrs, controller, $timeout) { - if (newValue !== scope.piwikFormField.value) { - $timeout(function () { - scope.piwikFormField.value = newValue; - }); - } - } - }, - $inject: ['$timeout'], - postCreate: function postCreate(vm, scope) { - scope.$watch('piwikFormField.value', function (newVal, oldVal) { - if (newVal !== oldVal) { - vm.modelValue = newVal; - } - }); // deep watch for all settings, on change trigger change in formfield property - // so condition is re-applied - - scope.$watch('allSettings', function () { - vm.formField = Object.assign(Object.assign({}, vm.formField), {}, { - condition: scope.piwikFormField.condition ? conditionFn.bind(null, scope, scope.piwikFormField.condition) : scope.piwikFormField.condition - }); - }, true); - } -})); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/Field/Field.vue?vue&type=template&id=85ce424c - -function Fieldvue_type_template_id_85ce424c_render(_ctx, _cache, $props, $setup, $data, $options) { - var _component_FormField = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("FormField"); - - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_FormField, { - "form-field": _ctx.field, - "model-value": _ctx.modelValue, - "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { - return _ctx.onChange($event); - }), - "model-modifiers": _ctx.modelModifiers - }, { - "inline-help": Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { - return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "inline-help")]; - }), - _: 3 - }, 8, ["form-field", "model-value", "model-modifiers"]); -} -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Field/Field.vue?vue&type=template&id=85ce424c - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/Field/Field.vue?vue&type=script&lang=ts - - -var UI_CONTROLS_TO_TYPE = { - multiselect: 'array', - checkbox: 'boolean', - site: 'object', - number: 'integer' -}; -/* harmony default export */ var Fieldvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - modelValue: null, - modelModifiers: Object, - uicontrol: String, - name: String, - defaultValue: null, - options: [Object, Array], - description: String, - introduction: String, - title: String, - inlineHelp: [String, Object], - inlineHelpBind: Object, - disabled: Boolean, - uiControlAttributes: { - type: Object, - default: function _default() { - return {}; - } - }, - uiControlOptions: { - type: Object, - default: function _default() { - return {}; - } - }, - autocomplete: Boolean, - condition: Function, - varType: String, - autofocus: Boolean, - tabindex: Number, - fullWidth: Boolean, - maxlength: Number, - required: Boolean, - placeholder: String, - rows: Number, - min: Number, - max: Number, - component: null, - templateFile: String - }, - emits: ['update:modelValue'], - components: { - FormField: FormField - }, - computed: { - type: function type() { - if (this.varType) { - return this.varType; - } - - var uicontrol = this.uicontrol; - - if (uicontrol && UI_CONTROLS_TO_TYPE[uicontrol]) { - return UI_CONTROLS_TO_TYPE[uicontrol]; - } - - return 'string'; - }, - field: function field() { - return { - uiControl: this.uicontrol, - type: this.type, - name: this.name, - defaultValue: this.defaultValue, - availableValues: this.options, - description: this.description, - introduction: this.introduction, - inlineHelp: this.inlineHelp, - inlineHelpBind: this.inlineHelpBind, - title: this.title, - component: this.component, - templateFile: this.templateFile, - uiControlAttributes: Object.assign(Object.assign({}, this.uiControlAttributes), {}, { - disabled: this.disabled, - autocomplete: this.autocomplete, - tabindex: this.tabindex, - autofocus: this.autofocus, - rows: this.rows, - required: this.required, - maxlength: this.maxlength, - placeholder: this.placeholder, - min: this.min, - max: this.max - }), - fullWidth: this.fullWidth, - uiControlOptions: this.uiControlOptions - }; - } - }, - methods: { - onChange: function onChange(newValue) { - this.$emit('update:modelValue', newValue); - } - } -})); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Field/Field.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Field/Field.vue - - - -Fieldvue_type_script_lang_ts.render = Fieldvue_type_template_id_85ce424c_render - -/* harmony default export */ var Field = (Fieldvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Field/Field.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 handleJsonValue(value, varType, uiControl) { - if (typeof value === 'string' && value && (varType === 'array' || uiControl === 'multituple' || uiControl === 'field-array' || uiControl === 'multiselect' || uiControl === 'site')) { - var result = JSON.parse(value); // the angularjs site field supplied siteid/sitename properties which initializes the - // siteselector value. the sitename is assumed to be encoded, and is decoded once. - // so the value for 'site' Field's in angularjs is assumed to be encoded. - - if (uiControl === 'site') { - result.name = external_CoreHome_["Matomo"].helper.htmlDecode(result.name); - } - - return result; - } - - if (uiControl === 'checkbox' && varType !== 'array') { - return Object(external_CoreHome_["transformAngularJsBoolAttr"])(value); - } - - return value; -} - -/* harmony default export */ var Field_adapter = (Object(external_CoreHome_["createAngularJsAdapter"])({ - component: Field, - require: '?ngModel', - scope: { - uicontrol: { - angularJsBind: '@' - }, - name: { - angularJsBind: '@' - }, - value: { - vue: 'modelValue', - angularJsBind: '@', - // eslint-disable-next-line @typescript-eslint/no-explicit-any - transform: function transform(value, vm, scope) { - // vue components expect object data as input, so we parse JSON data - // for angularjs directives that use JSON. - return handleJsonValue(value, scope.varType, scope.uicontrol); - } - }, - default: { - vue: 'defaultValue', - angularJsBind: '@' - }, - options: { - angularJsBind: '=' - }, - description: { - angularJsBind: '@' - }, - introduction: { - angularJsBind: '@' - }, - title: { - angularJsBind: '@' - }, - inlineHelp: { - angularJsBind: '@' - }, - disabled: { - angularJsBind: '=', - transform: external_CoreHome_["transformAngularJsBoolAttr"] - }, - uiControlAttributes: { - angularJsBind: '=' - }, - uiControlOptions: { - angularJsBind: '=' - }, - autocomplete: { - angularJsBind: '@', - transform: external_CoreHome_["transformAngularJsBoolAttr"] - }, - condition: { - angularJsBind: '@', - transform: function transform(value, vm, scope) { - if (!value) { - return undefined; - } - - return function (values) { - return scope.$eval(value, values); - }; - } - }, - varType: { - angularJsBind: '@' - }, - autofocus: { - angularJsBind: '@', - transform: external_CoreHome_["transformAngularJsBoolAttr"] - }, - tabindex: { - angularJsBind: '@', - transform: external_CoreHome_["transformAngularJsIntAttr"] - }, - fullWidth: { - angularJsBind: '@', - transform: external_CoreHome_["transformAngularJsBoolAttr"] - }, - maxlength: { - angularJsBind: '@', - transform: external_CoreHome_["transformAngularJsIntAttr"] - }, - required: { - angularJsBind: '@', - transform: external_CoreHome_["transformAngularJsBoolAttr"] - }, - placeholder: { - angularJsBind: '@' - }, - rows: { - angularJsBind: '@', - transform: external_CoreHome_["transformAngularJsIntAttr"] - }, - min: { - angularJsBind: '@', - transform: external_CoreHome_["transformAngularJsIntAttr"] - }, - max: { - angularJsBind: '@', - transform: external_CoreHome_["transformAngularJsIntAttr"] - }, - component: { - angularJsBind: '<', - // eslint-disable-next-line @typescript-eslint/no-explicit-any - transform: function transform(value, vm, scope) { - if (!value) { - return undefined; - } - - if (scope.templateFile) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["shallowRef"])(FieldAngularJsTemplate); - } - - var plugin = value.plugin, - name = value.name; - - if (!plugin || !name) { - throw new Error('Invalid component property given to piwik-field directive, must ' + 'be {plugin: \'...\',name: \'...\'}'); - } - - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["shallowRef"])(Object(external_CoreHome_["useExternalPluginComponent"])(plugin, name)); - } - } - }, - directiveName: 'piwikField', - $inject: ['$timeout'], - events: { - 'update:modelValue': function updateModelValue(newValue, vm, scope, element, attrs, ngModel, $timeout) { - var currentValue = ngModel ? ngModel.$viewValue : scope.value; - - if (newValue !== currentValue) { - $timeout(function () { - if (!ngModel) { - scope.value = newValue; - return; - } // ngModel being used - - - ngModel.$setViewValue(newValue); - ngModel.$render(); // not detected by the watch for some reason - }); - } - } - }, - postCreate: function postCreate(vm, scope, element, attrs, controller) { - var ngModel = controller; - - if (!ngModel) { - scope.$watch('value', function (newVal) { - if (newVal !== vm.modelValue) { - var transformed = handleJsonValue(newVal, scope.varType, scope.uicontrol); - Object(external_commonjs_vue_commonjs2_vue_root_Vue_["nextTick"])(function () { - vm.modelValue = transformed; - }); - } - }); - return; - } // ngModel being used - - - ngModel.$render = function () { - Object(external_commonjs_vue_commonjs2_vue_root_Vue_["nextTick"])(function () { - vm.modelValue = Object(external_CoreHome_["removeAngularJsSpecificProperties"])(ngModel.$viewValue); - }); - }; - - if (typeof scope.value !== 'undefined') { - var transformed = handleJsonValue(scope.value, scope.varType, scope.uicontrol); - ngModel.$setViewValue(transformed); - } else { - ngModel.$setViewValue(vm.modelValue); - } // to provide same behavior in angularjs/<4.6.0, we trigger a model update to the same - // value, but only for 'site' uicontrols. this only happened for site selectors, no others. - - - if (scope.uicontrol === 'site' && ngModel.$viewValue) { - setTimeout(function () { - ngModel.$setViewValue(Object.assign({}, ngModel.$viewValue)); - }); - } - } -})); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/PluginSettings/PluginSettings.vue?vue&type=template&id=4f2694bf - -var PluginSettingsvue_type_template_id_4f2694bf_hoisted_1 = { - class: "pluginSettings", - ref: "root" -}; -var PluginSettingsvue_type_template_id_4f2694bf_hoisted_2 = ["id"]; -var PluginSettingsvue_type_template_id_4f2694bf_hoisted_3 = { - class: "card-content" -}; -var PluginSettingsvue_type_template_id_4f2694bf_hoisted_4 = ["id"]; -var PluginSettingsvue_type_template_id_4f2694bf_hoisted_5 = ["onClick", "disabled", "value"]; -function PluginSettingsvue_type_template_id_4f2694bf_render(_ctx, _cache, $props, $setup, $data, $options) { - var _component_GroupedSettings = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("GroupedSettings"); - - var _component_ActivityIndicator = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ActivityIndicator"); - - var _component_PasswordConfirmation = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("PasswordConfirmation"); - - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", PluginSettingsvue_type_template_id_4f2694bf_hoisted_1, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.settingsPerPlugin, function (settings) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { - class: "card", - id: "".concat(settings.pluginName, "PluginSettings"), - key: "".concat(settings.pluginName, "PluginSettings") - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PluginSettingsvue_type_template_id_4f2694bf_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", { - class: "card-title", - id: settings.pluginName - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(settings.title), 9, PluginSettingsvue_type_template_id_4f2694bf_hoisted_4), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_GroupedSettings, { - "group-name": settings.pluginName, - settings: settings.settings, - "all-setting-values": _ctx.settingValues, - onChange: function onChange($event) { - return _ctx.settingValues["".concat(settings.pluginName, ".").concat($event.name)] = $event.value; - } - }, null, 8, ["group-name", "settings", "all-setting-values", "onChange"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - type: "button", - onClick: function onClick($event) { - return _ctx.saveSetting(settings.pluginName); - }, - disabled: _ctx.isLoading, - class: "pluginsSettingsSubmit btn", - value: _ctx.translate('General_Save') - }, null, 8, PluginSettingsvue_type_template_id_4f2694bf_hoisted_5), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ActivityIndicator, { - loading: _ctx.isLoading || _ctx.isSaving[settings.pluginName] - }, null, 8, ["loading"])])], 8, PluginSettingsvue_type_template_id_4f2694bf_hoisted_2); - }), 128)), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_PasswordConfirmation, { - modelValue: _ctx.showPasswordConfirmModal, - "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { - return _ctx.showPasswordConfirmModal = $event; - }), - onConfirmed: _ctx.confirmPassword - }, { - default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { - return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ConfirmWithPassword')), 1)]; - }), - _: 1 - }, 8, ["modelValue", "onConfirmed"])], 512); -} -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/PluginSettings/PluginSettings.vue?vue&type=template&id=4f2694bf - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/GroupedSettings/GroupedSettings.vue?vue&type=template&id=566a93cc - -function GroupedSettingsvue_type_template_id_566a93cc_render(_ctx, _cache, $props, $setup, $data, $options) { - var _component_GroupedSetting = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("GroupedSetting"); - - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.settings, function (setting) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { - key: "".concat(_ctx.groupPrefix).concat(setting.name) - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_GroupedSetting, { - "model-value": _ctx.allSettingValues["".concat(_ctx.groupPrefix).concat(setting.name)], - "onUpdate:modelValue": function onUpdateModelValue($event) { - return _ctx.$emit('change', { - name: setting.name, - value: $event - }); - }, - setting: setting, - "condition-values": _ctx.settingValues - }, null, 8, ["model-value", "onUpdate:modelValue", "setting", "condition-values"])]); - }), 128); -} -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/GroupedSettings/GroupedSettings.vue?vue&type=template&id=566a93cc - -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/GroupedSettings/GroupedSetting.vue?vue&type=template&id=b2e643bc - -function GroupedSettingvue_type_template_id_b2e643bc_render(_ctx, _cache, $props, $setup, $data, $options) { - var _component_FormField = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("FormField"); - - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_FormField, { - "model-value": _ctx.modelValue, - "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { - return _ctx.changeValue($event); - }), - "form-field": _ctx.settingWithComponent - }, null, 8, ["model-value", "form-field"])], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showField]]); -} -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/GroupedSettings/GroupedSetting.vue?vue&type=template&id=b2e643bc - // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/extends.js var helpers_extends = __webpack_require__("a559"); var extends_default = /*#__PURE__*/__webpack_require__.n(helpers_extends); @@ -4676,7 +1933,7 @@ function typeOf(x) { * @return {*} clone */ -function object_clone(x) { +function clone(x) { var type = typeof x; // immutable primitive types if (type === 'number' || type === 'string' || type === 'boolean' || x === null || x === undefined) { @@ -4691,7 +1948,7 @@ function object_clone(x) { if (Array.isArray(x)) { return x.map(function (value) { - return object_clone(value); + return clone(value); }); } @@ -4701,7 +1958,7 @@ function object_clone(x) { if (x instanceof RegExp) throw new TypeError('Cannot clone ' + x); // TODO: clone a RegExp // object - return mapObject(x, object_clone); + return mapObject(x, clone); } /** * Apply map to all properties of an object @@ -7596,19 +4853,19 @@ function configFactory(config, emit) { */ function _config(options) { if (options) { - var prev = mapObject(config, object_clone); // validate some of the options + var prev = mapObject(config, clone); // validate some of the options validateOption(options, 'matrix', MATRIX_OPTIONS); validateOption(options, 'number', NUMBER_OPTIONS); // merge options deepExtend(config, options); - var curr = mapObject(config, object_clone); - var changes = mapObject(options, object_clone); // emit 'config' event + var curr = mapObject(config, clone); + var changes = mapObject(options, clone); // emit 'config' event emit('config', curr, prev, changes); return curr; } else { - return mapObject(config, object_clone); + return mapObject(config, clone); } } // attach the valid options to the function so they can be extended @@ -17802,8 +15059,2306 @@ expressions_math.import({ override: true }); /* harmony default export */ var src_expressions = (expressions_math); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/GroupedSettings/GroupedSetting.vue?vue&type=script&lang=ts +// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"} +var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf"); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FormField.vue?vue&type=template&id=e553cbfa + +var _hoisted_1 = { + class: "form-group row matomo-form-field" +}; +var _hoisted_2 = { + key: 0, + class: "col s12" +}; +var _hoisted_3 = { + key: 0, + class: "form-help" +}; +var _hoisted_4 = { + key: 0, + class: "inline-help", + ref: "inlineHelp" +}; + +var _hoisted_5 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); + +function render(_ctx, _cache, $props, $setup, $data, $options) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_1, [_ctx.formField.introduction ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("h3", _hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.formField.introduction), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["col s12", { + 'input-field': _ctx.formField.uiControl !== 'checkbox' && _ctx.formField.uiControl !== 'radio', + 'file-field': _ctx.formField.uiControl === 'file', + 'm6': !_ctx.formField.fullWidth + }]) + }, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDynamicComponent"])(_ctx.childComponent), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])(Object.assign(Object.assign({ + formField: _ctx.formField + }, _ctx.formField), {}, { + modelValue: _ctx.processedModelValue, + modelModifiers: _ctx.modelModifiers, + availableOptions: _ctx.availableOptions + }, _ctx.extraChildComponentParams), { + "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { + return _ctx.onChange($event); + }) + }), null, 16))], 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["col s12", { + 'm6': !_ctx.formField.fullWidth + }]) + }, [_ctx.showFormHelp ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + class: "form-description" + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.formField.description), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.formField.description]]), _ctx.formField.inlineHelp || _ctx.hasInlineHelpSlot ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", _hoisted_4, [_ctx.inlineHelpComponent ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDynamicComponent"])(_ctx.inlineHelpComponent), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeProps"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ + key: 0 + }, _ctx.inlineHelpBind)), null, 16)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "inline-help")], 512)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, [_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Default')) + ": ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.defaultValuePrettyTruncated), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showDefaultValue]])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 2)], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showField]]); +} +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FormField.vue?vue&type=template&id=e553cbfa + +// EXTERNAL MODULE: external "CoreHome" +var external_CoreHome_ = __webpack_require__("19dc"); + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckbox.vue?vue&type=template&id=2988a0eb + +var FieldCheckboxvue_type_template_id_2988a0eb_hoisted_1 = { + class: "checkbox" +}; +var FieldCheckboxvue_type_template_id_2988a0eb_hoisted_2 = ["checked", "id", "name"]; +var FieldCheckboxvue_type_template_id_2988a0eb_hoisted_3 = ["innerHTML"]; +function FieldCheckboxvue_type_template_id_2988a0eb_render(_ctx, _cache, $props, $setup, $data, $options) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", FieldCheckboxvue_type_template_id_2988a0eb_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ + onChange: _cache[0] || (_cache[0] = function ($event) { + return _ctx.onChange($event); + }) + }, _ctx.uiControlAttributes, { + value: 1, + checked: _ctx.isChecked, + type: "checkbox", + id: _ctx.name, + name: _ctx.name + }), null, 16, FieldCheckboxvue_type_template_id_2988a0eb_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + innerHTML: _ctx.$sanitize(_ctx.title) + }, null, 8, FieldCheckboxvue_type_template_id_2988a0eb_hoisted_3)])]); +} +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckbox.vue?vue&type=template&id=2988a0eb + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckbox.vue?vue&type=script&lang=ts + +/* harmony default export */ var FieldCheckboxvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + modelValue: [Boolean, Number, String], + modelModifiers: Object, + uiControlAttributes: Object, + name: String, + title: String + }, + inheritAttrs: false, + emits: ['update:modelValue'], + methods: { + onChange: function onChange(event) { + var newValue = event.target.checked; + + if (this.modelValue !== newValue) { + var _this$modelModifiers; + + if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { + this.$emit('update:modelValue', newValue); + return; + } + + var emitEventData = { + value: newValue, + abort: function abort() { + event.target.checked = !newValue; + } + }; + this.$emit('update:modelValue', emitEventData); + } + } + }, + computed: { + isChecked: function isChecked() { + return !!this.modelValue && this.modelValue !== '0'; + } + } +})); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckbox.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckbox.vue + + + +FieldCheckboxvue_type_script_lang_ts.render = FieldCheckboxvue_type_template_id_2988a0eb_render + +/* harmony default export */ var FieldCheckbox = (FieldCheckboxvue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckboxArray.vue?vue&type=template&id=18154c64 + +var FieldCheckboxArrayvue_type_template_id_18154c64_hoisted_1 = { + ref: "root" +}; +var FieldCheckboxArrayvue_type_template_id_18154c64_hoisted_2 = ["value", "checked", "onChange", "id", "name"]; +function FieldCheckboxArrayvue_type_template_id_18154c64_render(_ctx, _cache, $props, $setup, $data, $options) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", FieldCheckboxArrayvue_type_template_id_18154c64_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { + class: "fieldRadioTitle" + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.title), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.title]]), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.availableOptions, function (checkboxModel, $index) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", { + key: $index, + class: "checkbox" + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ + value: checkboxModel.key, + checked: !!_ctx.checkboxStates[$index], + onChange: function onChange($event) { + return _ctx.onChange($index); + } + }, _ctx.uiControlAttributes, { + type: "checkbox", + id: "".concat(_ctx.name).concat(checkboxModel.key), + name: checkboxModel.name + }), null, 16, FieldCheckboxArrayvue_type_template_id_18154c64_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(checkboxModel.value), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "form-description" + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(checkboxModel.description), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], checkboxModel.description]])])]); + }), 128))], 512); +} +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckboxArray.vue?vue&type=template&id=18154c64 + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckboxArray.vue?vue&type=script&lang=ts +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { 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 _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + + +function getCheckboxStates(availableOptions, modelValue) { + return (availableOptions || []).map(function (o) { + return modelValue && modelValue.indexOf(o.key) !== -1; + }); +} + +/* harmony default export */ var FieldCheckboxArrayvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + modelValue: Array, + modelModifiers: Object, + name: String, + title: String, + availableOptions: Array, + uiControlAttributes: Object, + type: String + }, + inheritAttrs: false, + emits: ['update:modelValue'], + computed: { + checkboxStates: function checkboxStates() { + return getCheckboxStates(this.availableOptions, this.modelValue); + } + }, + mounted: function mounted() { + window.Materialize.updateTextFields(); + }, + methods: { + onChange: function onChange(changedIndex) { + var _this$modelModifiers, + _this = this; + + var checkboxStates = _toConsumableArray(this.checkboxStates); + + checkboxStates[changedIndex] = !checkboxStates[changedIndex]; + var availableOptions = this.availableOptions || {}; + var newValue = []; + Object.values(availableOptions).forEach(function (option, index) { + if (checkboxStates[index]) { + newValue.push(option.key); + } + }); + + if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { + this.$emit('update:modelValue', newValue); + return; + } + + var emitEventData = { + value: newValue, + abort: function abort() { + // undo checked changes since we want the parent component to decide if it should go + // through + var item = _this.$refs.root.querySelectorAll('input').item(changedIndex); + + item.checked = !item.checked; + } + }; + this.$emit('update:modelValue', emitEventData); + } + } +})); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckboxArray.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckboxArray.vue + + + +FieldCheckboxArrayvue_type_script_lang_ts.render = FieldCheckboxArrayvue_type_template_id_18154c64_render + +/* harmony default export */ var FieldCheckboxArray = (FieldCheckboxArrayvue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldExpandableSelect.vue?vue&type=template&id=300528d8 + +var FieldExpandableSelectvue_type_template_id_300528d8_hoisted_1 = { + class: "expandableSelector" +}; + +var FieldExpandableSelectvue_type_template_id_300528d8_hoisted_2 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("svg", { + class: "caret", + height: "24", + viewBox: "0 0 24 24", + width: "24", + xmlns: "http://www.w3.org/2000/svg" +}, [/*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("path", { + d: "M7 10l5 5 5-5z" +}), /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("path", { + d: "M0 0h24v24H0z", + fill: "none" +})], -1); + +var FieldExpandableSelectvue_type_template_id_300528d8_hoisted_3 = ["value"]; +var FieldExpandableSelectvue_type_template_id_300528d8_hoisted_4 = { + class: "expandableList z-depth-2" +}; +var FieldExpandableSelectvue_type_template_id_300528d8_hoisted_5 = { + class: "searchContainer" +}; +var _hoisted_6 = { + class: "collection firstLevel" +}; +var _hoisted_7 = ["onClick"]; +var _hoisted_8 = { + class: "collection secondLevel" +}; +var _hoisted_9 = ["onClick"]; +var _hoisted_10 = { + class: "primary-content" +}; +var _hoisted_11 = ["title"]; +function FieldExpandableSelectvue_type_template_id_300528d8_render(_ctx, _cache, $props, $setup, $data, $options) { + var _directive_focus_if = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("focus-if"); + + var _directive_focus_anywhere_but_here = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("focus-anywhere-but-here"); + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", FieldExpandableSelectvue_type_template_id_300528d8_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + onClick: _cache[0] || (_cache[0] = function ($event) { + return _ctx.showSelect = !_ctx.showSelect; + }), + class: "select-wrapper" + }, [FieldExpandableSelectvue_type_template_id_300528d8_hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + type: "text", + class: "select-dropdown", + readonly: "readonly", + value: _ctx.modelValueText + }, null, 8, FieldExpandableSelectvue_type_template_id_300528d8_hoisted_3)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", FieldExpandableSelectvue_type_template_id_300528d8_hoisted_4, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", FieldExpandableSelectvue_type_template_id_300528d8_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + type: "text", + placeholder: "Search", + "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) { + return _ctx.searchTerm = $event; + }), + class: "expandableSearch browser-default" + }, null, 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelText"], _ctx.searchTerm], [_directive_focus_if, _ctx.showSelect]])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", _hoisted_6, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.availableOptions, function (options, index) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { + class: "collection-item", + key: index + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h4", { + class: "expandableListCategory", + onClick: function onClick($event) { + return _ctx.onCategoryClicked(options); + } + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(options.group) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["secondary-content", { + "icon-arrow-right": _ctx.showCategory !== options.group, + "icon-arrow-bottom": _ctx.showCategory === options.group + }]) + }, null, 2)], 8, _hoisted_7), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", _hoisted_8, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(options.values.filter(function (x) { + return x.value.toLowerCase().indexOf(_ctx.searchTerm.toLowerCase()) !== -1; + }), function (children) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { + class: "expandableListItem collection-item valign-wrapper", + key: children.key, + onClick: function onClick($event) { + return _ctx.onValueClicked(children); + } + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_10, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(children.value), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + title: children.tooltip, + class: "secondary-content icon-help" + }, null, 8, _hoisted_11), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], children.tooltip]])], 8, _hoisted_9); + }), 128))], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showCategory === options.group || _ctx.searchTerm]])], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], options.values.filter(function (x) { + return x.value.toLowerCase().indexOf(_ctx.searchTerm.toLowerCase()) !== -1; + }).length]]); + }), 128))])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showSelect]])], 512)), [[_directive_focus_anywhere_but_here, { + blur: _ctx.onBlur + }]]); +} +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldExpandableSelect.vue?vue&type=template&id=300528d8 + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldExpandableSelect.vue?vue&type=script&lang=ts + + +function getAvailableOptions(availableValues) { + var flatValues = []; + + if (!availableValues) { + return flatValues; + } + + var groups = {}; + Object.values(availableValues).forEach(function (uncastedValue) { + var value = uncastedValue; + var group = value.group || ''; + + if (!(group in groups) || !groups[group]) { + groups[group] = { + values: [], + group: group + }; + } + + var formatted = { + key: value.key, + value: value.value + }; + + if ('tooltip' in value && value.tooltip) { + formatted.tooltip = value.tooltip; + } + + groups[group].values.push(formatted); + }); + Object.values(groups).forEach(function (group) { + if (group.values.length) { + flatValues.push(group); + } + }); + return flatValues; +} +/* harmony default export */ var FieldExpandableSelectvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + modelValue: [Number, String], + modelModifiers: Object, + availableOptions: Array, + title: String + }, + directives: { + FocusAnywhereButHere: external_CoreHome_["FocusAnywhereButHere"], + FocusIf: external_CoreHome_["FocusIf"] + }, + inheritAttrs: false, + emits: ['update:modelValue'], + data: function data() { + return { + showSelect: false, + searchTerm: '', + showCategory: '' + }; + }, + computed: { + modelValueText: function modelValueText() { + if (this.title) { + return this.title; + } + + var key = this.modelValue; + var availableOptions = this.availableOptions || []; + var keyItem; + availableOptions.some(function (option) { + keyItem = option.values.find(function (item) { + return item.key === key; + }); + return keyItem; // stop iterating if found + }); + + if (keyItem) { + return keyItem.value ? "".concat(keyItem.value) : ''; + } + + return key ? "".concat(key) : ''; + } + }, + methods: { + onBlur: function onBlur() { + this.showSelect = false; + }, + onCategoryClicked: function onCategoryClicked(options) { + if (this.showCategory === options.group) { + this.showCategory = ''; + } else { + this.showCategory = options.group; + } + }, + onValueClicked: function onValueClicked(selectedValue) { + var _this$modelModifiers; + + this.showSelect = false; + + if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { + this.$emit('update:modelValue', selectedValue.key); + return; + } + + var emitEventData = { + value: selectedValue.key, + abort: function abort() {// empty (not necessary to reset anything since the DOM will not change for this UI + // element until modelValue does) + } + }; + this.$emit('update:modelValue', emitEventData); + } + } +})); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldExpandableSelect.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldExpandableSelect.vue + + + +FieldExpandableSelectvue_type_script_lang_ts.render = FieldExpandableSelectvue_type_template_id_300528d8_render + +/* harmony default export */ var FieldExpandableSelect = (FieldExpandableSelectvue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldFieldArray.vue?vue&type=template&id=58341ca6 + +var FieldFieldArrayvue_type_template_id_58341ca6_hoisted_1 = ["for", "innerHTML"]; +function FieldFieldArrayvue_type_template_id_58341ca6_render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_FieldArray = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("FieldArray"); + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { + for: _ctx.name, + innerHTML: _ctx.$sanitize(_ctx.title) + }, null, 8, FieldFieldArrayvue_type_template_id_58341ca6_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_FieldArray, { + name: _ctx.name, + "model-value": _ctx.modelValue, + "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { + return _ctx.onValueUpdate($event); + }), + "model-modifiers": _ctx.modelModifiers, + field: _ctx.uiControlAttributes.field + }, null, 8, ["name", "model-value", "model-modifiers", "field"])]); +} +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldFieldArray.vue?vue&type=template&id=58341ca6 + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldFieldArray.vue?vue&type=script&lang=ts + + +/* harmony default export */ var FieldFieldArrayvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + components: { + FieldArray: external_CoreHome_["FieldArray"] + }, + props: { + name: String, + title: String, + modelValue: null, + modelModifiers: Object, + uiControlAttributes: Object + }, + inheritAttrs: false, + emits: ['update:modelValue'], + methods: { + onValueUpdate: function onValueUpdate(newValue) { + this.$emit('update:modelValue', newValue); + } + } +})); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldFieldArray.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldFieldArray.vue + + + +FieldFieldArrayvue_type_script_lang_ts.render = FieldFieldArrayvue_type_template_id_58341ca6_render + +/* harmony default export */ var FieldFieldArray = (FieldFieldArrayvue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldFile.vue?vue&type=template&id=2903f7cf + +var FieldFilevue_type_template_id_2903f7cf_hoisted_1 = { + class: "btn" +}; +var FieldFilevue_type_template_id_2903f7cf_hoisted_2 = ["for", "innerHTML"]; +var FieldFilevue_type_template_id_2903f7cf_hoisted_3 = ["name", "id"]; +var FieldFilevue_type_template_id_2903f7cf_hoisted_4 = { + class: "file-path-wrapper" +}; +var FieldFilevue_type_template_id_2903f7cf_hoisted_5 = ["value"]; +function FieldFilevue_type_template_id_2903f7cf_render(_ctx, _cache, $props, $setup, $data, $options) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", FieldFilevue_type_template_id_2903f7cf_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + for: _ctx.name, + innerHTML: _ctx.$sanitize(_ctx.title) + }, null, 8, FieldFilevue_type_template_id_2903f7cf_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + ref: "fileInput", + name: _ctx.name, + type: "file", + id: _ctx.name, + onChange: _cache[0] || (_cache[0] = function ($event) { + return _ctx.onChange($event); + }) + }, null, 40, FieldFilevue_type_template_id_2903f7cf_hoisted_3)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", FieldFilevue_type_template_id_2903f7cf_hoisted_4, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + class: "file-path validate", + value: _ctx.filePath, + type: "text" + }, null, 8, FieldFilevue_type_template_id_2903f7cf_hoisted_5)])]); +} +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldFile.vue?vue&type=template&id=2903f7cf + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldFile.vue?vue&type=script&lang=ts + +/* harmony default export */ var FieldFilevue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + name: String, + title: String, + modelValue: [String, File], + modelModifiers: Object + }, + inheritAttrs: false, + emits: ['update:modelValue'], + watch: { + modelValue: function modelValue(v) { + if (!v || v === '') { + var fileInputElement = this.$refs.fileInput; + fileInputElement.value = ''; + } + } + }, + methods: { + onChange: function onChange(event) { + var _this$modelModifiers; + + var files = event.target.files; + + if (!files) { + return; + } + + var file = files.item(0); + + if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { + this.$emit('update:modelValue', file); + return; + } + + var emitEventData = { + value: file, + abort: function abort() {// not supported + } + }; + this.$emit('update:modelValue', emitEventData); + } + }, + computed: { + filePath: function filePath() { + if (this.modelValue instanceof File) { + return this.$refs.fileInput.value; + } + + return undefined; + } + } +})); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldFile.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldFile.vue + + + +FieldFilevue_type_script_lang_ts.render = FieldFilevue_type_template_id_2903f7cf_render + +/* harmony default export */ var FieldFile = (FieldFilevue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldHidden.vue?vue&type=template&id=1cc21994 + +var FieldHiddenvue_type_template_id_1cc21994_hoisted_1 = ["type", "name", "value"]; +function FieldHiddenvue_type_template_id_1cc21994_render(_ctx, _cache, $props, $setup, $data, $options) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + type: _ctx.uiControl, + name: _ctx.name, + value: _ctx.modelValue, + onChange: _cache[0] || (_cache[0] = function ($event) { + return _ctx.onChange($event); + }) + }, null, 40, FieldHiddenvue_type_template_id_1cc21994_hoisted_1)]); +} +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldHidden.vue?vue&type=template&id=1cc21994 + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldHidden.vue?vue&type=script&lang=ts + +/* harmony default export */ var FieldHiddenvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + modelValue: null, + modelModifiers: Object, + uiControl: String, + name: String + }, + inheritAttrs: false, + emits: ['update:modelValue'], + methods: { + onChange: function onChange(event) { + this.$emit('update:modelValue', event.target.value); + } + } +})); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldHidden.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldHidden.vue + + + +FieldHiddenvue_type_script_lang_ts.render = FieldHiddenvue_type_template_id_1cc21994_render + +/* harmony default export */ var FieldHidden = (FieldHiddenvue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldMultituple.vue?vue&type=template&id=6abda7e4 + +var FieldMultituplevue_type_template_id_6abda7e4_hoisted_1 = { + class: "fieldMultiTuple" +}; +var FieldMultituplevue_type_template_id_6abda7e4_hoisted_2 = ["for", "innerHTML"]; +function FieldMultituplevue_type_template_id_6abda7e4_render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_MultiPairField = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("MultiPairField"); + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", FieldMultituplevue_type_template_id_6abda7e4_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { + for: _ctx.name, + innerHTML: _ctx.$sanitize(_ctx.title) + }, null, 8, FieldMultituplevue_type_template_id_6abda7e4_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_MultiPairField, { + name: _ctx.name, + "model-value": _ctx.modelValue, + "onUpdate:modelValue": _ctx.onUpdateValue, + "model-modifiers": _ctx.modelModifiers, + field1: _ctx.uiControlAttributes.field1, + field2: _ctx.uiControlAttributes.field2, + field3: _ctx.uiControlAttributes.field3, + field4: _ctx.uiControlAttributes.field4 + }, null, 8, ["name", "model-value", "onUpdate:modelValue", "model-modifiers", "field1", "field2", "field3", "field4"])]); +} +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldMultituple.vue?vue&type=template&id=6abda7e4 + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldMultituple.vue?vue&type=script&lang=ts + + +/* harmony default export */ var FieldMultituplevue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + name: String, + title: String, + modelValue: null, + modelModifiers: Object, + uiControlAttributes: Object + }, + inheritAttrs: false, + components: { + MultiPairField: external_CoreHome_["MultiPairField"] + }, + emits: ['update:modelValue'], + methods: { + onUpdateValue: function onUpdateValue(newValue) { + this.$emit('update:modelValue', newValue); + } + } +})); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldMultituple.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldMultituple.vue + + + +FieldMultituplevue_type_script_lang_ts.render = FieldMultituplevue_type_template_id_6abda7e4_render + +/* harmony default export */ var FieldMultituple = (FieldMultituplevue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldNumber.vue?vue&type=template&id=70811ee5 + +var FieldNumbervue_type_template_id_70811ee5_hoisted_1 = ["type", "id", "name", "value"]; +var FieldNumbervue_type_template_id_70811ee5_hoisted_2 = ["for", "innerHTML"]; +function FieldNumbervue_type_template_id_70811ee5_render(_ctx, _cache, $props, $setup, $data, $options) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ + class: "control_".concat(_ctx.uiControl), + type: _ctx.uiControl, + id: _ctx.name, + name: _ctx.name, + value: _ctx.modelValueFormatted, + onKeydown: _cache[0] || (_cache[0] = function ($event) { + return _ctx.onChange($event); + }), + onChange: _cache[1] || (_cache[1] = function ($event) { + return _ctx.onChange($event); + }) + }, _ctx.uiControlAttributes), null, 16, FieldNumbervue_type_template_id_70811ee5_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { + for: _ctx.name, + innerHTML: _ctx.$sanitize(_ctx.title) + }, null, 8, FieldNumbervue_type_template_id_70811ee5_hoisted_2)], 64); +} +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldNumber.vue?vue&type=template&id=70811ee5 + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldNumber.vue?vue&type=script&lang=ts + + +/* harmony default export */ var FieldNumbervue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + uiControl: String, + name: String, + title: String, + modelValue: [Number, String], + modelModifiers: Object, + uiControlAttributes: Object + }, + inheritAttrs: false, + emits: ['update:modelValue'], + created: function created() { + this.onChange = Object(external_CoreHome_["debounce"])(this.onChange.bind(this), 50); + }, + methods: { + onChange: function onChange(event) { + var _this = this; + + var value = parseFloat(event.target.value); + + if (value !== this.modelValue) { + var _this$modelModifiers; + + if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { + this.$emit('update:modelValue', value); + return; + } + + var emitEventData = { + value: value, + abort: function abort() { + if (event.target.value !== _this.modelValueFormatted) { + // change to previous value if the parent component did not update the model value + // (done manually because Vue will not notice if a value does NOT change) + event.target.value = _this.modelValueFormatted; + } + } + }; + this.$emit('update:modelValue', emitEventData); + } + } + }, + mounted: function mounted() { + window.Materialize.updateTextFields(); + }, + watch: { + modelValue: function modelValue() { + setTimeout(function () { + window.Materialize.updateTextFields(); + }); + } + }, + computed: { + modelValueFormatted: function modelValueFormatted() { + return (this.modelValue || '').toString(); + } + } +})); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldNumber.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldNumber.vue + + + +FieldNumbervue_type_script_lang_ts.render = FieldNumbervue_type_template_id_70811ee5_render + +/* harmony default export */ var FieldNumber = (FieldNumbervue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldRadio.vue?vue&type=template&id=5ab171cb + +var FieldRadiovue_type_template_id_5ab171cb_hoisted_1 = { + ref: "root" +}; +var FieldRadiovue_type_template_id_5ab171cb_hoisted_2 = ["value", "id", "name", "disabled", "checked"]; +function FieldRadiovue_type_template_id_5ab171cb_render(_ctx, _cache, $props, $setup, $data, $options) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", FieldRadiovue_type_template_id_5ab171cb_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { + class: "fieldRadioTitle" + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.title), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.title]]), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.availableOptions || [], function (radioModel) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", { + key: radioModel.key, + class: "radio" + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ + value: radioModel.key, + onChange: _cache[0] || (_cache[0] = function ($event) { + return _ctx.onChange($event); + }), + type: "radio", + id: "".concat(_ctx.name).concat(radioModel.key), + name: _ctx.name, + disabled: radioModel.disabled || _ctx.disabled + }, _ctx.uiControlAttributes, { + checked: _ctx.modelValue === radioModel.key || "".concat(_ctx.modelValue) === radioModel.key + }), null, 16, FieldRadiovue_type_template_id_5ab171cb_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(radioModel.value) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "form-description" + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(radioModel.description), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], radioModel.description]])])])]); + }), 128))], 512); +} +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldRadio.vue?vue&type=template&id=5ab171cb + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldRadio.vue?vue&type=script&lang=ts + +/* harmony default export */ var FieldRadiovue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + title: String, + availableOptions: Array, + name: String, + disabled: Boolean, + uiControlAttributes: Object, + modelValue: [String, Number], + modelModifiers: Object + }, + inheritAttrs: false, + emits: ['update:modelValue'], + methods: { + onChange: function onChange(event) { + var _this$modelModifiers, + _this = this; + + if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { + this.$emit('update:modelValue', event.target.value); + return; + } + + var reset = function reset() { + // change to previous value so the parent component can determine if this change should + // go through + _this.$refs.root.querySelectorAll('input').forEach(function (inp, i) { + var _this$availableOption; + + if (!((_this$availableOption = _this.availableOptions) !== null && _this$availableOption !== void 0 && _this$availableOption[i])) { + return; + } + + var key = _this.availableOptions[i].key; + inp.checked = _this.modelValue === key || "".concat(_this.modelValue) === key; + }); + }; + + var emitEventData = { + value: event.target.value, + abort: function abort() { + reset(); + } + }; + this.$emit('update:modelValue', emitEventData); + } + } +})); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldRadio.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldRadio.vue + + + +FieldRadiovue_type_script_lang_ts.render = FieldRadiovue_type_template_id_5ab171cb_render + +/* harmony default export */ var FieldRadio = (FieldRadiovue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldSelect.vue?vue&type=template&id=32fc626c +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || FieldSelectvue_type_template_id_32fc626c_unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { 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 FieldSelectvue_type_template_id_32fc626c_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return FieldSelectvue_type_template_id_32fc626c_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return FieldSelectvue_type_template_id_32fc626c_arrayLikeToArray(o, minLen); } + +function FieldSelectvue_type_template_id_32fc626c_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + +var FieldSelectvue_type_template_id_32fc626c_hoisted_1 = { + key: 0, + class: "matomo-field-select" +}; +var FieldSelectvue_type_template_id_32fc626c_hoisted_2 = ["multiple", "name"]; +var FieldSelectvue_type_template_id_32fc626c_hoisted_3 = ["label"]; +var FieldSelectvue_type_template_id_32fc626c_hoisted_4 = ["value", "selected", "disabled"]; +var FieldSelectvue_type_template_id_32fc626c_hoisted_5 = ["for", "innerHTML"]; +var FieldSelectvue_type_template_id_32fc626c_hoisted_6 = { + key: 1, + class: "matomo-field-select" +}; +var FieldSelectvue_type_template_id_32fc626c_hoisted_7 = ["multiple", "name"]; +var FieldSelectvue_type_template_id_32fc626c_hoisted_8 = ["value", "selected", "disabled"]; +var FieldSelectvue_type_template_id_32fc626c_hoisted_9 = ["for", "innerHTML"]; +function FieldSelectvue_type_template_id_32fc626c_render(_ctx, _cache, $props, $setup, $data, $options) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, [_ctx.groupedOptions ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", FieldSelectvue_type_template_id_32fc626c_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("select", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ + ref: "select", + class: "grouped", + multiple: _ctx.multiple, + name: _ctx.name, + onChange: _cache[0] || (_cache[0] = function ($event) { + return _ctx.onChange($event); + }) + }, _ctx.uiControlAttributes), [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.groupedOptions, function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + group = _ref2[0], + options = _ref2[1]; + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("optgroup", { + key: group, + label: group + }, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(options, function (option) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("option", { + key: option.key, + value: "string:".concat(option.key), + selected: _ctx.multiple ? _ctx.modelValue && _ctx.modelValue.indexOf(option.key) !== -1 : _ctx.modelValue === option.key, + disabled: option.disabled + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(option.value), 9, FieldSelectvue_type_template_id_32fc626c_hoisted_4); + }), 128))], 8, FieldSelectvue_type_template_id_32fc626c_hoisted_3); + }), 128))], 16, FieldSelectvue_type_template_id_32fc626c_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { + for: _ctx.name, + innerHTML: _ctx.$sanitize(_ctx.title) + }, null, 8, FieldSelectvue_type_template_id_32fc626c_hoisted_5)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !_ctx.groupedOptions && _ctx.options ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", FieldSelectvue_type_template_id_32fc626c_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("select", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ + class: "ungrouped", + ref: "select", + multiple: _ctx.multiple, + name: _ctx.name, + onChange: _cache[1] || (_cache[1] = function ($event) { + return _ctx.onChange($event); + }) + }, _ctx.uiControlAttributes), [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.options, function (option) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("option", { + key: option.key, + value: "string:".concat(option.key), + selected: _ctx.multiple ? _ctx.modelValue && _ctx.modelValue.indexOf(option.key) !== -1 : _ctx.modelValue === option.key, + disabled: option.disabled + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(option.value), 9, FieldSelectvue_type_template_id_32fc626c_hoisted_8); + }), 128))], 16, FieldSelectvue_type_template_id_32fc626c_hoisted_7), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { + for: _ctx.name, + innerHTML: _ctx.$sanitize(_ctx.title) + }, null, 8, FieldSelectvue_type_template_id_32fc626c_hoisted_9)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 64); +} +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldSelect.vue?vue&type=template&id=32fc626c + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldSelect.vue?vue&type=script&lang=ts +function FieldSelectvue_type_script_lang_ts_toConsumableArray(arr) { return FieldSelectvue_type_script_lang_ts_arrayWithoutHoles(arr) || FieldSelectvue_type_script_lang_ts_iterableToArray(arr) || FieldSelectvue_type_script_lang_ts_unsupportedIterableToArray(arr) || FieldSelectvue_type_script_lang_ts_nonIterableSpread(); } + +function FieldSelectvue_type_script_lang_ts_nonIterableSpread() { 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 FieldSelectvue_type_script_lang_ts_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function FieldSelectvue_type_script_lang_ts_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return FieldSelectvue_type_script_lang_ts_arrayLikeToArray(arr); } + +function FieldSelectvue_type_script_lang_ts_slicedToArray(arr, i) { return FieldSelectvue_type_script_lang_ts_arrayWithHoles(arr) || FieldSelectvue_type_script_lang_ts_iterableToArrayLimit(arr, i) || FieldSelectvue_type_script_lang_ts_unsupportedIterableToArray(arr, i) || FieldSelectvue_type_script_lang_ts_nonIterableRest(); } + +function FieldSelectvue_type_script_lang_ts_nonIterableRest() { 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 FieldSelectvue_type_script_lang_ts_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return FieldSelectvue_type_script_lang_ts_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return FieldSelectvue_type_script_lang_ts_arrayLikeToArray(o, minLen); } + +function FieldSelectvue_type_script_lang_ts_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function FieldSelectvue_type_script_lang_ts_iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function FieldSelectvue_type_script_lang_ts_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + + + +function initMaterialSelect(select, modelValue, placeholder) { + var uiControlOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + var multiple = arguments.length > 4 ? arguments[4] : undefined; + + if (!select) { + return; + } + + var $select = window.$(select); // reset selected since materialize removes them + + Array.from(select.options).forEach(function (opt) { + if (multiple) { + opt.selected = !!modelValue && modelValue.indexOf(opt.value.replace(/^string:/, '')) !== -1; + } else { + opt.selected = "string:".concat(modelValue) === opt.value; + } + }); + $select.formSelect(uiControlOptions); // add placeholder to input + + if (placeholder) { + var $materialInput = $select.closest('.select-wrapper').find('input'); + $materialInput.attr('placeholder', placeholder); + } +} + +function hasGroupedValues(availableValues) { + if (Array.isArray(availableValues) || !(_typeof(availableValues) === 'object')) { + return false; + } + + return Object.values(availableValues).some(function (v) { + return _typeof(v) === 'object'; + }); +} + +function hasOption(flatValues, key) { + return flatValues.some(function (f) { + return f.key === key; + }); +} + +function FieldSelectvue_type_script_lang_ts_getAvailableOptions(givenAvailableValues, type, uiControlAttributes) { + if (!givenAvailableValues) { + return []; + } + + var hasGroups = true; + var availableValues = givenAvailableValues; + + if (!hasGroupedValues(availableValues)) { + availableValues = { + '': givenAvailableValues + }; + hasGroups = false; + } + + var flatValues = []; + Object.entries(availableValues).forEach(function (_ref) { + var _ref2 = FieldSelectvue_type_script_lang_ts_slicedToArray(_ref, 2), + group = _ref2[0], + values = _ref2[1]; + + Object.entries(values).forEach(function (_ref3) { + var _ref4 = FieldSelectvue_type_script_lang_ts_slicedToArray(_ref3, 2), + valueObjKey = _ref4[0], + value = _ref4[1]; + + if (value && _typeof(value) === 'object' && typeof value.key !== 'undefined') { + flatValues.push(value); + return; + } + + var key = valueObjKey; + + if (type === 'integer' && typeof valueObjKey === 'string') { + key = parseInt(valueObjKey, 10); + } + + flatValues.push({ + group: hasGroups ? group : undefined, + key: key, + value: value + }); + }); + }); // for selects w/ a placeholder, add an option to unset the select + + if (uiControlAttributes !== null && uiControlAttributes !== void 0 && uiControlAttributes.placeholder && !hasOption(flatValues, '')) { + return [{ + key: '', + value: '' + }].concat(flatValues); + } + + return flatValues; +} + +function handleOldAngularJsValues(value) { + if (typeof value === 'string') { + return value.replace(/^string:/, ''); + } + + return value; +} + +/* harmony default export */ var FieldSelectvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + modelValue: null, + modelModifiers: Object, + multiple: Boolean, + name: String, + title: String, + availableOptions: Array, + uiControlAttributes: Object, + uiControlOptions: Object + }, + inheritAttrs: false, + emits: ['update:modelValue'], + computed: { + options: function options() { + // if modelValue is empty, but there is no empty value allowed in availableOptions, + // add one temporarily until something is set + var availableOptions = this.availableOptions; + + if (availableOptions && !hasOption(availableOptions, '') && (typeof this.modelValue === 'undefined' || this.modelValue === null || this.modelValue === '')) { + return [{ + key: '', + value: this.modelValue, + group: this.hasGroups ? '' : undefined + }].concat(FieldSelectvue_type_script_lang_ts_toConsumableArray(availableOptions)); + } + + return availableOptions; + }, + hasGroups: function hasGroups() { + var availableOptions = this.availableOptions; + return availableOptions && availableOptions[0] && typeof availableOptions[0].group !== 'undefined'; + }, + groupedOptions: function groupedOptions() { + var options = this.options; + + if (!this.hasGroups || !options) { + return null; + } + + var groups = {}; + options.forEach(function (entry) { + var group = entry.group; + groups[group] = groups[group] || []; + groups[group].push(entry); + }); + var result = Object.entries(groups); + result.sort(function (lhs, rhs) { + if (lhs[0] < rhs[0]) { + return -1; + } + + if (lhs[0] > rhs[0]) { + return 1; + } + + return 0; + }); + return result; + } + }, + methods: { + onChange: function onChange(event) { + var _this$modelModifiers, + _this = this; + + var element = event.target; + var newValue; + + if (this.multiple) { + newValue = Array.from(element.options).filter(function (e) { + return e.selected; + }).map(function (e) { + return e.value; + }); + newValue = newValue.map(function (x) { + return handleOldAngularJsValues(x); + }); + } else { + newValue = element.value; + newValue = handleOldAngularJsValues(newValue); + } + + if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { + this.$emit('update:modelValue', newValue); + return; + } + + var emitEventData = { + value: newValue, + abort: function abort() { + _this.onModelValueChange(_this.modelValue); + } + }; + this.$emit('update:modelValue', emitEventData); + }, + onModelValueChange: function onModelValueChange(newVal) { + var _this2 = this; + + window.$(this.$refs.select).val(newVal); + setTimeout(function () { + var _this2$uiControlAttri; + + initMaterialSelect(_this2.$refs.select, newVal, (_this2$uiControlAttri = _this2.uiControlAttributes) === null || _this2$uiControlAttri === void 0 ? void 0 : _this2$uiControlAttri.placeholder, _this2.uiControlOptions, _this2.multiple); + }); + } + }, + watch: { + modelValue: function modelValue(newVal) { + this.onModelValueChange(newVal); + }, + 'uiControlAttributes.disabled': { + handler: function handler(newVal, oldVal) { + var _this3 = this; + + setTimeout(function () { + if (newVal !== oldVal) { + var _this3$uiControlAttri; + + initMaterialSelect(_this3.$refs.select, _this3.modelValue, (_this3$uiControlAttri = _this3.uiControlAttributes) === null || _this3$uiControlAttri === void 0 ? void 0 : _this3$uiControlAttri.placeholder, _this3.uiControlOptions, _this3.multiple); + } + }); + } + }, + availableOptions: function availableOptions(newVal, oldVal) { + var _this4 = this; + + if (newVal !== oldVal) { + setTimeout(function () { + var _this4$uiControlAttri; + + initMaterialSelect(_this4.$refs.select, _this4.modelValue, (_this4$uiControlAttri = _this4.uiControlAttributes) === null || _this4$uiControlAttri === void 0 ? void 0 : _this4$uiControlAttri.placeholder, _this4.uiControlOptions, _this4.multiple); + }); + } + } + }, + mounted: function mounted() { + var _this5 = this; + + setTimeout(function () { + var _this5$uiControlAttri; + + initMaterialSelect(_this5.$refs.select, _this5.modelValue, (_this5$uiControlAttri = _this5.uiControlAttributes) === null || _this5$uiControlAttri === void 0 ? void 0 : _this5$uiControlAttri.placeholder, _this5.uiControlOptions, _this5.multiple); + }); + } +})); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldSelect.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldSelect.vue + + + +FieldSelectvue_type_script_lang_ts.render = FieldSelectvue_type_template_id_32fc626c_render + +/* harmony default export */ var FieldSelect = (FieldSelectvue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldSite.vue?vue&type=template&id=4680911e + +var FieldSitevue_type_template_id_4680911e_hoisted_1 = ["for", "innerHTML"]; +var FieldSitevue_type_template_id_4680911e_hoisted_2 = { + class: "sites_autocomplete" +}; +function FieldSitevue_type_template_id_4680911e_render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_SiteSelector = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("SiteSelector"); + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { + for: _ctx.name, + class: "siteSelectorLabel", + innerHTML: _ctx.$sanitize(_ctx.title) + }, null, 8, FieldSitevue_type_template_id_4680911e_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", FieldSitevue_type_template_id_4680911e_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_SiteSelector, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ + "model-value": _ctx.modelValue, + "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { + return _ctx.onChange($event); + }), + id: _ctx.name, + "show-all-sites-item": _ctx.uiControlAttributes.showAllSitesItem || false, + "switch-site-on-select": false, + "show-selected-site": true, + "only-sites-with-admin-access": _ctx.uiControlAttributes.onlySitesWithAdminAccess || false + }, _ctx.uiControlAttributes), null, 16, ["model-value", "id", "show-all-sites-item", "only-sites-with-admin-access"])])]); +} +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldSite.vue?vue&type=template&id=4680911e + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldSite.vue?vue&type=script&lang=ts + + +/* harmony default export */ var FieldSitevue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + name: String, + title: String, + modelValue: Object, + modelModifiers: Object, + uiControlAttributes: Object + }, + inheritAttrs: false, + components: { + SiteSelector: external_CoreHome_["SiteSelector"] + }, + emits: ['update:modelValue'], + methods: { + onChange: function onChange(newValue) { + var _this$modelModifiers; + + if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { + this.$emit('update:modelValue', newValue); + return; + } + + var emitEventData = { + value: newValue, + abort: function abort() {// empty (not necessary to reset anything since the DOM will not change for this UI + // element until modelValue does) + } + }; + this.$emit('update:modelValue', emitEventData); + } + } +})); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldSite.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldSite.vue + + + +FieldSitevue_type_script_lang_ts.render = FieldSitevue_type_template_id_4680911e_render + +/* harmony default export */ var FieldSite = (FieldSitevue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue?vue&type=template&id=518c87fe + +var FieldTextvue_type_template_id_518c87fe_hoisted_1 = ["type", "id", "name", "value"]; +var FieldTextvue_type_template_id_518c87fe_hoisted_2 = ["for", "innerHTML"]; +function FieldTextvue_type_template_id_518c87fe_render(_ctx, _cache, $props, $setup, $data, $options) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ + class: "control_".concat(_ctx.uiControl), + type: _ctx.uiControl, + id: _ctx.name, + name: _ctx.name, + value: _ctx.modelValueText, + onKeydown: _cache[0] || (_cache[0] = function ($event) { + return _ctx.onKeydown($event); + }), + onChange: _cache[1] || (_cache[1] = function ($event) { + return _ctx.onKeydown($event); + }) + }, _ctx.uiControlAttributes), null, 16, FieldTextvue_type_template_id_518c87fe_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { + for: _ctx.name, + innerHTML: _ctx.$sanitize(_ctx.title) + }, null, 8, FieldTextvue_type_template_id_518c87fe_hoisted_2)], 64); +} +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue?vue&type=template&id=518c87fe + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue?vue&type=script&lang=ts + + +/* harmony default export */ var FieldTextvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + title: String, + name: String, + uiControlAttributes: Object, + modelValue: [String, Number], + modelModifiers: Object, + uiControl: String + }, + inheritAttrs: false, + emits: ['update:modelValue'], + computed: { + modelValueText: function modelValueText() { + if (typeof this.modelValue === 'undefined' || this.modelValue === null) { + return ''; + } + + return this.modelValue.toString(); + } + }, + created: function created() { + // debounce because puppeteer types reeaally fast + this.onKeydown = Object(external_CoreHome_["debounce"])(this.onKeydown.bind(this), 50); + }, + mounted: function mounted() { + setTimeout(function () { + window.Materialize.updateTextFields(); + }); + }, + watch: { + modelValue: function modelValue() { + setTimeout(function () { + window.Materialize.updateTextFields(); + }); + } + }, + methods: { + onKeydown: function onKeydown(event) { + var _this = this; + + var newValue = event.target.value; + + if (this.modelValue !== newValue) { + var _this$modelModifiers; + + if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { + this.$emit('update:modelValue', newValue); + return; + } + + var emitEventData = { + value: newValue, + abort: function abort() { + // change to previous value if the parent component did not update the model value + // (done manually because Vue will not notice if a value does NOT change) + if (event.target.value !== _this.modelValueText) { + event.target.value = _this.modelValueText; + } + } + }; + this.$emit('update:modelValue', emitEventData); + } + } + } +})); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue + + + +FieldTextvue_type_script_lang_ts.render = FieldTextvue_type_template_id_518c87fe_render + +/* harmony default export */ var FieldText = (FieldTextvue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue?vue&type=template&id=72853163 + +var FieldTextArrayvue_type_template_id_72853163_hoisted_1 = ["for", "innerHTML"]; +var FieldTextArrayvue_type_template_id_72853163_hoisted_2 = ["type", "name", "value"]; +function FieldTextArrayvue_type_template_id_72853163_render(_ctx, _cache, $props, $setup, $data, $options) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { + for: _ctx.name, + innerHTML: _ctx.$sanitize(_ctx.title) + }, null, 8, FieldTextArrayvue_type_template_id_72853163_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ + class: "control_".concat(_ctx.uiControl), + type: _ctx.uiControl, + name: _ctx.name, + onKeydown: _cache[0] || (_cache[0] = function ($event) { + return _ctx.onKeydown($event); + }), + onChange: _cache[1] || (_cache[1] = function ($event) { + return _ctx.onKeydown($event); + }), + value: _ctx.concattedValues + }, _ctx.uiControlAttributes), null, 16, FieldTextArrayvue_type_template_id_72853163_hoisted_2)]); +} +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue?vue&type=template&id=72853163 + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue?vue&type=script&lang=ts + + +/* harmony default export */ var FieldTextArrayvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + name: String, + title: String, + uiControl: String, + modelValue: Array, + modelModifiers: Object, + uiControlAttributes: Object + }, + inheritAttrs: false, + computed: { + concattedValues: function concattedValues() { + if (typeof this.modelValue === 'string') { + return this.modelValue; + } + + return (this.modelValue || []).join(', '); + } + }, + emits: ['update:modelValue'], + created: function created() { + // debounce because puppeteer types reeaally fast + this.onKeydown = Object(external_CoreHome_["debounce"])(this.onKeydown.bind(this), 50); + }, + methods: { + onKeydown: function onKeydown(event) { + var _this = this; + + var values = event.target.value.split(',').map(function (v) { + return v.trim(); + }); + + if (values.join(', ') !== this.concattedValues) { + var _this$modelModifiers; + + if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { + this.$emit('update:modelValue', values); + return; + } + + var emitEventData = { + value: values, + abort: function abort() { + if (event.target.value !== _this.concattedValues) { + event.target.value = _this.concattedValues; + } + } + }; + this.$emit('update:modelValue', emitEventData); + } + } + } +})); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue + + + +FieldTextArrayvue_type_script_lang_ts.render = FieldTextArrayvue_type_template_id_72853163_render + +/* harmony default export */ var FieldTextArray = (FieldTextArrayvue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextarea.vue?vue&type=template&id=f0327bcc + +var FieldTextareavue_type_template_id_f0327bcc_hoisted_1 = ["name", "id", "value"]; +var FieldTextareavue_type_template_id_f0327bcc_hoisted_2 = ["for", "innerHTML"]; +function FieldTextareavue_type_template_id_f0327bcc_render(_ctx, _cache, $props, $setup, $data, $options) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("textarea", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ + name: _ctx.name + }, _ctx.uiControlAttributes, { + id: _ctx.name, + value: _ctx.modelValueText, + onKeydown: _cache[0] || (_cache[0] = function ($event) { + return _ctx.onKeydown($event); + }), + onChange: _cache[1] || (_cache[1] = function ($event) { + return _ctx.onKeydown($event); + }), + class: "materialize-textarea", + ref: "textarea" + }), null, 16, FieldTextareavue_type_template_id_f0327bcc_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { + for: _ctx.name, + innerHTML: _ctx.$sanitize(_ctx.title) + }, null, 8, FieldTextareavue_type_template_id_f0327bcc_hoisted_2)], 64); +} +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextarea.vue?vue&type=template&id=f0327bcc + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextarea.vue?vue&type=script&lang=ts + + +/* harmony default export */ var FieldTextareavue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + name: String, + uiControlAttributes: Object, + modelValue: String, + modelModifiers: Object, + title: String + }, + inheritAttrs: false, + emits: ['update:modelValue'], + created: function created() { + this.onKeydown = Object(external_CoreHome_["debounce"])(this.onKeydown.bind(this), 50); + }, + methods: { + onKeydown: function onKeydown(event) { + var _this = this; + + var newValue = event.target.value; + + if (newValue !== this.modelValue) { + var _this$modelModifiers; + + if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { + this.$emit('update:modelValue', newValue); + return; + } + + var emitEventData = { + value: newValue, + abort: function abort() { + if (event.target.value !== _this.modelValue) { + event.target.value = _this.modelValueText; + } + } + }; + this.$emit('update:modelValue', emitEventData); + } + } + }, + computed: { + modelValueText: function modelValueText() { + return this.modelValue || ''; + } + }, + watch: { + modelValue: function modelValue() { + var _this2 = this; + + setTimeout(function () { + window.Materialize.textareaAutoResize(_this2.$refs.textarea); + window.Materialize.updateTextFields(); + }); + } + }, + mounted: function mounted() { + var _this3 = this; + + setTimeout(function () { + window.Materialize.textareaAutoResize(_this3.$refs.textarea); + window.Materialize.updateTextFields(); + }); + } +})); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextarea.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextarea.vue + + + +FieldTextareavue_type_script_lang_ts.render = FieldTextareavue_type_template_id_f0327bcc_render + +/* harmony default export */ var FieldTextarea = (FieldTextareavue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue?vue&type=template&id=72695c4b + +var FieldTextareaArrayvue_type_template_id_72695c4b_hoisted_1 = ["for", "innerHTML"]; +var FieldTextareaArrayvue_type_template_id_72695c4b_hoisted_2 = ["name", "value"]; +function FieldTextareaArrayvue_type_template_id_72695c4b_render(_ctx, _cache, $props, $setup, $data, $options) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", { + for: _ctx.name, + innerHTML: _ctx.$sanitize(_ctx.title) + }, null, 8, FieldTextareaArrayvue_type_template_id_72695c4b_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("textarea", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ + ref: "textarea", + name: _ctx.name + }, _ctx.uiControlAttributes, { + value: _ctx.concattedValue, + onKeydown: _cache[0] || (_cache[0] = function ($event) { + return _ctx.onKeydown($event); + }), + onChange: _cache[1] || (_cache[1] = function ($event) { + return _ctx.onKeydown($event); + }), + class: "materialize-textarea" + }), null, 16, FieldTextareaArrayvue_type_template_id_72695c4b_hoisted_2)]); +} +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue?vue&type=template&id=72695c4b + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue?vue&type=script&lang=ts + + +var SEPARATOR = '\n'; +/* harmony default export */ var FieldTextareaArrayvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + name: String, + title: String, + uiControlAttributes: Object, + modelValue: [Array, String], + modelModifiers: Object + }, + inheritAttrs: false, + emits: ['update:modelValue'], + computed: { + concattedValue: function concattedValue() { + if (typeof this.modelValue === 'string') { + return this.modelValue; + } + + return (this.modelValue || []).join(SEPARATOR); + } + }, + created: function created() { + this.onKeydown = Object(external_CoreHome_["debounce"])(this.onKeydown.bind(this), 50); + }, + methods: { + onKeydown: function onKeydown(event) { + var _this = this; + + var value = event.target.value.split(SEPARATOR); + + if (value.join(SEPARATOR) !== this.concattedValue) { + var _this$modelModifiers; + + if (!((_this$modelModifiers = this.modelModifiers) !== null && _this$modelModifiers !== void 0 && _this$modelModifiers.abortable)) { + this.$emit('update:modelValue', value); + return; + } + + var emitEventData = { + value: value, + abort: function abort() { + if (event.target.value !== _this.concattedValue) { + // change to previous value if the parent component did not update the model value + // (done manually because Vue will not notice if a value does NOT change) + event.target.value = _this.concattedValue; + } + } + }; + this.$emit('update:modelValue', emitEventData); + } + } + }, + watch: { + modelValue: function modelValue(newVal, oldVal) { + var _this2 = this; + + if (newVal !== oldVal) { + setTimeout(function () { + if (_this2.$refs.textarea) { + window.Materialize.textareaAutoResize(_this2.$refs.textarea); + } + + window.Materialize.updateTextFields(); + }); + } + } + }, + mounted: function mounted() { + var _this3 = this; + + setTimeout(function () { + if (_this3.$refs.textarea) { + window.Materialize.textareaAutoResize(_this3.$refs.textarea); + } + + window.Materialize.updateTextFields(); + }); + } +})); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue + + + +FieldTextareaArrayvue_type_script_lang_ts.render = FieldTextareaArrayvue_type_template_id_72695c4b_render + +/* harmony default export */ var FieldTextareaArray = (FieldTextareaArrayvue_type_script_lang_ts); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/utilities.ts +function utilities_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { utilities_typeof = function _typeof(obj) { return typeof obj; }; } else { utilities_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return utilities_typeof(obj); } + +function utilities_slicedToArray(arr, i) { return utilities_arrayWithHoles(arr) || utilities_iterableToArrayLimit(arr, i) || utilities_unsupportedIterableToArray(arr, i) || utilities_nonIterableRest(); } + +function utilities_nonIterableRest() { 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 utilities_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return utilities_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return utilities_arrayLikeToArray(o, minLen); } + +function utilities_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function utilities_iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function utilities_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +function processCheckboxAndRadioAvailableValues(availableValues, type) { + if (!availableValues) { + return []; + } + + var flatValues = []; + Object.entries(availableValues).forEach(function (_ref) { + var _ref2 = utilities_slicedToArray(_ref, 2), + valueObjKey = _ref2[0], + value = _ref2[1]; + + if (value && utilities_typeof(value) === 'object' && typeof value.key !== 'undefined') { + flatValues.push(value); + return; + } + + var key = valueObjKey; + + if (type === 'integer' && typeof valueObjKey === 'string') { + key = parseInt(key, 10); + } + + flatValues.push({ + key: key, + value: value + }); + }); + return flatValues; +} +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FormField.vue?vue&type=script&lang=ts +function FormFieldvue_type_script_lang_ts_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FormFieldvue_type_script_lang_ts_typeof = function _typeof(obj) { return typeof obj; }; } else { FormFieldvue_type_script_lang_ts_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FormFieldvue_type_script_lang_ts_typeof(obj); } + + + + + + + + + + + + + + + + + + + +var TEXT_CONTROLS = ['password', 'url', 'search', 'email']; +var CONTROLS_SUPPORTING_ARRAY = ['textarea', 'checkbox', 'text']; +var CONTROL_TO_COMPONENT_MAP = { + checkbox: 'FieldCheckbox', + 'expandable-select': 'FieldExpandableSelect', + 'field-array': 'FieldFieldArray', + file: 'FieldFile', + hidden: 'FieldHidden', + multiselect: 'FieldSelect', + multituple: 'FieldMultituple', + number: 'FieldNumber', + radio: 'FieldRadio', + select: 'FieldSelect', + site: 'FieldSite', + text: 'FieldText', + textarea: 'FieldTextarea' +}; +var CONTROL_TO_AVAILABLE_OPTION_PROCESSOR = { + FieldSelect: FieldSelectvue_type_script_lang_ts_getAvailableOptions, + FieldCheckboxArray: processCheckboxAndRadioAvailableValues, + FieldRadio: processCheckboxAndRadioAvailableValues, + FieldExpandableSelect: getAvailableOptions +}; +/* harmony default export */ var FormFieldvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + modelValue: null, + modelModifiers: Object, + formField: { + type: Object, + required: true + } + }, + emits: ['update:modelValue'], + components: { + FieldCheckbox: FieldCheckbox, + FieldCheckboxArray: FieldCheckboxArray, + FieldExpandableSelect: FieldExpandableSelect, + FieldFieldArray: FieldFieldArray, + FieldFile: FieldFile, + FieldHidden: FieldHidden, + FieldMultituple: FieldMultituple, + FieldNumber: FieldNumber, + FieldRadio: FieldRadio, + FieldSelect: FieldSelect, + FieldSite: FieldSite, + FieldText: FieldText, + FieldTextArray: FieldTextArray, + FieldTextarea: FieldTextarea, + FieldTextareaArray: FieldTextareaArray + }, + setup: function setup(props) { + var inlineHelpNode = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(null); + + var setInlineHelp = function setInlineHelp(newVal) { + var toAppend; + + if (!newVal || !inlineHelpNode.value || typeof newVal.render === 'function') { + return; + } + + if (typeof newVal === 'string') { + if (newVal.indexOf('#') === 0) { + toAppend = window.$(newVal); + } else { + toAppend = window.vueSanitize(newVal); + } + } else { + toAppend = newVal; + } + + window.$(inlineHelpNode.value).html('').append(toAppend); + }; + + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["watch"])(function () { + return props.formField.inlineHelp; + }, setInlineHelp); + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["onMounted"])(function () { + setInlineHelp(props.formField.inlineHelp); + }); + return { + inlineHelp: inlineHelpNode + }; + }, + computed: { + inlineHelpComponent: function inlineHelpComponent() { + var formField = this.formField; + var inlineHelpRecord = formField.inlineHelp; + + if (inlineHelpRecord && typeof inlineHelpRecord.render === 'function') { + return formField.inlineHelp; + } + + return undefined; + }, + inlineHelpBind: function inlineHelpBind() { + return this.inlineHelpComponent ? this.formField.inlineHelpBind : undefined; + }, + childComponent: function childComponent() { + var formField = this.formField; + + if (formField.component) { + var component = formField.component; + + if (formField.component.plugin) { + var _formField$component = formField.component, + plugin = _formField$component.plugin, + name = _formField$component.name; + + if (!plugin || !name) { + throw new Error('Invalid component property given to FormField directive, must be ' + '{plugin: \'...\',name: \'...\'}'); + } + + component = Object(external_CoreHome_["useExternalPluginComponent"])(plugin, name); + } + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["markRaw"])(component); + } + + var uiControl = formField.uiControl; + var control = CONTROL_TO_COMPONENT_MAP[uiControl]; + + if (TEXT_CONTROLS.indexOf(uiControl) !== -1) { + control = 'FieldText'; // we use same template for text and password both + } + + if (this.formField.type === 'array' && CONTROLS_SUPPORTING_ARRAY.indexOf(uiControl) !== -1) { + control = "".concat(control, "Array"); + } + + return control; + }, + extraChildComponentParams: function extraChildComponentParams() { + if (this.formField.uiControl === 'multiselect') { + return { + multiple: true + }; + } + + return {}; + }, + showFormHelp: function showFormHelp() { + return this.formField.description || this.formField.inlineHelp || this.showDefaultValue || this.hasInlineHelpSlot; + }, + showDefaultValue: function showDefaultValue() { + return this.defaultValuePretty && this.formField.uiControl !== 'checkbox' && this.formField.uiControl !== 'radio'; + }, + + /** + * @deprecated here for angularjs BC support. shouldn't be used directly, instead use + * GroupedSetting.vue. + */ + showField: function showField() { + if (!this.formField || !this.formField.condition || !(this.formField.condition instanceof Function)) { + return true; + } + + return this.formField.condition(); + }, + processedModelValue: function processedModelValue() { + var field = this.formField; // convert boolean values since angular 1.6 uses strict equals when determining if a model + // value matches the ng-value of an input. + + if (field.type === 'boolean') { + var valueIsTruthy = this.modelValue && this.modelValue > 0 && this.modelValue !== '0'; // for checkboxes, the value MUST be either true or false + + if (field.uiControl === 'checkbox') { + return valueIsTruthy; + } + + if (field.uiControl === 'radio') { + return valueIsTruthy ? '1' : '0'; + } + } + + return this.modelValue; + }, + defaultValue: function defaultValue() { + var defaultValue = this.formField.defaultValue; + + if (Array.isArray(defaultValue)) { + return defaultValue.join(','); + } + + return defaultValue; + }, + availableOptions: function availableOptions() { + var childComponent = this.childComponent; + + if (typeof childComponent !== 'string') { + return null; + } + + var formField = this.formField; + + if (!formField.availableValues || !CONTROL_TO_AVAILABLE_OPTION_PROCESSOR[childComponent]) { + return null; + } + + return CONTROL_TO_AVAILABLE_OPTION_PROCESSOR[childComponent](formField.availableValues, formField.type, formField.uiControlAttributes); + }, + defaultValuePretty: function defaultValuePretty() { + var formField = this.formField; + var defaultValue = formField.defaultValue; + var availableOptions = this.availableOptions; + + if (typeof defaultValue === 'string' && defaultValue) { + // eg default value for multi tuple + var defaultParsed = null; + + try { + defaultParsed = JSON.parse(defaultValue); + } catch (e) {// invalid JSON + } + + if (defaultParsed !== null && FormFieldvue_type_script_lang_ts_typeof(defaultParsed) === 'object') { + return ''; + } + } + + if (!Array.isArray(availableOptions)) { + if (Array.isArray(defaultValue)) { + return ''; + } + + return defaultValue ? "".concat(defaultValue) : ''; + } + + var prettyValues = []; + + if (!Array.isArray(defaultValue)) { + defaultValue = [defaultValue]; + } + + (availableOptions || []).forEach(function (value) { + if (typeof value.value !== 'undefined' && defaultValue.indexOf(value.key) !== -1) { + prettyValues.push(value.value); + } + }); + return prettyValues.join(', '); + }, + defaultValuePrettyTruncated: function defaultValuePrettyTruncated() { + return this.defaultValuePretty.substring(0, 50); + }, + hasInlineHelpSlot: function hasInlineHelpSlot() { + var _inlineHelpSlot$, _inlineHelpSlot$$chil; + + if (!this.$slots['inline-help']) { + return false; + } + + var inlineHelpSlot = this.$slots['inline-help'](); + return !!(inlineHelpSlot !== null && inlineHelpSlot !== void 0 && (_inlineHelpSlot$ = inlineHelpSlot[0]) !== null && _inlineHelpSlot$ !== void 0 && (_inlineHelpSlot$$chil = _inlineHelpSlot$.children) !== null && _inlineHelpSlot$$chil !== void 0 && _inlineHelpSlot$$chil.length); + } + }, + methods: { + onChange: function onChange(newValue) { + this.$emit('update:modelValue', newValue); + } + } +})); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FormField.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FormField.vue + + + +FormFieldvue_type_script_lang_ts.render = render + +/* harmony default export */ var FormField = (FormFieldvue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/Field/Field.vue?vue&type=template&id=85ce424c + +function Fieldvue_type_template_id_85ce424c_render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_FormField = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("FormField"); + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_FormField, { + "form-field": _ctx.field, + "model-value": _ctx.modelValue, + "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { + return _ctx.onChange($event); + }), + "model-modifiers": _ctx.modelModifiers + }, { + "inline-help": Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "inline-help")]; + }), + _: 3 + }, 8, ["form-field", "model-value", "model-modifiers"]); +} +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Field/Field.vue?vue&type=template&id=85ce424c + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/Field/Field.vue?vue&type=script&lang=ts + + +var UI_CONTROLS_TO_TYPE = { + multiselect: 'array', + checkbox: 'boolean', + site: 'object', + number: 'integer' +}; +/* harmony default export */ var Fieldvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + modelValue: null, + modelModifiers: Object, + uicontrol: String, + name: String, + defaultValue: null, + options: [Object, Array], + description: String, + introduction: String, + title: String, + inlineHelp: [String, Object], + inlineHelpBind: Object, + disabled: Boolean, + uiControlAttributes: { + type: Object, + default: function _default() { + return {}; + } + }, + uiControlOptions: { + type: Object, + default: function _default() { + return {}; + } + }, + autocomplete: Boolean, + condition: Function, + varType: String, + autofocus: Boolean, + tabindex: Number, + fullWidth: Boolean, + maxlength: Number, + required: Boolean, + placeholder: String, + rows: Number, + min: Number, + max: Number, + component: null, + templateFile: String + }, + emits: ['update:modelValue'], + components: { + FormField: FormField + }, + computed: { + type: function type() { + if (this.varType) { + return this.varType; + } + + var uicontrol = this.uicontrol; + + if (uicontrol && UI_CONTROLS_TO_TYPE[uicontrol]) { + return UI_CONTROLS_TO_TYPE[uicontrol]; + } + + return 'string'; + }, + field: function field() { + return { + uiControl: this.uicontrol, + type: this.type, + name: this.name, + defaultValue: this.defaultValue, + availableValues: this.options, + description: this.description, + introduction: this.introduction, + inlineHelp: this.inlineHelp, + inlineHelpBind: this.inlineHelpBind, + title: this.title, + component: this.component, + templateFile: this.templateFile, + uiControlAttributes: Object.assign(Object.assign({}, this.uiControlAttributes), {}, { + disabled: this.disabled, + autocomplete: this.autocomplete, + tabindex: this.tabindex, + autofocus: this.autofocus, + rows: this.rows, + required: this.required, + maxlength: this.maxlength, + placeholder: this.placeholder, + min: this.min, + max: this.max + }), + fullWidth: this.fullWidth, + uiControlOptions: this.uiControlOptions + }; + } + }, + methods: { + onChange: function onChange(newValue) { + this.$emit('update:modelValue', newValue); + } + } +})); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Field/Field.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Field/Field.vue + + + +Fieldvue_type_script_lang_ts.render = Fieldvue_type_template_id_85ce424c_render + +/* harmony default export */ var Field = (Fieldvue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/PluginSettings/PluginSettings.vue?vue&type=template&id=a041fcc8 + +var PluginSettingsvue_type_template_id_a041fcc8_hoisted_1 = { + class: "pluginSettings", + ref: "root" +}; +var PluginSettingsvue_type_template_id_a041fcc8_hoisted_2 = ["id"]; +var PluginSettingsvue_type_template_id_a041fcc8_hoisted_3 = { + class: "card-content" +}; +var PluginSettingsvue_type_template_id_a041fcc8_hoisted_4 = ["id"]; +var PluginSettingsvue_type_template_id_a041fcc8_hoisted_5 = ["onClick", "disabled", "value"]; +function PluginSettingsvue_type_template_id_a041fcc8_render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_GroupedSettings = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("GroupedSettings"); + + var _component_ActivityIndicator = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ActivityIndicator"); + + var _component_PasswordConfirmation = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("PasswordConfirmation"); + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", PluginSettingsvue_type_template_id_a041fcc8_hoisted_1, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.settingsPerPlugin, function (settings) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { + class: "card", + id: "".concat(settings.pluginName, "PluginSettings"), + key: "".concat(settings.pluginName, "PluginSettings") + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PluginSettingsvue_type_template_id_a041fcc8_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", { + class: "card-title", + id: settings.pluginName + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(settings.title), 9, PluginSettingsvue_type_template_id_a041fcc8_hoisted_4), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_GroupedSettings, { + "group-name": settings.pluginName, + settings: settings.settings, + "all-setting-values": _ctx.settingValues, + onChange: function onChange($event) { + return _ctx.settingValues["".concat(settings.pluginName, ".").concat($event.name)] = $event.value; + } + }, null, 8, ["group-name", "settings", "all-setting-values", "onChange"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + type: "button", + onClick: function onClick($event) { + return _ctx.saveSetting(settings.pluginName); + }, + disabled: _ctx.isLoading, + class: "pluginsSettingsSubmit btn", + value: _ctx.translate('General_Save') + }, null, 8, PluginSettingsvue_type_template_id_a041fcc8_hoisted_5), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ActivityIndicator, { + loading: _ctx.isLoading || _ctx.isSaving[settings.pluginName] + }, null, 8, ["loading"])])], 8, PluginSettingsvue_type_template_id_a041fcc8_hoisted_2); + }), 128)), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_PasswordConfirmation, { + modelValue: _ctx.showPasswordConfirmModal, + "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { + return _ctx.showPasswordConfirmModal = $event; + }), + onConfirmed: _ctx.confirmPassword + }, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ConfirmWithPassword')), 1)]; + }), + _: 1 + }, 8, ["modelValue", "onConfirmed"])], 512); +} +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/PluginSettings/PluginSettings.vue?vue&type=template&id=a041fcc8 + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/GroupedSettings/GroupedSettings.vue?vue&type=template&id=566a93cc + +function GroupedSettingsvue_type_template_id_566a93cc_render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_GroupedSetting = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("GroupedSetting"); + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.settings, function (setting) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { + key: "".concat(_ctx.groupPrefix).concat(setting.name) + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_GroupedSetting, { + "model-value": _ctx.allSettingValues["".concat(_ctx.groupPrefix).concat(setting.name)], + "onUpdate:modelValue": function onUpdateModelValue($event) { + return _ctx.$emit('change', { + name: setting.name, + value: $event + }); + }, + setting: setting, + "condition-values": _ctx.settingValues + }, null, 8, ["model-value", "onUpdate:modelValue", "setting", "condition-values"])]); + }), 128); +} +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/GroupedSettings/GroupedSettings.vue?vue&type=template&id=566a93cc + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/GroupedSettings/GroupedSetting.vue?vue&type=template&id=cfc59e1e + +function GroupedSettingvue_type_template_id_cfc59e1e_render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_FormField = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("FormField"); + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_FormField, { + "model-value": _ctx.modelValue, + "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { + return _ctx.changeValue($event); + }), + "form-field": _ctx.setting + }, null, 8, ["model-value", "form-field"])], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showField]]); +} +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/GroupedSettings/GroupedSetting.vue?vue&type=template&id=cfc59e1e + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/GroupedSettings/GroupedSetting.vue?vue&type=script&lang=ts @@ -17824,16 +17379,6 @@ expressions_math.import({ }, emits: ['update:modelValue'], computed: { - // bc for angularjs field that uses templateFile - settingWithComponent: function settingWithComponent() { - if (this.setting.templateFile) { - return Object.assign(Object.assign({}, this.setting), {}, { - component: FieldAngularJsTemplate - }); - } - - return this.setting; - }, showField: function showField() { var condition = this.setting.condition; @@ -17867,7 +17412,7 @@ expressions_math.import({ -GroupedSettingvue_type_script_lang_ts.render = GroupedSettingvue_type_template_id_b2e643bc_render +GroupedSettingvue_type_script_lang_ts.render = GroupedSettingvue_type_template_id_cfc59e1e_render /* harmony default export */ var GroupedSetting = (GroupedSettingvue_type_script_lang_ts); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/GroupedSettings/GroupedSettings.vue?vue&type=script&lang=ts @@ -18133,7 +17678,7 @@ var PluginSettingsvue_type_script_lang_ts_window = window, _this.settingValues["".concat(settings.pluginName, ".").concat(setting.name)] = setting.value; }); }); - window.anchorLinkFix.scrollToAnchorInUrl(); + Object(external_CoreHome_["scrollToAnchorInUrl"])(); _this.addSectionsToTableOfContents(); }).catch(function () { @@ -18257,155 +17802,9 @@ var PluginSettingsvue_type_script_lang_ts_window = window, -PluginSettingsvue_type_script_lang_ts.render = PluginSettingsvue_type_template_id_4f2694bf_render +PluginSettingsvue_type_script_lang_ts.render = PluginSettingsvue_type_template_id_a041fcc8_render /* harmony default export */ var PluginSettings = (PluginSettingsvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/PluginSettings/PluginSettings.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 - */ - - -/* harmony default export */ var PluginSettings_adapter = (Object(external_CoreHome_["createAngularJsAdapter"])({ - component: PluginSettings, - scope: { - mode: { - angularJsBind: '@' - } - }, - directiveName: 'piwikPluginSettings' -})); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Plugins/PluginManagement.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 PluginManagement_window = window, - PluginManagement_$ = PluginManagement_window.$; - -function onClickUninstall(binding, event) { - event.preventDefault(); - var link = PluginManagement_$(event.target).attr('href'); - var pluginName = PluginManagement_$(event.target).attr('data-plugin-name'); - - if (!link || !pluginName) { - return; - } - - if (!binding.value.uninstallConfirmMessage) { - binding.value.uninstallConfirmMessage = PluginManagement_$('#uninstallPluginConfirm').text(); - } - - var messageToDisplay = (binding.value.uninstallConfirmMessage || '').replace('%s', pluginName); - PluginManagement_$('#uninstallPluginConfirm').text(messageToDisplay); - external_CoreHome_["Matomo"].helper.modalConfirm('#confirmUninstallPlugin', { - yes: function yes() { - window.location.href = link; - } - }); -} - -function onDonateLinkClick(event) { - event.preventDefault(); - var overlayId = PluginManagement_$(event.target).data('overlay-id'); - external_CoreHome_["Matomo"].helper.modalConfirm("#".concat(overlayId), {}); -} - -/* harmony default export */ var PluginManagement = ({ - mounted: function mounted(el, binding) { - setTimeout(function () { - binding.value.uninstallConfirmMessage = ''; - PluginManagement_$(el).find('.uninstall').click(onClickUninstall.bind(null, binding)); - PluginManagement_$(el).find('.plugin-donation-link').click(onDonateLinkClick); - }); - } -}); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Plugins/PluginManagement.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 piwikPluginManagement() { - return { - restrict: 'A', - link: function expandOnClickLink(scope, element) { - var binding = { - instance: null, - value: {}, - oldValue: null, - modifiers: {}, - dir: {} - }; - PluginManagement.mounted(element[0], binding); - } - }; -} -window.angular.module('piwikApp').directive('piwikPluginManagement', piwikPluginManagement); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Plugins/PluginUpload.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 PluginUpload_window = window, - PluginUpload_$ = PluginUpload_window.$; - -function onUploadPlugin(event) { - event.preventDefault(); - external_CoreHome_["Matomo"].helper.modalConfirm('#installPluginByUpload', {}); -} - -function onSubmitPlugin(event) { - var $zipFile = PluginUpload_$('[name=pluginZip]'); - var fileName = $zipFile.val(); - - if (!fileName || fileName.slice(-4) !== '.zip') { - event.preventDefault(); // eslint-disable-next-line no-alert - - alert(Object(external_CoreHome_["translate"])('CorePluginsAdmin_NoZipFileSelected')); - } else if ($zipFile.data('maxSize') > 0 && $zipFile[0].files[0].size > $zipFile.data('maxSize') * 1048576) { - event.preventDefault(); // eslint-disable-next-line no-alert - - alert(Object(external_CoreHome_["translate"])('CorePluginsAdmin_FileExceedsUploadLimit')); - } -} - -/* harmony default export */ var PluginUpload = ({ - mounted: function mounted() { - setTimeout(function () { - PluginUpload_$('.uploadPlugin').click(onUploadPlugin); - PluginUpload_$('#uploadPluginForm').submit(onSubmitPlugin); - }); - } -}); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Plugins/PluginUpload.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 piwikPluginUpload() { - return { - restrict: 'A', - link: function expandOnClickLink() { - PluginUpload.mounted(); - } - }; -} -window.angular.module('piwikApp').directive('piwikPluginUpload', piwikPluginUpload); // CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Plugins/PluginFilter.ts /*! * Matomo - free/libre analytics platform @@ -18492,7 +17891,7 @@ function onClickOrigin(element, event) { }); } }); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Plugins/PluginFilter.adapter.ts +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Plugins/PluginManagement.ts /*! * Matomo - free/libre analytics platform * @@ -18500,15 +17899,85 @@ function onClickOrigin(element, event) { * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function piwikPluginFilter() { - return { - restrict: 'A', - link: function expandOnClickLink(scope, element) { - PluginFilter.mounted(element[0]); +var PluginManagement_window = window, + PluginManagement_$ = PluginManagement_window.$; + +function onClickUninstall(binding, event) { + event.preventDefault(); + var link = PluginManagement_$(event.target).attr('href'); + var pluginName = PluginManagement_$(event.target).attr('data-plugin-name'); + + if (!link || !pluginName) { + return; + } + + if (!binding.value.uninstallConfirmMessage) { + binding.value.uninstallConfirmMessage = PluginManagement_$('#uninstallPluginConfirm').text(); + } + + var messageToDisplay = (binding.value.uninstallConfirmMessage || '').replace('%s', pluginName); + PluginManagement_$('#uninstallPluginConfirm').text(messageToDisplay); + external_CoreHome_["Matomo"].helper.modalConfirm('#confirmUninstallPlugin', { + yes: function yes() { + window.location.href = link; } - }; + }); } -window.angular.module('piwikApp').directive('piwikPluginFilter', piwikPluginFilter); + +function onDonateLinkClick(event) { + event.preventDefault(); + var overlayId = PluginManagement_$(event.target).data('overlay-id'); + external_CoreHome_["Matomo"].helper.modalConfirm("#".concat(overlayId), {}); +} + +/* harmony default export */ var PluginManagement = ({ + mounted: function mounted(el, binding) { + setTimeout(function () { + binding.value.uninstallConfirmMessage = ''; + PluginManagement_$(el).find('.uninstall').click(onClickUninstall.bind(null, binding)); + PluginManagement_$(el).find('.plugin-donation-link').click(onDonateLinkClick); + }); + } +}); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Plugins/PluginUpload.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 PluginUpload_window = window, + PluginUpload_$ = PluginUpload_window.$; + +function onUploadPlugin(event) { + event.preventDefault(); + external_CoreHome_["Matomo"].helper.modalConfirm('#installPluginByUpload', {}); +} + +function onSubmitPlugin(event) { + var $zipFile = PluginUpload_$('[name=pluginZip]'); + var fileName = $zipFile.val(); + + if (!fileName || fileName.slice(-4) !== '.zip') { + event.preventDefault(); // eslint-disable-next-line no-alert + + alert(Object(external_CoreHome_["translate"])('CorePluginsAdmin_NoZipFileSelected')); + } else if ($zipFile.data('maxSize') > 0 && $zipFile[0].files[0].size > $zipFile.data('maxSize') * 1048576) { + event.preventDefault(); // eslint-disable-next-line no-alert + + alert(Object(external_CoreHome_["translate"])('CorePluginsAdmin_FileExceedsUploadLimit')); + } +} + +/* harmony default export */ var PluginUpload = ({ + mounted: function mounted() { + setTimeout(function () { + PluginUpload_$('.uploadPlugin').click(onUploadPlugin); + PluginUpload_$('#uploadPluginForm').submit(onSubmitPlugin); + }); + } +}); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/SaveButton/SaveButton.vue?vue&type=template&id=1e391ba1 var SaveButtonvue_type_template_id_1e391ba1_hoisted_1 = { @@ -18563,43 +18032,6 @@ function SaveButtonvue_type_template_id_1e391ba1_render(_ctx, _cache, $props, $s SaveButtonvue_type_script_lang_ts.render = SaveButtonvue_type_template_id_1e391ba1_render /* harmony default export */ var SaveButton = (SaveButtonvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/SaveButton/SaveButton.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 - */ - - -/* harmony default export */ var SaveButton_adapter = (Object(external_CoreHome_["createAngularJsAdapter"])({ - component: SaveButton, - scope: { - saving: { - angularJsBind: '=?' - }, - value: { - angularJsBind: '@?' - }, - disabled: { - angularJsBind: '=?' - }, - onconfirm: { - angularJsBind: '&?', - vue: 'confirm' - } - }, - events: { - confirm: function confirm($event, vm, scope, element, attrs, controller, $timeout) { - element[0].click(); // this directive can be used on input's with ng-click specified - - $timeout(); - } - }, - replace: true, - directiveName: 'piwikSaveButton', - $inject: ['$timeout'] -})); // CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Form/Form.ts /*! * Matomo - free/libre analytics platform @@ -18622,23 +18054,6 @@ var Form_window = window, }); } }); -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Form/Form.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 piwikForm() { - return { - restrict: 'A', - link: function expandOnClickLink(scope, element) { - Form.mounted(element[0]); - } - }; -} -window.angular.module('piwikApp').directive('piwikForm', piwikForm); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/PluginsIntro/PluginsIntro.vue?vue&type=template&id=39bb52aa var PluginsIntrovue_type_template_id_39bb52aa_hoisted_1 = ["innerHTML"]; @@ -18717,6 +18132,75 @@ function PluginsIntrovue_type_template_id_39bb52aa_render(_ctx, _cache, $props, PluginsIntrovue_type_script_lang_ts.render = PluginsIntrovue_type_template_id_39bb52aa_render /* harmony default export */ var PluginsIntro = (PluginsIntrovue_type_script_lang_ts); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/ThemesIntro/ThemesIntro.vue?vue&type=template&id=ad7726de + +var ThemesIntrovue_type_template_id_ad7726de_hoisted_1 = ["innerHTML"]; +var ThemesIntrovue_type_template_id_ad7726de_hoisted_2 = { + key: 1 +}; + +var ThemesIntrovue_type_template_id_ad7726de_hoisted_3 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); + +var ThemesIntrovue_type_template_id_ad7726de_hoisted_4 = { + key: 2 +}; + +var ThemesIntrovue_type_template_id_ad7726de_hoisted_5 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); + +function ThemesIntrovue_type_template_id_ad7726de_render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_EnrichedHeadline = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("EnrichedHeadline"); + + var _directive_content_intro = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("content-intro"); + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_EnrichedHeadline, null, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CorePluginsAdmin_ThemesManagement')), 1)]; + }), + _: 1 + })]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CorePluginsAdmin_ThemesDescription')) + " ", 1), _ctx.isMarketplaceEnabled ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", { + key: 0, + innerHTML: _ctx.$sanitize(_ctx.teaserExtendByThemeText) + }, null, 8, ThemesIntrovue_type_template_id_ad7726de_hoisted_1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.otherUsersCount > 0 ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", ThemesIntrovue_type_template_id_ad7726de_hoisted_2, [ThemesIntrovue_type_template_id_ad7726de_hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CorePluginsAdmin_InfoThemeIsUsedByOtherUsersAsWell', _ctx.otherUsersCount, _ctx.themeEnabled)), 1)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !_ctx.isPluginsAdminEnabled ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", ThemesIntrovue_type_template_id_ad7726de_hoisted_4, [ThemesIntrovue_type_template_id_ad7726de_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CorePluginsAdmin_DoMoreContactPiwikAdmins')), 1)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])], 512)), [[_directive_content_intro]]); +} +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/ThemesIntro/ThemesIntro.vue?vue&type=template&id=ad7726de + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/ThemesIntro/ThemesIntro.vue?vue&type=script&lang=ts + + +/* harmony default export */ var ThemesIntrovue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + isMarketplaceEnabled: Boolean, + otherUsersCount: Number, + themeEnabled: Boolean, + isPluginsAdminEnabled: Boolean + }, + components: { + EnrichedHeadline: external_CoreHome_["EnrichedHeadline"] + }, + directives: { + ContentIntro: external_CoreHome_["ContentIntro"] + }, + computed: { + teaserExtendByThemeText: function teaserExtendByThemeText() { + var link = "?".concat(external_CoreHome_["MatomoUrl"].stringify(Object.assign(Object.assign({}, external_CoreHome_["MatomoUrl"].urlParsed.value), {}, { + module: 'Marketplace', + action: 'overview', + sort: '', + show: 'themes' + }))); + return Object(external_CoreHome_["translate"])('CorePluginsAdmin_TeaserExtendPiwikByTheme', "<a href=\"".concat(link, "\">"), '</a>'); + } + } +})); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/ThemesIntro/ThemesIntro.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/ThemesIntro/ThemesIntro.vue + + + +ThemesIntrovue_type_script_lang_ts.render = ThemesIntrovue_type_template_id_ad7726de_render + +/* harmony default export */ var ThemesIntro = (ThemesIntrovue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Plugins/PluginName.ts /*! * Matomo - free/libre analytics platform @@ -19726,13 +19210,6 @@ UploadPluginDialogvue_type_script_lang_ts.render = UploadPluginDialogvue_type_te - - - - - - - // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js diff --git a/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.min.js b/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.min.js index 0d63313593..d6c8af02ea 100644 --- a/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.min.js +++ b/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.min.js @@ -1,79 +1,40 @@ -(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue")):"function"===typeof define&&define.amd?define(["CoreHome"],t):"object"===typeof exports?exports["CorePluginsAdmin"]=t(require("CoreHome"),require("vue")):e["CorePluginsAdmin"]=t(e["CoreHome"],e["Vue"])})("undefined"!==typeof self?self:this,(function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/CorePluginsAdmin/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},4788:function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o={"{":"\\{","}":"\\}","\\":"\\textbackslash{}","#":"\\#",$:"\\$","%":"\\%","&":"\\&","^":"\\textasciicircum{}",_:"\\_","~":"\\textasciitilde{}"},i={"–":"\\--","—":"\\---"," ":"~","\t":"\\qquad{}","\r\n":"\\newline{}","\n":"\\newline{}"},a=function(e,t){return r({},e,t)};e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.preserveFormatting,s=void 0!==n&&n,l=t.escapeMapFn,c=void 0===l?a:l,u=String(e),p="",f=c(r({},o),s?r({},i):{}),d=Object.keys(f),m=function(){var e=!1;d.forEach((function(t,n){e||u.length>=t.length&&u.slice(0,t.length)===t&&(p+=f[d[n]],u=u.slice(t.length,u.length),e=!0)})),e||(p+=u.slice(0,1),u=u.slice(1,u.length))};while(u)m();return p}},7634:function(e,t,n){"use strict";var r,o,i;(function(n,a){o=[],r=a,i="function"===typeof r?r.apply(t,o):r,void 0===i||(e.exports=i)})(0,(function(){function e(){return!0}function t(){return!1}function n(){}function r(){var o=[{name:"number",test:function(e){return"number"===typeof e}},{name:"string",test:function(e){return"string"===typeof e}},{name:"boolean",test:function(e){return"boolean"===typeof e}},{name:"Function",test:function(e){return"function"===typeof e}},{name:"Array",test:Array.isArray},{name:"Date",test:function(e){return e instanceof Date}},{name:"RegExp",test:function(e){return e instanceof RegExp}},{name:"Object",test:function(e){return"object"===typeof e&&null!==e&&e.constructor===Object}},{name:"null",test:function(e){return null===e}},{name:"undefined",test:function(e){return void 0===e}}],i={name:"any",test:e},a=[],s=[],l={types:o,conversions:s,ignore:a};function c(e){var t=K(l.types,(function(t){return t.name===e}));if(t)return t;if("any"===e)return i;var n=K(l.types,(function(t){return t.name.toLowerCase()===e.toLowerCase()}));throw new TypeError('Unknown type "'+e+'"'+(n?'. Did you mean "'+n.name+'"?':""))}function u(e){return e===i?999:l.types.indexOf(e)}function p(e){var t=K(l.types,(function(t){return t.test(e)}));if(t)return t.name;throw new TypeError("Value has unknown type. Value: "+e)}function f(e,t){if(!e.signatures)throw new TypeError("Function is no typed-function");var n;if("string"===typeof t){n=t.split(",");for(var r=0;r<n.length;r++)n[r]=n[r].trim()}else{if(!Array.isArray(t))throw new TypeError("String array or a comma separated string expected");n=t}var o=n.join(","),i=e.signatures[o];if(i)return i;throw new TypeError("Signature not found (signature: "+(e.name||"unnamed")+"("+n.join(", ")+"))")}function d(e,t){var n=p(e);if(t===n)return e;for(var r=0;r<l.conversions.length;r++){var o=l.conversions[r];if(o.from===n&&o.to===t)return o.convert(e)}throw new Error("Cannot convert from "+n+" to "+t)}function m(e){return e.map((function(e){var t=e.types.map(N);return(e.restParam?"...":"")+t.join("|")})).join(",")}function h(e,t){var n=0===e.indexOf("..."),r=n?e.length>3?e.slice(3):"any":e,o=r.split("|").map(I).filter(U).filter(L),i=T(t,o),a=o.map((function(e){var t=c(e);return{name:e,typeIndex:u(t),test:t.test,conversion:null,conversionIndex:-1}})),s=i.map((function(e){var n=c(e.from);return{name:e.from,typeIndex:u(n),test:n.test,conversion:e,conversionIndex:t.indexOf(e)}}));return{types:a.concat(s),restParam:n}}function g(e,t,n){var r=[];return""!==e.trim()&&(r=e.split(",").map(I).map((function(e,t,r){var o=h(e,n);if(o.restParam&&t!==r.length-1)throw new SyntaxError('Unexpected rest parameter "'+e+'": only allowed for the last parameter');return o}))),r.some(J)?null:{params:r,fn:t}}function b(e){var t=q(e);return!!t&&t.restParam}function v(e){return e.types.some((function(e){return null!=e.conversion}))}function y(t){if(t&&0!==t.types.length){if(1===t.types.length)return c(t.types[0].name).test;if(2===t.types.length){var n=c(t.types[0].name).test,r=c(t.types[1].name).test;return function(e){return n(e)||r(e)}}var o=t.types.map((function(e){return c(e.name).test}));return function(e){for(var t=0;t<o.length;t++)if(o[t](e))return!0;return!1}}return e}function O(e){var t,n,r;if(b(e)){t=R(e).map(y);var o=t.length,i=y(q(e)),a=function(e){for(var t=o;t<e.length;t++)if(!i(e[t]))return!1;return!0};return function(e){for(var n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return a(e)&&e.length>=o+1}}return 0===e.length?function(e){return 0===e.length}:1===e.length?(n=y(e[0]),function(e){return n(e[0])&&1===e.length}):2===e.length?(n=y(e[0]),r=y(e[1]),function(e){return n(e[0])&&r(e[1])&&2===e.length}):(t=e.map(y),function(e){for(var n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return e.length===t.length})}function w(e,t){return t<e.params.length?e.params[t]:b(e.params)?q(e.params):null}function j(e,t,n){var r=w(e,t),o=r?n?r.types.filter(x):r.types:[];return o.map(N)}function N(e){return e.name}function x(e){return null===e.conversion||void 0===e.conversion}function k(e,t){var n=Y(Z(e,(function(e){return j(e,t,!1)})));return-1!==n.indexOf("any")?["any"]:n}function E(e,t,n){var r,o,i,a=e||"unnamed",s=n;for(i=0;i<t.length;i++){var l=s.filter((function(e){var n=y(w(e,i));return(i<e.params.length||b(e.params))&&n(t[i])}));if(0===l.length){if(o=k(s,i),o.length>0){var c=p(t[i]);return r=new TypeError("Unexpected type of argument in function "+a+" (expected: "+o.join(" or ")+", actual: "+c+", index: "+i+")"),r.data={category:"wrongType",fn:a,index:i,actual:c,expected:o},r}}else s=l}var u=s.map((function(e){return b(e.params)?1/0:e.params.length}));if(t.length<Math.min.apply(null,u))return o=k(s,i),r=new TypeError("Too few arguments in function "+a+" (expected: "+o.join(" or ")+", index: "+t.length+")"),r.data={category:"tooFewArgs",fn:a,index:t.length,expected:o},r;var f=Math.max.apply(null,u);return t.length>f?(r=new TypeError("Too many arguments in function "+a+" (expected: "+f+", actual: "+t.length+")"),r.data={category:"tooManyArgs",fn:a,index:t.length,expectedLength:f},r):(r=new TypeError('Arguments of type "'+t.join(", ")+'" do not match any of the defined signatures of function '+a+"."),r.data={category:"mismatch",actual:t.map(p)},r)}function C(e){for(var t=999,n=0;n<e.types.length;n++)x(e.types[n])&&(t=Math.min(t,e.types[n].typeIndex));return t}function S(e){for(var t=999,n=0;n<e.types.length;n++)x(e.types[n])||(t=Math.min(t,e.types[n].conversionIndex));return t}function A(e,t){var n;return n=e.restParam-t.restParam,0!==n?n:(n=v(e)-v(t),0!==n?n:(n=C(e)-C(t),0!==n?n:S(e)-S(t)))}function V(e,t){var n,r,o=Math.min(e.params.length,t.params.length);if(r=e.params.some(v)-t.params.some(v),0!==r)return r;for(n=0;n<o;n++)if(r=v(e.params[n])-v(t.params[n]),0!==r)return r;for(n=0;n<o;n++)if(r=A(e.params[n],t.params[n]),0!==r)return r;return e.params.length-t.params.length}function T(e,t){var n={};return e.forEach((function(e){-1!==t.indexOf(e.from)||-1===t.indexOf(e.to)||n[e.from]||(n[e.from]=e)})),Object.keys(n).map((function(e){return n[e]}))}function M(e,t){var n=t;if(e.some(v)){var r=b(e),o=e.map(P);n=function(){for(var e=[],n=r?arguments.length-1:arguments.length,i=0;i<n;i++)e[i]=o[i](arguments[i]);return r&&(e[n]=arguments[n].map(o[n])),t.apply(this,e)}}var i=n;if(b(e)){var a=e.length-1;i=function(){return n.apply(this,z(arguments,0,a).concat([z(arguments,a)]))}}return i}function P(e){var t,n,r,o,i=[],a=[];switch(e.types.forEach((function(e){e.conversion&&(i.push(c(e.conversion.from).test),a.push(e.conversion.convert))})),a.length){case 0:return function(e){return e};case 1:return t=i[0],r=a[0],function(e){return t(e)?r(e):e};case 2:return t=i[0],n=i[1],r=a[0],o=a[1],function(e){return t(e)?r(e):n(e)?o(e):e};default:return function(e){for(var t=0;t<a.length;t++)if(i[t](e))return a[t](e);return e}}}function B(e){var t={};return e.forEach((function(e){e.params.some(v)||D(e.params,!0).forEach((function(n){t[m(n)]=e.fn}))})),t}function D(e,t){function n(e,r,o){if(r<e.length){var i,a=e[r],s=t?a.types.filter(x):a.types;if(a.restParam){var l=s.filter(x);i=l.length<s.length?[l,s]:[s]}else i=s.map((function(e){return[e]}));return Z(i,(function(t){return n(e,r+1,o.concat([t]))}))}var c=o.map((function(t,n){return{types:t,restParam:n===e.length-1&&b(e)}}));return[c]}return n(e,0,[])}function F(e,t){for(var n=Math.max(e.params.length,t.params.length),r=0;r<n;r++){var o=j(e,r,!0),i=j(t,r,!0);if(!G(o,i))return!1}var a=e.params.length,s=t.params.length,l=b(e.params),c=b(t.params);return l?c?a===s:s>=a:c?a>=s:a===s}function $(e,r){if(0===Object.keys(r).length)throw new SyntaxError("No signatures provided");var o=[];Object.keys(r).map((function(e){return g(e,r[e],l.conversions)})).filter(H).forEach((function(e){var t=K(o,(function(t){return F(t,e)}));if(t)throw new TypeError('Conflicting signatures "'+m(t.params)+'" and "'+m(e.params)+'".');o.push(e)}));var i=Z(o,(function(e){var t=e?D(e.params,!1):[];return t.map((function(t){return{params:t,fn:e.fn}}))})).filter(H);i.sort(V);var a=i[0]&&i[0].params.length<=2&&!b(i[0].params),s=i[1]&&i[1].params.length<=2&&!b(i[1].params),c=i[2]&&i[2].params.length<=2&&!b(i[2].params),u=i[3]&&i[3].params.length<=2&&!b(i[3].params),p=i[4]&&i[4].params.length<=2&&!b(i[4].params),f=i[5]&&i[5].params.length<=2&&!b(i[5].params),d=a&&s&&c&&u&&p&&f,h=i.map((function(e){return O(e.params)})),v=a?y(i[0].params[0]):t,w=s?y(i[1].params[0]):t,j=c?y(i[2].params[0]):t,N=u?y(i[3].params[0]):t,x=p?y(i[4].params[0]):t,k=f?y(i[5].params[0]):t,E=a?y(i[0].params[1]):t,C=s?y(i[1].params[1]):t,S=c?y(i[2].params[1]):t,A=u?y(i[3].params[1]):t,T=p?y(i[4].params[1]):t,P=f?y(i[5].params[1]):t,$=i.map((function(e){return M(e.params,e.fn)})),_=a?$[0]:n,L=s?$[1]:n,I=c?$[2]:n,U=u?$[3]:n,J=p?$[4]:n,R=f?$[5]:n,q=a?i[0].params.length:-1,z=s?i[1].params.length:-1,W=c?i[2].params.length:-1,G=u?i[3].params.length:-1,Y=p?i[4].params.length:-1,X=f?i[5].params.length:-1,Q=d?6:0,ee=i.length,te=function(){for(var t=Q;t<ee;t++)if(h[t](arguments))return $[t].apply(this,arguments);return l.onMismatch(e,arguments,i)},ne=function e(t,n){return arguments.length===q&&v(t)&&E(n)?_.apply(e,arguments):arguments.length===z&&w(t)&&C(n)?L.apply(e,arguments):arguments.length===W&&j(t)&&S(n)?I.apply(e,arguments):arguments.length===G&&N(t)&&A(n)?U.apply(e,arguments):arguments.length===Y&&x(t)&&T(n)?J.apply(e,arguments):arguments.length===X&&k(t)&&P(n)?R.apply(e,arguments):te.apply(e,arguments)};try{Object.defineProperty(ne,"name",{value:e})}catch(re){}return ne.signatures=B(i),ne}function _(e,t,n){throw E(e,t,n)}function L(e){return-1===l.ignore.indexOf(e)}function I(e){return e.trim()}function U(e){return!!e}function H(e){return null!==e}function J(e){return 0===e.types.length}function R(e){return e.slice(0,e.length-1)}function q(e){return e[e.length-1]}function z(e,t,n){return Array.prototype.slice.call(e,t,n)}function W(e,t){return-1!==e.indexOf(t)}function G(e,t){for(var n=0;n<e.length;n++)if(W(t,e[n]))return!0;return!1}function K(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function Y(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;return Object.keys(t)}function Z(e,t){return Array.prototype.concat.apply([],e.map(t))}function X(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(("object"===typeof r.signatures||"string"===typeof r.signature)&&""!==r.name)if(""===t)t=r.name;else if(t!==r.name){var o=new Error("Function names do not match (expected: "+t+", actual: "+r.name+")");throw o.data={actual:r.name,expected:t},o}}return t}function Q(e){var t,n={};function r(e,r){if(n.hasOwnProperty(e)&&r!==n[e])throw t=new Error('Signature "'+e+'" is defined twice'),t.data={signature:e},t}for(var o=0;o<e.length;o++){var i=e[o];if("object"===typeof i.signatures)for(var a in i.signatures)i.signatures.hasOwnProperty(a)&&(r(a,i.signatures[a]),n[a]=i.signatures[a]);else{if("string"!==typeof i.signature)throw t=new TypeError("Function is no typed-function (index: "+o+")"),t.data={index:o},t;r(i.signature,i),n[i.signature]=i}}return n}return l=$("typed",{"string, Object":$,Object:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(e[n]);var r=X(t);return $(r,e)},"...Function":function(e){return $(X(e),Q(e))},"string, ...Function":function(e,t){return $(e,Q(t))}}),l.create=r,l.types=o,l.conversions=s,l.ignore=a,l.onMismatch=_,l.throwMismatchError=_,l.createError=E,l.convert=d,l.find=f,l.addType=function(e,t){if(!e||"string"!==typeof e.name||"function"!==typeof e.test)throw new TypeError("Object with properties {name: string, test: function} expected");if(!1!==t)for(var n=0;n<l.types.length;n++)if("Object"===l.types[n].name)return void l.types.splice(n,0,e);l.types.push(e)},l.addConversion=function(e){if(!e||"string"!==typeof e.from||"string"!==typeof e.to||"function"!==typeof e.convert)throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");l.conversions.push(e)},l}return r()}))},"8bbf":function(e,n){e.exports=t},a559:function(e,t){function n(){return e.exports=n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.__esModule=!0,e.exports["default"]=e.exports,n.apply(this,arguments)}e.exports=n,e.exports.__esModule=!0,e.exports["default"]=e.exports},c0e2:function(e,t){function n(){}n.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;for(r;r<o;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],o=[];if(r&&t)for(var i=0,a=r.length;i<a;i++)r[i].fn!==t&&r[i].fn._!==t&&o.push(r[i]);return o.length?n[e]=o:delete n[e],this}},e.exports=n,e.exports.TinyEmitter=n},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"expressions",(function(){return xl})),n.d(t,"FormField",(function(){return Gt})),n.d(t,"Field",(function(){return en})),n.d(t,"PluginSettings",(function(){return ec})),n.d(t,"PluginFilter",(function(){return Nc})),n.d(t,"PluginManagement",(function(){return ic})),n.d(t,"PluginUpload",(function(){return pc})),n.d(t,"SaveButton",(function(){return Ac})),n.d(t,"Form",(function(){return Mc})),n.d(t,"GroupedSettings",(function(){return Bl})),n.d(t,"PasswordConfirmation",(function(){return Rl})),n.d(t,"PluginsIntro",(function(){return Ic})),n.d(t,"PluginName",(function(){return Rc})),n.d(t,"PluginsTable",(function(){return Fp})),n.d(t,"PluginsTableWithUpdates",(function(){return mf})),n.d(t,"UploadPluginDialog",(function(){return Sf})),"undefined"!==typeof window){var r=window.document.currentScript,o=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);o&&(n.p=o[1])}var i=n("19dc"),a=n("8bbf"),s={class:"form-group row matomo-form-field"},l={key:0,class:"col s12"},c={key:0,class:"form-help"},u={key:0,class:"inline-help",ref:"inlineHelp"},p=Object(a["createElementVNode"])("br",null,null,-1);function f(e,t,n,r,o,i){return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("div",s,[e.formField.introduction?(Object(a["openBlock"])(),Object(a["createElementBlock"])("h3",l,Object(a["toDisplayString"])(e.formField.introduction),1)):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("div",{class:Object(a["normalizeClass"])(["col s12",{"input-field":"checkbox"!==e.formField.uiControl&&"radio"!==e.formField.uiControl,"file-field":"file"===e.formField.uiControl,m6:!e.formField.fullWidth}])},[(Object(a["openBlock"])(),Object(a["createBlock"])(Object(a["resolveDynamicComponent"])(e.childComponent),Object(a["mergeProps"])(Object.assign(Object.assign({formField:e.formField},e.formField),{},{modelValue:e.processedModelValue,modelModifiers:e.modelModifiers,availableOptions:e.availableOptions},e.extraChildComponentParams),{"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onChange(t)})}),null,16))],2),Object(a["createElementVNode"])("div",{class:Object(a["normalizeClass"])(["col s12",{m6:!e.formField.fullWidth}])},[e.showFormHelp?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",c,[Object(a["withDirectives"])(Object(a["createElementVNode"])("div",{class:"form-description"},Object(a["toDisplayString"])(e.formField.description),513),[[a["vShow"],e.formField.description]]),e.formField.inlineHelp||e.hasInlineHelpSlot?(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",u,[e.inlineHelpComponent?(Object(a["openBlock"])(),Object(a["createBlock"])(Object(a["resolveDynamicComponent"])(e.inlineHelpComponent),Object(a["normalizeProps"])(Object(a["mergeProps"])({key:0},e.inlineHelpBind)),null,16)):Object(a["createCommentVNode"])("",!0),Object(a["renderSlot"])(e.$slots,"inline-help")],512)):Object(a["createCommentVNode"])("",!0),Object(a["withDirectives"])(Object(a["createElementVNode"])("span",null,[p,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("General_Default"))+": ",1),Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(e.defaultValuePrettyTruncated),1)],512),[[a["vShow"],e.showDefaultValue]])])):Object(a["createCommentVNode"])("",!0)],2)],512)),[[a["vShow"],e.showField]])}var d={class:"checkbox"},m=["checked","id","name"],h=["innerHTML"];function g(e,t,n,r,o,i){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",d,[Object(a["createElementVNode"])("label",null,[Object(a["createElementVNode"])("input",Object(a["mergeProps"])({onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},e.uiControlAttributes,{value:1,checked:e.isChecked,type:"checkbox",id:e.name,name:e.name}),null,16,m),Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.title)},null,8,h)])])}var b=Object(a["defineComponent"])({props:{modelValue:[Boolean,Number,String],modelModifiers:Object,uiControlAttributes:Object,name:String,title:String},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){var t=e.target.checked;if(this.modelValue!==t){var n;if(null===(n=this.modelModifiers)||void 0===n||!n.abortable)return void this.$emit("update:modelValue",t);var r={value:t,abort:function(){e.target.checked=!t}};this.$emit("update:modelValue",r)}}},computed:{isChecked:function(){return!!this.modelValue&&"0"!==this.modelValue}}});b.render=g;var v=b,y={ref:"root"},O=["value","checked","onChange","id","name"];function w(e,t,n,r,o,i){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",y,[Object(a["withDirectives"])(Object(a["createElementVNode"])("label",{class:"fieldRadioTitle"},Object(a["toDisplayString"])(e.title),513),[[a["vShow"],e.title]]),(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.availableOptions,(function(t,n){return Object(a["openBlock"])(),Object(a["createElementBlock"])("p",{key:n,class:"checkbox"},[Object(a["createElementVNode"])("label",null,[Object(a["createElementVNode"])("input",Object(a["mergeProps"])({value:t.key,checked:!!e.checkboxStates[n],onChange:function(t){return e.onChange(n)}},e.uiControlAttributes,{type:"checkbox",id:"".concat(e.name).concat(t.key),name:t.name}),null,16,O),Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(t.value),1),Object(a["withDirectives"])(Object(a["createElementVNode"])("span",{class:"form-description"},Object(a["toDisplayString"])(t.description),513),[[a["vShow"],t.description]])])])})),128))],512)}function j(e){return E(e)||k(e)||x(e)||N()}function N(){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 x(e,t){if(e){if("string"===typeof e)return C(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)?C(e,t):void 0}}function k(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function E(e){if(Array.isArray(e))return C(e)}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function S(e,t){return(e||[]).map((function(e){return t&&-1!==t.indexOf(e.key)}))}var A=Object(a["defineComponent"])({props:{modelValue:Array,modelModifiers:Object,name:String,title:String,availableOptions:Array,uiControlAttributes:Object,type:String},inheritAttrs:!1,emits:["update:modelValue"],computed:{checkboxStates:function(){return S(this.availableOptions,this.modelValue)}},mounted:function(){window.Materialize.updateTextFields()},methods:{onChange:function(e){var t,n=this,r=j(this.checkboxStates);r[e]=!r[e];var o=this.availableOptions||{},i=[];if(Object.values(o).forEach((function(e,t){r[t]&&i.push(e.key)})),null!==(t=this.modelModifiers)&&void 0!==t&&t.abortable){var a={value:i,abort:function(){var t=n.$refs.root.querySelectorAll("input").item(e);t.checked=!t.checked}};this.$emit("update:modelValue",a)}else this.$emit("update:modelValue",i)}}});A.render=w;var V=A,T={class:"expandableSelector"},M=Object(a["createElementVNode"])("svg",{class:"caret",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},[Object(a["createElementVNode"])("path",{d:"M7 10l5 5 5-5z"}),Object(a["createElementVNode"])("path",{d:"M0 0h24v24H0z",fill:"none"})],-1),P=["value"],B={class:"expandableList z-depth-2"},D={class:"searchContainer"},F={class:"collection firstLevel"},$=["onClick"],_={class:"collection secondLevel"},L=["onClick"],I={class:"primary-content"},U=["title"];function H(e,t,n,r,o,i){var s=Object(a["resolveDirective"])("focus-if"),l=Object(a["resolveDirective"])("focus-anywhere-but-here");return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("div",T,[Object(a["createElementVNode"])("div",{onClick:t[0]||(t[0]=function(t){return e.showSelect=!e.showSelect}),class:"select-wrapper"},[M,Object(a["createElementVNode"])("input",{type:"text",class:"select-dropdown",readonly:"readonly",value:e.modelValueText},null,8,P)]),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",B,[Object(a["createElementVNode"])("div",D,[Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{type:"text",placeholder:"Search","onUpdate:modelValue":t[1]||(t[1]=function(t){return e.searchTerm=t}),class:"expandableSearch browser-default"},null,512),[[a["vModelText"],e.searchTerm],[s,e.showSelect]])]),Object(a["createElementVNode"])("ul",F,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.availableOptions,(function(t,n){return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("li",{class:"collection-item",key:n},[Object(a["createElementVNode"])("h4",{class:"expandableListCategory",onClick:function(n){return e.onCategoryClicked(t)}},[Object(a["createTextVNode"])(Object(a["toDisplayString"])(t.group)+" ",1),Object(a["createElementVNode"])("span",{class:Object(a["normalizeClass"])(["secondary-content",{"icon-arrow-right":e.showCategory!==t.group,"icon-arrow-bottom":e.showCategory===t.group}])},null,2)],8,$),Object(a["withDirectives"])(Object(a["createElementVNode"])("ul",_,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(t.values.filter((function(t){return-1!==t.value.toLowerCase().indexOf(e.searchTerm.toLowerCase())})),(function(t){return Object(a["openBlock"])(),Object(a["createElementBlock"])("li",{class:"expandableListItem collection-item valign-wrapper",key:t.key,onClick:function(n){return e.onValueClicked(t)}},[Object(a["createElementVNode"])("span",I,Object(a["toDisplayString"])(t.value),1),Object(a["withDirectives"])(Object(a["createElementVNode"])("span",{title:t.tooltip,class:"secondary-content icon-help"},null,8,U),[[a["vShow"],t.tooltip]])],8,L)})),128))],512),[[a["vShow"],e.showCategory===t.group||e.searchTerm]])],512)),[[a["vShow"],t.values.filter((function(t){return-1!==t.value.toLowerCase().indexOf(e.searchTerm.toLowerCase())})).length]])})),128))])],512),[[a["vShow"],e.showSelect]])],512)),[[l,{blur:e.onBlur}]])}function J(e){var t=[];if(!e)return t;var n={};return Object.values(e).forEach((function(e){var t=e,r=t.group||"";r in n&&n[r]||(n[r]={values:[],group:r});var o={key:t.key,value:t.value};"tooltip"in t&&t.tooltip&&(o.tooltip=t.tooltip),n[r].values.push(o)})),Object.values(n).forEach((function(e){e.values.length&&t.push(e)})),t}var R=Object(a["defineComponent"])({props:{modelValue:[Number,String],modelModifiers:Object,availableOptions:Array,title:String},directives:{FocusAnywhereButHere:i["FocusAnywhereButHere"],FocusIf:i["FocusIf"]},inheritAttrs:!1,emits:["update:modelValue"],data:function(){return{showSelect:!1,searchTerm:"",showCategory:""}},computed:{modelValueText:function(){if(this.title)return this.title;var e,t=this.modelValue,n=this.availableOptions||[];return n.some((function(n){return e=n.values.find((function(e){return e.key===t})),e})),e?e.value?"".concat(e.value):"":t?"".concat(t):""}},methods:{onBlur:function(){this.showSelect=!1},onCategoryClicked:function(e){this.showCategory===e.group?this.showCategory="":this.showCategory=e.group},onValueClicked:function(e){var t;if(this.showSelect=!1,null!==(t=this.modelModifiers)&&void 0!==t&&t.abortable){var n={value:e.key,abort:function(){}};this.$emit("update:modelValue",n)}else this.$emit("update:modelValue",e.key)}}});R.render=H;var q=R,z=["for","innerHTML"];function W(e,t,n,r,o,i){var s=Object(a["resolveComponent"])("FieldArray");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",null,[Object(a["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,z),Object(a["createVNode"])(s,{name:e.name,"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onValueUpdate(t)}),"model-modifiers":e.modelModifiers,field:e.uiControlAttributes.field},null,8,["name","model-value","model-modifiers","field"])])}var G=Object(a["defineComponent"])({components:{FieldArray:i["FieldArray"]},props:{name:String,title:String,modelValue:null,modelModifiers:Object,uiControlAttributes:Object},inheritAttrs:!1,emits:["update:modelValue"],methods:{onValueUpdate:function(e){this.$emit("update:modelValue",e)}}});G.render=W;var K=G,Y={class:"btn"},Z=["for","innerHTML"],X=["name","id"],Q={class:"file-path-wrapper"},ee=["value"];function te(e,t,n,r,o,i){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",null,[Object(a["createElementVNode"])("div",Y,[Object(a["createElementVNode"])("span",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,Z),Object(a["createElementVNode"])("input",{ref:"fileInput",name:e.name,type:"file",id:e.name,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},null,40,X)]),Object(a["createElementVNode"])("div",Q,[Object(a["createElementVNode"])("input",{class:"file-path validate",value:e.filePath,type:"text"},null,8,ee)])])}var ne=Object(a["defineComponent"])({props:{name:String,title:String,modelValue:[String,File],modelModifiers:Object},inheritAttrs:!1,emits:["update:modelValue"],watch:{modelValue:function(e){if(!e||""===e){var t=this.$refs.fileInput;t.value=""}}},methods:{onChange:function(e){var t,n=e.target.files;if(n){var r=n.item(0);if(null!==(t=this.modelModifiers)&&void 0!==t&&t.abortable){var o={value:r,abort:function(){}};this.$emit("update:modelValue",o)}else this.$emit("update:modelValue",r)}}},computed:{filePath:function(){if(this.modelValue instanceof File)return this.$refs.fileInput.value}}});ne.render=te;var re=ne,oe=["type","name","value"];function ie(e,t,n,r,o,i){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",null,[Object(a["createElementVNode"])("input",{type:e.uiControl,name:e.name,value:e.modelValue,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},null,40,oe)])}var ae=Object(a["defineComponent"])({props:{modelValue:null,modelModifiers:Object,uiControl:String,name:String},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){this.$emit("update:modelValue",e.target.value)}}});ae.render=ie;var se=ae,le={class:"fieldMultiTuple"},ce=["for","innerHTML"];function ue(e,t,n,r,o,i){var s=Object(a["resolveComponent"])("MultiPairField");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",le,[Object(a["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,ce),Object(a["createVNode"])(s,{name:e.name,"model-value":e.modelValue,"onUpdate:modelValue":e.onUpdateValue,"model-modifiers":e.modelModifiers,field1:e.uiControlAttributes.field1,field2:e.uiControlAttributes.field2,field3:e.uiControlAttributes.field3,field4:e.uiControlAttributes.field4},null,8,["name","model-value","onUpdate:modelValue","model-modifiers","field1","field2","field3","field4"])])}var pe=Object(a["defineComponent"])({props:{name:String,title:String,modelValue:null,modelModifiers:Object,uiControlAttributes:Object},inheritAttrs:!1,components:{MultiPairField:i["MultiPairField"]},emits:["update:modelValue"],methods:{onUpdateValue:function(e){this.$emit("update:modelValue",e)}}});pe.render=ue;var fe=pe,de=["type","id","name","value"],me=["for","innerHTML"];function he(e,t,n,r,o,i){return Object(a["openBlock"])(),Object(a["createElementBlock"])(a["Fragment"],null,[Object(a["createElementVNode"])("input",Object(a["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,id:e.name,name:e.name,value:e.modelValueFormatted,onKeydown:t[0]||(t[0]=function(t){return e.onChange(t)}),onChange:t[1]||(t[1]=function(t){return e.onChange(t)})},e.uiControlAttributes),null,16,de),Object(a["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,me)],64)}var ge=Object(a["defineComponent"])({props:{uiControl:String,name:String,title:String,modelValue:[Number,String],modelModifiers:Object,uiControlAttributes:Object},inheritAttrs:!1,emits:["update:modelValue"],created:function(){this.onChange=Object(i["debounce"])(this.onChange.bind(this),50)},methods:{onChange:function(e){var t=this,n=parseFloat(e.target.value);if(n!==this.modelValue){var r;if(null===(r=this.modelModifiers)||void 0===r||!r.abortable)return void this.$emit("update:modelValue",n);var o={value:n,abort:function(){e.target.value!==t.modelValueFormatted&&(e.target.value=t.modelValueFormatted)}};this.$emit("update:modelValue",o)}}},mounted:function(){window.Materialize.updateTextFields()},watch:{modelValue:function(){setTimeout((function(){window.Materialize.updateTextFields()}))}},computed:{modelValueFormatted:function(){return(this.modelValue||"").toString()}}});ge.render=he;var be=ge,ve={ref:"root"},ye=["value","id","name","disabled","checked"];function Oe(e,t,n,r,o,i){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",ve,[Object(a["withDirectives"])(Object(a["createElementVNode"])("label",{class:"fieldRadioTitle"},Object(a["toDisplayString"])(e.title),513),[[a["vShow"],e.title]]),(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.availableOptions||[],(function(n){return Object(a["openBlock"])(),Object(a["createElementBlock"])("p",{key:n.key,class:"radio"},[Object(a["createElementVNode"])("label",null,[Object(a["createElementVNode"])("input",Object(a["mergeProps"])({value:n.key,onChange:t[0]||(t[0]=function(t){return e.onChange(t)}),type:"radio",id:"".concat(e.name).concat(n.key),name:e.name,disabled:n.disabled||e.disabled},e.uiControlAttributes,{checked:e.modelValue===n.key||"".concat(e.modelValue)===n.key}),null,16,ye),Object(a["createElementVNode"])("span",null,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(n.value)+" ",1),Object(a["withDirectives"])(Object(a["createElementVNode"])("span",{class:"form-description"},Object(a["toDisplayString"])(n.description),513),[[a["vShow"],n.description]])])])])})),128))],512)}var we=Object(a["defineComponent"])({props:{title:String,availableOptions:Array,name:String,disabled:Boolean,uiControlAttributes:Object,modelValue:[String,Number],modelModifiers:Object},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){var t,n=this;if(null!==(t=this.modelModifiers)&&void 0!==t&&t.abortable){var r=function(){n.$refs.root.querySelectorAll("input").forEach((function(e,t){var r;if(null!==(r=n.availableOptions)&&void 0!==r&&r[t]){var o=n.availableOptions[t].key;e.checked=n.modelValue===o||"".concat(n.modelValue)===o}}))},o={value:e.target.value,abort:function(){r()}};this.$emit("update:modelValue",o)}else this.$emit("update:modelValue",e.target.value)}}});we.render=Oe;var je=we;function Ne(e,t){return Se(e)||Ce(e,t)||ke(e,t)||xe()}function xe(){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 ke(e,t){if(e){if("string"===typeof e)return Ee(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)?Ee(e,t):void 0}}function Ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ce(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0)if(i.push(r.value),t&&i.length===t)break}catch(l){s=!0,o=l}finally{try{a||null==n["return"]||n["return"]()}finally{if(s)throw o}}return i}}function Se(e){if(Array.isArray(e))return e}var Ae={key:0,class:"matomo-field-select"},Ve=["multiple","name"],Te=["label"],Me=["value","selected","disabled"],Pe=["for","innerHTML"],Be={key:1,class:"matomo-field-select"},De=["multiple","name"],Fe=["value","selected","disabled"],$e=["for","innerHTML"];function _e(e,t,n,r,o,i){return Object(a["openBlock"])(),Object(a["createElementBlock"])(a["Fragment"],null,[e.groupedOptions?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Ae,[Object(a["createElementVNode"])("select",Object(a["mergeProps"])({ref:"select",class:"grouped",multiple:e.multiple,name:e.name,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},e.uiControlAttributes),[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.groupedOptions,(function(t){var n=Ne(t,2),r=n[0],o=n[1];return Object(a["openBlock"])(),Object(a["createElementBlock"])("optgroup",{key:r,label:r},[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(o,(function(t){return Object(a["openBlock"])(),Object(a["createElementBlock"])("option",{key:t.key,value:"string:".concat(t.key),selected:e.multiple?e.modelValue&&-1!==e.modelValue.indexOf(t.key):e.modelValue===t.key,disabled:t.disabled},Object(a["toDisplayString"])(t.value),9,Me)})),128))],8,Te)})),128))],16,Ve),Object(a["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,Pe)])):Object(a["createCommentVNode"])("",!0),!e.groupedOptions&&e.options?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Be,[Object(a["createElementVNode"])("select",Object(a["mergeProps"])({class:"ungrouped",ref:"select",multiple:e.multiple,name:e.name,onChange:t[1]||(t[1]=function(t){return e.onChange(t)})},e.uiControlAttributes),[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.options,(function(t){return Object(a["openBlock"])(),Object(a["createElementBlock"])("option",{key:t.key,value:"string:".concat(t.key),selected:e.multiple?e.modelValue&&-1!==e.modelValue.indexOf(t.key):e.modelValue===t.key,disabled:t.disabled},Object(a["toDisplayString"])(t.value),9,Fe)})),128))],16,De),Object(a["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,$e)])):Object(a["createCommentVNode"])("",!0)],64)}function Le(e){return He(e)||Ue(e)||qe(e)||Ie()}function Ie(){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 Ue(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function He(e){if(Array.isArray(e))return ze(e)}function Je(e,t){return Ge(e)||We(e,t)||qe(e,t)||Re()}function Re(){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 qe(e,t){if(e){if("string"===typeof e)return ze(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)?ze(e,t):void 0}}function ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function We(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0)if(i.push(r.value),t&&i.length===t)break}catch(l){s=!0,o=l}finally{try{a||null==n["return"]||n["return"]()}finally{if(s)throw o}}return i}}function Ge(e){if(Array.isArray(e))return e}function Ke(e){return Ke="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ke(e)}function Ye(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4?arguments[4]:void 0;if(e){var i=window.$(e);if(Array.from(e.options).forEach((function(e){e.selected=o?!!t&&-1!==t.indexOf(e.value.replace(/^string:/,"")):"string:".concat(t)===e.value})),i.formSelect(r),n){var a=i.closest(".select-wrapper").find("input");a.attr("placeholder",n)}}}function Ze(e){return!Array.isArray(e)&&"object"===Ke(e)&&Object.values(e).some((function(e){return"object"===Ke(e)}))}function Xe(e,t){return e.some((function(e){return e.key===t}))}function Qe(e,t,n){if(!e)return[];var r=!0,o=e;Ze(o)||(o={"":e},r=!1);var i=[];return Object.entries(o).forEach((function(e){var n=Je(e,2),o=n[0],a=n[1];Object.entries(a).forEach((function(e){var n=Je(e,2),a=n[0],s=n[1];if(s&&"object"===Ke(s)&&"undefined"!==typeof s.key)i.push(s);else{var l=a;"integer"===t&&"string"===typeof a&&(l=parseInt(a,10)),i.push({group:r?o:void 0,key:l,value:s})}}))})),null!==n&&void 0!==n&&n.placeholder&&!Xe(i,"")?[{key:"",value:""}].concat(i):i}function et(e){return"string"===typeof e?e.replace(/^string:/,""):e}var tt=Object(a["defineComponent"])({props:{modelValue:null,modelModifiers:Object,multiple:Boolean,name:String,title:String,availableOptions:Array,uiControlAttributes:Object,uiControlOptions:Object},inheritAttrs:!1,emits:["update:modelValue"],computed:{options:function(){var e=this.availableOptions;return!e||Xe(e,"")||"undefined"!==typeof this.modelValue&&null!==this.modelValue&&""!==this.modelValue?e:[{key:"",value:this.modelValue,group:this.hasGroups?"":void 0}].concat(Le(e))},hasGroups:function(){var e=this.availableOptions;return e&&e[0]&&"undefined"!==typeof e[0].group},groupedOptions:function(){var e=this.options;if(!this.hasGroups||!e)return null;var t={};e.forEach((function(e){var n=e.group;t[n]=t[n]||[],t[n].push(e)}));var n=Object.entries(t);return n.sort((function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0})),n}},methods:{onChange:function(e){var t,n,r=this,o=e.target;if(this.multiple?(n=Array.from(o.options).filter((function(e){return e.selected})).map((function(e){return e.value})),n=n.map((function(e){return et(e)}))):(n=o.value,n=et(n)),null!==(t=this.modelModifiers)&&void 0!==t&&t.abortable){var i={value:n,abort:function(){r.onModelValueChange(r.modelValue)}};this.$emit("update:modelValue",i)}else this.$emit("update:modelValue",n)},onModelValueChange:function(e){var t=this;window.$(this.$refs.select).val(e),setTimeout((function(){var n;Ye(t.$refs.select,e,null===(n=t.uiControlAttributes)||void 0===n?void 0:n.placeholder,t.uiControlOptions,t.multiple)}))}},watch:{modelValue:function(e){this.onModelValueChange(e)},"uiControlAttributes.disabled":{handler:function(e,t){var n=this;setTimeout((function(){var r;e!==t&&Ye(n.$refs.select,n.modelValue,null===(r=n.uiControlAttributes)||void 0===r?void 0:r.placeholder,n.uiControlOptions,n.multiple)}))}},availableOptions:function(e,t){var n=this;e!==t&&setTimeout((function(){var e;Ye(n.$refs.select,n.modelValue,null===(e=n.uiControlAttributes)||void 0===e?void 0:e.placeholder,n.uiControlOptions,n.multiple)}))}},mounted:function(){var e=this;setTimeout((function(){var t;Ye(e.$refs.select,e.modelValue,null===(t=e.uiControlAttributes)||void 0===t?void 0:t.placeholder,e.uiControlOptions,e.multiple)}))}});tt.render=_e;var nt=tt,rt=["for","innerHTML"],ot={class:"sites_autocomplete"};function it(e,t,n,r,o,i){var s=Object(a["resolveComponent"])("SiteSelector");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",null,[Object(a["createElementVNode"])("label",{for:e.name,class:"siteSelectorLabel",innerHTML:e.$sanitize(e.title)},null,8,rt),Object(a["createElementVNode"])("div",ot,[Object(a["createVNode"])(s,Object(a["mergeProps"])({"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onChange(t)}),id:e.name,"show-all-sites-item":e.uiControlAttributes.showAllSitesItem||!1,"switch-site-on-select":!1,"show-selected-site":!0,"only-sites-with-admin-access":e.uiControlAttributes.onlySitesWithAdminAccess||!1},e.uiControlAttributes),null,16,["model-value","id","show-all-sites-item","only-sites-with-admin-access"])])])}var at=Object(a["defineComponent"])({props:{name:String,title:String,modelValue:Object,modelModifiers:Object,uiControlAttributes:Object},inheritAttrs:!1,components:{SiteSelector:i["SiteSelector"]},emits:["update:modelValue"],methods:{onChange:function(e){var t;if(null!==(t=this.modelModifiers)&&void 0!==t&&t.abortable){var n={value:e,abort:function(){}};this.$emit("update:modelValue",n)}else this.$emit("update:modelValue",e)}}});at.render=it;var st=at,lt=["type","id","name","value"],ct=["for","innerHTML"];function ut(e,t,n,r,o,i){return Object(a["openBlock"])(),Object(a["createElementBlock"])(a["Fragment"],null,[Object(a["createElementVNode"])("input",Object(a["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,id:e.name,name:e.name,value:e.modelValueText,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)})},e.uiControlAttributes),null,16,lt),Object(a["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,ct)],64)}var pt=Object(a["defineComponent"])({props:{title:String,name:String,uiControlAttributes:Object,modelValue:[String,Number],modelModifiers:Object,uiControl:String},inheritAttrs:!1,emits:["update:modelValue"],computed:{modelValueText:function(){return"undefined"===typeof this.modelValue||null===this.modelValue?"":this.modelValue.toString()}},created:function(){this.onKeydown=Object(i["debounce"])(this.onKeydown.bind(this),50)},mounted:function(){setTimeout((function(){window.Materialize.updateTextFields()}))},watch:{modelValue:function(){setTimeout((function(){window.Materialize.updateTextFields()}))}},methods:{onKeydown:function(e){var t=this,n=e.target.value;if(this.modelValue!==n){var r;if(null===(r=this.modelModifiers)||void 0===r||!r.abortable)return void this.$emit("update:modelValue",n);var o={value:n,abort:function(){e.target.value!==t.modelValueText&&(e.target.value=t.modelValueText)}};this.$emit("update:modelValue",o)}}}});pt.render=ut;var ft=pt,dt=["for","innerHTML"],mt=["type","name","value"];function ht(e,t,n,r,o,i){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",null,[Object(a["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,dt),Object(a["createElementVNode"])("input",Object(a["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,name:e.name,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),value:e.concattedValues},e.uiControlAttributes),null,16,mt)])}var gt=Object(a["defineComponent"])({props:{name:String,title:String,uiControl:String,modelValue:Array,modelModifiers:Object,uiControlAttributes:Object},inheritAttrs:!1,computed:{concattedValues:function(){return"string"===typeof this.modelValue?this.modelValue:(this.modelValue||[]).join(", ")}},emits:["update:modelValue"],created:function(){this.onKeydown=Object(i["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){var t=this,n=e.target.value.split(",").map((function(e){return e.trim()}));if(n.join(", ")!==this.concattedValues){var r;if(null===(r=this.modelModifiers)||void 0===r||!r.abortable)return void this.$emit("update:modelValue",n);var o={value:n,abort:function(){e.target.value!==t.concattedValues&&(e.target.value=t.concattedValues)}};this.$emit("update:modelValue",o)}}}});gt.render=ht;var bt=gt,vt=["name","id","value"],yt=["for","innerHTML"];function Ot(e,t,n,r,o,i){return Object(a["openBlock"])(),Object(a["createElementBlock"])(a["Fragment"],null,[Object(a["createElementVNode"])("textarea",Object(a["mergeProps"])({name:e.name},e.uiControlAttributes,{id:e.name,value:e.modelValueText,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),class:"materialize-textarea",ref:"textarea"}),null,16,vt),Object(a["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,yt)],64)}var wt=Object(a["defineComponent"])({props:{name:String,uiControlAttributes:Object,modelValue:String,modelModifiers:Object,title:String},inheritAttrs:!1,emits:["update:modelValue"],created:function(){this.onKeydown=Object(i["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){var t=this,n=e.target.value;if(n!==this.modelValue){var r;if(null===(r=this.modelModifiers)||void 0===r||!r.abortable)return void this.$emit("update:modelValue",n);var o={value:n,abort:function(){e.target.value!==t.modelValue&&(e.target.value=t.modelValueText)}};this.$emit("update:modelValue",o)}}},computed:{modelValueText:function(){return this.modelValue||""}},watch:{modelValue:function(){var e=this;setTimeout((function(){window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}},mounted:function(){var e=this;setTimeout((function(){window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}});wt.render=Ot;var jt=wt,Nt=["for","innerHTML"],xt=["name","value"];function kt(e,t,n,r,o,i){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",null,[Object(a["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,Nt),Object(a["createElementVNode"])("textarea",Object(a["mergeProps"])({ref:"textarea",name:e.name},e.uiControlAttributes,{value:e.concattedValue,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),class:"materialize-textarea"}),null,16,xt)])}var Et="\n",Ct=Object(a["defineComponent"])({props:{name:String,title:String,uiControlAttributes:Object,modelValue:[Array,String],modelModifiers:Object},inheritAttrs:!1,emits:["update:modelValue"],computed:{concattedValue:function(){return"string"===typeof this.modelValue?this.modelValue:(this.modelValue||[]).join(Et)}},created:function(){this.onKeydown=Object(i["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){var t=this,n=e.target.value.split(Et);if(n.join(Et)!==this.concattedValue){var r;if(null===(r=this.modelModifiers)||void 0===r||!r.abortable)return void this.$emit("update:modelValue",n);var o={value:n,abort:function(){e.target.value!==t.concattedValue&&(e.target.value=t.concattedValue)}};this.$emit("update:modelValue",o)}}},watch:{modelValue:function(e,t){var n=this;e!==t&&setTimeout((function(){n.$refs.textarea&&window.Materialize.textareaAutoResize(n.$refs.textarea),window.Materialize.updateTextFields()}))}},mounted:function(){var e=this;setTimeout((function(){e.$refs.textarea&&window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}});Ct.render=kt;var St=Ct;function At(e){return At="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},At(e)}function Vt(e,t){return Dt(e)||Bt(e,t)||Mt(e,t)||Tt()}function Tt(){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 Mt(e,t){if(e){if("string"===typeof e)return Pt(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)?Pt(e,t):void 0}}function Pt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Bt(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0)if(i.push(r.value),t&&i.length===t)break}catch(l){s=!0,o=l}finally{try{a||null==n["return"]||n["return"]()}finally{if(s)throw o}}return i}}function Dt(e){if(Array.isArray(e))return e} +(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue")):"function"===typeof define&&define.amd?define(["CoreHome"],t):"object"===typeof exports?exports["CorePluginsAdmin"]=t(require("CoreHome"),require("vue")):e["CorePluginsAdmin"]=t(e["CoreHome"],e["Vue"])})("undefined"!==typeof self?self:this,(function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/CorePluginsAdmin/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},4788:function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o={"{":"\\{","}":"\\}","\\":"\\textbackslash{}","#":"\\#",$:"\\$","%":"\\%","&":"\\&","^":"\\textasciicircum{}",_:"\\_","~":"\\textasciitilde{}"},i={"–":"\\--","—":"\\---"," ":"~","\t":"\\qquad{}","\r\n":"\\newline{}","\n":"\\newline{}"},a=function(e,t){return r({},e,t)};e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.preserveFormatting,s=void 0!==n&&n,l=t.escapeMapFn,c=void 0===l?a:l,u=String(e),p="",d=c(r({},o),s?r({},i):{}),f=Object.keys(d),m=function(){var e=!1;f.forEach((function(t,n){e||u.length>=t.length&&u.slice(0,t.length)===t&&(p+=d[f[n]],u=u.slice(t.length,u.length),e=!0)})),e||(p+=u.slice(0,1),u=u.slice(1,u.length))};while(u)m();return p}},7634:function(e,t,n){"use strict";var r,o,i;(function(n,a){o=[],r=a,i="function"===typeof r?r.apply(t,o):r,void 0===i||(e.exports=i)})(0,(function(){function e(){return!0}function t(){return!1}function n(){}function r(){var o=[{name:"number",test:function(e){return"number"===typeof e}},{name:"string",test:function(e){return"string"===typeof e}},{name:"boolean",test:function(e){return"boolean"===typeof e}},{name:"Function",test:function(e){return"function"===typeof e}},{name:"Array",test:Array.isArray},{name:"Date",test:function(e){return e instanceof Date}},{name:"RegExp",test:function(e){return e instanceof RegExp}},{name:"Object",test:function(e){return"object"===typeof e&&null!==e&&e.constructor===Object}},{name:"null",test:function(e){return null===e}},{name:"undefined",test:function(e){return void 0===e}}],i={name:"any",test:e},a=[],s=[],l={types:o,conversions:s,ignore:a};function c(e){var t=K(l.types,(function(t){return t.name===e}));if(t)return t;if("any"===e)return i;var n=K(l.types,(function(t){return t.name.toLowerCase()===e.toLowerCase()}));throw new TypeError('Unknown type "'+e+'"'+(n?'. Did you mean "'+n.name+'"?':""))}function u(e){return e===i?999:l.types.indexOf(e)}function p(e){var t=K(l.types,(function(t){return t.test(e)}));if(t)return t.name;throw new TypeError("Value has unknown type. Value: "+e)}function d(e,t){if(!e.signatures)throw new TypeError("Function is no typed-function");var n;if("string"===typeof t){n=t.split(",");for(var r=0;r<n.length;r++)n[r]=n[r].trim()}else{if(!Array.isArray(t))throw new TypeError("String array or a comma separated string expected");n=t}var o=n.join(","),i=e.signatures[o];if(i)return i;throw new TypeError("Signature not found (signature: "+(e.name||"unnamed")+"("+n.join(", ")+"))")}function f(e,t){var n=p(e);if(t===n)return e;for(var r=0;r<l.conversions.length;r++){var o=l.conversions[r];if(o.from===n&&o.to===t)return o.convert(e)}throw new Error("Cannot convert from "+n+" to "+t)}function m(e){return e.map((function(e){var t=e.types.map(N);return(e.restParam?"...":"")+t.join("|")})).join(",")}function h(e,t){var n=0===e.indexOf("..."),r=n?e.length>3?e.slice(3):"any":e,o=r.split("|").map(I).filter(U).filter(L),i=T(t,o),a=o.map((function(e){var t=c(e);return{name:e,typeIndex:u(t),test:t.test,conversion:null,conversionIndex:-1}})),s=i.map((function(e){var n=c(e.from);return{name:e.from,typeIndex:u(n),test:n.test,conversion:e,conversionIndex:t.indexOf(e)}}));return{types:a.concat(s),restParam:n}}function g(e,t,n){var r=[];return""!==e.trim()&&(r=e.split(",").map(I).map((function(e,t,r){var o=h(e,n);if(o.restParam&&t!==r.length-1)throw new SyntaxError('Unexpected rest parameter "'+e+'": only allowed for the last parameter');return o}))),r.some(R)?null:{params:r,fn:t}}function b(e){var t=z(e);return!!t&&t.restParam}function y(e){return e.types.some((function(e){return null!=e.conversion}))}function v(t){if(t&&0!==t.types.length){if(1===t.types.length)return c(t.types[0].name).test;if(2===t.types.length){var n=c(t.types[0].name).test,r=c(t.types[1].name).test;return function(e){return n(e)||r(e)}}var o=t.types.map((function(e){return c(e.name).test}));return function(e){for(var t=0;t<o.length;t++)if(o[t](e))return!0;return!1}}return e}function O(e){var t,n,r;if(b(e)){t=q(e).map(v);var o=t.length,i=v(z(e)),a=function(e){for(var t=o;t<e.length;t++)if(!i(e[t]))return!1;return!0};return function(e){for(var n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return a(e)&&e.length>=o+1}}return 0===e.length?function(e){return 0===e.length}:1===e.length?(n=v(e[0]),function(e){return n(e[0])&&1===e.length}):2===e.length?(n=v(e[0]),r=v(e[1]),function(e){return n(e[0])&&r(e[1])&&2===e.length}):(t=e.map(v),function(e){for(var n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return e.length===t.length})}function w(e,t){return t<e.params.length?e.params[t]:b(e.params)?z(e.params):null}function j(e,t,n){var r=w(e,t),o=r?n?r.types.filter(x):r.types:[];return o.map(N)}function N(e){return e.name}function x(e){return null===e.conversion||void 0===e.conversion}function k(e,t){var n=Y(Z(e,(function(e){return j(e,t,!1)})));return-1!==n.indexOf("any")?["any"]:n}function E(e,t,n){var r,o,i,a=e||"unnamed",s=n;for(i=0;i<t.length;i++){var l=s.filter((function(e){var n=v(w(e,i));return(i<e.params.length||b(e.params))&&n(t[i])}));if(0===l.length){if(o=k(s,i),o.length>0){var c=p(t[i]);return r=new TypeError("Unexpected type of argument in function "+a+" (expected: "+o.join(" or ")+", actual: "+c+", index: "+i+")"),r.data={category:"wrongType",fn:a,index:i,actual:c,expected:o},r}}else s=l}var u=s.map((function(e){return b(e.params)?1/0:e.params.length}));if(t.length<Math.min.apply(null,u))return o=k(s,i),r=new TypeError("Too few arguments in function "+a+" (expected: "+o.join(" or ")+", index: "+t.length+")"),r.data={category:"tooFewArgs",fn:a,index:t.length,expected:o},r;var d=Math.max.apply(null,u);return t.length>d?(r=new TypeError("Too many arguments in function "+a+" (expected: "+d+", actual: "+t.length+")"),r.data={category:"tooManyArgs",fn:a,index:t.length,expectedLength:d},r):(r=new TypeError('Arguments of type "'+t.join(", ")+'" do not match any of the defined signatures of function '+a+"."),r.data={category:"mismatch",actual:t.map(p)},r)}function C(e){for(var t=999,n=0;n<e.types.length;n++)x(e.types[n])&&(t=Math.min(t,e.types[n].typeIndex));return t}function S(e){for(var t=999,n=0;n<e.types.length;n++)x(e.types[n])||(t=Math.min(t,e.types[n].conversionIndex));return t}function V(e,t){var n;return n=e.restParam-t.restParam,0!==n?n:(n=y(e)-y(t),0!==n?n:(n=C(e)-C(t),0!==n?n:S(e)-S(t)))}function A(e,t){var n,r,o=Math.min(e.params.length,t.params.length);if(r=e.params.some(y)-t.params.some(y),0!==r)return r;for(n=0;n<o;n++)if(r=y(e.params[n])-y(t.params[n]),0!==r)return r;for(n=0;n<o;n++)if(r=V(e.params[n],t.params[n]),0!==r)return r;return e.params.length-t.params.length}function T(e,t){var n={};return e.forEach((function(e){-1!==t.indexOf(e.from)||-1===t.indexOf(e.to)||n[e.from]||(n[e.from]=e)})),Object.keys(n).map((function(e){return n[e]}))}function M(e,t){var n=t;if(e.some(y)){var r=b(e),o=e.map(P);n=function(){for(var e=[],n=r?arguments.length-1:arguments.length,i=0;i<n;i++)e[i]=o[i](arguments[i]);return r&&(e[n]=arguments[n].map(o[n])),t.apply(this,e)}}var i=n;if(b(e)){var a=e.length-1;i=function(){return n.apply(this,W(arguments,0,a).concat([W(arguments,a)]))}}return i}function P(e){var t,n,r,o,i=[],a=[];switch(e.types.forEach((function(e){e.conversion&&(i.push(c(e.conversion.from).test),a.push(e.conversion.convert))})),a.length){case 0:return function(e){return e};case 1:return t=i[0],r=a[0],function(e){return t(e)?r(e):e};case 2:return t=i[0],n=i[1],r=a[0],o=a[1],function(e){return t(e)?r(e):n(e)?o(e):e};default:return function(e){for(var t=0;t<a.length;t++)if(i[t](e))return a[t](e);return e}}}function D(e){var t={};return e.forEach((function(e){e.params.some(y)||B(e.params,!0).forEach((function(n){t[m(n)]=e.fn}))})),t}function B(e,t){function n(e,r,o){if(r<e.length){var i,a=e[r],s=t?a.types.filter(x):a.types;if(a.restParam){var l=s.filter(x);i=l.length<s.length?[l,s]:[s]}else i=s.map((function(e){return[e]}));return Z(i,(function(t){return n(e,r+1,o.concat([t]))}))}var c=o.map((function(t,n){return{types:t,restParam:n===e.length-1&&b(e)}}));return[c]}return n(e,0,[])}function $(e,t){for(var n=Math.max(e.params.length,t.params.length),r=0;r<n;r++){var o=j(e,r,!0),i=j(t,r,!0);if(!G(o,i))return!1}var a=e.params.length,s=t.params.length,l=b(e.params),c=b(t.params);return l?c?a===s:s>=a:c?a>=s:a===s}function F(e,r){if(0===Object.keys(r).length)throw new SyntaxError("No signatures provided");var o=[];Object.keys(r).map((function(e){return g(e,r[e],l.conversions)})).filter(H).forEach((function(e){var t=K(o,(function(t){return $(t,e)}));if(t)throw new TypeError('Conflicting signatures "'+m(t.params)+'" and "'+m(e.params)+'".');o.push(e)}));var i=Z(o,(function(e){var t=e?B(e.params,!1):[];return t.map((function(t){return{params:t,fn:e.fn}}))})).filter(H);i.sort(A);var a=i[0]&&i[0].params.length<=2&&!b(i[0].params),s=i[1]&&i[1].params.length<=2&&!b(i[1].params),c=i[2]&&i[2].params.length<=2&&!b(i[2].params),u=i[3]&&i[3].params.length<=2&&!b(i[3].params),p=i[4]&&i[4].params.length<=2&&!b(i[4].params),d=i[5]&&i[5].params.length<=2&&!b(i[5].params),f=a&&s&&c&&u&&p&&d,h=i.map((function(e){return O(e.params)})),y=a?v(i[0].params[0]):t,w=s?v(i[1].params[0]):t,j=c?v(i[2].params[0]):t,N=u?v(i[3].params[0]):t,x=p?v(i[4].params[0]):t,k=d?v(i[5].params[0]):t,E=a?v(i[0].params[1]):t,C=s?v(i[1].params[1]):t,S=c?v(i[2].params[1]):t,V=u?v(i[3].params[1]):t,T=p?v(i[4].params[1]):t,P=d?v(i[5].params[1]):t,F=i.map((function(e){return M(e.params,e.fn)})),_=a?F[0]:n,L=s?F[1]:n,I=c?F[2]:n,U=u?F[3]:n,R=p?F[4]:n,q=d?F[5]:n,z=a?i[0].params.length:-1,W=s?i[1].params.length:-1,J=c?i[2].params.length:-1,G=u?i[3].params.length:-1,Y=p?i[4].params.length:-1,X=d?i[5].params.length:-1,Q=f?6:0,ee=i.length,te=function(){for(var t=Q;t<ee;t++)if(h[t](arguments))return F[t].apply(this,arguments);return l.onMismatch(e,arguments,i)},ne=function e(t,n){return arguments.length===z&&y(t)&&E(n)?_.apply(e,arguments):arguments.length===W&&w(t)&&C(n)?L.apply(e,arguments):arguments.length===J&&j(t)&&S(n)?I.apply(e,arguments):arguments.length===G&&N(t)&&V(n)?U.apply(e,arguments):arguments.length===Y&&x(t)&&T(n)?R.apply(e,arguments):arguments.length===X&&k(t)&&P(n)?q.apply(e,arguments):te.apply(e,arguments)};try{Object.defineProperty(ne,"name",{value:e})}catch(re){}return ne.signatures=D(i),ne}function _(e,t,n){throw E(e,t,n)}function L(e){return-1===l.ignore.indexOf(e)}function I(e){return e.trim()}function U(e){return!!e}function H(e){return null!==e}function R(e){return 0===e.types.length}function q(e){return e.slice(0,e.length-1)}function z(e){return e[e.length-1]}function W(e,t,n){return Array.prototype.slice.call(e,t,n)}function J(e,t){return-1!==e.indexOf(t)}function G(e,t){for(var n=0;n<e.length;n++)if(J(t,e[n]))return!0;return!1}function K(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function Y(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;return Object.keys(t)}function Z(e,t){return Array.prototype.concat.apply([],e.map(t))}function X(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(("object"===typeof r.signatures||"string"===typeof r.signature)&&""!==r.name)if(""===t)t=r.name;else if(t!==r.name){var o=new Error("Function names do not match (expected: "+t+", actual: "+r.name+")");throw o.data={actual:r.name,expected:t},o}}return t}function Q(e){var t,n={};function r(e,r){if(n.hasOwnProperty(e)&&r!==n[e])throw t=new Error('Signature "'+e+'" is defined twice'),t.data={signature:e},t}for(var o=0;o<e.length;o++){var i=e[o];if("object"===typeof i.signatures)for(var a in i.signatures)i.signatures.hasOwnProperty(a)&&(r(a,i.signatures[a]),n[a]=i.signatures[a]);else{if("string"!==typeof i.signature)throw t=new TypeError("Function is no typed-function (index: "+o+")"),t.data={index:o},t;r(i.signature,i),n[i.signature]=i}}return n}return l=F("typed",{"string, Object":F,Object:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(e[n]);var r=X(t);return F(r,e)},"...Function":function(e){return F(X(e),Q(e))},"string, ...Function":function(e,t){return F(e,Q(t))}}),l.create=r,l.types=o,l.conversions=s,l.ignore=a,l.onMismatch=_,l.throwMismatchError=_,l.createError=E,l.convert=f,l.find=d,l.addType=function(e,t){if(!e||"string"!==typeof e.name||"function"!==typeof e.test)throw new TypeError("Object with properties {name: string, test: function} expected");if(!1!==t)for(var n=0;n<l.types.length;n++)if("Object"===l.types[n].name)return void l.types.splice(n,0,e);l.types.push(e)},l.addConversion=function(e){if(!e||"string"!==typeof e.from||"string"!==typeof e.to||"function"!==typeof e.convert)throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");l.conversions.push(e)},l}return r()}))},"8bbf":function(e,n){e.exports=t},a559:function(e,t){function n(){return e.exports=n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.__esModule=!0,e.exports["default"]=e.exports,n.apply(this,arguments)}e.exports=n,e.exports.__esModule=!0,e.exports["default"]=e.exports},c0e2:function(e,t){function n(){}n.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;for(r;r<o;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],o=[];if(r&&t)for(var i=0,a=r.length;i<a;i++)r[i].fn!==t&&r[i].fn._!==t&&o.push(r[i]);return o.length?n[e]=o:delete n[e],this}},e.exports=n,e.exports.TinyEmitter=n},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"expressions",(function(){return vi})),n.d(t,"FormField",(function(){return ol})),n.d(t,"Field",(function(){return ll})),n.d(t,"PluginSettings",(function(){return Wl})),n.d(t,"PluginFilter",(function(){return rc})),n.d(t,"PluginManagement",(function(){return lc})),n.d(t,"PluginUpload",(function(){return fc})),n.d(t,"SaveButton",(function(){return yc})),n.d(t,"Form",(function(){return wc})),n.d(t,"GroupedSettings",(function(){return El})),n.d(t,"PluginsIntro",(function(){return Sc})),n.d(t,"ThemesIntro",(function(){return $c})),n.d(t,"PasswordConfirmation",(function(){return $l})),n.d(t,"PluginName",(function(){return Ic})),n.d(t,"PluginsTable",(function(){return Mp})),n.d(t,"PluginsTableWithUpdates",(function(){return cd})),n.d(t,"UploadPluginDialog",(function(){return Nd})),"undefined"!==typeof window){var r=window.document.currentScript,o=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);o&&(n.p=o[1])}var i=n("a559"),a=n.n(i);function s(e){return"number"===typeof e}function l(e){return!(!e||"object"!==typeof e||"function"!==typeof e.constructor)&&(!0===e.isBigNumber&&"object"===typeof e.constructor.prototype&&!0===e.constructor.prototype.isBigNumber||"function"===typeof e.constructor.isDecimal&&!0===e.constructor.isDecimal(e))}function c(e){return e&&"object"===typeof e&&!0===Object.getPrototypeOf(e).isComplex||!1}function u(e){return e&&"object"===typeof e&&!0===Object.getPrototypeOf(e).isFraction||!1}function p(e){return e&&!0===e.constructor.prototype.isUnit||!1}function d(e){return"string"===typeof e}var f=Array.isArray;function m(e){return e&&!0===e.constructor.prototype.isMatrix||!1}function h(e){return Array.isArray(e)||m(e)}function g(e){return e&&e.isDenseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function b(e){return e&&e.isSparseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function y(e){return e&&!0===e.constructor.prototype.isRange||!1}function v(e){return e&&!0===e.constructor.prototype.isIndex||!1}function O(e){return"boolean"===typeof e}function w(e){return e&&!0===e.constructor.prototype.isResultSet||!1}function j(e){return e&&!0===e.constructor.prototype.isHelp||!1}function N(e){return"function"===typeof e}function x(e){return e instanceof Date}function k(e){return e instanceof RegExp}function E(e){return!(!e||"object"!==typeof e||e.constructor!==Object||c(e)||u(e))}function C(e){return null===e}function S(e){return void 0===e}function V(e){return e&&!0===e.isAccessorNode&&!0===e.constructor.prototype.isNode||!1}function A(e){return e&&!0===e.isArrayNode&&!0===e.constructor.prototype.isNode||!1}function T(e){return e&&!0===e.isAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function M(e){return e&&!0===e.isBlockNode&&!0===e.constructor.prototype.isNode||!1}function P(e){return e&&!0===e.isConditionalNode&&!0===e.constructor.prototype.isNode||!1}function D(e){return e&&!0===e.isConstantNode&&!0===e.constructor.prototype.isNode||!1}function B(e){return e&&!0===e.isFunctionAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function $(e){return e&&!0===e.isFunctionNode&&!0===e.constructor.prototype.isNode||!1}function F(e){return e&&!0===e.isIndexNode&&!0===e.constructor.prototype.isNode||!1}function _(e){return e&&!0===e.isNode&&!0===e.constructor.prototype.isNode||!1}function L(e){return e&&!0===e.isObjectNode&&!0===e.constructor.prototype.isNode||!1}function I(e){return e&&!0===e.isOperatorNode&&!0===e.constructor.prototype.isNode||!1}function U(e){return e&&!0===e.isParenthesisNode&&!0===e.constructor.prototype.isNode||!1}function H(e){return e&&!0===e.isRangeNode&&!0===e.constructor.prototype.isNode||!1}function R(e){return e&&!0===e.isSymbolNode&&!0===e.constructor.prototype.isNode||!1}function q(e){return e&&!0===e.constructor.prototype.isChain||!1}function z(e){var t=typeof e;return"object"===t?null===e?"null":Array.isArray(e)?"Array":e instanceof Date?"Date":e instanceof RegExp?"RegExp":l(e)?"BigNumber":c(e)?"Complex":u(e)?"Fraction":m(e)?"Matrix":p(e)?"Unit":v(e)?"Index":y(e)?"Range":w(e)?"ResultSet":_(e)?e.type:q(e)?"Chain":j(e)?"Help":"Object":"function"===t?"Function":t}function W(e){var t=typeof e;if("number"===t||"string"===t||"boolean"===t||null===e||void 0===e)return e;if("function"===typeof e.clone)return e.clone();if(Array.isArray(e))return e.map((function(e){return W(e)}));if(e instanceof Date)return new Date(e.valueOf());if(l(e))return e;if(e instanceof RegExp)throw new TypeError("Cannot clone "+e);return J(e,W)}function J(e,t){var n={};for(var r in e)Q(e,r)&&(n[r]=t(e[r]));return n}function G(e,t){if(Array.isArray(t))throw new TypeError("Arrays are not supported by deepExtend");for(var n in t)if(Q(t,n)&&!(n in Object.prototype)&&!(n in Function.prototype))if(t[n]&&t[n].constructor===Object)void 0===e[n]&&(e[n]={}),e[n]&&e[n].constructor===Object?G(e[n],t[n]):e[n]=t[n];else{if(Array.isArray(t[n]))throw new TypeError("Arrays are not supported by deepExtend");e[n]=t[n]}return e}function K(e,t){var n,r,o;if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(r=0,o=e.length;r<o;r++)if(!K(e[r],t[r]))return!1;return!0}if("function"===typeof e)return e===t;if(e instanceof Object){if(Array.isArray(t)||!(t instanceof Object))return!1;for(n in e)if(!(n in t)||!K(e[n],t[n]))return!1;for(n in t)if(!(n in e))return!1;return!0}return e===t}function Y(e){var t={};return Z(e,t),t}function Z(e,t){for(var n in e)if(Q(e,n)){var r=e[n];"object"===typeof r&&null!==r?Z(r,t):t[n]=r}}function X(e,t,n){var r,o=!0;Object.defineProperty(e,t,{get:function(){return o&&(r=n(),o=!1),r},set:function(e){r=e,o=!1},configurable:!0,enumerable:!0})}function Q(e,t){return e&&Object.hasOwnProperty.call(e,t)}function ee(e){return e&&"function"===typeof e.factory}function te(e,t){for(var n={},r=0;r<t.length;r++){var o=t[r],i=e[o];void 0!==i&&(n[o]=i)}return n}function ne(e){return Object.keys(e).map(t=>e[t])}var re=n("c0e2"),oe=n.n(re);function ie(e){var t=new oe.a;return e.on=t.on.bind(t),e.off=t.off.bind(t),e.once=t.once.bind(t),e.emit=t.emit.bind(t),e}function ae(e){return"boolean"===typeof e||!!isFinite(e)&&e===Math.round(e)}var se=Math.sign||function(e){return e>0?1:e<0?-1:0},le=Math.log2||function(e){return Math.log(e)/Math.LN2},ce=Math.log10||function(e){return Math.log(e)/Math.LN10},ue=Math.log1p||function(e){return Math.log(e+1)},pe=Math.cbrt||function(e){if(0===e)return e;var t,n=e<0;return n&&(e=-e),isFinite(e)?(t=Math.exp(Math.log(e)/3),t=(e/(t*t)+2*t)/3):t=e,n?-t:t},de=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function fe(e,t,n){var r={2:"0b",8:"0o",16:"0x"},o=r[t],i="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!ae(n))throw new Error("size must be an integer");if(e>2**(n-1)-1||e<-(2**(n-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!ae(e))throw new Error("Value must be an integer");e<0&&(e+=2**n),i="i".concat(n)}var a="";return e<0&&(e=-e,a="-"),"".concat(a).concat(o).concat(e.toString(t)).concat(i)}function me(e,t){if("function"===typeof t)return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var n,r,o="auto";if(t&&(t.notation&&(o=t.notation),s(t)?n=t:s(t.precision)&&(n=t.precision),t.wordSize&&(r=t.wordSize,"number"!==typeof r)))throw new Error('Option "wordSize" must be a number');switch(o){case"fixed":return be(e,n);case"exponential":return ye(e,n);case"engineering":return ge(e,n);case"bin":return fe(e,2,r);case"oct":return fe(e,8,r);case"hex":return fe(e,16,r);case"auto":return ve(e,n,t&&t).replace(/((\.\d*?)(0+))($|e)/,(function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t}));default:throw new Error('Unknown notation "'+o+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function he(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var n=t[1],r=t[2],o=parseFloat(t[4]||"0"),i=r.indexOf(".");o+=-1!==i?i-1:r.length-1;var a=r.replace(".","").replace(/^0*/,(function(e){return o-=e.length,""})).replace(/0*$/,"").split("").map((function(e){return parseInt(e)}));return 0===a.length&&(a.push(0),o++),{sign:n,coefficients:a,exponent:o}}function ge(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=he(e),r=Oe(n,t),o=r.exponent,i=r.coefficients,a=o%3===0?o:o<0?o-3-o%3:o-o%3;if(s(t))while(t>i.length||o-a+1>i.length)i.push(0);else for(var l=Math.abs(o-a)-(i.length-1),c=0;c<l;c++)i.push(0);var u=Math.abs(o-a),p=1;while(u>0)p++,u--;var d=i.slice(p).join(""),f=s(t)&&d.length||d.match(/[1-9]/)?"."+d:"",m=i.slice(0,p).join("")+f+"e"+(o>=0?"+":"")+a.toString();return r.sign+m}function be(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=he(e),r="number"===typeof t?Oe(n,n.exponent+1+t):n,o=r.coefficients,i=r.exponent+1,a=i+(t||0);return o.length<a&&(o=o.concat(we(a-o.length))),i<0&&(o=we(1-i).concat(o),i=1),i<o.length&&o.splice(i,0,0===i?"0.":"."),r.sign+o.join("")}function ye(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=he(e),r=t?Oe(n,t):n,o=r.coefficients,i=r.exponent;o.length<t&&(o=o.concat(we(t-o.length)));var a=o.shift();return r.sign+a+(o.length>0?"."+o.join(""):"")+"e"+(i>=0?"+":"")+i}function ve(e,t,n){if(isNaN(e)||!isFinite(e))return String(e);var r=n&&void 0!==n.lowerExp?n.lowerExp:-3,o=n&&void 0!==n.upperExp?n.upperExp:5,i=he(e),a=t?Oe(i,t):i;if(a.exponent<r||a.exponent>=o)return ye(e,t);var s=a.coefficients,l=a.exponent;s.length<t&&(s=s.concat(we(t-s.length))),s=s.concat(we(l-s.length+1+(s.length<t?t-s.length:0))),s=we(-l).concat(s);var c=l>0?l:0;return c<s.length-1&&s.splice(c+1,0,"."),a.sign+s.join("")}function Oe(e,t){var n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=n.coefficients;while(t<=0)r.unshift(0),n.exponent++,t++;if(r.length>t){var o=r.splice(t,r.length-t);if(o[0]>=5){var i=t-1;r[i]++;while(10===r[i])r.pop(),0===i&&(r.unshift(0),n.exponent++,i++),i--,r[i]++}}return n}function we(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}function je(e){return e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length}Number.EPSILON;var Ne=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)},xe=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},ke=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},Ee=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},Ce=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},Se=Math.tanh||function(e){var t=Math.exp(2*e);return(t-1)/(t+1)};function Ve(e,t,n){var r=e.constructor,o=new r(2),i="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!ae(n))throw new Error("size must be an integer");if(e.greaterThan(o.pow(n-1).sub(1))||e.lessThan(o.pow(n-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(o.pow(n))),i="i".concat(n)}switch(t){case 2:return"".concat(e.toBinary()).concat(i);case 8:return"".concat(e.toOctal()).concat(i);case 16:return"".concat(e.toHexadecimal()).concat(i);default:throw new Error("Base ".concat(t," not supported "))}}function Ae(e,t){if("function"===typeof t)return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var n,r,o="auto";if(void 0!==t&&(t.notation&&(o=t.notation),"number"===typeof t?n=t:t.precision&&(n=t.precision),t.wordSize&&(r=t.wordSize,"number"!==typeof r)))throw new Error('Option "wordSize" must be a number');switch(o){case"fixed":return Pe(e,n);case"exponential":return Me(e,n);case"engineering":return Te(e,n);case"bin":return Ve(e,2,r);case"oct":return Ve(e,8,r);case"hex":return Ve(e,16,r);case"auto":var i,a=t&&void 0!==t.lowerExp?t.lowerExp:-3,s=t&&void 0!==t.upperExp?t.upperExp:5;if(e.isZero())return"0";var l=e.toSignificantDigits(n),c=l.e;return i=c>=a&&c<s?l.toFixed():Me(e,n),i.replace(/((\.\d*?)(0+))($|e)/,(function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t}));default:throw new Error('Unknown notation "'+o+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Te(e,t){var n=e.e,r=n%3===0?n:n<0?n-3-n%3:n-n%3,o=e.mul(Math.pow(10,-r)),i=o.toPrecision(t);return-1!==i.indexOf("e")&&(i=o.toString()),i+"e"+(n>=0?"+":"")+r.toString()}function Me(e,t){return void 0!==t?e.toExponential(t-1):e.toExponential()}function Pe(e,t){return e.toFixed(t)}function De(e,t){var n=Be(e,t);return t&&"object"===typeof t&&"truncate"in t&&n.length>t.truncate?n.substring(0,t.truncate-3)+"...":n}function Be(e,t){if("number"===typeof e)return me(e,t);if(l(e))return Ae(e,t);if(Le(e))return t&&"decimal"===t.fraction?e.toString():e.s*e.n+"/"+e.d;if(Array.isArray(e))return _e(e,t);if(d(e))return'"'+e+'"';if("function"===typeof e)return e.syntax?String(e.syntax):"function";if(e&&"object"===typeof e){if("function"===typeof e.format)return e.format(t);if(e&&e.toString(t)!=={}.toString())return e.toString(t);var n=Object.keys(e).map(n=>'"'+n+'": '+De(e[n],t));return"{"+n.join(", ")+"}"}return String(e)}function $e(e){var t=String(e),n="",r=0;while(r<t.length){var o=t.charAt(r);"\\"===o?(n+=o,r++,o=t.charAt(r),""!==o&&-1!=='"\\/bfnrtu'.indexOf(o)||(n+="\\"),n+=o):n+='"'===o?'\\"':o,r++}return'"'+n+'"'}function Fe(e){var t=String(e);return t=t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">"),t}function _e(e,t){if(Array.isArray(e)){for(var n="[",r=e.length,o=0;o<r;o++)0!==o&&(n+=", "),n+=_e(e[o],t);return n+="]",n}return De(e,t)}function Le(e){return e&&"object"===typeof e&&"number"===typeof e.s&&"number"===typeof e.n&&"number"===typeof e.d||!1}function Ie(e,t,n){if(!(this instanceof Ie))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=(new Error).stack}function Ue(e,t,n){if(!(this instanceof Ue))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=n),void 0!==this.min&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":void 0!==this.max&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=(new Error).stack}function He(e){var t=[];while(Array.isArray(e))t.push(e.length),e=e[0];return t}function Re(e,t){return Array.prototype.map.call(e,t)}function qe(e,t){Array.prototype.forEach.call(e,t)}function ze(e,t){return Array.prototype.join.call(e,t)}function We(e,t){return-1!==e.indexOf(t)}function Je(e,t,n,r){function o(r){var o=te(r,t.map(Ze));return Ke(e,t,r),n(o)}return o.isFactory=!0,o.fn=e,o.dependencies=t.slice().sort(),r&&(o.meta=r),o}function Ge(e){return"function"===typeof e&&"string"===typeof e.fn&&Array.isArray(e.dependencies)}function Ke(e,t,n){var r=t.filter(e=>!Ye(e)).every(e=>void 0!==n[e]);if(!r){var o=t.filter(e=>void 0===n[e]);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(o.map(e=>'"'.concat(e,'"')).join(", "),"."))}}function Ye(e){return e&&"?"===e[0]}function Ze(e){return e&&"?"===e[0]?e.slice(1):e}function Xe(e,t,n,r){if(!(this instanceof Xe))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=n,this.max=r,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+n+(void 0!==r&&null!==r?"-"+r:"")+" expected)",this.stack=(new Error).stack}function Qe(e,t,n,r){function o(e,t){var n=arguments.length;if(1!==n&&2!==n)throw new Xe("import",n,1,2);function r(e,n,o){if(Array.isArray(n))n.forEach(t=>r(e,t));else if("object"===typeof n)for(var i in n)Q(n,i)&&r(e,n[i],i);else if(Ge(n)||void 0!==o){var a=Ge(n)?O(n)?n.fn+".transform":n.fn:o;if(Q(e,a)&&e[a]!==n&&!t.silent)throw new Error('Cannot import "'+a+'" twice');e[a]=n}else if(!t.silent)throw new TypeError("Factory, Object, or Array expected")}t||(t={});var o={};for(var a in r(o,e),o)if(Q(o,a)){var s=o[a];if(Ge(s))f(s,t);else if(h(s))i(a,s,t);else if(!t.silent)throw new TypeError("Factory, Object, or Array expected")}}function i(t,o,i){if(i.wrap&&"function"===typeof o&&(o=d(o)),b(o)&&(o=e(t,{[o.signature]:o})),g(n[t])&&g(o))return o=i.override?e(t,o.signatures):e(n[t],o),n[t]=o,delete r[t],a(t,o),void n.emit("import",t,(function(){return o}));if(void 0===n[t]||i.override)return n[t]=o,delete r[t],a(t,o),void n.emit("import",t,(function(){return o}));if(!i.silent)throw new Error('Cannot import "'+t+'": already exists')}function a(e,t){t&&"function"===typeof t.transform?(n.expression.transform[e]=t.transform,y(e)&&(n.expression.mathWithTransform[e]=t.transform)):(delete n.expression.transform[e],y(e)&&(n.expression.mathWithTransform[e]=t))}function s(e){delete n.expression.transform[e],y(e)?n.expression.mathWithTransform[e]=n[e]:delete n.expression.mathWithTransform[e]}function d(e){var t=function(){for(var t=[],r=0,o=arguments.length;r<o;r++){var i=arguments[r];t[r]=i&&i.valueOf()}return e.apply(n,t)};return e.transform&&(t.transform=e.transform),t}function f(t,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.fn;if(We(i,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(i));var a=O(t)?n.expression.transform:n,l=i in n.expression.transform,c=Q(a,i)?a[i]:void 0,u=function(){var r={};t.dependencies.map(Ze).forEach(e=>{if(We(e,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(e));"math"===e?r.math=n:"mathWithTransform"===e?r.mathWithTransform=n.expression.mathWithTransform:"classes"===e?r.classes=n:r[e]=n[e]});var a=t(r);if(a&&"function"===typeof a.transform)throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(void 0===c||o.override)return a;if(g(c)&&g(a))return e(c,a);if(o.silent)return c;throw new Error('Cannot import "'+i+'": already exists')};t.meta&&!1===t.meta.lazy?(a[i]=u(),c&&l?s(i):(O(t)||v(t))&&X(n.expression.mathWithTransform,i,()=>a[i])):(X(a,i,u),c&&l?s(i):(O(t)||v(t))&&X(n.expression.mathWithTransform,i,()=>a[i])),r[i]=t,n.emit("import",i,u)}function h(e){return"function"===typeof e||"number"===typeof e||"string"===typeof e||"boolean"===typeof e||null===e||p(e)||c(e)||l(e)||u(e)||m(e)||Array.isArray(e)}function g(e){return"function"===typeof e&&"object"===typeof e.signatures}function b(e){return"function"===typeof e&&"string"===typeof e.signature}function y(e){return!Q(w,e)}function v(e){return-1===e.fn.indexOf(".")&&!Q(w,e.fn)&&(!e.meta||!e.meta.isClass)}function O(e){return void 0!==e&&void 0!==e.meta&&!0===e.meta.isTransformFunction||!1}var w={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return o}Ie.prototype=new RangeError,Ie.prototype.constructor=RangeError,Ie.prototype.name="DimensionError",Ie.prototype.isDimensionError=!0,Ue.prototype=new RangeError,Ue.prototype.constructor=RangeError,Ue.prototype.name="IndexError",Ue.prototype.isIndexError=!0,Xe.prototype=new Error,Xe.prototype.constructor=Error,Xe.prototype.name="ArgumentsError",Xe.prototype.isArgumentsError=!0;var et={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null},tt=["Matrix","Array"],nt=["number","BigNumber","Fraction"];function rt(e,t){function n(n){if(n){var r=J(e,W);it(n,"matrix",tt),it(n,"number",nt),G(e,n);var o=J(e,W),i=J(n,W);return t("config",o,r,i),o}return J(e,W)}return n.MATRIX_OPTIONS=tt,n.NUMBER_OPTIONS=nt,Object.keys(et).forEach(t=>{Object.defineProperty(n,t,{get:()=>e[t],enumerable:!0,configurable:!0})}),n}function ot(e,t){return-1!==e.indexOf(t)}function it(e,t,n){void 0===e[t]||ot(n,e[t])||console.warn('Warning: Unknown value "'+e[t]+'" for configuration option "'+t+'". Available options: '+n.map(e=>JSON.stringify(e)).join(", ")+".")}function at(e,t){var n=a()({},et,t);if("function"!==typeof Object.create)throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var r=ie({isNumber:s,isComplex:c,isBigNumber:l,isFraction:u,isUnit:p,isString:d,isArray:f,isMatrix:m,isCollection:h,isDenseMatrix:g,isSparseMatrix:b,isRange:y,isIndex:v,isBoolean:O,isResultSet:w,isHelp:j,isFunction:N,isDate:x,isRegExp:k,isObject:E,isNull:C,isUndefined:S,isAccessorNode:V,isArrayNode:A,isAssignmentNode:T,isBlockNode:M,isConditionalNode:P,isConstantNode:D,isFunctionAssignmentNode:B,isFunctionNode:$,isIndexNode:F,isNode:_,isObjectNode:L,isOperatorNode:I,isParenthesisNode:U,isRangeNode:H,isSymbolNode:R,isChain:q});r.config=rt(n,r.emit),r.expression={transform:{},mathWithTransform:{config:r.config}};var o=[],i=[];function z(e){if(Ge(e))return e(r);var t=e[Object.keys(e)[0]];if(Ge(t))return t(r);if(!ee(e))throw console.warn("Factory object with properties `type`, `name`, and `factory` expected",e),new Error("Factory object with properties `type`, `name`, and `factory` expected");var a,s=o.indexOf(e);return-1===s?(a=!0===e.math?e.factory(r.type,n,z,r.typed,r):e.factory(r.type,n,z,r.typed),o.push(e),i.push(a)):a=i[s],a}var W={};function J(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.typed.apply(r.typed,t)}var G=Qe(J,z,r,W);return r.import=G,r.on("config",()=>{ne(W).forEach(e=>{e&&e.meta&&e.meta.recreateOnConfigChange&&G(e,{override:!0})})}),r.create=at.bind(null,e),r.factory=Je,r.import(ne(Y(e))),r.ArgumentsError=Xe,r.DimensionError=Ie,r.IndexError=Ue,r}var st=new Set(["end"]);function lt(e,t){if(mt(e)&&pt(e,t))return e[t];if("function"===typeof e[t]&&ft(e,t))throw new Error('Cannot access method "'+t+'" as a property');throw new Error('No access to property "'+t+'"')}function ct(e,t,n){if(mt(e)&&pt(e,t))return e[t]=n,n;throw new Error('No access to property "'+t+'"')}function ut(e,t){return t in e}function pt(e,t){return!(!e||"object"!==typeof e)&&(!!Q(ht,t)||!(t in Object.prototype)&&!(t in Function.prototype))}function dt(e,t){if(!ft(e,t))throw new Error('No access to method "'+t+'"')}function ft(e,t){return null!==e&&void 0!==e&&"function"===typeof e[t]&&(!(Q(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e))&&(!!Q(gt,t)||!(t in Object.prototype)&&!(t in Function.prototype)))}function mt(e){return"object"===typeof e&&e&&e.constructor===Object}var ht={length:!0,name:!0},gt={toString:!0,valueOf:!0,toLocaleString:!0};class bt{constructor(e){this.wrappedObject=e}keys(){return Object.keys(this.wrappedObject)}get(e){return lt(this.wrappedObject,e)}set(e,t){return ct(this.wrappedObject,e,t),this}has(e){return ut(this.wrappedObject,e)}}function yt(){return new Map}function vt(e){if(!e)return yt();if(Ot(e))return e;if(E(e))return new bt(e);throw new Error("createMap can create maps from objects or Maps")}function Ot(e){return!!e&&(e instanceof Map||e instanceof bt||"function"===typeof e.set&&"function"===typeof e.get&&"function"===typeof e.keys&&"function"===typeof e.has)}function wt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var o of n)if(o)if(Ot(o))for(var i of o.keys())e.set(i,o.get(i));else if(E(o))for(var a of Object.keys(o))e.set(a,o[a]);return e}var jt="Node",Nt=["mathWithTransform"],xt=Je(jt,Nt,e=>{var{mathWithTransform:t}=e;function n(){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator")}function r(e){for(var t of[...st])if(e.has(t))throw new Error('Scope contains an illegal symbol, "'+t+'" is a reserved keyword')}return n.prototype.evaluate=function(e){return this.compile().evaluate(e)},n.prototype.type="Node",n.prototype.isNode=!0,n.prototype.comment="",n.prototype.compile=function(){var e=this._compile(t,{}),n={},o=null;function i(t){var i=vt(t);return r(i),e(i,n,o)}return{evaluate:i}},n.prototype._compile=function(e,t){throw new Error("Method _compile should be implemented by type "+this.type)},n.prototype.forEach=function(e){throw new Error("Cannot run forEach on a Node interface")},n.prototype.map=function(e){throw new Error("Cannot run map on a Node interface")},n.prototype._ifNode=function(e){if(!_(e))throw new TypeError("Callback function must return a Node");return e},n.prototype.traverse=function(e){function t(e,n){e.forEach((function(e,r,o){n(e,r,o),t(e,n)}))}e(this,null,null),t(this,e)},n.prototype.transform=function(e){function t(n,r,o){var i=e(n,r,o);return i!==n?i:n.map(t)}return t(this,null,null)},n.prototype.filter=function(e){var t=[];return this.traverse((function(n,r,o){e(n,r,o)&&t.push(n)})),t},n.prototype.clone=function(){throw new Error("Cannot clone a Node interface")},n.prototype.cloneDeep=function(){return this.map((function(e){return e.cloneDeep()}))},n.prototype.equals=function(e){return!!e&&K(this,e)},n.prototype.toString=function(e){var t=this._getCustomString(e);return"undefined"!==typeof t?t:this._toString(e)},n.prototype.toJSON=function(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)},n.prototype.toHTML=function(e){var t=this._getCustomString(e);return"undefined"!==typeof t?t:this.toHTML(e)},n.prototype._toString=function(){throw new Error("_toString not implemented for "+this.type)},n.prototype.toTex=function(e){var t=this._getCustomString(e);return"undefined"!==typeof t?t:this._toTex(e)},n.prototype._toTex=function(e){throw new Error("_toTex not implemented for "+this.type)},n.prototype._getCustomString=function(e){if(e&&"object"===typeof e)switch(typeof e.handler){case"object":case"undefined":return;case"function":return e.handler(this,e);default:throw new TypeError("Object or function expected as callback")}},n.prototype.getIdentifier=function(){return this.type},n.prototype.getContent=function(){return this},n},{isClass:!0,isNode:!0}),kt={createNode:xt},Et="number",Ct="number, number";function St(e){return Math.abs(e)}function Vt(e,t){return e+t}function At(e,t){return e-t}function Tt(e,t){return e*t}function Mt(e,t){return e/t}function Pt(e){return-e}function Dt(e){return e}function Bt(e){return pe(e)}function $t(e){return e*e*e}function Ft(e){return Math.exp(e)}function _t(e){return de(e)}function Lt(e,t){if(!ae(e)||!ae(t))throw new Error("Parameters in function gcd must be integer numbers");var n;while(0!==t)n=e%t,e=t,t=n;return e<0?-e:e}function It(e,t){if(!ae(e)||!ae(t))throw new Error("Parameters in function lcm must be integer numbers");if(0===e||0===t)return 0;var n,r=e*t;while(0!==t)n=t,t=e%n,e=n;return Math.abs(r/e)}function Ut(e){return ce(e)}function Ht(e){return le(e)}function Rt(e){return ue(e)}function qt(e,t){if(t>0)return e-t*Math.floor(e/t);if(0===t)return e;throw new Error("Cannot calculate mod for a negative divisor")}function zt(e){return se(e)}function Wt(e){return Math.sqrt(e)}function Jt(e){return e*e}function Gt(e,t){var n,r,o,i,a=0,s=1,l=1,c=0;if(!ae(e)||!ae(t))throw new Error("Parameters in function xgcd must be integer numbers");while(t)r=Math.floor(e/t),o=e-r*t,n=a,a=s-r*a,s=n,n=l,l=c-r*l,c=n,e=t,t=o;return i=e<0?[-e,-s,-c]:[e,e?s:0,c],i}function Kt(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}function Yt(e){return Math.abs(e)}St.signature=Et,Vt.signature=Ct,At.signature=Ct,Tt.signature=Ct,Mt.signature=Ct,Pt.signature=Et,Dt.signature=Et,Bt.signature=Et,$t.signature=Et,Ft.signature=Et,_t.signature=Et,Lt.signature=Ct,It.signature=Ct,Ut.signature=Et,Ht.signature=Et,Rt.signature=Et,qt.signature=Ct,zt.signature=Et,Wt.signature=Et,Jt.signature=Et,Gt.signature=Ct,Kt.signature=Ct,Yt.signature=Et;var Zt="number",Xt="number, number";function Qt(e,t){if(!ae(e)||!ae(t))throw new Error("Integers expected in function bitAnd");return e&t}function en(e){if(!ae(e))throw new Error("Integer expected in function bitNot");return~e}function tn(e,t){if(!ae(e)||!ae(t))throw new Error("Integers expected in function bitOr");return e|t}function nn(e,t){if(!ae(e)||!ae(t))throw new Error("Integers expected in function bitXor");return e^t}function rn(e,t){if(!ae(e)||!ae(t))throw new Error("Integers expected in function leftShift");return e<<t}function on(e,t){if(!ae(e)||!ae(t))throw new Error("Integers expected in function rightArithShift");return e>>t}function an(e,t){if(!ae(e)||!ae(t))throw new Error("Integers expected in function rightLogShift");return e>>>t}Qt.signature=Xt,en.signature=Zt,tn.signature=Xt,nn.signature=Xt,rn.signature=Xt,on.signature=Xt,an.signature=Xt;var sn="number",ln="number, number";function cn(e){return!e}function un(e,t){return!(!e&&!t)}function pn(e,t){return!!e!==!!t}function dn(e,t){return!(!e||!t)}function fn(e,t){if(t<e)return 1;if(t===e)return t;var n=t+e>>1;return fn(e,n)*fn(n+1,t)}function mn(e,t){if(!ae(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!ae(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(t>e)throw new TypeError("k must be less than or equal to n");for(var n=e-t,r=1,o=t<n?n+1:t+1,i=2,a=t<n?t:n,s=o;s<=e;++s){r*=s;while(i<=a&&r%i===0)r/=i,++i}return i<=a&&(r/=fn(i,a)),r}function hn(e){var t;if(ae(e))return e<=0?isFinite(e)?1/0:NaN:e>171?1/0:fn(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*hn(1-e));if(e>=171.35)return 1/0;if(e>85){var n=e*e,r=n*e,o=r*e,i=o*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*n)-139/(51840*r)-571/(2488320*o)+163879/(209018880*i)+5246819/(75246796800*i*e))}--e,t=bn[0];for(var a=1;a<bn.length;++a)t+=bn[a]/(e+a);var s=e+gn+.5;return Math.sqrt(2*Math.PI)*Math.pow(s,e+.5)*Math.exp(-s)*t}cn.signature=sn,un.signature=ln,pn.signature=ln,dn.signature=ln,mn.signature="number, number",hn.signature="number";var gn=4.7421875,bn=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],yn=.9189385332046728,vn=5,On=7,wn=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];function jn(e){if(e<0)return NaN;if(0===e)return 1/0;if(!isFinite(e))return e;if(e<.5)return Math.log(Math.PI/Math.sin(Math.PI*e))-jn(1-e);e-=1;for(var t=e+vn+.5,n=wn[0],r=On-1;r>=1;r--)n+=wn[r]/(e+r);return yn+(e+.5)*Math.log(t)-t+Math.log(n)}jn.signature="number";var Nn="number",xn="number, number";function kn(e){return Math.acos(e)}function En(e){return Ne(e)}function Cn(e){return Math.atan(1/e)}function Sn(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}function Vn(e){return Math.asin(1/e)}function An(e){var t=1/e;return Math.log(t+Math.sqrt(t*t+1))}function Tn(e){return Math.acos(1/e)}function Mn(e){var t=1/e,n=Math.sqrt(t*t-1);return Math.log(n+t)}function Pn(e){return Math.asin(e)}function Dn(e){return xe(e)}function Bn(e){return Math.atan(e)}function $n(e,t){return Math.atan2(e,t)}function Fn(e){return ke(e)}function _n(e){return Math.cos(e)}function Ln(e){return Ee(e)}function In(e){return 1/Math.tan(e)}function Un(e){var t=Math.exp(2*e);return(t+1)/(t-1)}function Hn(e){return 1/Math.sin(e)}function Rn(e){return 0===e?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*se(e)}function qn(e){return 1/Math.cos(e)}function zn(e){return 2/(Math.exp(e)+Math.exp(-e))}function Wn(e){return Math.sin(e)}function Jn(e){return Ce(e)}function Gn(e){return Math.tan(e)}function Kn(e){return Se(e)}kn.signature=Nn,En.signature=Nn,Cn.signature=Nn,Sn.signature=Nn,Vn.signature=Nn,An.signature=Nn,Tn.signature=Nn,Mn.signature=Nn,Pn.signature=Nn,Dn.signature=Nn,Bn.signature=Nn,$n.signature=xn,Fn.signature=Nn,_n.signature=Nn,Ln.signature=Nn,In.signature=Nn,Un.signature=Nn,Hn.signature=Nn,Rn.signature=Nn,qn.signature=Nn,zn.signature=Nn,Wn.signature=Nn,Jn.signature=Nn,Gn.signature=Nn,Kn.signature=Nn;var Yn="number";function Zn(e){return ae(e)}function Xn(e){return e<0}function Qn(e){return e>0}function er(e){return 0===e}function tr(e){return Number.isNaN(e)}function nr(){throw new Error('No "bignumber" implementation available')}function rr(){throw new Error('No "fraction" implementation available')}function or(){throw new Error('No "matrix" implementation available')}function ir(){throw new Error('No "matrix" implementation available')}Zn.signature=Yn,Xn.signature=Yn,Qn.signature=Yn,er.signature=Yn,tr.signature=Yn;var ar=Je("matrix",[],()=>or),sr=Je("subset",[],()=>ir);lr("combinations",mn),lr("gamma",hn),lr("lgamma",jn);function lr(e,t){return Je(e,["typed"],e=>{var{typed:n}=e;return n(t)})}var cr={createSubset:sr};function ur(e){return e&&e.isIndexError?new Ue(e.index+1,e.min+1,void 0!==e.max?e.max+1:void 0):e}function pr(e){var{subset:t}=e;return function(e,n){try{if(Array.isArray(e))return t(e,n);if(e&&"function"===typeof e.subset)return e.subset(n);if("string"===typeof e)return t(e,n);if("object"===typeof e){if(!n.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return lt(e,n.getObjectProperty())}throw new TypeError("Cannot apply index: unsupported type of object")}catch(r){throw ur(r)}}}var dr="AccessorNode",fr=["subset","Node"],mr=Je(dr,fr,e=>{var{subset:t,Node:n}=e,r=pr({subset:t});function o(e,t){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");if(!_(e))throw new TypeError('Node expected for parameter "object"');if(!F(t))throw new TypeError('IndexNode expected for parameter "index"');this.object=e||null,this.index=t,Object.defineProperty(this,"name",{get:function(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}.bind(this),set:function(){throw new Error("Cannot assign a new name, name is read-only")}})}function i(e){return!(V(e)||A(e)||D(e)||$(e)||L(e)||U(e)||R(e))}return o.prototype=new n,o.prototype.type="AccessorNode",o.prototype.isAccessorNode=!0,o.prototype._compile=function(e,t){var n=this.object._compile(e,t),o=this.index._compile(e,t);if(this.index.isObjectProperty()){var i=this.index.getObjectProperty();return function(e,t,r){return lt(n(e,t,r),i)}}return function(e,t,i){var a=n(e,t,i),s=o(e,t,a);return r(a,s)}},o.prototype.forEach=function(e){e(this.object,"object",this),e(this.index,"index",this)},o.prototype.map=function(e){return new o(this._ifNode(e(this.object,"object",this)),this._ifNode(e(this.index,"index",this)))},o.prototype.clone=function(){return new o(this.object,this.index)},o.prototype._toString=function(e){var t=this.object.toString(e);return i(this.object)&&(t="("+t+")"),t+this.index.toString(e)},o.prototype.toHTML=function(e){var t=this.object.toHTML(e);return i(this.object)&&(t='<span class="math-parenthesis math-round-parenthesis">(</span>'+t+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t+this.index.toHTML(e)},o.prototype._toTex=function(e){var t=this.object.toTex(e);return i(this.object)&&(t="\\left(' + object + '\\right)"),t+this.index.toTex(e)},o.prototype.toJSON=function(){return{mathjs:"AccessorNode",object:this.object,index:this.index}},o.fromJSON=function(e){return new o(e.object,e.index)},o},{isClass:!0,isNode:!0}),hr={NodeDependencies:kt,subsetDependencies:cr,createAccessorNode:mr},gr="ArrayNode",br=["Node"],yr=Je(gr,br,e=>{var{Node:t}=e;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(this.items=e||[],!Array.isArray(this.items)||!this.items.every(_))throw new TypeError("Array containing Nodes expected")}return n.prototype=new t,n.prototype.type="ArrayNode",n.prototype.isArrayNode=!0,n.prototype._compile=function(e,t){var n=Re(this.items,(function(n){return n._compile(e,t)})),r="Array"!==e.config.matrix;if(r){var o=e.matrix;return function(e,t,r){return o(Re(n,(function(n){return n(e,t,r)})))}}return function(e,t,r){return Re(n,(function(n){return n(e,t,r)}))}},n.prototype.forEach=function(e){for(var t=0;t<this.items.length;t++){var n=this.items[t];e(n,"items["+t+"]",this)}},n.prototype.map=function(e){for(var t=[],r=0;r<this.items.length;r++)t[r]=this._ifNode(e(this.items[r],"items["+r+"]",this));return new n(t)},n.prototype.clone=function(){return new n(this.items.slice(0))},n.prototype._toString=function(e){var t=this.items.map((function(t){return t.toString(e)}));return"["+t.join(", ")+"]"},n.prototype.toJSON=function(){return{mathjs:"ArrayNode",items:this.items}},n.fromJSON=function(e){return new n(e.items)},n.prototype.toHTML=function(e){var t=this.items.map((function(t){return t.toHTML(e)}));return'<span class="math-parenthesis math-square-parenthesis">[</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'},n.prototype._toTex=function(e){function t(n,r){var o=n.some(A)&&!n.every(A),i=r||o,a=i?"&":"\\\\",s=n.map((function(n){return n.items?t(n.items,!r):n.toTex(e)})).join(a);return o||!i||i&&!r?"\\begin{bmatrix}"+s+"\\end{bmatrix}":s}return t(this.items,!1)},n},{isClass:!0,isNode:!0}),vr={NodeDependencies:kt,createArrayNode:yr},Or={createMatrix:ar};function wr(e){var{subset:t,matrix:n}=e;return function(e,r,o){try{if(Array.isArray(e))return n(e).subset(r,o).valueOf();if(e&&"function"===typeof e.subset)return e.subset(r,o);if("string"===typeof e)return t(e,r,o);if("object"===typeof e){if(!r.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return ct(e,r.getObjectProperty(),o),e}throw new TypeError("Cannot apply index: unsupported type of object")}catch(i){throw ur(i)}}}var jr=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{associativity:"left",associativeWith:[]}},{"OperatorNode:and":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{associativity:"left",associativeWith:[]},"OperatorNode:unequal":{associativity:"left",associativeWith:[]},"OperatorNode:smaller":{associativity:"left",associativeWith:[]},"OperatorNode:larger":{associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{associativity:"left",associativeWith:[]}},{"OperatorNode:to":{associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{associativity:"left",associativeWith:[]},"OperatorNode:mod":{associativity:"left",associativeWith:[]}},{"OperatorNode:unaryPlus":{associativity:"right"},"OperatorNode:unaryMinus":{associativity:"right"},"OperatorNode:bitNot":{associativity:"right"},"OperatorNode:not":{associativity:"right"}},{"OperatorNode:pow":{associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{associativity:"left"}},{"OperatorNode:transpose":{associativity:"left"}}];function Nr(e,t){var n=e;"keep"!==t&&(n=e.getContent());for(var r=n.getIdentifier(),o=0;o<jr.length;o++)if(r in jr[o])return o;return null}function xr(e,t){var n=e;"keep"!==t&&(n=e.getContent());var r=n.getIdentifier(),o=Nr(n,t);if(null===o)return null;var i=jr[o][r];if(Q(i,"associativity")){if("left"===i.associativity)return"left";if("right"===i.associativity)return"right";throw Error("'"+r+"' has the invalid associativity '"+i.associativity+"'.")}return null}function kr(e,t,n){var r="keep"!==n?e.getContent():e,o="keep"!==n?e.getContent():t,i=r.getIdentifier(),a=o.getIdentifier(),s=Nr(r,n);if(null===s)return null;var l=jr[s][i];if(Q(l,"associativeWith")&&l.associativeWith instanceof Array){for(var c=0;c<l.associativeWith.length;c++)if(l.associativeWith[c]===a)return!0;return!1}return null}var Er="AssignmentNode",Cr=["subset","?matrix","Node"],Sr=Je(Er,Cr,e=>{var{subset:t,matrix:n,Node:r}=e,o=pr({subset:t}),i=wr({subset:t,matrix:n});function a(e,t,n){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");if(this.object=e,this.index=n?t:null,this.value=n||t,!R(e)&&!V(e))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(R(e)&&"end"===e.name)throw new Error('Cannot assign to symbol "end"');if(this.index&&!F(this.index))throw new TypeError('IndexNode expected as "index"');if(!_(this.value))throw new TypeError('Node expected as "value"');Object.defineProperty(this,"name",{get:function(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}.bind(this),set:function(){throw new Error("Cannot assign a new name, name is read-only")}})}function s(e,t){t||(t="keep");var n=Nr(e,t),r=Nr(e.value,t);return"all"===t||null!==r&&r<=n}return a.prototype=new r,a.prototype.type="AssignmentNode",a.prototype.isAssignmentNode=!0,a.prototype._compile=function(e,t){var n=this.object._compile(e,t),r=this.index?this.index._compile(e,t):null,a=this.value._compile(e,t),s=this.object.name;if(this.index){if(this.index.isObjectProperty()){var l=this.index.getObjectProperty();return function(e,t,r){var o=n(e,t,r),i=a(e,t,r);return ct(o,l,i),i}}if(R(this.object))return function(e,t,o){var l=n(e,t,o),c=a(e,t,o),u=r(e,t,l);return e.set(s,i(l,u,c)),c};var c=this.object.object._compile(e,t);if(this.object.index.isObjectProperty()){var u=this.object.index.getObjectProperty();return function(e,t,n){var o=c(e,t,n),s=lt(o,u),l=r(e,t,s),p=a(e,t,n);return ct(o,u,i(s,l,p)),p}}var p=this.object.index._compile(e,t);return function(e,t,n){var s=c(e,t,n),l=p(e,t,s),u=o(s,l),d=r(e,t,u),f=a(e,t,n);return i(s,l,i(u,d,f)),f}}if(!R(this.object))throw new TypeError("SymbolNode expected as object");return function(e,t,n){var r=a(e,t,n);return e.set(s,r),r}},a.prototype.forEach=function(e){e(this.object,"object",this),this.index&&e(this.index,"index",this),e(this.value,"value",this)},a.prototype.map=function(e){var t=this._ifNode(e(this.object,"object",this)),n=this.index?this._ifNode(e(this.index,"index",this)):null,r=this._ifNode(e(this.value,"value",this));return new a(t,n,r)},a.prototype.clone=function(){return new a(this.object,this.index,this.value)},a.prototype._toString=function(e){var t=this.object.toString(e),n=this.index?this.index.toString(e):"",r=this.value.toString(e);return s(this,e&&e.parenthesis)&&(r="("+r+")"),t+n+" = "+r},a.prototype.toJSON=function(){return{mathjs:"AssignmentNode",object:this.object,index:this.index,value:this.value}},a.fromJSON=function(e){return new a(e.object,e.index,e.value)},a.prototype.toHTML=function(e){var t=this.object.toHTML(e),n=this.index?this.index.toHTML(e):"",r=this.value.toHTML(e);return s(this,e&&e.parenthesis)&&(r='<span class="math-paranthesis math-round-parenthesis">(</span>'+r+'<span class="math-paranthesis math-round-parenthesis">)</span>'),t+n+'<span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+r},a.prototype._toTex=function(e){var t=this.object.toTex(e),n=this.index?this.index.toTex(e):"",r=this.value.toTex(e);return s(this,e&&e.parenthesis)&&(r="\\left(".concat(r,"\\right)")),t+n+":="+r},a},{isClass:!0,isNode:!0}),Vr={matrixDependencies:Or,NodeDependencies:kt,subsetDependencies:cr,createAssignmentNode:Sr},Ar="ResultSet",Tr=[],Mr=Je(Ar,Tr,()=>{function e(t){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=t||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(t){return new e(t.entries)},e},{isClass:!0}),Pr={createResultSet:Mr},Dr="BlockNode",Br=["ResultSet","Node"],$r=Je(Dr,Br,e=>{var{ResultSet:t,Node:n}=e;function r(e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!Array.isArray(e))throw new Error("Array expected");this.blocks=e.map((function(e){var t=e&&e.node,n=!e||void 0===e.visible||e.visible;if(!_(t))throw new TypeError('Property "node" must be a Node');if("boolean"!==typeof n)throw new TypeError('Property "visible" must be a boolean');return{node:t,visible:n}}))}return r.prototype=new n,r.prototype.type="BlockNode",r.prototype.isBlockNode=!0,r.prototype._compile=function(e,n){var r=Re(this.blocks,(function(t){return{evaluate:t.node._compile(e,n),visible:t.visible}}));return function(e,n,o){var i=[];return qe(r,(function(t){var r=t.evaluate(e,n,o);t.visible&&i.push(r)})),new t(i)}},r.prototype.forEach=function(e){for(var t=0;t<this.blocks.length;t++)e(this.blocks[t].node,"blocks["+t+"].node",this)},r.prototype.map=function(e){for(var t=[],n=0;n<this.blocks.length;n++){var o=this.blocks[n],i=this._ifNode(e(o.node,"blocks["+n+"].node",this));t[n]={node:i,visible:o.visible}}return new r(t)},r.prototype.clone=function(){var e=this.blocks.map((function(e){return{node:e.node,visible:e.visible}}));return new r(e)},r.prototype._toString=function(e){return this.blocks.map((function(t){return t.node.toString(e)+(t.visible?"":";")})).join("\n")},r.prototype.toJSON=function(){return{mathjs:"BlockNode",blocks:this.blocks}},r.fromJSON=function(e){return new r(e.blocks)},r.prototype.toHTML=function(e){return this.blocks.map((function(t){return t.node.toHTML(e)+(t.visible?"":'<span class="math-separator">;</span>')})).join('<span class="math-separator"><br /></span>')},r.prototype._toTex=function(e){return this.blocks.map((function(t){return t.node.toTex(e)+(t.visible?"":";")})).join("\\;\\;\n")},r},{isClass:!0,isNode:!0}),Fr={NodeDependencies:kt,ResultSetDependencies:Pr,createBlockNode:$r},_r="ConditionalNode",Lr=["Node"],Ir=Je(_r,Lr,e=>{var{Node:t}=e;function n(e,t,r){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!_(e))throw new TypeError("Parameter condition must be a Node");if(!_(t))throw new TypeError("Parameter trueExpr must be a Node");if(!_(r))throw new TypeError("Parameter falseExpr must be a Node");this.condition=e,this.trueExpr=t,this.falseExpr=r}function r(e){if("number"===typeof e||"boolean"===typeof e||"string"===typeof e)return!!e;if(e){if(l(e))return!e.isZero();if(c(e))return!(!e.re&&!e.im);if(p(e))return!!e.value}if(null===e||void 0===e)return!1;throw new TypeError('Unsupported type of condition "'+z(e)+'"')}return n.prototype=new t,n.prototype.type="ConditionalNode",n.prototype.isConditionalNode=!0,n.prototype._compile=function(e,t){var n=this.condition._compile(e,t),o=this.trueExpr._compile(e,t),i=this.falseExpr._compile(e,t);return function(e,t,a){return r(n(e,t,a))?o(e,t,a):i(e,t,a)}},n.prototype.forEach=function(e){e(this.condition,"condition",this),e(this.trueExpr,"trueExpr",this),e(this.falseExpr,"falseExpr",this)},n.prototype.map=function(e){return new n(this._ifNode(e(this.condition,"condition",this)),this._ifNode(e(this.trueExpr,"trueExpr",this)),this._ifNode(e(this.falseExpr,"falseExpr",this)))},n.prototype.clone=function(){return new n(this.condition,this.trueExpr,this.falseExpr)},n.prototype._toString=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=Nr(this,t),r=this.condition.toString(e),o=Nr(this.condition,t);("all"===t||"OperatorNode"===this.condition.type||null!==o&&o<=n)&&(r="("+r+")");var i=this.trueExpr.toString(e),a=Nr(this.trueExpr,t);("all"===t||"OperatorNode"===this.trueExpr.type||null!==a&&a<=n)&&(i="("+i+")");var s=this.falseExpr.toString(e),l=Nr(this.falseExpr,t);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==l&&l<=n)&&(s="("+s+")"),r+" ? "+i+" : "+s},n.prototype.toJSON=function(){return{mathjs:"ConditionalNode",condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}},n.fromJSON=function(e){return new n(e.condition,e.trueExpr,e.falseExpr)},n.prototype.toHTML=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=Nr(this,t),r=this.condition.toHTML(e),o=Nr(this.condition,t);("all"===t||"OperatorNode"===this.condition.type||null!==o&&o<=n)&&(r='<span class="math-parenthesis math-round-parenthesis">(</span>'+r+'<span class="math-parenthesis math-round-parenthesis">)</span>');var i=this.trueExpr.toHTML(e),a=Nr(this.trueExpr,t);("all"===t||"OperatorNode"===this.trueExpr.type||null!==a&&a<=n)&&(i='<span class="math-parenthesis math-round-parenthesis">(</span>'+i+'<span class="math-parenthesis math-round-parenthesis">)</span>');var s=this.falseExpr.toHTML(e),l=Nr(this.falseExpr,t);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==l&&l<=n)&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),r+'<span class="math-operator math-conditional-operator">?</span>'+i+'<span class="math-operator math-conditional-operator">:</span>'+s},n.prototype._toTex=function(e){return"\\begin{cases} {"+this.trueExpr.toTex(e)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(e)+"}\\\\{"+this.falseExpr.toTex(e)+"}, &\\quad{\\text{otherwise}}\\end{cases}"},n},{isClass:!0,isNode:!0}),Ur={NodeDependencies:kt,createConditionalNode:Ir},Hr=n("4788"),Rr=n.n(Hr),qr={Alpha:"A",alpha:"\\alpha",Beta:"B",beta:"\\beta",Gamma:"\\Gamma",gamma:"\\gamma",Delta:"\\Delta",delta:"\\delta",Epsilon:"E",epsilon:"\\epsilon",varepsilon:"\\varepsilon",Zeta:"Z",zeta:"\\zeta",Eta:"H",eta:"\\eta",Theta:"\\Theta",theta:"\\theta",vartheta:"\\vartheta",Iota:"I",iota:"\\iota",Kappa:"K",kappa:"\\kappa",varkappa:"\\varkappa",Lambda:"\\Lambda",lambda:"\\lambda",Mu:"M",mu:"\\mu",Nu:"N",nu:"\\nu",Xi:"\\Xi",xi:"\\xi",Omicron:"O",omicron:"o",Pi:"\\Pi",pi:"\\pi",varpi:"\\varpi",Rho:"P",rho:"\\rho",varrho:"\\varrho",Sigma:"\\Sigma",sigma:"\\sigma",varsigma:"\\varsigma",Tau:"T",tau:"\\tau",Upsilon:"\\Upsilon",upsilon:"\\upsilon",Phi:"\\Phi",phi:"\\phi",varphi:"\\varphi",Chi:"X",chi:"\\chi",Psi:"\\Psi",psi:"\\psi",Omega:"\\Omega",omega:"\\omega",true:"\\mathrm{True}",false:"\\mathrm{False}",i:"i",inf:"\\infty",Inf:"\\infty",infinity:"\\infty",Infinity:"\\infty",oo:"\\infty",lim:"\\lim",undefined:"\\mathbf{?}"},zr={transpose:"^\\top",ctranspose:"^H",factorial:"!",pow:"^",dotPow:".^\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"\\~",not:"\\neg",multiply:"\\cdot",divide:"\\frac",dotMultiply:".\\cdot",dotDivide:".:",mod:"\\mod",add:"+",subtract:"-",to:"\\rightarrow",leftShift:"<<",rightArithShift:">>",rightLogShift:">>>",equal:"=",unequal:"\\neq",smaller:"<",larger:">",smallerEq:"\\leq",largerEq:"\\geq",bitAnd:"\\&",bitXor:"\\underline{|}",bitOr:"|",and:"\\wedge",xor:"\\veebar",or:"\\vee"},Wr={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(zr.add,"${args[1]}\\right)")},cbrt:{1:"\\sqrt[3]{${args[0]}}"},ceil:{1:"\\left\\lceil${args[0]}\\right\\rceil"},cube:{1:"\\left(${args[0]}\\right)^3"},divide:{2:"\\frac{${args[0]}}{${args[1]}}"},dotDivide:{2:"\\left(${args[0]}".concat(zr.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(zr.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(zr.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(zr.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},gcd:"\\gcd\\left(${args}\\right)",hypot:"\\hypot\\left(${args}\\right)",log:{1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},log10:{1:"\\log_{10}\\left(${args[0]}\\right)"},log1p:{1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},log2:"\\log_{2}\\left(${args[0]}\\right)",mod:{2:"\\left(${args[0]}".concat(zr.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(zr.multiply,"${args[1]}\\right)")},norm:{1:"\\left\\|${args[0]}\\right\\|",2:void 0},nthRoot:{2:"\\sqrt[${args[1]}]{${args[0]}}"},nthRoots:{2:"\\{y : $y^{args[1]} = {${args[0]}}\\}"},pow:{2:"\\left(${args[0]}\\right)".concat(zr.pow,"{${args[1]}}")},round:{1:"\\left\\lfloor${args[0]}\\right\\rceil",2:void 0},sign:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},sqrt:{1:"\\sqrt{${args[0]}}"},square:{1:"\\left(${args[0]}\\right)^2"},subtract:{2:"\\left(${args[0]}".concat(zr.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(zr.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(zr.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(zr.bitAnd,"${args[1]}\\right)")},bitNot:{1:zr.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(zr.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(zr.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(zr.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(zr.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(zr.rightLogShift,"${args[1]}\\right)")},bellNumbers:{1:"\\mathrm{B}_{${args[0]}}"},catalan:{1:"\\mathrm{C}_{${args[0]}}"},stirlingS2:{2:"\\mathrm{S}\\left(${args}\\right)"},arg:{1:"\\arg\\left(${args[0]}\\right)"},conj:{1:"\\left(${args[0]}\\right)^*"},im:{1:"\\Im\\left\\lbrace${args[0]}\\right\\rbrace"},re:{1:"\\Re\\left\\lbrace${args[0]}\\right\\rbrace"},and:{2:"\\left(${args[0]}".concat(zr.and,"${args[1]}\\right)")},not:{1:zr.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(zr.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(zr.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(zr.ctranspose)},det:{1:"\\det\\left(${args[0]}\\right)"},dot:{2:"\\left(${args[0]}\\cdot${args[1]}\\right)"},expm:{1:"\\exp\\left(${args[0]}\\right)"},inv:{1:"\\left(${args[0]}\\right)^{-1}"},pinv:{1:"\\left(${args[0]}\\right)^{+}"},sqrtm:{1:"{${args[0]}}".concat(zr.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(zr.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(zr.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(zr.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(zr.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(zr.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(zr.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(zr.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(zr.unequal,"${args[1]}\\right)")},erf:{1:"erf\\left(${args[0]}\\right)"},max:"\\max\\left(${args}\\right)",min:"\\min\\left(${args}\\right)",variance:"\\mathrm{Var}\\left(${args}\\right)",acos:{1:"\\cos^{-1}\\left(${args[0]}\\right)"},acosh:{1:"\\cosh^{-1}\\left(${args[0]}\\right)"},acot:{1:"\\cot^{-1}\\left(${args[0]}\\right)"},acoth:{1:"\\coth^{-1}\\left(${args[0]}\\right)"},acsc:{1:"\\csc^{-1}\\left(${args[0]}\\right)"},acsch:{1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},asec:{1:"\\sec^{-1}\\left(${args[0]}\\right)"},asech:{1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},asin:{1:"\\sin^{-1}\\left(${args[0]}\\right)"},asinh:{1:"\\sinh^{-1}\\left(${args[0]}\\right)"},atan:{1:"\\tan^{-1}\\left(${args[0]}\\right)"},atan2:{2:"\\mathrm{atan2}\\left(${args}\\right)"},atanh:{1:"\\tanh^{-1}\\left(${args[0]}\\right)"},cos:{1:"\\cos\\left(${args[0]}\\right)"},cosh:{1:"\\cosh\\left(${args[0]}\\right)"},cot:{1:"\\cot\\left(${args[0]}\\right)"},coth:{1:"\\coth\\left(${args[0]}\\right)"},csc:{1:"\\csc\\left(${args[0]}\\right)"},csch:{1:"\\mathrm{csch}\\left(${args[0]}\\right)"},sec:{1:"\\sec\\left(${args[0]}\\right)"},sech:{1:"\\mathrm{sech}\\left(${args[0]}\\right)"},sin:{1:"\\sin\\left(${args[0]}\\right)"},sinh:{1:"\\sinh\\left(${args[0]}\\right)"},tan:{1:"\\tan\\left(${args[0]}\\right)"},tanh:{1:"\\tanh\\left(${args[0]}\\right)"},to:{2:"\\left(${args[0]}".concat(zr.to,"${args[1]}\\right)")},numeric:function(e,t){return e.args[0].toTex()},number:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:"0",1:"\\left(${args[0]}\\right)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(qr.i,"\\cdot\\left(${args[1]}\\right)\\right)")},matrix:{0:"\\begin{bmatrix}\\end{bmatrix}",1:"\\left(${args[0]}\\right)",2:"\\left(${args[0]}\\right)"},sparse:{0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},unit:{1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"}},Jr="\\mathrm{${name}}\\left(${args}\\right)",Gr={deg:"^\\circ"};function Kr(e){return Rr()(e,{preserveFormatting:!0})}function Yr(e,t){return t="undefined"!==typeof t&&t,t?Q(Gr,e)?Gr[e]:"\\mathrm{"+Kr(e)+"}":Q(qr,e)?qr[e]:Kr(e)}var Zr="ConstantNode",Xr=["Node"],Qr=Je(Zr,Xr,e=>{var{Node:t}=e;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this.value=e}return n.prototype=new t,n.prototype.type="ConstantNode",n.prototype.isConstantNode=!0,n.prototype._compile=function(e,t){var n=this.value;return function(){return n}},n.prototype.forEach=function(e){},n.prototype.map=function(e){return this.clone()},n.prototype.clone=function(){return new n(this.value)},n.prototype._toString=function(e){return De(this.value,e)},n.prototype.toHTML=function(e){var t=this._toString(e);switch(z(this.value)){case"number":case"BigNumber":case"Fraction":return'<span class="math-number">'+t+"</span>";case"string":return'<span class="math-string">'+t+"</span>";case"boolean":return'<span class="math-boolean">'+t+"</span>";case"null":return'<span class="math-null-symbol">'+t+"</span>";case"undefined":return'<span class="math-undefined">'+t+"</span>";default:return'<span class="math-symbol">'+t+"</span>"}},n.prototype.toJSON=function(){return{mathjs:"ConstantNode",value:this.value}},n.fromJSON=function(e){return new n(e.value)},n.prototype._toTex=function(e){var t=this._toString(e);switch(z(this.value)){case"string":return"\\mathtt{"+Kr(t)+"}";case"number":case"BigNumber":if(!isFinite(this.value))return this.value.valueOf()<0?"-\\infty":"\\infty";var n=t.toLowerCase().indexOf("e");return-1!==n?t.substring(0,n)+"\\cdot10^{"+t.substring(n+1)+"}":t;case"Fraction":return this.value.toLatex();default:return t}},n},{isClass:!0,isNode:!0}),eo={NodeDependencies:kt,createConstantNode:Qr},to=n("7634"),no=n.n(to),ro=function(){return ro=no.a.create,no.a},oo=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],io=Je("typed",oo,(function(e){var{BigNumber:t,Complex:n,DenseMatrix:r,Fraction:o}=e,i=ro();return i.types=[{name:"number",test:s},{name:"Complex",test:c},{name:"BigNumber",test:l},{name:"Fraction",test:u},{name:"Unit",test:p},{name:"string",test:d},{name:"Chain",test:q},{name:"Array",test:f},{name:"Matrix",test:m},{name:"DenseMatrix",test:g},{name:"SparseMatrix",test:b},{name:"Range",test:y},{name:"Index",test:v},{name:"boolean",test:O},{name:"ResultSet",test:w},{name:"Help",test:j},{name:"function",test:N},{name:"Date",test:x},{name:"RegExp",test:k},{name:"null",test:C},{name:"undefined",test:S},{name:"AccessorNode",test:V},{name:"ArrayNode",test:A},{name:"AssignmentNode",test:T},{name:"BlockNode",test:M},{name:"ConditionalNode",test:P},{name:"ConstantNode",test:D},{name:"FunctionNode",test:$},{name:"FunctionAssignmentNode",test:B},{name:"IndexNode",test:F},{name:"Node",test:_},{name:"ObjectNode",test:L},{name:"OperatorNode",test:I},{name:"ParenthesisNode",test:U},{name:"RangeNode",test:H},{name:"SymbolNode",test:R},{name:"Map",test:Ot},{name:"Object",test:E}],i.conversions=[{from:"number",to:"BigNumber",convert:function(e){if(t||ao(e),je(e)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+e+"). Use function bignumber(x) to convert to BigNumber.");return new t(e)}},{from:"number",to:"Complex",convert:function(e){return n||so(e),new n(e,0)}},{from:"number",to:"string",convert:function(e){return e+""}},{from:"BigNumber",to:"Complex",convert:function(e){return n||so(e),new n(e.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(e){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(e){return n||so(e),new n(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){o||co(e);var t=new o(e);if(t.valueOf()!==e)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+e+"). Use function fraction(x) to convert to Fraction.");return t}},{from:"string",to:"number",convert:function(e){var t=Number(e);if(isNaN(t))throw new Error('Cannot convert "'+e+'" to a number');return t}},{from:"string",to:"BigNumber",convert:function(e){t||ao(e);try{return new t(e)}catch(n){throw new Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(e){o||co(e);try{return new o(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){n||so(e);try{return new n(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Complex')}}},{from:"boolean",to:"number",convert:function(e){return+e}},{from:"boolean",to:"BigNumber",convert:function(e){return t||ao(e),new t(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return o||co(e),new o(+e)}},{from:"boolean",to:"string",convert:function(e){return String(e)}},{from:"Array",to:"Matrix",convert:function(e){return r||lo(),new r(e)}},{from:"Matrix",to:"Array",convert:function(e){return e.valueOf()}}],i}));function ao(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function so(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function lo(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function co(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var uo={createTyped:io},po="FunctionAssignmentNode",fo=["typed","Node"],mo=Je(po,fo,e=>{var{typed:t,Node:n}=e;function r(e,t,n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if("string"!==typeof e)throw new TypeError('String expected for parameter "name"');if(!Array.isArray(t))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!_(n))throw new TypeError('Node expected for parameter "expr"');if(st.has(e))throw new Error('Illegal function name, "'+e+'" is a reserved keyword');this.name=e,this.params=t.map((function(e){return e&&e.name||e})),this.types=t.map((function(e){return e&&e.type||"any"})),this.expr=n}function o(e,t){var n=Nr(e,t),r=Nr(e.expr,t);return"all"===t||null!==r&&r<=n}return r.prototype=new n,r.prototype.type="FunctionAssignmentNode",r.prototype.isFunctionAssignmentNode=!0,r.prototype._compile=function(e,n){var r=Object.create(n);qe(this.params,(function(e){r[e]=!0}));var o=this.expr._compile(e,r),i=this.name,a=this.params,s=ze(this.types,","),l=i+"("+ze(this.params,", ")+")";return function(e,n,r){var c={};c[s]=function(){for(var t=Object.create(n),i=0;i<a.length;i++)t[a[i]]=arguments[i];return o(e,t,r)};var u=t(i,c);return u.syntax=l,e.set(i,u),u}},r.prototype.forEach=function(e){e(this.expr,"expr",this)},r.prototype.map=function(e){var t=this._ifNode(e(this.expr,"expr",this));return new r(this.name,this.params.slice(0),t)},r.prototype.clone=function(){return new r(this.name,this.params.slice(0),this.expr)},r.prototype._toString=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=this.expr.toString(e);return o(this,t)&&(n="("+n+")"),this.name+"("+this.params.join(", ")+") = "+n},r.prototype.toJSON=function(){var e=this.types;return{mathjs:"FunctionAssignmentNode",name:this.name,params:this.params.map((function(t,n){return{name:t,type:e[n]}})),expr:this.expr}},r.fromJSON=function(e){return new r(e.name,e.params,e.expr)},r.prototype.toHTML=function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=[],r=0;r<this.params.length;r++)n.push('<span class="math-symbol math-parameter">'+Fe(this.params[r])+"</span>");var i=this.expr.toHTML(e);return o(this,t)&&(i='<span class="math-parenthesis math-round-parenthesis">(</span>'+i+'<span class="math-parenthesis math-round-parenthesis">)</span>'),'<span class="math-function">'+Fe(this.name)+'</span><span class="math-parenthesis math-round-parenthesis">(</span>'+n.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-round-parenthesis">)</span><span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+i},r.prototype._toTex=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=this.expr.toTex(e);return o(this,t)&&(n="\\left(".concat(n,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(Yr).join(",")+"\\right):="+n},r},{isClass:!0,isNode:!0}),ho={NodeDependencies:kt,typedDependencies:uo,createFunctionAssignmentNode:mo},go="SymbolNode",bo=["math","?Unit","Node"],yo=Je(go,bo,e=>{var{math:t,Unit:n,Node:r}=e;function o(e){return!!n&&n.isValuelessUnit(e)}function i(e){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if("string"!==typeof e)throw new TypeError('String expected for parameter "name"');this.name=e}return i.prototype=new r,i.prototype.type="SymbolNode",i.prototype.isSymbolNode=!0,i.prototype._compile=function(e,t){var r=this.name;if(!0===t[r])return function(e,t,n){return t[r]};if(r in e)return function(t,n,o){return t.has(r)?t.get(r):lt(e,r)};var a=o(r);return function(e,t,o){return e.has(r)?e.get(r):a?new n(null,r):i.onUndefinedSymbol(r)}},i.prototype.forEach=function(e){},i.prototype.map=function(e){return this.clone()},i.onUndefinedSymbol=function(e){throw new Error("Undefined symbol "+e)},i.prototype.clone=function(){return new i(this.name)},i.prototype._toString=function(e){return this.name},i.prototype.toHTML=function(e){var t=Fe(this.name);return"true"===t||"false"===t?'<span class="math-symbol math-boolean">'+t+"</span>":"i"===t?'<span class="math-symbol math-imaginary-symbol">'+t+"</span>":"Infinity"===t?'<span class="math-symbol math-infinity-symbol">'+t+"</span>":"NaN"===t?'<span class="math-symbol math-nan-symbol">'+t+"</span>":"null"===t?'<span class="math-symbol math-null-symbol">'+t+"</span>":"undefined"===t?'<span class="math-symbol math-undefined-symbol">'+t+"</span>":'<span class="math-symbol">'+t+"</span>"},i.prototype.toJSON=function(){return{mathjs:"SymbolNode",name:this.name}},i.fromJSON=function(e){return new i(e.name)},i.prototype._toTex=function(e){var n=!1;"undefined"===typeof t[this.name]&&o(this.name)&&(n=!0);var r=Yr(this.name,n);return"\\"===r[0]?r:" "+r},i},{isClass:!0,isNode:!0}),vo={NodeDependencies:kt,createSymbolNode:yo};function Oo(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"===typeof e.createSubScope?wt(e.createSubScope(),...n):wt(yt(),e,...n)}var wo="FunctionNode",jo=["math","Node","SymbolNode"],No=Je(wo,jo,e=>{var{math:t,Node:n,SymbolNode:r}=e;function o(e,t){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");if("string"===typeof e&&(e=new r(e)),!_(e))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(t)||!t.every(_))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=e,this.args=t||[],Object.defineProperty(this,"name",{get:function(){return this.fn.name||""}.bind(this),set:function(){throw new Error("Cannot assign a new name, name is read-only")}})}o.prototype=new n,o.prototype.type="FunctionNode",o.prototype.isFunctionNode=!0;var i=e=>De(e,{truncate:78});o.prototype._compile=function(e,t){if(!(this instanceof o))throw new TypeError("No valid FunctionNode");var n=this.args.map(n=>n._compile(e,t));if(!R(this.fn)){if(V(this.fn)&&F(this.fn.index)&&this.fn.index.isObjectProperty()){var r=this.fn.object._compile(e,t),a=this.fn.index.getObjectProperty(),s=this.args;return function(t,o,i){var l=r(t,o,i);dt(l,a);var c=l[a]&&l[a].rawArgs;if(c)return l[a](s,e,Oo(t,o),t);var u=n.map(e=>e(t,o,i));return l[a].apply(l,u)}}var l=this.fn.toString(),c=this.fn._compile(e,t),u=this.args;return function(t,r,o){var a=c(t,r,o);if("function"!==typeof a)throw new TypeError("Expression '".concat(l,"' did not evaluate to a function; value is:")+"\n ".concat(i(a)));if(a.rawArgs)return a(u,e,Oo(t,r),t);var s=n.map(e=>e(t,r,o));return a.apply(a,s)}}var p=this.fn.name;if(t[p]){var d=this.args;return function(t,r,o){var a=r[p];if("function"!==typeof a)throw new TypeError("Argument '".concat(p,"' was not a function; received: ").concat(i(a)));if(a.rawArgs)return a(d,e,Oo(t,r),t);var s=n.map(e=>e(t,r,o));return a.apply(a,s)}}var f=p in e?lt(e,p):void 0,m="function"===typeof f&&!0===f.rawArgs,h=t=>{var n;if(t.has(p))n=t.get(p);else{if(!(p in e))return o.onUndefinedFunction(p);n=lt(e,p)}if("function"===typeof n)return n;throw new TypeError("'".concat(p,"' is not a function; its value is:\n ").concat(i(n)))};if(m){var g=this.args;return function(t,n,r){var o=h(t);return o(g,e,Oo(t,n),t)}}switch(n.length){case 0:return function(e,t,n){var r=h(e);return r()};case 1:return function(e,t,r){var o=h(e),i=n[0];return o(i(e,t,r))};case 2:return function(e,t,r){var o=h(e),i=n[0],a=n[1];return o(i(e,t,r),a(e,t,r))};default:return function(e,t,r){var o=h(e),i=n.map(n=>n(e,t,r));return o(...i)}}},o.prototype.forEach=function(e){e(this.fn,"fn",this);for(var t=0;t<this.args.length;t++)e(this.args[t],"args["+t+"]",this)},o.prototype.map=function(e){for(var t=this._ifNode(e(this.fn,"fn",this)),n=[],r=0;r<this.args.length;r++)n[r]=this._ifNode(e(this.args[r],"args["+r+"]",this));return new o(t,n)},o.prototype.clone=function(){return new o(this.fn,this.args.slice(0))},o.onUndefinedFunction=function(e){throw new Error("Undefined function "+e)};var a=o.prototype.toString;function s(e,t,n){var r,o="",i=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,a=0;while(null!==(r=i.exec(e)))if(o+=e.substring(a,r.index),a=r.index,"$$"===r[0])o+="$",a++;else{a+=r[0].length;var s=t[r[1]];if(!s)throw new ReferenceError("Template: Property "+r[1]+" does not exist.");if(void 0===r[2])switch(typeof s){case"string":o+=s;break;case"object":if(_(s))o+=s.toTex(n);else{if(!Array.isArray(s))throw new TypeError("Template: "+r[1]+" has to be a Node, String or array of Nodes");o+=s.map((function(e,t){if(_(e))return e.toTex(n);throw new TypeError("Template: "+r[1]+"["+t+"] is not a Node.")})).join(",")}break;default:throw new TypeError("Template: "+r[1]+" has to be a Node, String or array of Nodes")}else{if(!_(s[r[2]]&&s[r[2]]))throw new TypeError("Template: "+r[1]+"["+r[2]+"] is not a Node.");o+=s[r[2]].toTex(n)}}return o+=e.slice(a),o}o.prototype.toString=function(e){var t,n=this.fn.toString(e);return e&&"object"===typeof e.handler&&Q(e.handler,n)&&(t=e.handler[n](this,e)),"undefined"!==typeof t?t:a.call(this,e)},o.prototype._toString=function(e){var t=this.args.map((function(t){return t.toString(e)})),n=B(this.fn)?"("+this.fn.toString(e)+")":this.fn.toString(e);return n+"("+t.join(", ")+")"},o.prototype.toJSON=function(){return{mathjs:"FunctionNode",fn:this.fn,args:this.args}},o.fromJSON=function(e){return new o(e.fn,e.args)},o.prototype.toHTML=function(e){var t=this.args.map((function(t){return t.toHTML(e)}));return'<span class="math-function">'+Fe(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'};var l=o.prototype.toTex;return o.prototype.toTex=function(e){var t;return e&&"object"===typeof e.handler&&Q(e.handler,this.name)&&(t=e.handler[this.name](this,e)),"undefined"!==typeof t?t:l.call(this,e)},o.prototype._toTex=function(e){var n,r,o=this.args.map((function(t){return t.toTex(e)}));switch(Wr[this.name]&&(n=Wr[this.name]),!t[this.name]||"function"!==typeof t[this.name].toTex&&"object"!==typeof t[this.name].toTex&&"string"!==typeof t[this.name].toTex||(n=t[this.name].toTex),typeof n){case"function":r=n(this,e);break;case"string":r=s(n,this,e);break;case"object":switch(typeof n[o.length]){case"function":r=n[o.length](this,e);break;case"string":r=s(n[o.length],this,e);break}}return"undefined"!==typeof r?r:s(Jr,this,e)},o.prototype.getIdentifier=function(){return this.type+":"+this.name},o},{isClass:!0,isNode:!0}),xo={NodeDependencies:kt,SymbolNodeDependencies:vo,createFunctionNode:No},ko="size",Eo=["typed","config","?matrix"],Co=Je(ko,Eo,e=>{var{typed:t,config:n,matrix:r}=e;return t(ko,{Matrix:function(e){return e.create(e.size())},Array:He,string:function(e){return"Array"===n.matrix?[e.length]:r([e.length])},"number | Complex | BigNumber | Unit | boolean | null":function(e){return"Array"===n.matrix?[]:r?r([]):or()}})}),So={matrixDependencies:Or,typedDependencies:uo,createSize:Co},Vo="IndexNode",Ao=["Node","size"],To=Je(Vo,Ao,e=>{var{Node:t,size:n}=e;function r(e,t){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(this.dimensions=e,this.dotNotation=t||!1,!Array.isArray(e)||!e.every(_))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}return r.prototype=new t,r.prototype.type="IndexNode",r.prototype.isIndexNode=!0,r.prototype._compile=function(e,t){var r=Re(this.dimensions,(function(r,o){var i=r.filter(e=>e.isSymbolNode&&"end"===e.name).length>0;if(i){var a=Object.create(t);a.end=!0;var s=r._compile(e,a);return function(e,t,r){if(!m(r)&&!f(r)&&!d(r))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+z(r));var i=n(r).valueOf(),a=Object.create(t);return a.end=i[o],s(e,a,r)}}return r._compile(e,t)})),o=lt(e,"index");return function(e,t,n){var i=Re(r,(function(r){return r(e,t,n)}));return o(...i)}},r.prototype.forEach=function(e){for(var t=0;t<this.dimensions.length;t++)e(this.dimensions[t],"dimensions["+t+"]",this)},r.prototype.map=function(e){for(var t=[],n=0;n<this.dimensions.length;n++)t[n]=this._ifNode(e(this.dimensions[n],"dimensions["+n+"]",this));return new r(t,this.dotNotation)},r.prototype.clone=function(){return new r(this.dimensions.slice(0),this.dotNotation)},r.prototype.isObjectProperty=function(){return 1===this.dimensions.length&&D(this.dimensions[0])&&"string"===typeof this.dimensions[0].value},r.prototype.getObjectProperty=function(){return this.isObjectProperty()?this.dimensions[0].value:null},r.prototype._toString=function(e){return this.dotNotation?"."+this.getObjectProperty():"["+this.dimensions.join(", ")+"]"},r.prototype.toJSON=function(){return{mathjs:"IndexNode",dimensions:this.dimensions,dotNotation:this.dotNotation}},r.fromJSON=function(e){return new r(e.dimensions,e.dotNotation)},r.prototype.toHTML=function(e){for(var t=[],n=0;n<this.dimensions.length;n++)t[n]=this.dimensions[n].toHTML();return this.dotNotation?'<span class="math-operator math-accessor-operator">.</span><span class="math-symbol math-property">'+Fe(this.getObjectProperty())+"</span>":'<span class="math-parenthesis math-square-parenthesis">[</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'},r.prototype._toTex=function(e){var t=this.dimensions.map((function(t){return t.toTex(e)}));return this.dotNotation?"."+this.getObjectProperty():"_{"+t.join(",")+"}"},r},{isClass:!0,isNode:!0}),Mo={NodeDependencies:kt,sizeDependencies:So,createIndexNode:To},Po="ObjectNode",Do=["Node"],Bo=Je(Po,Do,e=>{var{Node:t}=e;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(this.properties=e||{},e&&("object"!==typeof e||!Object.keys(e).every((function(t){return _(e[t])}))))throw new TypeError("Object containing Nodes expected")}return n.prototype=new t,n.prototype.type="ObjectNode",n.prototype.isObjectNode=!0,n.prototype._compile=function(e,t){var n={};for(var r in this.properties)if(Q(this.properties,r)){var o=$e(r),i=JSON.parse(o);if(!pt(this.properties,i))throw new Error('No access to property "'+i+'"');n[i]=this.properties[r]._compile(e,t)}return function(e,t,r){var o={};for(var i in n)Q(n,i)&&(o[i]=n[i](e,t,r));return o}},n.prototype.forEach=function(e){for(var t in this.properties)Q(this.properties,t)&&e(this.properties[t],"properties["+$e(t)+"]",this)},n.prototype.map=function(e){var t={};for(var r in this.properties)Q(this.properties,r)&&(t[r]=this._ifNode(e(this.properties[r],"properties["+$e(r)+"]",this)));return new n(t)},n.prototype.clone=function(){var e={};for(var t in this.properties)Q(this.properties,t)&&(e[t]=this.properties[t]);return new n(e)},n.prototype._toString=function(e){var t=[];for(var n in this.properties)Q(this.properties,n)&&t.push($e(n)+": "+this.properties[n].toString(e));return"{"+t.join(", ")+"}"},n.prototype.toJSON=function(){return{mathjs:"ObjectNode",properties:this.properties}},n.fromJSON=function(e){return new n(e.properties)},n.prototype.toHTML=function(e){var t=[];for(var n in this.properties)Q(this.properties,n)&&t.push('<span class="math-symbol math-property">'+Fe(n)+'</span><span class="math-operator math-assignment-operator math-property-assignment-operator math-binary-operator">:</span>'+this.properties[n].toHTML(e));return'<span class="math-parenthesis math-curly-parenthesis">{</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-curly-parenthesis">}</span>'},n.prototype._toTex=function(e){var t=[];for(var n in this.properties)Q(this.properties,n)&&t.push("\\mathbf{"+n+":} & "+this.properties[n].toTex(e)+"\\\\");return"\\left\\{\\begin{array}{ll}".concat(t.join("\n"),"\\end{array}\\right\\}")},n},{isClass:!0,isNode:!0}),$o={NodeDependencies:kt,createObjectNode:Bo},Fo="OperatorNode",_o=["Node"],Lo=Je(Fo,_o,e=>{var{Node:t}=e;function n(e,t,r,o,i){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if("string"!==typeof e)throw new TypeError('string expected for parameter "op"');if("string"!==typeof t)throw new TypeError('string expected for parameter "fn"');if(!Array.isArray(r)||!r.every(_))throw new TypeError('Array containing Nodes expected for parameter "args"');this.implicit=!0===o,this.isPercentage=!0===i,this.op=e,this.fn=t,this.args=r||[]}function r(e,t,n,r,o){var i,a=Nr(e,t),s=xr(e,t);if("all"===t||r.length>2&&"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier())return r.map((function(e){switch(e.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}}));switch(r.length){case 0:i=[];break;case 1:var l=Nr(r[0],t);if(o&&null!==l){var c,u;if("keep"===t?(c=r[0].getIdentifier(),u=e.getIdentifier()):(c=r[0].getContent().getIdentifier(),u=e.getContent().getIdentifier()),!1===jr[a][u].latexLeftParens){i=[!1];break}if(!1===jr[l][c].latexParens){i=[!1];break}}if(null===l){i=[!1];break}if(l<=a){i=[!0];break}i=[!1];break;case 2:var p,d,f=Nr(r[0],t),m=kr(e,r[0],t);p=null!==f&&(f===a&&"right"===s&&!m||f<a);var h,g,b,y=Nr(r[1],t),v=kr(e,r[1],t);if(d=null!==y&&(y===a&&"left"===s&&!v||y<a),o)"keep"===t?(h=e.getIdentifier(),g=e.args[0].getIdentifier(),b=e.args[1].getIdentifier()):(h=e.getContent().getIdentifier(),g=e.args[0].getContent().getIdentifier(),b=e.args[1].getContent().getIdentifier()),null!==f&&(!1===jr[a][h].latexLeftParens&&(p=!1),!1===jr[f][g].latexParens&&(p=!1)),null!==y&&(!1===jr[a][h].latexRightParens&&(d=!1),!1===jr[y][b].latexParens&&(d=!1));i=[p,d];break;default:"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier()||(i=r.map((function(n){var r=Nr(n,t),o=kr(e,n,t),i=xr(n,t);return null!==r&&(a===r&&s===i&&!o||r<a)})));break}return r.length>=2&&"OperatorNode:multiply"===e.getIdentifier()&&e.implicit&&"auto"===t&&"hide"===n&&(i=r.map((function(e,t){var n="ParenthesisNode"===e.getIdentifier();return!(!i[t]&&!n)}))),i}return n.prototype=new t,n.prototype.type="OperatorNode",n.prototype.isOperatorNode=!0,n.prototype._compile=function(e,t){if("string"!==typeof this.fn||!ft(e,this.fn))throw e[this.fn]?new Error('No access to function "'+this.fn+'"'):new Error("Function "+this.fn+' missing in provided namespace "math"');var n=lt(e,this.fn),r=Re(this.args,(function(n){return n._compile(e,t)}));if(1===r.length){var o=r[0];return function(e,t,r){return n(o(e,t,r))}}if(2===r.length){var i=r[0],a=r[1];return function(e,t,r){return n(i(e,t,r),a(e,t,r))}}return function(e,t,o){return n.apply(null,Re(r,(function(n){return n(e,t,o)})))}},n.prototype.forEach=function(e){for(var t=0;t<this.args.length;t++)e(this.args[t],"args["+t+"]",this)},n.prototype.map=function(e){for(var t=[],r=0;r<this.args.length;r++)t[r]=this._ifNode(e(this.args[r],"args["+r+"]",this));return new n(this.op,this.fn,t,this.implicit,this.isPercentage)},n.prototype.clone=function(){return new n(this.op,this.fn,this.args.slice(0),this.implicit,this.isPercentage)},n.prototype.isUnary=function(){return 1===this.args.length},n.prototype.isBinary=function(){return 2===this.args.length},n.prototype._toString=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=e&&e.implicit?e.implicit:"hide",o=this.args,i=r(this,t,n,o,!1);if(1===o.length){var a=xr(this,t),s=o[0].toString(e);i[0]&&(s="("+s+")");var l=/[a-zA-Z]+/.test(this.op);return"right"===a?this.op+(l?" ":"")+s:"left"===a?s+(l?" ":"")+this.op:s+this.op}if(2===o.length){var c=o[0].toString(e),u=o[1].toString(e);return i[0]&&(c="("+c+")"),i[1]&&(u="("+u+")"),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?c+" "+u:c+" "+this.op+" "+u}if(o.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var p=o.map((function(t,n){return t=t.toString(e),i[n]&&(t="("+t+")"),t}));return this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?p.join(" "):p.join(" "+this.op+" ")}return this.fn+"("+this.args.join(", ")+")"},n.prototype.toJSON=function(){return{mathjs:"OperatorNode",op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}},n.fromJSON=function(e){return new n(e.op,e.fn,e.args,e.implicit,e.isPercentage)},n.prototype.toHTML=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=e&&e.implicit?e.implicit:"hide",o=this.args,i=r(this,t,n,o,!1);if(1===o.length){var a=xr(this,t),s=o[0].toHTML(e);return i[0]&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),"right"===a?'<span class="math-operator math-unary-operator math-lefthand-unary-operator">'+Fe(this.op)+"</span>"+s:s+'<span class="math-operator math-unary-operator math-righthand-unary-operator">'+Fe(this.op)+"</span>"}if(2===o.length){var l=o[0].toHTML(e),c=o[1].toHTML(e);return i[0]&&(l='<span class="math-parenthesis math-round-parenthesis">(</span>'+l+'<span class="math-parenthesis math-round-parenthesis">)</span>'),i[1]&&(c='<span class="math-parenthesis math-round-parenthesis">(</span>'+c+'<span class="math-parenthesis math-round-parenthesis">)</span>'),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?l+'<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'+c:l+'<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Fe(this.op)+"</span>"+c}var u=o.map((function(t,n){return t=t.toHTML(e),i[n]&&(t='<span class="math-parenthesis math-round-parenthesis">(</span>'+t+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t}));return o.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())?this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?u.join('<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'):u.join('<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Fe(this.op)+"</span>"):'<span class="math-function">'+Fe(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+u.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'},n.prototype._toTex=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=e&&e.implicit?e.implicit:"hide",o=this.args,i=r(this,t,n,o,!0),a=zr[this.fn];if(a="undefined"===typeof a?this.op:a,1===o.length){var s=xr(this,t),l=o[0].toTex(e);return i[0]&&(l="\\left(".concat(l,"\\right)")),"right"===s?a+l:l+a}if(2===o.length){var c=o[0],u=c.toTex(e);i[0]&&(u="\\left(".concat(u,"\\right)"));var p,d=o[1],f=d.toTex(e);switch(i[1]&&(f="\\left(".concat(f,"\\right)")),p="keep"===t?c.getIdentifier():c.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return a+"{"+u+"}{"+f+"}";case"OperatorNode:pow":switch(u="{"+u+"}",f="{"+f+"}",p){case"ConditionalNode":case"OperatorNode:divide":u="\\left(".concat(u,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&"hide"===n)return u+"~"+f}return u+a+f}if(o.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var m=o.map((function(t,n){return t=t.toTex(e),i[n]&&(t="\\left(".concat(t,"\\right)")),t}));return"OperatorNode:multiply"===this.getIdentifier()&&this.implicit?m.join("~"):m.join(a)}return"\\mathrm{"+this.fn+"}\\left("+o.map((function(t){return t.toTex(e)})).join(",")+"\\right)"},n.prototype.getIdentifier=function(){return this.type+":"+this.fn},n},{isClass:!0,isNode:!0}),Io={NodeDependencies:kt,createOperatorNode:Lo},Uo="ParenthesisNode",Ho=["Node"],Ro=Je(Uo,Ho,e=>{var{Node:t}=e;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!_(e))throw new TypeError('Node expected for parameter "content"');this.content=e}return n.prototype=new t,n.prototype.type="ParenthesisNode",n.prototype.isParenthesisNode=!0,n.prototype._compile=function(e,t){return this.content._compile(e,t)},n.prototype.getContent=function(){return this.content.getContent()},n.prototype.forEach=function(e){e(this.content,"content",this)},n.prototype.map=function(e){var t=e(this.content,"content",this);return new n(t)},n.prototype.clone=function(){return new n(this.content)},n.prototype._toString=function(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"("+this.content.toString(e)+")":this.content.toString(e)},n.prototype.toJSON=function(){return{mathjs:"ParenthesisNode",content:this.content}},n.fromJSON=function(e){return new n(e.content)},n.prototype.toHTML=function(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?'<span class="math-parenthesis math-round-parenthesis">(</span>'+this.content.toHTML(e)+'<span class="math-parenthesis math-round-parenthesis">)</span>':this.content.toHTML(e)},n.prototype._toTex=function(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"\\left(".concat(this.content.toTex(e),"\\right)"):this.content.toTex(e)},n},{isClass:!0,isNode:!0}),qo={NodeDependencies:kt,createParenthesisNode:Ro},zo="RangeNode",Wo=["Node"],Jo=Je(zo,Wo,e=>{var{Node:t}=e;function n(e,t,r){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!_(e))throw new TypeError("Node expected");if(!_(t))throw new TypeError("Node expected");if(r&&!_(r))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=e,this.end=t,this.step=r||null}function r(e,t){var n=Nr(e,t),r={},o=Nr(e.start,t);if(r.start=null!==o&&o<=n||"all"===t,e.step){var i=Nr(e.step,t);r.step=null!==i&&i<=n||"all"===t}var a=Nr(e.end,t);return r.end=null!==a&&a<=n||"all"===t,r}return n.prototype=new t,n.prototype.type="RangeNode",n.prototype.isRangeNode=!0,n.prototype.needsEnd=function(){var e=this.filter((function(e){return R(e)&&"end"===e.name}));return e.length>0},n.prototype._compile=function(e,t){var n=e.range,r=this.start._compile(e,t),o=this.end._compile(e,t);if(this.step){var i=this.step._compile(e,t);return function(e,t,a){return n(r(e,t,a),o(e,t,a),i(e,t,a))}}return function(e,t,i){return n(r(e,t,i),o(e,t,i))}},n.prototype.forEach=function(e){e(this.start,"start",this),e(this.end,"end",this),this.step&&e(this.step,"step",this)},n.prototype.map=function(e){return new n(this._ifNode(e(this.start,"start",this)),this._ifNode(e(this.end,"end",this)),this.step&&this._ifNode(e(this.step,"step",this)))},n.prototype.clone=function(){return new n(this.start,this.end,this.step&&this.step)},n.prototype._toString=function(e){var t,n=e&&e.parenthesis?e.parenthesis:"keep",o=r(this,n),i=this.start.toString(e);if(o.start&&(i="("+i+")"),t=i,this.step){var a=this.step.toString(e);o.step&&(a="("+a+")"),t+=":"+a}var s=this.end.toString(e);return o.end&&(s="("+s+")"),t+=":"+s,t},n.prototype.toJSON=function(){return{mathjs:"RangeNode",start:this.start,end:this.end,step:this.step}},n.fromJSON=function(e){return new n(e.start,e.end,e.step)},n.prototype.toHTML=function(e){var t,n=e&&e.parenthesis?e.parenthesis:"keep",o=r(this,n),i=this.start.toHTML(e);if(o.start&&(i='<span class="math-parenthesis math-round-parenthesis">(</span>'+i+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t=i,this.step){var a=this.step.toHTML(e);o.step&&(a='<span class="math-parenthesis math-round-parenthesis">(</span>'+a+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t+='<span class="math-operator math-range-operator">:</span>'+a}var s=this.end.toHTML(e);return o.end&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t+='<span class="math-operator math-range-operator">:</span>'+s,t},n.prototype._toTex=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=r(this,t),o=this.start.toTex(e);if(n.start&&(o="\\left(".concat(o,"\\right)")),this.step){var i=this.step.toTex(e);n.step&&(i="\\left(".concat(i,"\\right)")),o+=":"+i}var a=this.end.toTex(e);return n.end&&(a="\\left(".concat(a,"\\right)")),o+=":"+a,o},n},{isClass:!0,isNode:!0}),Go={NodeDependencies:kt,createRangeNode:Jo},Ko="RelationalNode",Yo=["Node"],Zo=Je(Ko,Yo,e=>{var{Node:t}=e;function n(e,t){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!Array.isArray(e))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(t))throw new TypeError("Parameter params must be an array");if(e.length!==t.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=e,this.params=t}return n.prototype=new t,n.prototype.type="RelationalNode",n.prototype.isRelationalNode=!0,n.prototype._compile=function(e,t){var n=this,r=this.params.map(n=>n._compile(e,t));return function(t,o,i){for(var a,s=r[0](t,o,i),l=0;l<n.conditionals.length;l++){a=s,s=r[l+1](t,o,i);var c=lt(e,n.conditionals[l]);if(!c(a,s))return!1}return!0}},n.prototype.forEach=function(e){this.params.forEach((t,n)=>e(t,"params["+n+"]",this),this)},n.prototype.map=function(e){return new n(this.conditionals.slice(),this.params.map((t,n)=>this._ifNode(e(t,"params["+n+"]",this)),this))},n.prototype.clone=function(){return new n(this.conditionals,this.params)},n.prototype._toString=function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=Nr(this,t),r=this.params.map((function(r,o){var i=Nr(r,t);return"all"===t||null!==i&&i<=n?"("+r.toString(e)+")":r.toString(e)})),o={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="},i=r[0],a=0;a<this.conditionals.length;a++)i+=" "+o[this.conditionals[a]]+" "+r[a+1];return i},n.prototype.toJSON=function(){return{mathjs:"RelationalNode",conditionals:this.conditionals,params:this.params}},n.fromJSON=function(e){return new n(e.conditionals,e.params)},n.prototype.toHTML=function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=Nr(this,t),r=this.params.map((function(r,o){var i=Nr(r,t);return"all"===t||null!==i&&i<=n?'<span class="math-parenthesis math-round-parenthesis">(</span>'+r.toHTML(e)+'<span class="math-parenthesis math-round-parenthesis">)</span>':r.toHTML(e)})),o={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="},i=r[0],a=0;a<this.conditionals.length;a++)i+='<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Fe(o[this.conditionals[a]])+"</span>"+r[a+1];return i},n.prototype._toTex=function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=Nr(this,t),r=this.params.map((function(r,o){var i=Nr(r,t);return"all"===t||null!==i&&i<=n?"\\left("+r.toTex(e)+"\right)":r.toTex(e)})),o=r[0],i=0;i<this.conditionals.length;i++)o+=zr[this.conditionals[i]]+r[i+1];return o},n},{isClass:!0,isNode:!0}),Xo={NodeDependencies:kt,createRelationalNode:Zo};function Qo(e,t,n){return e&&"function"===typeof e.map?e.map((function(e){return Qo(e,t,n)})):t(e)}var ei="number",ti=["typed"];function ni(e){var t=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(t){var n={"0b":2,"0o":8,"0x":16}[t[1]],r=t[2],o=t[3];return{input:e,radix:n,integerPart:r,fractionalPart:o}}return null}function ri(e){for(var t=parseInt(e.integerPart,e.radix),n=0,r=0;r<e.fractionalPart.length;r++){var o=parseInt(e.fractionalPart[r],e.radix);n+=o/Math.pow(e.radix,r+1)}var i=t+n;if(isNaN(i))throw new SyntaxError('String "'+e.input+'" is no valid number');return i}var oi=Je(ei,ti,e=>{var{typed:t}=e,n=t("number",{"":function(){return 0},number:function(e){return e},string:function(e){if("NaN"===e)return NaN;var t=ni(e);if(t)return ri(t);var n=0,r=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);r&&(n=Number(r[2]),e=r[1]);var o=Number(e);if(isNaN(o))throw new SyntaxError('String "'+e+'" is no valid number');if(r){if(o>2**n-1)throw new SyntaxError('String "'.concat(e,'" is out of range'));o>=2**(n-1)&&(o-=2**n)}return o},BigNumber:function(e){return e.toNumber()},Fraction:function(e){return e.valueOf()},Unit:function(e){throw new Error("Second argument with valueless unit expected")},null:function(e){return 0},"Unit, string | Unit":function(e,t){return e.toNumber(t)},"Array | Matrix":function(e){return Qo(e,this)}});return n.fromJSON=function(e){return parseFloat(e.value)},n}),ii={typedDependencies:uo,createNumber:oi},ai="numeric",si=["number","?bignumber","?fraction"],li=Je(ai,si,e=>{var{number:t,bignumber:n,fraction:r}=e,o={string:!0,number:!0,BigNumber:!0,Fraction:!0},i={number:e=>t(e),BigNumber:n?e=>n(e):nr,Fraction:r?e=>r(e):rr};return function(e,t){var n=z(e);if(!(n in o))throw new TypeError("Cannot convert "+e+' of type "'+n+'"; valid input types are '+Object.keys(o).join(", "));if(!(t in i))throw new TypeError("Cannot convert "+e+' to type "'+t+'"; valid output types are '+Object.keys(i).join(", "));return t===n?e:i[t](e)}}),ci={numberDependencies:ii,createNumeric:li},ui="parse",pi=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],di=Je(ui,pi,e=>{var{typed:t,numeric:n,config:r,AccessorNode:o,ArrayNode:i,AssignmentNode:s,BlockNode:l,ConditionalNode:c,ConstantNode:u,FunctionAssignmentNode:p,FunctionNode:d,IndexNode:f,ObjectNode:m,OperatorNode:h,ParenthesisNode:g,RangeNode:b,RelationalNode:y,SymbolNode:v}=e,O=t(ui,{string:function(e){return U(e,{})},"Array | Matrix":function(e){return w(e,{})},"string, Object":function(e,t){var n=void 0!==t.nodes?t.nodes:{};return U(e,n)},"Array | Matrix, Object":w});function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=void 0!==t.nodes?t.nodes:{};return Qo(e,(function(e){if("string"!==typeof e)throw new TypeError("String expected");return U(e,n)}))}var j={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},N={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},x={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},k={true:!0,false:!1,null:null,undefined:void 0},E=["NaN","Infinity"];function C(){return{extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:j.NULL,nestingLevel:0,conditionalLevel:null}}function S(e,t){return e.expression.substr(e.index,t)}function A(e){return S(e,1)}function T(e){e.index++}function M(e){return e.expression.charAt(e.index-1)}function P(e){return e.expression.charAt(e.index+1)}function B(e){e.tokenType=j.NULL,e.token="",e.comment="";while(1){if("#"===A(e))while("\n"!==A(e)&&""!==A(e))e.comment+=A(e),T(e);if(!O.isWhitespace(A(e),e.nestingLevel))break;T(e)}if(""!==A(e)){if("\n"===A(e)&&!e.nestingLevel)return e.tokenType=j.DELIMITER,e.token=A(e),void T(e);var t=A(e),n=S(e,2),r=S(e,3);if(3===r.length&&N[r])return e.tokenType=j.DELIMITER,e.token=r,T(e),T(e),void T(e);if(2===n.length&&N[n])return e.tokenType=j.DELIMITER,e.token=n,T(e),void T(e);if(N[t])return e.tokenType=j.DELIMITER,e.token=t,void T(e);if(O.isDigitDot(t)){e.tokenType=j.NUMBER;var o=S(e,2);if("0b"===o||"0o"===o||"0x"===o){e.token+=A(e),T(e),e.token+=A(e),T(e);while(O.isHexDigit(A(e)))e.token+=A(e),T(e);if("."===A(e)){e.token+=".",T(e);while(O.isHexDigit(A(e)))e.token+=A(e),T(e)}else if("i"===A(e)){e.token+="i",T(e);while(O.isDigit(A(e)))e.token+=A(e),T(e)}return}if("."===A(e)){if(e.token+=A(e),T(e),!O.isDigit(A(e)))return void(e.tokenType=j.DELIMITER)}else{while(O.isDigit(A(e)))e.token+=A(e),T(e);O.isDecimalMark(A(e),P(e))&&(e.token+=A(e),T(e))}while(O.isDigit(A(e)))e.token+=A(e),T(e);if("E"===A(e)||"e"===A(e))if(O.isDigit(P(e))||"-"===P(e)||"+"===P(e)){if(e.token+=A(e),T(e),"+"!==A(e)&&"-"!==A(e)||(e.token+=A(e),T(e)),!O.isDigit(A(e)))throw ke(e,'Digit expected, got "'+A(e)+'"');while(O.isDigit(A(e)))e.token+=A(e),T(e);if(O.isDecimalMark(A(e),P(e)))throw ke(e,'Digit expected, got "'+A(e)+'"')}else if("."===P(e))throw T(e),ke(e,'Digit expected, got "'+A(e)+'"')}else{if(!O.isAlpha(A(e),M(e),P(e))){e.tokenType=j.UNKNOWN;while(""!==A(e))e.token+=A(e),T(e);throw ke(e,'Syntax error in part "'+e.token+'"')}while(O.isAlpha(A(e),M(e),P(e))||O.isDigit(A(e)))e.token+=A(e),T(e);Q(x,e.token)?e.tokenType=j.DELIMITER:e.tokenType=j.SYMBOL}}else e.tokenType=j.DELIMITER}function F(e){do{B(e)}while("\n"===e.token)}function _(e){e.nestingLevel++}function L(e){e.nestingLevel--}function U(e,t){var n=C();a()(n,{expression:e,extraNodes:t}),B(n);var r=H(n);if(""!==n.token)throw n.tokenType===j.DELIMITER?Ee(n,"Unexpected operator "+n.token):ke(n,'Unexpected part "'+n.token+'"');return r}function H(e){var t,n,r=[];""!==e.token&&"\n"!==e.token&&";"!==e.token&&(t=q(e),t.comment=e.comment);while("\n"===e.token||";"===e.token)0===r.length&&t&&(n=";"!==e.token,r.push({node:t,visible:n})),B(e),"\n"!==e.token&&";"!==e.token&&""!==e.token&&(t=q(e),t.comment=e.comment,n=";"!==e.token,r.push({node:t,visible:n}));return r.length>0?new l(r):(t||(t=new u(void 0),t.comment=e.comment),t)}function q(e){var t,n,r,o,i=z(e);if("="===e.token){if(R(i))return t=i.name,F(e),r=q(e),new s(new v(t),r);if(V(i))return F(e),r=q(e),new s(i.object,i.index,r);if($(i)&&R(i.fn)&&(o=!0,n=[],t=i.name,i.args.forEach((function(e,t){R(e)?n[t]=e.name:o=!1})),o))return F(e),r=q(e),new p(t,n,r);throw ke(e,"Invalid left hand side of assignment operator =")}return i}function z(e){var t=W(e);while("?"===e.token){var n=e.conditionalLevel;e.conditionalLevel=e.nestingLevel,F(e);var r=t,o=q(e);if(":"!==e.token)throw ke(e,"False part of conditional expression expected");e.conditionalLevel=null,F(e);var i=q(e);t=new c(r,o,i),e.conditionalLevel=n}return t}function W(e){var t=J(e);while("or"===e.token)F(e),t=new h("or","or",[t,J(e)]);return t}function J(e){var t=G(e);while("xor"===e.token)F(e),t=new h("xor","xor",[t,G(e)]);return t}function G(e){var t=K(e);while("and"===e.token)F(e),t=new h("and","and",[t,K(e)]);return t}function K(e){var t=Y(e);while("|"===e.token)F(e),t=new h("|","bitOr",[t,Y(e)]);return t}function Y(e){var t=Z(e);while("^|"===e.token)F(e),t=new h("^|","bitXor",[t,Z(e)]);return t}function Z(e){var t=X(e);while("&"===e.token)F(e),t=new h("&","bitAnd",[t,X(e)]);return t}function X(e){var t=[ee(e)],n=[],r={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};while(Q(r,e.token)){var o={name:e.token,fn:r[e.token]};n.push(o),F(e),t.push(ee(e))}return 1===t.length?t[0]:2===t.length?new h(n[0].name,n[0].fn,t):new y(n.map(e=>e.fn),t)}function ee(e){var t,n,r,o;t=te(e);var i={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};while(Q(i,e.token))n=e.token,r=i[n],F(e),o=[t,te(e)],t=new h(n,r,o);return t}function te(e){var t,n,r,o;t=ne(e);var i={to:"to",in:"to"};while(Q(i,e.token))n=e.token,r=i[n],F(e),"in"===n&&""===e.token?t=new h("*","multiply",[t,new v("in")],!0):(o=[t,ne(e)],t=new h(n,r,o));return t}function ne(e){var t,n=[];if(t=":"===e.token?new u(1):re(e),":"===e.token&&e.conditionalLevel!==e.nestingLevel){n.push(t);while(":"===e.token&&n.length<3)F(e),")"===e.token||"]"===e.token||","===e.token||""===e.token?n.push(new v("end")):n.push(re(e));t=3===n.length?new b(n[0],n[2],n[1]):new b(n[0],n[1])}return t}function re(e){var t,n,r,o;t=oe(e);var i={"+":"add","-":"subtract"};while(Q(i,e.token)){n=e.token,r=i[n],F(e);var a=oe(e);o=a.isPercentage?[t,new h("*","multiply",[t,a])]:[t,a],t=new h(n,r,o)}return t}function oe(e){var t,n,r,o;t=ie(e),n=t;var i={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};while(1){if(!Q(i,e.token))break;r=e.token,o=i[r],F(e),n=ie(e),t=new h(r,o,[t,n])}return t}function ie(e){var t,n;t=ae(e),n=t;while(1){if(!(e.tokenType===j.SYMBOL||"in"===e.token&&D(t))&&(e.tokenType!==j.NUMBER||D(n)||I(n)&&"!"!==n.op)&&"("!==e.token)break;n=ae(e),t=new h("*","multiply",[t,n],!0)}return t}function ae(e){var t=se(e),n=t,r=[];while(1){if("/"!==e.token||!D(n))break;if(r.push(a()({},e)),F(e),e.tokenType!==j.NUMBER){a()(e,r.pop());break}if(r.push(a()({},e)),F(e),e.tokenType!==j.SYMBOL&&"("!==e.token){r.pop(),a()(e,r.pop());break}a()(e,r.pop()),r.pop(),n=se(e),t=new h("/","divide",[t,n])}return t}function se(e){var t,n,r,o;t=le(e);var i={"%":"mod",mod:"mod"};while(Q(i,e.token))n=e.token,r=i[n],F(e),"%"===n&&e.tokenType===j.DELIMITER&&"("!==e.token?t=new h("/","divide",[t,new u(100)],!1,!0):(o=[t,le(e)],t=new h(n,r,o));return t}function le(e){var t,n,r,o={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return Q(o,e.token)?(r=o[e.token],t=e.token,F(e),n=[le(e)],new h(t,r,n)):ce(e)}function ce(e){var t,n,r,o;return t=ue(e),"^"!==e.token&&".^"!==e.token||(n=e.token,r="^"===n?"pow":"dotPow",F(e),o=[t,le(e)],t=new h(n,r,o)),t}function ue(e){var t,n,r,o;t=pe(e);var i={"!":"factorial","'":"ctranspose"};while(Q(i,e.token))n=e.token,r=i[n],B(e),o=[t],t=new h(n,r,o),t=fe(e,t);return t}function pe(e){var t=[];if(e.tokenType===j.SYMBOL&&Q(e.extraNodes,e.token)){var n=e.extraNodes[e.token];if(B(e),"("===e.token){if(t=[],_(e),B(e),")"!==e.token){t.push(q(e));while(","===e.token)B(e),t.push(q(e))}if(")"!==e.token)throw ke(e,"Parenthesis ) expected");L(e),B(e)}return new n(t)}return de(e)}function de(e){var t,r;return e.tokenType===j.SYMBOL||e.tokenType===j.DELIMITER&&e.token in x?(r=e.token,B(e),t=Q(k,r)?new u(k[r]):-1!==E.indexOf(r)?new u(n(r,"number")):new v(r),t=fe(e,t),t):me(e)}function fe(e,t,n){var r;while(("("===e.token||"["===e.token||"."===e.token)&&(!n||-1!==n.indexOf(e.token)))if(r=[],"("===e.token){if(!R(t)&&!V(t))return t;if(_(e),B(e),")"!==e.token){r.push(q(e));while(","===e.token)B(e),r.push(q(e))}if(")"!==e.token)throw ke(e,"Parenthesis ) expected");L(e),B(e),t=new d(t,r)}else if("["===e.token){if(_(e),B(e),"]"!==e.token){r.push(q(e));while(","===e.token)B(e),r.push(q(e))}if("]"!==e.token)throw ke(e,"Parenthesis ] expected");L(e),B(e),t=new o(t,new f(r))}else{if(B(e),e.tokenType!==j.SYMBOL)throw ke(e,"Property name expected after dot");r.push(new u(e.token)),B(e);var i=!0;t=new o(t,new f(r,i))}return t}function me(e){var t,n;return'"'===e.token?(n=he(e),t=new u(n),t=fe(e,t),t):ge(e)}function he(e){var t="";while(""!==A(e)&&'"'!==A(e))"\\"===A(e)&&(t+=A(e),T(e)),t+=A(e),T(e);if(B(e),'"'!==e.token)throw ke(e,'End of string " expected');return B(e),JSON.parse('"'+t+'"')}function ge(e){var t,n;return"'"===e.token?(n=be(e),t=new u(n),t=fe(e,t),t):ye(e)}function be(e){var t="";while(""!==A(e)&&"'"!==A(e))"\\"===A(e)&&(t+=A(e),T(e)),t+=A(e),T(e);if(B(e),"'"!==e.token)throw ke(e,"End of string ' expected");return B(e),JSON.parse('"'+t+'"')}function ye(e){var t,n,r,o;if("["===e.token){if(_(e),B(e),"]"!==e.token){var a=ve(e);if(";"===e.token){r=1,n=[a];while(";"===e.token)B(e),n[r]=ve(e),r++;if("]"!==e.token)throw ke(e,"End of matrix ] expected");L(e),B(e),o=n[0].items.length;for(var s=1;s<r;s++)if(n[s].items.length!==o)throw Ee(e,"Column dimensions mismatch ("+n[s].items.length+" !== "+o+")");t=new i(n)}else{if("]"!==e.token)throw ke(e,"End of matrix ] expected");L(e),B(e),t=a}}else L(e),B(e),t=new i([]);return fe(e,t)}return Oe(e)}function ve(e){var t=[q(e)],n=1;while(","===e.token)B(e),t[n]=q(e),n++;return new i(t)}function Oe(e){if("{"===e.token){var t;_(e);var n={};do{if(B(e),"}"!==e.token){if('"'===e.token)t=he(e);else if("'"===e.token)t=be(e);else{if(!(e.tokenType===j.SYMBOL||e.tokenType===j.DELIMITER&&e.token in x))throw ke(e,"Symbol or string expected as object key");t=e.token,B(e)}if(":"!==e.token)throw ke(e,"Colon : expected after object key");B(e),n[t]=q(e)}}while(","===e.token);if("}"!==e.token)throw ke(e,"Comma , or bracket } expected after object value");L(e),B(e);var r=new m(n);return r=fe(e,r),r}return we(e)}function we(e){var t;return e.tokenType===j.NUMBER?(t=e.token,B(e),new u(n(t,r.number))):je(e)}function je(e){var t;if("("===e.token){if(_(e),B(e),t=q(e),")"!==e.token)throw ke(e,"Parenthesis ) expected");return L(e),B(e),t=new g(t),t=fe(e,t),t}return Ne(e)}function Ne(e){throw""===e.token?ke(e,"Unexpected end of expression"):ke(e,"Value expected")}function xe(e){return e.index-e.token.length+1}function ke(e,t){var n=xe(e),r=new SyntaxError(t+" (char "+n+")");return r.char=n,r}function Ee(e,t){var n=xe(e),r=new SyntaxError(t+" (char "+n+")");return r.char=n,r}return O.isAlpha=function(e,t,n){return O.isValidLatinOrGreek(e)||O.isValidMathSymbol(e,n)||O.isValidMathSymbol(t,e)},O.isValidLatinOrGreek=function(e){return/^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(e)},O.isValidMathSymbol=function(e,t){return/^[\uD835]$/.test(e)&&/^[\uDC00-\uDFFF]$/.test(t)&&/^[^\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]$/.test(t)},O.isWhitespace=function(e,t){return" "===e||"\t"===e||"\n"===e&&t>0},O.isDecimalMark=function(e,t){return"."===e&&"/"!==t&&"*"!==t&&"^"!==t},O.isDigitDot=function(e){return e>="0"&&e<="9"||"."===e},O.isDigit=function(e){return e>="0"&&e<="9"},O.isHexDigit=function(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"},O}),fi={AccessorNodeDependencies:hr,ArrayNodeDependencies:vr,AssignmentNodeDependencies:Vr,BlockNodeDependencies:Fr,ConditionalNodeDependencies:Ur,ConstantNodeDependencies:eo,FunctionAssignmentNodeDependencies:ho,FunctionNodeDependencies:xo,IndexNodeDependencies:Mo,ObjectNodeDependencies:$o,OperatorNodeDependencies:Io,ParenthesisNodeDependencies:qo,RangeNodeDependencies:Go,RelationalNodeDependencies:Xo,SymbolNodeDependencies:vo,numericDependencies:ci,typedDependencies:uo,createParse:di},mi="evaluate",hi=["typed","parse"],gi=Je(mi,hi,e=>{var{typed:t,parse:n}=e;return t(mi,{string:function(e){var t=yt();return n(e).compile().evaluate(t)},"string, Map | Object":function(e,t){return n(e).compile().evaluate(t)},"Array | Matrix":function(e){var t=yt();return Qo(e,(function(e){return n(e).compile().evaluate(t)}))},"Array | Matrix, Map | Object":function(e,t){return Qo(e,(function(e){return n(e).compile().evaluate(t)}))}})}),bi={parseDependencies:fi,typedDependencies:uo,createEvaluate:gi},yi=at({evaluateDependencies:bi});yi.import({add:function(e,t){return e+t},subtract:function(e,t){return e-t},multiply:function(e,t){return e*t},divide:function(e,t){return e/t},equal:function(e,t){return e==t},unequal:function(e,t){return e!=t},not:function(e){return!e},and:function(e,t){return e&&t},or:function(e,t){return e||t},largerEq:function(e,t){return e>=t},larger:function(e,t){return e>t},smallerEq:function(e,t){return e<=t},smaller:function(e,t){return e<t}},{override:!0});var vi=yi,Oi=n("8bbf"),wi={class:"form-group row matomo-form-field"},ji={key:0,class:"col s12"},Ni={key:0,class:"form-help"},xi={key:0,class:"inline-help",ref:"inlineHelp"},ki=Object(Oi["createElementVNode"])("br",null,null,-1);function Ei(e,t,n,r,o,i){return Object(Oi["withDirectives"])((Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",wi,[e.formField.introduction?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("h3",ji,Object(Oi["toDisplayString"])(e.formField.introduction),1)):Object(Oi["createCommentVNode"])("",!0),Object(Oi["createElementVNode"])("div",{class:Object(Oi["normalizeClass"])(["col s12",{"input-field":"checkbox"!==e.formField.uiControl&&"radio"!==e.formField.uiControl,"file-field":"file"===e.formField.uiControl,m6:!e.formField.fullWidth}])},[(Object(Oi["openBlock"])(),Object(Oi["createBlock"])(Object(Oi["resolveDynamicComponent"])(e.childComponent),Object(Oi["mergeProps"])(Object.assign(Object.assign({formField:e.formField},e.formField),{},{modelValue:e.processedModelValue,modelModifiers:e.modelModifiers,availableOptions:e.availableOptions},e.extraChildComponentParams),{"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onChange(t)})}),null,16))],2),Object(Oi["createElementVNode"])("div",{class:Object(Oi["normalizeClass"])(["col s12",{m6:!e.formField.fullWidth}])},[e.showFormHelp?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",Ni,[Object(Oi["withDirectives"])(Object(Oi["createElementVNode"])("div",{class:"form-description"},Object(Oi["toDisplayString"])(e.formField.description),513),[[Oi["vShow"],e.formField.description]]),e.formField.inlineHelp||e.hasInlineHelpSlot?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",xi,[e.inlineHelpComponent?(Object(Oi["openBlock"])(),Object(Oi["createBlock"])(Object(Oi["resolveDynamicComponent"])(e.inlineHelpComponent),Object(Oi["normalizeProps"])(Object(Oi["mergeProps"])({key:0},e.inlineHelpBind)),null,16)):Object(Oi["createCommentVNode"])("",!0),Object(Oi["renderSlot"])(e.$slots,"inline-help")],512)):Object(Oi["createCommentVNode"])("",!0),Object(Oi["withDirectives"])(Object(Oi["createElementVNode"])("span",null,[ki,Object(Oi["createTextVNode"])(" "+Object(Oi["toDisplayString"])(e.translate("General_Default"))+": ",1),Object(Oi["createElementVNode"])("span",null,Object(Oi["toDisplayString"])(e.defaultValuePrettyTruncated),1)],512),[[Oi["vShow"],e.showDefaultValue]])])):Object(Oi["createCommentVNode"])("",!0)],2)],512)),[[Oi["vShow"],e.showField]])}var Ci=n("19dc"),Si={class:"checkbox"},Vi=["checked","id","name"],Ai=["innerHTML"];function Ti(e,t,n,r,o,i){return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",Si,[Object(Oi["createElementVNode"])("label",null,[Object(Oi["createElementVNode"])("input",Object(Oi["mergeProps"])({onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},e.uiControlAttributes,{value:1,checked:e.isChecked,type:"checkbox",id:e.name,name:e.name}),null,16,Vi),Object(Oi["createElementVNode"])("span",{innerHTML:e.$sanitize(e.title)},null,8,Ai)])])}var Mi=Object(Oi["defineComponent"])({props:{modelValue:[Boolean,Number,String],modelModifiers:Object,uiControlAttributes:Object,name:String,title:String},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){var t=e.target.checked;if(this.modelValue!==t){var n;if(null===(n=this.modelModifiers)||void 0===n||!n.abortable)return void this.$emit("update:modelValue",t);var r={value:t,abort:function(){e.target.checked=!t}};this.$emit("update:modelValue",r)}}},computed:{isChecked:function(){return!!this.modelValue&&"0"!==this.modelValue}}});Mi.render=Ti;var Pi=Mi,Di={ref:"root"},Bi=["value","checked","onChange","id","name"];function $i(e,t,n,r,o,i){return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",Di,[Object(Oi["withDirectives"])(Object(Oi["createElementVNode"])("label",{class:"fieldRadioTitle"},Object(Oi["toDisplayString"])(e.title),513),[[Oi["vShow"],e.title]]),(Object(Oi["openBlock"])(!0),Object(Oi["createElementBlock"])(Oi["Fragment"],null,Object(Oi["renderList"])(e.availableOptions,(function(t,n){return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("p",{key:n,class:"checkbox"},[Object(Oi["createElementVNode"])("label",null,[Object(Oi["createElementVNode"])("input",Object(Oi["mergeProps"])({value:t.key,checked:!!e.checkboxStates[n],onChange:function(t){return e.onChange(n)}},e.uiControlAttributes,{type:"checkbox",id:"".concat(e.name).concat(t.key),name:t.name}),null,16,Bi),Object(Oi["createElementVNode"])("span",null,Object(Oi["toDisplayString"])(t.value),1),Object(Oi["withDirectives"])(Object(Oi["createElementVNode"])("span",{class:"form-description"},Object(Oi["toDisplayString"])(t.description),513),[[Oi["vShow"],t.description]])])])})),128))],512)}function Fi(e){return Ui(e)||Ii(e)||Li(e)||_i()}function _i(){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 Li(e,t){if(e){if("string"===typeof e)return Hi(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)?Hi(e,t):void 0}}function Ii(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Ui(e){if(Array.isArray(e))return Hi(e)}function Hi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ri(e,t){return(e||[]).map((function(e){return t&&-1!==t.indexOf(e.key)}))}var qi=Object(Oi["defineComponent"])({props:{modelValue:Array,modelModifiers:Object,name:String,title:String,availableOptions:Array,uiControlAttributes:Object,type:String},inheritAttrs:!1,emits:["update:modelValue"],computed:{checkboxStates:function(){return Ri(this.availableOptions,this.modelValue)}},mounted:function(){window.Materialize.updateTextFields()},methods:{onChange:function(e){var t,n=this,r=Fi(this.checkboxStates);r[e]=!r[e];var o=this.availableOptions||{},i=[];if(Object.values(o).forEach((function(e,t){r[t]&&i.push(e.key)})),null!==(t=this.modelModifiers)&&void 0!==t&&t.abortable){var a={value:i,abort:function(){var t=n.$refs.root.querySelectorAll("input").item(e);t.checked=!t.checked}};this.$emit("update:modelValue",a)}else this.$emit("update:modelValue",i)}}});qi.render=$i;var zi=qi,Wi={class:"expandableSelector"},Ji=Object(Oi["createElementVNode"])("svg",{class:"caret",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},[Object(Oi["createElementVNode"])("path",{d:"M7 10l5 5 5-5z"}),Object(Oi["createElementVNode"])("path",{d:"M0 0h24v24H0z",fill:"none"})],-1),Gi=["value"],Ki={class:"expandableList z-depth-2"},Yi={class:"searchContainer"},Zi={class:"collection firstLevel"},Xi=["onClick"],Qi={class:"collection secondLevel"},ea=["onClick"],ta={class:"primary-content"},na=["title"];function ra(e,t,n,r,o,i){var a=Object(Oi["resolveDirective"])("focus-if"),s=Object(Oi["resolveDirective"])("focus-anywhere-but-here");return Object(Oi["withDirectives"])((Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",Wi,[Object(Oi["createElementVNode"])("div",{onClick:t[0]||(t[0]=function(t){return e.showSelect=!e.showSelect}),class:"select-wrapper"},[Ji,Object(Oi["createElementVNode"])("input",{type:"text",class:"select-dropdown",readonly:"readonly",value:e.modelValueText},null,8,Gi)]),Object(Oi["withDirectives"])(Object(Oi["createElementVNode"])("div",Ki,[Object(Oi["createElementVNode"])("div",Yi,[Object(Oi["withDirectives"])(Object(Oi["createElementVNode"])("input",{type:"text",placeholder:"Search","onUpdate:modelValue":t[1]||(t[1]=function(t){return e.searchTerm=t}),class:"expandableSearch browser-default"},null,512),[[Oi["vModelText"],e.searchTerm],[a,e.showSelect]])]),Object(Oi["createElementVNode"])("ul",Zi,[(Object(Oi["openBlock"])(!0),Object(Oi["createElementBlock"])(Oi["Fragment"],null,Object(Oi["renderList"])(e.availableOptions,(function(t,n){return Object(Oi["withDirectives"])((Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("li",{class:"collection-item",key:n},[Object(Oi["createElementVNode"])("h4",{class:"expandableListCategory",onClick:function(n){return e.onCategoryClicked(t)}},[Object(Oi["createTextVNode"])(Object(Oi["toDisplayString"])(t.group)+" ",1),Object(Oi["createElementVNode"])("span",{class:Object(Oi["normalizeClass"])(["secondary-content",{"icon-arrow-right":e.showCategory!==t.group,"icon-arrow-bottom":e.showCategory===t.group}])},null,2)],8,Xi),Object(Oi["withDirectives"])(Object(Oi["createElementVNode"])("ul",Qi,[(Object(Oi["openBlock"])(!0),Object(Oi["createElementBlock"])(Oi["Fragment"],null,Object(Oi["renderList"])(t.values.filter((function(t){return-1!==t.value.toLowerCase().indexOf(e.searchTerm.toLowerCase())})),(function(t){return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("li",{class:"expandableListItem collection-item valign-wrapper",key:t.key,onClick:function(n){return e.onValueClicked(t)}},[Object(Oi["createElementVNode"])("span",ta,Object(Oi["toDisplayString"])(t.value),1),Object(Oi["withDirectives"])(Object(Oi["createElementVNode"])("span",{title:t.tooltip,class:"secondary-content icon-help"},null,8,na),[[Oi["vShow"],t.tooltip]])],8,ea)})),128))],512),[[Oi["vShow"],e.showCategory===t.group||e.searchTerm]])],512)),[[Oi["vShow"],t.values.filter((function(t){return-1!==t.value.toLowerCase().indexOf(e.searchTerm.toLowerCase())})).length]])})),128))])],512),[[Oi["vShow"],e.showSelect]])],512)),[[s,{blur:e.onBlur}]])}function oa(e){var t=[];if(!e)return t;var n={};return Object.values(e).forEach((function(e){var t=e,r=t.group||"";r in n&&n[r]||(n[r]={values:[],group:r});var o={key:t.key,value:t.value};"tooltip"in t&&t.tooltip&&(o.tooltip=t.tooltip),n[r].values.push(o)})),Object.values(n).forEach((function(e){e.values.length&&t.push(e)})),t}var ia=Object(Oi["defineComponent"])({props:{modelValue:[Number,String],modelModifiers:Object,availableOptions:Array,title:String},directives:{FocusAnywhereButHere:Ci["FocusAnywhereButHere"],FocusIf:Ci["FocusIf"]},inheritAttrs:!1,emits:["update:modelValue"],data:function(){return{showSelect:!1,searchTerm:"",showCategory:""}},computed:{modelValueText:function(){if(this.title)return this.title;var e,t=this.modelValue,n=this.availableOptions||[];return n.some((function(n){return e=n.values.find((function(e){return e.key===t})),e})),e?e.value?"".concat(e.value):"":t?"".concat(t):""}},methods:{onBlur:function(){this.showSelect=!1},onCategoryClicked:function(e){this.showCategory===e.group?this.showCategory="":this.showCategory=e.group},onValueClicked:function(e){var t;if(this.showSelect=!1,null!==(t=this.modelModifiers)&&void 0!==t&&t.abortable){var n={value:e.key,abort:function(){}};this.$emit("update:modelValue",n)}else this.$emit("update:modelValue",e.key)}}});ia.render=ra;var aa=ia,sa=["for","innerHTML"];function la(e,t,n,r,o,i){var a=Object(Oi["resolveComponent"])("FieldArray");return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",null,[Object(Oi["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,sa),Object(Oi["createVNode"])(a,{name:e.name,"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onValueUpdate(t)}),"model-modifiers":e.modelModifiers,field:e.uiControlAttributes.field},null,8,["name","model-value","model-modifiers","field"])])}var ca=Object(Oi["defineComponent"])({components:{FieldArray:Ci["FieldArray"]},props:{name:String,title:String,modelValue:null,modelModifiers:Object,uiControlAttributes:Object},inheritAttrs:!1,emits:["update:modelValue"],methods:{onValueUpdate:function(e){this.$emit("update:modelValue",e)}}});ca.render=la;var ua=ca,pa={class:"btn"},da=["for","innerHTML"],fa=["name","id"],ma={class:"file-path-wrapper"},ha=["value"];function ga(e,t,n,r,o,i){return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",null,[Object(Oi["createElementVNode"])("div",pa,[Object(Oi["createElementVNode"])("span",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,da),Object(Oi["createElementVNode"])("input",{ref:"fileInput",name:e.name,type:"file",id:e.name,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},null,40,fa)]),Object(Oi["createElementVNode"])("div",ma,[Object(Oi["createElementVNode"])("input",{class:"file-path validate",value:e.filePath,type:"text"},null,8,ha)])])}var ba=Object(Oi["defineComponent"])({props:{name:String,title:String,modelValue:[String,File],modelModifiers:Object},inheritAttrs:!1,emits:["update:modelValue"],watch:{modelValue:function(e){if(!e||""===e){var t=this.$refs.fileInput;t.value=""}}},methods:{onChange:function(e){var t,n=e.target.files;if(n){var r=n.item(0);if(null!==(t=this.modelModifiers)&&void 0!==t&&t.abortable){var o={value:r,abort:function(){}};this.$emit("update:modelValue",o)}else this.$emit("update:modelValue",r)}}},computed:{filePath:function(){if(this.modelValue instanceof File)return this.$refs.fileInput.value}}});ba.render=ga;var ya=ba,va=["type","name","value"];function Oa(e,t,n,r,o,i){return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",null,[Object(Oi["createElementVNode"])("input",{type:e.uiControl,name:e.name,value:e.modelValue,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},null,40,va)])}var wa=Object(Oi["defineComponent"])({props:{modelValue:null,modelModifiers:Object,uiControl:String,name:String},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){this.$emit("update:modelValue",e.target.value)}}});wa.render=Oa;var ja=wa,Na={class:"fieldMultiTuple"},xa=["for","innerHTML"];function ka(e,t,n,r,o,i){var a=Object(Oi["resolveComponent"])("MultiPairField");return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",Na,[Object(Oi["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,xa),Object(Oi["createVNode"])(a,{name:e.name,"model-value":e.modelValue,"onUpdate:modelValue":e.onUpdateValue,"model-modifiers":e.modelModifiers,field1:e.uiControlAttributes.field1,field2:e.uiControlAttributes.field2,field3:e.uiControlAttributes.field3,field4:e.uiControlAttributes.field4},null,8,["name","model-value","onUpdate:modelValue","model-modifiers","field1","field2","field3","field4"])])}var Ea=Object(Oi["defineComponent"])({props:{name:String,title:String,modelValue:null,modelModifiers:Object,uiControlAttributes:Object},inheritAttrs:!1,components:{MultiPairField:Ci["MultiPairField"]},emits:["update:modelValue"],methods:{onUpdateValue:function(e){this.$emit("update:modelValue",e)}}});Ea.render=ka;var Ca=Ea,Sa=["type","id","name","value"],Va=["for","innerHTML"];function Aa(e,t,n,r,o,i){return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])(Oi["Fragment"],null,[Object(Oi["createElementVNode"])("input",Object(Oi["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,id:e.name,name:e.name,value:e.modelValueFormatted,onKeydown:t[0]||(t[0]=function(t){return e.onChange(t)}),onChange:t[1]||(t[1]=function(t){return e.onChange(t)})},e.uiControlAttributes),null,16,Sa),Object(Oi["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,Va)],64)}var Ta=Object(Oi["defineComponent"])({props:{uiControl:String,name:String,title:String,modelValue:[Number,String],modelModifiers:Object,uiControlAttributes:Object},inheritAttrs:!1,emits:["update:modelValue"],created:function(){this.onChange=Object(Ci["debounce"])(this.onChange.bind(this),50)},methods:{onChange:function(e){var t=this,n=parseFloat(e.target.value);if(n!==this.modelValue){var r;if(null===(r=this.modelModifiers)||void 0===r||!r.abortable)return void this.$emit("update:modelValue",n);var o={value:n,abort:function(){e.target.value!==t.modelValueFormatted&&(e.target.value=t.modelValueFormatted)}};this.$emit("update:modelValue",o)}}},mounted:function(){window.Materialize.updateTextFields()},watch:{modelValue:function(){setTimeout((function(){window.Materialize.updateTextFields()}))}},computed:{modelValueFormatted:function(){return(this.modelValue||"").toString()}}});Ta.render=Aa;var Ma=Ta,Pa={ref:"root"},Da=["value","id","name","disabled","checked"];function Ba(e,t,n,r,o,i){return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",Pa,[Object(Oi["withDirectives"])(Object(Oi["createElementVNode"])("label",{class:"fieldRadioTitle"},Object(Oi["toDisplayString"])(e.title),513),[[Oi["vShow"],e.title]]),(Object(Oi["openBlock"])(!0),Object(Oi["createElementBlock"])(Oi["Fragment"],null,Object(Oi["renderList"])(e.availableOptions||[],(function(n){return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("p",{key:n.key,class:"radio"},[Object(Oi["createElementVNode"])("label",null,[Object(Oi["createElementVNode"])("input",Object(Oi["mergeProps"])({value:n.key,onChange:t[0]||(t[0]=function(t){return e.onChange(t)}),type:"radio",id:"".concat(e.name).concat(n.key),name:e.name,disabled:n.disabled||e.disabled},e.uiControlAttributes,{checked:e.modelValue===n.key||"".concat(e.modelValue)===n.key}),null,16,Da),Object(Oi["createElementVNode"])("span",null,[Object(Oi["createTextVNode"])(Object(Oi["toDisplayString"])(n.value)+" ",1),Object(Oi["withDirectives"])(Object(Oi["createElementVNode"])("span",{class:"form-description"},Object(Oi["toDisplayString"])(n.description),513),[[Oi["vShow"],n.description]])])])])})),128))],512)}var $a=Object(Oi["defineComponent"])({props:{title:String,availableOptions:Array,name:String,disabled:Boolean,uiControlAttributes:Object,modelValue:[String,Number],modelModifiers:Object},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){var t,n=this;if(null!==(t=this.modelModifiers)&&void 0!==t&&t.abortable){var r=function(){n.$refs.root.querySelectorAll("input").forEach((function(e,t){var r;if(null!==(r=n.availableOptions)&&void 0!==r&&r[t]){var o=n.availableOptions[t].key;e.checked=n.modelValue===o||"".concat(n.modelValue)===o}}))},o={value:e.target.value,abort:function(){r()}};this.$emit("update:modelValue",o)}else this.$emit("update:modelValue",e.target.value)}}});$a.render=Ba;var Fa=$a;function _a(e,t){return Ra(e)||Ha(e,t)||Ia(e,t)||La()}function La(){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 Ia(e,t){if(e){if("string"===typeof e)return Ua(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)?Ua(e,t):void 0}}function Ua(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ha(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0)if(i.push(r.value),t&&i.length===t)break}catch(l){s=!0,o=l}finally{try{a||null==n["return"]||n["return"]()}finally{if(s)throw o}}return i}}function Ra(e){if(Array.isArray(e))return e}var qa={key:0,class:"matomo-field-select"},za=["multiple","name"],Wa=["label"],Ja=["value","selected","disabled"],Ga=["for","innerHTML"],Ka={key:1,class:"matomo-field-select"},Ya=["multiple","name"],Za=["value","selected","disabled"],Xa=["for","innerHTML"];function Qa(e,t,n,r,o,i){return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])(Oi["Fragment"],null,[e.groupedOptions?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",qa,[Object(Oi["createElementVNode"])("select",Object(Oi["mergeProps"])({ref:"select",class:"grouped",multiple:e.multiple,name:e.name,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},e.uiControlAttributes),[(Object(Oi["openBlock"])(!0),Object(Oi["createElementBlock"])(Oi["Fragment"],null,Object(Oi["renderList"])(e.groupedOptions,(function(t){var n=_a(t,2),r=n[0],o=n[1];return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("optgroup",{key:r,label:r},[(Object(Oi["openBlock"])(!0),Object(Oi["createElementBlock"])(Oi["Fragment"],null,Object(Oi["renderList"])(o,(function(t){return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("option",{key:t.key,value:"string:".concat(t.key),selected:e.multiple?e.modelValue&&-1!==e.modelValue.indexOf(t.key):e.modelValue===t.key,disabled:t.disabled},Object(Oi["toDisplayString"])(t.value),9,Ja)})),128))],8,Wa)})),128))],16,za),Object(Oi["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,Ga)])):Object(Oi["createCommentVNode"])("",!0),!e.groupedOptions&&e.options?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",Ka,[Object(Oi["createElementVNode"])("select",Object(Oi["mergeProps"])({class:"ungrouped",ref:"select",multiple:e.multiple,name:e.name,onChange:t[1]||(t[1]=function(t){return e.onChange(t)})},e.uiControlAttributes),[(Object(Oi["openBlock"])(!0),Object(Oi["createElementBlock"])(Oi["Fragment"],null,Object(Oi["renderList"])(e.options,(function(t){return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("option",{key:t.key,value:"string:".concat(t.key),selected:e.multiple?e.modelValue&&-1!==e.modelValue.indexOf(t.key):e.modelValue===t.key,disabled:t.disabled},Object(Oi["toDisplayString"])(t.value),9,Za)})),128))],16,Ya),Object(Oi["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,Xa)])):Object(Oi["createCommentVNode"])("",!0)],64)}function es(e){return rs(e)||ns(e)||as(e)||ts()}function ts(){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 ns(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function rs(e){if(Array.isArray(e))return ss(e)}function os(e,t){return cs(e)||ls(e,t)||as(e,t)||is()}function is(){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 as(e,t){if(e){if("string"===typeof e)return ss(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)?ss(e,t):void 0}}function ss(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ls(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0)if(i.push(r.value),t&&i.length===t)break}catch(l){s=!0,o=l}finally{try{a||null==n["return"]||n["return"]()}finally{if(s)throw o}}return i}}function cs(e){if(Array.isArray(e))return e}function us(e){return us="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},us(e)}function ps(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4?arguments[4]:void 0;if(e){var i=window.$(e);if(Array.from(e.options).forEach((function(e){e.selected=o?!!t&&-1!==t.indexOf(e.value.replace(/^string:/,"")):"string:".concat(t)===e.value})),i.formSelect(r),n){var a=i.closest(".select-wrapper").find("input");a.attr("placeholder",n)}}}function ds(e){return!Array.isArray(e)&&"object"===us(e)&&Object.values(e).some((function(e){return"object"===us(e)}))}function fs(e,t){return e.some((function(e){return e.key===t}))}function ms(e,t,n){if(!e)return[];var r=!0,o=e;ds(o)||(o={"":e},r=!1);var i=[];return Object.entries(o).forEach((function(e){var n=os(e,2),o=n[0],a=n[1];Object.entries(a).forEach((function(e){var n=os(e,2),a=n[0],s=n[1];if(s&&"object"===us(s)&&"undefined"!==typeof s.key)i.push(s);else{var l=a;"integer"===t&&"string"===typeof a&&(l=parseInt(a,10)),i.push({group:r?o:void 0,key:l,value:s})}}))})),null!==n&&void 0!==n&&n.placeholder&&!fs(i,"")?[{key:"",value:""}].concat(i):i}function hs(e){return"string"===typeof e?e.replace(/^string:/,""):e}var gs=Object(Oi["defineComponent"])({props:{modelValue:null,modelModifiers:Object,multiple:Boolean,name:String,title:String,availableOptions:Array,uiControlAttributes:Object,uiControlOptions:Object},inheritAttrs:!1,emits:["update:modelValue"],computed:{options:function(){var e=this.availableOptions;return!e||fs(e,"")||"undefined"!==typeof this.modelValue&&null!==this.modelValue&&""!==this.modelValue?e:[{key:"",value:this.modelValue,group:this.hasGroups?"":void 0}].concat(es(e))},hasGroups:function(){var e=this.availableOptions;return e&&e[0]&&"undefined"!==typeof e[0].group},groupedOptions:function(){var e=this.options;if(!this.hasGroups||!e)return null;var t={};e.forEach((function(e){var n=e.group;t[n]=t[n]||[],t[n].push(e)}));var n=Object.entries(t);return n.sort((function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0})),n}},methods:{onChange:function(e){var t,n,r=this,o=e.target;if(this.multiple?(n=Array.from(o.options).filter((function(e){return e.selected})).map((function(e){return e.value})),n=n.map((function(e){return hs(e)}))):(n=o.value,n=hs(n)),null!==(t=this.modelModifiers)&&void 0!==t&&t.abortable){var i={value:n,abort:function(){r.onModelValueChange(r.modelValue)}};this.$emit("update:modelValue",i)}else this.$emit("update:modelValue",n)},onModelValueChange:function(e){var t=this;window.$(this.$refs.select).val(e),setTimeout((function(){var n;ps(t.$refs.select,e,null===(n=t.uiControlAttributes)||void 0===n?void 0:n.placeholder,t.uiControlOptions,t.multiple)}))}},watch:{modelValue:function(e){this.onModelValueChange(e)},"uiControlAttributes.disabled":{handler:function(e,t){var n=this;setTimeout((function(){var r;e!==t&&ps(n.$refs.select,n.modelValue,null===(r=n.uiControlAttributes)||void 0===r?void 0:r.placeholder,n.uiControlOptions,n.multiple)}))}},availableOptions:function(e,t){var n=this;e!==t&&setTimeout((function(){var e;ps(n.$refs.select,n.modelValue,null===(e=n.uiControlAttributes)||void 0===e?void 0:e.placeholder,n.uiControlOptions,n.multiple)}))}},mounted:function(){var e=this;setTimeout((function(){var t;ps(e.$refs.select,e.modelValue,null===(t=e.uiControlAttributes)||void 0===t?void 0:t.placeholder,e.uiControlOptions,e.multiple)}))}});gs.render=Qa;var bs=gs,ys=["for","innerHTML"],vs={class:"sites_autocomplete"};function Os(e,t,n,r,o,i){var a=Object(Oi["resolveComponent"])("SiteSelector");return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",null,[Object(Oi["createElementVNode"])("label",{for:e.name,class:"siteSelectorLabel",innerHTML:e.$sanitize(e.title)},null,8,ys),Object(Oi["createElementVNode"])("div",vs,[Object(Oi["createVNode"])(a,Object(Oi["mergeProps"])({"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onChange(t)}),id:e.name,"show-all-sites-item":e.uiControlAttributes.showAllSitesItem||!1,"switch-site-on-select":!1,"show-selected-site":!0,"only-sites-with-admin-access":e.uiControlAttributes.onlySitesWithAdminAccess||!1},e.uiControlAttributes),null,16,["model-value","id","show-all-sites-item","only-sites-with-admin-access"])])])}var ws=Object(Oi["defineComponent"])({props:{name:String,title:String,modelValue:Object,modelModifiers:Object,uiControlAttributes:Object},inheritAttrs:!1,components:{SiteSelector:Ci["SiteSelector"]},emits:["update:modelValue"],methods:{onChange:function(e){var t;if(null!==(t=this.modelModifiers)&&void 0!==t&&t.abortable){var n={value:e,abort:function(){}};this.$emit("update:modelValue",n)}else this.$emit("update:modelValue",e)}}});ws.render=Os;var js=ws,Ns=["type","id","name","value"],xs=["for","innerHTML"];function ks(e,t,n,r,o,i){return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])(Oi["Fragment"],null,[Object(Oi["createElementVNode"])("input",Object(Oi["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,id:e.name,name:e.name,value:e.modelValueText,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)})},e.uiControlAttributes),null,16,Ns),Object(Oi["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,xs)],64)}var Es=Object(Oi["defineComponent"])({props:{title:String,name:String,uiControlAttributes:Object,modelValue:[String,Number],modelModifiers:Object,uiControl:String},inheritAttrs:!1,emits:["update:modelValue"],computed:{modelValueText:function(){return"undefined"===typeof this.modelValue||null===this.modelValue?"":this.modelValue.toString()}},created:function(){this.onKeydown=Object(Ci["debounce"])(this.onKeydown.bind(this),50)},mounted:function(){setTimeout((function(){window.Materialize.updateTextFields()}))},watch:{modelValue:function(){setTimeout((function(){window.Materialize.updateTextFields()}))}},methods:{onKeydown:function(e){var t=this,n=e.target.value;if(this.modelValue!==n){var r;if(null===(r=this.modelModifiers)||void 0===r||!r.abortable)return void this.$emit("update:modelValue",n);var o={value:n,abort:function(){e.target.value!==t.modelValueText&&(e.target.value=t.modelValueText)}};this.$emit("update:modelValue",o)}}}});Es.render=ks;var Cs=Es,Ss=["for","innerHTML"],Vs=["type","name","value"];function As(e,t,n,r,o,i){return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",null,[Object(Oi["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,Ss),Object(Oi["createElementVNode"])("input",Object(Oi["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,name:e.name,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),value:e.concattedValues},e.uiControlAttributes),null,16,Vs)])}var Ts=Object(Oi["defineComponent"])({props:{name:String,title:String,uiControl:String,modelValue:Array,modelModifiers:Object,uiControlAttributes:Object},inheritAttrs:!1,computed:{concattedValues:function(){return"string"===typeof this.modelValue?this.modelValue:(this.modelValue||[]).join(", ")}},emits:["update:modelValue"],created:function(){this.onKeydown=Object(Ci["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){var t=this,n=e.target.value.split(",").map((function(e){return e.trim()}));if(n.join(", ")!==this.concattedValues){var r;if(null===(r=this.modelModifiers)||void 0===r||!r.abortable)return void this.$emit("update:modelValue",n);var o={value:n,abort:function(){e.target.value!==t.concattedValues&&(e.target.value=t.concattedValues)}};this.$emit("update:modelValue",o)}}}});Ts.render=As;var Ms=Ts,Ps=["name","id","value"],Ds=["for","innerHTML"];function Bs(e,t,n,r,o,i){return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])(Oi["Fragment"],null,[Object(Oi["createElementVNode"])("textarea",Object(Oi["mergeProps"])({name:e.name},e.uiControlAttributes,{id:e.name,value:e.modelValueText,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),class:"materialize-textarea",ref:"textarea"}),null,16,Ps),Object(Oi["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,Ds)],64)}var $s=Object(Oi["defineComponent"])({props:{name:String,uiControlAttributes:Object,modelValue:String,modelModifiers:Object,title:String},inheritAttrs:!1,emits:["update:modelValue"],created:function(){this.onKeydown=Object(Ci["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){var t=this,n=e.target.value;if(n!==this.modelValue){var r;if(null===(r=this.modelModifiers)||void 0===r||!r.abortable)return void this.$emit("update:modelValue",n);var o={value:n,abort:function(){e.target.value!==t.modelValue&&(e.target.value=t.modelValueText)}};this.$emit("update:modelValue",o)}}},computed:{modelValueText:function(){return this.modelValue||""}},watch:{modelValue:function(){var e=this;setTimeout((function(){window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}},mounted:function(){var e=this;setTimeout((function(){window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}});$s.render=Bs;var Fs=$s,_s=["for","innerHTML"],Ls=["name","value"];function Is(e,t,n,r,o,i){return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",null,[Object(Oi["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,_s),Object(Oi["createElementVNode"])("textarea",Object(Oi["mergeProps"])({ref:"textarea",name:e.name},e.uiControlAttributes,{value:e.concattedValue,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),class:"materialize-textarea"}),null,16,Ls)])}var Us="\n",Hs=Object(Oi["defineComponent"])({props:{name:String,title:String,uiControlAttributes:Object,modelValue:[Array,String],modelModifiers:Object},inheritAttrs:!1,emits:["update:modelValue"],computed:{concattedValue:function(){return"string"===typeof this.modelValue?this.modelValue:(this.modelValue||[]).join(Us)}},created:function(){this.onKeydown=Object(Ci["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){var t=this,n=e.target.value.split(Us);if(n.join(Us)!==this.concattedValue){var r;if(null===(r=this.modelModifiers)||void 0===r||!r.abortable)return void this.$emit("update:modelValue",n);var o={value:n,abort:function(){e.target.value!==t.concattedValue&&(e.target.value=t.concattedValue)}};this.$emit("update:modelValue",o)}}},watch:{modelValue:function(e,t){var n=this;e!==t&&setTimeout((function(){n.$refs.textarea&&window.Materialize.textareaAutoResize(n.$refs.textarea),window.Materialize.updateTextFields()}))}},mounted:function(){var e=this;setTimeout((function(){e.$refs.textarea&&window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}});Hs.render=Is;var Rs=Hs;function qs(e){return qs="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qs(e)}function zs(e,t){return Ys(e)||Ks(e,t)||Js(e,t)||Ws()}function Ws(){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 Js(e,t){if(e){if("string"===typeof e)return Gs(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)?Gs(e,t):void 0}}function Gs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ks(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0)if(i.push(r.value),t&&i.length===t)break}catch(l){s=!0,o=l}finally{try{a||null==n["return"]||n["return"]()}finally{if(s)throw o}}return i}}function Ys(e){if(Array.isArray(e))return e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Ft(e,t){if(!e)return[];var n=[];return Object.entries(e).forEach((function(e){var r=Vt(e,2),o=r[0],i=r[1];if(i&&"object"===At(i)&&"undefined"!==typeof i.key)n.push(i);else{var a=o;"integer"===t&&"string"===typeof o&&(a=parseInt(a,10)),n.push({key:a,value:i})}})),n}var $t={ref:"root"};function _t(e,t,n,r,o,i){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",$t,null,512)}function Lt(e){if("undefined"!==typeof e)return JSON.parse(JSON.stringify(e))}var It=Object(a["defineComponent"])({props:{modelValue:null,formField:{type:null,required:!0},templateFile:{type:String,required:!0}},emits:["update:modelValue"],inheritAttrs:!1,setup:function(e,t){var n=Object(a["ref"])(null),r=window.$("<div ng-include=\"'".concat(e.templateFile,"?cb=").concat(i["Matomo"].cacheBuster,"'\"></div>")),o=i["Matomo"].helper.getAngularDependency("$timeout"),s=i["Matomo"].helper.getAngularDependency("$rootScope"),l=s.$new();return l.formField=Object.assign(Object.assign({},Lt(e.formField)),{},{value:Lt(e.modelValue)}),l.$watch("formField.value",(function(n,r){n!==r&&JSON.stringify(n)!==JSON.stringify(e.modelValue)&&t.emit("update:modelValue",Lt(n))})),Object(a["watch"])((function(){return e.modelValue}),(function(e){JSON.stringify(e)!==JSON.stringify(l.formField.value)&&o((function(){l.formField.value=e}))})),Object(a["watch"])((function(){return e.formField}),(function(e){o((function(){var t=l.formField.value;l.formField=Object.assign(Object.assign({},Lt(e)),{},{value:t})}))}),{deep:!0}),Object(a["onMounted"])((function(){window.$(n.value).append(r),i["Matomo"].helper.compileAngularComponents(r,{scope:l,params:{formField:Object.assign(Object.assign({},Lt(e.formField)),{},{value:e.modelValue})}})})),{root:n}}});It.render=_t;var Ut=It;function Ht(e){return Ht="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ht(e)}var Jt=["password","url","search","email"],Rt=["textarea","checkbox","text"],qt={checkbox:"FieldCheckbox","expandable-select":"FieldExpandableSelect","field-array":"FieldFieldArray",file:"FieldFile",hidden:"FieldHidden",multiselect:"FieldSelect",multituple:"FieldMultituple",number:"FieldNumber",radio:"FieldRadio",select:"FieldSelect",site:"FieldSite",text:"FieldText",textarea:"FieldTextarea"},zt={FieldSelect:Qe,FieldCheckboxArray:Ft,FieldRadio:Ft,FieldExpandableSelect:J},Wt=Object(a["defineComponent"])({props:{modelValue:null,modelModifiers:Object,formField:{type:Object,required:!0}},emits:["update:modelValue"],components:{FieldCheckbox:v,FieldCheckboxArray:V,FieldExpandableSelect:q,FieldFieldArray:K,FieldFile:re,FieldHidden:se,FieldMultituple:fe,FieldNumber:be,FieldRadio:je,FieldSelect:nt,FieldSite:st,FieldText:ft,FieldTextArray:bt,FieldTextarea:jt,FieldTextareaArray:St},setup:function(e){var t=Object(a["ref"])(null),n=function(e){var n;e&&t.value&&"function"!==typeof e.render&&(n="string"===typeof e?0===e.indexOf("#")?window.$(e):window.vueSanitize(e):e,window.$(t.value).html("").append(n))};return Object(a["watch"])((function(){return e.formField.inlineHelp}),n),Object(a["onMounted"])((function(){n(e.formField.inlineHelp)})),{inlineHelp:t}},computed:{inlineHelpComponent:function(){var e=this.formField,t=e.inlineHelp;if(t&&"function"===typeof t.render)return e.inlineHelp},inlineHelpBind:function(){return this.inlineHelpComponent?this.formField.inlineHelpBind:void 0},childComponent:function(){var e=this.formField;if(e.component){var t=e.component;if(e.component.plugin){var n=e.component,r=n.plugin,o=n.name;if(!r||!o)throw new Error("Invalid component property given to piwik-field directive, must be {plugin: '...',name: '...'}");t=Object(i["useExternalPluginComponent"])(r,o)}return Object(a["markRaw"])(t)}if(e.templateFile)return Object(a["markRaw"])(Ut);var s=e.uiControl,l=qt[s];return-1!==Jt.indexOf(s)&&(l="FieldText"),"array"===this.formField.type&&-1!==Rt.indexOf(s)&&(l="".concat(l,"Array")),l},extraChildComponentParams:function(){return"multiselect"===this.formField.uiControl?{multiple:!0}:{}},showFormHelp:function(){return this.formField.description||this.formField.inlineHelp||this.showDefaultValue||this.hasInlineHelpSlot},showDefaultValue:function(){return this.defaultValuePretty&&"checkbox"!==this.formField.uiControl&&"radio"!==this.formField.uiControl},showField:function(){return!(this.formField&&this.formField.condition&&this.formField.condition instanceof Function)||this.formField.condition()},processedModelValue:function(){var e=this.formField;if("boolean"===e.type){var t=this.modelValue&&this.modelValue>0&&"0"!==this.modelValue;if("checkbox"===e.uiControl)return t;if("radio"===e.uiControl)return t?"1":"0"}return this.modelValue},defaultValue:function(){var e=this.formField.defaultValue;return Array.isArray(e)?e.join(","):e},availableOptions:function(){var e=this.childComponent;if("string"!==typeof e)return null;var t=this.formField;return t.availableValues&&zt[e]?zt[e](t.availableValues,t.type,t.uiControlAttributes):null},defaultValuePretty:function(){var e=this.formField,t=e.defaultValue,n=this.availableOptions;if("string"===typeof t&&t){var r=null;try{r=JSON.parse(t)}catch(i){}if(null!==r&&"object"===Ht(r))return""}if(!Array.isArray(n))return Array.isArray(t)?"":t?"".concat(t):"";var o=[];return Array.isArray(t)||(t=[t]),(n||[]).forEach((function(e){"undefined"!==typeof e.value&&-1!==t.indexOf(e.key)&&o.push(e.value)})),o.join(", ")},defaultValuePrettyTruncated:function(){return this.defaultValuePretty.substring(0,50)},hasInlineHelpSlot:function(){var e,t;if(!this.$slots["inline-help"])return!1;var n=this.$slots["inline-help"]();return!(null===n||void 0===n||null===(e=n[0])||void 0===e||null===(t=e.children)||void 0===t||!t.length)}},methods:{onChange:function(e){this.$emit("update:modelValue",e)}}});Wt.render=f;var Gt=Wt; + */function Zs(e,t){if(!e)return[];var n=[];return Object.entries(e).forEach((function(e){var r=zs(e,2),o=r[0],i=r[1];if(i&&"object"===qs(i)&&"undefined"!==typeof i.key)n.push(i);else{var a=o;"integer"===t&&"string"===typeof o&&(a=parseInt(a,10)),n.push({key:a,value:i})}})),n}function Xs(e){return Xs="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xs(e)}var Qs=["password","url","search","email"],el=["textarea","checkbox","text"],tl={checkbox:"FieldCheckbox","expandable-select":"FieldExpandableSelect","field-array":"FieldFieldArray",file:"FieldFile",hidden:"FieldHidden",multiselect:"FieldSelect",multituple:"FieldMultituple",number:"FieldNumber",radio:"FieldRadio",select:"FieldSelect",site:"FieldSite",text:"FieldText",textarea:"FieldTextarea"},nl={FieldSelect:ms,FieldCheckboxArray:Zs,FieldRadio:Zs,FieldExpandableSelect:oa},rl=Object(Oi["defineComponent"])({props:{modelValue:null,modelModifiers:Object,formField:{type:Object,required:!0}},emits:["update:modelValue"],components:{FieldCheckbox:Pi,FieldCheckboxArray:zi,FieldExpandableSelect:aa,FieldFieldArray:ua,FieldFile:ya,FieldHidden:ja,FieldMultituple:Ca,FieldNumber:Ma,FieldRadio:Fa,FieldSelect:bs,FieldSite:js,FieldText:Cs,FieldTextArray:Ms,FieldTextarea:Fs,FieldTextareaArray:Rs},setup:function(e){var t=Object(Oi["ref"])(null),n=function(e){var n;e&&t.value&&"function"!==typeof e.render&&(n="string"===typeof e?0===e.indexOf("#")?window.$(e):window.vueSanitize(e):e,window.$(t.value).html("").append(n))};return Object(Oi["watch"])((function(){return e.formField.inlineHelp}),n),Object(Oi["onMounted"])((function(){n(e.formField.inlineHelp)})),{inlineHelp:t}},computed:{inlineHelpComponent:function(){var e=this.formField,t=e.inlineHelp;if(t&&"function"===typeof t.render)return e.inlineHelp},inlineHelpBind:function(){return this.inlineHelpComponent?this.formField.inlineHelpBind:void 0},childComponent:function(){var e=this.formField;if(e.component){var t=e.component;if(e.component.plugin){var n=e.component,r=n.plugin,o=n.name;if(!r||!o)throw new Error("Invalid component property given to FormField directive, must be {plugin: '...',name: '...'}");t=Object(Ci["useExternalPluginComponent"])(r,o)}return Object(Oi["markRaw"])(t)}var i=e.uiControl,a=tl[i];return-1!==Qs.indexOf(i)&&(a="FieldText"),"array"===this.formField.type&&-1!==el.indexOf(i)&&(a="".concat(a,"Array")),a},extraChildComponentParams:function(){return"multiselect"===this.formField.uiControl?{multiple:!0}:{}},showFormHelp:function(){return this.formField.description||this.formField.inlineHelp||this.showDefaultValue||this.hasInlineHelpSlot},showDefaultValue:function(){return this.defaultValuePretty&&"checkbox"!==this.formField.uiControl&&"radio"!==this.formField.uiControl},showField:function(){return!(this.formField&&this.formField.condition&&this.formField.condition instanceof Function)||this.formField.condition()},processedModelValue:function(){var e=this.formField;if("boolean"===e.type){var t=this.modelValue&&this.modelValue>0&&"0"!==this.modelValue;if("checkbox"===e.uiControl)return t;if("radio"===e.uiControl)return t?"1":"0"}return this.modelValue},defaultValue:function(){var e=this.formField.defaultValue;return Array.isArray(e)?e.join(","):e},availableOptions:function(){var e=this.childComponent;if("string"!==typeof e)return null;var t=this.formField;return t.availableValues&&nl[e]?nl[e](t.availableValues,t.type,t.uiControlAttributes):null},defaultValuePretty:function(){var e=this.formField,t=e.defaultValue,n=this.availableOptions;if("string"===typeof t&&t){var r=null;try{r=JSON.parse(t)}catch(i){}if(null!==r&&"object"===Xs(r))return""}if(!Array.isArray(n))return Array.isArray(t)?"":t?"".concat(t):"";var o=[];return Array.isArray(t)||(t=[t]),(n||[]).forEach((function(e){"undefined"!==typeof e.value&&-1!==t.indexOf(e.key)&&o.push(e.value)})),o.join(", ")},defaultValuePrettyTruncated:function(){return this.defaultValuePretty.substring(0,50)},hasInlineHelpSlot:function(){var e,t;if(!this.$slots["inline-help"])return!1;var n=this.$slots["inline-help"]();return!(null===n||void 0===n||null===(e=n[0])||void 0===e||null===(t=e.children)||void 0===t||!t.length)}},methods:{onChange:function(e){this.$emit("update:modelValue",e)}}});rl.render=Ei;var ol=rl;function il(e,t,n,r,o,i){var a=Object(Oi["resolveComponent"])("FormField");return Object(Oi["openBlock"])(),Object(Oi["createBlock"])(a,{"form-field":e.field,"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onChange(t)}),"model-modifiers":e.modelModifiers},{"inline-help":Object(Oi["withCtx"])((function(){return[Object(Oi["renderSlot"])(e.$slots,"inline-help")]})),_:3},8,["form-field","model-value","model-modifiers"])}var al={multiselect:"array",checkbox:"boolean",site:"object",number:"integer"},sl=Object(Oi["defineComponent"])({props:{modelValue:null,modelModifiers:Object,uicontrol:String,name:String,defaultValue:null,options:[Object,Array],description:String,introduction:String,title:String,inlineHelp:[String,Object],inlineHelpBind:Object,disabled:Boolean,uiControlAttributes:{type:Object,default:function(){return{}}},uiControlOptions:{type:Object,default:function(){return{}}},autocomplete:Boolean,condition:Function,varType:String,autofocus:Boolean,tabindex:Number,fullWidth:Boolean,maxlength:Number,required:Boolean,placeholder:String,rows:Number,min:Number,max:Number,component:null,templateFile:String},emits:["update:modelValue"],components:{FormField:ol},computed:{type:function(){if(this.varType)return this.varType;var e=this.uicontrol;return e&&al[e]?al[e]:"string"},field:function(){return{uiControl:this.uicontrol,type:this.type,name:this.name,defaultValue:this.defaultValue,availableValues:this.options,description:this.description,introduction:this.introduction,inlineHelp:this.inlineHelp,inlineHelpBind:this.inlineHelpBind,title:this.title,component:this.component,templateFile:this.templateFile,uiControlAttributes:Object.assign(Object.assign({},this.uiControlAttributes),{},{disabled:this.disabled,autocomplete:this.autocomplete,tabindex:this.tabindex,autofocus:this.autofocus,rows:this.rows,required:this.required,maxlength:this.maxlength,placeholder:this.placeholder,min:this.min,max:this.max}),fullWidth:this.fullWidth,uiControlOptions:this.uiControlOptions}}},methods:{onChange:function(e){this.$emit("update:modelValue",e)}}});sl.render=il;var ll=sl,cl={class:"pluginSettings",ref:"root"},ul=["id"],pl={class:"card-content"},dl=["id"],fl=["onClick","disabled","value"];function ml(e,t,n,r,o,i){var a=Object(Oi["resolveComponent"])("GroupedSettings"),s=Object(Oi["resolveComponent"])("ActivityIndicator"),l=Object(Oi["resolveComponent"])("PasswordConfirmation");return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",cl,[(Object(Oi["openBlock"])(!0),Object(Oi["createElementBlock"])(Oi["Fragment"],null,Object(Oi["renderList"])(e.settingsPerPlugin,(function(t){return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",{class:"card",id:"".concat(t.pluginName,"PluginSettings"),key:"".concat(t.pluginName,"PluginSettings")},[Object(Oi["createElementVNode"])("div",pl,[Object(Oi["createElementVNode"])("h2",{class:"card-title",id:t.pluginName},Object(Oi["toDisplayString"])(t.title),9,dl),Object(Oi["createVNode"])(a,{"group-name":t.pluginName,settings:t.settings,"all-setting-values":e.settingValues,onChange:function(n){return e.settingValues["".concat(t.pluginName,".").concat(n.name)]=n.value}},null,8,["group-name","settings","all-setting-values","onChange"]),Object(Oi["createElementVNode"])("input",{type:"button",onClick:function(n){return e.saveSetting(t.pluginName)},disabled:e.isLoading,class:"pluginsSettingsSubmit btn",value:e.translate("General_Save")},null,8,fl),Object(Oi["createVNode"])(s,{loading:e.isLoading||e.isSaving[t.pluginName]},null,8,["loading"])])],8,ul)})),128)),Object(Oi["createVNode"])(l,{modelValue:e.showPasswordConfirmModal,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.showPasswordConfirmModal=t}),onConfirmed:e.confirmPassword},{default:Object(Oi["withCtx"])((function(){return[Object(Oi["createElementVNode"])("h2",null,Object(Oi["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])],512)}function hl(e,t,n,r,o,i){var a=Object(Oi["resolveComponent"])("GroupedSetting");return Object(Oi["openBlock"])(!0),Object(Oi["createElementBlock"])(Oi["Fragment"],null,Object(Oi["renderList"])(e.settings,(function(t){return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",{key:"".concat(e.groupPrefix).concat(t.name)},[Object(Oi["createVNode"])(a,{"model-value":e.allSettingValues["".concat(e.groupPrefix).concat(t.name)],"onUpdate:modelValue":function(n){return e.$emit("change",{name:t.name,value:n})},setting:t,"condition-values":e.settingValues},null,8,["model-value","onUpdate:modelValue","setting","condition-values"])])})),128)}function gl(e,t,n,r,o,i){var a=Object(Oi["resolveComponent"])("FormField");return Object(Oi["withDirectives"])((Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",null,[Object(Oi["createVNode"])(a,{"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.changeValue(t)}),"form-field":e.setting},null,8,["model-value","form-field"])],512)),[[Oi["vShow"],e.showField]])}var bl=Object(Oi["defineComponent"])({props:{setting:{type:Object,required:!0},modelValue:null,conditionValues:{type:Object,required:!0}},components:{FormField:ol},emits:["update:modelValue"],computed:{showField:function(){var e=this.setting.condition;if(!e)return!0;e=e.replace(/&&/g," and "),e=e.replace(/\|\|/g," or "),e=e.replace(/!/g," not ");try{return vi.evaluate(e,this.conditionValues)}catch(t){return console.log("failed to parse setting condition '".concat(e,"': ").concat(t.message)),console.log(this.conditionValues),!1}}},methods:{changeValue:function(e){this.$emit("update:modelValue",e)}}});bl.render=gl;var yl=bl;function vl(e,t){return xl(e)||Nl(e,t)||wl(e,t)||Ol()}function Ol(){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 wl(e,t){if(e){if("string"===typeof e)return jl(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)?jl(e,t):void 0}}function jl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Nl(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0)if(i.push(r.value),t&&i.length===t)break}catch(l){s=!0,o=l}finally{try{a||null==n["return"]||n["return"]()}finally{if(s)throw o}}return i}}function xl(e){if(Array.isArray(e))return e}var kl=Object(Oi["defineComponent"])({props:{groupName:String,settings:{type:Array,required:!0},allSettingValues:{type:Object,required:!0}},emits:["change"],components:{GroupedSetting:yl},computed:{settingValues:function(){var e=this,t=Object.entries(this.allSettingValues).filter((function(t){var n=vl(t,1),r=n[0];if(e.groupName){var o=r.split("."),i=vl(o,1),a=i[0];if(a!==e.groupName)return!1}return!0})).map((function(t){var n=vl(t,2),r=n[0],o=n[1];return e.groupName?[r.split(".")[1],o]:[r,o]}));return Object.fromEntries(t)},groupPrefix:function(){return this.groupName?"".concat(this.groupName,"."):""}}});kl.render=hl;var El=kl,Cl={class:"confirm-password-modal modal",ref:"root"},Sl={class:"modal-content"},Vl={class:"modal-text"},Al={class:"modal-footer"},Tl=["disabled"];function Ml(e,t,n,r,o,i){var a=Object(Oi["resolveComponent"])("Field");return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",Cl,[Object(Oi["createElementVNode"])("div",Sl,[Object(Oi["createElementVNode"])("div",Vl,[Object(Oi["renderSlot"])(e.$slots,"default")]),Object(Oi["createElementVNode"])("div",null,[Object(Oi["createVNode"])(a,{modelValue:e.passwordConfirmation,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.passwordConfirmation=t}),uicontrol:"password",disabled:e.requiresPasswordConfirmation?void 0:"disabled",name:"currentUserPassword",autocomplete:!1,"full-width":!0,title:e.translate("UsersManager_YourCurrentPassword")},null,8,["modelValue","disabled","title"])])]),Object(Oi["createElementVNode"])("div",Al,[Object(Oi["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",disabled:e.requiresPasswordConfirmation&&!e.passwordConfirmation?"disabled":void 0,onClick:t[1]||(t[1]=function(t){t.preventDefault(),e.$emit("confirmed",e.passwordConfirmation),e.passwordConfirmation=""})},Object(Oi["toDisplayString"])(e.translate("General_Yes")),9,Tl),Object(Oi["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no btn-flat",onClick:t[2]||(t[2]=function(t){t.preventDefault(),e.$emit("aborted")})},Object(Oi["toDisplayString"])(e.translate("General_No")),1)])],512)}var Pl=window,Dl=Pl.$,Bl=Object(Oi["defineComponent"])({props:{modelValue:{type:Boolean,required:!0}},data:function(){return{passwordConfirmation:""}},emits:["confirmed","aborted","update:modelValue"],components:{Field:ll},activated:function(){this.$emit("update:modelValue",!1)},methods:{showPasswordConfirmModal:function(){var e=this,t=this.$refs.root,n=Dl(t),r=function(t){var r=t.keyCode?t.keyCode:t.which;13===r&&(n.modal("close"),e.$emit("confirmed",e.passwordConfirmation),e.passwordConfirmation="")};n.modal({dismissible:!1,onOpenEnd:function(){var e=".modal.open #currentUserPassword";Dl(e).focus(),Dl(e).off("keypress").keypress(r)},onCloseEnd:function(){e.$emit("update:modelValue",!1)}}).modal("open")}},computed:{requiresPasswordConfirmation:function(){return!!Ci["Matomo"].requiresPasswordConfirmation}},watch:{modelValue:function(e){e&&this.showPasswordConfirmModal()}}});Bl.render=Ml;var $l=Bl;function Fl(e,t){return Hl(e)||Ul(e,t)||Ll(e,t)||_l()}function _l(){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 Ll(e,t){if(e){if("string"===typeof e)return Il(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)?Il(e,t):void 0}}function Il(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ul(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0)if(i.push(r.value),t&&i.length===t)break}catch(l){s=!0,o=l}finally{try{a||null==n["return"]||n["return"]()}finally{if(s)throw o}}return i}}function Hl(e){if(Array.isArray(e))return e}var Rl=window,ql=Rl.$,zl=Object(Oi["defineComponent"])({props:{mode:String},components:{PasswordConfirmation:$l,ActivityIndicator:Ci["ActivityIndicator"],GroupedSettings:El},data:function(){return{isLoading:!0,isSaving:{},showPasswordConfirmModal:!1,settingsToSave:null,settingsPerPlugin:[],settingValues:{}}},created:function(){var e=this;Ci["AjaxHelper"].fetch({method:this.apiMethod}).then((function(t){e.isLoading=!1,e.settingsPerPlugin=t,t.forEach((function(t){t.settings.forEach((function(n){e.settingValues["".concat(t.pluginName,".").concat(n.name)]=n.value}))})),Object(Ci["scrollToAnchorInUrl"])(),e.addSectionsToTableOfContents()})).catch((function(){e.isLoading=!1}))},computed:{apiMethod:function(){return"admin"===this.mode?"CorePluginsAdmin.getSystemSettings":"CorePluginsAdmin.getUserSettings"},saveApiMethod:function(){return"admin"===this.mode?"CorePluginsAdmin.setSystemSettings":"CorePluginsAdmin.setUserSettings"}},methods:{addSectionsToTableOfContents:function(){var e=ql("#generalSettingsTOC");if(e.length){var t=this.settingsPerPlugin;t.forEach((function(t){var n=t.pluginName,r=t.settings;n&&("CoreAdminHome"===n&&r?r.filter((function(e){return e.introduction})).forEach((function(t){e.append('<a href="#/'.concat(n,'PluginSettings">').concat(t.introduction,"</a> "))})):e.append('<a href="#/'.concat(n,'">').concat(n.replace(/([A-Z])/g," $1").trim(),"</a> ")))}))}},confirmPassword:function(e){this.showPasswordConfirmModal=!1,this.save(this.settingsToSave,e)},saveSetting:function(e){"admin"===this.mode?(this.settingsToSave=e,this.showPasswordConfirmModal=!0):this.save(e)},save:function(e,t){var n=this,r=this.saveApiMethod;this.isSaving[e]=!0;var o=this.getValuesForPlugin(e);Ci["AjaxHelper"].post({method:r},{settingValues:o,passwordConfirmation:t}).then((function(){n.isSaving[e]=!1;var t=Ci["NotificationsStore"].show({message:Object(Ci["translate"])("CoreAdminHome_PluginSettingsSaveSuccess"),id:"generalSettings",context:"success",type:"transient"});Ci["NotificationsStore"].scrollToNotification(t)})).catch((function(){n.isSaving[e]=!1})),this.settingsToSave=null},getValuesForPlugin:function(e){var t={};return t[e]||(t[e]=[]),Object.entries(this.settingValues).forEach((function(n){var r=Fl(n,2),o=r[0],i=r[1],a=o.split("."),s=Fl(a,2),l=s[0],c=s[1];if(l===e){var u=i;!1===u?u="0":!0===u&&(u="1"),t[l].push({name:c,value:u})}})),t}}});zl.render=ml;var Wl=zl,Jl=window,Gl=Jl.$; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Kt(e){if(e){var t=e.plugin,n=e.name;if(!t||!n)throw new Error("Invalid component property given to piwik-field directive, must be {plugin: '...',name: '...'}");return Object(i["useExternalPluginComponent"])(t,n)}}function Yt(e,t){var n={};return Object.values(e.allSettings||{}).forEach((function(e){"0"===e.value?n[e.name]=0:n[e.name]=e.value})),e.$eval(t,n)}Object(i["createAngularJsAdapter"])({component:Gt,scope:{modelValue:{default:function(e){var t=e.piwikFormField;return"string"!==typeof t.value||!t.value||"array"!==t.type&&"multituple"!==t.uiControl&&"field-array"!==t.uiControl&&"multiselect"!==t.uiControl&&"site"!==t.uiControl||(t.value=JSON.parse(t.value)),"checkbox"===t.uiControl?Object(i["transformAngularJsBoolAttr"])(t.value):t.value}},piwikFormField:{vue:"formField",angularJsBind:"=",transform:function(e,t,n){var r=e;function o(){if(r.templateFile)return Object(a["markRaw"])(Ut);var e=Kt(r.component);return e?Object(a["markRaw"])(e):void 0}return Object.assign(Object.assign({},r),{},{condition:r.condition?Yt.bind(null,n,r.condition):r.condition,disabled:Object(i["transformAngularJsBoolAttr"])(r.disabled),autocomplete:Object(i["transformAngularJsBoolAttr"])(r.autocomplete),autofocus:Object(i["transformAngularJsBoolAttr"])(r.autofocus),tabindex:Object(i["transformAngularJsIntAttr"])(r.tabindex),fullWidth:Object(i["transformAngularJsBoolAttr"])(r.fullWidth),maxlength:Object(i["transformAngularJsIntAttr"])(r.maxlength),required:Object(i["transformAngularJsBoolAttr"])(r.required),rows:Object(i["transformAngularJsIntAttr"])(r.rows),min:Object(i["transformAngularJsIntAttr"])(r.min),max:Object(i["transformAngularJsIntAttr"])(r.max),component:o()})}},allSettings:{angularJsBind:"="}},directiveName:"piwikFormField",events:{"update:modelValue":function(e,t,n,r,o,i,a){e!==n.piwikFormField.value&&a((function(){n.piwikFormField.value=e}))}},$inject:["$timeout"],postCreate:function(e,t){t.$watch("piwikFormField.value",(function(t,n){t!==n&&(e.modelValue=t)})),t.$watch("allSettings",(function(){e.formField=Object.assign(Object.assign({},e.formField),{},{condition:t.piwikFormField.condition?Yt.bind(null,t,t.piwikFormField.condition):t.piwikFormField.condition})}),!0)}});function Zt(e,t,n,r,o,i){var s=Object(a["resolveComponent"])("FormField");return Object(a["openBlock"])(),Object(a["createBlock"])(s,{"form-field":e.field,"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onChange(t)}),"model-modifiers":e.modelModifiers},{"inline-help":Object(a["withCtx"])((function(){return[Object(a["renderSlot"])(e.$slots,"inline-help")]})),_:3},8,["form-field","model-value","model-modifiers"])}var Xt={multiselect:"array",checkbox:"boolean",site:"object",number:"integer"},Qt=Object(a["defineComponent"])({props:{modelValue:null,modelModifiers:Object,uicontrol:String,name:String,defaultValue:null,options:[Object,Array],description:String,introduction:String,title:String,inlineHelp:[String,Object],inlineHelpBind:Object,disabled:Boolean,uiControlAttributes:{type:Object,default:function(){return{}}},uiControlOptions:{type:Object,default:function(){return{}}},autocomplete:Boolean,condition:Function,varType:String,autofocus:Boolean,tabindex:Number,fullWidth:Boolean,maxlength:Number,required:Boolean,placeholder:String,rows:Number,min:Number,max:Number,component:null,templateFile:String},emits:["update:modelValue"],components:{FormField:Gt},computed:{type:function(){if(this.varType)return this.varType;var e=this.uicontrol;return e&&Xt[e]?Xt[e]:"string"},field:function(){return{uiControl:this.uicontrol,type:this.type,name:this.name,defaultValue:this.defaultValue,availableValues:this.options,description:this.description,introduction:this.introduction,inlineHelp:this.inlineHelp,inlineHelpBind:this.inlineHelpBind,title:this.title,component:this.component,templateFile:this.templateFile,uiControlAttributes:Object.assign(Object.assign({},this.uiControlAttributes),{},{disabled:this.disabled,autocomplete:this.autocomplete,tabindex:this.tabindex,autofocus:this.autofocus,rows:this.rows,required:this.required,maxlength:this.maxlength,placeholder:this.placeholder,min:this.min,max:this.max}),fullWidth:this.fullWidth,uiControlOptions:this.uiControlOptions}}},methods:{onChange:function(e){this.$emit("update:modelValue",e)}}});Qt.render=Zt;var en=Qt; + */function Kl(e){return e.find(".origin a.active").data("filter-origin")}function Yl(e){return e.find(".status a.active").data("filter-status")}function Zl(e,t){var n="#plugins tr";return n+="all"===e?"[data-filter-origin]":"[data-filter-origin=".concat(e,"]"),n+="all"===t?"[data-filter-status]":"[data-filter-status=".concat(t,"]"),Gl(n)}function Xl(e,t,n,r){var o=Zl(n,r).length,i=" (".concat(o,")");e.find("".concat(t," .counter")).text(i)}function Ql(e){var t=Kl(e),n=Yl(e);Xl(e,'[data-filter-status="all"]',t,"all"),Xl(e,'[data-filter-status="active"]',t,"active"),Xl(e,'[data-filter-status="inactive"]',t,"inactive"),Xl(e,'[data-filter-origin="all"]',"all",n),Xl(e,'[data-filter-origin="core"]',"core",n),Xl(e,'[data-filter-origin="official"]',"official",n),Xl(e,'[data-filter-origin="thirdparty"]',"thirdparty",n)}function ec(e){var t=Kl(e),n=Yl(e),r=Zl(t,n);Gl("#plugins tr[data-filter-origin][data-filter-status]").css("display","none"),r.css("display","table-row"),Ql(e)}function tc(e,t){t.preventDefault(),Gl(t.target).siblings().removeClass("active"),Gl(t.target).addClass("active"),ec(e)}function nc(e,t){t.preventDefault(),Gl(t.target).siblings().removeClass("active"),Gl(t.target).addClass("active"),ec(e)}var rc={mounted:function(e){setTimeout((function(){Ql(Gl(e)),Gl(e).find(".status").on("click","a",tc.bind(null,Gl(e))),Gl(e).find(".origin").on("click","a",nc.bind(null,Gl(e)))}))}},oc=window,ic=oc.$; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function tn(e,t,n){if("string"===typeof e&&e&&("array"===t||"multituple"===n||"field-array"===n||"multiselect"===n||"site"===n)){var r=JSON.parse(e);return"site"===n&&(r.name=i["Matomo"].helper.htmlDecode(r.name)),r}return"checkbox"===n&&"array"!==t?Object(i["transformAngularJsBoolAttr"])(e):e}Object(i["createAngularJsAdapter"])({component:en,require:"?ngModel",scope:{uicontrol:{angularJsBind:"@"},name:{angularJsBind:"@"},value:{vue:"modelValue",angularJsBind:"@",transform:function(e,t,n){return tn(e,n.varType,n.uicontrol)}},default:{vue:"defaultValue",angularJsBind:"@"},options:{angularJsBind:"="},description:{angularJsBind:"@"},introduction:{angularJsBind:"@"},title:{angularJsBind:"@"},inlineHelp:{angularJsBind:"@"},disabled:{angularJsBind:"=",transform:i["transformAngularJsBoolAttr"]},uiControlAttributes:{angularJsBind:"="},uiControlOptions:{angularJsBind:"="},autocomplete:{angularJsBind:"@",transform:i["transformAngularJsBoolAttr"]},condition:{angularJsBind:"@",transform:function(e,t,n){if(e)return function(t){return n.$eval(e,t)}}},varType:{angularJsBind:"@"},autofocus:{angularJsBind:"@",transform:i["transformAngularJsBoolAttr"]},tabindex:{angularJsBind:"@",transform:i["transformAngularJsIntAttr"]},fullWidth:{angularJsBind:"@",transform:i["transformAngularJsBoolAttr"]},maxlength:{angularJsBind:"@",transform:i["transformAngularJsIntAttr"]},required:{angularJsBind:"@",transform:i["transformAngularJsBoolAttr"]},placeholder:{angularJsBind:"@"},rows:{angularJsBind:"@",transform:i["transformAngularJsIntAttr"]},min:{angularJsBind:"@",transform:i["transformAngularJsIntAttr"]},max:{angularJsBind:"@",transform:i["transformAngularJsIntAttr"]},component:{angularJsBind:"<",transform:function(e,t,n){if(e){if(n.templateFile)return Object(a["shallowRef"])(Ut);var r=e.plugin,o=e.name;if(!r||!o)throw new Error("Invalid component property given to piwik-field directive, must be {plugin: '...',name: '...'}");return Object(a["shallowRef"])(Object(i["useExternalPluginComponent"])(r,o))}}}},directiveName:"piwikField",$inject:["$timeout"],events:{"update:modelValue":function(e,t,n,r,o,i,a){var s=i?i.$viewValue:n.value;e!==s&&a((function(){i?(i.$setViewValue(e),i.$render()):n.value=e}))}},postCreate:function(e,t,n,r,o){var s=o;if(s){if(s.$render=function(){Object(a["nextTick"])((function(){e.modelValue=Object(i["removeAngularJsSpecificProperties"])(s.$viewValue)}))},"undefined"!==typeof t.value){var l=tn(t.value,t.varType,t.uicontrol);s.$setViewValue(l)}else s.$setViewValue(e.modelValue);"site"===t.uicontrol&&s.$viewValue&&setTimeout((function(){s.$setViewValue(Object.assign({},s.$viewValue))}))}else t.$watch("value",(function(n){if(n!==e.modelValue){var r=tn(n,t.varType,t.uicontrol);Object(a["nextTick"])((function(){e.modelValue=r}))}}))}});var nn={class:"pluginSettings",ref:"root"},rn=["id"],on={class:"card-content"},an=["id"],sn=["onClick","disabled","value"];function ln(e,t,n,r,o,i){var s=Object(a["resolveComponent"])("GroupedSettings"),l=Object(a["resolveComponent"])("ActivityIndicator"),c=Object(a["resolveComponent"])("PasswordConfirmation");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",nn,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.settingsPerPlugin,(function(t){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{class:"card",id:"".concat(t.pluginName,"PluginSettings"),key:"".concat(t.pluginName,"PluginSettings")},[Object(a["createElementVNode"])("div",on,[Object(a["createElementVNode"])("h2",{class:"card-title",id:t.pluginName},Object(a["toDisplayString"])(t.title),9,an),Object(a["createVNode"])(s,{"group-name":t.pluginName,settings:t.settings,"all-setting-values":e.settingValues,onChange:function(n){return e.settingValues["".concat(t.pluginName,".").concat(n.name)]=n.value}},null,8,["group-name","settings","all-setting-values","onChange"]),Object(a["createElementVNode"])("input",{type:"button",onClick:function(n){return e.saveSetting(t.pluginName)},disabled:e.isLoading,class:"pluginsSettingsSubmit btn",value:e.translate("General_Save")},null,8,sn),Object(a["createVNode"])(l,{loading:e.isLoading||e.isSaving[t.pluginName]},null,8,["loading"])])],8,rn)})),128)),Object(a["createVNode"])(c,{modelValue:e.showPasswordConfirmModal,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.showPasswordConfirmModal=t}),onConfirmed:e.confirmPassword},{default:Object(a["withCtx"])((function(){return[Object(a["createElementVNode"])("h2",null,Object(a["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])],512)}function cn(e,t,n,r,o,i){var s=Object(a["resolveComponent"])("GroupedSetting");return Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.settings,(function(t){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{key:"".concat(e.groupPrefix).concat(t.name)},[Object(a["createVNode"])(s,{"model-value":e.allSettingValues["".concat(e.groupPrefix).concat(t.name)],"onUpdate:modelValue":function(n){return e.$emit("change",{name:t.name,value:n})},setting:t,"condition-values":e.settingValues},null,8,["model-value","onUpdate:modelValue","setting","condition-values"])])})),128)}function un(e,t,n,r,o,i){var s=Object(a["resolveComponent"])("FormField");return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("div",null,[Object(a["createVNode"])(s,{"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.changeValue(t)}),"form-field":e.settingWithComponent},null,8,["model-value","form-field"])],512)),[[a["vShow"],e.showField]])}var pn=n("a559"),fn=n.n(pn);function dn(e){return"number"===typeof e}function mn(e){return!(!e||"object"!==typeof e||"function"!==typeof e.constructor)&&(!0===e.isBigNumber&&"object"===typeof e.constructor.prototype&&!0===e.constructor.prototype.isBigNumber||"function"===typeof e.constructor.isDecimal&&!0===e.constructor.isDecimal(e))}function hn(e){return e&&"object"===typeof e&&!0===Object.getPrototypeOf(e).isComplex||!1}function gn(e){return e&&"object"===typeof e&&!0===Object.getPrototypeOf(e).isFraction||!1}function bn(e){return e&&!0===e.constructor.prototype.isUnit||!1}function vn(e){return"string"===typeof e}var yn=Array.isArray;function On(e){return e&&!0===e.constructor.prototype.isMatrix||!1}function wn(e){return Array.isArray(e)||On(e)}function jn(e){return e&&e.isDenseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function Nn(e){return e&&e.isSparseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function xn(e){return e&&!0===e.constructor.prototype.isRange||!1}function kn(e){return e&&!0===e.constructor.prototype.isIndex||!1}function En(e){return"boolean"===typeof e}function Cn(e){return e&&!0===e.constructor.prototype.isResultSet||!1}function Sn(e){return e&&!0===e.constructor.prototype.isHelp||!1}function An(e){return"function"===typeof e}function Vn(e){return e instanceof Date}function Tn(e){return e instanceof RegExp}function Mn(e){return!(!e||"object"!==typeof e||e.constructor!==Object||hn(e)||gn(e))}function Pn(e){return null===e}function Bn(e){return void 0===e}function Dn(e){return e&&!0===e.isAccessorNode&&!0===e.constructor.prototype.isNode||!1}function Fn(e){return e&&!0===e.isArrayNode&&!0===e.constructor.prototype.isNode||!1}function $n(e){return e&&!0===e.isAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function _n(e){return e&&!0===e.isBlockNode&&!0===e.constructor.prototype.isNode||!1}function Ln(e){return e&&!0===e.isConditionalNode&&!0===e.constructor.prototype.isNode||!1}function In(e){return e&&!0===e.isConstantNode&&!0===e.constructor.prototype.isNode||!1}function Un(e){return e&&!0===e.isFunctionAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function Hn(e){return e&&!0===e.isFunctionNode&&!0===e.constructor.prototype.isNode||!1}function Jn(e){return e&&!0===e.isIndexNode&&!0===e.constructor.prototype.isNode||!1}function Rn(e){return e&&!0===e.isNode&&!0===e.constructor.prototype.isNode||!1}function qn(e){return e&&!0===e.isObjectNode&&!0===e.constructor.prototype.isNode||!1}function zn(e){return e&&!0===e.isOperatorNode&&!0===e.constructor.prototype.isNode||!1}function Wn(e){return e&&!0===e.isParenthesisNode&&!0===e.constructor.prototype.isNode||!1}function Gn(e){return e&&!0===e.isRangeNode&&!0===e.constructor.prototype.isNode||!1}function Kn(e){return e&&!0===e.isSymbolNode&&!0===e.constructor.prototype.isNode||!1}function Yn(e){return e&&!0===e.constructor.prototype.isChain||!1}function Zn(e){var t=typeof e;return"object"===t?null===e?"null":Array.isArray(e)?"Array":e instanceof Date?"Date":e instanceof RegExp?"RegExp":mn(e)?"BigNumber":hn(e)?"Complex":gn(e)?"Fraction":On(e)?"Matrix":bn(e)?"Unit":kn(e)?"Index":xn(e)?"Range":Cn(e)?"ResultSet":Rn(e)?e.type:Yn(e)?"Chain":Sn(e)?"Help":"Object":"function"===t?"Function":t}function Xn(e){var t=typeof e;if("number"===t||"string"===t||"boolean"===t||null===e||void 0===e)return e;if("function"===typeof e.clone)return e.clone();if(Array.isArray(e))return e.map((function(e){return Xn(e)}));if(e instanceof Date)return new Date(e.valueOf());if(mn(e))return e;if(e instanceof RegExp)throw new TypeError("Cannot clone "+e);return Qn(e,Xn)}function Qn(e,t){var n={};for(var r in e)ir(e,r)&&(n[r]=t(e[r]));return n}function er(e,t){if(Array.isArray(t))throw new TypeError("Arrays are not supported by deepExtend");for(var n in t)if(ir(t,n)&&!(n in Object.prototype)&&!(n in Function.prototype))if(t[n]&&t[n].constructor===Object)void 0===e[n]&&(e[n]={}),e[n]&&e[n].constructor===Object?er(e[n],t[n]):e[n]=t[n];else{if(Array.isArray(t[n]))throw new TypeError("Arrays are not supported by deepExtend");e[n]=t[n]}return e}function tr(e,t){var n,r,o;if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(r=0,o=e.length;r<o;r++)if(!tr(e[r],t[r]))return!1;return!0}if("function"===typeof e)return e===t;if(e instanceof Object){if(Array.isArray(t)||!(t instanceof Object))return!1;for(n in e)if(!(n in t)||!tr(e[n],t[n]))return!1;for(n in t)if(!(n in e))return!1;return!0}return e===t}function nr(e){var t={};return rr(e,t),t}function rr(e,t){for(var n in e)if(ir(e,n)){var r=e[n];"object"===typeof r&&null!==r?rr(r,t):t[n]=r}}function or(e,t,n){var r,o=!0;Object.defineProperty(e,t,{get:function(){return o&&(r=n(),o=!1),r},set:function(e){r=e,o=!1},configurable:!0,enumerable:!0})}function ir(e,t){return e&&Object.hasOwnProperty.call(e,t)}function ar(e){return e&&"function"===typeof e.factory}function sr(e,t){for(var n={},r=0;r<t.length;r++){var o=t[r],i=e[o];void 0!==i&&(n[o]=i)}return n}function lr(e){return Object.keys(e).map(t=>e[t])}var cr=n("c0e2"),ur=n.n(cr);function pr(e){var t=new ur.a;return e.on=t.on.bind(t),e.off=t.off.bind(t),e.once=t.once.bind(t),e.emit=t.emit.bind(t),e}function fr(e){return"boolean"===typeof e||!!isFinite(e)&&e===Math.round(e)}var dr=Math.sign||function(e){return e>0?1:e<0?-1:0},mr=Math.log2||function(e){return Math.log(e)/Math.LN2},hr=Math.log10||function(e){return Math.log(e)/Math.LN10},gr=Math.log1p||function(e){return Math.log(e+1)},br=Math.cbrt||function(e){if(0===e)return e;var t,n=e<0;return n&&(e=-e),isFinite(e)?(t=Math.exp(Math.log(e)/3),t=(e/(t*t)+2*t)/3):t=e,n?-t:t},vr=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function yr(e,t,n){var r={2:"0b",8:"0o",16:"0x"},o=r[t],i="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!fr(n))throw new Error("size must be an integer");if(e>2**(n-1)-1||e<-(2**(n-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!fr(e))throw new Error("Value must be an integer");e<0&&(e+=2**n),i="i".concat(n)}var a="";return e<0&&(e=-e,a="-"),"".concat(a).concat(o).concat(e.toString(t)).concat(i)}function Or(e,t){if("function"===typeof t)return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var n,r,o="auto";if(t&&(t.notation&&(o=t.notation),dn(t)?n=t:dn(t.precision)&&(n=t.precision),t.wordSize&&(r=t.wordSize,"number"!==typeof r)))throw new Error('Option "wordSize" must be a number');switch(o){case"fixed":return Nr(e,n);case"exponential":return xr(e,n);case"engineering":return jr(e,n);case"bin":return yr(e,2,r);case"oct":return yr(e,8,r);case"hex":return yr(e,16,r);case"auto":return kr(e,n,t&&t).replace(/((\.\d*?)(0+))($|e)/,(function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t}));default:throw new Error('Unknown notation "'+o+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function wr(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var n=t[1],r=t[2],o=parseFloat(t[4]||"0"),i=r.indexOf(".");o+=-1!==i?i-1:r.length-1;var a=r.replace(".","").replace(/^0*/,(function(e){return o-=e.length,""})).replace(/0*$/,"").split("").map((function(e){return parseInt(e)}));return 0===a.length&&(a.push(0),o++),{sign:n,coefficients:a,exponent:o}}function jr(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=wr(e),r=Er(n,t),o=r.exponent,i=r.coefficients,a=o%3===0?o:o<0?o-3-o%3:o-o%3;if(dn(t))while(t>i.length||o-a+1>i.length)i.push(0);else for(var s=Math.abs(o-a)-(i.length-1),l=0;l<s;l++)i.push(0);var c=Math.abs(o-a),u=1;while(c>0)u++,c--;var p=i.slice(u).join(""),f=dn(t)&&p.length||p.match(/[1-9]/)?"."+p:"",d=i.slice(0,u).join("")+f+"e"+(o>=0?"+":"")+a.toString();return r.sign+d}function Nr(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=wr(e),r="number"===typeof t?Er(n,n.exponent+1+t):n,o=r.coefficients,i=r.exponent+1,a=i+(t||0);return o.length<a&&(o=o.concat(Cr(a-o.length))),i<0&&(o=Cr(1-i).concat(o),i=1),i<o.length&&o.splice(i,0,0===i?"0.":"."),r.sign+o.join("")}function xr(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=wr(e),r=t?Er(n,t):n,o=r.coefficients,i=r.exponent;o.length<t&&(o=o.concat(Cr(t-o.length)));var a=o.shift();return r.sign+a+(o.length>0?"."+o.join(""):"")+"e"+(i>=0?"+":"")+i}function kr(e,t,n){if(isNaN(e)||!isFinite(e))return String(e);var r=n&&void 0!==n.lowerExp?n.lowerExp:-3,o=n&&void 0!==n.upperExp?n.upperExp:5,i=wr(e),a=t?Er(i,t):i;if(a.exponent<r||a.exponent>=o)return xr(e,t);var s=a.coefficients,l=a.exponent;s.length<t&&(s=s.concat(Cr(t-s.length))),s=s.concat(Cr(l-s.length+1+(s.length<t?t-s.length:0))),s=Cr(-l).concat(s);var c=l>0?l:0;return c<s.length-1&&s.splice(c+1,0,"."),a.sign+s.join("")}function Er(e,t){var n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=n.coefficients;while(t<=0)r.unshift(0),n.exponent++,t++;if(r.length>t){var o=r.splice(t,r.length-t);if(o[0]>=5){var i=t-1;r[i]++;while(10===r[i])r.pop(),0===i&&(r.unshift(0),n.exponent++,i++),i--,r[i]++}}return n}function Cr(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}function Sr(e){return e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length}Number.EPSILON;var Ar=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)},Vr=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},Tr=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},Mr=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},Pr=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},Br=Math.tanh||function(e){var t=Math.exp(2*e);return(t-1)/(t+1)};function Dr(e,t,n){var r=e.constructor,o=new r(2),i="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!fr(n))throw new Error("size must be an integer");if(e.greaterThan(o.pow(n-1).sub(1))||e.lessThan(o.pow(n-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(o.pow(n))),i="i".concat(n)}switch(t){case 2:return"".concat(e.toBinary()).concat(i);case 8:return"".concat(e.toOctal()).concat(i);case 16:return"".concat(e.toHexadecimal()).concat(i);default:throw new Error("Base ".concat(t," not supported "))}}function Fr(e,t){if("function"===typeof t)return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var n,r,o="auto";if(void 0!==t&&(t.notation&&(o=t.notation),"number"===typeof t?n=t:t.precision&&(n=t.precision),t.wordSize&&(r=t.wordSize,"number"!==typeof r)))throw new Error('Option "wordSize" must be a number');switch(o){case"fixed":return Lr(e,n);case"exponential":return _r(e,n);case"engineering":return $r(e,n);case"bin":return Dr(e,2,r);case"oct":return Dr(e,8,r);case"hex":return Dr(e,16,r);case"auto":var i,a=t&&void 0!==t.lowerExp?t.lowerExp:-3,s=t&&void 0!==t.upperExp?t.upperExp:5;if(e.isZero())return"0";var l=e.toSignificantDigits(n),c=l.e;return i=c>=a&&c<s?l.toFixed():_r(e,n),i.replace(/((\.\d*?)(0+))($|e)/,(function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t}));default:throw new Error('Unknown notation "'+o+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function $r(e,t){var n=e.e,r=n%3===0?n:n<0?n-3-n%3:n-n%3,o=e.mul(Math.pow(10,-r)),i=o.toPrecision(t);return-1!==i.indexOf("e")&&(i=o.toString()),i+"e"+(n>=0?"+":"")+r.toString()}function _r(e,t){return void 0!==t?e.toExponential(t-1):e.toExponential()}function Lr(e,t){return e.toFixed(t)}function Ir(e,t){var n=Ur(e,t);return t&&"object"===typeof t&&"truncate"in t&&n.length>t.truncate?n.substring(0,t.truncate-3)+"...":n}function Ur(e,t){if("number"===typeof e)return Or(e,t);if(mn(e))return Fr(e,t);if(qr(e))return t&&"decimal"===t.fraction?e.toString():e.s*e.n+"/"+e.d;if(Array.isArray(e))return Rr(e,t);if(vn(e))return'"'+e+'"';if("function"===typeof e)return e.syntax?String(e.syntax):"function";if(e&&"object"===typeof e){if("function"===typeof e.format)return e.format(t);if(e&&e.toString(t)!=={}.toString())return e.toString(t);var n=Object.keys(e).map(n=>'"'+n+'": '+Ir(e[n],t));return"{"+n.join(", ")+"}"}return String(e)}function Hr(e){var t=String(e),n="",r=0;while(r<t.length){var o=t.charAt(r);"\\"===o?(n+=o,r++,o=t.charAt(r),""!==o&&-1!=='"\\/bfnrtu'.indexOf(o)||(n+="\\"),n+=o):n+='"'===o?'\\"':o,r++}return'"'+n+'"'}function Jr(e){var t=String(e);return t=t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">"),t}function Rr(e,t){if(Array.isArray(e)){for(var n="[",r=e.length,o=0;o<r;o++)0!==o&&(n+=", "),n+=Rr(e[o],t);return n+="]",n}return Ir(e,t)}function qr(e){return e&&"object"===typeof e&&"number"===typeof e.s&&"number"===typeof e.n&&"number"===typeof e.d||!1}function zr(e,t,n){if(!(this instanceof zr))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=(new Error).stack}function Wr(e,t,n){if(!(this instanceof Wr))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=n),void 0!==this.min&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":void 0!==this.max&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=(new Error).stack}function Gr(e){var t=[];while(Array.isArray(e))t.push(e.length),e=e[0];return t}function Kr(e,t){return Array.prototype.map.call(e,t)}function Yr(e,t){Array.prototype.forEach.call(e,t)}function Zr(e,t){return Array.prototype.join.call(e,t)}function Xr(e,t){return-1!==e.indexOf(t)}function Qr(e,t,n,r){function o(r){var o=sr(r,t.map(ro));return to(e,t,r),n(o)}return o.isFactory=!0,o.fn=e,o.dependencies=t.slice().sort(),r&&(o.meta=r),o}function eo(e){return"function"===typeof e&&"string"===typeof e.fn&&Array.isArray(e.dependencies)}function to(e,t,n){var r=t.filter(e=>!no(e)).every(e=>void 0!==n[e]);if(!r){var o=t.filter(e=>void 0===n[e]);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(o.map(e=>'"'.concat(e,'"')).join(", "),"."))}}function no(e){return e&&"?"===e[0]}function ro(e){return e&&"?"===e[0]?e.slice(1):e}function oo(e,t,n,r){if(!(this instanceof oo))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=n,this.max=r,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+n+(void 0!==r&&null!==r?"-"+r:"")+" expected)",this.stack=(new Error).stack}function io(e,t,n,r){function o(e,t){var n=arguments.length;if(1!==n&&2!==n)throw new oo("import",n,1,2);function r(e,n,o){if(Array.isArray(n))n.forEach(t=>r(e,t));else if("object"===typeof n)for(var i in n)ir(n,i)&&r(e,n[i],i);else if(eo(n)||void 0!==o){var a=eo(n)?h(n)?n.fn+".transform":n.fn:o;if(ir(e,a)&&e[a]!==n&&!t.silent)throw new Error('Cannot import "'+a+'" twice');e[a]=n}else if(!t.silent)throw new TypeError("Factory, Object, or Array expected")}t||(t={});var o={};for(var a in r(o,e),o)if(ir(o,a)){var s=o[a];if(eo(s))c(s,t);else if(u(s))i(a,s,t);else if(!t.silent)throw new TypeError("Factory, Object, or Array expected")}}function i(t,o,i){if(i.wrap&&"function"===typeof o&&(o=l(o)),f(o)&&(o=e(t,{[o.signature]:o})),p(n[t])&&p(o))return o=i.override?e(t,o.signatures):e(n[t],o),n[t]=o,delete r[t],a(t,o),void n.emit("import",t,(function(){return o}));if(void 0===n[t]||i.override)return n[t]=o,delete r[t],a(t,o),void n.emit("import",t,(function(){return o}));if(!i.silent)throw new Error('Cannot import "'+t+'": already exists')}function a(e,t){t&&"function"===typeof t.transform?(n.expression.transform[e]=t.transform,d(e)&&(n.expression.mathWithTransform[e]=t.transform)):(delete n.expression.transform[e],d(e)&&(n.expression.mathWithTransform[e]=t))}function s(e){delete n.expression.transform[e],d(e)?n.expression.mathWithTransform[e]=n[e]:delete n.expression.mathWithTransform[e]}function l(e){var t=function(){for(var t=[],r=0,o=arguments.length;r<o;r++){var i=arguments[r];t[r]=i&&i.valueOf()}return e.apply(n,t)};return e.transform&&(t.transform=e.transform),t}function c(t,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.fn;if(Xr(i,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(i));var a=h(t)?n.expression.transform:n,l=i in n.expression.transform,c=ir(a,i)?a[i]:void 0,u=function(){var r={};t.dependencies.map(ro).forEach(e=>{if(Xr(e,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(e));"math"===e?r.math=n:"mathWithTransform"===e?r.mathWithTransform=n.expression.mathWithTransform:"classes"===e?r.classes=n:r[e]=n[e]});var a=t(r);if(a&&"function"===typeof a.transform)throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(void 0===c||o.override)return a;if(p(c)&&p(a))return e(c,a);if(o.silent)return c;throw new Error('Cannot import "'+i+'": already exists')};t.meta&&!1===t.meta.lazy?(a[i]=u(),c&&l?s(i):(h(t)||m(t))&&or(n.expression.mathWithTransform,i,()=>a[i])):(or(a,i,u),c&&l?s(i):(h(t)||m(t))&&or(n.expression.mathWithTransform,i,()=>a[i])),r[i]=t,n.emit("import",i,u)}function u(e){return"function"===typeof e||"number"===typeof e||"string"===typeof e||"boolean"===typeof e||null===e||bn(e)||hn(e)||mn(e)||gn(e)||On(e)||Array.isArray(e)}function p(e){return"function"===typeof e&&"object"===typeof e.signatures}function f(e){return"function"===typeof e&&"string"===typeof e.signature}function d(e){return!ir(g,e)}function m(e){return-1===e.fn.indexOf(".")&&!ir(g,e.fn)&&(!e.meta||!e.meta.isClass)}function h(e){return void 0!==e&&void 0!==e.meta&&!0===e.meta.isTransformFunction||!1}var g={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return o}zr.prototype=new RangeError,zr.prototype.constructor=RangeError,zr.prototype.name="DimensionError",zr.prototype.isDimensionError=!0,Wr.prototype=new RangeError,Wr.prototype.constructor=RangeError,Wr.prototype.name="IndexError",Wr.prototype.isIndexError=!0,oo.prototype=new Error,oo.prototype.constructor=Error,oo.prototype.name="ArgumentsError",oo.prototype.isArgumentsError=!0;var ao={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null},so=["Matrix","Array"],lo=["number","BigNumber","Fraction"];function co(e,t){function n(n){if(n){var r=Qn(e,Xn);po(n,"matrix",so),po(n,"number",lo),er(e,n);var o=Qn(e,Xn),i=Qn(n,Xn);return t("config",o,r,i),o}return Qn(e,Xn)}return n.MATRIX_OPTIONS=so,n.NUMBER_OPTIONS=lo,Object.keys(ao).forEach(t=>{Object.defineProperty(n,t,{get:()=>e[t],enumerable:!0,configurable:!0})}),n}function uo(e,t){return-1!==e.indexOf(t)}function po(e,t,n){void 0===e[t]||uo(n,e[t])||console.warn('Warning: Unknown value "'+e[t]+'" for configuration option "'+t+'". Available options: '+n.map(e=>JSON.stringify(e)).join(", ")+".")}function fo(e,t){var n=fn()({},ao,t);if("function"!==typeof Object.create)throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var r=pr({isNumber:dn,isComplex:hn,isBigNumber:mn,isFraction:gn,isUnit:bn,isString:vn,isArray:yn,isMatrix:On,isCollection:wn,isDenseMatrix:jn,isSparseMatrix:Nn,isRange:xn,isIndex:kn,isBoolean:En,isResultSet:Cn,isHelp:Sn,isFunction:An,isDate:Vn,isRegExp:Tn,isObject:Mn,isNull:Pn,isUndefined:Bn,isAccessorNode:Dn,isArrayNode:Fn,isAssignmentNode:$n,isBlockNode:_n,isConditionalNode:Ln,isConstantNode:In,isFunctionAssignmentNode:Un,isFunctionNode:Hn,isIndexNode:Jn,isNode:Rn,isObjectNode:qn,isOperatorNode:zn,isParenthesisNode:Wn,isRangeNode:Gn,isSymbolNode:Kn,isChain:Yn});r.config=co(n,r.emit),r.expression={transform:{},mathWithTransform:{config:r.config}};var o=[],i=[];function a(e){if(eo(e))return e(r);var t=e[Object.keys(e)[0]];if(eo(t))return t(r);if(!ar(e))throw console.warn("Factory object with properties `type`, `name`, and `factory` expected",e),new Error("Factory object with properties `type`, `name`, and `factory` expected");var s,l=o.indexOf(e);return-1===l?(s=!0===e.math?e.factory(r.type,n,a,r.typed,r):e.factory(r.type,n,a,r.typed),o.push(e),i.push(s)):s=i[l],s}var s={};function l(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.typed.apply(r.typed,t)}var c=io(l,a,r,s);return r.import=c,r.on("config",()=>{lr(s).forEach(e=>{e&&e.meta&&e.meta.recreateOnConfigChange&&c(e,{override:!0})})}),r.create=fo.bind(null,e),r.factory=Qr,r.import(lr(nr(e))),r.ArgumentsError=oo,r.DimensionError=zr,r.IndexError=Wr,r}var mo=new Set(["end"]);function ho(e,t){if(wo(e)&&vo(e,t))return e[t];if("function"===typeof e[t]&&Oo(e,t))throw new Error('Cannot access method "'+t+'" as a property');throw new Error('No access to property "'+t+'"')}function go(e,t,n){if(wo(e)&&vo(e,t))return e[t]=n,n;throw new Error('No access to property "'+t+'"')}function bo(e,t){return t in e}function vo(e,t){return!(!e||"object"!==typeof e)&&(!!ir(jo,t)||!(t in Object.prototype)&&!(t in Function.prototype))}function yo(e,t){if(!Oo(e,t))throw new Error('No access to method "'+t+'"')}function Oo(e,t){return null!==e&&void 0!==e&&"function"===typeof e[t]&&(!(ir(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e))&&(!!ir(No,t)||!(t in Object.prototype)&&!(t in Function.prototype)))}function wo(e){return"object"===typeof e&&e&&e.constructor===Object}var jo={length:!0,name:!0},No={toString:!0,valueOf:!0,toLocaleString:!0};class xo{constructor(e){this.wrappedObject=e}keys(){return Object.keys(this.wrappedObject)}get(e){return ho(this.wrappedObject,e)}set(e,t){return go(this.wrappedObject,e,t),this}has(e){return bo(this.wrappedObject,e)}}function ko(){return new Map}function Eo(e){if(!e)return ko();if(Co(e))return e;if(Mn(e))return new xo(e);throw new Error("createMap can create maps from objects or Maps")}function Co(e){return!!e&&(e instanceof Map||e instanceof xo||"function"===typeof e.set&&"function"===typeof e.get&&"function"===typeof e.keys&&"function"===typeof e.has)}function So(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var o of n)if(o)if(Co(o))for(var i of o.keys())e.set(i,o.get(i));else if(Mn(o))for(var a of Object.keys(o))e.set(a,o[a]);return e}var Ao="Node",Vo=["mathWithTransform"],To=Qr(Ao,Vo,e=>{var{mathWithTransform:t}=e;function n(){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator")}function r(e){for(var t of[...mo])if(e.has(t))throw new Error('Scope contains an illegal symbol, "'+t+'" is a reserved keyword')}return n.prototype.evaluate=function(e){return this.compile().evaluate(e)},n.prototype.type="Node",n.prototype.isNode=!0,n.prototype.comment="",n.prototype.compile=function(){var e=this._compile(t,{}),n={},o=null;function i(t){var i=Eo(t);return r(i),e(i,n,o)}return{evaluate:i}},n.prototype._compile=function(e,t){throw new Error("Method _compile should be implemented by type "+this.type)},n.prototype.forEach=function(e){throw new Error("Cannot run forEach on a Node interface")},n.prototype.map=function(e){throw new Error("Cannot run map on a Node interface")},n.prototype._ifNode=function(e){if(!Rn(e))throw new TypeError("Callback function must return a Node");return e},n.prototype.traverse=function(e){function t(e,n){e.forEach((function(e,r,o){n(e,r,o),t(e,n)}))}e(this,null,null),t(this,e)},n.prototype.transform=function(e){function t(n,r,o){var i=e(n,r,o);return i!==n?i:n.map(t)}return t(this,null,null)},n.prototype.filter=function(e){var t=[];return this.traverse((function(n,r,o){e(n,r,o)&&t.push(n)})),t},n.prototype.clone=function(){throw new Error("Cannot clone a Node interface")},n.prototype.cloneDeep=function(){return this.map((function(e){return e.cloneDeep()}))},n.prototype.equals=function(e){return!!e&&tr(this,e)},n.prototype.toString=function(e){var t=this._getCustomString(e);return"undefined"!==typeof t?t:this._toString(e)},n.prototype.toJSON=function(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)},n.prototype.toHTML=function(e){var t=this._getCustomString(e);return"undefined"!==typeof t?t:this.toHTML(e)},n.prototype._toString=function(){throw new Error("_toString not implemented for "+this.type)},n.prototype.toTex=function(e){var t=this._getCustomString(e);return"undefined"!==typeof t?t:this._toTex(e)},n.prototype._toTex=function(e){throw new Error("_toTex not implemented for "+this.type)},n.prototype._getCustomString=function(e){if(e&&"object"===typeof e)switch(typeof e.handler){case"object":case"undefined":return;case"function":return e.handler(this,e);default:throw new TypeError("Object or function expected as callback")}},n.prototype.getIdentifier=function(){return this.type},n.prototype.getContent=function(){return this},n},{isClass:!0,isNode:!0}),Mo={createNode:To},Po="number",Bo="number, number";function Do(e){return Math.abs(e)}function Fo(e,t){return e+t}function $o(e,t){return e-t}function _o(e,t){return e*t}function Lo(e,t){return e/t}function Io(e){return-e}function Uo(e){return e}function Ho(e){return br(e)}function Jo(e){return e*e*e}function Ro(e){return Math.exp(e)}function qo(e){return vr(e)}function zo(e,t){if(!fr(e)||!fr(t))throw new Error("Parameters in function gcd must be integer numbers");var n;while(0!==t)n=e%t,e=t,t=n;return e<0?-e:e}function Wo(e,t){if(!fr(e)||!fr(t))throw new Error("Parameters in function lcm must be integer numbers");if(0===e||0===t)return 0;var n,r=e*t;while(0!==t)n=t,t=e%n,e=n;return Math.abs(r/e)}function Go(e){return hr(e)}function Ko(e){return mr(e)}function Yo(e){return gr(e)}function Zo(e,t){if(t>0)return e-t*Math.floor(e/t);if(0===t)return e;throw new Error("Cannot calculate mod for a negative divisor")}function Xo(e){return dr(e)}function Qo(e){return Math.sqrt(e)}function ei(e){return e*e}function ti(e,t){var n,r,o,i,a=0,s=1,l=1,c=0;if(!fr(e)||!fr(t))throw new Error("Parameters in function xgcd must be integer numbers");while(t)r=Math.floor(e/t),o=e-r*t,n=a,a=s-r*a,s=n,n=l,l=c-r*l,c=n,e=t,t=o;return i=e<0?[-e,-s,-c]:[e,e?s:0,c],i}function ni(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}function ri(e){return Math.abs(e)}Do.signature=Po,Fo.signature=Bo,$o.signature=Bo,_o.signature=Bo,Lo.signature=Bo,Io.signature=Po,Uo.signature=Po,Ho.signature=Po,Jo.signature=Po,Ro.signature=Po,qo.signature=Po,zo.signature=Bo,Wo.signature=Bo,Go.signature=Po,Ko.signature=Po,Yo.signature=Po,Zo.signature=Bo,Xo.signature=Po,Qo.signature=Po,ei.signature=Po,ti.signature=Bo,ni.signature=Bo,ri.signature=Po;var oi="number",ii="number, number";function ai(e,t){if(!fr(e)||!fr(t))throw new Error("Integers expected in function bitAnd");return e&t}function si(e){if(!fr(e))throw new Error("Integer expected in function bitNot");return~e}function li(e,t){if(!fr(e)||!fr(t))throw new Error("Integers expected in function bitOr");return e|t}function ci(e,t){if(!fr(e)||!fr(t))throw new Error("Integers expected in function bitXor");return e^t}function ui(e,t){if(!fr(e)||!fr(t))throw new Error("Integers expected in function leftShift");return e<<t}function pi(e,t){if(!fr(e)||!fr(t))throw new Error("Integers expected in function rightArithShift");return e>>t}function fi(e,t){if(!fr(e)||!fr(t))throw new Error("Integers expected in function rightLogShift");return e>>>t}ai.signature=ii,si.signature=oi,li.signature=ii,ci.signature=ii,ui.signature=ii,pi.signature=ii,fi.signature=ii;var di="number",mi="number, number";function hi(e){return!e}function gi(e,t){return!(!e&&!t)}function bi(e,t){return!!e!==!!t}function vi(e,t){return!(!e||!t)}function yi(e,t){if(t<e)return 1;if(t===e)return t;var n=t+e>>1;return yi(e,n)*yi(n+1,t)}function Oi(e,t){if(!fr(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!fr(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(t>e)throw new TypeError("k must be less than or equal to n");for(var n=e-t,r=1,o=t<n?n+1:t+1,i=2,a=t<n?t:n,s=o;s<=e;++s){r*=s;while(i<=a&&r%i===0)r/=i,++i}return i<=a&&(r/=yi(i,a)),r}function wi(e){var t;if(fr(e))return e<=0?isFinite(e)?1/0:NaN:e>171?1/0:yi(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*wi(1-e));if(e>=171.35)return 1/0;if(e>85){var n=e*e,r=n*e,o=r*e,i=o*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*n)-139/(51840*r)-571/(2488320*o)+163879/(209018880*i)+5246819/(75246796800*i*e))}--e,t=Ni[0];for(var a=1;a<Ni.length;++a)t+=Ni[a]/(e+a);var s=e+ji+.5;return Math.sqrt(2*Math.PI)*Math.pow(s,e+.5)*Math.exp(-s)*t}hi.signature=di,gi.signature=mi,bi.signature=mi,vi.signature=mi,Oi.signature="number, number",wi.signature="number";var ji=4.7421875,Ni=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],xi=.9189385332046728,ki=5,Ei=7,Ci=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];function Si(e){if(e<0)return NaN;if(0===e)return 1/0;if(!isFinite(e))return e;if(e<.5)return Math.log(Math.PI/Math.sin(Math.PI*e))-Si(1-e);e-=1;for(var t=e+ki+.5,n=Ci[0],r=Ei-1;r>=1;r--)n+=Ci[r]/(e+r);return xi+(e+.5)*Math.log(t)-t+Math.log(n)}Si.signature="number";var Ai="number",Vi="number, number";function Ti(e){return Math.acos(e)}function Mi(e){return Ar(e)}function Pi(e){return Math.atan(1/e)}function Bi(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}function Di(e){return Math.asin(1/e)}function Fi(e){var t=1/e;return Math.log(t+Math.sqrt(t*t+1))}function $i(e){return Math.acos(1/e)}function _i(e){var t=1/e,n=Math.sqrt(t*t-1);return Math.log(n+t)}function Li(e){return Math.asin(e)}function Ii(e){return Vr(e)}function Ui(e){return Math.atan(e)}function Hi(e,t){return Math.atan2(e,t)}function Ji(e){return Tr(e)}function Ri(e){return Math.cos(e)}function qi(e){return Mr(e)}function zi(e){return 1/Math.tan(e)}function Wi(e){var t=Math.exp(2*e);return(t+1)/(t-1)}function Gi(e){return 1/Math.sin(e)}function Ki(e){return 0===e?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*dr(e)}function Yi(e){return 1/Math.cos(e)}function Zi(e){return 2/(Math.exp(e)+Math.exp(-e))}function Xi(e){return Math.sin(e)}function Qi(e){return Pr(e)}function ea(e){return Math.tan(e)}function ta(e){return Br(e)}Ti.signature=Ai,Mi.signature=Ai,Pi.signature=Ai,Bi.signature=Ai,Di.signature=Ai,Fi.signature=Ai,$i.signature=Ai,_i.signature=Ai,Li.signature=Ai,Ii.signature=Ai,Ui.signature=Ai,Hi.signature=Vi,Ji.signature=Ai,Ri.signature=Ai,qi.signature=Ai,zi.signature=Ai,Wi.signature=Ai,Gi.signature=Ai,Ki.signature=Ai,Yi.signature=Ai,Zi.signature=Ai,Xi.signature=Ai,Qi.signature=Ai,ea.signature=Ai,ta.signature=Ai;var na="number";function ra(e){return fr(e)}function oa(e){return e<0}function ia(e){return e>0}function aa(e){return 0===e}function sa(e){return Number.isNaN(e)}function la(){throw new Error('No "bignumber" implementation available')}function ca(){throw new Error('No "fraction" implementation available')}function ua(){throw new Error('No "matrix" implementation available')}function pa(){throw new Error('No "matrix" implementation available')}ra.signature=na,oa.signature=na,ia.signature=na,aa.signature=na,sa.signature=na;var fa=Qr("matrix",[],()=>ua),da=Qr("subset",[],()=>pa);ma("combinations",Oi),ma("gamma",wi),ma("lgamma",Si);function ma(e,t){return Qr(e,["typed"],e=>{var{typed:n}=e;return n(t)})}var ha={createSubset:da};function ga(e){return e&&e.isIndexError?new Wr(e.index+1,e.min+1,void 0!==e.max?e.max+1:void 0):e}function ba(e){var{subset:t}=e;return function(e,n){try{if(Array.isArray(e))return t(e,n);if(e&&"function"===typeof e.subset)return e.subset(n);if("string"===typeof e)return t(e,n);if("object"===typeof e){if(!n.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return ho(e,n.getObjectProperty())}throw new TypeError("Cannot apply index: unsupported type of object")}catch(r){throw ga(r)}}}var va="AccessorNode",ya=["subset","Node"],Oa=Qr(va,ya,e=>{var{subset:t,Node:n}=e,r=ba({subset:t});function o(e,t){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");if(!Rn(e))throw new TypeError('Node expected for parameter "object"');if(!Jn(t))throw new TypeError('IndexNode expected for parameter "index"');this.object=e||null,this.index=t,Object.defineProperty(this,"name",{get:function(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}.bind(this),set:function(){throw new Error("Cannot assign a new name, name is read-only")}})}function i(e){return!(Dn(e)||Fn(e)||In(e)||Hn(e)||qn(e)||Wn(e)||Kn(e))}return o.prototype=new n,o.prototype.type="AccessorNode",o.prototype.isAccessorNode=!0,o.prototype._compile=function(e,t){var n=this.object._compile(e,t),o=this.index._compile(e,t);if(this.index.isObjectProperty()){var i=this.index.getObjectProperty();return function(e,t,r){return ho(n(e,t,r),i)}}return function(e,t,i){var a=n(e,t,i),s=o(e,t,a);return r(a,s)}},o.prototype.forEach=function(e){e(this.object,"object",this),e(this.index,"index",this)},o.prototype.map=function(e){return new o(this._ifNode(e(this.object,"object",this)),this._ifNode(e(this.index,"index",this)))},o.prototype.clone=function(){return new o(this.object,this.index)},o.prototype._toString=function(e){var t=this.object.toString(e);return i(this.object)&&(t="("+t+")"),t+this.index.toString(e)},o.prototype.toHTML=function(e){var t=this.object.toHTML(e);return i(this.object)&&(t='<span class="math-parenthesis math-round-parenthesis">(</span>'+t+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t+this.index.toHTML(e)},o.prototype._toTex=function(e){var t=this.object.toTex(e);return i(this.object)&&(t="\\left(' + object + '\\right)"),t+this.index.toTex(e)},o.prototype.toJSON=function(){return{mathjs:"AccessorNode",object:this.object,index:this.index}},o.fromJSON=function(e){return new o(e.object,e.index)},o},{isClass:!0,isNode:!0}),wa={NodeDependencies:Mo,subsetDependencies:ha,createAccessorNode:Oa},ja="ArrayNode",Na=["Node"],xa=Qr(ja,Na,e=>{var{Node:t}=e;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(this.items=e||[],!Array.isArray(this.items)||!this.items.every(Rn))throw new TypeError("Array containing Nodes expected")}return n.prototype=new t,n.prototype.type="ArrayNode",n.prototype.isArrayNode=!0,n.prototype._compile=function(e,t){var n=Kr(this.items,(function(n){return n._compile(e,t)})),r="Array"!==e.config.matrix;if(r){var o=e.matrix;return function(e,t,r){return o(Kr(n,(function(n){return n(e,t,r)})))}}return function(e,t,r){return Kr(n,(function(n){return n(e,t,r)}))}},n.prototype.forEach=function(e){for(var t=0;t<this.items.length;t++){var n=this.items[t];e(n,"items["+t+"]",this)}},n.prototype.map=function(e){for(var t=[],r=0;r<this.items.length;r++)t[r]=this._ifNode(e(this.items[r],"items["+r+"]",this));return new n(t)},n.prototype.clone=function(){return new n(this.items.slice(0))},n.prototype._toString=function(e){var t=this.items.map((function(t){return t.toString(e)}));return"["+t.join(", ")+"]"},n.prototype.toJSON=function(){return{mathjs:"ArrayNode",items:this.items}},n.fromJSON=function(e){return new n(e.items)},n.prototype.toHTML=function(e){var t=this.items.map((function(t){return t.toHTML(e)}));return'<span class="math-parenthesis math-square-parenthesis">[</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'},n.prototype._toTex=function(e){function t(n,r){var o=n.some(Fn)&&!n.every(Fn),i=r||o,a=i?"&":"\\\\",s=n.map((function(n){return n.items?t(n.items,!r):n.toTex(e)})).join(a);return o||!i||i&&!r?"\\begin{bmatrix}"+s+"\\end{bmatrix}":s}return t(this.items,!1)},n},{isClass:!0,isNode:!0}),ka={NodeDependencies:Mo,createArrayNode:xa},Ea={createMatrix:fa};function Ca(e){var{subset:t,matrix:n}=e;return function(e,r,o){try{if(Array.isArray(e))return n(e).subset(r,o).valueOf();if(e&&"function"===typeof e.subset)return e.subset(r,o);if("string"===typeof e)return t(e,r,o);if("object"===typeof e){if(!r.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return go(e,r.getObjectProperty(),o),e}throw new TypeError("Cannot apply index: unsupported type of object")}catch(i){throw ga(i)}}}var Sa=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{associativity:"left",associativeWith:[]}},{"OperatorNode:and":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{associativity:"left",associativeWith:[]},"OperatorNode:unequal":{associativity:"left",associativeWith:[]},"OperatorNode:smaller":{associativity:"left",associativeWith:[]},"OperatorNode:larger":{associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{associativity:"left",associativeWith:[]}},{"OperatorNode:to":{associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{associativity:"left",associativeWith:[]},"OperatorNode:mod":{associativity:"left",associativeWith:[]}},{"OperatorNode:unaryPlus":{associativity:"right"},"OperatorNode:unaryMinus":{associativity:"right"},"OperatorNode:bitNot":{associativity:"right"},"OperatorNode:not":{associativity:"right"}},{"OperatorNode:pow":{associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{associativity:"left"}},{"OperatorNode:transpose":{associativity:"left"}}];function Aa(e,t){var n=e;"keep"!==t&&(n=e.getContent());for(var r=n.getIdentifier(),o=0;o<Sa.length;o++)if(r in Sa[o])return o;return null}function Va(e,t){var n=e;"keep"!==t&&(n=e.getContent());var r=n.getIdentifier(),o=Aa(n,t);if(null===o)return null;var i=Sa[o][r];if(ir(i,"associativity")){if("left"===i.associativity)return"left";if("right"===i.associativity)return"right";throw Error("'"+r+"' has the invalid associativity '"+i.associativity+"'.")}return null}function Ta(e,t,n){var r="keep"!==n?e.getContent():e,o="keep"!==n?e.getContent():t,i=r.getIdentifier(),a=o.getIdentifier(),s=Aa(r,n);if(null===s)return null;var l=Sa[s][i];if(ir(l,"associativeWith")&&l.associativeWith instanceof Array){for(var c=0;c<l.associativeWith.length;c++)if(l.associativeWith[c]===a)return!0;return!1}return null}var Ma="AssignmentNode",Pa=["subset","?matrix","Node"],Ba=Qr(Ma,Pa,e=>{var{subset:t,matrix:n,Node:r}=e,o=ba({subset:t}),i=Ca({subset:t,matrix:n});function a(e,t,n){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");if(this.object=e,this.index=n?t:null,this.value=n||t,!Kn(e)&&!Dn(e))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(Kn(e)&&"end"===e.name)throw new Error('Cannot assign to symbol "end"');if(this.index&&!Jn(this.index))throw new TypeError('IndexNode expected as "index"');if(!Rn(this.value))throw new TypeError('Node expected as "value"');Object.defineProperty(this,"name",{get:function(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}.bind(this),set:function(){throw new Error("Cannot assign a new name, name is read-only")}})}function s(e,t){t||(t="keep");var n=Aa(e,t),r=Aa(e.value,t);return"all"===t||null!==r&&r<=n}return a.prototype=new r,a.prototype.type="AssignmentNode",a.prototype.isAssignmentNode=!0,a.prototype._compile=function(e,t){var n=this.object._compile(e,t),r=this.index?this.index._compile(e,t):null,a=this.value._compile(e,t),s=this.object.name;if(this.index){if(this.index.isObjectProperty()){var l=this.index.getObjectProperty();return function(e,t,r){var o=n(e,t,r),i=a(e,t,r);return go(o,l,i),i}}if(Kn(this.object))return function(e,t,o){var l=n(e,t,o),c=a(e,t,o),u=r(e,t,l);return e.set(s,i(l,u,c)),c};var c=this.object.object._compile(e,t);if(this.object.index.isObjectProperty()){var u=this.object.index.getObjectProperty();return function(e,t,n){var o=c(e,t,n),s=ho(o,u),l=r(e,t,s),p=a(e,t,n);return go(o,u,i(s,l,p)),p}}var p=this.object.index._compile(e,t);return function(e,t,n){var s=c(e,t,n),l=p(e,t,s),u=o(s,l),f=r(e,t,u),d=a(e,t,n);return i(s,l,i(u,f,d)),d}}if(!Kn(this.object))throw new TypeError("SymbolNode expected as object");return function(e,t,n){var r=a(e,t,n);return e.set(s,r),r}},a.prototype.forEach=function(e){e(this.object,"object",this),this.index&&e(this.index,"index",this),e(this.value,"value",this)},a.prototype.map=function(e){var t=this._ifNode(e(this.object,"object",this)),n=this.index?this._ifNode(e(this.index,"index",this)):null,r=this._ifNode(e(this.value,"value",this));return new a(t,n,r)},a.prototype.clone=function(){return new a(this.object,this.index,this.value)},a.prototype._toString=function(e){var t=this.object.toString(e),n=this.index?this.index.toString(e):"",r=this.value.toString(e);return s(this,e&&e.parenthesis)&&(r="("+r+")"),t+n+" = "+r},a.prototype.toJSON=function(){return{mathjs:"AssignmentNode",object:this.object,index:this.index,value:this.value}},a.fromJSON=function(e){return new a(e.object,e.index,e.value)},a.prototype.toHTML=function(e){var t=this.object.toHTML(e),n=this.index?this.index.toHTML(e):"",r=this.value.toHTML(e);return s(this,e&&e.parenthesis)&&(r='<span class="math-paranthesis math-round-parenthesis">(</span>'+r+'<span class="math-paranthesis math-round-parenthesis">)</span>'),t+n+'<span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+r},a.prototype._toTex=function(e){var t=this.object.toTex(e),n=this.index?this.index.toTex(e):"",r=this.value.toTex(e);return s(this,e&&e.parenthesis)&&(r="\\left(".concat(r,"\\right)")),t+n+":="+r},a},{isClass:!0,isNode:!0}),Da={matrixDependencies:Ea,NodeDependencies:Mo,subsetDependencies:ha,createAssignmentNode:Ba},Fa="ResultSet",$a=[],_a=Qr(Fa,$a,()=>{function e(t){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=t||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(t){return new e(t.entries)},e},{isClass:!0}),La={createResultSet:_a},Ia="BlockNode",Ua=["ResultSet","Node"],Ha=Qr(Ia,Ua,e=>{var{ResultSet:t,Node:n}=e;function r(e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!Array.isArray(e))throw new Error("Array expected");this.blocks=e.map((function(e){var t=e&&e.node,n=!e||void 0===e.visible||e.visible;if(!Rn(t))throw new TypeError('Property "node" must be a Node');if("boolean"!==typeof n)throw new TypeError('Property "visible" must be a boolean');return{node:t,visible:n}}))}return r.prototype=new n,r.prototype.type="BlockNode",r.prototype.isBlockNode=!0,r.prototype._compile=function(e,n){var r=Kr(this.blocks,(function(t){return{evaluate:t.node._compile(e,n),visible:t.visible}}));return function(e,n,o){var i=[];return Yr(r,(function(t){var r=t.evaluate(e,n,o);t.visible&&i.push(r)})),new t(i)}},r.prototype.forEach=function(e){for(var t=0;t<this.blocks.length;t++)e(this.blocks[t].node,"blocks["+t+"].node",this)},r.prototype.map=function(e){for(var t=[],n=0;n<this.blocks.length;n++){var o=this.blocks[n],i=this._ifNode(e(o.node,"blocks["+n+"].node",this));t[n]={node:i,visible:o.visible}}return new r(t)},r.prototype.clone=function(){var e=this.blocks.map((function(e){return{node:e.node,visible:e.visible}}));return new r(e)},r.prototype._toString=function(e){return this.blocks.map((function(t){return t.node.toString(e)+(t.visible?"":";")})).join("\n")},r.prototype.toJSON=function(){return{mathjs:"BlockNode",blocks:this.blocks}},r.fromJSON=function(e){return new r(e.blocks)},r.prototype.toHTML=function(e){return this.blocks.map((function(t){return t.node.toHTML(e)+(t.visible?"":'<span class="math-separator">;</span>')})).join('<span class="math-separator"><br /></span>')},r.prototype._toTex=function(e){return this.blocks.map((function(t){return t.node.toTex(e)+(t.visible?"":";")})).join("\\;\\;\n")},r},{isClass:!0,isNode:!0}),Ja={NodeDependencies:Mo,ResultSetDependencies:La,createBlockNode:Ha},Ra="ConditionalNode",qa=["Node"],za=Qr(Ra,qa,e=>{var{Node:t}=e;function n(e,t,r){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!Rn(e))throw new TypeError("Parameter condition must be a Node");if(!Rn(t))throw new TypeError("Parameter trueExpr must be a Node");if(!Rn(r))throw new TypeError("Parameter falseExpr must be a Node");this.condition=e,this.trueExpr=t,this.falseExpr=r}function r(e){if("number"===typeof e||"boolean"===typeof e||"string"===typeof e)return!!e;if(e){if(mn(e))return!e.isZero();if(hn(e))return!(!e.re&&!e.im);if(bn(e))return!!e.value}if(null===e||void 0===e)return!1;throw new TypeError('Unsupported type of condition "'+Zn(e)+'"')}return n.prototype=new t,n.prototype.type="ConditionalNode",n.prototype.isConditionalNode=!0,n.prototype._compile=function(e,t){var n=this.condition._compile(e,t),o=this.trueExpr._compile(e,t),i=this.falseExpr._compile(e,t);return function(e,t,a){return r(n(e,t,a))?o(e,t,a):i(e,t,a)}},n.prototype.forEach=function(e){e(this.condition,"condition",this),e(this.trueExpr,"trueExpr",this),e(this.falseExpr,"falseExpr",this)},n.prototype.map=function(e){return new n(this._ifNode(e(this.condition,"condition",this)),this._ifNode(e(this.trueExpr,"trueExpr",this)),this._ifNode(e(this.falseExpr,"falseExpr",this)))},n.prototype.clone=function(){return new n(this.condition,this.trueExpr,this.falseExpr)},n.prototype._toString=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=Aa(this,t),r=this.condition.toString(e),o=Aa(this.condition,t);("all"===t||"OperatorNode"===this.condition.type||null!==o&&o<=n)&&(r="("+r+")");var i=this.trueExpr.toString(e),a=Aa(this.trueExpr,t);("all"===t||"OperatorNode"===this.trueExpr.type||null!==a&&a<=n)&&(i="("+i+")");var s=this.falseExpr.toString(e),l=Aa(this.falseExpr,t);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==l&&l<=n)&&(s="("+s+")"),r+" ? "+i+" : "+s},n.prototype.toJSON=function(){return{mathjs:"ConditionalNode",condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}},n.fromJSON=function(e){return new n(e.condition,e.trueExpr,e.falseExpr)},n.prototype.toHTML=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=Aa(this,t),r=this.condition.toHTML(e),o=Aa(this.condition,t);("all"===t||"OperatorNode"===this.condition.type||null!==o&&o<=n)&&(r='<span class="math-parenthesis math-round-parenthesis">(</span>'+r+'<span class="math-parenthesis math-round-parenthesis">)</span>');var i=this.trueExpr.toHTML(e),a=Aa(this.trueExpr,t);("all"===t||"OperatorNode"===this.trueExpr.type||null!==a&&a<=n)&&(i='<span class="math-parenthesis math-round-parenthesis">(</span>'+i+'<span class="math-parenthesis math-round-parenthesis">)</span>');var s=this.falseExpr.toHTML(e),l=Aa(this.falseExpr,t);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==l&&l<=n)&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),r+'<span class="math-operator math-conditional-operator">?</span>'+i+'<span class="math-operator math-conditional-operator">:</span>'+s},n.prototype._toTex=function(e){return"\\begin{cases} {"+this.trueExpr.toTex(e)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(e)+"}\\\\{"+this.falseExpr.toTex(e)+"}, &\\quad{\\text{otherwise}}\\end{cases}"},n},{isClass:!0,isNode:!0}),Wa={NodeDependencies:Mo,createConditionalNode:za},Ga=n("4788"),Ka=n.n(Ga),Ya={Alpha:"A",alpha:"\\alpha",Beta:"B",beta:"\\beta",Gamma:"\\Gamma",gamma:"\\gamma",Delta:"\\Delta",delta:"\\delta",Epsilon:"E",epsilon:"\\epsilon",varepsilon:"\\varepsilon",Zeta:"Z",zeta:"\\zeta",Eta:"H",eta:"\\eta",Theta:"\\Theta",theta:"\\theta",vartheta:"\\vartheta",Iota:"I",iota:"\\iota",Kappa:"K",kappa:"\\kappa",varkappa:"\\varkappa",Lambda:"\\Lambda",lambda:"\\lambda",Mu:"M",mu:"\\mu",Nu:"N",nu:"\\nu",Xi:"\\Xi",xi:"\\xi",Omicron:"O",omicron:"o",Pi:"\\Pi",pi:"\\pi",varpi:"\\varpi",Rho:"P",rho:"\\rho",varrho:"\\varrho",Sigma:"\\Sigma",sigma:"\\sigma",varsigma:"\\varsigma",Tau:"T",tau:"\\tau",Upsilon:"\\Upsilon",upsilon:"\\upsilon",Phi:"\\Phi",phi:"\\phi",varphi:"\\varphi",Chi:"X",chi:"\\chi",Psi:"\\Psi",psi:"\\psi",Omega:"\\Omega",omega:"\\omega",true:"\\mathrm{True}",false:"\\mathrm{False}",i:"i",inf:"\\infty",Inf:"\\infty",infinity:"\\infty",Infinity:"\\infty",oo:"\\infty",lim:"\\lim",undefined:"\\mathbf{?}"},Za={transpose:"^\\top",ctranspose:"^H",factorial:"!",pow:"^",dotPow:".^\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"\\~",not:"\\neg",multiply:"\\cdot",divide:"\\frac",dotMultiply:".\\cdot",dotDivide:".:",mod:"\\mod",add:"+",subtract:"-",to:"\\rightarrow",leftShift:"<<",rightArithShift:">>",rightLogShift:">>>",equal:"=",unequal:"\\neq",smaller:"<",larger:">",smallerEq:"\\leq",largerEq:"\\geq",bitAnd:"\\&",bitXor:"\\underline{|}",bitOr:"|",and:"\\wedge",xor:"\\veebar",or:"\\vee"},Xa={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(Za.add,"${args[1]}\\right)")},cbrt:{1:"\\sqrt[3]{${args[0]}}"},ceil:{1:"\\left\\lceil${args[0]}\\right\\rceil"},cube:{1:"\\left(${args[0]}\\right)^3"},divide:{2:"\\frac{${args[0]}}{${args[1]}}"},dotDivide:{2:"\\left(${args[0]}".concat(Za.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(Za.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(Za.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(Za.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},gcd:"\\gcd\\left(${args}\\right)",hypot:"\\hypot\\left(${args}\\right)",log:{1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},log10:{1:"\\log_{10}\\left(${args[0]}\\right)"},log1p:{1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},log2:"\\log_{2}\\left(${args[0]}\\right)",mod:{2:"\\left(${args[0]}".concat(Za.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(Za.multiply,"${args[1]}\\right)")},norm:{1:"\\left\\|${args[0]}\\right\\|",2:void 0},nthRoot:{2:"\\sqrt[${args[1]}]{${args[0]}}"},nthRoots:{2:"\\{y : $y^{args[1]} = {${args[0]}}\\}"},pow:{2:"\\left(${args[0]}\\right)".concat(Za.pow,"{${args[1]}}")},round:{1:"\\left\\lfloor${args[0]}\\right\\rceil",2:void 0},sign:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},sqrt:{1:"\\sqrt{${args[0]}}"},square:{1:"\\left(${args[0]}\\right)^2"},subtract:{2:"\\left(${args[0]}".concat(Za.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(Za.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(Za.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(Za.bitAnd,"${args[1]}\\right)")},bitNot:{1:Za.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(Za.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(Za.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(Za.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(Za.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(Za.rightLogShift,"${args[1]}\\right)")},bellNumbers:{1:"\\mathrm{B}_{${args[0]}}"},catalan:{1:"\\mathrm{C}_{${args[0]}}"},stirlingS2:{2:"\\mathrm{S}\\left(${args}\\right)"},arg:{1:"\\arg\\left(${args[0]}\\right)"},conj:{1:"\\left(${args[0]}\\right)^*"},im:{1:"\\Im\\left\\lbrace${args[0]}\\right\\rbrace"},re:{1:"\\Re\\left\\lbrace${args[0]}\\right\\rbrace"},and:{2:"\\left(${args[0]}".concat(Za.and,"${args[1]}\\right)")},not:{1:Za.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(Za.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(Za.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(Za.ctranspose)},det:{1:"\\det\\left(${args[0]}\\right)"},dot:{2:"\\left(${args[0]}\\cdot${args[1]}\\right)"},expm:{1:"\\exp\\left(${args[0]}\\right)"},inv:{1:"\\left(${args[0]}\\right)^{-1}"},pinv:{1:"\\left(${args[0]}\\right)^{+}"},sqrtm:{1:"{${args[0]}}".concat(Za.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(Za.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(Za.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(Za.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(Za.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(Za.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(Za.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(Za.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(Za.unequal,"${args[1]}\\right)")},erf:{1:"erf\\left(${args[0]}\\right)"},max:"\\max\\left(${args}\\right)",min:"\\min\\left(${args}\\right)",variance:"\\mathrm{Var}\\left(${args}\\right)",acos:{1:"\\cos^{-1}\\left(${args[0]}\\right)"},acosh:{1:"\\cosh^{-1}\\left(${args[0]}\\right)"},acot:{1:"\\cot^{-1}\\left(${args[0]}\\right)"},acoth:{1:"\\coth^{-1}\\left(${args[0]}\\right)"},acsc:{1:"\\csc^{-1}\\left(${args[0]}\\right)"},acsch:{1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},asec:{1:"\\sec^{-1}\\left(${args[0]}\\right)"},asech:{1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},asin:{1:"\\sin^{-1}\\left(${args[0]}\\right)"},asinh:{1:"\\sinh^{-1}\\left(${args[0]}\\right)"},atan:{1:"\\tan^{-1}\\left(${args[0]}\\right)"},atan2:{2:"\\mathrm{atan2}\\left(${args}\\right)"},atanh:{1:"\\tanh^{-1}\\left(${args[0]}\\right)"},cos:{1:"\\cos\\left(${args[0]}\\right)"},cosh:{1:"\\cosh\\left(${args[0]}\\right)"},cot:{1:"\\cot\\left(${args[0]}\\right)"},coth:{1:"\\coth\\left(${args[0]}\\right)"},csc:{1:"\\csc\\left(${args[0]}\\right)"},csch:{1:"\\mathrm{csch}\\left(${args[0]}\\right)"},sec:{1:"\\sec\\left(${args[0]}\\right)"},sech:{1:"\\mathrm{sech}\\left(${args[0]}\\right)"},sin:{1:"\\sin\\left(${args[0]}\\right)"},sinh:{1:"\\sinh\\left(${args[0]}\\right)"},tan:{1:"\\tan\\left(${args[0]}\\right)"},tanh:{1:"\\tanh\\left(${args[0]}\\right)"},to:{2:"\\left(${args[0]}".concat(Za.to,"${args[1]}\\right)")},numeric:function(e,t){return e.args[0].toTex()},number:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:"0",1:"\\left(${args[0]}\\right)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(Ya.i,"\\cdot\\left(${args[1]}\\right)\\right)")},matrix:{0:"\\begin{bmatrix}\\end{bmatrix}",1:"\\left(${args[0]}\\right)",2:"\\left(${args[0]}\\right)"},sparse:{0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},unit:{1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"}},Qa="\\mathrm{${name}}\\left(${args}\\right)",es={deg:"^\\circ"};function ts(e){return Ka()(e,{preserveFormatting:!0})}function ns(e,t){return t="undefined"!==typeof t&&t,t?ir(es,e)?es[e]:"\\mathrm{"+ts(e)+"}":ir(Ya,e)?Ya[e]:ts(e)}var rs="ConstantNode",os=["Node"],is=Qr(rs,os,e=>{var{Node:t}=e;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this.value=e}return n.prototype=new t,n.prototype.type="ConstantNode",n.prototype.isConstantNode=!0,n.prototype._compile=function(e,t){var n=this.value;return function(){return n}},n.prototype.forEach=function(e){},n.prototype.map=function(e){return this.clone()},n.prototype.clone=function(){return new n(this.value)},n.prototype._toString=function(e){return Ir(this.value,e)},n.prototype.toHTML=function(e){var t=this._toString(e);switch(Zn(this.value)){case"number":case"BigNumber":case"Fraction":return'<span class="math-number">'+t+"</span>";case"string":return'<span class="math-string">'+t+"</span>";case"boolean":return'<span class="math-boolean">'+t+"</span>";case"null":return'<span class="math-null-symbol">'+t+"</span>";case"undefined":return'<span class="math-undefined">'+t+"</span>";default:return'<span class="math-symbol">'+t+"</span>"}},n.prototype.toJSON=function(){return{mathjs:"ConstantNode",value:this.value}},n.fromJSON=function(e){return new n(e.value)},n.prototype._toTex=function(e){var t=this._toString(e);switch(Zn(this.value)){case"string":return"\\mathtt{"+ts(t)+"}";case"number":case"BigNumber":if(!isFinite(this.value))return this.value.valueOf()<0?"-\\infty":"\\infty";var n=t.toLowerCase().indexOf("e");return-1!==n?t.substring(0,n)+"\\cdot10^{"+t.substring(n+1)+"}":t;case"Fraction":return this.value.toLatex();default:return t}},n},{isClass:!0,isNode:!0}),as={NodeDependencies:Mo,createConstantNode:is},ss=n("7634"),ls=n.n(ss),cs=function(){return cs=ls.a.create,ls.a},us=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],ps=Qr("typed",us,(function(e){var{BigNumber:t,Complex:n,DenseMatrix:r,Fraction:o}=e,i=cs();return i.types=[{name:"number",test:dn},{name:"Complex",test:hn},{name:"BigNumber",test:mn},{name:"Fraction",test:gn},{name:"Unit",test:bn},{name:"string",test:vn},{name:"Chain",test:Yn},{name:"Array",test:yn},{name:"Matrix",test:On},{name:"DenseMatrix",test:jn},{name:"SparseMatrix",test:Nn},{name:"Range",test:xn},{name:"Index",test:kn},{name:"boolean",test:En},{name:"ResultSet",test:Cn},{name:"Help",test:Sn},{name:"function",test:An},{name:"Date",test:Vn},{name:"RegExp",test:Tn},{name:"null",test:Pn},{name:"undefined",test:Bn},{name:"AccessorNode",test:Dn},{name:"ArrayNode",test:Fn},{name:"AssignmentNode",test:$n},{name:"BlockNode",test:_n},{name:"ConditionalNode",test:Ln},{name:"ConstantNode",test:In},{name:"FunctionNode",test:Hn},{name:"FunctionAssignmentNode",test:Un},{name:"IndexNode",test:Jn},{name:"Node",test:Rn},{name:"ObjectNode",test:qn},{name:"OperatorNode",test:zn},{name:"ParenthesisNode",test:Wn},{name:"RangeNode",test:Gn},{name:"SymbolNode",test:Kn},{name:"Map",test:Co},{name:"Object",test:Mn}],i.conversions=[{from:"number",to:"BigNumber",convert:function(e){if(t||fs(e),Sr(e)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+e+"). Use function bignumber(x) to convert to BigNumber.");return new t(e)}},{from:"number",to:"Complex",convert:function(e){return n||ds(e),new n(e,0)}},{from:"number",to:"string",convert:function(e){return e+""}},{from:"BigNumber",to:"Complex",convert:function(e){return n||ds(e),new n(e.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(e){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(e){return n||ds(e),new n(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){o||hs(e);var t=new o(e);if(t.valueOf()!==e)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+e+"). Use function fraction(x) to convert to Fraction.");return t}},{from:"string",to:"number",convert:function(e){var t=Number(e);if(isNaN(t))throw new Error('Cannot convert "'+e+'" to a number');return t}},{from:"string",to:"BigNumber",convert:function(e){t||fs(e);try{return new t(e)}catch(n){throw new Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(e){o||hs(e);try{return new o(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){n||ds(e);try{return new n(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Complex')}}},{from:"boolean",to:"number",convert:function(e){return+e}},{from:"boolean",to:"BigNumber",convert:function(e){return t||fs(e),new t(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return o||hs(e),new o(+e)}},{from:"boolean",to:"string",convert:function(e){return String(e)}},{from:"Array",to:"Matrix",convert:function(e){return r||ms(),new r(e)}},{from:"Matrix",to:"Array",convert:function(e){return e.valueOf()}}],i}));function fs(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function ds(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function ms(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function hs(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var gs={createTyped:ps},bs="FunctionAssignmentNode",vs=["typed","Node"],ys=Qr(bs,vs,e=>{var{typed:t,Node:n}=e;function r(e,t,n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if("string"!==typeof e)throw new TypeError('String expected for parameter "name"');if(!Array.isArray(t))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!Rn(n))throw new TypeError('Node expected for parameter "expr"');if(mo.has(e))throw new Error('Illegal function name, "'+e+'" is a reserved keyword');this.name=e,this.params=t.map((function(e){return e&&e.name||e})),this.types=t.map((function(e){return e&&e.type||"any"})),this.expr=n}function o(e,t){var n=Aa(e,t),r=Aa(e.expr,t);return"all"===t||null!==r&&r<=n}return r.prototype=new n,r.prototype.type="FunctionAssignmentNode",r.prototype.isFunctionAssignmentNode=!0,r.prototype._compile=function(e,n){var r=Object.create(n);Yr(this.params,(function(e){r[e]=!0}));var o=this.expr._compile(e,r),i=this.name,a=this.params,s=Zr(this.types,","),l=i+"("+Zr(this.params,", ")+")";return function(e,n,r){var c={};c[s]=function(){for(var t=Object.create(n),i=0;i<a.length;i++)t[a[i]]=arguments[i];return o(e,t,r)};var u=t(i,c);return u.syntax=l,e.set(i,u),u}},r.prototype.forEach=function(e){e(this.expr,"expr",this)},r.prototype.map=function(e){var t=this._ifNode(e(this.expr,"expr",this));return new r(this.name,this.params.slice(0),t)},r.prototype.clone=function(){return new r(this.name,this.params.slice(0),this.expr)},r.prototype._toString=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=this.expr.toString(e);return o(this,t)&&(n="("+n+")"),this.name+"("+this.params.join(", ")+") = "+n},r.prototype.toJSON=function(){var e=this.types;return{mathjs:"FunctionAssignmentNode",name:this.name,params:this.params.map((function(t,n){return{name:t,type:e[n]}})),expr:this.expr}},r.fromJSON=function(e){return new r(e.name,e.params,e.expr)},r.prototype.toHTML=function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=[],r=0;r<this.params.length;r++)n.push('<span class="math-symbol math-parameter">'+Jr(this.params[r])+"</span>");var i=this.expr.toHTML(e);return o(this,t)&&(i='<span class="math-parenthesis math-round-parenthesis">(</span>'+i+'<span class="math-parenthesis math-round-parenthesis">)</span>'),'<span class="math-function">'+Jr(this.name)+'</span><span class="math-parenthesis math-round-parenthesis">(</span>'+n.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-round-parenthesis">)</span><span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+i},r.prototype._toTex=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=this.expr.toTex(e);return o(this,t)&&(n="\\left(".concat(n,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(ns).join(",")+"\\right):="+n},r},{isClass:!0,isNode:!0}),Os={NodeDependencies:Mo,typedDependencies:gs,createFunctionAssignmentNode:ys},ws="SymbolNode",js=["math","?Unit","Node"],Ns=Qr(ws,js,e=>{var{math:t,Unit:n,Node:r}=e;function o(e){return!!n&&n.isValuelessUnit(e)}function i(e){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if("string"!==typeof e)throw new TypeError('String expected for parameter "name"');this.name=e}return i.prototype=new r,i.prototype.type="SymbolNode",i.prototype.isSymbolNode=!0,i.prototype._compile=function(e,t){var r=this.name;if(!0===t[r])return function(e,t,n){return t[r]};if(r in e)return function(t,n,o){return t.has(r)?t.get(r):ho(e,r)};var a=o(r);return function(e,t,o){return e.has(r)?e.get(r):a?new n(null,r):i.onUndefinedSymbol(r)}},i.prototype.forEach=function(e){},i.prototype.map=function(e){return this.clone()},i.onUndefinedSymbol=function(e){throw new Error("Undefined symbol "+e)},i.prototype.clone=function(){return new i(this.name)},i.prototype._toString=function(e){return this.name},i.prototype.toHTML=function(e){var t=Jr(this.name);return"true"===t||"false"===t?'<span class="math-symbol math-boolean">'+t+"</span>":"i"===t?'<span class="math-symbol math-imaginary-symbol">'+t+"</span>":"Infinity"===t?'<span class="math-symbol math-infinity-symbol">'+t+"</span>":"NaN"===t?'<span class="math-symbol math-nan-symbol">'+t+"</span>":"null"===t?'<span class="math-symbol math-null-symbol">'+t+"</span>":"undefined"===t?'<span class="math-symbol math-undefined-symbol">'+t+"</span>":'<span class="math-symbol">'+t+"</span>"},i.prototype.toJSON=function(){return{mathjs:"SymbolNode",name:this.name}},i.fromJSON=function(e){return new i(e.name)},i.prototype._toTex=function(e){var n=!1;"undefined"===typeof t[this.name]&&o(this.name)&&(n=!0);var r=ns(this.name,n);return"\\"===r[0]?r:" "+r},i},{isClass:!0,isNode:!0}),xs={NodeDependencies:Mo,createSymbolNode:Ns};function ks(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"===typeof e.createSubScope?So(e.createSubScope(),...n):So(ko(),e,...n)}var Es="FunctionNode",Cs=["math","Node","SymbolNode"],Ss=Qr(Es,Cs,e=>{var{math:t,Node:n,SymbolNode:r}=e;function o(e,t){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");if("string"===typeof e&&(e=new r(e)),!Rn(e))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(t)||!t.every(Rn))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=e,this.args=t||[],Object.defineProperty(this,"name",{get:function(){return this.fn.name||""}.bind(this),set:function(){throw new Error("Cannot assign a new name, name is read-only")}})}o.prototype=new n,o.prototype.type="FunctionNode",o.prototype.isFunctionNode=!0;var i=e=>Ir(e,{truncate:78});o.prototype._compile=function(e,t){if(!(this instanceof o))throw new TypeError("No valid FunctionNode");var n=this.args.map(n=>n._compile(e,t));if(!Kn(this.fn)){if(Dn(this.fn)&&Jn(this.fn.index)&&this.fn.index.isObjectProperty()){var r=this.fn.object._compile(e,t),a=this.fn.index.getObjectProperty(),s=this.args;return function(t,o,i){var l=r(t,o,i);yo(l,a);var c=l[a]&&l[a].rawArgs;if(c)return l[a](s,e,ks(t,o),t);var u=n.map(e=>e(t,o,i));return l[a].apply(l,u)}}var l=this.fn.toString(),c=this.fn._compile(e,t),u=this.args;return function(t,r,o){var a=c(t,r,o);if("function"!==typeof a)throw new TypeError("Expression '".concat(l,"' did not evaluate to a function; value is:")+"\n ".concat(i(a)));if(a.rawArgs)return a(u,e,ks(t,r),t);var s=n.map(e=>e(t,r,o));return a.apply(a,s)}}var p=this.fn.name;if(t[p]){var f=this.args;return function(t,r,o){var a=r[p];if("function"!==typeof a)throw new TypeError("Argument '".concat(p,"' was not a function; received: ").concat(i(a)));if(a.rawArgs)return a(f,e,ks(t,r),t);var s=n.map(e=>e(t,r,o));return a.apply(a,s)}}var d=p in e?ho(e,p):void 0,m="function"===typeof d&&!0===d.rawArgs,h=t=>{var n;if(t.has(p))n=t.get(p);else{if(!(p in e))return o.onUndefinedFunction(p);n=ho(e,p)}if("function"===typeof n)return n;throw new TypeError("'".concat(p,"' is not a function; its value is:\n ").concat(i(n)))};if(m){var g=this.args;return function(t,n,r){var o=h(t);return o(g,e,ks(t,n),t)}}switch(n.length){case 0:return function(e,t,n){var r=h(e);return r()};case 1:return function(e,t,r){var o=h(e),i=n[0];return o(i(e,t,r))};case 2:return function(e,t,r){var o=h(e),i=n[0],a=n[1];return o(i(e,t,r),a(e,t,r))};default:return function(e,t,r){var o=h(e),i=n.map(n=>n(e,t,r));return o(...i)}}},o.prototype.forEach=function(e){e(this.fn,"fn",this);for(var t=0;t<this.args.length;t++)e(this.args[t],"args["+t+"]",this)},o.prototype.map=function(e){for(var t=this._ifNode(e(this.fn,"fn",this)),n=[],r=0;r<this.args.length;r++)n[r]=this._ifNode(e(this.args[r],"args["+r+"]",this));return new o(t,n)},o.prototype.clone=function(){return new o(this.fn,this.args.slice(0))},o.onUndefinedFunction=function(e){throw new Error("Undefined function "+e)};var a=o.prototype.toString;function s(e,t,n){var r,o="",i=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,a=0;while(null!==(r=i.exec(e)))if(o+=e.substring(a,r.index),a=r.index,"$$"===r[0])o+="$",a++;else{a+=r[0].length;var s=t[r[1]];if(!s)throw new ReferenceError("Template: Property "+r[1]+" does not exist.");if(void 0===r[2])switch(typeof s){case"string":o+=s;break;case"object":if(Rn(s))o+=s.toTex(n);else{if(!Array.isArray(s))throw new TypeError("Template: "+r[1]+" has to be a Node, String or array of Nodes");o+=s.map((function(e,t){if(Rn(e))return e.toTex(n);throw new TypeError("Template: "+r[1]+"["+t+"] is not a Node.")})).join(",")}break;default:throw new TypeError("Template: "+r[1]+" has to be a Node, String or array of Nodes")}else{if(!Rn(s[r[2]]&&s[r[2]]))throw new TypeError("Template: "+r[1]+"["+r[2]+"] is not a Node.");o+=s[r[2]].toTex(n)}}return o+=e.slice(a),o}o.prototype.toString=function(e){var t,n=this.fn.toString(e);return e&&"object"===typeof e.handler&&ir(e.handler,n)&&(t=e.handler[n](this,e)),"undefined"!==typeof t?t:a.call(this,e)},o.prototype._toString=function(e){var t=this.args.map((function(t){return t.toString(e)})),n=Un(this.fn)?"("+this.fn.toString(e)+")":this.fn.toString(e);return n+"("+t.join(", ")+")"},o.prototype.toJSON=function(){return{mathjs:"FunctionNode",fn:this.fn,args:this.args}},o.fromJSON=function(e){return new o(e.fn,e.args)},o.prototype.toHTML=function(e){var t=this.args.map((function(t){return t.toHTML(e)}));return'<span class="math-function">'+Jr(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'};var l=o.prototype.toTex;return o.prototype.toTex=function(e){var t;return e&&"object"===typeof e.handler&&ir(e.handler,this.name)&&(t=e.handler[this.name](this,e)),"undefined"!==typeof t?t:l.call(this,e)},o.prototype._toTex=function(e){var n,r,o=this.args.map((function(t){return t.toTex(e)}));switch(Xa[this.name]&&(n=Xa[this.name]),!t[this.name]||"function"!==typeof t[this.name].toTex&&"object"!==typeof t[this.name].toTex&&"string"!==typeof t[this.name].toTex||(n=t[this.name].toTex),typeof n){case"function":r=n(this,e);break;case"string":r=s(n,this,e);break;case"object":switch(typeof n[o.length]){case"function":r=n[o.length](this,e);break;case"string":r=s(n[o.length],this,e);break}}return"undefined"!==typeof r?r:s(Qa,this,e)},o.prototype.getIdentifier=function(){return this.type+":"+this.name},o},{isClass:!0,isNode:!0}),As={NodeDependencies:Mo,SymbolNodeDependencies:xs,createFunctionNode:Ss},Vs="size",Ts=["typed","config","?matrix"],Ms=Qr(Vs,Ts,e=>{var{typed:t,config:n,matrix:r}=e;return t(Vs,{Matrix:function(e){return e.create(e.size())},Array:Gr,string:function(e){return"Array"===n.matrix?[e.length]:r([e.length])},"number | Complex | BigNumber | Unit | boolean | null":function(e){return"Array"===n.matrix?[]:r?r([]):ua()}})}),Ps={matrixDependencies:Ea,typedDependencies:gs,createSize:Ms},Bs="IndexNode",Ds=["Node","size"],Fs=Qr(Bs,Ds,e=>{var{Node:t,size:n}=e;function r(e,t){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(this.dimensions=e,this.dotNotation=t||!1,!Array.isArray(e)||!e.every(Rn))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}return r.prototype=new t,r.prototype.type="IndexNode",r.prototype.isIndexNode=!0,r.prototype._compile=function(e,t){var r=Kr(this.dimensions,(function(r,o){var i=r.filter(e=>e.isSymbolNode&&"end"===e.name).length>0;if(i){var a=Object.create(t);a.end=!0;var s=r._compile(e,a);return function(e,t,r){if(!On(r)&&!yn(r)&&!vn(r))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+Zn(r));var i=n(r).valueOf(),a=Object.create(t);return a.end=i[o],s(e,a,r)}}return r._compile(e,t)})),o=ho(e,"index");return function(e,t,n){var i=Kr(r,(function(r){return r(e,t,n)}));return o(...i)}},r.prototype.forEach=function(e){for(var t=0;t<this.dimensions.length;t++)e(this.dimensions[t],"dimensions["+t+"]",this)},r.prototype.map=function(e){for(var t=[],n=0;n<this.dimensions.length;n++)t[n]=this._ifNode(e(this.dimensions[n],"dimensions["+n+"]",this));return new r(t,this.dotNotation)},r.prototype.clone=function(){return new r(this.dimensions.slice(0),this.dotNotation)},r.prototype.isObjectProperty=function(){return 1===this.dimensions.length&&In(this.dimensions[0])&&"string"===typeof this.dimensions[0].value},r.prototype.getObjectProperty=function(){return this.isObjectProperty()?this.dimensions[0].value:null},r.prototype._toString=function(e){return this.dotNotation?"."+this.getObjectProperty():"["+this.dimensions.join(", ")+"]"},r.prototype.toJSON=function(){return{mathjs:"IndexNode",dimensions:this.dimensions,dotNotation:this.dotNotation}},r.fromJSON=function(e){return new r(e.dimensions,e.dotNotation)},r.prototype.toHTML=function(e){for(var t=[],n=0;n<this.dimensions.length;n++)t[n]=this.dimensions[n].toHTML();return this.dotNotation?'<span class="math-operator math-accessor-operator">.</span><span class="math-symbol math-property">'+Jr(this.getObjectProperty())+"</span>":'<span class="math-parenthesis math-square-parenthesis">[</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'},r.prototype._toTex=function(e){var t=this.dimensions.map((function(t){return t.toTex(e)}));return this.dotNotation?"."+this.getObjectProperty():"_{"+t.join(",")+"}"},r},{isClass:!0,isNode:!0}),$s={NodeDependencies:Mo,sizeDependencies:Ps,createIndexNode:Fs},_s="ObjectNode",Ls=["Node"],Is=Qr(_s,Ls,e=>{var{Node:t}=e;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(this.properties=e||{},e&&("object"!==typeof e||!Object.keys(e).every((function(t){return Rn(e[t])}))))throw new TypeError("Object containing Nodes expected")}return n.prototype=new t,n.prototype.type="ObjectNode",n.prototype.isObjectNode=!0,n.prototype._compile=function(e,t){var n={};for(var r in this.properties)if(ir(this.properties,r)){var o=Hr(r),i=JSON.parse(o);if(!vo(this.properties,i))throw new Error('No access to property "'+i+'"');n[i]=this.properties[r]._compile(e,t)}return function(e,t,r){var o={};for(var i in n)ir(n,i)&&(o[i]=n[i](e,t,r));return o}},n.prototype.forEach=function(e){for(var t in this.properties)ir(this.properties,t)&&e(this.properties[t],"properties["+Hr(t)+"]",this)},n.prototype.map=function(e){var t={};for(var r in this.properties)ir(this.properties,r)&&(t[r]=this._ifNode(e(this.properties[r],"properties["+Hr(r)+"]",this)));return new n(t)},n.prototype.clone=function(){var e={};for(var t in this.properties)ir(this.properties,t)&&(e[t]=this.properties[t]);return new n(e)},n.prototype._toString=function(e){var t=[];for(var n in this.properties)ir(this.properties,n)&&t.push(Hr(n)+": "+this.properties[n].toString(e));return"{"+t.join(", ")+"}"},n.prototype.toJSON=function(){return{mathjs:"ObjectNode",properties:this.properties}},n.fromJSON=function(e){return new n(e.properties)},n.prototype.toHTML=function(e){var t=[];for(var n in this.properties)ir(this.properties,n)&&t.push('<span class="math-symbol math-property">'+Jr(n)+'</span><span class="math-operator math-assignment-operator math-property-assignment-operator math-binary-operator">:</span>'+this.properties[n].toHTML(e));return'<span class="math-parenthesis math-curly-parenthesis">{</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-curly-parenthesis">}</span>'},n.prototype._toTex=function(e){var t=[];for(var n in this.properties)ir(this.properties,n)&&t.push("\\mathbf{"+n+":} & "+this.properties[n].toTex(e)+"\\\\");return"\\left\\{\\begin{array}{ll}".concat(t.join("\n"),"\\end{array}\\right\\}")},n},{isClass:!0,isNode:!0}),Us={NodeDependencies:Mo,createObjectNode:Is},Hs="OperatorNode",Js=["Node"],Rs=Qr(Hs,Js,e=>{var{Node:t}=e;function n(e,t,r,o,i){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if("string"!==typeof e)throw new TypeError('string expected for parameter "op"');if("string"!==typeof t)throw new TypeError('string expected for parameter "fn"');if(!Array.isArray(r)||!r.every(Rn))throw new TypeError('Array containing Nodes expected for parameter "args"');this.implicit=!0===o,this.isPercentage=!0===i,this.op=e,this.fn=t,this.args=r||[]}function r(e,t,n,r,o){var i,a=Aa(e,t),s=Va(e,t);if("all"===t||r.length>2&&"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier())return r.map((function(e){switch(e.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}}));switch(r.length){case 0:i=[];break;case 1:var l=Aa(r[0],t);if(o&&null!==l){var c,u;if("keep"===t?(c=r[0].getIdentifier(),u=e.getIdentifier()):(c=r[0].getContent().getIdentifier(),u=e.getContent().getIdentifier()),!1===Sa[a][u].latexLeftParens){i=[!1];break}if(!1===Sa[l][c].latexParens){i=[!1];break}}if(null===l){i=[!1];break}if(l<=a){i=[!0];break}i=[!1];break;case 2:var p,f,d=Aa(r[0],t),m=Ta(e,r[0],t);p=null!==d&&(d===a&&"right"===s&&!m||d<a);var h,g,b,v=Aa(r[1],t),y=Ta(e,r[1],t);if(f=null!==v&&(v===a&&"left"===s&&!y||v<a),o)"keep"===t?(h=e.getIdentifier(),g=e.args[0].getIdentifier(),b=e.args[1].getIdentifier()):(h=e.getContent().getIdentifier(),g=e.args[0].getContent().getIdentifier(),b=e.args[1].getContent().getIdentifier()),null!==d&&(!1===Sa[a][h].latexLeftParens&&(p=!1),!1===Sa[d][g].latexParens&&(p=!1)),null!==v&&(!1===Sa[a][h].latexRightParens&&(f=!1),!1===Sa[v][b].latexParens&&(f=!1));i=[p,f];break;default:"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier()||(i=r.map((function(n){var r=Aa(n,t),o=Ta(e,n,t),i=Va(n,t);return null!==r&&(a===r&&s===i&&!o||r<a)})));break}return r.length>=2&&"OperatorNode:multiply"===e.getIdentifier()&&e.implicit&&"auto"===t&&"hide"===n&&(i=r.map((function(e,t){var n="ParenthesisNode"===e.getIdentifier();return!(!i[t]&&!n)}))),i}return n.prototype=new t,n.prototype.type="OperatorNode",n.prototype.isOperatorNode=!0,n.prototype._compile=function(e,t){if("string"!==typeof this.fn||!Oo(e,this.fn))throw e[this.fn]?new Error('No access to function "'+this.fn+'"'):new Error("Function "+this.fn+' missing in provided namespace "math"');var n=ho(e,this.fn),r=Kr(this.args,(function(n){return n._compile(e,t)}));if(1===r.length){var o=r[0];return function(e,t,r){return n(o(e,t,r))}}if(2===r.length){var i=r[0],a=r[1];return function(e,t,r){return n(i(e,t,r),a(e,t,r))}}return function(e,t,o){return n.apply(null,Kr(r,(function(n){return n(e,t,o)})))}},n.prototype.forEach=function(e){for(var t=0;t<this.args.length;t++)e(this.args[t],"args["+t+"]",this)},n.prototype.map=function(e){for(var t=[],r=0;r<this.args.length;r++)t[r]=this._ifNode(e(this.args[r],"args["+r+"]",this));return new n(this.op,this.fn,t,this.implicit,this.isPercentage)},n.prototype.clone=function(){return new n(this.op,this.fn,this.args.slice(0),this.implicit,this.isPercentage)},n.prototype.isUnary=function(){return 1===this.args.length},n.prototype.isBinary=function(){return 2===this.args.length},n.prototype._toString=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=e&&e.implicit?e.implicit:"hide",o=this.args,i=r(this,t,n,o,!1);if(1===o.length){var a=Va(this,t),s=o[0].toString(e);i[0]&&(s="("+s+")");var l=/[a-zA-Z]+/.test(this.op);return"right"===a?this.op+(l?" ":"")+s:"left"===a?s+(l?" ":"")+this.op:s+this.op}if(2===o.length){var c=o[0].toString(e),u=o[1].toString(e);return i[0]&&(c="("+c+")"),i[1]&&(u="("+u+")"),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?c+" "+u:c+" "+this.op+" "+u}if(o.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var p=o.map((function(t,n){return t=t.toString(e),i[n]&&(t="("+t+")"),t}));return this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?p.join(" "):p.join(" "+this.op+" ")}return this.fn+"("+this.args.join(", ")+")"},n.prototype.toJSON=function(){return{mathjs:"OperatorNode",op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}},n.fromJSON=function(e){return new n(e.op,e.fn,e.args,e.implicit,e.isPercentage)},n.prototype.toHTML=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=e&&e.implicit?e.implicit:"hide",o=this.args,i=r(this,t,n,o,!1);if(1===o.length){var a=Va(this,t),s=o[0].toHTML(e);return i[0]&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),"right"===a?'<span class="math-operator math-unary-operator math-lefthand-unary-operator">'+Jr(this.op)+"</span>"+s:s+'<span class="math-operator math-unary-operator math-righthand-unary-operator">'+Jr(this.op)+"</span>"}if(2===o.length){var l=o[0].toHTML(e),c=o[1].toHTML(e);return i[0]&&(l='<span class="math-parenthesis math-round-parenthesis">(</span>'+l+'<span class="math-parenthesis math-round-parenthesis">)</span>'),i[1]&&(c='<span class="math-parenthesis math-round-parenthesis">(</span>'+c+'<span class="math-parenthesis math-round-parenthesis">)</span>'),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?l+'<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'+c:l+'<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Jr(this.op)+"</span>"+c}var u=o.map((function(t,n){return t=t.toHTML(e),i[n]&&(t='<span class="math-parenthesis math-round-parenthesis">(</span>'+t+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t}));return o.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())?this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?u.join('<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'):u.join('<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Jr(this.op)+"</span>"):'<span class="math-function">'+Jr(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+u.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'},n.prototype._toTex=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=e&&e.implicit?e.implicit:"hide",o=this.args,i=r(this,t,n,o,!0),a=Za[this.fn];if(a="undefined"===typeof a?this.op:a,1===o.length){var s=Va(this,t),l=o[0].toTex(e);return i[0]&&(l="\\left(".concat(l,"\\right)")),"right"===s?a+l:l+a}if(2===o.length){var c=o[0],u=c.toTex(e);i[0]&&(u="\\left(".concat(u,"\\right)"));var p,f=o[1],d=f.toTex(e);switch(i[1]&&(d="\\left(".concat(d,"\\right)")),p="keep"===t?c.getIdentifier():c.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return a+"{"+u+"}{"+d+"}";case"OperatorNode:pow":switch(u="{"+u+"}",d="{"+d+"}",p){case"ConditionalNode":case"OperatorNode:divide":u="\\left(".concat(u,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&"hide"===n)return u+"~"+d}return u+a+d}if(o.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var m=o.map((function(t,n){return t=t.toTex(e),i[n]&&(t="\\left(".concat(t,"\\right)")),t}));return"OperatorNode:multiply"===this.getIdentifier()&&this.implicit?m.join("~"):m.join(a)}return"\\mathrm{"+this.fn+"}\\left("+o.map((function(t){return t.toTex(e)})).join(",")+"\\right)"},n.prototype.getIdentifier=function(){return this.type+":"+this.fn},n},{isClass:!0,isNode:!0}),qs={NodeDependencies:Mo,createOperatorNode:Rs},zs="ParenthesisNode",Ws=["Node"],Gs=Qr(zs,Ws,e=>{var{Node:t}=e;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!Rn(e))throw new TypeError('Node expected for parameter "content"');this.content=e}return n.prototype=new t,n.prototype.type="ParenthesisNode",n.prototype.isParenthesisNode=!0,n.prototype._compile=function(e,t){return this.content._compile(e,t)},n.prototype.getContent=function(){return this.content.getContent()},n.prototype.forEach=function(e){e(this.content,"content",this)},n.prototype.map=function(e){var t=e(this.content,"content",this);return new n(t)},n.prototype.clone=function(){return new n(this.content)},n.prototype._toString=function(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"("+this.content.toString(e)+")":this.content.toString(e)},n.prototype.toJSON=function(){return{mathjs:"ParenthesisNode",content:this.content}},n.fromJSON=function(e){return new n(e.content)},n.prototype.toHTML=function(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?'<span class="math-parenthesis math-round-parenthesis">(</span>'+this.content.toHTML(e)+'<span class="math-parenthesis math-round-parenthesis">)</span>':this.content.toHTML(e)},n.prototype._toTex=function(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"\\left(".concat(this.content.toTex(e),"\\right)"):this.content.toTex(e)},n},{isClass:!0,isNode:!0}),Ks={NodeDependencies:Mo,createParenthesisNode:Gs},Ys="RangeNode",Zs=["Node"],Xs=Qr(Ys,Zs,e=>{var{Node:t}=e;function n(e,t,r){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!Rn(e))throw new TypeError("Node expected");if(!Rn(t))throw new TypeError("Node expected");if(r&&!Rn(r))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=e,this.end=t,this.step=r||null}function r(e,t){var n=Aa(e,t),r={},o=Aa(e.start,t);if(r.start=null!==o&&o<=n||"all"===t,e.step){var i=Aa(e.step,t);r.step=null!==i&&i<=n||"all"===t}var a=Aa(e.end,t);return r.end=null!==a&&a<=n||"all"===t,r}return n.prototype=new t,n.prototype.type="RangeNode",n.prototype.isRangeNode=!0,n.prototype.needsEnd=function(){var e=this.filter((function(e){return Kn(e)&&"end"===e.name}));return e.length>0},n.prototype._compile=function(e,t){var n=e.range,r=this.start._compile(e,t),o=this.end._compile(e,t);if(this.step){var i=this.step._compile(e,t);return function(e,t,a){return n(r(e,t,a),o(e,t,a),i(e,t,a))}}return function(e,t,i){return n(r(e,t,i),o(e,t,i))}},n.prototype.forEach=function(e){e(this.start,"start",this),e(this.end,"end",this),this.step&&e(this.step,"step",this)},n.prototype.map=function(e){return new n(this._ifNode(e(this.start,"start",this)),this._ifNode(e(this.end,"end",this)),this.step&&this._ifNode(e(this.step,"step",this)))},n.prototype.clone=function(){return new n(this.start,this.end,this.step&&this.step)},n.prototype._toString=function(e){var t,n=e&&e.parenthesis?e.parenthesis:"keep",o=r(this,n),i=this.start.toString(e);if(o.start&&(i="("+i+")"),t=i,this.step){var a=this.step.toString(e);o.step&&(a="("+a+")"),t+=":"+a}var s=this.end.toString(e);return o.end&&(s="("+s+")"),t+=":"+s,t},n.prototype.toJSON=function(){return{mathjs:"RangeNode",start:this.start,end:this.end,step:this.step}},n.fromJSON=function(e){return new n(e.start,e.end,e.step)},n.prototype.toHTML=function(e){var t,n=e&&e.parenthesis?e.parenthesis:"keep",o=r(this,n),i=this.start.toHTML(e);if(o.start&&(i='<span class="math-parenthesis math-round-parenthesis">(</span>'+i+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t=i,this.step){var a=this.step.toHTML(e);o.step&&(a='<span class="math-parenthesis math-round-parenthesis">(</span>'+a+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t+='<span class="math-operator math-range-operator">:</span>'+a}var s=this.end.toHTML(e);return o.end&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t+='<span class="math-operator math-range-operator">:</span>'+s,t},n.prototype._toTex=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=r(this,t),o=this.start.toTex(e);if(n.start&&(o="\\left(".concat(o,"\\right)")),this.step){var i=this.step.toTex(e);n.step&&(i="\\left(".concat(i,"\\right)")),o+=":"+i}var a=this.end.toTex(e);return n.end&&(a="\\left(".concat(a,"\\right)")),o+=":"+a,o},n},{isClass:!0,isNode:!0}),Qs={NodeDependencies:Mo,createRangeNode:Xs},el="RelationalNode",tl=["Node"],nl=Qr(el,tl,e=>{var{Node:t}=e;function n(e,t){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!Array.isArray(e))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(t))throw new TypeError("Parameter params must be an array");if(e.length!==t.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=e,this.params=t}return n.prototype=new t,n.prototype.type="RelationalNode",n.prototype.isRelationalNode=!0,n.prototype._compile=function(e,t){var n=this,r=this.params.map(n=>n._compile(e,t));return function(t,o,i){for(var a,s=r[0](t,o,i),l=0;l<n.conditionals.length;l++){a=s,s=r[l+1](t,o,i);var c=ho(e,n.conditionals[l]);if(!c(a,s))return!1}return!0}},n.prototype.forEach=function(e){this.params.forEach((t,n)=>e(t,"params["+n+"]",this),this)},n.prototype.map=function(e){return new n(this.conditionals.slice(),this.params.map((t,n)=>this._ifNode(e(t,"params["+n+"]",this)),this))},n.prototype.clone=function(){return new n(this.conditionals,this.params)},n.prototype._toString=function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=Aa(this,t),r=this.params.map((function(r,o){var i=Aa(r,t);return"all"===t||null!==i&&i<=n?"("+r.toString(e)+")":r.toString(e)})),o={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="},i=r[0],a=0;a<this.conditionals.length;a++)i+=" "+o[this.conditionals[a]]+" "+r[a+1];return i},n.prototype.toJSON=function(){return{mathjs:"RelationalNode",conditionals:this.conditionals,params:this.params}},n.fromJSON=function(e){return new n(e.conditionals,e.params)},n.prototype.toHTML=function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=Aa(this,t),r=this.params.map((function(r,o){var i=Aa(r,t);return"all"===t||null!==i&&i<=n?'<span class="math-parenthesis math-round-parenthesis">(</span>'+r.toHTML(e)+'<span class="math-parenthesis math-round-parenthesis">)</span>':r.toHTML(e)})),o={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="},i=r[0],a=0;a<this.conditionals.length;a++)i+='<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Jr(o[this.conditionals[a]])+"</span>"+r[a+1];return i},n.prototype._toTex=function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=Aa(this,t),r=this.params.map((function(r,o){var i=Aa(r,t);return"all"===t||null!==i&&i<=n?"\\left("+r.toTex(e)+"\right)":r.toTex(e)})),o=r[0],i=0;i<this.conditionals.length;i++)o+=Za[this.conditionals[i]]+r[i+1];return o},n},{isClass:!0,isNode:!0}),rl={NodeDependencies:Mo,createRelationalNode:nl};function ol(e,t,n){return e&&"function"===typeof e.map?e.map((function(e){return ol(e,t,n)})):t(e)}var il="number",al=["typed"];function sl(e){var t=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(t){var n={"0b":2,"0o":8,"0x":16}[t[1]],r=t[2],o=t[3];return{input:e,radix:n,integerPart:r,fractionalPart:o}}return null}function ll(e){for(var t=parseInt(e.integerPart,e.radix),n=0,r=0;r<e.fractionalPart.length;r++){var o=parseInt(e.fractionalPart[r],e.radix);n+=o/Math.pow(e.radix,r+1)}var i=t+n;if(isNaN(i))throw new SyntaxError('String "'+e.input+'" is no valid number');return i}var cl=Qr(il,al,e=>{var{typed:t}=e,n=t("number",{"":function(){return 0},number:function(e){return e},string:function(e){if("NaN"===e)return NaN;var t=sl(e);if(t)return ll(t);var n=0,r=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);r&&(n=Number(r[2]),e=r[1]);var o=Number(e);if(isNaN(o))throw new SyntaxError('String "'+e+'" is no valid number');if(r){if(o>2**n-1)throw new SyntaxError('String "'.concat(e,'" is out of range'));o>=2**(n-1)&&(o-=2**n)}return o},BigNumber:function(e){return e.toNumber()},Fraction:function(e){return e.valueOf()},Unit:function(e){throw new Error("Second argument with valueless unit expected")},null:function(e){return 0},"Unit, string | Unit":function(e,t){return e.toNumber(t)},"Array | Matrix":function(e){return ol(e,this)}});return n.fromJSON=function(e){return parseFloat(e.value)},n}),ul={typedDependencies:gs,createNumber:cl},pl="numeric",fl=["number","?bignumber","?fraction"],dl=Qr(pl,fl,e=>{var{number:t,bignumber:n,fraction:r}=e,o={string:!0,number:!0,BigNumber:!0,Fraction:!0},i={number:e=>t(e),BigNumber:n?e=>n(e):la,Fraction:r?e=>r(e):ca};return function(e,t){var n=Zn(e);if(!(n in o))throw new TypeError("Cannot convert "+e+' of type "'+n+'"; valid input types are '+Object.keys(o).join(", "));if(!(t in i))throw new TypeError("Cannot convert "+e+' to type "'+t+'"; valid output types are '+Object.keys(i).join(", "));return t===n?e:i[t](e)}}),ml={numberDependencies:ul,createNumeric:dl},hl="parse",gl=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],bl=Qr(hl,gl,e=>{var{typed:t,numeric:n,config:r,AccessorNode:o,ArrayNode:i,AssignmentNode:a,BlockNode:s,ConditionalNode:l,ConstantNode:c,FunctionAssignmentNode:u,FunctionNode:p,IndexNode:f,ObjectNode:d,OperatorNode:m,ParenthesisNode:h,RangeNode:g,RelationalNode:b,SymbolNode:v}=e,y=t(hl,{string:function(e){return F(e,{})},"Array | Matrix":function(e){return O(e,{})},"string, Object":function(e,t){var n=void 0!==t.nodes?t.nodes:{};return F(e,n)},"Array | Matrix, Object":O});function O(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=void 0!==t.nodes?t.nodes:{};return ol(e,(function(e){if("string"!==typeof e)throw new TypeError("String expected");return F(e,n)}))}var w={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},j={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},N={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},x={true:!0,false:!1,null:null,undefined:void 0},k=["NaN","Infinity"];function E(){return{extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:w.NULL,nestingLevel:0,conditionalLevel:null}}function C(e,t){return e.expression.substr(e.index,t)}function S(e){return C(e,1)}function A(e){e.index++}function V(e){return e.expression.charAt(e.index-1)}function T(e){return e.expression.charAt(e.index+1)}function M(e){e.tokenType=w.NULL,e.token="",e.comment="";while(1){if("#"===S(e))while("\n"!==S(e)&&""!==S(e))e.comment+=S(e),A(e);if(!y.isWhitespace(S(e),e.nestingLevel))break;A(e)}if(""!==S(e)){if("\n"===S(e)&&!e.nestingLevel)return e.tokenType=w.DELIMITER,e.token=S(e),void A(e);var t=S(e),n=C(e,2),r=C(e,3);if(3===r.length&&j[r])return e.tokenType=w.DELIMITER,e.token=r,A(e),A(e),void A(e);if(2===n.length&&j[n])return e.tokenType=w.DELIMITER,e.token=n,A(e),void A(e);if(j[t])return e.tokenType=w.DELIMITER,e.token=t,void A(e);if(y.isDigitDot(t)){e.tokenType=w.NUMBER;var o=C(e,2);if("0b"===o||"0o"===o||"0x"===o){e.token+=S(e),A(e),e.token+=S(e),A(e);while(y.isHexDigit(S(e)))e.token+=S(e),A(e);if("."===S(e)){e.token+=".",A(e);while(y.isHexDigit(S(e)))e.token+=S(e),A(e)}else if("i"===S(e)){e.token+="i",A(e);while(y.isDigit(S(e)))e.token+=S(e),A(e)}return}if("."===S(e)){if(e.token+=S(e),A(e),!y.isDigit(S(e)))return void(e.tokenType=w.DELIMITER)}else{while(y.isDigit(S(e)))e.token+=S(e),A(e);y.isDecimalMark(S(e),T(e))&&(e.token+=S(e),A(e))}while(y.isDigit(S(e)))e.token+=S(e),A(e);if("E"===S(e)||"e"===S(e))if(y.isDigit(T(e))||"-"===T(e)||"+"===T(e)){if(e.token+=S(e),A(e),"+"!==S(e)&&"-"!==S(e)||(e.token+=S(e),A(e)),!y.isDigit(S(e)))throw ve(e,'Digit expected, got "'+S(e)+'"');while(y.isDigit(S(e)))e.token+=S(e),A(e);if(y.isDecimalMark(S(e),T(e)))throw ve(e,'Digit expected, got "'+S(e)+'"')}else if("."===T(e))throw A(e),ve(e,'Digit expected, got "'+S(e)+'"')}else{if(!y.isAlpha(S(e),V(e),T(e))){e.tokenType=w.UNKNOWN;while(""!==S(e))e.token+=S(e),A(e);throw ve(e,'Syntax error in part "'+e.token+'"')}while(y.isAlpha(S(e),V(e),T(e))||y.isDigit(S(e)))e.token+=S(e),A(e);ir(N,e.token)?e.tokenType=w.DELIMITER:e.tokenType=w.SYMBOL}}else e.tokenType=w.DELIMITER}function P(e){do{M(e)}while("\n"===e.token)}function B(e){e.nestingLevel++}function D(e){e.nestingLevel--}function F(e,t){var n=E();fn()(n,{expression:e,extraNodes:t}),M(n);var r=$(n);if(""!==n.token)throw n.tokenType===w.DELIMITER?ye(n,"Unexpected operator "+n.token):ve(n,'Unexpected part "'+n.token+'"');return r}function $(e){var t,n,r=[];""!==e.token&&"\n"!==e.token&&";"!==e.token&&(t=_(e),t.comment=e.comment);while("\n"===e.token||";"===e.token)0===r.length&&t&&(n=";"!==e.token,r.push({node:t,visible:n})),M(e),"\n"!==e.token&&";"!==e.token&&""!==e.token&&(t=_(e),t.comment=e.comment,n=";"!==e.token,r.push({node:t,visible:n}));return r.length>0?new s(r):(t||(t=new c(void 0),t.comment=e.comment),t)}function _(e){var t,n,r,o,i=L(e);if("="===e.token){if(Kn(i))return t=i.name,P(e),r=_(e),new a(new v(t),r);if(Dn(i))return P(e),r=_(e),new a(i.object,i.index,r);if(Hn(i)&&Kn(i.fn)&&(o=!0,n=[],t=i.name,i.args.forEach((function(e,t){Kn(e)?n[t]=e.name:o=!1})),o))return P(e),r=_(e),new u(t,n,r);throw ve(e,"Invalid left hand side of assignment operator =")}return i}function L(e){var t=I(e);while("?"===e.token){var n=e.conditionalLevel;e.conditionalLevel=e.nestingLevel,P(e);var r=t,o=_(e);if(":"!==e.token)throw ve(e,"False part of conditional expression expected");e.conditionalLevel=null,P(e);var i=_(e);t=new l(r,o,i),e.conditionalLevel=n}return t}function I(e){var t=U(e);while("or"===e.token)P(e),t=new m("or","or",[t,U(e)]);return t}function U(e){var t=H(e);while("xor"===e.token)P(e),t=new m("xor","xor",[t,H(e)]);return t}function H(e){var t=J(e);while("and"===e.token)P(e),t=new m("and","and",[t,J(e)]);return t}function J(e){var t=R(e);while("|"===e.token)P(e),t=new m("|","bitOr",[t,R(e)]);return t}function R(e){var t=q(e);while("^|"===e.token)P(e),t=new m("^|","bitXor",[t,q(e)]);return t}function q(e){var t=z(e);while("&"===e.token)P(e),t=new m("&","bitAnd",[t,z(e)]);return t}function z(e){var t=[W(e)],n=[],r={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};while(ir(r,e.token)){var o={name:e.token,fn:r[e.token]};n.push(o),P(e),t.push(W(e))}return 1===t.length?t[0]:2===t.length?new m(n[0].name,n[0].fn,t):new b(n.map(e=>e.fn),t)}function W(e){var t,n,r,o;t=G(e);var i={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};while(ir(i,e.token))n=e.token,r=i[n],P(e),o=[t,G(e)],t=new m(n,r,o);return t}function G(e){var t,n,r,o;t=K(e);var i={to:"to",in:"to"};while(ir(i,e.token))n=e.token,r=i[n],P(e),"in"===n&&""===e.token?t=new m("*","multiply",[t,new v("in")],!0):(o=[t,K(e)],t=new m(n,r,o));return t}function K(e){var t,n=[];if(t=":"===e.token?new c(1):Y(e),":"===e.token&&e.conditionalLevel!==e.nestingLevel){n.push(t);while(":"===e.token&&n.length<3)P(e),")"===e.token||"]"===e.token||","===e.token||""===e.token?n.push(new v("end")):n.push(Y(e));t=3===n.length?new g(n[0],n[2],n[1]):new g(n[0],n[1])}return t}function Y(e){var t,n,r,o;t=Z(e);var i={"+":"add","-":"subtract"};while(ir(i,e.token)){n=e.token,r=i[n],P(e);var a=Z(e);o=a.isPercentage?[t,new m("*","multiply",[t,a])]:[t,a],t=new m(n,r,o)}return t}function Z(e){var t,n,r,o;t=X(e),n=t;var i={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};while(1){if(!ir(i,e.token))break;r=e.token,o=i[r],P(e),n=X(e),t=new m(r,o,[t,n])}return t}function X(e){var t,n;t=Q(e),n=t;while(1){if(!(e.tokenType===w.SYMBOL||"in"===e.token&&In(t))&&(e.tokenType!==w.NUMBER||In(n)||zn(n)&&"!"!==n.op)&&"("!==e.token)break;n=Q(e),t=new m("*","multiply",[t,n],!0)}return t}function Q(e){var t=ee(e),n=t,r=[];while(1){if("/"!==e.token||!In(n))break;if(r.push(fn()({},e)),P(e),e.tokenType!==w.NUMBER){fn()(e,r.pop());break}if(r.push(fn()({},e)),P(e),e.tokenType!==w.SYMBOL&&"("!==e.token){r.pop(),fn()(e,r.pop());break}fn()(e,r.pop()),r.pop(),n=ee(e),t=new m("/","divide",[t,n])}return t}function ee(e){var t,n,r,o;t=te(e);var i={"%":"mod",mod:"mod"};while(ir(i,e.token))n=e.token,r=i[n],P(e),"%"===n&&e.tokenType===w.DELIMITER&&"("!==e.token?t=new m("/","divide",[t,new c(100)],!1,!0):(o=[t,te(e)],t=new m(n,r,o));return t}function te(e){var t,n,r,o={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return ir(o,e.token)?(r=o[e.token],t=e.token,P(e),n=[te(e)],new m(t,r,n)):ne(e)}function ne(e){var t,n,r,o;return t=re(e),"^"!==e.token&&".^"!==e.token||(n=e.token,r="^"===n?"pow":"dotPow",P(e),o=[t,te(e)],t=new m(n,r,o)),t}function re(e){var t,n,r,o;t=oe(e);var i={"!":"factorial","'":"ctranspose"};while(ir(i,e.token))n=e.token,r=i[n],M(e),o=[t],t=new m(n,r,o),t=ae(e,t);return t}function oe(e){var t=[];if(e.tokenType===w.SYMBOL&&ir(e.extraNodes,e.token)){var n=e.extraNodes[e.token];if(M(e),"("===e.token){if(t=[],B(e),M(e),")"!==e.token){t.push(_(e));while(","===e.token)M(e),t.push(_(e))}if(")"!==e.token)throw ve(e,"Parenthesis ) expected");D(e),M(e)}return new n(t)}return ie(e)}function ie(e){var t,r;return e.tokenType===w.SYMBOL||e.tokenType===w.DELIMITER&&e.token in N?(r=e.token,M(e),t=ir(x,r)?new c(x[r]):-1!==k.indexOf(r)?new c(n(r,"number")):new v(r),t=ae(e,t),t):se(e)}function ae(e,t,n){var r;while(("("===e.token||"["===e.token||"."===e.token)&&(!n||-1!==n.indexOf(e.token)))if(r=[],"("===e.token){if(!Kn(t)&&!Dn(t))return t;if(B(e),M(e),")"!==e.token){r.push(_(e));while(","===e.token)M(e),r.push(_(e))}if(")"!==e.token)throw ve(e,"Parenthesis ) expected");D(e),M(e),t=new p(t,r)}else if("["===e.token){if(B(e),M(e),"]"!==e.token){r.push(_(e));while(","===e.token)M(e),r.push(_(e))}if("]"!==e.token)throw ve(e,"Parenthesis ] expected");D(e),M(e),t=new o(t,new f(r))}else{if(M(e),e.tokenType!==w.SYMBOL)throw ve(e,"Property name expected after dot");r.push(new c(e.token)),M(e);var i=!0;t=new o(t,new f(r,i))}return t}function se(e){var t,n;return'"'===e.token?(n=le(e),t=new c(n),t=ae(e,t),t):ce(e)}function le(e){var t="";while(""!==S(e)&&'"'!==S(e))"\\"===S(e)&&(t+=S(e),A(e)),t+=S(e),A(e);if(M(e),'"'!==e.token)throw ve(e,'End of string " expected');return M(e),JSON.parse('"'+t+'"')}function ce(e){var t,n;return"'"===e.token?(n=ue(e),t=new c(n),t=ae(e,t),t):pe(e)}function ue(e){var t="";while(""!==S(e)&&"'"!==S(e))"\\"===S(e)&&(t+=S(e),A(e)),t+=S(e),A(e);if(M(e),"'"!==e.token)throw ve(e,"End of string ' expected");return M(e),JSON.parse('"'+t+'"')}function pe(e){var t,n,r,o;if("["===e.token){if(B(e),M(e),"]"!==e.token){var a=fe(e);if(";"===e.token){r=1,n=[a];while(";"===e.token)M(e),n[r]=fe(e),r++;if("]"!==e.token)throw ve(e,"End of matrix ] expected");D(e),M(e),o=n[0].items.length;for(var s=1;s<r;s++)if(n[s].items.length!==o)throw ye(e,"Column dimensions mismatch ("+n[s].items.length+" !== "+o+")");t=new i(n)}else{if("]"!==e.token)throw ve(e,"End of matrix ] expected");D(e),M(e),t=a}}else D(e),M(e),t=new i([]);return ae(e,t)}return de(e)}function fe(e){var t=[_(e)],n=1;while(","===e.token)M(e),t[n]=_(e),n++;return new i(t)}function de(e){if("{"===e.token){var t;B(e);var n={};do{if(M(e),"}"!==e.token){if('"'===e.token)t=le(e);else if("'"===e.token)t=ue(e);else{if(!(e.tokenType===w.SYMBOL||e.tokenType===w.DELIMITER&&e.token in N))throw ve(e,"Symbol or string expected as object key");t=e.token,M(e)}if(":"!==e.token)throw ve(e,"Colon : expected after object key");M(e),n[t]=_(e)}}while(","===e.token);if("}"!==e.token)throw ve(e,"Comma , or bracket } expected after object value");D(e),M(e);var r=new d(n);return r=ae(e,r),r}return me(e)}function me(e){var t;return e.tokenType===w.NUMBER?(t=e.token,M(e),new c(n(t,r.number))):he(e)}function he(e){var t;if("("===e.token){if(B(e),M(e),t=_(e),")"!==e.token)throw ve(e,"Parenthesis ) expected");return D(e),M(e),t=new h(t),t=ae(e,t),t}return ge(e)}function ge(e){throw""===e.token?ve(e,"Unexpected end of expression"):ve(e,"Value expected")}function be(e){return e.index-e.token.length+1}function ve(e,t){var n=be(e),r=new SyntaxError(t+" (char "+n+")");return r.char=n,r}function ye(e,t){var n=be(e),r=new SyntaxError(t+" (char "+n+")");return r.char=n,r}return y.isAlpha=function(e,t,n){return y.isValidLatinOrGreek(e)||y.isValidMathSymbol(e,n)||y.isValidMathSymbol(t,e)},y.isValidLatinOrGreek=function(e){return/^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(e)},y.isValidMathSymbol=function(e,t){return/^[\uD835]$/.test(e)&&/^[\uDC00-\uDFFF]$/.test(t)&&/^[^\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]$/.test(t)},y.isWhitespace=function(e,t){return" "===e||"\t"===e||"\n"===e&&t>0},y.isDecimalMark=function(e,t){return"."===e&&"/"!==t&&"*"!==t&&"^"!==t},y.isDigitDot=function(e){return e>="0"&&e<="9"||"."===e},y.isDigit=function(e){return e>="0"&&e<="9"},y.isHexDigit=function(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"},y}),vl={AccessorNodeDependencies:wa,ArrayNodeDependencies:ka,AssignmentNodeDependencies:Da,BlockNodeDependencies:Ja,ConditionalNodeDependencies:Wa,ConstantNodeDependencies:as,FunctionAssignmentNodeDependencies:Os,FunctionNodeDependencies:As,IndexNodeDependencies:$s,ObjectNodeDependencies:Us,OperatorNodeDependencies:qs,ParenthesisNodeDependencies:Ks,RangeNodeDependencies:Qs,RelationalNodeDependencies:rl,SymbolNodeDependencies:xs,numericDependencies:ml,typedDependencies:gs,createParse:bl},yl="evaluate",Ol=["typed","parse"],wl=Qr(yl,Ol,e=>{var{typed:t,parse:n}=e;return t(yl,{string:function(e){var t=ko();return n(e).compile().evaluate(t)},"string, Map | Object":function(e,t){return n(e).compile().evaluate(t)},"Array | Matrix":function(e){var t=ko();return ol(e,(function(e){return n(e).compile().evaluate(t)}))},"Array | Matrix, Map | Object":function(e,t){return ol(e,(function(e){return n(e).compile().evaluate(t)}))}})}),jl={parseDependencies:vl,typedDependencies:gs,createEvaluate:wl},Nl=fo({evaluateDependencies:jl});Nl.import({add:function(e,t){return e+t},subtract:function(e,t){return e-t},multiply:function(e,t){return e*t},divide:function(e,t){return e/t},equal:function(e,t){return e==t},unequal:function(e,t){return e!=t},not:function(e){return!e},and:function(e,t){return e&&t},or:function(e,t){return e||t},largerEq:function(e,t){return e>=t},larger:function(e,t){return e>t},smallerEq:function(e,t){return e<=t},smaller:function(e,t){return e<t}},{override:!0});var xl=Nl,kl=Object(a["defineComponent"])({props:{setting:{type:Object,required:!0},modelValue:null,conditionValues:{type:Object,required:!0}},components:{FormField:Gt},emits:["update:modelValue"],computed:{settingWithComponent:function(){return this.setting.templateFile?Object.assign(Object.assign({},this.setting),{},{component:Ut}):this.setting},showField:function(){var e=this.setting.condition;if(!e)return!0;e=e.replace(/&&/g," and "),e=e.replace(/\|\|/g," or "),e=e.replace(/!/g," not ");try{return xl.evaluate(e,this.conditionValues)}catch(t){return console.log("failed to parse setting condition '".concat(e,"': ").concat(t.message)),console.log(this.conditionValues),!1}}},methods:{changeValue:function(e){this.$emit("update:modelValue",e)}}});kl.render=un;var El=kl;function Cl(e,t){return Ml(e)||Tl(e,t)||Al(e,t)||Sl()}function Sl(){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 Al(e,t){if(e){if("string"===typeof e)return Vl(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)?Vl(e,t):void 0}}function Vl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Tl(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0)if(i.push(r.value),t&&i.length===t)break}catch(l){s=!0,o=l}finally{try{a||null==n["return"]||n["return"]()}finally{if(s)throw o}}return i}}function Ml(e){if(Array.isArray(e))return e}var Pl=Object(a["defineComponent"])({props:{groupName:String,settings:{type:Array,required:!0},allSettingValues:{type:Object,required:!0}},emits:["change"],components:{GroupedSetting:El},computed:{settingValues:function(){var e=this,t=Object.entries(this.allSettingValues).filter((function(t){var n=Cl(t,1),r=n[0];if(e.groupName){var o=r.split("."),i=Cl(o,1),a=i[0];if(a!==e.groupName)return!1}return!0})).map((function(t){var n=Cl(t,2),r=n[0],o=n[1];return e.groupName?[r.split(".")[1],o]:[r,o]}));return Object.fromEntries(t)},groupPrefix:function(){return this.groupName?"".concat(this.groupName,"."):""}}});Pl.render=cn;var Bl=Pl,Dl={class:"confirm-password-modal modal",ref:"root"},Fl={class:"modal-content"},$l={class:"modal-text"},_l={class:"modal-footer"},Ll=["disabled"];function Il(e,t,n,r,o,i){var s=Object(a["resolveComponent"])("Field");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Dl,[Object(a["createElementVNode"])("div",Fl,[Object(a["createElementVNode"])("div",$l,[Object(a["renderSlot"])(e.$slots,"default")]),Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(s,{modelValue:e.passwordConfirmation,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.passwordConfirmation=t}),uicontrol:"password",disabled:e.requiresPasswordConfirmation?void 0:"disabled",name:"currentUserPassword",autocomplete:!1,"full-width":!0,title:e.translate("UsersManager_YourCurrentPassword")},null,8,["modelValue","disabled","title"])])]),Object(a["createElementVNode"])("div",_l,[Object(a["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",disabled:e.requiresPasswordConfirmation&&!e.passwordConfirmation?"disabled":void 0,onClick:t[1]||(t[1]=function(t){t.preventDefault(),e.$emit("confirmed",e.passwordConfirmation),e.passwordConfirmation=""})},Object(a["toDisplayString"])(e.translate("General_Yes")),9,Ll),Object(a["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no btn-flat",onClick:t[2]||(t[2]=function(t){t.preventDefault(),e.$emit("aborted")})},Object(a["toDisplayString"])(e.translate("General_No")),1)])],512)}var Ul=window,Hl=Ul.$,Jl=Object(a["defineComponent"])({props:{modelValue:{type:Boolean,required:!0}},data:function(){return{passwordConfirmation:""}},emits:["confirmed","aborted","update:modelValue"],components:{Field:en},activated:function(){this.$emit("update:modelValue",!1)},methods:{showPasswordConfirmModal:function(){var e=this,t=this.$refs.root,n=Hl(t),r=function(t){var r=t.keyCode?t.keyCode:t.which;13===r&&(n.modal("close"),e.$emit("confirmed",e.passwordConfirmation),e.passwordConfirmation="")};n.modal({dismissible:!1,onOpenEnd:function(){var e=".modal.open #currentUserPassword";Hl(e).focus(),Hl(e).off("keypress").keypress(r)},onCloseEnd:function(){e.$emit("update:modelValue",!1)}}).modal("open")}},computed:{requiresPasswordConfirmation:function(){return!!i["Matomo"].requiresPasswordConfirmation}},watch:{modelValue:function(e){e&&this.showPasswordConfirmModal()}}});Jl.render=Il;var Rl=Jl;function ql(e,t){return Yl(e)||Kl(e,t)||Wl(e,t)||zl()}function zl(){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 Wl(e,t){if(e){if("string"===typeof e)return Gl(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)?Gl(e,t):void 0}}function Gl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Kl(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0)if(i.push(r.value),t&&i.length===t)break}catch(l){s=!0,o=l}finally{try{a||null==n["return"]||n["return"]()}finally{if(s)throw o}}return i}}function Yl(e){if(Array.isArray(e))return e}var Zl=window,Xl=Zl.$,Ql=Object(a["defineComponent"])({props:{mode:String},components:{PasswordConfirmation:Rl,ActivityIndicator:i["ActivityIndicator"],GroupedSettings:Bl},data:function(){return{isLoading:!0,isSaving:{},showPasswordConfirmModal:!1,settingsToSave:null,settingsPerPlugin:[],settingValues:{}}},created:function(){var e=this;i["AjaxHelper"].fetch({method:this.apiMethod}).then((function(t){e.isLoading=!1,e.settingsPerPlugin=t,t.forEach((function(t){t.settings.forEach((function(n){e.settingValues["".concat(t.pluginName,".").concat(n.name)]=n.value}))})),window.anchorLinkFix.scrollToAnchorInUrl(),e.addSectionsToTableOfContents()})).catch((function(){e.isLoading=!1}))},computed:{apiMethod:function(){return"admin"===this.mode?"CorePluginsAdmin.getSystemSettings":"CorePluginsAdmin.getUserSettings"},saveApiMethod:function(){return"admin"===this.mode?"CorePluginsAdmin.setSystemSettings":"CorePluginsAdmin.setUserSettings"}},methods:{addSectionsToTableOfContents:function(){var e=Xl("#generalSettingsTOC");if(e.length){var t=this.settingsPerPlugin;t.forEach((function(t){var n=t.pluginName,r=t.settings;n&&("CoreAdminHome"===n&&r?r.filter((function(e){return e.introduction})).forEach((function(t){e.append('<a href="#/'.concat(n,'PluginSettings">').concat(t.introduction,"</a> "))})):e.append('<a href="#/'.concat(n,'">').concat(n.replace(/([A-Z])/g," $1").trim(),"</a> ")))}))}},confirmPassword:function(e){this.showPasswordConfirmModal=!1,this.save(this.settingsToSave,e)},saveSetting:function(e){"admin"===this.mode?(this.settingsToSave=e,this.showPasswordConfirmModal=!0):this.save(e)},save:function(e,t){var n=this,r=this.saveApiMethod;this.isSaving[e]=!0;var o=this.getValuesForPlugin(e);i["AjaxHelper"].post({method:r},{settingValues:o,passwordConfirmation:t}).then((function(){n.isSaving[e]=!1;var t=i["NotificationsStore"].show({message:Object(i["translate"])("CoreAdminHome_PluginSettingsSaveSuccess"),id:"generalSettings",context:"success",type:"transient"});i["NotificationsStore"].scrollToNotification(t)})).catch((function(){n.isSaving[e]=!1})),this.settingsToSave=null},getValuesForPlugin:function(e){var t={};return t[e]||(t[e]=[]),Object.entries(this.settingValues).forEach((function(n){var r=ql(n,2),o=r[0],i=r[1],a=o.split("."),s=ql(a,2),l=s[0],c=s[1];if(l===e){var u=i;!1===u?u="0":!0===u&&(u="1"),t[l].push({name:c,value:u})}})),t}}});Ql.render=ln;var ec=Ql,tc=(Object(i["createAngularJsAdapter"])({component:ec,scope:{mode:{angularJsBind:"@"}},directiveName:"piwikPluginSettings"}),window),nc=tc.$; + */function ac(e,t){t.preventDefault();var n=ic(t.target).attr("href"),r=ic(t.target).attr("data-plugin-name");if(n&&r){e.value.uninstallConfirmMessage||(e.value.uninstallConfirmMessage=ic("#uninstallPluginConfirm").text());var o=(e.value.uninstallConfirmMessage||"").replace("%s",r);ic("#uninstallPluginConfirm").text(o),Ci["Matomo"].helper.modalConfirm("#confirmUninstallPlugin",{yes:function(){window.location.href=n}})}}function sc(e){e.preventDefault();var t=ic(e.target).data("overlay-id");Ci["Matomo"].helper.modalConfirm("#".concat(t),{})}var lc={mounted:function(e,t){setTimeout((function(){t.value.uninstallConfirmMessage="",ic(e).find(".uninstall").click(ac.bind(null,t)),ic(e).find(".plugin-donation-link").click(sc)}))}},cc=window,uc=cc.$; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function rc(e,t){t.preventDefault();var n=nc(t.target).attr("href"),r=nc(t.target).attr("data-plugin-name");if(n&&r){e.value.uninstallConfirmMessage||(e.value.uninstallConfirmMessage=nc("#uninstallPluginConfirm").text());var o=(e.value.uninstallConfirmMessage||"").replace("%s",r);nc("#uninstallPluginConfirm").text(o),i["Matomo"].helper.modalConfirm("#confirmUninstallPlugin",{yes:function(){window.location.href=n}})}}function oc(e){e.preventDefault();var t=nc(e.target).data("overlay-id");i["Matomo"].helper.modalConfirm("#".concat(t),{})}var ic={mounted:function(e,t){setTimeout((function(){t.value.uninstallConfirmMessage="",nc(e).find(".uninstall").click(rc.bind(null,t)),nc(e).find(".plugin-donation-link").click(oc)}))}}; + */function pc(e){e.preventDefault(),Ci["Matomo"].helper.modalConfirm("#installPluginByUpload",{})}function dc(e){var t=uc("[name=pluginZip]"),n=t.val();n&&".zip"===n.slice(-4)?t.data("maxSize")>0&&t[0].files[0].size>1048576*t.data("maxSize")&&(e.preventDefault(),alert(Object(Ci["translate"])("CorePluginsAdmin_FileExceedsUploadLimit"))):(e.preventDefault(),alert(Object(Ci["translate"])("CorePluginsAdmin_NoZipFileSelected")))}var fc={mounted:function(){setTimeout((function(){uc(".uploadPlugin").click(pc),uc("#uploadPluginForm").submit(dc)}))}},mc={class:"matomo-save-button",style:{display:"inline-block"}},hc=["disabled","value"];function gc(e,t,n,r,o,i){var a=Object(Oi["resolveComponent"])("ActivityIndicator");return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",mc,[Object(Oi["createElementVNode"])("input",{type:"button",onClick:t[0]||(t[0]=function(t){return e.onConfirm(t)}),disabled:e.saving||e.disabled,class:"btn",value:e.value?e.value:e.translate("General_Save")},null,8,hc),Object(Oi["createVNode"])(a,{loading:e.saving},null,8,["loading"])])}var bc=Object(Oi["defineComponent"])({props:{saving:Boolean,value:String,disabled:Boolean},components:{ActivityIndicator:Ci["ActivityIndicator"]},emits:["confirm"],methods:{onConfirm:function(e){this.$emit("confirm",e)}}});bc.render=gc;var yc=bc,vc=window,Oc=vc.$,wc={mounted:function(e){setTimeout((function(){Oc(e).find("input[type=text]").keypress((function(t){var n=t.keyCode||t.which;13===n&&Oc(e).find(".matomo-save-button input").triggerHandler("click")}))}))}},jc=["innerHTML"],Nc={key:1,style:{"margin-right":"3.5px"}},xc=Object(Oi["createElementVNode"])("br",null,null,-1),kc=["innerHTML"]; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function ac(){return{restrict:"A",link:function(e,t){var n={instance:null,value:{},oldValue:null,modifiers:{},dir:{}};ic.mounted(t[0],n)}}}window.angular.module("piwikApp").directive("piwikPluginManagement",ac); + */function Ec(e,t,n,r,o,i){var a=Object(Oi["resolveComponent"])("EnrichedHeadline"),s=Object(Oi["resolveDirective"])("content-intro");return Object(Oi["withDirectives"])((Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",null,[Object(Oi["createElementVNode"])("h2",null,[Object(Oi["createVNode"])(a,null,{default:Object(Oi["withCtx"])((function(){return[Object(Oi["createTextVNode"])(Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_PluginsManagement")),1)]})),_:1})]),Object(Oi["createElementVNode"])("p",null,[Object(Oi["createTextVNode"])(Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_PluginsExtendPiwik"))+" "+Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_OncePluginIsInstalledYouMayActivateHere"))+" ",1),e.isMarketplaceEnabled||e.isPluginUploadEnabled?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",{key:0,innerHTML:e.$sanitize(e.teaserExtendMatomoByPluginText),style:{"margin-right":"3.5px"}},null,8,jc)):Object(Oi["createCommentVNode"])("",!0),e.isPluginsAdminEnabled?Object(Oi["createCommentVNode"])("",!0):(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",Nc,[xc,Object(Oi["createTextVNode"])(Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_DoMoreContactPiwikAdmins")),1)])),Object(Oi["createElementVNode"])("span",{innerHTML:e.$sanitize(e.changeLookByManageThemesText)},null,8,kc)])],512)),[[s]])}var Cc=Object(Oi["defineComponent"])({props:{isMarketplaceEnabled:Boolean,isPluginUploadEnabled:Boolean,isPluginsAdminEnabled:Boolean},components:{EnrichedHeadline:Ci["EnrichedHeadline"]},directives:{ContentIntro:Ci["ContentIntro"]},computed:{teaserExtendMatomoByPluginText:function(){var e="?".concat(Ci["MatomoUrl"].stringify(Object.assign(Object.assign({},Ci["MatomoUrl"].urlParsed.value),{},{module:"Marketplace",action:"overview",sort:null,activated:null})));return Object(Ci["translate"])("CorePluginsAdmin_TeaserExtendPiwikByPlugin",'<a href="'.concat(e,'">'),"</a>",'<a href="#" class="uploadPlugin">',"</a>")},changeLookByManageThemesText:function(){var e="?".concat(Ci["MatomoUrl"].stringify(Object.assign(Object.assign({},Ci["MatomoUrl"].urlParsed.value),{},{action:"themes",activated:null})));return Object(Ci["translate"])("CorePluginsAdmin_ChangeLookByManageThemes",'<a href="'.concat(e,'">'),"</a>")}}});Cc.render=Ec;var Sc=Cc,Vc=["innerHTML"],Ac={key:1},Tc=Object(Oi["createElementVNode"])("br",null,null,-1),Mc={key:2},Pc=Object(Oi["createElementVNode"])("br",null,null,-1);function Dc(e,t,n,r,o,i){var a=Object(Oi["resolveComponent"])("EnrichedHeadline"),s=Object(Oi["resolveDirective"])("content-intro");return Object(Oi["withDirectives"])((Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",null,[Object(Oi["createElementVNode"])("h2",null,[Object(Oi["createVNode"])(a,null,{default:Object(Oi["withCtx"])((function(){return[Object(Oi["createTextVNode"])(Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_ThemesManagement")),1)]})),_:1})]),Object(Oi["createElementVNode"])("p",null,[Object(Oi["createTextVNode"])(Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_ThemesDescription"))+" ",1),e.isMarketplaceEnabled?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",{key:0,innerHTML:e.$sanitize(e.teaserExtendByThemeText)},null,8,Vc)):Object(Oi["createCommentVNode"])("",!0),e.otherUsersCount>0?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",Ac,[Tc,Object(Oi["createTextVNode"])(" "+Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_InfoThemeIsUsedByOtherUsersAsWell",e.otherUsersCount,e.themeEnabled)),1)])):Object(Oi["createCommentVNode"])("",!0),e.isPluginsAdminEnabled?Object(Oi["createCommentVNode"])("",!0):(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",Mc,[Pc,Object(Oi["createTextVNode"])(Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_DoMoreContactPiwikAdmins")),1)]))])],512)),[[s]])}var Bc=Object(Oi["defineComponent"])({props:{isMarketplaceEnabled:Boolean,otherUsersCount:Number,themeEnabled:Boolean,isPluginsAdminEnabled:Boolean},components:{EnrichedHeadline:Ci["EnrichedHeadline"]},directives:{ContentIntro:Ci["ContentIntro"]},computed:{teaserExtendByThemeText:function(){var e="?".concat(Ci["MatomoUrl"].stringify(Object.assign(Object.assign({},Ci["MatomoUrl"].urlParsed.value),{},{module:"Marketplace",action:"overview",sort:"",show:"themes"})));return Object(Ci["translate"])("CorePluginsAdmin_TeaserExtendPiwikByTheme",'<a href="'.concat(e,'">'),"</a>")}}});Bc.render=Dc;var $c=Bc; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -var sc=window,lc=sc.$;function cc(e){e.preventDefault(),i["Matomo"].helper.modalConfirm("#installPluginByUpload",{})}function uc(e){var t=lc("[name=pluginZip]"),n=t.val();n&&".zip"===n.slice(-4)?t.data("maxSize")>0&&t[0].files[0].size>1048576*t.data("maxSize")&&(e.preventDefault(),alert(Object(i["translate"])("CorePluginsAdmin_FileExceedsUploadLimit"))):(e.preventDefault(),alert(Object(i["translate"])("CorePluginsAdmin_NoZipFileSelected")))}var pc={mounted:function(){setTimeout((function(){lc(".uploadPlugin").click(cc),lc("#uploadPluginForm").submit(uc)}))}}; -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function fc(){return{restrict:"A",link:function(){pc.mounted()}}}window.angular.module("piwikApp").directive("piwikPluginUpload",fc); -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -var dc=window,mc=dc.$;function hc(e){return e.find(".origin a.active").data("filter-origin")}function gc(e){return e.find(".status a.active").data("filter-status")}function bc(e,t){var n="#plugins tr";return n+="all"===e?"[data-filter-origin]":"[data-filter-origin=".concat(e,"]"),n+="all"===t?"[data-filter-status]":"[data-filter-status=".concat(t,"]"),mc(n)}function vc(e,t,n,r){var o=bc(n,r).length,i=" (".concat(o,")");e.find("".concat(t," .counter")).text(i)}function yc(e){var t=hc(e),n=gc(e);vc(e,'[data-filter-status="all"]',t,"all"),vc(e,'[data-filter-status="active"]',t,"active"),vc(e,'[data-filter-status="inactive"]',t,"inactive"),vc(e,'[data-filter-origin="all"]',"all",n),vc(e,'[data-filter-origin="core"]',"core",n),vc(e,'[data-filter-origin="official"]',"official",n),vc(e,'[data-filter-origin="thirdparty"]',"thirdparty",n)}function Oc(e){var t=hc(e),n=gc(e),r=bc(t,n);mc("#plugins tr[data-filter-origin][data-filter-status]").css("display","none"),r.css("display","table-row"),yc(e)}function wc(e,t){t.preventDefault(),mc(t.target).siblings().removeClass("active"),mc(t.target).addClass("active"),Oc(e)}function jc(e,t){t.preventDefault(),mc(t.target).siblings().removeClass("active"),mc(t.target).addClass("active"),Oc(e)}var Nc={mounted:function(e){setTimeout((function(){yc(mc(e)),mc(e).find(".status").on("click","a",wc.bind(null,mc(e))),mc(e).find(".origin").on("click","a",jc.bind(null,mc(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 xc(){return{restrict:"A",link:function(e,t){Nc.mounted(t[0])}}}window.angular.module("piwikApp").directive("piwikPluginFilter",xc);var kc={class:"matomo-save-button",style:{display:"inline-block"}},Ec=["disabled","value"];function Cc(e,t,n,r,o,i){var s=Object(a["resolveComponent"])("ActivityIndicator");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",kc,[Object(a["createElementVNode"])("input",{type:"button",onClick:t[0]||(t[0]=function(t){return e.onConfirm(t)}),disabled:e.saving||e.disabled,class:"btn",value:e.value?e.value:e.translate("General_Save")},null,8,Ec),Object(a["createVNode"])(s,{loading:e.saving},null,8,["loading"])])}var Sc=Object(a["defineComponent"])({props:{saving:Boolean,value:String,disabled:Boolean},components:{ActivityIndicator:i["ActivityIndicator"]},emits:["confirm"],methods:{onConfirm:function(e){this.$emit("confirm",e)}}});Sc.render=Cc;var Ac=Sc,Vc=(Object(i["createAngularJsAdapter"])({component:Ac,scope:{saving:{angularJsBind:"=?"},value:{angularJsBind:"@?"},disabled:{angularJsBind:"=?"},onconfirm:{angularJsBind:"&?",vue:"confirm"}},events:{confirm:function(e,t,n,r,o,i,a){r[0].click(),a()}},replace:!0,directiveName:"piwikSaveButton",$inject:["$timeout"]}),window),Tc=Vc.$,Mc={mounted:function(e){setTimeout((function(){Tc(e).find("input[type=text]").keypress((function(t){var n=t.keyCode||t.which;13===n&&Tc(e).find(".matomo-save-button input").triggerHandler("click")}))}))}}; -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -function Pc(){return{restrict:"A",link:function(e,t){Mc.mounted(t[0])}}}window.angular.module("piwikApp").directive("piwikForm",Pc);var Bc=["innerHTML"],Dc={key:1,style:{"margin-right":"3.5px"}},Fc=Object(a["createElementVNode"])("br",null,null,-1),$c=["innerHTML"];function _c(e,t,n,r,o,i){var s=Object(a["resolveComponent"])("EnrichedHeadline"),l=Object(a["resolveDirective"])("content-intro");return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("div",null,[Object(a["createElementVNode"])("h2",null,[Object(a["createVNode"])(s,null,{default:Object(a["withCtx"])((function(){return[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_PluginsManagement")),1)]})),_:1})]),Object(a["createElementVNode"])("p",null,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_PluginsExtendPiwik"))+" "+Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_OncePluginIsInstalledYouMayActivateHere"))+" ",1),e.isMarketplaceEnabled||e.isPluginUploadEnabled?(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",{key:0,innerHTML:e.$sanitize(e.teaserExtendMatomoByPluginText),style:{"margin-right":"3.5px"}},null,8,Bc)):Object(a["createCommentVNode"])("",!0),e.isPluginsAdminEnabled?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",Dc,[Fc,Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_DoMoreContactPiwikAdmins")),1)])),Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.changeLookByManageThemesText)},null,8,$c)])],512)),[[l]])}var Lc=Object(a["defineComponent"])({props:{isMarketplaceEnabled:Boolean,isPluginUploadEnabled:Boolean,isPluginsAdminEnabled:Boolean},components:{EnrichedHeadline:i["EnrichedHeadline"]},directives:{ContentIntro:i["ContentIntro"]},computed:{teaserExtendMatomoByPluginText:function(){var e="?".concat(i["MatomoUrl"].stringify(Object.assign(Object.assign({},i["MatomoUrl"].urlParsed.value),{},{module:"Marketplace",action:"overview",sort:null,activated:null})));return Object(i["translate"])("CorePluginsAdmin_TeaserExtendPiwikByPlugin",'<a href="'.concat(e,'">'),"</a>",'<a href="#" class="uploadPlugin">',"</a>")},changeLookByManageThemesText:function(){var e="?".concat(i["MatomoUrl"].stringify(Object.assign(Object.assign({},i["MatomoUrl"].urlParsed.value),{},{action:"themes",activated:null})));return Object(i["translate"])("CorePluginsAdmin_ChangeLookByManageThemes",'<a href="'.concat(e,'">'),"</a>")}}});Lc.render=_c;var Ic=Lc; -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Uc(e,t){var n=e.value.pluginName,r=e.value.activePluginTab;t.preventDefault(),r&&(n+="!".concat(r)),window.broadcast.propagateNewPopoverParameter("browsePluginDetail",n)}window.broadcast.addPopoverHandler("browsePluginDetail",(function(e){var t=e,n=null;-1!==e.indexOf("!")&&(n=e.slice(e.indexOf("!")+1),t=e.slice(0,e.indexOf("!")));var r="module=Marketplace&action=pluginDetails&pluginName=".concat(encodeURIComponent(t));n&&(r+="&activeTab=".concat(encodeURIComponent(n))),window.Piwik_Popover.createPopupAndLoadUrl(r,"details")}));var Hc=window,Jc=Hc.$,Rc={mounted:function(e,t){var n=t.value.pluginName;n&&(t.value.onClickHandler=Uc.bind(null,t),Jc(e).on("click",t.value.onClickHandler).attr("matomo-plugin-name",n))},unmounted:function(e,t){Jc(e).off("click",t.value.onClickHandler)}},qc={class:"row pluginsFilter"},zc={class:"origin"},Wc={style:{"margin-right":"3.5px"}},Gc={"data-filter-origin":"all",href:"#",class:"active"},Kc=Object(a["createElementVNode"])("span",{class:"counter"},null,-1),Yc=Object(a["createTextVNode"])(" | "),Zc={"data-filter-origin":"core",href:"#"},Xc=Object(a["createElementVNode"])("span",{class:"counter"},null,-1),Qc=Object(a["createTextVNode"])(" | "),eu={"data-filter-origin":"official",href:"#"},tu=Object(a["createElementVNode"])("span",{class:"counter"},null,-1),nu=Object(a["createTextVNode"])(" | "),ru={"data-filter-origin":"thirdparty",href:"#"},ou=Object(a["createElementVNode"])("span",{class:"counter"},null,-1),iu={class:"status"},au={style:{"margin-right":"3.5px"}},su={"data-filter-status":"all",href:"#",class:"active"},lu=Object(a["createElementVNode"])("span",{class:"counter"},null,-1),cu=Object(a["createTextVNode"])(" | "),uu={"data-filter-status":"active",href:"#"},pu=Object(a["createElementVNode"])("span",{class:"counter"},null,-1),fu=Object(a["createTextVNode"])(" | "),du={"data-filter-status":"inactive",href:"#"},mu=Object(a["createElementVNode"])("span",{class:"counter"},null,-1),hu={id:"confirmUninstallPlugin",class:"ui-confirm"},gu={id:"uninstallPluginConfirm"},bu=["value"],vu=["value"],yu={class:"status"},Ou={key:0,class:"action-links"},wu={id:"plugins"},ju=["data-filter-status","data-filter-origin"],Nu={class:"name"},xu=["name"],ku={key:0},Eu={key:1},Cu=["title"],Su={key:2},Au=Object(a["createElementVNode"])("br",null,null,-1),Vu=Object(a["createElementVNode"])("br",null,null,-1),Tu=["href"],Mu={class:"desc"},Pu={class:"plugin-desc-missingrequirements"},Bu={key:0},Du=Object(a["createElementVNode"])("br",null,null,-1),Fu={class:"plugin-desc-text"},$u={key:0,class:"plugin-homepage"},_u=["href"],Lu={key:1,class:"plugin-donation"},Iu=["data-overlay-id"],Uu=["id","title"],Hu=["innerHTML"],Ju={class:"donation-links"},Ru=["href"],qu=Object(a["createElementVNode"])("img",{src:"plugins/CorePluginsAdmin/images/paypal_donate.png",height:"30"},null,-1),zu=[qu],Wu=["href"],Gu=Object(a["createElementVNode"])("img",{class:"alignnone",title:"Flattr",alt:"",src:"plugins/CorePluginsAdmin/images/flattr.png",height:"29"},null,-1),Ku=[Gu],Yu={key:2,class:"donation-link bitcoin"},Zu=Object(a["createElementVNode"])("span",null,"Donate Bitcoins to:",-1),Xu=["href"],Qu=["value"],ep={key:0,class:"plugin-license"},tp=["title","href"],np={key:1},rp={key:1,class:"plugin-author"},op=Object(a["createTextVNode"])(" By "),ip=["title","href"],ap={key:1},sp={key:2,style:{"margin-right":"3.5px"}},lp=Object(a["createTextVNode"])(". "),cp={key:0},up={key:0},pp={key:1},fp={key:0},dp=Object(a["createElementVNode"])("br",null,null,-1),mp=Object(a["createTextVNode"])(" - "),hp=["data-plugin-name","href"],gp={key:0},bp={key:0},vp={key:1},yp=["href"],Op={key:1},wp=["href"],jp={key:0,class:"tableActionBar"},Np=["href"],xp=Object(a["createElementVNode"])("span",{class:"icon-add"},null,-1),kp=["href"],Ep=Object(a["createElementVNode"])("span",{class:"icon-add"},null,-1),Cp={class:"footer-message"};function Sp(e,t,n,r,o,i){var s=Object(a["resolveComponent"])("ContentBlock"),l=Object(a["resolveDirective"])("plugin-filter"),c=Object(a["resolveDirective"])("plugin-name"),u=Object(a["resolveDirective"])("content-table"),p=Object(a["resolveDirective"])("plugin-management");return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createBlock"])(s,{"content-title":e.title,class:"pluginsManagement"},{default:Object(a["withCtx"])((function(){return[Object(a["withDirectives"])(Object(a["createElementVNode"])("p",qc,[Object(a["createElementVNode"])("span",zc,[Object(a["createElementVNode"])("strong",Wc,Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_Origin")),1),Object(a["createElementVNode"])("a",Gc,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("General_All")),1),Kc]),Yc,Object(a["createElementVNode"])("a",Zc,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_OriginCore")),1),Xc]),Qc,Object(a["createElementVNode"])("a",eu,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_OriginOfficial")),1),tu]),nu,Object(a["createElementVNode"])("a",ru,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_OriginThirdParty")),1),ou])]),Object(a["createElementVNode"])("span",iu,[Object(a["createElementVNode"])("strong",au,Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_Status")),1),Object(a["createElementVNode"])("a",su,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("General_All")),1),lu]),cu,Object(a["createElementVNode"])("a",uu,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_Active")),1),pu]),fu,Object(a["createElementVNode"])("a",du,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_Inactive")),1),mu])])],512),[[l]]),Object(a["createElementVNode"])("div",hu,[Object(a["createElementVNode"])("h2",gu,Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_UninstallConfirm")),1),Object(a["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,bu),Object(a["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,vu)]),Object(a["withDirectives"])(Object(a["createElementVNode"])("table",null,[Object(a["createElementVNode"])("thead",null,[Object(a["createElementVNode"])("tr",null,[Object(a["createElementVNode"])("th",null,Object(a["toDisplayString"])(e.isTheme?e.translate("CorePluginsAdmin_Theme"):e.translate("General_Plugin")),1),Object(a["createElementVNode"])("th",null,Object(a["toDisplayString"])(e.translate("General_Description")),1),Object(a["createElementVNode"])("th",yu,Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_Status")),1),e.displayAdminLinks?(Object(a["openBlock"])(),Object(a["createElementBlock"])("th",Ou,Object(a["toDisplayString"])(e.translate("General_Action")),1)):Object(a["createCommentVNode"])("",!0)])]),Object(a["createElementVNode"])("tbody",wu,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.pluginsToDisplay,(function(n,r){var o,i,s,l,u,p,f,d,m,h,g,b,v,y;return Object(a["openBlock"])(),Object(a["createElementBlock"])("tr",{key:r,class:Object(a["normalizeClass"])(n.activated?"active-plugin":"inactive-plugin"),"data-filter-status":n.activated?"active":"inactive","data-filter-origin":e.getPluginOrigin(n)},[Object(a["createElementVNode"])("td",Nu,[Object(a["createElementVNode"])("a",{name:r},null,8,xu),n.isCorePlugin||-1===e.marketplacePluginNames.indexOf(r)?(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",Eu,Object(a["toDisplayString"])(r),1)):Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("a",ku,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(r),1)],512)),[[c,{pluginName:r}]]),Object(a["createElementVNode"])("span",{class:"plugin-version",title:n.isCorePlugin?e.translate("CorePluginsAdmin_CorePluginTooltip"):void 0}," ("+Object(a["toDisplayString"])(n.isCorePlugin?e.translate("CorePluginsAdmin_OriginCore"):n.info.version)+") ",9,Cu),-1!==e.pluginNamesHavingSettings.indexOf(r)?(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",Su,[Au,Vu,Object(a["createElementVNode"])("a",{href:"".concat(e.generalSettingsLink,"#").concat(r),class:"settingsLink"},Object(a["toDisplayString"])(e.translate("General_Settings")),9,Tu)])):Object(a["createCommentVNode"])("",!0)]),Object(a["createElementVNode"])("td",Mu,[Object(a["createElementVNode"])("div",Pu,[n.missingRequirements?(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",Bu,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(n.missingRequirements)+" ",1),Du])):Object(a["createCommentVNode"])("",!0)]),Object(a["createElementVNode"])("div",Fu,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(n.info.description.replaceAll("\n","<br/>"))+" ",1),null!==(o=n.info)&&void 0!==o&&o.homepage&&-1===e.matomoUrls.indexOf(null===(i=n.info)||void 0===i?void 0:i.homepage)?(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",$u,[Object(a["createElementVNode"])("a",{target:"_blank",rel:"noreferrer noopener",href:n.info.homepage}," ("+Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_PluginHomepage").replaceAll(" "," "))+") ",9,_u)])):Object(a["createCommentVNode"])("",!0),null!==(s=n.info)&&void 0!==s&&null!==(l=s.donate)&&void 0!==l&&l.length?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Lu,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_LikeThisPlugin"))+" ",1),Object(a["createElementVNode"])("a",{onClick:t[0]||(t[0]=Object(a["withModifiers"])((function(){}),["prevent"])),class:"plugin-donation-link","data-overlay-id":"overlay-".concat(r)},Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_ConsiderDonating")),9,Iu),Object(a["createElementVNode"])("div",{id:"overlay-".concat(r),class:"donation-overlay ui-confirm",title:e.translate("CorePluginsAdmin_LikeThisPlugin")},[Object(a["createElementVNode"])("p",null,Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_CommunityContributedPlugin")),1),Object(a["createElementVNode"])("p",{innerHTML:e.$sanitize(e.translate("CorePluginsAdmin_ConsiderDonatingCreatorOf","<b>".concat(r,"</b>")))},null,8,Hu),Object(a["createElementVNode"])("div",Ju,[null!==(u=n.info)&&void 0!==u&&null!==(p=u.donate)&&void 0!==p&&p.paypal?(Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{key:0,class:"donation-link paypal",target:"_blank",rel:"noreferrer noopener",href:e.getPluginDonateLink(r,n.info.donate.paypal)},zu,8,Ru)):Object(a["createCommentVNode"])("",!0),null!==(f=n.info)&&void 0!==f&&null!==(d=f.donate)&&void 0!==d&&d.flattr?(Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{key:1,class:"donation-link flattr",target:"_blank",rel:"noreferrer noopener",href:null===(m=n.info.donate)||void 0===m?void 0:m.flattr},Ku,8,Wu)):Object(a["createCommentVNode"])("",!0),null!==(h=n.info)&&void 0!==h&&null!==(g=h.donate)&&void 0!==g&&g.bitcoin?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",Yu,[Zu,Object(a["createElementVNode"])("a",{href:"bitcoin:".concat(encodeURIComponent(n.info.donate.bitcoin))},Object(a["toDisplayString"])(n.info.donate.bitcoin),9,Xu)])):Object(a["createCommentVNode"])("",!0)]),Object(a["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_Close")},null,8,Qu)],8,Uu)])):Object(a["createCommentVNode"])("",!0)]),null!==(b=n.info)&&void 0!==b&&b.license?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",ep,[null!==(v=n.info)&&void 0!==v&&v.license_file?(Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{key:0,title:e.translate("CorePluginsAdmin_LicenseHomepage"),rel:"noreferrer noopener",target:"_blank",href:"index.php?module=CorePluginsAdmin&action=showLicense&pluginName=".concat(r)},Object(a["toDisplayString"])(n.info.license),9,tp)):(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",np,Object(a["toDisplayString"])(n.info.license),1))])):Object(a["createCommentVNode"])("",!0),null!==(y=n.info)&&void 0!==y&&y.authors?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",rp,[op,(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(n.info.authors.filter((function(e){return e.name})),(function(t,r){return Object(a["openBlock"])(),Object(a["createElementBlock"])("span",{key:r},[t.homepage?(Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{key:0,title:e.translate("CorePluginsAdmin_AuthorHomepage"),href:t.homepage,rel:"noreferrer noopener",target:"_blank"},Object(a["toDisplayString"])(t.name),9,ip)):(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",ap,Object(a["toDisplayString"])(t.name),1)),n.info.authors.length-1>r?(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",sp,",")):Object(a["createCommentVNode"])("",!0)])})),128)),lp])):Object(a["createCommentVNode"])("",!0)]),Object(a["createElementVNode"])("td",{class:"status",style:Object(a["normalizeStyle"])({"border-left-width":e.isDefaultTheme(r)?"0":void 0})},[e.isDefaultTheme(r)?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",cp,[n.activated?(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",up,Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_Active")),1)):(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",pp,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_Inactive"))+" ",1),n.uninstallable&&e.displayAdminLinks?(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",fp,[dp,mp,Object(a["createElementVNode"])("a",{"data-plugin-name":r,class:"uninstall",href:e.getUninstallLink(r)},Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_ActionUninstall")),9,hp)])):Object(a["createCommentVNode"])("",!0)]))]))],4),e.displayAdminLinks?(Object(a["openBlock"])(),Object(a["createElementBlock"])("td",{key:0,class:"togl action-links",style:Object(a["normalizeStyle"])({"border-left-width":e.isDefaultTheme(r)?0:void 0})},[e.isDefaultTheme(r)?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",gp,[n.invalid&&n.alwaysActivated?(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",bp,"-")):(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",vp,[n.activated?(Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{key:0,href:e.getDeactivateLink(r)},Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_Deactivate")),9,yp)):n.missingRequirements?(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",Op,"-")):(Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{key:2,href:e.getActivateLink(r)},Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_Activate")),9,wp))]))]))],4)):Object(a["createCommentVNode"])("",!0)],10,ju)})),128))])],512),[[u]]),e.displayAdminLinks?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",jp,[e.isTheme?(Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{key:0,href:e.themeOverviewLink},[xp,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_InstallNewThemes")),1)],8,Np)):(Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{key:1,href:e.overviewLink},[Ep,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_InstallNewPlugins")),1)],8,kp))])):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("div",Cp,Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_AlwaysActivatedPluginsList",e.pluginsAlwaysActivated)),1)]})),_:1},8,["content-title"])),[[p,{}]])}function Ap(e,t){return Bp(e)||Pp(e,t)||Tp(e,t)||Vp()}function Vp(){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 Tp(e,t){if(e){if("string"===typeof e)return Mp(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)?Mp(e,t):void 0}}function Mp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Pp(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0)if(i.push(r.value),t&&i.length===t)break}catch(l){s=!0,o=l}finally{try{a||null==n["return"]||n["return"]()}finally{if(s)throw o}}return i}}function Bp(e){if(Array.isArray(e))return e}var Dp=Object(a["defineComponent"])({props:{isTheme:Boolean,displayAdminLinks:Boolean,pluginsInfo:{type:Object,required:!0},uninstallNonce:{type:String,required:!0},deactivateNonce:{type:String,required:!0},activateNonce:{type:String,required:!0},marketplacePluginNames:{type:Array,required:!0},pluginNamesHavingSettings:{type:Array,required:!0},title:{type:String,required:!0}},components:{ContentBlock:i["ContentBlock"]},directives:{PluginManagement:ic,PluginFilter:Nc,ContentTable:i["ContentTable"],PluginName:Rc},methods:{getPluginOrigin:function(e){return e.isCorePlugin?"core":e.isOfficialPlugin?"official":"thirdparty"},getPluginDonateLink:function(e,t){return"https://www.paypal.com/cgi-bin/webscr?".concat(i["MatomoUrl"].stringify({cmd:"_donations",item_name:"Matomo Plugin ".concat(e),bn:"PP-DonationsBF:btn_donateCC_LG.gif:NonHosted",business:t}))},getUninstallLink:function(e){return"?".concat(i["MatomoUrl"].stringify({module:"CorePluginsAdmin",action:"uninstall",pluginName:e,nonce:this.uninstallNonce}))},isDefaultTheme:function(e){return this.isTheme&&"Morpheus"===e},getDeactivateLink:function(e){return"?".concat(i["MatomoUrl"].stringify({module:"CorePluginsAdmin",action:"deactivate",pluginName:e,nonce:this.deactivateNonce,redirectTo:"referrer"}))},getActivateLink:function(e){return"?".concat(i["MatomoUrl"].stringify({module:"CorePluginsAdmin",action:"activate",pluginName:e,nonce:this.activateNonce,redirectTo:"referrer"}))}},computed:{pluginsToDisplay:function(){var e=this,t=this.pluginsInfo;return Object.fromEntries(Object.entries(t).filter((function(t){var n=Ap(t,2),r=n[1];if(e.isTheme)return!0;var o=r.alwaysActivated;return"undefined"!==typeof o&&null!==o&&!o})))},generalSettingsLink:function(){return"?".concat(i["MatomoUrl"].stringify(Object.assign(Object.assign({},i["MatomoUrl"].urlParsed.value),{},{module:"CoreAdminHome",action:"generalSettings"})))},matomoUrls:function(){return["http://piwik.org","http://www.piwik.org","http://piwik.org/","http://www.piwik.org/","https://piwik.org","https://www.piwik.org","https://piwik.org/","https://www.piwik.org/","http://matomo.org","http://www.matomo.org","http://matomo.org/","http://www.matomo.org/","https://matomo.org","https://www.matomo.org","https://matomo.org/","https://www.matomo.org/"]},themeOverviewLink:function(){return"?".concat(i["MatomoUrl"].stringify(Object.assign(Object.assign({},i["MatomoUrl"].urlParsed.value),{},{module:"Marketplace",action:"overview",sort:"",show:"themes"})))},overviewLink:function(){return"?".concat(i["MatomoUrl"].stringify(Object.assign(Object.assign({},i["MatomoUrl"].urlParsed.value),{},{module:"Marketplace",action:"overview",sort:""})))},pluginsAlwaysActivated:function(){var e=this.pluginsInfo;return Object.entries(e).filter((function(e){var t=Ap(e,2),n=t[1];return n.alwaysActivated})).map((function(e){var t=Ap(e,1),n=t[0];return n})).join(", ")}}});Dp.render=Sp;var Fp=Dp,$p={class:"checkbox-container"},_p=Object(a["createElementVNode"])("span",null,null,-1),Lp={class:"num"},Ip={class:"status"},Up={class:"action-links"},Hp={id:"plugins"},Jp={class:"select-cell"},Rp={class:"checkbox-container"},qp=["id","disabled","onUpdate:modelValue"],zp=Object(a["createElementVNode"])("span",null,null,-1),Wp={class:"name"},Gp={class:"vers"},Kp=["href","title"],Yp={key:1},Zp={class:"desc"},Xp={class:"status"},Qp={class:"togl action-links"},ef=["title"],tf=["href"],nf=["href"],rf={key:3};function of(e,t,n,r,o,i){var s=Object(a["resolveComponent"])("MissingReqsNotice"),l=Object(a["resolveComponent"])("ContentBlock"),c=Object(a["resolveDirective"])("plugin-name"),u=Object(a["resolveDirective"])("content-table");return Object.keys(e.pluginsHavingUpdate).length?(Object(a["openBlock"])(),Object(a["createBlock"])(l,{key:0,"content-title":e.translate("CorePluginsAdmin_NUpdatesAvailable",Object.keys(e.pluginsHavingUpdate).length)},{default:Object(a["withCtx"])((function(){return[Object(a["createElementVNode"])("p",null,Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_InfoPluginUpdateIsRecommended")),1),Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("a",{id:"update-selected-plugins",onClick:t[0]||(t[0]=Object(a["withModifiers"])((function(t){return e.updateSelectedPlugins()}),["prevent"])),class:Object(a["normalizeClass"])({btn:!0,disabled:e.isUpdateLinkDisabled})},Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_UpdateSelected")),3)]),Object(a["withDirectives"])(Object(a["createElementVNode"])("table",null,[Object(a["createElementVNode"])("thead",null,[Object(a["createElementVNode"])("tr",null,[Object(a["createElementVNode"])("th",null,[Object(a["createElementVNode"])("span",$p,[Object(a["createElementVNode"])("label",null,[Object(a["createElementVNode"])("input",{type:"checkbox",id:"select-plugin-all",onChange:t[1]||(t[1]=function(t){return e.selectAll(t.target.checked)})},null,32),_p])])]),Object(a["createElementVNode"])("th",null,Object(a["toDisplayString"])(e.translate("General_Plugin")),1),Object(a["createElementVNode"])("th",Lp,Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_Version")),1),Object(a["createElementVNode"])("th",null,Object(a["toDisplayString"])(e.translate("General_Description")),1),Object(a["createElementVNode"])("th",Ip,Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_Status")),1),Object(a["createElementVNode"])("th",Up,Object(a["toDisplayString"])(e.translate("General_Action")),1)])]),Object(a["createElementVNode"])("tbody",Hp,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.pluginsHavingUpdate,(function(n,r){var o;return Object(a["openBlock"])(),Object(a["createElementBlock"])("tr",{key:r,class:Object(a["normalizeClass"])(n.isActivated?"active-plugin":"inactive-plugin")},[Object(a["createElementVNode"])("td",Jp,[Object(a["createElementVNode"])("span",Rp,[Object(a["createElementVNode"])("label",null,[Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{type:"checkbox",id:"select-plugin-".concat(n.name),disabled:"undefined"!==typeof n.isDownloadable&&null!==n.isDownloadable&&!n.isDownloadable,"onUpdate:modelValue":function(t){return e.pluginsSelected[r]=t}},null,8,qp),[[a["vModelCheckbox"],e.pluginsSelected[r]]]),zp])])]),Object(a["createElementVNode"])("td",Wp,[Object(a["withDirectives"])(Object(a["createElementVNode"])("a",{onClick:t[2]||(t[2]=Object(a["withModifiers"])((function(){}),["prevent"])),class:"plugin-details"},[Object(a["createTextVNode"])(Object(a["toDisplayString"])(n.name),1)],512),[[c,{pluginName:n.name}]])]),Object(a["createElementVNode"])("td",Gp,[null!==(o=n.changelog)&&void 0!==o&&o.url?(Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{key:0,href:n.changelog.url,title:e.translate("CorePluginsAdmin_Changelog"),target:"_blank",rel:"noreferrer noopener"},Object(a["toDisplayString"])(n.currentVersion)+" => "+Object(a["toDisplayString"])(n.latestVersion),9,Kp)):(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",Yp,Object(a["toDisplayString"])(n.currentVersion)+" => "+Object(a["toDisplayString"])(n.latestVersion),1))]),Object(a["createElementVNode"])("td",Zp,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(n.description)+" ",1),Object(a["createVNode"])(s,{plugin:n},null,8,["plugin"])]),Object(a["createElementVNode"])("td",Xp,Object(a["toDisplayString"])(n.isActivated?e.translate("CorePluginsAdmin_Active"):e.translate("CorePluginsAdmin_Inactive")),1),Object(a["createElementVNode"])("td",Qp,["undefined"===typeof n.isDownloadable||null===n.isDownloadable||n.isDownloadable?e.isMultiServerEnvironment?Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{key:1,onClick:t[3]||(t[3]=function(t){return e.isPluginDownloadLinkClicked=!0}),href:e.downloadPluginLink(n)},Object(a["toDisplayString"])(e.translate("General_Download")),9,tf)),[[a["vShow"],!e.isPluginDownloadLinkClicked]]):0===n.missingRequirements.length?(Object(a["openBlock"])(),Object(a["createElementBlock"])("a",{key:2,href:e.updatePluginLink(n)},Object(a["toDisplayString"])(e.translate("CoreUpdater_UpdateTitle")),9,nf)):(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",rf,"-")):(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",{key:0,title:"".concat(e.translate("CorePluginsAdmin_PluginNotDownloadable")," ").concat(n.isPaid?e.translate("CorePluginsAdmin_PluginNotDownloadablePaidReason"):"")},Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_NotDownloadable")),9,ef))])],2)})),128))])],512),[[u]])]})),_:1},8,["content-title"])):Object(a["createCommentVNode"])("",!0)}function af(e,t){return pf(e)||uf(e,t)||lf(e,t)||sf()}function sf(){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 lf(e,t){if(e){if("string"===typeof e)return cf(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)?cf(e,t):void 0}}function cf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function uf(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0)if(i.push(r.value),t&&i.length===t)break}catch(l){s=!0,o=l}finally{try{a||null==n["return"]||n["return"]()}finally{if(s)throw o}}return i}}function pf(e){if(Array.isArray(e))return e}var ff=Object(i["useExternalPluginComponent"])("Marketplace","MissingReqsNotice"),df=Object(a["defineComponent"])({props:{pluginsHavingUpdate:{type:Object,required:!0},pluginUpdateNonces:{type:Object,required:!0},updateNonce:{type:String,required:!0},isMultiServerEnvironment:Boolean},components:{ContentBlock:i["ContentBlock"],MissingReqsNotice:ff},directives:{ContentTable:i["ContentTable"],PluginName:Rc},data:function(){return{isUpdating:!1,isPluginDownloadLinkClicked:!1,pluginsSelected:{}}},computed:{isUpdateLinkDisabled:function(){return this.isUpdating||!Object.keys(this.pluginsSelected).length||!Object.values(this.pluginsSelected).some((function(e){return!!e}))}},methods:{selectAll:function(e){var t=this,n=this.pluginsHavingUpdate;Object.entries(n).forEach((function(n){var r=af(n,2),o=r[0],i=r[1];(null===i.isDownloadable||"undefined"===typeof i.isDownloadable||i.isDownloadable)&&(t.pluginsSelected[o]=e)}))},downloadPluginLink:function(e){return"?".concat(i["MatomoUrl"].stringify(Object.assign(Object.assign({},i["MatomoUrl"].urlParsed.value),{},{module:"Marketplace",action:"download",pluginName:e.name,nonce:this.pluginUpdateNonces[e.name]})))},updatePluginLink:function(e){return"?".concat(i["MatomoUrl"].stringify(Object.assign(Object.assign({},i["MatomoUrl"].urlParsed.value),{},{module:"Marketplace",action:"updatePlugin",pluginName:e.name,nonce:this.updateNonce})))},updateSelectedPlugins:function(){this.isUpdating=!0;var e=Object.entries(this.pluginsSelected).filter((function(e){var t=af(e,2),n=t[1];return n})).map((function(e){var t=af(e,1),n=t[0];return n}));i["MatomoUrl"].updateUrl(Object.assign(Object.assign({},i["MatomoUrl"].urlParsed.value),{},{module:"Marketplace",action:"updatePlugin",nonce:this.updateNonce,pluginName:e.join(",")}))}}});df.render=of;var mf=df,hf={class:"ui-confirm",id:"installPluginByUpload"},gf={key:0},bf={class:"description"},vf=["action"],yf=["data-max-size"],Of=Object(a["createElementVNode"])("br",null,null,-1),wf=["value"],jf={key:1},Nf=["innerHTML"],xf=Object(a["createElementVNode"])("pre",null,"[General]\n enable_plugin_upload = 1",-1),kf=["value"];function Ef(e,t,n,r,o,i){var s=Object(a["resolveComponent"])("Field"),l=Object(a["resolveDirective"])("plugin-upload");return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("div",hf,[Object(a["createElementVNode"])("h2",null,Object(a["toDisplayString"])(e.translate("Marketplace_TeaserExtendPiwikByUpload")),1),e.isPluginUploadEnabled?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",gf,[Object(a["createElementVNode"])("p",bf,Object(a["toDisplayString"])(e.translate("Marketplace_AllowedUploadFormats")),1),Object(a["createElementVNode"])("form",{enctype:"multipart/form-data",method:"post",id:"uploadPluginForm",action:e.uploadPluginAction},[Object(a["createElementVNode"])("input",{type:"file",name:"pluginZip","data-max-size":e.uploadLimit},null,8,yf),Of,Object(a["createVNode"])(s,{uicontrol:"password",name:"confirmPassword",autocomplete:"off",title:e.translate("Login_ConfirmPasswordToContinue"),modelValue:e.confirmPassword,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.confirmPassword=t})},null,8,["title","modelValue"]),Object(a["createElementVNode"])("input",{class:"startUpload btn",type:"submit",value:e.translate("Marketplace_UploadZipFile")},null,8,wf)],8,vf)])):(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",jf,[Object(a["createElementVNode"])("p",{class:"description",innerHTML:e.$sanitize(e.translate("Marketplace_PluginUploadDisabled"))},null,8,Nf),xf,Object(a["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Ok")},null,8,kf)]))],512)),[[l]])}var Cf=Object(a["defineComponent"])({props:{isPluginUploadEnabled:Boolean,uploadLimit:[String,Number],installNonce:String},components:{Field:en},directives:{PluginUpload:pc},data:function(){return{confirmPassword:""}},computed:{uploadPluginAction:function(){return"?".concat(i["MatomoUrl"].stringify(Object.assign(Object.assign({},i["MatomoUrl"].urlParsed.value),{},{module:"CorePluginsAdmin",action:"uploadPlugin",nonce:this.installNonce})))}}});Cf.render=Ef;var Sf=Cf; + */function Fc(e,t){var n=e.value.pluginName,r=e.value.activePluginTab;t.preventDefault(),r&&(n+="!".concat(r)),window.broadcast.propagateNewPopoverParameter("browsePluginDetail",n)}window.broadcast.addPopoverHandler("browsePluginDetail",(function(e){var t=e,n=null;-1!==e.indexOf("!")&&(n=e.slice(e.indexOf("!")+1),t=e.slice(0,e.indexOf("!")));var r="module=Marketplace&action=pluginDetails&pluginName=".concat(encodeURIComponent(t));n&&(r+="&activeTab=".concat(encodeURIComponent(n))),window.Piwik_Popover.createPopupAndLoadUrl(r,"details")}));var _c=window,Lc=_c.$,Ic={mounted:function(e,t){var n=t.value.pluginName;n&&(t.value.onClickHandler=Fc.bind(null,t),Lc(e).on("click",t.value.onClickHandler).attr("matomo-plugin-name",n))},unmounted:function(e,t){Lc(e).off("click",t.value.onClickHandler)}},Uc={class:"row pluginsFilter"},Hc={class:"origin"},Rc={style:{"margin-right":"3.5px"}},qc={"data-filter-origin":"all",href:"#",class:"active"},zc=Object(Oi["createElementVNode"])("span",{class:"counter"},null,-1),Wc=Object(Oi["createTextVNode"])(" | "),Jc={"data-filter-origin":"core",href:"#"},Gc=Object(Oi["createElementVNode"])("span",{class:"counter"},null,-1),Kc=Object(Oi["createTextVNode"])(" | "),Yc={"data-filter-origin":"official",href:"#"},Zc=Object(Oi["createElementVNode"])("span",{class:"counter"},null,-1),Xc=Object(Oi["createTextVNode"])(" | "),Qc={"data-filter-origin":"thirdparty",href:"#"},eu=Object(Oi["createElementVNode"])("span",{class:"counter"},null,-1),tu={class:"status"},nu={style:{"margin-right":"3.5px"}},ru={"data-filter-status":"all",href:"#",class:"active"},ou=Object(Oi["createElementVNode"])("span",{class:"counter"},null,-1),iu=Object(Oi["createTextVNode"])(" | "),au={"data-filter-status":"active",href:"#"},su=Object(Oi["createElementVNode"])("span",{class:"counter"},null,-1),lu=Object(Oi["createTextVNode"])(" | "),cu={"data-filter-status":"inactive",href:"#"},uu=Object(Oi["createElementVNode"])("span",{class:"counter"},null,-1),pu={id:"confirmUninstallPlugin",class:"ui-confirm"},du={id:"uninstallPluginConfirm"},fu=["value"],mu=["value"],hu={class:"status"},gu={key:0,class:"action-links"},bu={id:"plugins"},yu=["data-filter-status","data-filter-origin"],vu={class:"name"},Ou=["name"],wu={key:0},ju={key:1},Nu=["title"],xu={key:2},ku=Object(Oi["createElementVNode"])("br",null,null,-1),Eu=Object(Oi["createElementVNode"])("br",null,null,-1),Cu=["href"],Su={class:"desc"},Vu={class:"plugin-desc-missingrequirements"},Au={key:0},Tu=Object(Oi["createElementVNode"])("br",null,null,-1),Mu={class:"plugin-desc-text"},Pu={key:0,class:"plugin-homepage"},Du=["href"],Bu={key:1,class:"plugin-donation"},$u=["data-overlay-id"],Fu=["id","title"],_u=["innerHTML"],Lu={class:"donation-links"},Iu=["href"],Uu=Object(Oi["createElementVNode"])("img",{src:"plugins/CorePluginsAdmin/images/paypal_donate.png",height:"30"},null,-1),Hu=[Uu],Ru=["href"],qu=Object(Oi["createElementVNode"])("img",{class:"alignnone",title:"Flattr",alt:"",src:"plugins/CorePluginsAdmin/images/flattr.png",height:"29"},null,-1),zu=[qu],Wu={key:2,class:"donation-link bitcoin"},Ju=Object(Oi["createElementVNode"])("span",null,"Donate Bitcoins to:",-1),Gu=["href"],Ku=["value"],Yu={key:0,class:"plugin-license"},Zu=["title","href"],Xu={key:1},Qu={key:1,class:"plugin-author"},ep=Object(Oi["createTextVNode"])(" By "),tp=["title","href"],np={key:1},rp={key:2,style:{"margin-right":"3.5px"}},op=Object(Oi["createTextVNode"])(". "),ip={key:0},ap={key:0},sp={key:1},lp={key:0},cp=Object(Oi["createElementVNode"])("br",null,null,-1),up=Object(Oi["createTextVNode"])(" - "),pp=["data-plugin-name","href"],dp={key:0},fp={key:0},mp={key:1},hp=["href"],gp={key:1},bp=["href"],yp={key:0,class:"tableActionBar"},vp=["href"],Op=Object(Oi["createElementVNode"])("span",{class:"icon-add"},null,-1),wp=["href"],jp=Object(Oi["createElementVNode"])("span",{class:"icon-add"},null,-1),Np={class:"footer-message"};function xp(e,t,n,r,o,i){var a=Object(Oi["resolveComponent"])("ContentBlock"),s=Object(Oi["resolveDirective"])("plugin-filter"),l=Object(Oi["resolveDirective"])("plugin-name"),c=Object(Oi["resolveDirective"])("content-table"),u=Object(Oi["resolveDirective"])("plugin-management");return Object(Oi["withDirectives"])((Object(Oi["openBlock"])(),Object(Oi["createBlock"])(a,{"content-title":e.title,class:"pluginsManagement"},{default:Object(Oi["withCtx"])((function(){return[Object(Oi["withDirectives"])(Object(Oi["createElementVNode"])("p",Uc,[Object(Oi["createElementVNode"])("span",Hc,[Object(Oi["createElementVNode"])("strong",Rc,Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_Origin")),1),Object(Oi["createElementVNode"])("a",qc,[Object(Oi["createTextVNode"])(Object(Oi["toDisplayString"])(e.translate("General_All")),1),zc]),Wc,Object(Oi["createElementVNode"])("a",Jc,[Object(Oi["createTextVNode"])(Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_OriginCore")),1),Gc]),Kc,Object(Oi["createElementVNode"])("a",Yc,[Object(Oi["createTextVNode"])(Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_OriginOfficial")),1),Zc]),Xc,Object(Oi["createElementVNode"])("a",Qc,[Object(Oi["createTextVNode"])(Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_OriginThirdParty")),1),eu])]),Object(Oi["createElementVNode"])("span",tu,[Object(Oi["createElementVNode"])("strong",nu,Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_Status")),1),Object(Oi["createElementVNode"])("a",ru,[Object(Oi["createTextVNode"])(Object(Oi["toDisplayString"])(e.translate("General_All")),1),ou]),iu,Object(Oi["createElementVNode"])("a",au,[Object(Oi["createTextVNode"])(Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_Active")),1),su]),lu,Object(Oi["createElementVNode"])("a",cu,[Object(Oi["createTextVNode"])(Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_Inactive")),1),uu])])],512),[[s]]),Object(Oi["createElementVNode"])("div",pu,[Object(Oi["createElementVNode"])("h2",du,Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_UninstallConfirm")),1),Object(Oi["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,fu),Object(Oi["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,mu)]),Object(Oi["withDirectives"])(Object(Oi["createElementVNode"])("table",null,[Object(Oi["createElementVNode"])("thead",null,[Object(Oi["createElementVNode"])("tr",null,[Object(Oi["createElementVNode"])("th",null,Object(Oi["toDisplayString"])(e.isTheme?e.translate("CorePluginsAdmin_Theme"):e.translate("General_Plugin")),1),Object(Oi["createElementVNode"])("th",null,Object(Oi["toDisplayString"])(e.translate("General_Description")),1),Object(Oi["createElementVNode"])("th",hu,Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_Status")),1),e.displayAdminLinks?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("th",gu,Object(Oi["toDisplayString"])(e.translate("General_Action")),1)):Object(Oi["createCommentVNode"])("",!0)])]),Object(Oi["createElementVNode"])("tbody",bu,[(Object(Oi["openBlock"])(!0),Object(Oi["createElementBlock"])(Oi["Fragment"],null,Object(Oi["renderList"])(e.pluginsToDisplay,(function(n,r){var o,i,a,s,c,u,p,d,f,m,h,g,b,y;return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("tr",{key:r,class:Object(Oi["normalizeClass"])(n.activated?"active-plugin":"inactive-plugin"),"data-filter-status":n.activated?"active":"inactive","data-filter-origin":e.getPluginOrigin(n)},[Object(Oi["createElementVNode"])("td",vu,[Object(Oi["createElementVNode"])("a",{name:r},null,8,Ou),n.isCorePlugin||-1===e.marketplacePluginNames.indexOf(r)?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",ju,Object(Oi["toDisplayString"])(r),1)):Object(Oi["withDirectives"])((Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("a",wu,[Object(Oi["createTextVNode"])(Object(Oi["toDisplayString"])(r),1)],512)),[[l,{pluginName:r}]]),Object(Oi["createElementVNode"])("span",{class:"plugin-version",title:n.isCorePlugin?e.translate("CorePluginsAdmin_CorePluginTooltip"):void 0}," ("+Object(Oi["toDisplayString"])(n.isCorePlugin?e.translate("CorePluginsAdmin_OriginCore"):n.info.version)+") ",9,Nu),-1!==e.pluginNamesHavingSettings.indexOf(r)?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",xu,[ku,Eu,Object(Oi["createElementVNode"])("a",{href:"".concat(e.generalSettingsLink,"#").concat(r),class:"settingsLink"},Object(Oi["toDisplayString"])(e.translate("General_Settings")),9,Cu)])):Object(Oi["createCommentVNode"])("",!0)]),Object(Oi["createElementVNode"])("td",Su,[Object(Oi["createElementVNode"])("div",Vu,[n.missingRequirements?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",Au,[Object(Oi["createTextVNode"])(Object(Oi["toDisplayString"])(n.missingRequirements)+" ",1),Tu])):Object(Oi["createCommentVNode"])("",!0)]),Object(Oi["createElementVNode"])("div",Mu,[Object(Oi["createTextVNode"])(Object(Oi["toDisplayString"])(n.info.description.replaceAll("\n","<br/>"))+" ",1),null!==(o=n.info)&&void 0!==o&&o.homepage&&-1===e.matomoUrls.indexOf(null===(i=n.info)||void 0===i?void 0:i.homepage)?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",Pu,[Object(Oi["createElementVNode"])("a",{target:"_blank",rel:"noreferrer noopener",href:n.info.homepage}," ("+Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_PluginHomepage").replaceAll(" "," "))+") ",9,Du)])):Object(Oi["createCommentVNode"])("",!0),null!==(a=n.info)&&void 0!==a&&null!==(s=a.donate)&&void 0!==s&&s.length?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",Bu,[Object(Oi["createTextVNode"])(Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_LikeThisPlugin"))+" ",1),Object(Oi["createElementVNode"])("a",{onClick:t[0]||(t[0]=Object(Oi["withModifiers"])((function(){}),["prevent"])),class:"plugin-donation-link","data-overlay-id":"overlay-".concat(r)},Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_ConsiderDonating")),9,$u),Object(Oi["createElementVNode"])("div",{id:"overlay-".concat(r),class:"donation-overlay ui-confirm",title:e.translate("CorePluginsAdmin_LikeThisPlugin")},[Object(Oi["createElementVNode"])("p",null,Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_CommunityContributedPlugin")),1),Object(Oi["createElementVNode"])("p",{innerHTML:e.$sanitize(e.translate("CorePluginsAdmin_ConsiderDonatingCreatorOf","<b>".concat(r,"</b>")))},null,8,_u),Object(Oi["createElementVNode"])("div",Lu,[null!==(c=n.info)&&void 0!==c&&null!==(u=c.donate)&&void 0!==u&&u.paypal?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("a",{key:0,class:"donation-link paypal",target:"_blank",rel:"noreferrer noopener",href:e.getPluginDonateLink(r,n.info.donate.paypal)},Hu,8,Iu)):Object(Oi["createCommentVNode"])("",!0),null!==(p=n.info)&&void 0!==p&&null!==(d=p.donate)&&void 0!==d&&d.flattr?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("a",{key:1,class:"donation-link flattr",target:"_blank",rel:"noreferrer noopener",href:null===(f=n.info.donate)||void 0===f?void 0:f.flattr},zu,8,Ru)):Object(Oi["createCommentVNode"])("",!0),null!==(m=n.info)&&void 0!==m&&null!==(h=m.donate)&&void 0!==h&&h.bitcoin?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",Wu,[Ju,Object(Oi["createElementVNode"])("a",{href:"bitcoin:".concat(encodeURIComponent(n.info.donate.bitcoin))},Object(Oi["toDisplayString"])(n.info.donate.bitcoin),9,Gu)])):Object(Oi["createCommentVNode"])("",!0)]),Object(Oi["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_Close")},null,8,Ku)],8,Fu)])):Object(Oi["createCommentVNode"])("",!0)]),null!==(g=n.info)&&void 0!==g&&g.license?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",Yu,[null!==(b=n.info)&&void 0!==b&&b.license_file?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("a",{key:0,title:e.translate("CorePluginsAdmin_LicenseHomepage"),rel:"noreferrer noopener",target:"_blank",href:"index.php?module=CorePluginsAdmin&action=showLicense&pluginName=".concat(r)},Object(Oi["toDisplayString"])(n.info.license),9,Zu)):(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",Xu,Object(Oi["toDisplayString"])(n.info.license),1))])):Object(Oi["createCommentVNode"])("",!0),null!==(y=n.info)&&void 0!==y&&y.authors?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",Qu,[ep,(Object(Oi["openBlock"])(!0),Object(Oi["createElementBlock"])(Oi["Fragment"],null,Object(Oi["renderList"])(n.info.authors.filter((function(e){return e.name})),(function(t,r){return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",{key:r},[t.homepage?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("a",{key:0,title:e.translate("CorePluginsAdmin_AuthorHomepage"),href:t.homepage,rel:"noreferrer noopener",target:"_blank"},Object(Oi["toDisplayString"])(t.name),9,tp)):(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",np,Object(Oi["toDisplayString"])(t.name),1)),n.info.authors.length-1>r?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",rp,",")):Object(Oi["createCommentVNode"])("",!0)])})),128)),op])):Object(Oi["createCommentVNode"])("",!0)]),Object(Oi["createElementVNode"])("td",{class:"status",style:Object(Oi["normalizeStyle"])({"border-left-width":e.isDefaultTheme(r)?"0":void 0})},[e.isDefaultTheme(r)?Object(Oi["createCommentVNode"])("",!0):(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",ip,[n.activated?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",ap,Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_Active")),1)):(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",sp,[Object(Oi["createTextVNode"])(Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_Inactive"))+" ",1),n.uninstallable&&e.displayAdminLinks?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",lp,[cp,up,Object(Oi["createElementVNode"])("a",{"data-plugin-name":r,class:"uninstall",href:e.getUninstallLink(r)},Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_ActionUninstall")),9,pp)])):Object(Oi["createCommentVNode"])("",!0)]))]))],4),e.displayAdminLinks?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("td",{key:0,class:"togl action-links",style:Object(Oi["normalizeStyle"])({"border-left-width":e.isDefaultTheme(r)?0:void 0})},[e.isDefaultTheme(r)?Object(Oi["createCommentVNode"])("",!0):(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",dp,[n.invalid&&n.alwaysActivated?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",fp,"-")):(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",mp,[n.activated?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("a",{key:0,href:e.getDeactivateLink(r)},Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_Deactivate")),9,hp)):n.missingRequirements?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",gp,"-")):(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("a",{key:2,href:e.getActivateLink(r)},Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_Activate")),9,bp))]))]))],4)):Object(Oi["createCommentVNode"])("",!0)],10,yu)})),128))])],512),[[c]]),e.displayAdminLinks?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",yp,[e.isTheme?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("a",{key:0,href:e.themeOverviewLink},[Op,Object(Oi["createTextVNode"])(" "+Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_InstallNewThemes")),1)],8,vp)):(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("a",{key:1,href:e.overviewLink},[jp,Object(Oi["createTextVNode"])(" "+Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_InstallNewPlugins")),1)],8,wp))])):Object(Oi["createCommentVNode"])("",!0),Object(Oi["createElementVNode"])("div",Np,Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_AlwaysActivatedPluginsList",e.pluginsAlwaysActivated)),1)]})),_:1},8,["content-title"])),[[u,{}]])}function kp(e,t){return Ap(e)||Vp(e,t)||Cp(e,t)||Ep()}function Ep(){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 Cp(e,t){if(e){if("string"===typeof e)return Sp(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)?Sp(e,t):void 0}}function Sp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Vp(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0)if(i.push(r.value),t&&i.length===t)break}catch(l){s=!0,o=l}finally{try{a||null==n["return"]||n["return"]()}finally{if(s)throw o}}return i}}function Ap(e){if(Array.isArray(e))return e}var Tp=Object(Oi["defineComponent"])({props:{isTheme:Boolean,displayAdminLinks:Boolean,pluginsInfo:{type:Object,required:!0},uninstallNonce:{type:String,required:!0},deactivateNonce:{type:String,required:!0},activateNonce:{type:String,required:!0},marketplacePluginNames:{type:Array,required:!0},pluginNamesHavingSettings:{type:Array,required:!0},title:{type:String,required:!0}},components:{ContentBlock:Ci["ContentBlock"]},directives:{PluginManagement:lc,PluginFilter:rc,ContentTable:Ci["ContentTable"],PluginName:Ic},methods:{getPluginOrigin:function(e){return e.isCorePlugin?"core":e.isOfficialPlugin?"official":"thirdparty"},getPluginDonateLink:function(e,t){return"https://www.paypal.com/cgi-bin/webscr?".concat(Ci["MatomoUrl"].stringify({cmd:"_donations",item_name:"Matomo Plugin ".concat(e),bn:"PP-DonationsBF:btn_donateCC_LG.gif:NonHosted",business:t}))},getUninstallLink:function(e){return"?".concat(Ci["MatomoUrl"].stringify({module:"CorePluginsAdmin",action:"uninstall",pluginName:e,nonce:this.uninstallNonce}))},isDefaultTheme:function(e){return this.isTheme&&"Morpheus"===e},getDeactivateLink:function(e){return"?".concat(Ci["MatomoUrl"].stringify({module:"CorePluginsAdmin",action:"deactivate",pluginName:e,nonce:this.deactivateNonce,redirectTo:"referrer"}))},getActivateLink:function(e){return"?".concat(Ci["MatomoUrl"].stringify({module:"CorePluginsAdmin",action:"activate",pluginName:e,nonce:this.activateNonce,redirectTo:"referrer"}))}},computed:{pluginsToDisplay:function(){var e=this,t=this.pluginsInfo;return Object.fromEntries(Object.entries(t).filter((function(t){var n=kp(t,2),r=n[1];if(e.isTheme)return!0;var o=r.alwaysActivated;return"undefined"!==typeof o&&null!==o&&!o})))},generalSettingsLink:function(){return"?".concat(Ci["MatomoUrl"].stringify(Object.assign(Object.assign({},Ci["MatomoUrl"].urlParsed.value),{},{module:"CoreAdminHome",action:"generalSettings"})))},matomoUrls:function(){return["http://piwik.org","http://www.piwik.org","http://piwik.org/","http://www.piwik.org/","https://piwik.org","https://www.piwik.org","https://piwik.org/","https://www.piwik.org/","http://matomo.org","http://www.matomo.org","http://matomo.org/","http://www.matomo.org/","https://matomo.org","https://www.matomo.org","https://matomo.org/","https://www.matomo.org/"]},themeOverviewLink:function(){return"?".concat(Ci["MatomoUrl"].stringify(Object.assign(Object.assign({},Ci["MatomoUrl"].urlParsed.value),{},{module:"Marketplace",action:"overview",sort:"",show:"themes"})))},overviewLink:function(){return"?".concat(Ci["MatomoUrl"].stringify(Object.assign(Object.assign({},Ci["MatomoUrl"].urlParsed.value),{},{module:"Marketplace",action:"overview",sort:""})))},pluginsAlwaysActivated:function(){var e=this.pluginsInfo;return Object.entries(e).filter((function(e){var t=kp(e,2),n=t[1];return n.alwaysActivated})).map((function(e){var t=kp(e,1),n=t[0];return n})).join(", ")}}});Tp.render=xp;var Mp=Tp,Pp={class:"checkbox-container"},Dp=Object(Oi["createElementVNode"])("span",null,null,-1),Bp={class:"num"},$p={class:"status"},Fp={class:"action-links"},_p={id:"plugins"},Lp={class:"select-cell"},Ip={class:"checkbox-container"},Up=["id","disabled","onUpdate:modelValue"],Hp=Object(Oi["createElementVNode"])("span",null,null,-1),Rp={class:"name"},qp={class:"vers"},zp=["href","title"],Wp={key:1},Jp={class:"desc"},Gp={class:"status"},Kp={class:"togl action-links"},Yp=["title"],Zp=["href"],Xp=["href"],Qp={key:3};function ed(e,t,n,r,o,i){var a=Object(Oi["resolveComponent"])("MissingReqsNotice"),s=Object(Oi["resolveComponent"])("ContentBlock"),l=Object(Oi["resolveDirective"])("plugin-name"),c=Object(Oi["resolveDirective"])("content-table");return Object.keys(e.pluginsHavingUpdate).length?(Object(Oi["openBlock"])(),Object(Oi["createBlock"])(s,{key:0,"content-title":e.translate("CorePluginsAdmin_NUpdatesAvailable",Object.keys(e.pluginsHavingUpdate).length)},{default:Object(Oi["withCtx"])((function(){return[Object(Oi["createElementVNode"])("p",null,Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_InfoPluginUpdateIsRecommended")),1),Object(Oi["createElementVNode"])("div",null,[Object(Oi["createElementVNode"])("a",{id:"update-selected-plugins",onClick:t[0]||(t[0]=Object(Oi["withModifiers"])((function(t){return e.updateSelectedPlugins()}),["prevent"])),class:Object(Oi["normalizeClass"])({btn:!0,disabled:e.isUpdateLinkDisabled})},Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_UpdateSelected")),3)]),Object(Oi["withDirectives"])(Object(Oi["createElementVNode"])("table",null,[Object(Oi["createElementVNode"])("thead",null,[Object(Oi["createElementVNode"])("tr",null,[Object(Oi["createElementVNode"])("th",null,[Object(Oi["createElementVNode"])("span",Pp,[Object(Oi["createElementVNode"])("label",null,[Object(Oi["createElementVNode"])("input",{type:"checkbox",id:"select-plugin-all",onChange:t[1]||(t[1]=function(t){return e.selectAll(t.target.checked)})},null,32),Dp])])]),Object(Oi["createElementVNode"])("th",null,Object(Oi["toDisplayString"])(e.translate("General_Plugin")),1),Object(Oi["createElementVNode"])("th",Bp,Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_Version")),1),Object(Oi["createElementVNode"])("th",null,Object(Oi["toDisplayString"])(e.translate("General_Description")),1),Object(Oi["createElementVNode"])("th",$p,Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_Status")),1),Object(Oi["createElementVNode"])("th",Fp,Object(Oi["toDisplayString"])(e.translate("General_Action")),1)])]),Object(Oi["createElementVNode"])("tbody",_p,[(Object(Oi["openBlock"])(!0),Object(Oi["createElementBlock"])(Oi["Fragment"],null,Object(Oi["renderList"])(e.pluginsHavingUpdate,(function(n,r){var o;return Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("tr",{key:r,class:Object(Oi["normalizeClass"])(n.isActivated?"active-plugin":"inactive-plugin")},[Object(Oi["createElementVNode"])("td",Lp,[Object(Oi["createElementVNode"])("span",Ip,[Object(Oi["createElementVNode"])("label",null,[Object(Oi["withDirectives"])(Object(Oi["createElementVNode"])("input",{type:"checkbox",id:"select-plugin-".concat(n.name),disabled:"undefined"!==typeof n.isDownloadable&&null!==n.isDownloadable&&!n.isDownloadable,"onUpdate:modelValue":function(t){return e.pluginsSelected[r]=t}},null,8,Up),[[Oi["vModelCheckbox"],e.pluginsSelected[r]]]),Hp])])]),Object(Oi["createElementVNode"])("td",Rp,[Object(Oi["withDirectives"])(Object(Oi["createElementVNode"])("a",{onClick:t[2]||(t[2]=Object(Oi["withModifiers"])((function(){}),["prevent"])),class:"plugin-details"},[Object(Oi["createTextVNode"])(Object(Oi["toDisplayString"])(n.name),1)],512),[[l,{pluginName:n.name}]])]),Object(Oi["createElementVNode"])("td",qp,[null!==(o=n.changelog)&&void 0!==o&&o.url?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("a",{key:0,href:n.changelog.url,title:e.translate("CorePluginsAdmin_Changelog"),target:"_blank",rel:"noreferrer noopener"},Object(Oi["toDisplayString"])(n.currentVersion)+" => "+Object(Oi["toDisplayString"])(n.latestVersion),9,zp)):(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",Wp,Object(Oi["toDisplayString"])(n.currentVersion)+" => "+Object(Oi["toDisplayString"])(n.latestVersion),1))]),Object(Oi["createElementVNode"])("td",Jp,[Object(Oi["createTextVNode"])(Object(Oi["toDisplayString"])(n.description)+" ",1),Object(Oi["createVNode"])(a,{plugin:n},null,8,["plugin"])]),Object(Oi["createElementVNode"])("td",Gp,Object(Oi["toDisplayString"])(n.isActivated?e.translate("CorePluginsAdmin_Active"):e.translate("CorePluginsAdmin_Inactive")),1),Object(Oi["createElementVNode"])("td",Kp,["undefined"===typeof n.isDownloadable||null===n.isDownloadable||n.isDownloadable?e.isMultiServerEnvironment?Object(Oi["withDirectives"])((Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("a",{key:1,onClick:t[3]||(t[3]=function(t){return e.isPluginDownloadLinkClicked=!0}),href:e.downloadPluginLink(n)},Object(Oi["toDisplayString"])(e.translate("General_Download")),9,Zp)),[[Oi["vShow"],!e.isPluginDownloadLinkClicked]]):0===n.missingRequirements.length?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("a",{key:2,href:e.updatePluginLink(n)},Object(Oi["toDisplayString"])(e.translate("CoreUpdater_UpdateTitle")),9,Xp)):(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",Qp,"-")):(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("span",{key:0,title:"".concat(e.translate("CorePluginsAdmin_PluginNotDownloadable")," ").concat(n.isPaid?e.translate("CorePluginsAdmin_PluginNotDownloadablePaidReason"):"")},Object(Oi["toDisplayString"])(e.translate("CorePluginsAdmin_NotDownloadable")),9,Yp))])],2)})),128))])],512),[[c]])]})),_:1},8,["content-title"])):Object(Oi["createCommentVNode"])("",!0)}function td(e,t){return ad(e)||id(e,t)||rd(e,t)||nd()}function nd(){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 rd(e,t){if(e){if("string"===typeof e)return od(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)?od(e,t):void 0}}function od(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function id(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done);a=!0)if(i.push(r.value),t&&i.length===t)break}catch(l){s=!0,o=l}finally{try{a||null==n["return"]||n["return"]()}finally{if(s)throw o}}return i}}function ad(e){if(Array.isArray(e))return e}var sd=Object(Ci["useExternalPluginComponent"])("Marketplace","MissingReqsNotice"),ld=Object(Oi["defineComponent"])({props:{pluginsHavingUpdate:{type:Object,required:!0},pluginUpdateNonces:{type:Object,required:!0},updateNonce:{type:String,required:!0},isMultiServerEnvironment:Boolean},components:{ContentBlock:Ci["ContentBlock"],MissingReqsNotice:sd},directives:{ContentTable:Ci["ContentTable"],PluginName:Ic},data:function(){return{isUpdating:!1,isPluginDownloadLinkClicked:!1,pluginsSelected:{}}},computed:{isUpdateLinkDisabled:function(){return this.isUpdating||!Object.keys(this.pluginsSelected).length||!Object.values(this.pluginsSelected).some((function(e){return!!e}))}},methods:{selectAll:function(e){var t=this,n=this.pluginsHavingUpdate;Object.entries(n).forEach((function(n){var r=td(n,2),o=r[0],i=r[1];(null===i.isDownloadable||"undefined"===typeof i.isDownloadable||i.isDownloadable)&&(t.pluginsSelected[o]=e)}))},downloadPluginLink:function(e){return"?".concat(Ci["MatomoUrl"].stringify(Object.assign(Object.assign({},Ci["MatomoUrl"].urlParsed.value),{},{module:"Marketplace",action:"download",pluginName:e.name,nonce:this.pluginUpdateNonces[e.name]})))},updatePluginLink:function(e){return"?".concat(Ci["MatomoUrl"].stringify(Object.assign(Object.assign({},Ci["MatomoUrl"].urlParsed.value),{},{module:"Marketplace",action:"updatePlugin",pluginName:e.name,nonce:this.updateNonce})))},updateSelectedPlugins:function(){this.isUpdating=!0;var e=Object.entries(this.pluginsSelected).filter((function(e){var t=td(e,2),n=t[1];return n})).map((function(e){var t=td(e,1),n=t[0];return n}));Ci["MatomoUrl"].updateUrl(Object.assign(Object.assign({},Ci["MatomoUrl"].urlParsed.value),{},{module:"Marketplace",action:"updatePlugin",nonce:this.updateNonce,pluginName:e.join(",")}))}}});ld.render=ed;var cd=ld,ud={class:"ui-confirm",id:"installPluginByUpload"},pd={key:0},dd={class:"description"},fd=["action"],md=["data-max-size"],hd=Object(Oi["createElementVNode"])("br",null,null,-1),gd=["value"],bd={key:1},yd=["innerHTML"],vd=Object(Oi["createElementVNode"])("pre",null,"[General]\n enable_plugin_upload = 1",-1),Od=["value"];function wd(e,t,n,r,o,i){var a=Object(Oi["resolveComponent"])("Field"),s=Object(Oi["resolveDirective"])("plugin-upload");return Object(Oi["withDirectives"])((Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",ud,[Object(Oi["createElementVNode"])("h2",null,Object(Oi["toDisplayString"])(e.translate("Marketplace_TeaserExtendPiwikByUpload")),1),e.isPluginUploadEnabled?(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",pd,[Object(Oi["createElementVNode"])("p",dd,Object(Oi["toDisplayString"])(e.translate("Marketplace_AllowedUploadFormats")),1),Object(Oi["createElementVNode"])("form",{enctype:"multipart/form-data",method:"post",id:"uploadPluginForm",action:e.uploadPluginAction},[Object(Oi["createElementVNode"])("input",{type:"file",name:"pluginZip","data-max-size":e.uploadLimit},null,8,md),hd,Object(Oi["createVNode"])(a,{uicontrol:"password",name:"confirmPassword",autocomplete:"off",title:e.translate("Login_ConfirmPasswordToContinue"),modelValue:e.confirmPassword,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.confirmPassword=t})},null,8,["title","modelValue"]),Object(Oi["createElementVNode"])("input",{class:"startUpload btn",type:"submit",value:e.translate("Marketplace_UploadZipFile")},null,8,gd)],8,fd)])):(Object(Oi["openBlock"])(),Object(Oi["createElementBlock"])("div",bd,[Object(Oi["createElementVNode"])("p",{class:"description",innerHTML:e.$sanitize(e.translate("Marketplace_PluginUploadDisabled"))},null,8,yd),vd,Object(Oi["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Ok")},null,8,Od)]))],512)),[[s]])}var jd=Object(Oi["defineComponent"])({props:{isPluginUploadEnabled:Boolean,uploadLimit:[String,Number],installNonce:String},components:{Field:ll},directives:{PluginUpload:fc},data:function(){return{confirmPassword:""}},computed:{uploadPluginAction:function(){return"?".concat(Ci["MatomoUrl"].stringify(Object.assign(Object.assign({},Ci["MatomoUrl"].urlParsed.value),{},{module:"CorePluginsAdmin",action:"uploadPlugin",nonce:this.installNonce})))}}});jd.render=wd;var Nd=jd; /*! * Matomo - free/libre analytics platform * diff --git a/plugins/CorePluginsAdmin/vue/src/Field/Field.adapter.ts b/plugins/CorePluginsAdmin/vue/src/Field/Field.adapter.ts deleted file mode 100644 index 209428c76a..0000000000 --- a/plugins/CorePluginsAdmin/vue/src/Field/Field.adapter.ts +++ /dev/null @@ -1,238 +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 - */ - -import { INgModelController, IScope, ITimeoutService } from 'angular'; -import { nextTick, shallowRef } from 'vue'; -import { - createAngularJsAdapter, - transformAngularJsBoolAttr, - transformAngularJsIntAttr, - removeAngularJsSpecificProperties, - Matomo, - useExternalPluginComponent, -} from 'CoreHome'; -import Field from './Field.vue'; -import FieldAngularJsTemplate from '../FormField/FieldAngularJsTemplate.vue'; - -function handleJsonValue(value: unknown, varType: string, uiControl: string): unknown { - if (typeof value === 'string' - && value - && (varType === 'array' - || uiControl === 'multituple' - || uiControl === 'field-array' - || uiControl === 'multiselect' - || uiControl === 'site') - ) { - const result = JSON.parse(value); - - // the angularjs site field supplied siteid/sitename properties which initializes the - // siteselector value. the sitename is assumed to be encoded, and is decoded once. - // so the value for 'site' Field's in angularjs is assumed to be encoded. - if (uiControl === 'site') { - result.name = Matomo.helper.htmlDecode(result.name); - } - - return result; - } - - if (uiControl === 'checkbox' && varType !== 'array') { - return transformAngularJsBoolAttr(value); - } - - return value; -} - -interface ExternalComponentRef { - plugin: string; - name: string; -} - -export default createAngularJsAdapter<[ITimeoutService]>({ - component: Field, - require: '?ngModel', - scope: { - uicontrol: { - angularJsBind: '@', - }, - name: { - angularJsBind: '@', - }, - value: { - vue: 'modelValue', - angularJsBind: '@', - // eslint-disable-next-line @typescript-eslint/no-explicit-any - transform(value: unknown, vm: unknown, scope: any): unknown { - // vue components expect object data as input, so we parse JSON data - // for angularjs directives that use JSON. - return handleJsonValue(value, scope.varType, scope.uicontrol); - }, - }, - default: { - vue: 'defaultValue', - angularJsBind: '@', - }, - options: { - angularJsBind: '=', - }, - description: { - angularJsBind: '@', - }, - introduction: { - angularJsBind: '@', - }, - title: { - angularJsBind: '@', - }, - inlineHelp: { - angularJsBind: '@', - }, - disabled: { - angularJsBind: '=', - transform: transformAngularJsBoolAttr, - }, - uiControlAttributes: { - angularJsBind: '=', - }, - uiControlOptions: { - angularJsBind: '=', - }, - autocomplete: { - angularJsBind: '@', - transform: transformAngularJsBoolAttr, - }, - condition: { - angularJsBind: '@', - transform( - value: unknown, - vm: unknown, - scope: IScope, - ): ((values: unknown[]) => boolean)|undefined { - if (!value) { - return undefined; - } - - return (values: unknown[]) => (scope.$eval(value as string, values) as boolean); - }, - }, - varType: { - angularJsBind: '@', - }, - autofocus: { - angularJsBind: '@', - transform: transformAngularJsBoolAttr, - }, - tabindex: { - angularJsBind: '@', - transform: transformAngularJsIntAttr, - }, - fullWidth: { - angularJsBind: '@', - transform: transformAngularJsBoolAttr, - }, - maxlength: { - angularJsBind: '@', - transform: transformAngularJsIntAttr, - }, - required: { - angularJsBind: '@', - transform: transformAngularJsBoolAttr, - }, - placeholder: { - angularJsBind: '@', - }, - rows: { - angularJsBind: '@', - transform: transformAngularJsIntAttr, - }, - min: { - angularJsBind: '@', - transform: transformAngularJsIntAttr, - }, - max: { - angularJsBind: '@', - transform: transformAngularJsIntAttr, - }, - component: { - angularJsBind: '<', - // eslint-disable-next-line @typescript-eslint/no-explicit-any - transform(value: unknown, vm: unknown, scope: any) { - if (!value) { - return undefined; - } - - if (scope.templateFile) { - return shallowRef(FieldAngularJsTemplate); - } - - const { plugin, name } = value as ExternalComponentRef; - if (!plugin || !name) { - throw new Error('Invalid component property given to piwik-field directive, must ' - + 'be {plugin: \'...\',name: \'...\'}'); - } - - return shallowRef(useExternalPluginComponent(plugin, name)); - }, - }, - }, - directiveName: 'piwikField', - $inject: ['$timeout'], - events: { - 'update:modelValue': (newValue, vm, scope, element, attrs, ngModel, $timeout) => { - const currentValue = ngModel ? ngModel.$viewValue : scope.value; - if (newValue !== currentValue) { - $timeout(() => { - if (!ngModel) { - scope.value = newValue; - return; - } - - // ngModel being used - (ngModel as INgModelController).$setViewValue(newValue); - (ngModel as INgModelController).$render(); // not detected by the watch for some reason - }); - } - }, - }, - postCreate(vm, scope, element, attrs, controller) { - const ngModel = controller as INgModelController; - - if (!ngModel) { - scope.$watch('value', (newVal: unknown) => { - if (newVal !== vm.modelValue) { - const transformed = handleJsonValue(newVal, scope.varType, scope.uicontrol); - - nextTick(() => { - vm.modelValue = transformed; - }); - } - }); - return; - } - - // ngModel being used - ngModel.$render = () => { - nextTick(() => { - vm.modelValue = removeAngularJsSpecificProperties(ngModel.$viewValue); - }); - }; - - if (typeof scope.value !== 'undefined') { - const transformed = handleJsonValue(scope.value, scope.varType, scope.uicontrol); - (ngModel as INgModelController).$setViewValue(transformed); - } else { - ngModel.$setViewValue(vm.modelValue); - } - - // to provide same behavior in angularjs/<4.6.0, we trigger a model update to the same - // value, but only for 'site' uicontrols. this only happened for site selectors, no others. - if (scope.uicontrol === 'site' && ngModel.$viewValue) { - setTimeout(() => { - ngModel.$setViewValue({ ...ngModel.$viewValue }); - }); - } - }, -}); diff --git a/plugins/CorePluginsAdmin/vue/src/FormField/FieldAngularJsTemplate.vue b/plugins/CorePluginsAdmin/vue/src/FormField/FieldAngularJsTemplate.vue deleted file mode 100644 index c608e33682..0000000000 --- a/plugins/CorePluginsAdmin/vue/src/FormField/FieldAngularJsTemplate.vue +++ /dev/null @@ -1,104 +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 ---> - -<template> - <div ref="root"/> -</template> - -<script lang="ts"> -import { - defineComponent, - ref, - watch, - onMounted, -} from 'vue'; -import { Matomo } from 'CoreHome'; - -function clone<T>(obj?: T): T|undefined { - if (typeof obj === 'undefined') { - return undefined; - } - - return JSON.parse(JSON.stringify(obj)); -} - -export default defineComponent({ - props: { - modelValue: null, - formField: { - type: null, - required: true, - }, - templateFile: { - type: String, - required: true, - }, - }, - emits: ['update:modelValue'], - inheritAttrs: false, - setup(props, context) { - const root = ref(null); - - const $element = window.$( - `<div ng-include="'${props.templateFile}?cb=${Matomo.cacheBuster}'"></div>`, - ); - - const $timeout = Matomo.helper.getAngularDependency('$timeout'); - const $rootScope = Matomo.helper.getAngularDependency('$rootScope'); - - const scope = $rootScope.$new(); - scope.formField = { - ...clone(props.formField), - value: clone(props.modelValue), - }; - - scope.$watch('formField.value', (newValue: unknown, oldValue: unknown) => { - if (newValue !== oldValue - && JSON.stringify(newValue) !== JSON.stringify(props.modelValue) - ) { - context.emit('update:modelValue', clone(newValue)); - } - }); - - watch(() => props.modelValue, (newValue) => { - if (JSON.stringify(newValue) !== JSON.stringify(scope.formField.value)) { - $timeout(() => { - scope.formField.value = newValue; - }); - } - }); - - watch(() => props.formField, (newValue) => { - $timeout(() => { - const currentValue = scope.formField.value; - scope.formField = { - ...clone(newValue), - value: currentValue, - }; - }); - }, { deep: true }); - - // append on mount - onMounted(() => { - window.$(root.value! as HTMLElement).append($element); - - Matomo.helper.compileAngularComponents($element, { - scope, - params: { - formField: { - ...clone(props.formField), - value: props.modelValue, - }, - }, - }); - }); - - return { - root, - }; - }, -}); -</script> diff --git a/plugins/CorePluginsAdmin/vue/src/FormField/FormField.adapter.ts b/plugins/CorePluginsAdmin/vue/src/FormField/FormField.adapter.ts deleted file mode 100644 index fad8f05cf9..0000000000 --- a/plugins/CorePluginsAdmin/vue/src/FormField/FormField.adapter.ts +++ /dev/null @@ -1,150 +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 - */ - -import { IScope, ITimeoutService } from 'angular'; -import { - createAngularJsAdapter, - transformAngularJsBoolAttr, - transformAngularJsIntAttr, - useExternalPluginComponent, -} from 'CoreHome'; -import { markRaw } from 'vue'; -import FormField from './FormField.vue'; -import FieldAngularJsTemplate from './FieldAngularJsTemplate.vue'; - -function transformVueComponentRef(value?: Record<string, string>) { - if (!value) { - return undefined; - } - - const { plugin, name } = value; - if (!plugin || !name) { - throw new Error('Invalid component property given to piwik-field directive, must be ' - + '{plugin: \'...\',name: \'...\'}'); - } - - return useExternalPluginComponent(plugin, name); -} - -interface Setting { - name: string; - value: unknown; -} - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function conditionFn(scope: any, condition: string) { - const values: Record<string, unknown> = {}; - Object.values((scope.allSettings || {}) as Record<string, Setting>).forEach((setting) => { - if (setting.value === '0') { - values[setting.name] = 0; - } else { - values[setting.name] = setting.value; - } - }); - - return scope.$eval(condition, values); -} - -export default createAngularJsAdapter<[ITimeoutService]>({ - component: FormField, - scope: { - modelValue: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - default(scope: any) { - const field = scope.piwikFormField; - - // vue components expect object data as input, so we parse JSON data - // for angularjs directives that use JSON. - if (typeof field.value === 'string' - && field.value - && (field.type === 'array' - || field.uiControl === 'multituple' - || field.uiControl === 'field-array' - || field.uiControl === 'multiselect' - || field.uiControl === 'site') - ) { - field.value = JSON.parse(field.value); - } - - if (field.uiControl === 'checkbox') { - return transformAngularJsBoolAttr(field.value); - } - return field.value; - }, - }, - piwikFormField: { - vue: 'formField', - angularJsBind: '=', - transform(v: unknown, vm: unknown, scope: IScope) { - const value = v as Record<string, unknown>; - - function getComponent() { - if (value.templateFile) { - return markRaw(FieldAngularJsTemplate); - } - - const comp = transformVueComponentRef(value.component as Record<string, string>); - if (!comp) { - return undefined; - } - - return markRaw(comp); - } - - return { - ...value, - condition: value.condition - ? conditionFn.bind(null, scope, value.condition as string) - : value.condition, - disabled: transformAngularJsBoolAttr(value.disabled), - autocomplete: transformAngularJsBoolAttr(value.autocomplete), - autofocus: transformAngularJsBoolAttr(value.autofocus), - tabindex: transformAngularJsIntAttr(value.tabindex), - fullWidth: transformAngularJsBoolAttr(value.fullWidth), - maxlength: transformAngularJsIntAttr(value.maxlength), - required: transformAngularJsBoolAttr(value.required), - rows: transformAngularJsIntAttr(value.rows), - min: transformAngularJsIntAttr(value.min), - max: transformAngularJsIntAttr(value.max), - component: getComponent(), - }; - }, - }, - allSettings: { - angularJsBind: '=', - }, - }, - directiveName: 'piwikFormField', - events: { - 'update:modelValue': (newValue, vm, scope, element, attrs, controller, $timeout) => { - if (newValue !== scope.piwikFormField.value) { - $timeout(() => { - scope.piwikFormField.value = newValue; - }); - } - }, - }, - $inject: ['$timeout'], - postCreate(vm, scope) { - scope.$watch('piwikFormField.value', (newVal: unknown, oldVal: unknown) => { - if (newVal !== oldVal) { - vm.modelValue = newVal; - } - }); - - // deep watch for all settings, on change trigger change in formfield property - // so condition is re-applied - scope.$watch('allSettings', () => { - vm.formField = { - ...vm.formField, - condition: scope.piwikFormField.condition - ? conditionFn.bind(null, scope, scope.piwikFormField.condition as string) - : scope.piwikFormField.condition, - }; - }, true); - }, -}); diff --git a/plugins/CorePluginsAdmin/vue/src/FormField/FormField.vue b/plugins/CorePluginsAdmin/vue/src/FormField/FormField.vue index ddf416f220..f5c654677d 100644 --- a/plugins/CorePluginsAdmin/vue/src/FormField/FormField.vue +++ b/plugins/CorePluginsAdmin/vue/src/FormField/FormField.vue @@ -104,7 +104,6 @@ import FieldTextArray from './FieldTextArray.vue'; import FieldTextarea from './FieldTextarea.vue'; import FieldTextareaArray from './FieldTextareaArray.vue'; import { processCheckboxAndRadioAvailableValues } from './utilities'; -import FieldAngularJsTemplate from './FieldAngularJsTemplate.vue'; const TEXT_CONTROLS = ['password', 'url', 'search', 'email']; const CONTROLS_SUPPORTING_ARRAY = ['textarea', 'checkbox', 'text']; @@ -244,7 +243,7 @@ export default defineComponent({ if ((formField.component as ComponentReference).plugin) { const { plugin, name } = formField.component as ComponentReference; if (!plugin || !name) { - throw new Error('Invalid component property given to piwik-field directive, must be ' + throw new Error('Invalid component property given to FormField directive, must be ' + '{plugin: \'...\',name: \'...\'}'); } @@ -254,11 +253,6 @@ export default defineComponent({ return markRaw(component); } - // backwards compatibility w/ settings that use templateFile property - if (formField.templateFile) { - return markRaw(FieldAngularJsTemplate); - } - const { uiControl } = formField; let control = CONTROL_TO_COMPONENT_MAP[uiControl]; diff --git a/plugins/CorePluginsAdmin/vue/src/GroupedSettings/GroupedSetting.vue b/plugins/CorePluginsAdmin/vue/src/GroupedSettings/GroupedSetting.vue index 31619c629b..f88774cae8 100644 --- a/plugins/CorePluginsAdmin/vue/src/GroupedSettings/GroupedSetting.vue +++ b/plugins/CorePluginsAdmin/vue/src/GroupedSettings/GroupedSetting.vue @@ -9,7 +9,7 @@ <FormField :model-value="modelValue" @update:model-value="changeValue($event)" - :form-field="settingWithComponent" + :form-field="setting" /> </div> </template> @@ -17,7 +17,6 @@ <script lang="ts"> import { defineComponent } from 'vue'; import FormField from '../FormField/FormField.vue'; -import FieldAngularJsTemplate from '../FormField/FieldAngularJsTemplate.vue'; import expressions from '../expressions'; export default defineComponent({ @@ -37,17 +36,6 @@ export default defineComponent({ }, emits: ['update:modelValue'], computed: { - // bc for angularjs field that uses templateFile - settingWithComponent() { - if (this.setting.templateFile) { - return { - ...this.setting, - component: FieldAngularJsTemplate, - }; - } - - return this.setting; - }, showField() { let condition = this.setting.condition as string; if (!condition) { diff --git a/plugins/CorePluginsAdmin/vue/src/PluginSettings/PluginSettings.adapter.ts b/plugins/CorePluginsAdmin/vue/src/PluginSettings/PluginSettings.adapter.ts deleted file mode 100644 index 30dace60e2..0000000000 --- a/plugins/CorePluginsAdmin/vue/src/PluginSettings/PluginSettings.adapter.ts +++ /dev/null @@ -1,19 +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 - */ - -import { createAngularJsAdapter } from 'CoreHome'; -import PluginSettings from './PluginSettings.vue'; - -export default createAngularJsAdapter({ - component: PluginSettings, - scope: { - mode: { - angularJsBind: '@', - }, - }, - directiveName: 'piwikPluginSettings', -}); diff --git a/plugins/CorePluginsAdmin/vue/src/PluginSettings/PluginSettings.vue b/plugins/CorePluginsAdmin/vue/src/PluginSettings/PluginSettings.vue index f1bd21b19f..304fe296e9 100644 --- a/plugins/CorePluginsAdmin/vue/src/PluginSettings/PluginSettings.vue +++ b/plugins/CorePluginsAdmin/vue/src/PluginSettings/PluginSettings.vue @@ -51,6 +51,7 @@ import { AjaxHelper, NotificationsStore, translate, + scrollToAnchorInUrl, } from 'CoreHome'; import Setting from './Setting'; import SettingsForSinglePlugin from './SettingsForSinglePlugin'; @@ -100,7 +101,7 @@ export default defineComponent({ }); }); - window.anchorLinkFix.scrollToAnchorInUrl(); + scrollToAnchorInUrl(); this.addSectionsToTableOfContents(); }).catch(() => { diff --git a/plugins/CorePluginsAdmin/vue/src/Plugins/PluginFilter.adapter.ts b/plugins/CorePluginsAdmin/vue/src/Plugins/PluginFilter.adapter.ts deleted file mode 100644 index 521477bd7a..0000000000 --- a/plugins/CorePluginsAdmin/vue/src/Plugins/PluginFilter.adapter.ts +++ /dev/null @@ -1,20 +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 - */ - -import { IDirective, IScope } from 'angular'; -import PluginFilter from './PluginFilter'; - -export default function piwikPluginFilter(): IDirective { - return { - restrict: 'A', - link: function expandOnClickLink(scope: IScope, element: JQuery) { - PluginFilter.mounted(element[0]); - }, - }; -} - -window.angular.module('piwikApp').directive('piwikPluginFilter', piwikPluginFilter); diff --git a/plugins/CorePluginsAdmin/vue/src/Plugins/PluginManagement.adapter.ts b/plugins/CorePluginsAdmin/vue/src/Plugins/PluginManagement.adapter.ts deleted file mode 100644 index 86fc15f318..0000000000 --- a/plugins/CorePluginsAdmin/vue/src/Plugins/PluginManagement.adapter.ts +++ /dev/null @@ -1,28 +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 - */ - -import { IDirective, IScope } from 'angular'; -import PluginManagement from './PluginManagement'; - -export default function piwikPluginManagement(): IDirective { - return { - restrict: 'A', - link: function expandOnClickLink(scope: IScope, element: JQuery) { - const binding = { - instance: null, - value: {}, - oldValue: null, - modifiers: {}, - dir: {}, - }; - - PluginManagement.mounted(element[0], binding); - }, - }; -} - -window.angular.module('piwikApp').directive('piwikPluginManagement', piwikPluginManagement); diff --git a/plugins/CorePluginsAdmin/vue/src/Plugins/PluginUpload.adapter.ts b/plugins/CorePluginsAdmin/vue/src/Plugins/PluginUpload.adapter.ts deleted file mode 100644 index 251585ec1f..0000000000 --- a/plugins/CorePluginsAdmin/vue/src/Plugins/PluginUpload.adapter.ts +++ /dev/null @@ -1,20 +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 - */ - -import { IDirective } from 'angular'; -import PluginUpload from './PluginUpload'; - -export default function piwikPluginUpload(): IDirective { - return { - restrict: 'A', - link: function expandOnClickLink() { - PluginUpload.mounted(); - }, - }; -} - -window.angular.module('piwikApp').directive('piwikPluginUpload', piwikPluginUpload); diff --git a/plugins/CorePluginsAdmin/vue/src/SaveButton/SaveButton.adapter.ts b/plugins/CorePluginsAdmin/vue/src/SaveButton/SaveButton.adapter.ts deleted file mode 100644 index b991c2912f..0000000000 --- a/plugins/CorePluginsAdmin/vue/src/SaveButton/SaveButton.adapter.ts +++ /dev/null @@ -1,38 +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 - */ - -import { ITimeoutService } from 'angular'; -import { createAngularJsAdapter } from 'CoreHome'; -import SaveButton from './SaveButton.vue'; - -export default createAngularJsAdapter<[ITimeoutService]>({ - component: SaveButton, - scope: { - saving: { - angularJsBind: '=?', - }, - value: { - angularJsBind: '@?', - }, - disabled: { - angularJsBind: '=?', - }, - onconfirm: { - angularJsBind: '&?', - vue: 'confirm', - }, - }, - events: { - confirm($event, vm, scope, element, attrs, controller, $timeout) { - element[0].click(); // this directive can be used on input's with ng-click specified - $timeout(); - }, - }, - replace: true, - directiveName: 'piwikSaveButton', - $inject: ['$timeout'], -}); diff --git a/plugins/CorePluginsAdmin/vue/src/ThemesIntro/ThemesIntro.vue b/plugins/CorePluginsAdmin/vue/src/ThemesIntro/ThemesIntro.vue new file mode 100644 index 0000000000..13e6343f97 --- /dev/null +++ b/plugins/CorePluginsAdmin/vue/src/ThemesIntro/ThemesIntro.vue @@ -0,0 +1,73 @@ +<!-- + Matomo - free/libre analytics platform + @link https://matomo.org + @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later +--> + +<template> + <div v-content-intro> + <h2> + <EnrichedHeadline>{{ translate('CorePluginsAdmin_ThemesManagement') }}</EnrichedHeadline> + </h2> + + <p> + {{ translate('CorePluginsAdmin_ThemesDescription') }} + + <span v-if="isMarketplaceEnabled" v-html="$sanitize(teaserExtendByThemeText)"></span> + + <span v-if="otherUsersCount > 0"> + <br/> + {{ translate( + 'CorePluginsAdmin_InfoThemeIsUsedByOtherUsersAsWell', + otherUsersCount, + themeEnabled, + ) }} + </span> + + <span v-if="!isPluginsAdminEnabled"> + <br/>{{ translate('CorePluginsAdmin_DoMoreContactPiwikAdmins') }} + </span> + </p> + </div> +</template> + +<script lang="ts"> +import { defineComponent } from 'vue'; +import { + translate, + EnrichedHeadline, + ContentIntro, + MatomoUrl, +} from 'CoreHome'; + +export default defineComponent({ + props: { + isMarketplaceEnabled: Boolean, + otherUsersCount: Number, + themeEnabled: Boolean, + isPluginsAdminEnabled: Boolean, + }, + components: { + EnrichedHeadline, + }, + directives: { + ContentIntro, + }, + computed: { + teaserExtendByThemeText() { + const link = `?${MatomoUrl.stringify({ + ...MatomoUrl.urlParsed.value, + module: 'Marketplace', + action: 'overview', + sort: '', + show: 'themes', + })}`; + return translate( + 'CorePluginsAdmin_TeaserExtendPiwikByTheme', + `<a href="${link}">`, + '</a>', + ); + }, + }, +}); +</script> diff --git a/plugins/CorePluginsAdmin/vue/src/index.ts b/plugins/CorePluginsAdmin/vue/src/index.ts index fa0dc889d8..93377a382a 100644 --- a/plugins/CorePluginsAdmin/vue/src/index.ts +++ b/plugins/CorePluginsAdmin/vue/src/index.ts @@ -5,15 +5,6 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -import './FormField/FormField.adapter'; -import './Field/Field.adapter'; -import './PluginSettings/PluginSettings.adapter'; -import './Plugins/PluginManagement.adapter'; -import './Plugins/PluginUpload.adapter'; -import './Plugins/PluginFilter.adapter'; -import './SaveButton/SaveButton.adapter'; -import './Form/Form.adapter'; - export { default as expressions } from './expressions'; export { default as AbortableEvent } from './FormField/AbortableEvent'; export { default as FormField } from './FormField/FormField.vue'; @@ -27,8 +18,9 @@ export { default as PluginUpload } from './Plugins/PluginUpload'; export { default as SaveButton } from './SaveButton/SaveButton.vue'; export { default as Form } from './Form/Form'; export { default as GroupedSettings } from './GroupedSettings/GroupedSettings.vue'; -export { default as PasswordConfirmation } from './PasswordConfirmation/PasswordConfirmation.vue'; export { default as PluginsIntro } from './PluginsIntro/PluginsIntro.vue'; +export { default as ThemesIntro } from './ThemesIntro/ThemesIntro.vue'; +export { default as PasswordConfirmation } from './PasswordConfirmation/PasswordConfirmation.vue'; export { default as PluginName } from './Plugins/PluginName'; export { default as PluginsTable } from './PluginsTable/PluginsTable.vue'; export { default as PluginsTableWithUpdates } from './PluginsTable/PluginsTableWithUpdates.vue'; diff --git a/plugins/CoreUpdater/Controller.php b/plugins/CoreUpdater/Controller.php index c33e6a674b..df1de9f929 100644 --- a/plugins/CoreUpdater/Controller.php +++ b/plugins/CoreUpdater/Controller.php @@ -106,12 +106,6 @@ class Controller extends \Piwik\Plugin\Controller 'node_modules/angular-animate/angular-animate.min.js', 'node_modules/angular-cookies/angular-cookies.min.js', 'node_modules/ng-dialog/js/ngDialog.min.js', - 'plugins/CoreHome/angularjs/common/services/service.module.js', - 'plugins/CoreHome/angularjs/common/filters/filter.module.js', - 'plugins/CoreHome/angularjs/common/filters/translate.js', - 'plugins/CoreHome/angularjs/common/directives/directive.module.js', - 'plugins/CoreHome/angularjs/piwikApp.config.js', - 'plugins/CoreHome/angularjs/piwikApp.js', 'plugins/Installation/javascripts/installation.js', ); diff --git a/plugins/CoreUpdater/templates/layout.twig b/plugins/CoreUpdater/templates/layout.twig index a78aff6603..b7cdde7ca3 100644 --- a/plugins/CoreUpdater/templates/layout.twig +++ b/plugins/CoreUpdater/templates/layout.twig @@ -1,5 +1,5 @@ <!DOCTYPE html> -<html id="ng-app" ng-app="piwikApp"> +<html id="ng-app"> <head> <meta charset="utf-8"> <title>Matomo › {{ pageTitle|default('CoreUpdater_UpdateTitle'|translate) }}</title> @@ -17,7 +17,7 @@ {% include "@CoreHome/_favicon.twig" %} {% include "@CoreHome/_applePinnedTabIcon.twig" %} </head> -<body id="simple" ng-app="app"> +<body id="simple"> {% include "@CoreHome/_logo.twig" with { 'logoLink': false } %} diff --git a/plugins/CoreVue/Commands/Build.php b/plugins/CoreVue/Commands/Build.php index 6e030b9684..f7f00689f3 100644 --- a/plugins/CoreVue/Commands/Build.php +++ b/plugins/CoreVue/Commands/Build.php @@ -29,6 +29,7 @@ class Build extends ConsoleCommand $this->setName('vue:build'); $this->setDescription('Builds vue modules for one or more plugins.'); $this->addArgument('plugins', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Plugins whose vue modules to build. Defaults to all plugins.', []); + $this->addOption('bail', null, InputOption::VALUE_NONE, 'If supplied, will exit immediately.'); $this->addOption('watch', null, InputOption::VALUE_NONE, 'If supplied, will watch for changes and automatically rebuild.'); $this->addOption('clear-webpack-cache', null, InputOption::VALUE_NONE); $this->addOption('print-build-command', null, InputOption::VALUE_NONE); @@ -55,6 +56,8 @@ class Build extends ConsoleCommand $plugins = $input->getArgument('plugins'); if (empty($plugins)) { $plugins = $this->getAllPluginsWithVueLibrary(); + $output->writeln("<info>Going to build all plugins with Vue libraries: " + . implode(', ', $plugins)); } else { $plugins = $this->filterPluginsWithoutVueLibrary($plugins); if (empty($plugins)) { @@ -69,7 +72,9 @@ class Build extends ConsoleCommand // remove webpack cache since it can result in strange builds if present Filesystem::unlinkRecursive(PIWIK_INCLUDE_PATH . '/node_modules/.cache', true); - $failed = $this->build($output, $plugins, $printBuildCommand, $watch); + $bail = $input->getOption('bail'); + + $failed = $this->build($output, $plugins, $printBuildCommand, $watch, $bail); return $failed; } @@ -93,7 +98,7 @@ class Build extends ConsoleCommand return is_file($typeDirectory); } - private function build(OutputInterface $output, $plugins, $printBuildCommand, $watch = false) + private function build(OutputInterface $output, $plugins, $printBuildCommand, $watch = false, $bail = false) { if ($watch) { $this->watch($plugins, $printBuildCommand, $output); @@ -103,7 +108,13 @@ class Build extends ConsoleCommand $failed = 0; foreach ($plugins as $plugin) { - $failed += (int) $this->buildFiles($output, $plugin, $printBuildCommand); + $buildFailed = (int) $this->buildFiles($output, $plugin, $printBuildCommand); + if ($buildFailed && $bail) { + $output->writeln("<error>Build failed, bailing.</error>"); + return $failed; + } + + $failed += $buildFailed; } return $failed; diff --git a/plugins/CoreVue/types/index.d.ts b/plugins/CoreVue/types/index.d.ts index 25c72be634..b5e92c25bb 100644 --- a/plugins/CoreVue/types/index.d.ts +++ b/plugins/CoreVue/types/index.d.ts @@ -78,14 +78,11 @@ declare global { htmlDecode(encoded: string): string; htmlEntities(value: string): string; modalConfirm(element: JQuery|JQLite|HTMLElement|string, callbacks?: ModalConfirmCallbacks, options?: ModalConfirmOptions); - getAngularDependency(eventName: string): any; - isAngularRenderingThePage(): boolean; isReportingPage(): boolean; setMarginLeftToBeInViewport(elementToPosition: JQuery|JQLite|Element|string): void; lazyScrollTo(element: JQuery|JQLite|HTMLElement|string, time: number, forceScroll?: boolean): void; lazyScrollToContent(): void; registerShortcut(key: string, description: string, callback: (event: ExtendedKeyboardEvent) => void): void; - compileAngularComponents(selector: JQuery|JQLite|HTMLElement|string, options?: CompileAngularComponentsOptions): void; compileVueEntryComponents(selector: JQuery|JQLite|HTMLElement|string, extraProps?: Record<string, unknown>): void; destroyVueComponent(selector: JQuery|JQLite|HTMLElement|string): void; compileVueDirectives(selector: JQuery|JQLite|HTMLElement|string): void; @@ -190,10 +187,6 @@ declare global { let widgetsHelper: WidgetsHelper; - interface AnchorLinkFix { - scrollToAnchorInUrl(): void; - } - interface NumberFormatter { formatNumber(value?: number|string): string; formatPercent(value?: number|string): string; @@ -223,7 +216,6 @@ declare global { piwik_translations: {[key: string]: string}; Materialize: M; widgetsHelper: WidgetsHelper; - anchorLinkFix: AnchorLinkFix; $: JQueryStatic; Piwik_Popover: PiwikPopoverGlobal; NumberFormatter: NumberFormatter; diff --git a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable.png b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable.png index a4dd470c6b..6ca30d62b8 100644 --- a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable.png +++ b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:42d192b4ea98d5a6c6e5cb3291bf2eea2bd886a74b9214c6aa534971b1a3f103 -size 54885 +oid sha256:b13994522075161c058dda7f6f019198b32b2545d2a5590706ce15333b599ca7 +size 54886 diff --git a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable_rowevolution.png b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable_rowevolution.png index 416b66d07d..810c2bc2e6 100644 --- a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable_rowevolution.png +++ b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable_rowevolution.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6368680ecc7e5982ddd961fe1b3dc1d257d68879d2122f8e382e15de21679391 -size 74140 +oid sha256:91ad4883d9f2b20eed5ad0a3a777bb0252e0c310b2628725ebe79058f600dccd +size 74132 diff --git a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable_segmented_visitor_log.png b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable_segmented_visitor_log.png index 4dcc9308e6..55e4227273 100644 --- a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable_segmented_visitor_log.png +++ b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_action_subtable_segmented_visitor_log.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8cd810533b88947f657a22e365eea118bb1b7cbc3a221a2c80c1c8e630e8d8af -size 84656 +oid sha256:f70a38b9525e25077f82abf74a0de41c1d336e84552596ac5671747239d30a13 +size 84675 diff --git a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_actions_rowactions.png b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_actions_rowactions.png index 3037818e06..4ec8672c2a 100644 --- a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_actions_rowactions.png +++ b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_actions_rowactions.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:878c54d0c81d87a15d6c2dde701bfb0d089012af226c2cbbca4ec0856dfcead8 -size 33333 +oid sha256:daaf3f5ec1dbc0ca8f5c045fa66319ad440681b18c025d4c49616f2950593942 +size 33334 diff --git a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_actions_rowevolution.png b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_actions_rowevolution.png index 65a5718b17..999062764e 100644 --- a/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_actions_rowevolution.png +++ b/plugins/CustomDimensions/tests/UI/expected-screenshots/CustomDimensions_report_actions_rowevolution.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bf25b1aa3ca129e0b54df11e5de08097256e911946a4e4ff086b6d70621773a2 -size 64439 +oid sha256:8b9e33a5c00e2b53d141ddb646abc29c98c4f91013b27844a74149c783e66f99 +size 64428 diff --git a/plugins/Dashboard/javascripts/dashboardWidget.js b/plugins/Dashboard/javascripts/dashboardWidget.js index 84736b3914..1e3f442fc1 100644 --- a/plugins/Dashboard/javascripts/dashboardWidget.js +++ b/plugins/Dashboard/javascripts/dashboardWidget.js @@ -136,7 +136,6 @@ if (currentWidget.parents('body').length) { // there might be race conditions, eg widget might be just refreshed while whole dashboard is also // removed from DOM - piwikHelper.compileAngularComponents($widgetContent); piwikHelper.compileVueEntryComponents($widgetContent); } $widgetContent.removeClass('loading'); diff --git a/plugins/Dashboard/javascripts/widgetMenu.js b/plugins/Dashboard/javascripts/widgetMenu.js index 3e9e3bc9ab..808a6339d9 100644 --- a/plugins/Dashboard/javascripts/widgetMenu.js +++ b/plugins/Dashboard/javascripts/widgetMenu.js @@ -430,7 +430,6 @@ widgetsHelper.loadWidgetAjax = function (widgetUniqueId, widgetParameters, onWid var widgetElement = $(document.getElementById(widgetUniqueId)); // document.getElementById needed for widgets with uniqueid like widgetOpens+Contact+Form $('.widgetContent', widgetElement).html($(response)); - piwikHelper.compileAngularComponents($('.widgetContent', widgetElement)); piwikHelper.compileVueEntryComponents($('.widgetContent', widgetElement)); $('.widgetContent', widgetElement).trigger('widget:create'); settings.onPreviewLoaded(widgetUniqueId, widgetElement); diff --git a/plugins/Dashboard/templates/_header.twig b/plugins/Dashboard/templates/_header.twig index be94af8c55..c6bfc81f02 100644 --- a/plugins/Dashboard/templates/_header.twig +++ b/plugins/Dashboard/templates/_header.twig @@ -1,6 +1,6 @@ {# This header is for loading the dashboard in stand alone mode #} <!DOCTYPE html> -<html id="ng-app" ng-app="piwikApp"> +<html id="ng-app"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex,nofollow"> @@ -11,4 +11,4 @@ {% include "_jsGlobalVariables.twig" %} {% include "_jsCssIncludes.twig" %} </head> -<body id="standalone" ng-app="app"> +<body id="standalone"> diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_small_screen.png b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_small_screen.png index 6fb2c16f5d..a814c5931f 100644 --- a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_small_screen.png +++ b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_small_screen.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:32e67872c09aa07f5070f04dcc6663ede57fc0351bd5efa542ab2129fc424c7a -size 238399 +oid sha256:3519131be1fc570ee2a33e99d1311d5a6a243cf772ec523e58d7caa928b9e556 +size 238398 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_widget_preview.png b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_widget_preview.png index 924fbd55d7..facfc618d1 100644 --- a/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_widget_preview.png +++ b/plugins/Dashboard/tests/UI/expected-screenshots/DashboardManager_widget_preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a0514385854b38ed2b783cfcad5043b7b6d044bfaa218149e2fe303c9c4fda3e -size 78461 +oid sha256:97dc2af7aa04f9e2380883a06cd8c2c674aba325cc79b2175f735871c9d7d6bb +size 78497 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_rowevolution.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_rowevolution.png index 5441f608fa..425ff73ad0 100644 --- a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_rowevolution.png +++ b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_rowevolution.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:acb0bac250eb6a112528a1ea725e5fa31ba7b18d976956f345daa110f1a3b45c -size 71378 +oid sha256:481b6f4ac6f29a187843ee6e8a157c4407817b69231d2962ff6ea07e506f5a9b +size 71377 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_maximise.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_maximise.png index 61383c8b7a..0a90a83196 100644 --- a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_maximise.png +++ b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_maximise.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c70d8380448f17247553e7c0aa51b2c1b5b11982a9739e6784e26ba36f2a2410 -size 32830 +oid sha256:444f3e17430529779001a20e3302b270bd982148da14a27f46564a5b4e449fc8 +size 32820 diff --git a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_unmaximise.png b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_unmaximise.png index 8b373c0cdd..f30918d44d 100644 --- a/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_unmaximise.png +++ b/plugins/Dashboard/tests/UI/expected-screenshots/Dashboard_widget_unmaximise.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fbf725607a824ffa9ab5c0c688c8c20f188fdfd09af755e993ffee66b7e00de2 -size 31073 +oid sha256:d26bbe47bd1f7c60b823e202c63ab3c1c09cb87ef3bb6c1b80d1a080d0578077 +size 31072 diff --git a/plugins/DevicesDetection/vue/src/DetectionPage/DetectionPage.less b/plugins/DevicesDetection/vue/src/DetectionPage/DetectionPage.less index 0c92585ebe..a0b3953342 100644 --- a/plugins/DevicesDetection/vue/src/DetectionPage/DetectionPage.less +++ b/plugins/DevicesDetection/vue/src/DetectionPage/DetectionPage.less @@ -15,7 +15,7 @@ .detection td img { margin-right: 10px; } - + #noclienthints { display: inline-block; } diff --git a/plugins/Goals/tests/UI/expected-screenshots/GoalsPages_individual_row_evolution.png b/plugins/Goals/tests/UI/expected-screenshots/GoalsPages_individual_row_evolution.png index 6201921ddd..558ea557e8 100644 --- a/plugins/Goals/tests/UI/expected-screenshots/GoalsPages_individual_row_evolution.png +++ b/plugins/Goals/tests/UI/expected-screenshots/GoalsPages_individual_row_evolution.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:40b8aa2e147e3f3d012ef827fa680e1629fffd81a7427ff6d06744f92909e13a -size 79278 +oid sha256:894df69edc4a1cedaea1b7b34abb83d5cbeac171433f066a643aa2821d95e026 +size 79266 diff --git a/plugins/Goals/tests/UI/expected-screenshots/GoalsPages_individual_row_evolution_reloaded.png b/plugins/Goals/tests/UI/expected-screenshots/GoalsPages_individual_row_evolution_reloaded.png index 96f11bda6b..6a71ee36ec 100644 --- a/plugins/Goals/tests/UI/expected-screenshots/GoalsPages_individual_row_evolution_reloaded.png +++ b/plugins/Goals/tests/UI/expected-screenshots/GoalsPages_individual_row_evolution_reloaded.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bd0af5841ad6cf391fae350c0212f1e1c149e3f3e70b367e84930e70d15be7f7 -size 59765 +oid sha256:b8dc66c9db9915e5e591017c4646d13673e41196f34fc2eb6ce83074596e9d1e +size 59753 diff --git a/plugins/Goals/tests/UI/expected-screenshots/GoalsPages_overview_row_evolution.png b/plugins/Goals/tests/UI/expected-screenshots/GoalsPages_overview_row_evolution.png index be7b352951..5e25abf754 100644 --- a/plugins/Goals/tests/UI/expected-screenshots/GoalsPages_overview_row_evolution.png +++ b/plugins/Goals/tests/UI/expected-screenshots/GoalsPages_overview_row_evolution.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8c424966632880c030448e4fba43643d099b2a6ae4cf8446dd5c58981f1a7e16 -size 177941 +oid sha256:7b91d7e2959344558311b74bfb5f88df67e5ea084fe374808204bb5d4fa7becc +size 177938 diff --git a/plugins/Goals/tests/UI/expected-screenshots/GoalsPages_overview_row_evolution_reloaded.png b/plugins/Goals/tests/UI/expected-screenshots/GoalsPages_overview_row_evolution_reloaded.png index c2e242f0ad..2813327a86 100644 --- a/plugins/Goals/tests/UI/expected-screenshots/GoalsPages_overview_row_evolution_reloaded.png +++ b/plugins/Goals/tests/UI/expected-screenshots/GoalsPages_overview_row_evolution_reloaded.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2c47a3b38ac92a0a390c0536ac9db15773f80a244787c3ee29535c386a6c810c +oid sha256:bdcc94848f2643c949ac1fefc2c9f40396a465a776dad0b700ac5ea6654a328a size 158468 diff --git a/plugins/Goals/tests/UI/expected-screenshots/Goals_action_goals_row_evolution.png b/plugins/Goals/tests/UI/expected-screenshots/Goals_action_goals_row_evolution.png index 666924af87..b66752f52a 100644 --- a/plugins/Goals/tests/UI/expected-screenshots/Goals_action_goals_row_evolution.png +++ b/plugins/Goals/tests/UI/expected-screenshots/Goals_action_goals_row_evolution.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e14ef0f683d204813182402fc54ce2542e534bd095176d151390bfff65bfba14 -size 69247 +oid sha256:14f657ea08fca961b1f5ddcad7d1407484bf518a4ca9de06d1ad643955f4a907 +size 69246 diff --git a/plugins/Installation/Controller.php b/plugins/Installation/Controller.php index 2ca8310aab..d17a89f28e 100644 --- a/plugins/Installation/Controller.php +++ b/plugins/Installation/Controller.php @@ -556,12 +556,6 @@ class Controller extends \Piwik\Plugin\ControllerAdmin 'node_modules/angular-animate/angular-animate.min.js', 'node_modules/angular-cookies/angular-cookies.min.js', 'node_modules/ng-dialog/js/ngDialog.min.js', - 'plugins/CoreHome/angularjs/common/services/service.module.js', - 'plugins/CoreHome/angularjs/common/filters/filter.module.js', - 'plugins/CoreHome/angularjs/common/filters/translate.js', - 'plugins/CoreHome/angularjs/common/directives/directive.module.js', - 'plugins/CoreHome/angularjs/piwikApp.config.js', - 'plugins/CoreHome/angularjs/piwikApp.js', 'plugins/Installation/javascripts/installation.js', 'plugins/Morpheus/javascripts/piwikHelper.js', "plugins/CoreHome/javascripts/broadcast.js", diff --git a/plugins/Installation/templates/layout.twig b/plugins/Installation/templates/layout.twig index a52ef61786..74916353d5 100644 --- a/plugins/Installation/templates/layout.twig +++ b/plugins/Installation/templates/layout.twig @@ -1,5 +1,5 @@ <!DOCTYPE html> -<html id="ng-app" ng-app="piwikApp"> +<html id="ng-app"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex,nofollow"> @@ -14,7 +14,7 @@ <script type="text/javascript" src="index.php?module=Installation&action=getInstallationJs"></script> <link rel="shortcut icon" href="plugins/CoreHome/images/favicon.png"/> </head> -<body ng-app="app" id="installation"> +<body id="installation"> <div class="container"> <div class="header"> diff --git a/plugins/LogViewer b/plugins/LogViewer -Subproject 5cfc95ccae7fa66f59bcc24a8570c1bb97dc00c +Subproject abc1ac5a8008ecd8a1ed967d947db4f3ed6894f diff --git a/plugins/LoginLdap b/plugins/LoginLdap -Subproject b3f0d00ebce2b0dd0cc863e7bbe72cc9e9a3468 +Subproject d050ffd6c2c9c09490503c1ea2a5bebcbeb23d3 diff --git a/plugins/Marketplace/templates/getNewPlugins.twig b/plugins/Marketplace/templates/getNewPlugins.twig index 9b22c29275..4ca027ddc5 100644 --- a/plugins/Marketplace/templates/getNewPlugins.twig +++ b/plugins/Marketplace/templates/getNewPlugins.twig @@ -1 +1 @@ -<div vue-entry="Marketplace.GetNewPlugins" plugins="{{ plugins|json_encode }}"></div>
\ No newline at end of file +<div vue-entry="Marketplace.GetNewPlugins" plugins="{{ plugins|json_encode }}"></div> diff --git a/plugins/Marketplace/templates/getPremiumFeatures.twig b/plugins/Marketplace/templates/getPremiumFeatures.twig index e8def730fd..0b8e1a5c45 100644 --- a/plugins/Marketplace/templates/getPremiumFeatures.twig +++ b/plugins/Marketplace/templates/getPremiumFeatures.twig @@ -1 +1 @@ -<div vue-entry="Marketplace.GetPremiumFeatures" plugins="{{ plugins|json_encode }}"></div>
\ No newline at end of file +<div vue-entry="Marketplace.GetPremiumFeatures" plugins="{{ plugins|json_encode }}"></div> diff --git a/plugins/Morpheus/javascripts/piwikHelper.js b/plugins/Morpheus/javascripts/piwikHelper.js index d96ea1d671..a29b361c77 100644 --- a/plugins/Morpheus/javascripts/piwikHelper.js +++ b/plugins/Morpheus/javascripts/piwikHelper.js @@ -116,9 +116,7 @@ window.piwikHelper = { */ escape: function (value) { - var escape = angular.element(document).injector().get('$sanitize'); - - return escape(value); + return window.vueSanitize(value); }, /** @@ -148,10 +146,6 @@ window.piwikHelper = { return url; }, - getAngularDependency: function (dependency) { - return angular.element(document).injector().get(dependency); - }, - // initial call for 'body' later in this file compileVueEntryComponents: function (selector, extraProps) { function toCamelCase(arg) { @@ -200,13 +194,11 @@ window.piwikHelper = { component = useExternalPluginComponent(parts[0], parts[1]); } - $(this).attr('ng-non-bindable', ''); - var paramsStr = ''; var componentParams = {}; function handleProperty(name, value) { - if (name === 'vue-entry' || name === 'class' || name === 'style') { + if (name === 'vue-entry' || name === 'class' || name === 'style' || name === 'id') { return; } @@ -230,6 +222,8 @@ window.piwikHelper = { handleProperty(name, value); }); + var element = this; + // NOTE: we could just do createVueApp(component, componentParams), but Vue will not allow // slots to be in the vue-entry element this way. So instead, we create a quick // template that references the root component and wraps the vue-entry component's html. @@ -320,81 +314,14 @@ window.piwikHelper = { }); }, - /** - * As we still have a lot of old jQuery code and copy html from node to node we sometimes have to trigger the - * compiling of angular components manually. - * - * @param selector - * @param {object} options - * @param {object} options.scope if supplied, the given scope will be used when compiling the template. Shouldn't - * be a plain object but an actual angular scope. - * @param {object} options.params if supplied, the properties in this object are - * added to the new scope. - */ - compileAngularComponents: function (selector, options) { - options = options || {}; - - var $element = $(selector); - - if (!$element.length) { - return; - } - - angular.element(document).injector().invoke(function($compile, $rootScope) { - var scope = null; - if (options.scope) { - scope = options.scope; - } else if (!options.forceNewScope) { // TODO: docs - scope = angular.element($element).scope(); - } - if (!scope) { - scope = $rootScope.$new(true); - } - - if (options.params) { - $.extend(scope, options.params); - } - - $compile($element)(scope); - - setTimeout(function () { - piwikHelper.processDynamicHtml($element); - }); - }); - }, - processDynamicHtml: function ($element) { piwik.postEvent('Matomo.processDynamicHtml', $element); }, /** - * Detection works currently only for directives defining an isolated scope. Functionality might need to be - * extended if needed. Under circumstances you might call this method before calling compileAngularComponents() - * to avoid compiling the same element twice. - * @param selector - */ - isAlreadyCompiledAngularComponent: function (selector) { - var $element = $(selector); - - return ($element.length && $element.hasClass('ng-isolate-scope')); - }, - - /** - * Detects whether angular is rendering the page. If so, the page will be reloaded automatically - * via angular as soon as it detects a $locationChange - * - * @returns {number|jQuery} - * @deprecated use isReportingPage() instead - */ - isAngularRenderingThePage: function () - { - return piwikHelper.isReportingPage(); - }, - - /** * Detects whether the current page is a reporting page or not. * - * @returns {number|jQuery|*} + * @returns {number} */ isReportingPage: function () { diff --git a/plugins/Morpheus/templates/admin.twig b/plugins/Morpheus/templates/admin.twig index 1b55871789..7495ca59f0 100644 --- a/plugins/Morpheus/templates/admin.twig +++ b/plugins/Morpheus/templates/admin.twig @@ -45,7 +45,7 @@ {% endblock %} {% include "@CoreHome/_warningInvalidHost.twig" %} - <div class="admin" id="content" ng-cloak> + <div class="admin" id="content"> <div class="ui-confirm" id="alert"> <h2></h2> diff --git a/plugins/Morpheus/templates/dashboard.twig b/plugins/Morpheus/templates/dashboard.twig index 4e831aa8a3..b1c0ecce5d 100644 --- a/plugins/Morpheus/templates/dashboard.twig +++ b/plugins/Morpheus/templates/dashboard.twig @@ -42,7 +42,7 @@ </div> {% endif %} - <div class="pageWrap" ng-cloak> + <div class="pageWrap"> <a name="main"></a> {% block notification %} diff --git a/plugins/Morpheus/templates/layout.twig b/plugins/Morpheus/templates/layout.twig index a1cea0e92b..1e69be00e7 100644 --- a/plugins/Morpheus/templates/layout.twig +++ b/plugins/Morpheus/templates/layout.twig @@ -1,5 +1,5 @@ <!DOCTYPE html> -<html id="ng-app" {% if language is defined %}lang="{{ language }}"{% endif %} ng-app="piwikApp"> +<html id="ng-app" {% if language is defined %}lang="{{ language }}"{% endif %}> <head> {% block head %} <meta charset="utf-8"> @@ -30,7 +30,7 @@ {% endblock %} </head> - <body id="{{ bodyId|default('') }}" ng-app="app" class="{{ bodyClass|default('') }}"> + <body id="{{ bodyId|default('') }}" class="{{ bodyClass|default('') }}"> {{ postEvent('Template.bodyTop' ) }} {% block body %} diff --git a/plugins/Overlay/tests/UI/expected-screenshots/Overlay_row_evolution.png b/plugins/Overlay/tests/UI/expected-screenshots/Overlay_row_evolution.png index 102133d213..520cd925d3 100644 --- a/plugins/Overlay/tests/UI/expected-screenshots/Overlay_row_evolution.png +++ b/plugins/Overlay/tests/UI/expected-screenshots/Overlay_row_evolution.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c37bfe9402997176e4d3c2f229f6cad18ccc0df502812767803727bbffe3606b -size 100201 +oid sha256:685bc3ad7246aaee3bff98dcd22fd228d758b9fd3356932ee84178d172651fda +size 100223 diff --git a/plugins/PagePerformance/tests/UI/expected-screenshots/PagePerformance_pagetitle_overlay.png b/plugins/PagePerformance/tests/UI/expected-screenshots/PagePerformance_pagetitle_overlay.png index 76a3ff8dd0..89f640809c 100644 --- a/plugins/PagePerformance/tests/UI/expected-screenshots/PagePerformance_pagetitle_overlay.png +++ b/plugins/PagePerformance/tests/UI/expected-screenshots/PagePerformance_pagetitle_overlay.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f8ab270114050309bc64050648a4f422c6cdaadf1ee510f69a1343d743039f65 -size 152344 +oid sha256:2e6ce0d3c03f02c2cb2e936c09ee94f5141ad108f705790d8c11c43b50051314 +size 152356 diff --git a/plugins/PagePerformance/tests/UI/expected-screenshots/PagePerformance_pageurl_overlay.png b/plugins/PagePerformance/tests/UI/expected-screenshots/PagePerformance_pageurl_overlay.png index d6eb96886b..db98d08341 100644 --- a/plugins/PagePerformance/tests/UI/expected-screenshots/PagePerformance_pageurl_overlay.png +++ b/plugins/PagePerformance/tests/UI/expected-screenshots/PagePerformance_pageurl_overlay.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:46c072eeea746a54af65bed37b5fc979f54bfcf4888d2f7fa2b60c77c3d53a5a -size 151556 +oid sha256:376157408d2fac25f8b27381be884e5d14205d124b411617e3cb6275d35c4c3d +size 151576 diff --git a/plugins/PagePerformance/tests/UI/expected-screenshots/PagePerformance_rowactions.png b/plugins/PagePerformance/tests/UI/expected-screenshots/PagePerformance_rowactions.png index 72c5208764..02e95f4ae6 100644 --- a/plugins/PagePerformance/tests/UI/expected-screenshots/PagePerformance_rowactions.png +++ b/plugins/PagePerformance/tests/UI/expected-screenshots/PagePerformance_rowactions.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:444dbedd62f5f5d7ad93e563e3c1a2e004f971bc0643998692689ce6a1fd218b +oid sha256:e5d0620b58a1669e8bd7a4c4b1d9989a82ecb68e601533ff01698ad0f97525e5 size 34322 diff --git a/plugins/PagePerformance/tests/UI/expected-screenshots/PagePerformance_rowactions_subtable.png b/plugins/PagePerformance/tests/UI/expected-screenshots/PagePerformance_rowactions_subtable.png index 5af1936615..13e82ddee6 100644 --- a/plugins/PagePerformance/tests/UI/expected-screenshots/PagePerformance_rowactions_subtable.png +++ b/plugins/PagePerformance/tests/UI/expected-screenshots/PagePerformance_rowactions_subtable.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f7f8758e21a67b7c0e18b46d1ae1a43a90176f449503dd4eae9d852851b0bd6d +oid sha256:31469b8e6735c12671bd0ab7a1ee6b8b1d2c3fb3413cf2a65abcfe17b93be7fc size 38309 diff --git a/plugins/PagePerformance/tests/UI/expected-screenshots/PagePerformance_visualizations.png b/plugins/PagePerformance/tests/UI/expected-screenshots/PagePerformance_visualizations.png index cef09da445..235fb311c0 100644 --- a/plugins/PagePerformance/tests/UI/expected-screenshots/PagePerformance_visualizations.png +++ b/plugins/PagePerformance/tests/UI/expected-screenshots/PagePerformance_visualizations.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7829e0f57e987132ad6b36f7ba046b54342c09181d3781f48c3763559044b63e -size 44306 +oid sha256:875dec7aa382e23e96975505ce106d8f64d24039402c163756bf190f2e0baf64 +size 44063 diff --git a/plugins/UsersManager/vue/dist/UsersManager.umd.js b/plugins/UsersManager/vue/dist/UsersManager.umd.js index 539e543b23..52d238f538 100644 --- a/plugins/UsersManager/vue/dist/UsersManager.umd.js +++ b/plugins/UsersManager/vue/dist/UsersManager.umd.js @@ -4289,19 +4289,19 @@ function UserSecurityvue_type_template_id_5309c3ad_render(_ctx, _cache, $props, UserSecurityvue_type_script_lang_ts.render = UserSecurityvue_type_template_id_5309c3ad_render /* harmony default export */ var UserSecurity = (UserSecurityvue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/UsersManager/vue/src/UserSettings/UserSettings.vue?vue&type=template&id=299713a4 +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/UsersManager/vue/src/UserSettings/UserSettings.vue?vue&type=template&id=9b4f242a -var UserSettingsvue_type_template_id_299713a4_hoisted_1 = ["innerHTML"]; -var UserSettingsvue_type_template_id_299713a4_hoisted_2 = { +var UserSettingsvue_type_template_id_9b4f242a_hoisted_1 = ["innerHTML"]; +var UserSettingsvue_type_template_id_9b4f242a_hoisted_2 = { style: { "margin-left": "20px" } }; -var UserSettingsvue_type_template_id_299713a4_hoisted_3 = ["href"]; +var UserSettingsvue_type_template_id_9b4f242a_hoisted_3 = ["href"]; -var UserSettingsvue_type_template_id_299713a4_hoisted_4 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); +var UserSettingsvue_type_template_id_9b4f242a_hoisted_4 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -function UserSettingsvue_type_template_id_299713a4_render(_ctx, _cache, $props, $setup, $data, $options) { +function UserSettingsvue_type_template_id_9b4f242a_render(_ctx, _cache, $props, $setup, $data, $options) { var _component_PersonalSettings = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("PersonalSettings"); var _component_NewsletterSettings = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("NewsletterSettings"); @@ -4310,7 +4310,7 @@ function UserSettingsvue_type_template_id_299713a4_render(_ctx, _cache, $props, var _component_ContentBlock = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ContentBlock"); - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_PersonalSettings, { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_PersonalSettings, { "is-users-admin-enabled": _ctx.isUsersAdminEnabled, title: _ctx.title, "user-login": _ctx.userLogin, @@ -4335,14 +4335,14 @@ function UserSettingsvue_type_template_id_299713a4_render(_ctx, _cache, $props, default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", { innerHTML: _ctx.$sanitize(_ctx.yourVisitsAreText) - }, null, 8, UserSettingsvue_type_template_id_299713a4_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", UserSettingsvue_type_template_id_299713a4_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + }, null, 8, UserSettingsvue_type_template_id_9b4f242a_hoisted_1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", UserSettingsvue_type_template_id_9b4f242a_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { href: _ctx.setIgnoreCookieLink - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" › " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.ignoreCookieSet ? _ctx.translate('UsersManager_ClickHereToDeleteTheCookie') : _ctx.translate('UsersManager_ClickHereToSetTheCookieOnDomain', _ctx.piwikHost)) + " ", 1), UserSettingsvue_type_template_id_299713a4_hoisted_4], 8, UserSettingsvue_type_template_id_299713a4_hoisted_3)])]; + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" › " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.ignoreCookieSet ? _ctx.translate('UsersManager_ClickHereToDeleteTheCookie') : _ctx.translate('UsersManager_ClickHereToSetTheCookieOnDomain', _ctx.piwikHost)) + " ", 1), UserSettingsvue_type_template_id_9b4f242a_hoisted_4], 8, UserSettingsvue_type_template_id_9b4f242a_hoisted_3)])]; }), _: 1 - }, 8, ["content-title"])], 64); + }, 8, ["content-title"])]); } -// CONCATENATED MODULE: ./plugins/UsersManager/vue/src/UserSettings/UserSettings.vue?vue&type=template&id=299713a4 +// CONCATENATED MODULE: ./plugins/UsersManager/vue/src/UserSettings/UserSettings.vue?vue&type=template&id=9b4f242a // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/UsersManager/vue/src/UserSettings/UserSettings.vue?vue&type=script&lang=ts @@ -4445,7 +4445,7 @@ function UserSettingsvue_type_template_id_299713a4_render(_ctx, _cache, $props, -UserSettingsvue_type_script_lang_ts.render = UserSettingsvue_type_template_id_299713a4_render +UserSettingsvue_type_script_lang_ts.render = UserSettingsvue_type_template_id_9b4f242a_render /* harmony default export */ var UserSettings = (UserSettingsvue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/UsersManager/vue/src/index.ts diff --git a/plugins/UsersManager/vue/dist/UsersManager.umd.min.js b/plugins/UsersManager/vue/dist/UsersManager.umd.min.js index 8685170dab..100c0574d5 100644 --- a/plugins/UsersManager/vue/dist/UsersManager.umd.min.js +++ b/plugins/UsersManager/vue/dist/UsersManager.umd.min.js @@ -4,7 +4,7 @@ * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var C=function(){function e(){var t=this;h(this,e),v(this,"privateState",Object(o["reactive"])({isLoading:!1,capabilities:[]})),v(this,"state",Object(o["computed"])((function(){return Object(o["readonly"])(t.privateState)}))),v(this,"capabilities",Object(o["computed"])((function(){return t.state.value.capabilities}))),v(this,"isLoading",Object(o["computed"])((function(){return t.state.value.isLoading}))),v(this,"fetchPromise",void 0)}return j(e,[{key:"init",value:function(){return this.fetchCapabilities()}},{key:"fetchCapabilities",value:function(){var e=this;return this.fetchPromise||(this.privateState.isLoading=!0,this.fetchPromise=g["AjaxHelper"].fetch({method:"UsersManager.getAvailableCapabilities"}).then((function(t){return e.privateState.capabilities=t,e.capabilities.value})).finally((function(){e.privateState.isLoading=!1}))),this.fetchPromise}}]),e}(),k=new C,y=window,N=y.$,S=Object(o["defineComponent"])({props:{idsite:[String,Number],siteName:{type:String,required:!0},userLogin:{type:String,required:!0},userRole:{type:String,required:!0},capabilities:Array},components:{Field:f["Field"]},data:function(){return{theCapabilities:this.capabilities||[],isBusy:!1,isAddingCapability:!1,capabilityToAddId:null,capabilityToRemoveId:null,capabilityToAddOrRemove:null}},emits:["change"],watch:{capabilities:function(e){e&&(this.theCapabilities=e)}},created:function(){var e=this;k.init(),this.capabilities?this.theCapabilities=this.capabilities:(this.isBusy=!0,g["AjaxHelper"].fetch({method:"UsersManager.getUsersPlusRole",limit:"1",filter_search:this.userLogin}).then((function(e){return e&&e.capabilities?e.capabilities:[]})).then((function(t){e.theCapabilities=t})).finally((function(){e.isBusy=!1})))},methods:{onToggleCapability:function(e){var t=this;this.isAddingCapability=e;var n=e?this.capabilityToAddId:this.capabilityToRemoveId;this.capabilityToAddOrRemove=null,this.availableCapabilities.forEach((function(e){e.id===n&&(t.capabilityToAddOrRemove=e)})),this.$refs.confirmCapabilityToggleModal&&N(this.$refs.confirmCapabilityToggleModal).modal({dismissible:!1,yes:function(){return null}}).modal("open")},toggleCapability:function(){this.isAddingCapability?this.addCapability(this.capabilityToAddOrRemove):this.removeCapability(this.capabilityToAddOrRemove)},isIncludedInRole:function(e){return-1!==(e.includedInRoles||[]).indexOf(this.userRole)},getCapabilitiesList:function(){var e=this,t=[];return this.availableCapabilities.forEach((function(n){e.isIncludedInRole(n)||e.capabilitiesSet[n.id]&&t.push(n.id)})),t},addCapability:function(e){var t=this;this.isBusy=!0,g["AjaxHelper"].post({method:"UsersManager.addCapabilities"},{userLogin:this.userLogin,capabilities:e.id,idSites:this.idsite}).then((function(){t.$emit("change",t.getCapabilitiesList())})).finally((function(){t.isBusy=!1,t.capabilityToAddOrRemove=null,t.capabilityToAddId=null,t.capabilityToRemoveId=null}))},removeCapability:function(e){var t=this;this.isBusy=!0,g["AjaxHelper"].post({method:"UsersManager.removeCapabilities"},{userLogin:this.userLogin,capabilities:e.id,idSites:this.idsite}).then((function(){t.$emit("change",t.getCapabilitiesList())})).finally((function(){t.isBusy=!1,t.capabilityToAddOrRemove=null,t.capabilityToAddId=null,t.capabilityToRemoveId=null}))}},computed:{availableCapabilities:function(){return k.capabilities.value},confirmAddCapabilityToggleContent:function(){return Object(g["translate"])("UsersManager_AreYouSureAddCapability","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.capabilityToAddOrRemove?this.capabilityToAddOrRemove.name:"","</strong>"),"<strong>".concat(this.siteNameText,"</strong>"))},confirmCapabilityToggleContent:function(){return Object(g["translate"])("UsersManager_AreYouSureRemoveCapability","<strong>".concat(this.capabilityToAddOrRemove?this.capabilityToAddOrRemove.name:"","</strong>"),"<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.siteNameText,"</strong>"))},siteNameText:function(){return g["Matomo"].helper.htmlEntities(this.siteName)},availableCapabilitiesGrouped:function(){var e=this,t=this.availableCapabilities.filter((function(t){return!e.capabilitiesSet[t.id]})).map((function(e){return{group:e.category,key:e.id,value:e.name,tooltip:e.description}}));return t.sort((function(e,t){return e.group===t.group?e.value===t.value?0:e.value<t.value?-1:1:e.group<t.group?-1:1})),t},capabilitiesSet:function(){var e=this,t={},n=this.theCapabilities;return(n||[]).forEach((function(e){t[e]=!0})),(this.availableCapabilities||[]).forEach((function(n){e.isIncludedInRole(n)&&(t[n.id]=!0)})),t},actualCapabilities:function(){var e=this.capabilitiesSet;return this.availableCapabilities.filter((function(t){return!!e[t.id]}))}}});S.render=p;var V=S,U={key:0,class:"row"},E={class:"row to-all-websites"},w={class:"col s12"},A={style:{"margin-right":"3.5px"}},T={id:"all-sites-access-select",style:{"margin-right":"3.5px"}},M={style:{"margin-top":"18px"}},B={class:"filters row"},_={class:"col s12 m12 l8"},D={class:"input-field bulk-actions",style:{"margin-right":"3.5px"}},x={id:"user-permissions-edit-bulk-actions",class:"dropdown-content"},L={class:"dropdown-trigger","data-target":"user-permissions-bulk-set-access"},R={id:"user-permissions-bulk-set-access",class:"dropdown-content"},P=["onClick"],F={class:"input-field site-filter",style:{"margin-right":"3.5px"}},H=["value","placeholder"],I={class:"input-field access-filter",style:{"margin-right":"3.5px"}},q={key:0,class:"col s12 m12 l4 sites-for-permission-pagination-container"},$={class:"sites-for-permission-pagination"},G={class:"counter"},z=["textContent"],W={class:"roles-help-notification"},Y=["innerHTML"],X={class:"capabilities-help-notification"},J={id:"sitesForPermission"},K={class:"select-cell"},Q={class:"checkbox-container"},Z=["checked"],ee=Object(o["createElementVNode"])("span",null,null,-1),te={class:"role_header"},ne=["innerHTML"],se=Object(o["createElementVNode"])("span",{class:"icon-help"},null,-1),re=[se],oe={class:"capabilities_header"},ie=["innerHTML"],ae=Object(o["createElementVNode"])("span",{class:"icon-help"},null,-1),le=[ae],ce={key:0,class:"select-all-row"},de={colspan:"4"},ue={key:0},me=["innerHTML"],be=["innerHTML"],pe={key:1},ge=["innerHTML"],fe=["innerHTML"],he={class:"select-cell"},Oe={class:"checkbox-container"},je=["id","onUpdate:modelValue"],ve=Object(o["createElementVNode"])("span",null,null,-1),Ce={class:"role-select"},ke={class:"delete-access-confirm-modal modal",ref:"deleteAccessConfirmModal"},ye={class:"modal-content"},Ne=["innerHTML"],Se=["innerHTML"],Ve={class:"modal-footer"},Ue={class:"change-access-confirm-modal modal",ref:"changeAccessConfirmModal"},Ee={class:"modal-content"},we=["innerHTML"],Ae=["innerHTML"],Te={class:"modal-footer"},Me={class:"confirm-give-access-all-sites modal",ref:"confirmGiveAccessAllSitesModal"},Be={class:"modal-content"},_e=["innerHTML"],De={class:"modal-footer"};function xe(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Notification"),l=Object(o["resolveComponent"])("Field"),c=Object(o["resolveComponent"])("CapabilitiesEdit"),d=Object(o["resolveDirective"])("dropdown-menu"),u=Object(o["resolveDirective"])("content-table");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])(["userPermissionsEdit",{loading:e.isLoadingAccess}])},[e.hasAccessToAtLeastOneSite?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",U,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{context:"warning",type:"transient",noclear:!0},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("strong",null,Object(o["toDisplayString"])(e.translate("General_Warning"))+":",1),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("UsersManager_NoAccessWarning")),1)]})),_:1})])])),Object(o["createElementVNode"])("div",E,[Object(o["createElementVNode"])("div",w,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("span",A,Object(o["toDisplayString"])(e.translate("UsersManager_GiveAccessToAll"))+":",1),Object(o["createElementVNode"])("div",T,[Object(o["createVNode"])(l,{modelValue:e.allWebsitesAccssLevelSet,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.allWebsitesAccssLevelSet=t}),uicontrol:"select",options:e.filteredAccessLevels,"full-width":!0},null,8,["modelValue","options"])]),Object(o["createElementVNode"])("a",{href:"",class:Object(o["normalizeClass"])(["btn",{disabled:e.isGivingAccessToAllSites}]),onClick:t[1]||(t[1]=Object(o["withModifiers"])((function(t){return e.showChangeAccessAllSitesModal()}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_Apply")),3)]),Object(o["createElementVNode"])("p",M,Object(o["toDisplayString"])(e.translate("UsersManager_OrManageIndividually"))+":",1)])]),Object(o["createElementVNode"])("div",B,[Object(o["createElementVNode"])("div",_,[Object(o["createElementVNode"])("div",D,[Object(o["withDirectives"])(Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["dropdown-trigger btn",{disabled:e.isBulkActionsDisabled}]),href:"","data-target":"user-permissions-edit-bulk-actions"},[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_BulkActions")),1)],2),[[d,{activates:"#user-permissions-edit-bulk-actions"}]]),Object(o["createElementVNode"])("ul",x,[Object(o["createElementVNode"])("li",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("a",L,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_SetPermission")),1)],512),[[d,{activates:"#user-permissions-bulk-set-access"}]]),Object(o["createElementVNode"])("ul",R,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.filteredAccessLevels,(function(t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{key:t.key},[Object(o["createElementVNode"])("a",{href:"",onClick:Object(o["withModifiers"])((function(n){e.siteAccessToChange=null,e.roleToChangeTo=t.key,e.showChangeAccessConfirm()}),["prevent"])},Object(o["toDisplayString"])(t.value),9,P)])})),128))])]),Object(o["createElementVNode"])("li",null,[Object(o["createElementVNode"])("a",{href:"",onClick:t[2]||(t[2]=Object(o["withModifiers"])((function(t){e.siteAccessToChange=null,e.roleToChangeTo="noaccess",e.showRemoveAccessConfirm()}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_RemovePermissions")),1)])])]),Object(o["createElementVNode"])("div",F,[Object(o["createElementVNode"])("input",{type:"text",value:e.siteNameFilter,onKeydown:t[3]||(t[3]=function(t){e.onChangeSiteFilter(t)}),onChange:t[4]||(t[4]=function(t){e.onChangeSiteFilter(t)}),placeholder:e.translate("UsersManager_FilterByWebsite")},null,40,H)]),Object(o["createElementVNode"])("div",I,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(l,{modelValue:e.accessLevelFilter,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.accessLevelFilter=t}),uicontrol:"select",options:e.filteredSelectAccessLevels,"full-width":!0,placeholder:e.translate("UsersManager_FilterByAccess")},null,8,["modelValue","options","placeholder"])])])]),e.totalEntries>e.limit?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",q,[Object(o["createElementVNode"])("div",$,[Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["prev",{disabled:e.offset<=0}])},[Object(o["createElementVNode"])("span",{class:"pointer",onClick:t[6]||(t[6]=function(t){return e.gotoPreviousPage()})},"« "+Object(o["toDisplayString"])(e.translate("General_Previous")),1)],2),Object(o["createElementVNode"])("span",G,[Object(o["createElementVNode"])("span",{textContent:Object(o["toDisplayString"])(e.paginationText)},null,8,z)]),Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["next",{disabled:e.offset+e.limit>=e.totalEntries}])},[Object(o["createElementVNode"])("span",{class:"pointer",onClick:t[7]||(t[7]=function(t){return e.gotoNextPage()})},Object(o["toDisplayString"])(e.translate("General_Next"))+" »",1)],2)])])):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",W,[e.isRoleHelpToggled?(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,context:"info",type:"persistent",noclear:!0},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.rolesHelpText)},null,8,Y)]})),_:1})):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",X,[e.isCapabilitiesHelpToggled?(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,context:"info",type:"persistent",noclear:!0},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.translate("UsersManager_CapabilitiesHelp")),1)]})),_:1})):Object(o["createCommentVNode"])("",!0)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("table",J,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",K,[Object(o["createElementVNode"])("span",Q,[Object(o["createElementVNode"])("label",null,[Object(o["createElementVNode"])("input",{type:"checkbox",id:"perm_edit_select_all",checked:e.isAllCheckboxSelected,onChange:t[8]||(t[8]=function(t){return e.onAllCheckboxChange(t)})},null,40,Z),ee])])]),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Name")),1),Object(o["createElementVNode"])("th",te,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize("".concat(e.translate("UsersManager_Role")," "))},null,8,ne),Object(o["createElementVNode"])("a",{href:"",class:Object(o["normalizeClass"])(["helpIcon",{sticky:e.isRoleHelpToggled}]),onClick:t[9]||(t[9]=Object(o["withModifiers"])((function(t){return e.isRoleHelpToggled=!e.isRoleHelpToggled}),["prevent"]))},re,2)]),Object(o["createElementVNode"])("th",oe,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize("".concat(e.translate("UsersManager_Capabilities")," "))},null,8,ie),Object(o["createElementVNode"])("a",{href:"",class:Object(o["normalizeClass"])(["helpIcon",{sticky:e.isCapabilitiesHelpToggled}]),onClick:t[10]||(t[10]=Object(o["withModifiers"])((function(t){return e.isCapabilitiesHelpToggled=!e.isCapabilitiesHelpToggled}),["prevent"]))},le,2)])])]),Object(o["createElementVNode"])("tbody",null,[e.isAllCheckboxSelected&&e.siteAccess.length<e.totalEntries?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",ce,[Object(o["createElementVNode"])("td",de,[e.areAllResultsSelected?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ue,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.theDisplayedWebsitesAreSelectedText),style:{"margin-right":"3.5px"}},null,8,me),Object(o["createElementVNode"])("a",{href:"#",onClick:t[11]||(t[11]=Object(o["withModifiers"])((function(t){return e.areAllResultsSelected=!e.areAllResultsSelected}),["prevent"])),innerHTML:e.$sanitize(e.clickToSelectAllText)},null,8,be)])),e.areAllResultsSelected?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",pe,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.allWebsitesAreSelectedText),style:{"margin-right":"3.5px"}},null,8,ge),Object(o["createElementVNode"])("a",{href:"#",onClick:t[12]||(t[12]=Object(o["withModifiers"])((function(t){return e.areAllResultsSelected=!e.areAllResultsSelected}),["prevent"])),innerHTML:e.$sanitize(e.clickToSelectDisplayedWebsitesText)},null,8,fe)])):Object(o["createCommentVNode"])("",!0)])])):Object(o["createCommentVNode"])("",!0),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.siteAccess,(function(n,s){return Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",{key:n.idsite},[Object(o["createElementVNode"])("td",he,[Object(o["createElementVNode"])("span",Oe,[Object(o["createElementVNode"])("label",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"checkbox",id:"perm_edit_select_row".concat(s),"onUpdate:modelValue":function(t){return e.selectedRows[s]=t},onClick:t[13]||(t[13]=function(t){return e.onRowSelected()})},null,8,je),[[o["vModelCheckbox"],e.selectedRows[s]]]),ve])])]),Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(n.site_name),1)]),Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("div",Ce,[Object(o["createVNode"])(l,{"model-value":n.role,"onUpdate:modelValue":function(t){e.onRoleChange(n,t)},uicontrol:"select",options:e.filteredAccessLevels,"full-width":!0},null,8,["model-value","onUpdate:modelValue","options"])])]),Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(c,{idsite:n.idsite,"site-name":n.site_name,"user-login":e.userLogin,"user-role":n.role,capabilities:n.capabilities,onChange:t[14]||(t[14]=function(t){return e.fetchAccess()})},null,8,["idsite","site-name","user-login","user-role","capabilities"])])])])})),128))])],512),[[u]]),Object(o["createElementVNode"])("div",ke,[Object(o["createElementVNode"])("div",ye,[e.siteAccessToChange?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h3",{key:0,innerHTML:e.$sanitize(e.deletePermConfirmSingleText)},null,8,Ne)):Object(o["createCommentVNode"])("",!0),e.siteAccessToChange?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",{key:1,innerHTML:e.$sanitize(e.deletePermConfirmMultipleText)},null,8,Se))]),Object(o["createElementVNode"])("div",Ve,[Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[15]||(t[15]=Object(o["withModifiers"])((function(t){return e.changeUserRole()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("General_Yes")),1),Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[16]||(t[16]=Object(o["withModifiers"])((function(t){e.siteAccessToChange=null,e.roleToChangeTo=null}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_No")),1)])],512),Object(o["createElementVNode"])("div",Ue,[Object(o["createElementVNode"])("div",Ee,[e.siteAccessToChange?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h3",{key:0,innerHTML:e.$sanitize(e.changePermToSiteConfirmSingleText)},null,8,we)):Object(o["createCommentVNode"])("",!0),e.siteAccessToChange?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",{key:1,innerHTML:e.$sanitize(e.changePermToSiteConfirmMultipleText)},null,8,Ae))]),Object(o["createElementVNode"])("div",Te,[Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[17]||(t[17]=Object(o["withModifiers"])((function(t){return e.changeUserRole()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("General_Yes")),1),Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[18]||(t[18]=Object(o["withModifiers"])((function(t){e.siteAccessToChange.role=e.previousRole,e.siteAccessToChange=null,e.roleToChangeTo=null}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_No")),1)])],512),Object(o["createElementVNode"])("div",Me,[Object(o["createElementVNode"])("div",Be,[Object(o["createElementVNode"])("h3",{innerHTML:e.$sanitize(e.changePermToAllSitesConfirmText)},null,8,_e),Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ChangePermToAllSitesConfirm2")),1)]),Object(o["createElementVNode"])("div",De,[Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[19]||(t[19]=Object(o["withModifiers"])((function(t){return e.giveAccessToAllSites()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("General_Yes")),1),Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[20]||(t[20]=function(e){return e.preventDefault()})},Object(o["toDisplayString"])(e.translate("General_No")),1)])],512)],2)}var Le=window,Re=Le.$,Pe=Object(o["defineComponent"])({props:{userLogin:{type:String,required:!0},limit:{type:Number,default:10},accessLevels:{type:Array,required:!0},filterAccessLevels:{type:Array,required:!0}},components:{Notification:g["Notification"],Field:f["Field"],CapabilitiesEdit:V},directives:{DropdownMenu:g["DropdownMenu"],ContentTable:g["ContentTable"]},data:function(){return{siteAccess:[],offset:0,totalEntries:null,accessLevelFilter:"",siteNameFilter:"",isLoadingAccess:!1,allWebsitesAccssLevelSet:"view",isAllCheckboxSelected:!1,selectedRows:{},isBulkActionsDisabled:!0,areAllResultsSelected:!1,previousRole:null,hasAccessToAtLeastOneSite:!0,isRoleHelpToggled:!1,isCapabilitiesHelpToggled:!1,isGivingAccessToAllSites:!1,roleToChangeTo:null,siteAccessToChange:null}},emits:["userHasAccessDetected","accessChanged"],created:function(){var e=this;this.onChangeSiteFilter=Object(g["debounce"])(this.onChangeSiteFilter,300),Object(o["watch"])((function(){return e.allPropsWatch}),(function(){e.limit&&e.fetchAccess()})),this.fetchAccess()},watch:{accessLevelFilter:function(){this.offset=0,this.fetchAccess()}},methods:{onAllCheckboxChange:function(e){var t=this;this.isAllCheckboxSelected=e.target.checked,this.isAllCheckboxSelected?(this.siteAccess.forEach((function(e,n){t.selectedRows[n]=!0})),this.isBulkActionsDisabled=!1):this.clearSelection()},clearSelection:function(){this.selectedRows={},this.areAllResultsSelected=!1,this.isBulkActionsDisabled=!0,this.isAllCheckboxSelected=!1,this.siteAccessToChange=null},onRowSelected:function(){var e=this;setTimeout((function(){var t=e.selectedRowsCount;e.isBulkActionsDisabled=0===t,e.isAllCheckboxSelected=t===e.siteAccess.length}))},fetchAccess:function(){var e=this;return this.isLoadingAccess=!0,g["AjaxHelper"].fetch({method:"UsersManager.getSitesAccessForUser",limit:this.limit,offset:this.offset,filter_search:this.siteNameFilter,filter_access:this.accessLevelFilter,userLogin:this.userLogin},{returnResponseObject:!0}).then((function(t){var n=t.getRequestHandle();e.isLoadingAccess=!1,e.siteAccess=n.responseJSON,e.totalEntries=parseInt(n.getResponseHeader("x-matomo-total-results"),10)||0,e.hasAccessToAtLeastOneSite=!!n.getResponseHeader("x-matomo-has-some"),e.$emit("userHasAccessDetected",{hasAccess:e.hasAccessToAtLeastOneSite}),e.clearSelection()})).catch((function(){e.isLoadingAccess=!1,e.clearSelection()}))},gotoPreviousPage:function(){this.offset=Math.max(0,this.offset-this.limit),this.fetchAccess()},gotoNextPage:function(){var e=this.offset+this.limit;e>=(this.totalEntries||0)||(this.offset=e,this.fetchAccess())},showRemoveAccessConfirm:function(){Re(this.$refs.deleteAccessConfirmModal).modal({dismissible:!1}).modal("open")},changeUserRole:function(){var e=this,t=function(){var t=[];return Object.keys(e.selectedRows).forEach((function(n){e.selectedRows[n]&&e.siteAccess[n]&&t.push(e.siteAccess[n].idsite)})),t},n=function(){return g["AjaxHelper"].fetch({method:"UsersManager.getSitesAccessForUser",filter_search:e.siteNameFilter,filter_access:e.accessLevelFilter,userLogin:e.userLogin,filter_limit:"-1"}).then((function(e){return e.map((function(e){return e.idsite}))}))};return this.isLoadingAccess=!0,Promise.resolve().then((function(){return e.siteAccessToChange?[e.siteAccessToChange.idsite]:e.areAllResultsSelected?n():t()})).then((function(t){return g["AjaxHelper"].post({method:"UsersManager.setUserAccess"},{userLogin:e.userLogin,access:e.roleToChangeTo,idSites:t})})).catch((function(){})).then((function(){return e.$emit("accessChanged"),e.fetchAccess()}))},showChangeAccessConfirm:function(){Re(this.$refs.changeAccessConfirmModal).modal({dismissible:!1}).modal("open")},getRoleDisplay:function(e){var t=null;return this.filteredAccessLevels.forEach((function(n){n.key===e&&(t=n.value)})),t},giveAccessToAllSites:function(){var e=this;this.isGivingAccessToAllSites=!0,g["AjaxHelper"].fetch({method:"SitesManager.getSitesWithAdminAccess",filter_limit:-1}).then((function(t){var n=t.map((function(e){return e.idsite}));return g["AjaxHelper"].post({method:"UsersManager.setUserAccess"},{userLogin:e.userLogin,access:e.allWebsitesAccssLevelSet,idSites:n})})).then((function(){return e.fetchAccess()})).finally((function(){e.isGivingAccessToAllSites=!1}))},showChangeAccessAllSitesModal:function(){Re(this.$refs.confirmGiveAccessAllSitesModal).modal({dismissible:!1}).modal("open")},onChangeSiteFilter:function(e){var t=this;setTimeout((function(){var n=e.target.value;t.siteNameFilter!==n&&(t.siteNameFilter=n,t.offset=0,t.fetchAccess())}))},onRoleChange:function(e,t){this.previousRole=e.role,this.roleToChangeTo=t,this.siteAccessToChange=e,this.showChangeAccessConfirm()}},computed:{rolesHelpText:function(){return Object(g["translate"])("UsersManager_RolesHelp",'<a href="https://matomo.org/faq/general/faq_70/" target="_blank" rel="noreferrer noopener">',"</a>",'<a href="https://matomo.org/faq/general/faq_69/" target="_blank" rel="noreferrer noopener">',"</a>")},theDisplayedWebsitesAreSelectedText:function(){var e=Object(g["translate"])("UsersManager_TheDisplayedWebsitesAreSelected","<strong>".concat(this.siteAccess.length,"</strong>"));return"".concat(e," ")},clickToSelectAllText:function(){return Object(g["translate"])("UsersManager_ClickToSelectAll","<strong>".concat(this.totalEntries,"</strong>"))},allWebsitesAreSelectedText:function(){return Object(g["translate"])("UsersManager_AllWebsitesAreSelected","<strong>".concat(this.totalEntries,"</strong>"))},clickToSelectDisplayedWebsitesText:function(){return Object(g["translate"])("UsersManager_ClickToSelectDisplayedWebsites","<strong>".concat(this.siteAccess.length,"</strong>"))},deletePermConfirmSingleText:function(){return Object(g["translate"])("UsersManager_DeletePermConfirmSingle","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.siteAccessToChangeName,"</strong>"))},deletePermConfirmMultipleText:function(){return Object(g["translate"])("UsersManager_DeletePermConfirmMultiple","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.affectedSitesCount,"</strong>"))},changePermToSiteConfirmSingleText:function(){return Object(g["translate"])("UsersManager_ChangePermToSiteConfirmSingle","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.siteAccessToChangeName,"</strong>"),"<strong>".concat(this.getRoleDisplay(this.roleToChangeTo),"</strong>"))},changePermToSiteConfirmMultipleText:function(){return Object(g["translate"])("UsersManager_ChangePermToSiteConfirmMultiple","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.affectedSitesCount,"</strong>"),"<strong>".concat(this.getRoleDisplay(this.roleToChangeTo),"</strong>"))},changePermToAllSitesConfirmText:function(){return Object(g["translate"])("UsersManager_ChangePermToAllSitesConfirm","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.getRoleDisplay(this.allWebsitesAccssLevelSet),"</strong>"))},paginationLowerBound:function(){return this.offset+1},paginationUpperBound:function(){return this.totalEntries?Math.min(this.offset+this.limit,this.totalEntries):"?"},filteredAccessLevels:function(){return this.accessLevels.filter((function(e){return"superuser"!==e.key&&"role"===e.type}))},filteredSelectAccessLevels:function(){return this.filterAccessLevels.filter((function(e){return"superuser"!==e.key}))},selectedRowsCount:function(){var e=0;return Object.values(this.selectedRows).forEach((function(t){t&&(e+=1)})),e},affectedSitesCount:function(){return this.areAllResultsSelected?this.totalEntries:this.selectedRowsCount},allPropsWatch:function(){return this.userLogin,this.limit,this.accessLevels,this.filterAccessLevels,Date.now()},siteAccessToChangeName:function(){return this.siteAccessToChange?g["Matomo"].helper.htmlEntities(this.siteAccessToChange.site_name):""},paginationText:function(){var e=Object(g["translate"])("General_Pagination","".concat(this.paginationLowerBound),"".concat(this.paginationUpperBound),"".concat(this.totalEntries));return" ".concat(e," ")}}});Pe.render=xe;var Fe=Pe,He={class:"row"},Ie={key:0,class:"col s12 m6 invite-notes"},qe={class:"form-help"},$e=["innerHTML"],Ge={key:1,class:"col m2 entityList"},ze={class:"listCircle"},We={key:0,class:"icon-warning"},Ye=Object(o["createElementVNode"])("div",{class:"save-button-spacer hide-on-small-only"},null,-1),Xe={href:"",class:"entityCancelLink"},Je=Object(o["createElementVNode"])("span",{class:"icon-arrow-left-2"},null,-1),Ke={class:"visibleTab col m10"},Qe={key:0,class:"basic-info-tab"},Ze={class:"form-group row",style:{position:"relative"}},et={class:"col s12 m6 save-button"},tt={key:0,class:"resend-notes"},nt=["innerHTML"],st={key:0,class:"entityCancel"},rt=Object(o["createElementVNode"])("span",{class:"icon icon-arrow-left-2"},null,-1),ot={key:1,class:"user-permissions"},it={key:0},at={key:1,class:"alert alert-info"},lt={key:2,class:"superuser-access form-group"},ct={key:0},dt={key:1},ut={key:3,class:"twofa-reset form-group"},mt={class:"resetTwoFa"},bt=["innerHTML"];function pt(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("SaveButton"),c=Object(o["resolveComponent"])("PasswordConfirmation"),d=Object(o["resolveComponent"])("UserPermissionsEdit"),u=Object(o["resolveComponent"])("ContentBlock"),m=Object(o["resolveDirective"])("form");return Object(o["openBlock"])(),Object(o["createBlock"])(u,{class:Object(o["normalizeClass"])(["userEditForm",{loading:e.isSavingUserInfo}]),"content-title":"".concat(e.formTitle," ").concat(e.isAdd?"":"".concat(e.theUser.login))},{default:Object(o["withCtx"])((function(){return[Object(o["withDirectives"])(Object(o["createElementVNode"])("div",He,[e.isAdd?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ie,[Object(o["createElementVNode"])("div",qe,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.translate("UsersManager_InviteSuccessNotification",[e.inviteTokenExpiryDays]))},null,8,$e)])])):Object(o["createCommentVNode"])("",!0),e.isAdd?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ge,[Object(o["createElementVNode"])("ul",ze,[Object(o["createElementVNode"])("li",{class:Object(o["normalizeClass"])([{active:"basic"===e.activeTab},"menuBasicInfo"])},[Object(o["createElementVNode"])("a",{href:"",onClick:t[0]||(t[0]=Object(o["withModifiers"])((function(t){return e.activeTab="basic"}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_BasicInformation")),1)],2),Object(o["createElementVNode"])("li",{class:Object(o["normalizeClass"])([{active:"permissions"===e.activeTab},"menuPermissions"])},[Object(o["createElementVNode"])("a",{href:"",onClick:t[1]||(t[1]=Object(o["withModifiers"])((function(t){return e.activeTab="permissions"}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("UsersManager_Permissions")),1),e.userHasAccess||e.theUser.superuser_access?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",We))],2),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{key:0,class:Object(o["normalizeClass"])([{active:"superuser"===e.activeTab},"menuSuperuser"])},[Object(o["createElementVNode"])("a",{href:"",onClick:t[2]||(t[2]=Object(o["withModifiers"])((function(t){return e.activeTab="superuser"}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_SuperUserAccess")),1)],2)):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole&&e.theUser.uses_2fa&&!e.isAdd?(Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{key:1,class:Object(o["normalizeClass"])([{active:"2fa"===e.activeTab},"menuUserTwoFa"])},[Object(o["createElementVNode"])("a",{href:"",onClick:t[3]||(t[3]=Object(o["withModifiers"])((function(t){return e.activeTab="2fa"}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_TwoFactorAuthentication")),1)],2)):Object(o["createCommentVNode"])("",!0)]),Ye,Object(o["createElementVNode"])("div",{class:"entityCancel",onClick:t[4]||(t[4]=Object(o["withModifiers"])((function(t){return e.onDoneEditing()}),["prevent"]))},[Object(o["createElementVNode"])("a",Xe,[Je,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("UsersManager_BackToUser")),1)])])])),Object(o["createElementVNode"])("div",Ke,["basic"===e.activeTab?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Qe,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{modelValue:e.theUser.login,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.theUser.login=t}),disabled:e.isSavingUserInfo||!e.isAdd||e.isShowingPasswordConfirm,uicontrol:"text",name:"user_login",maxlength:100,title:e.translate("General_Username")},null,8,["modelValue","disabled","title"])]),Object(o["createElementVNode"])("div",null,[e.isPending?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,"model-value":e.theUser.password,disabled:e.isSavingUserInfo||"superuser"!==e.currentUserRole&&!e.isAdd||e.isShowingPasswordConfirm,"onUpdate:modelValue":t[6]||(t[6]=function(t){e.theUser.password=t,e.isPasswordModified=!0}),uicontrol:"password",name:"user_password",title:e.translate("General_Password")},null,8,["model-value","disabled","title"]))]),Object(o["createElementVNode"])("div",null,["superuser"===e.currentUserRole||e.isAdd?(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,modelValue:e.theUser.email,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.theUser.email=t}),disabled:e.isSavingUserInfo||"superuser"!==e.currentUserRole&&!e.isAdd||e.isShowingPasswordConfirm,uicontrol:"text",name:"user_email",maxlength:100,title:e.translate("UsersManager_Email")},null,8,["modelValue","disabled","title"])):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",null,[e.isAdd?(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,modelValue:e.firstSiteAccess,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.firstSiteAccess=t}),disabled:e.isSavingUserInfo,uicontrol:"site",name:"user_site","ui-control-attributes":{onlySitesWithAdminAccess:!0},title:e.translate("UsersManager_FirstWebsitePermission"),"inline-help":e.translate("UsersManager_FirstSiteInlineHelp")},null,8,["modelValue","disabled","title","inline-help"])):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("div",Ze,[Object(o["createElementVNode"])("div",et,["superuser"===e.currentUserRole||e.isAdd?(Object(o["openBlock"])(),Object(o["createBlock"])(l,{key:0,value:e.saveButtonLabel,disabled:e.isAdd&&(!e.firstSiteAccess||!e.firstSiteAccess.id),saving:e.isSavingUserInfo,onConfirm:e.saveUserInfo},null,8,["value","disabled","saving","onConfirm"])):Object(o["createCommentVNode"])("",!0)])]),e.user&&e.isPending?(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",tt,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_InvitationSent"))+" ",1),Object(o["createElementVNode"])("span",{class:"resend-link",onClick:t[9]||(t[9]=function(){return e.resendRequestedUser&&e.resendRequestedUser.apply(e,arguments)}),innerHTML:e.$sanitize(e.translate("UsersManager_ResendInvite")+"/"+e.translate("UsersManager_CopyLink"))},null,8,nt)])):Object(o["createCommentVNode"])("",!0),Object(o["createVNode"])(c,{modelValue:e.showPasswordConfirmationForInviteUser,"onUpdate:modelValue":t[10]||(t[10]=function(t){return e.showPasswordConfirmationForInviteUser=t}),onConfirmed:e.inviteUser},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])]),e.isAdd?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",st,[Object(o["createElementVNode"])("a",{href:"",class:"entityCancelLink",onClick:t[11]||(t[11]=Object(o["withModifiers"])((function(t){return e.onDoneEditing()}),["prevent"]))},[rt,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("UsersManager_BackToUser")),1)])])):Object(o["createCommentVNode"])("",!0)])):Object(o["createCommentVNode"])("",!0),e.isAdd?Object(o["createCommentVNode"])("",!0):Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ot,[e.theUser.superuser_access?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",it,[Object(o["createVNode"])(d,{"user-login":e.theUser.login,onUserHasAccessDetected:t[12]||(t[12]=function(t){return e.userHasAccess=t.hasAccess}),onAccessChanged:t[13]||(t[13]=function(t){return e.isUserModified=!0}),"access-levels":e.accessLevels,"filter-access-levels":e.filterAccessLevels},null,8,["user-login","access-levels","filter-access-levels"])])),e.theUser.superuser_access?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",at,Object(o["toDisplayString"])(e.translate("UsersManager_SuperUsersPermissionsNotice")),1)):Object(o["createCommentVNode"])("",!0)],512)),[[o["vShow"],"permissions"===e.activeTab]]),"superuser"!==e.activeTab||"superuser"!==e.currentUserRole||e.isAdd?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",lt,[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_SuperUserIntro1")),1),Object(o["createElementVNode"])("p",null,[Object(o["createElementVNode"])("strong",null,Object(o["toDisplayString"])(e.translate("UsersManager_SuperUserIntro2")),1)]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{modelValue:e.superUserAccessChecked,"onUpdate:modelValue":t[14]||(t[14]=function(t){return e.superUserAccessChecked=t}),onClick:t[15]||(t[15]=function(t){return e.confirmSuperUserChange()}),disabled:e.isSavingUserInfo,uicontrol:"checkbox",name:"superuser_access",title:e.translate("UsersManager_HasSuperUserAccess")},null,8,["modelValue","disabled","title"])]),Object(o["createVNode"])(c,{modelValue:e.showPasswordConfirmationForSuperUser,"onUpdate:modelValue":t[16]||(t[16]=function(t){return e.showPasswordConfirmationForSuperUser=t}),onConfirmed:e.toggleSuperuserAccess,onAborted:t[17]||(t[17]=function(t){return e.setSuperUserAccessChecked()})},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("UsersManager_AreYouSure")),1),e.theUser.superuser_access?(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",ct,Object(o["toDisplayString"])(e.translate("UsersManager_RemoveSuperuserAccessConfirm")),1)):Object(o["createCommentVNode"])("",!0),e.theUser.superuser_access?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",dt,Object(o["toDisplayString"])(e.translate("UsersManager_AddSuperuserAccessConfirm")),1))]})),_:1},8,["modelValue","onConfirmed"])])),"superuser"!==e.currentUserRole||e.isAdd?Object(o["createCommentVNode"])("",!0):Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ut,[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ResetTwoFactorAuthenticationInfo")),1),Object(o["createElementVNode"])("div",mt,[Object(o["createVNode"])(l,{saving:e.isResetting2FA,onConfirm:t[18]||(t[18]=function(t){return e.confirmReset2FA()}),value:e.translate("UsersManager_ResetTwoFactorAuthentication")},null,8,["saving","value"])]),Object(o["createVNode"])(c,{modelValue:e.showPasswordConfirmationFor2FA,"onUpdate:modelValue":t[19]||(t[19]=function(t){return e.showPasswordConfirmationFor2FA=t}),onConfirmed:e.reset2FA},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("UsersManager_AreYouSure")),1),Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])],512)),[[o["vShow"],"2fa"===e.activeTab]])])],512),[[m]]),Object(o["createVNode"])(c,{modelValue:e.isShowingPasswordConfirm,"onUpdate:modelValue":t[20]||(t[20]=function(t){return e.isShowingPasswordConfirm=t}),onConfirmed:e.updateUser},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("h2",{innerHTML:e.$sanitize(e.changePasswordTitle)},null,8,bt),Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])]})),_:1},8,["class","content-title"])}var gt={login:"",superuser_access:!1,uses_2fa:!1,password:"",email:"",invite_status:""},ft=Object(o["defineComponent"])({props:{user:Object,currentUserRole:{type:String,required:!0},accessLevels:{type:Array,required:!0},filterAccessLevels:{type:Array,required:!0},initialSiteId:{type:[String,Number],required:!0},initialSiteName:{type:String,required:!0},inviteTokenExpiryDays:{type:String,required:!0}},components:{ContentBlock:g["ContentBlock"],Field:f["Field"],SaveButton:f["SaveButton"],UserPermissionsEdit:Fe,PasswordConfirmation:f["PasswordConfirmation"]},directives:{Form:f["Form"]},data:function(){return{theUser:this.user||Object.assign({},gt),activeTab:"basic",permissionsForIdSite:1,isSavingUserInfo:!1,userHasAccess:!0,firstSiteAccess:{id:this.initialSiteId,name:this.initialSiteName},isUserModified:!1,isPasswordModified:!1,superUserAccessChecked:null,showPasswordConfirmationForSuperUser:!1,showPasswordConfirmationFor2FA:!1,showPasswordConfirmationForInviteUser:!1,isResetting2FA:!1,isShowingPasswordConfirm:!1}},emits:["done","updated","resendInvite"],watch:{user:function(e){this.onUserChange(e)}},created:function(){this.onUserChange(this.user)},methods:{onUserChange:function(e){this.theUser=e||Object.assign({},gt),this.theUser.password||this.resetPasswordVar(),this.setSuperUserAccessChecked()},confirmSuperUserChange:function(){this.showPasswordConfirmationForSuperUser=!0},confirmReset2FA:function(){this.showPasswordConfirmationFor2FA=!0},toggleSuperuserAccess:function(e){var t=this;this.isSavingUserInfo=!0,g["AjaxHelper"].post({method:"UsersManager.setSuperUserAccess"},{userLogin:this.theUser.login,hasSuperUserAccess:this.theUser.superuser_access?"0":"1",passwordConfirmation:e}).then((function(){t.theUser.superuser_access=!t.theUser.superuser_access})).catch((function(){})).then((function(){t.isSavingUserInfo=!1,t.setSuperUserAccessChecked()}))},saveUserInfo:function(){this.isAdd?this.showPasswordConfirmationForInviteUser=!0:this.isShowingPasswordConfirm=!0},resendRequestedUser:function(){this.$emit("resendInvite",{user:this.user})},inviteUser:function(e){var t=this;return this.isSavingUserInfo=!0,g["AjaxHelper"].post({method:"UsersManager.inviteUser"},{userLogin:this.theUser.login,email:this.theUser.email,initialIdSite:this.firstSiteAccess?this.firstSiteAccess.id:void 0,passwordConfirmation:e}).catch((function(e){throw t.isSavingUserInfo=!1,e})).then((function(){t.firstSiteAccess=null,t.isSavingUserInfo=!1,t.isUserModified=!0,t.theUser.invite_status="pending",t.resetPasswordVar(),t.showUserCreatedNotification(),t.$emit("updated",{user:Object(o["readonly"])(t.theUser)})}))},resetPasswordVar:function(){this.isAdd||(this.theUser.password="XXXXXXXX")},showUserSavedNotification:function(){g["NotificationsStore"].show({message:Object(g["translate"])("General_YourChangesHaveBeenSaved"),context:"success",type:"toast"})},showUserCreatedNotification:function(){g["NotificationsStore"].show({message:Object(g["translate"])("UsersManager_InviteSuccess"),context:"success",type:"toast"})},reset2FA:function(e){var t=this;return this.isResetting2FA=!0,g["AjaxHelper"].post({method:"TwoFactorAuth.resetTwoFactorAuth",userLogin:this.theUser.login,passwordConfirmation:e}).catch((function(e){throw t.isResetting2FA=!1,e})).then((function(){t.isResetting2FA=!1,t.theUser.uses_2fa=!1,t.activeTab="basic",t.showUserSavedNotification()}))},updateUser:function(e){var t=this;return this.isSavingUserInfo=!0,g["AjaxHelper"].post({method:"UsersManager.updateUser"},{userLogin:this.theUser.login,password:this.isPasswordModified&&this.theUser.password?this.theUser.password:void 0,passwordConfirmation:e,email:this.theUser.email}).then((function(){t.isSavingUserInfo=!1,t.isUserModified=!0,t.isPasswordModified=!1,t.resetPasswordVar(),t.showUserSavedNotification(),t.$emit("updated",{user:Object(o["readonly"])(t.theUser)})})).catch((function(){t.isSavingUserInfo=!1}))},setSuperUserAccessChecked:function(){this.superUserAccessChecked=!!this.theUser.superuser_access},onDoneEditing:function(){this.$emit("done",{isUserModified:this.isUserModified})}},computed:{formTitle:function(){return this.isAdd?Object(g["translate"])("UsersManager_AddNewUser"):""},saveButtonLabel:function(){return this.isAdd?Object(g["translate"])("UsersManager_InviteUser"):Object(g["translate"])("UsersManager_SaveBasicInfo")},isPending:function(){return!this.user||!("pending"!==this.user.invite_status&&!Number.isInteger(this.user.invite_status))},isAdd:function(){return!this.user},changePasswordTitle:function(){return Object(g["translate"])("UsersManager_AreYouSureChangeDetails","<strong>".concat(this.theUser.login,"</strong>"))}}});ft.render=pt;var ht=ft,Ot={class:"userListFilters row"},jt={class:"col s12 m12 l8"},vt={class:"input-field col s12 m3 l3"},Ct={id:"user-list-bulk-actions",class:"dropdown-content"},kt={class:"dropdown-trigger","data-target":"bulk-set-access"},yt={id:"bulk-set-access",class:"dropdown-content"},Nt=["onClick"],St={key:0},Vt={class:"input-field col s12 m3 l3"},Ut={class:"permissions-for-selector"},Et={class:"input-field col s12 m3 l3"},wt={class:"input-field col s12 m3 l3"},At={key:0,class:"input-field col s12 m12 l4 users-list-pagination-container"},Tt={class:"usersListPagination"},Mt={class:"pointer"},Bt={class:"counter"},_t={class:"pointer"},Dt={key:0,class:"roles-help-notification"},xt=["innerHTML"],Lt={class:"select-cell"},Rt={class:"checkbox-container"},Pt=Object(o["createElementVNode"])("span",null,null,-1),Ft={class:"first"},Ht={class:"role_header"},It={style:{"margin-right":"3.5px"}},qt=Object(o["createElementVNode"])("span",{class:"icon-help"},null,-1),$t=[qt],Gt={key:0},zt=["title"],Wt={key:2},Yt={class:"actions-cell-header"},Xt={key:0,class:"select-all-row"},Jt={colspan:"8"},Kt={key:0},Qt=["innerHTML"],Zt=["innerHTML"],en={key:1},tn=["innerHTML"],nn=["innerHTML"],sn=["id"],rn={class:"select-cell"},on={class:"checkbox-container"},an=["id","onUpdate:modelValue"],ln=Object(o["createElementVNode"])("span",null,null,-1),cn={id:"userLogin"},dn={class:"access-cell"},un={key:0,id:"email"},mn={key:1,id:"twofa"},bn={key:0,class:"icon-ok"},pn={key:1,class:"icon-close"},gn={key:2,id:"last_seen"},fn={id:"status"},hn=["title"],On={class:"center actions-cell"},jn=["onClick"],vn=Object(o["createElementVNode"])("span",{class:"icon-email"},null,-1),Cn=[vn],kn=["onClick"],yn=Object(o["createElementVNode"])("span",{class:"icon-edit"},null,-1),Nn=[yn],Sn=["onClick"],Vn=Object(o["createElementVNode"])("span",{class:"icon-delete"},null,-1),Un=[Vn],En=["innerHTML"],wn=["innerHTML"],An={class:"change-user-role-confirm-modal modal",ref:"changeUserRoleConfirmModal"},Tn={class:"modal-content"},Mn=["innerHTML"],Bn={key:1},_n=["innerHTML"],Dn=["innerHTML"],xn={class:"modal-footer"};function Ln(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("ActivityIndicator"),c=Object(o["resolveComponent"])("Notification"),d=Object(o["resolveComponent"])("ContentBlock"),u=Object(o["resolveComponent"])("PasswordConfirmation"),m=Object(o["resolveDirective"])("dropdown-menu"),b=Object(o["resolveDirective"])("content-table");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])(["pagedUsersList",{loading:e.isLoadingUsers}])},[Object(o["createElementVNode"])("div",Ot,[Object(o["createElementVNode"])("div",jt,[Object(o["createElementVNode"])("div",vt,[Object(o["withDirectives"])(Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["dropdown-trigger btn bulk-actions",{disabled:e.isBulkActionsDisabled}]),href:"","data-target":"user-list-bulk-actions"},[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_BulkActions")),1)],2),[[m]]),Object(o["createElementVNode"])("ul",Ct,[Object(o["createElementVNode"])("li",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("a",kt,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_SetPermission")),1)],512),[[m]]),Object(o["createElementVNode"])("ul",yt,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.bulkActionAccessLevels,(function(t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{key:t.key},[Object(o["createElementVNode"])("a",{href:"",onClick:Object(o["withModifiers"])((function(n){e.userToChange=null,e.roleToChangeTo=t.key,e.showAccessChangeConfirm()}),["prevent"])},Object(o["toDisplayString"])(t.value),9,Nt)])})),128))])]),Object(o["createElementVNode"])("li",null,[Object(o["createElementVNode"])("a",{href:"",onClick:t[0]||(t[0]=Object(o["withModifiers"])((function(t){e.userToChange=null,e.roleToChangeTo="noaccess",e.showAccessChangeConfirm()}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_RemovePermissions")),1)]),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("li",St,[Object(o["createElementVNode"])("a",{href:"",onClick:t[1]||(t[1]=Object(o["withModifiers"])((function(t){return e.showDeleteConfirm()}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_DeleteUsers")),1)])):Object(o["createCommentVNode"])("",!0)])]),Object(o["createElementVNode"])("div",Vt,[Object(o["createElementVNode"])("div",Ut,[Object(o["createVNode"])(a,{"model-value":e.userTextFilter,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.onUserTextFilterChange(t)}),name:"user-text-filter",uicontrol:"text","full-width":!0,placeholder:e.translate("UsersManager_UserSearch")},null,8,["model-value","placeholder"])])]),Object(o["createElementVNode"])("div",Et,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{"model-value":e.accessLevelFilter,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.accessLevelFilter=t,e.changeSearch({filter_access:e.accessLevelFilter,offset:0})}),name:"access-level-filter",uicontrol:"select",options:e.filterAccessLevels,"full-width":!0,placeholder:e.translate("UsersManager_FilterByAccess")},null,8,["model-value","options","placeholder"])])]),Object(o["createElementVNode"])("div",wt,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{"model-value":e.statusLevelFilter,"onUpdate:modelValue":t[4]||(t[4]=function(t){e.statusLevelFilter=t,e.changeSearch({filter_status:e.statusLevelFilter,offset:0})}),name:"status-level-filter",uicontrol:"select",options:e.filterStatusLevels,"full-width":!0,placeholder:e.translate("UsersManager_FilterByStatus")},null,8,["model-value","options","placeholder"])])])]),e.totalEntries>e.searchParams.limit?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",At,[Object(o["createElementVNode"])("div",Tt,[Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["btn prev",{disabled:e.searchParams.offset<=0}]),onClick:t[5]||(t[5]=Object(o["withModifiers"])((function(t){return e.gotoPreviousPage()}),["prevent"]))},[Object(o["createElementVNode"])("span",Mt,"« "+Object(o["toDisplayString"])(e.translate("General_Previous")),1)],2),Object(o["createElementVNode"])("div",Bt,[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])({visibility:e.isLoadingUsers?"hidden":"visible"})},Object(o["toDisplayString"])(e.translate("General_Pagination",e.paginationLowerBound,e.paginationUpperBound,e.totalEntries)),3),Object(o["createVNode"])(l,{loading:e.isLoadingUsers},null,8,["loading"])]),Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["btn next",{disabled:e.searchParams.offset+e.searchParams.limit>=e.totalEntries}]),onClick:t[6]||(t[6]=Object(o["withModifiers"])((function(t){return e.gotoNextPage()}),["prevent"]))},[Object(o["createElementVNode"])("span",_t,Object(o["toDisplayString"])(e.translate("General_Next"))+" »",1)],2)])])):Object(o["createCommentVNode"])("",!0)]),e.isRoleHelpToggled?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Dt,[Object(o["createVNode"])(c,{context:"info",type:"persistent",noclear:!0},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.rolesHelpText)},null,8,xt)]})),_:1})])):Object(o["createCommentVNode"])("",!0),Object(o["createVNode"])(d,null,{default:Object(o["withCtx"])((function(){return[Object(o["withDirectives"])(Object(o["createElementVNode"])("table",{id:"manageUsersTable",class:Object(o["normalizeClass"])({loading:e.isLoadingUsers})},[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",Lt,[Object(o["createElementVNode"])("span",Rt,[Object(o["createElementVNode"])("label",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"checkbox",id:"paged_users_select_all",checked:"checked","onUpdate:modelValue":t[7]||(t[7]=function(t){return e.isAllCheckboxSelected=t}),onChange:t[8]||(t[8]=function(t){return e.onAllCheckboxChange()})},null,544),[[o["vModelCheckbox"],e.isAllCheckboxSelected]]),Pt])])]),Object(o["createElementVNode"])("th",Ft,Object(o["toDisplayString"])(e.translate("UsersManager_Username")),1),Object(o["createElementVNode"])("th",Ht,[Object(o["createElementVNode"])("span",It,Object(o["toDisplayString"])(e.translate("UsersManager_RoleFor")),1),Object(o["createElementVNode"])("a",{href:"",class:Object(o["normalizeClass"])(["helpIcon",{sticky:e.isRoleHelpToggled}]),onClick:t[9]||(t[9]=Object(o["withModifiers"])((function(t){return e.isRoleHelpToggled=!e.isRoleHelpToggled}),["prevent"]))},$t,2),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{class:"permissions-for-selector","model-value":e.permissionsForSite,"onUpdate:modelValue":t[10]||(t[10]=function(t){e.onPermissionsForUpdate(t)}),uicontrol:"site","ui-control-attributes":{onlySitesWithAdminAccess:"superuser"!==e.currentUserRole}},null,8,["model-value","ui-control-attributes"])])]),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",Gt,Object(o["toDisplayString"])(e.translate("UsersManager_Email")),1)):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",{key:1,title:e.translate("UsersManager_UsesTwoFactorAuthentication")},Object(o["toDisplayString"])(e.translate("UsersManager_2FA")),9,zt)):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",Wt,Object(o["toDisplayString"])(e.translate("UsersManager_LastSeen")),1)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("UsersManager_Status")),1),Object(o["createElementVNode"])("th",Yt,[Object(o["createElementVNode"])("div",null,Object(o["toDisplayString"])(e.translate("General_Actions")),1)])])]),Object(o["createElementVNode"])("tbody",null,[e.isAllCheckboxSelected&&e.users.length&&e.users.length<e.totalEntries?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",Xt,[Object(o["createElementVNode"])("td",Jt,[e.areAllResultsSelected?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Kt,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.translate("UsersManager_TheDisplayedUsersAreSelected","<strong>".concat(e.users.length,"</strong>"))),style:{"margin-right":"3.5px"}},null,8,Qt),Object(o["createElementVNode"])("a",{class:"toggle-select-all-in-search",href:"#",onClick:t[11]||(t[11]=Object(o["withModifiers"])((function(t){return e.areAllResultsSelected=!e.areAllResultsSelected}),["prevent"])),innerHTML:e.$sanitize(e.translate("UsersManager_ClickToSelectAll","<strong>".concat(e.totalEntries,"</strong>")))},null,8,Zt)])),e.areAllResultsSelected?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",en,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.translate("UsersManager_AllUsersAreSelected","<strong>".concat(e.totalEntries,"</strong>"))),style:{"margin-right":"3.5px"}},null,8,tn),Object(o["createElementVNode"])("a",{class:"toggle-select-all-in-search",href:"#",onClick:t[12]||(t[12]=Object(o["withModifiers"])((function(t){return e.areAllResultsSelected=!e.areAllResultsSelected}),["prevent"])),innerHTML:e.$sanitize(e.translate("UsersManager_ClickToSelectDisplayedUsers","<strong>".concat(e.users.length,"</strong>")))},null,8,nn)])):Object(o["createCommentVNode"])("",!0)])])):Object(o["createCommentVNode"])("",!0),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.users,(function(n,s){return Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",{id:"row".concat(s),key:n.login},[Object(o["createElementVNode"])("td",rn,[Object(o["createElementVNode"])("span",on,[Object(o["createElementVNode"])("label",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"checkbox",id:"paged_users_select_row".concat(s),"onUpdate:modelValue":function(t){return e.selectedRows[s]=t},onClick:t[13]||(t[13]=function(t){return e.onRowSelected()})},null,8,an),[[o["vModelCheckbox"],e.selectedRows[s]]]),ln])])]),Object(o["createElementVNode"])("td",cn,Object(o["toDisplayString"])(n.login),1),Object(o["createElementVNode"])("td",dn,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{"model-value":n.role,"onUpdate:modelValue":function(t){e.userToChange=n,e.roleToChangeTo=t,e.showAccessChangeConfirm()},disabled:"superuser"===n.role,uicontrol:"select",options:"anonymous"===n.login?e.anonymousAccessLevels:"noaccess"===n.role?e.onlyRoleAccessLevels:e.accessLevels},null,8,["model-value","onUpdate:modelValue","disabled","options"])])]),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("td",un,Object(o["toDisplayString"])(n.email),1)):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("td",mn,[n.uses_2fa?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",bn)):Object(o["createCommentVNode"])("",!0),n.uses_2fa?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",pn))])):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("td",gn,Object(o["toDisplayString"])(n.last_seen?"".concat(n.last_seen," ago"):"-"),1)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("td",fn,[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(Number.isInteger(n.invite_status)?"pending":n.invite_status),title:"expired"===n.invite_status?e.translate("UsersManager_ExpiredInviteAutomaticallyRemoved","3"):""},Object(o["toDisplayString"])(e.getInviteStatus(n.invite_status)),11,hn)]),Object(o["createElementVNode"])("td",On,[("superuser"===e.currentUserRole||"admin"===e.currentUserRole&&n.invited_by===e.currentUserLogin)&&"active"!==n.invite_status?(Object(o["openBlock"])(),Object(o["createElementBlock"])("button",{key:0,class:"resend table-action",title:"Resend/Copy Invite Link",onClick:function(t){e.userToChange=n,e.resendRequestedUser()}},Cn,8,jn)):Object(o["createCommentVNode"])("",!0),"anonymous"!==n.login?(Object(o["openBlock"])(),Object(o["createElementBlock"])("button",{key:1,class:"edituser table-action",title:"Edit",onClick:function(t){return e.$emit("editUser",{user:n})}},Nn,8,kn)):Object(o["createCommentVNode"])("",!0),("superuser"===e.currentUserRole||"admin"===e.currentUserRole&&n.invited_by===e.currentUserLogin)&&"anonymous"!==n.login?(Object(o["openBlock"])(),Object(o["createElementBlock"])("button",{key:2,class:"deleteuser table-action",title:"Delete",onClick:function(t){e.userToChange=n,e.showDeleteConfirm()}},Un,8,Sn)):Object(o["createCommentVNode"])("",!0)])],8,sn)})),128))])],2),[[b]])]})),_:1}),Object(o["createVNode"])(u,{modelValue:e.showPasswordConfirmationForUserRemoval,"onUpdate:modelValue":t[14]||(t[14]=function(t){return e.showPasswordConfirmationForUserRemoval=t}),onConfirmed:e.deleteRequestedUsers,onAborted:t[15]||(t[15]=function(t){e.userToChange=null,e.roleToChangeTo=null})},{default:Object(o["withCtx"])((function(){return[e.userToChange?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h2",{key:0,innerHTML:e.$sanitize(e.translate("UsersManager_DeleteUserConfirmSingle","<strong>".concat(e.userToChange.login,"</strong>")))},null,8,En)):Object(o["createCommentVNode"])("",!0),e.userToChange?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("h2",{key:1,innerHTML:e.$sanitize(e.translate("UsersManager_DeleteUserConfirmMultiple","<strong>".concat(e.affectedUsersCount,"</strong>")))},null,8,wn)),Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"]),Object(o["createElementVNode"])("div",An,[Object(o["createElementVNode"])("div",Tn,[e.userToChange?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h3",{key:0,innerHTML:e.$sanitize(e.deleteUserPermConfirmSingleText)},null,8,Mn)):Object(o["createCommentVNode"])("",!0),e.userToChange&&"anonymous"===e.userToChange.login&&"view"===e.roleToChangeTo?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h3",Bn,[Object(o["createElementVNode"])("em",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_Note"))+": ",1),Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.translate("UsersManager_AnonymousUserRoleChangeWarning","anonymous",e.getRoleDisplay(e.roleToChangeTo)))},null,8,_n)])])):Object(o["createCommentVNode"])("",!0),e.userToChange?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",{key:2,innerHTML:e.$sanitize(e.deleteUserPermConfirmMultipleText)},null,8,Dn))]),Object(o["createElementVNode"])("div",xn,[Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[16]||(t[16]=Object(o["withModifiers"])((function(t){return e.changeUserRole()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("General_Yes")),1),Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[17]||(t[17]=Object(o["withModifiers"])((function(t){e.userToChange=null,e.roleToChangeTo=null}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_No")),1)])],512)],2)}var Rn=window,Pn=Rn.$,Fn=Object(o["defineComponent"])({props:{initialSiteId:{type:[String,Number],required:!0},initialSiteName:{type:String,required:!0},currentUserRole:String,isLoadingUsers:Boolean,accessLevels:{type:Array,required:!0},filterAccessLevels:{type:Array,required:!0},filterStatusLevels:{type:Array,required:!0},totalEntries:Number,users:{type:Array,required:!0},searchParams:{type:Object,required:!0}},components:{Field:f["Field"],ActivityIndicator:g["ActivityIndicator"],Notification:g["Notification"],ContentBlock:g["ContentBlock"],PasswordConfirmation:f["PasswordConfirmation"]},directives:{DropdownMenu:g["DropdownMenu"],ContentTable:g["ContentTable"]},data:function(){return{areAllResultsSelected:!1,selectedRows:{},isAllCheckboxSelected:!1,isBulkActionsDisabled:!0,userToChange:null,roleToChangeTo:null,accessLevelFilter:null,statusLevelFilter:null,isRoleHelpToggled:!1,userTextFilter:"",permissionsForSite:{id:this.initialSiteId,name:this.initialSiteName},showPasswordConfirmationForUserRemoval:!1}},emits:["editUser","changeUserRole","deleteUser","searchChange","resendInvite"],created:function(){this.onUserTextFilterChange=Object(g["debounce"])(this.onUserTextFilterChange,300)},watch:{users:function(){this.clearSelection()}},methods:{getInviteStatus:function(e){return Number.isInteger(e)?Object(g["translate"])("UsersManager_InviteDayLeft",e):"expired"===e?Object(g["translate"])("UsersManager_Expired"):Object(g["translate"])("UsersManager_Active")},onPermissionsForUpdate:function(e){this.permissionsForSite=e,this.changeSearch({idSite:this.permissionsForSite.id})},clearSelection:function(){this.selectedRows={},this.areAllResultsSelected=!1,this.isBulkActionsDisabled=!0,this.isAllCheckboxSelected=!1,this.userToChange=null},onAllCheckboxChange:function(){if(this.isAllCheckboxSelected){for(var e=0;e!==this.users.length;e+=1)this.selectedRows[e]=!0;this.isBulkActionsDisabled=!1}else this.clearSelection()},changeUserRole:function(){this.$emit("changeUserRole",{users:this.userOperationSubject,role:this.roleToChangeTo})},onRowSelected:function(){var e=this;setTimeout((function(){var t=e.selectedCount;e.isBulkActionsDisabled=0===t,e.isAllCheckboxSelected=t===e.users.length}))},deleteRequestedUsers:function(e){this.$emit("deleteUser",{users:this.userOperationSubject,password:e})},resendRequestedUser:function(){this.$emit("resendInvite",{user:this.userToChange})},showDeleteConfirm:function(){this.showPasswordConfirmationForUserRemoval=!0},showAccessChangeConfirm:function(){Pn(this.$refs.changeUserRoleConfirmModal).modal({dismissible:!1}).modal("open")},getRoleDisplay:function(e){var t=null;return this.accessLevels.forEach((function(n){n.key===e&&(t=n.value)})),t},changeSearch:function(e){var t=Object.assign(Object.assign({},this.searchParams),e);this.$emit("searchChange",{params:t})},gotoPreviousPage:function(){this.changeSearch({offset:Math.max(0,this.searchParams.offset-this.searchParams.limit)})},gotoNextPage:function(){var e=this.searchParams.offset+this.searchParams.limit;e>=this.totalEntries||this.changeSearch({offset:e})},onUserTextFilterChange:function(e){this.userTextFilter=e,this.changeSearch({filter_search:e,offset:0})}},computed:{currentUserLogin:function(){return g["Matomo"].userLogin},paginationLowerBound:function(){return this.searchParams.offset+1},paginationUpperBound:function(){if(null===this.totalEntries)return"?";var e=this.searchParams;return Math.min(e.offset+e.limit,this.totalEntries)},userOperationSubject:function(){return this.userToChange?[this.userToChange]:this.areAllResultsSelected?"all":this.selectedUsers},selectedUsers:function(){var e=this,t=this.users,n=[];return Object.keys(this.selectedRows).forEach((function(s){var r=parseInt(s,10);e.selectedRows[s]&&t[r]&&n.push(t[r])})),n},rolesHelpText:function(){var e="https://matomo.org/faq/general/faq_70/",t="https://matomo.org/faq/general/faq_69/";return Object(g["translate"])("UsersManager_RolesHelp",'<a href="'.concat(e,'" target="_blank" rel="noreferrer noopener">'),"</a>",'<a href="'.concat(t,'" target="_blank" rel="noreferrer noopener">'),"</a>")},affectedUsersCount:function(){return this.areAllResultsSelected?this.totalEntries||0:this.selectedCount},selectedCount:function(){var e=this,t=0;return Object.keys(this.selectedRows).forEach((function(n){e.selectedRows[n]&&(t+=1)})),t},deleteUserPermConfirmSingleText:function(){var e,t;return Object(g["translate"])("UsersManager_DeleteUserPermConfirmSingle","<strong>".concat((null===(e=this.userToChange)||void 0===e?void 0:e.login)||"","</strong>"),"<strong>".concat(this.getRoleDisplay(this.roleToChangeTo),"</strong>"),"<strong>".concat(g["Matomo"].helper.htmlEntities((null===(t=this.permissionsForSite)||void 0===t?void 0:t.name)||""),"</strong>"))},deleteUserPermConfirmMultipleText:function(){var e;return Object(g["translate"])("UsersManager_DeleteUserPermConfirmMultiple","<strong>".concat(this.affectedUsersCount,"</strong>"),"<strong>".concat(this.getRoleDisplay(this.roleToChangeTo),"</strong>"),"<strong>".concat(g["Matomo"].helper.htmlEntities((null===(e=this.permissionsForSite)||void 0===e?void 0:e.name)||""),"</strong>"))},bulkActionAccessLevels:function(){return this.accessLevels.filter((function(e){return"noaccess"!==e.key&&"superuser"!==e.key}))},anonymousAccessLevels:function(){return this.accessLevels.filter((function(e){return"noaccess"===e.key||"view"===e.key}))},onlyRoleAccessLevels:function(){return this.accessLevels.filter((function(e){return"role"===e.type}))}}});Fn.render=Ln;var Hn=Fn,In={class:"usersManager"},qn={key:0},$n={key:1},Gn={class:"row add-user-container"},zn={class:"col s12"},Wn={class:"input-field",style:{"margin-right":"3.5px"}},Yn={key:0,class:"input-field"},Xn={key:0},Jn={class:"resend-invite-confirm-modal modal",ref:"resendInviteConfirmModal"},Kn=Object(o["createElementVNode"])("div",{class:"btn-close modal-close"},[Object(o["createElementVNode"])("i",{class:"icon-close"})],-1),Qn={class:"modal-content"},Zn={class:"modal-title"},es=["innerHTML"],ts={class:"modal-footer"},ns={key:0,class:"success-copied"},ss=Object(o["createElementVNode"])("i",{class:"icon-success"},null,-1),rs={class:"add-existing-user-modal modal",ref:"addExistingUserModal"},os={class:"modal-content"},is={class:"modal-footer"};function as(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("EnrichedHeadline"),l=Object(o["resolveComponent"])("PagedUsersList"),c=Object(o["resolveComponent"])("UserEditForm"),d=Object(o["resolveComponent"])("Field"),u=Object(o["resolveComponent"])("PasswordConfirmation"),m=Object(o["resolveDirective"])("content-intro"),b=Object(o["resolveDirective"])("tooltips");return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",In,[Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("h2",null,[Object(o["createVNode"])(a,{"help-url":"https://matomo.org/docs/manage-users/","feature-name":"Users Management"},{default:Object(o["withCtx"])((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_ManageUsers")),1)]})),_:1})]),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",qn,Object(o["toDisplayString"])(e.translate("UsersManager_ManageUsersDesc")),1)):Object(o["createCommentVNode"])("",!0),"admin"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",$n,Object(o["toDisplayString"])(e.translate("UsersManager_ManageUsersAdminDesc")),1)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",Gn,[Object(o["createElementVNode"])("div",zn,[Object(o["createElementVNode"])("div",Wn,[Object(o["createElementVNode"])("a",{class:"btn add-new-user",onClick:t[0]||(t[0]=function(t){return e.onAddNewUser()})},Object(o["toDisplayString"])(e.translate("UsersManager_InviteNewUser")),1)]),"superuser"!==e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Yn,[Object(o["createElementVNode"])("a",{class:"btn add-existing-user",onClick:t[1]||(t[1]=function(t){return e.showAddExistingUserModal()})},Object(o["toDisplayString"])(e.translate("UsersManager_AddExistingUser")),1)])):Object(o["createCommentVNode"])("",!0)])]),Object(o["createVNode"])(l,{onEditUser:t[2]||(t[2]=function(t){return e.onEditUser(t.user)}),onChangeUserRole:t[3]||(t[3]=function(t){return e.onChangeUserRole(t.users,t.role)}),onDeleteUser:t[4]||(t[4]=function(t){return e.onDeleteUser(t.users,t.password)}),onSearchChange:t[5]||(t[5]=function(t){e.searchParams=t.params,e.fetchUsers()}),onResendInvite:t[6]||(t[6]=function(t){return e.showResendPopup(t.user)}),"initial-site-id":e.initialSiteId,"initial-site-name":e.initialSiteName,"is-loading-users":e.isLoadingUsers,"current-user-role":e.currentUserRole,"access-levels":e.accessLevels,"filter-access-levels":e.filterAccessLevels,"filter-status-levels":e.filterStatusLevels,"search-params":e.searchParams,users:e.users,"total-entries":e.totalEntries},null,8,["initial-site-id","initial-site-name","is-loading-users","current-user-role","access-levels","filter-access-levels","filter-status-levels","search-params","users","total-entries"])],512),[[m]])],512),[[o["vShow"],!e.isEditing]]),e.isEditing?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Xn,[Object(o["createVNode"])(c,{onDone:t[7]||(t[7]=function(t){return e.onDoneEditing(t.isUserModified)}),user:e.userBeingEdited,"current-user-role":e.currentUserRole,"invite-token-expiry-days":e.inviteTokenExpiryDays,"access-levels":e.accessLevels,"filter-access-levels":e.filterAccessLevels,"initial-site-id":e.initialSiteId,"initial-site-name":e.initialSiteName,onResendInvite:t[8]||(t[8]=function(t){return e.showResendPopup(t.user)}),onUpdated:t[9]||(t[9]=function(t){return e.userBeingEdited=t.user})},null,8,["user","current-user-role","invite-token-expiry-days","access-levels","filter-access-levels","initial-site-id","initial-site-name"])])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",Jn,[Kn,Object(o["createElementVNode"])("div",Qn,[Object(o["createElementVNode"])("h2",Zn,Object(o["toDisplayString"])(e.translate("UsersManager_ResendInvite")),1),e.userBeingEdited?(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",{key:0,innerHTML:e.$sanitize(e.translate("UsersManager_InviteConfirmMessage",["<strong>".concat(e.userBeingEdited.login,"</strong>"),"<strong>".concat(e.userBeingEdited.email,"</strong>")]))},null,8,es)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("p",null,[Object(o["createElementVNode"])("strong",null,Object(o["toDisplayString"])(e.translate("UsersManager_InviteActionNotes",e.inviteTokenExpiryDays)),1)])]),Object(o["createElementVNode"])("div",ts,[e.copied?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",ns,[ss,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("UsersManager_LinkCopied")),1)])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("button",{onClick:t[10]||(t[10]=function(t){return e.showInviteActionPasswordConfirm("copy")}),class:"btn btn-copy-link modal-action",style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("UsersManager_CopyLink")),1),Object(o["createElementVNode"])("button",{class:"btn btn-resend modal-action modal-no",onClick:t[11]||(t[11]=function(t){return e.showInviteActionPasswordConfirm("send")})},Object(o["toDisplayString"])(e.translate("UsersManager_ResendInvite")),1)])],512),Object(o["createElementVNode"])("div",rs,[Object(o["createElementVNode"])("div",os,[Object(o["createElementVNode"])("h3",null,Object(o["toDisplayString"])(e.translate("UsersManager_AddExistingUser")),1),Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_EnterUsernameOrEmail"))+":",1),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(d,{modelValue:e.addNewUserLoginEmail,"onUpdate:modelValue":t[12]||(t[12]=function(t){return e.addNewUserLoginEmail=t}),name:"add-existing-user-email",uicontrol:"text"},null,8,["modelValue"])])]),Object(o["createElementVNode"])("div",is,[Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[13]||(t[13]=Object(o["withModifiers"])((function(t){return e.addExistingUser()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("General_Add")),1),Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[14]||(t[14]=Object(o["withModifiers"])((function(t){return e.addNewUserLoginEmail=null}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_Cancel")),1)])],512),Object(o["createVNode"])(u,{modelValue:e.showPasswordConfirmationForInviteAction,"onUpdate:modelValue":t[15]||(t[15]=function(t){return e.showPasswordConfirmationForInviteAction=t}),onConfirmed:e.onInviteAction},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])],512)),[[b]])}var ls=20,cs=window,ds=cs.$,us=Object(o["defineComponent"])({props:{currentUserRole:{type:String,required:!0},initialSiteName:{type:String,required:!0},initialSiteId:{type:String,required:!0},accessLevels:{type:Array,required:!0},filterAccessLevels:{type:Array,required:!0},filterStatusLevels:{type:Array,required:!0},inviteTokenExpiryDays:{type:String,required:!0}},components:{PasswordConfirmation:f["PasswordConfirmation"],EnrichedHeadline:g["EnrichedHeadline"],PagedUsersList:Hn,UserEditForm:ht,Field:f["Field"]},directives:{ContentIntro:g["ContentIntro"],Tooltips:g["Tooltips"]},data:function(){return{isEditing:!!g["MatomoUrl"].urlParsed.value.showadduser,isCurrentUserSuperUser:!0,users:[],totalEntries:null,searchParams:{offset:0,limit:ls,filter_search:"",filter_access:"",filter_status:"",idSite:this.initialSiteId},isLoadingUsers:!1,userBeingEdited:null,addNewUserLoginEmail:"",copied:!1,loading:!1,showPasswordConfirmationForInviteAction:!1,inviteAction:""}},created:function(){this.fetchUsers()},watch:{limit:function(){this.fetchUsers()}},methods:{showInviteActionPasswordConfirm:function(e){this.loading||(this.showPasswordConfirmationForInviteAction=!0,this.inviteAction=e)},showResendPopup:function(e){this.userBeingEdited=e,ds(this.$refs.resendInviteConfirmModal).modal({dismissible:!1}).modal("open"),this.copied=!1},onInviteAction:function(e){"send"===this.inviteAction?this.onResendInvite(e):this.generateInviteLink(e)},onEditUser:function(e){g["Matomo"].helper.lazyScrollToContent(),this.isEditing=!0,this.userBeingEdited=e},onDoneEditing:function(e){this.isEditing=!1,e&&this.fetchUsers()},showAddExistingUserModal:function(){ds(this.$refs.addExistingUserModal).modal({dismissible:!1}).modal("open")},onChangeUserRole:function(e,t){var n=this;this.isLoadingUsers=!0,Promise.resolve().then((function(){return"all"===e?n.getAllUsersInSearch():e})).then((function(e){return e.filter((function(e){return"superuser"!==e.role})).map((function(e){return e.login}))})).then((function(e){var s,r=n.accessLevels.filter((function(e){return e.key===t})).map((function(e){return e.type}));return s=r.length&&"capability"===r[0]?e.map((function(e){return{method:"UsersManager.addCapabilities",userLogin:e,capabilities:t,idSites:n.searchParams.idSite}})):e.map((function(e){return{method:"UsersManager.setUserAccess",userLogin:e,access:t,idSites:n.searchParams.idSite}})),g["AjaxHelper"].fetch(s,{createErrorNotification:!0})})).catch((function(){})).then((function(){return n.fetchUsers()}))},getAllUsersInSearch:function(){return g["AjaxHelper"].fetch({method:"UsersManager.getUsersPlusRole",filter_search:this.searchParams.filter_search,filter_access:this.searchParams.filter_access,filter_status:this.searchParams.filter_status,idSite:this.searchParams.idSite,filter_limit:"-1"})},onDeleteUser:function(e,t){var n=this;this.isLoadingUsers=!0,Promise.resolve().then((function(){return"all"===e?n.getAllUsersInSearch():e})).then((function(e){return e.map((function(e){return e.login}))})).then((function(e){var n=e.map((function(e){return{method:"UsersManager.deleteUser",userLogin:e,passwordConfirmation:t}}));return g["AjaxHelper"].fetch(n,{createErrorNotification:!0})})).then((function(){g["NotificationsStore"].scrollToNotification(g["NotificationsStore"].show({id:"removeUserSuccess",message:Object(g["translate"])("UsersManager_DeleteSuccess"),context:"success",type:"toast"})),n.fetchUsers()}),(function(){"all"!==e&&e.length>1&&g["NotificationsStore"].show({id:"removeUserSuccess",message:Object(g["translate"])("UsersManager_DeleteNotSuccessful"),context:"warning",type:"toast"}),n.fetchUsers()}))},generateInviteLink:async function(e){if(!this.loading){this.loading=!0;try{var t=await g["AjaxHelper"].fetch({method:"UsersManager.generateInviteLink",userLogin:this.userBeingEdited.login,passwordConfirmation:e});await this.copyToClipboard(t.value)}catch(n){}this.loading=!1}},copyToClipboard:async function(e){try{var t=document.createElement("input");t.style.top="-100px",t.style.left="0",t.style.position="fixed",t.value=e,document.body.appendChild(t),t.select(),"https:"!==window.location.protocol?document.execCommand("copy"):await navigator.clipboard.writeText(t.value),document.body.removeChild(t),this.copied=!0}catch(s){var n=g["NotificationsStore"].show({message:"<strong>".concat(Object(g["translate"])("UsersManager_CopyDenied"),"</strong><br>\n").concat(Object(g["translate"])("UsersManager_CopyDeniedHints",['<br><span class="invite-link">'.concat(e,"</span>")])),id:"copyError",context:"error",type:"transient"});g["NotificationsStore"].scrollToNotification(n)}},onResendInvite:function(e){var t=this;""!==e&&g["AjaxHelper"].fetch({method:"UsersManager.resendInvite",userLogin:this.userBeingEdited.login,passwordConfirmation:e}).then((function(){t.fetchUsers(),ds(t.$refs.resendInviteConfirmModal).modal("close");var e=g["NotificationsStore"].show({message:Object(g["translate"])("UsersManager_InviteSuccess"),id:"resendInvite",context:"success",type:"transient"});g["NotificationsStore"].scrollToNotification(e)}))},fetchUsers:function(){var e=this;return this.isLoadingUsers=!0,g["AjaxHelper"].fetch(Object.assign(Object.assign({},this.searchParams),{},{method:"UsersManager.getUsersPlusRole"}),{returnResponseObject:!0}).then((function(t){var n=t.getRequestHandle();e.totalEntries=parseInt(n.getResponseHeader("x-matomo-total-results")||"0",10),e.users=n.responseJSON,e.isLoadingUsers=!1})).catch((function(){e.isLoadingUsers=!1}))},addExistingUser:function(){var e=this;return this.isLoadingUsers=!0,g["AjaxHelper"].fetch({method:"UsersManager.userExists",userLogin:this.addNewUserLoginEmail}).then((function(t){return t&&t.value?e.addNewUserLoginEmail:g["AjaxHelper"].fetch({method:"UsersManager.getUserLoginFromUserEmail",userEmail:e.addNewUserLoginEmail}).then((function(e){return e.value}))})).then((function(t){return g["AjaxHelper"].post({method:"UsersManager.setUserAccess"},{userLogin:t,access:"view",idSites:e.searchParams.idSite})})).then((function(){return e.fetchUsers()})).catch((function(){e.isLoadingUsers=!1}))},onAddNewUser:function(){var e={isAllowed:!0};g["Matomo"].postEvent("UsersManager.initAddUser",e),e&&!e.isAllowed||(this.isEditing=!0,this.userBeingEdited=null)}}});us.render=as;var ms=us,bs={key:0,class:"alert alert-info"},ps={key:1};function gs(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("SaveButton"),c=Object(o["resolveComponent"])("ContentBlock"),d=Object(o["resolveDirective"])("form");return Object(o["openBlock"])(),Object(o["createBlock"])(c,{"content-title":e.title},{default:Object(o["withCtx"])((function(){return[0===e.anonymousSites.length?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",bs,Object(o["toDisplayString"])(e.translate("UsersManager_NoteNoAnonymousUserAccessSettingsWontBeUsed2")),1)):Object(o["createCommentVNode"])("",!0),e.anonymousSites.length>0?Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ps,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"radio",name:"anonymousDefaultReport",modelValue:e.defaultReport,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.defaultReport=t}),introduction:e.translate("UsersManager_WhenUsersAreNotLoggedInAndVisitPiwikTheyShouldAccess"),options:e.defaultReportOptions},null,8,["modelValue","introduction","options"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"select",name:"anonymousDefaultReportWebsite",modelValue:e.defaultReportWebsite,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.defaultReportWebsite=t}),options:e.anonymousSites},null,8,["modelValue","options"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"radio",name:"anonymousDefaultDate",modelValue:e.defaultDate,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.defaultDate=t}),introduction:e.translate("UsersManager_ForAnonymousUsersReportDateToLoadByDefault"),options:e.availableDefaultDates},null,8,["modelValue","introduction","options"])]),Object(o["createVNode"])(l,{saving:e.loading,onConfirm:t[3]||(t[3]=function(t){return e.save()})},null,8,["saving"])],512)),[[d]]):Object(o["createCommentVNode"])("",!0)]})),_:1},8,["content-title"])}var fs=Object(o["defineComponent"])({props:{title:{type:String,required:!0},anonymousSites:{type:Array,required:!0},anonymousDefaultReport:{type:[String,Number],required:!0},anonymousDefaultSite:{type:String,required:!0},anonymousDefaultDate:{type:String,required:!0},availableDefaultDates:{type:Object,required:!0},defaultReportOptions:{type:Object,required:!0}},components:{ContentBlock:g["ContentBlock"],SaveButton:f["SaveButton"],Field:f["Field"]},directives:{Form:f["Form"]},data:function(){return{loading:!1,defaultReport:"".concat(this.anonymousDefaultReport),defaultReportWebsite:this.anonymousDefaultSite,defaultDate:this.anonymousDefaultDate}},methods:{save:function(){var e=this,t={anonymousDefaultReport:"1"===this.defaultReport?this.defaultReportWebsite:this.defaultReport,anonymousDefaultDate:this.defaultDate};this.loading=!0,g["AjaxHelper"].post({module:"UsersManager",action:"recordAnonymousUserSettings",format:"json"},t,{withTokenInUrl:!0}).then((function(){var e=g["NotificationsStore"].show({message:Object(g["translate"])("CoreAdminHome_SettingsSaveSuccess"),id:"anonymousUserSettings",context:"success",type:"transient"});g["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.loading=!1}))}}});fs.render=gs;var hs=fs,Os={id:"newsletterSignup"};function js(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("SaveButton"),c=Object(o["resolveComponent"])("ContentBlock");return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Os,[Object(o["createVNode"])(c,{"content-title":e.translate("UsersManager_NewsletterSignupTitle")},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"checkbox",name:"newsletterSignupCheckbox",id:"newsletterSignupCheckbox",modelValue:e.newsletterSignupCheckbox,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.newsletterSignupCheckbox=t}),"full-width":!0,title:e.signupTitleText},null,8,["modelValue","title"])]),Object(o["createVNode"])(l,{id:"newsletterSignupBtn",onConfirm:t[1]||(t[1]=function(t){return e.signupForNewsletter()}),disabled:!e.newsletterSignupCheckbox,value:e.newsletterSignupButtonTitle,saving:e.isProcessingNewsletterSignup},null,8,["disabled","value","saving"])]})),_:1},8,["content-title"])],512)),[[o["vShow"],e.showNewsletterSignup]])}var vs=Object(o["defineComponent"])({data:function(){return{showNewsletterSignup:!0,newsletterSignupCheckbox:!1,isProcessingNewsletterSignup:!1,newsletterSignupButtonTitle:Object(g["translate"])("General_Save")}},components:{ContentBlock:g["ContentBlock"],SaveButton:f["SaveButton"],Field:f["Field"]},computed:{signupTitleText:function(){return Object(g["translate"])("UsersManager_NewsletterSignupMessage",'<a href="https://matomo.org/privacy-policy/" target="_blank">',"</a>")}},methods:{signupForNewsletter:function(){var e=this;this.newsletterSignupButtonTitle=Object(g["translate"])("General_Loading"),this.isProcessingNewsletterSignup=!0,g["AjaxHelper"].fetch({module:"API",method:"UsersManager.newsletterSignup"},{withTokenInUrl:!0}).then((function(){e.isProcessingNewsletterSignup=!1,e.showNewsletterSignup=!1;var t=g["NotificationsStore"].show({message:Object(g["translate"])("UsersManager_NewsletterSignupSuccessMessage"),id:"newslettersignup",context:"success",type:"transient"});g["NotificationsStore"].scrollToNotification(t)})).catch((function(){e.isProcessingNewsletterSignup=!1;var t=g["NotificationsStore"].show({message:Object(g["translate"])("UsersManager_NewsletterSignupFailureMessage"),id:"newslettersignup",context:"error",type:"transient"});g["NotificationsStore"].scrollToNotification(t),e.newsletterSignupButtonTitle=Object(g["translate"])("General_PleaseTryAgain")}))}}});vs.render=js;var Cs=vs,ks={id:"userSettingsTable"},ys={key:0},Ns={id:"languageHelp",class:"inline-help-node"},Ss={target:"_blank",rel:"noreferrer noopener",href:"https://matomo.org/translations/"},Vs={class:"sites_autocomplete"};function Us(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("SiteSelector"),c=Object(o["resolveComponent"])("SaveButton"),d=Object(o["resolveComponent"])("PasswordConfirmation"),u=Object(o["resolveComponent"])("ContentBlock"),m=Object(o["resolveDirective"])("form");return Object(o["openBlock"])(),Object(o["createBlock"])(u,{"content-title":e.title,feature:"true"},{default:Object(o["withCtx"])((function(){return[Object(o["withDirectives"])(Object(o["createElementVNode"])("form",ks,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"text",name:"username",title:e.translate("General_Username"),disabled:!0,modelValue:e.username,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.username=t}),"inline-help":e.translate("UsersManager_YourUsernameCannotBeChanged")},null,8,["title","modelValue","inline-help"])]),e.isUsersAdminEnabled?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ys,[Object(o["createVNode"])(a,{uicontrol:"text",name:"email","model-value":e.email,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.email=t,e.doesRequirePasswordConfirmation=!0}),maxlength:100,title:e.translate("UsersManager_Email")},null,8,["model-value","title"])])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",Ns,[Object(o["createElementVNode"])("a",Ss,Object(o["toDisplayString"])(e.translate("LanguagesManager_AboutPiwikTranslations")),1)]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"select",name:"language",modelValue:e.language,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.language=t}),title:e.translate("General_Language"),options:e.languageOptions,"inline-help":"#languageHelp"},null,8,["modelValue","title","options"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"select",name:"timeformat",modelValue:e.timeformat,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.timeformat=t}),title:e.translate("General_TimeFormat"),options:e.timeFormats},null,8,["modelValue","title","options"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"radio",name:"defaultReport",modelValue:e.theDefaultReport,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.theDefaultReport=t}),introduction:e.translate("UsersManager_ReportToLoadByDefault"),title:e.translate("General_AllWebsitesDashboard"),options:e.defaultReportOptions},null,8,["modelValue","introduction","title","options"])]),Object(o["createElementVNode"])("div",Vs,[Object(o["createVNode"])(l,{modelValue:e.site,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.site=t}),"show-selected-site":!0,"switch-site-on-select":!1,"show-all-sites-item":!1,showselectedsite:!0,id:"defaultReportSiteSelector"},null,8,["modelValue"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"radio",name:"defaultDate",modelValue:e.theDefaultDate,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.theDefaultDate=t}),introduction:e.translate("UsersManager_ReportDateToLoadByDefault"),options:e.availableDefaultDates},null,8,["modelValue","introduction","options"])]),Object(o["createVNode"])(c,{onConfirm:t[7]||(t[7]=function(t){return e.save()}),saving:e.loading},null,8,["saving"]),Object(o["createVNode"])(d,{modelValue:e.showPasswordConfirmation,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.showPasswordConfirmation=t}),onConfirmed:e.doSave},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])],512),[[m]])]})),_:1},8,["content-title"])}var Es=Object(o["defineComponent"])({props:{isUsersAdminEnabled:{type:Boolean,required:!0},title:{type:String,required:!0},userLogin:{type:String,required:!0},userEmail:{type:String,required:!0},currentLanguageCode:{type:String,required:!0},languageOptions:{type:Object,required:!0},currentTimeformat:{type:Number,required:!0},timeFormats:{type:Object,required:!0},defaultReport:{type:[String,Number],required:!0},defaultReportOptions:{type:Object,required:!0},defaultReportIdSite:{type:[String,Number],required:!0},defaultReportSiteName:{type:String,required:!0},defaultDate:{type:String,required:!0},availableDefaultDates:{type:Object,required:!0}},components:{ContentBlock:g["ContentBlock"],SaveButton:f["SaveButton"],Field:f["Field"],SiteSelector:g["SiteSelector"],PasswordConfirmation:f["PasswordConfirmation"]},directives:{Form:f["Form"]},data:function(){return{doesRequirePasswordConfirmation:!1,username:this.userLogin,email:this.userEmail,language:this.currentLanguageCode,timeformat:this.currentTimeformat,theDefaultReport:this.defaultReport,site:{id:this.defaultReportIdSite,name:g["Matomo"].helper.htmlDecode(this.defaultReportSiteName)},theDefaultDate:this.defaultDate,loading:!1,showPasswordConfirmation:!1}},methods:{save:function(){this.doesRequirePasswordConfirmation?this.showPasswordConfirmation=!0:this.doSave()},doSave:function(e){var t=this,n={email:this.email,defaultReport:"MultiSites"===this.theDefaultReport?this.theDefaultReport:this.site.id,defaultDate:this.theDefaultDate,language:this.language,timeformat:this.timeformat};e&&(n.passwordConfirmation=e),this.loading=!0,g["AjaxHelper"].post({module:"UsersManager",action:"recordUserSettings",format:"json"},n,{withTokenInUrl:!0}).then((function(){var e=g["NotificationsStore"].show({message:Object(g["translate"])("CoreAdminHome_SettingsSaveSuccess"),id:"PersonalSettingsSuccess",context:"success",type:"transient"});g["NotificationsStore"].scrollToNotification(e),t.doesRequirePasswordConfirmation=!1,t.loading=!1})).catch((function(){t.loading=!1}))}}});Es.render=Us;var ws=Es,As={key:0},Ts={key:1,class:"alert alert-danger"},Ms=["action"],Bs=["value"],_s=["value"],Ds=["innerHTML"];function xs(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("ContentBlock");return Object(o["openBlock"])(),Object(o["createBlock"])(l,{"content-title":e.translate("UsersManager_AuthTokens")},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_TokenAuthIntro")),1),e.noDescription?(Object(o["openBlock"])(),Object(o["createElementBlock"])("br",As)):Object(o["createCommentVNode"])("",!0),e.noDescription?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ts,Object(o["toDisplayString"])(e.translate("General_Description"))+": "+Object(o["toDisplayString"])(e.translate("General_ValidatorErrorEmptyValue")),1)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("form",{action:e.addNewTokenFormUrl,method:"post",class:"addTokenForm"},[Object(o["createVNode"])(a,{uicontrol:"text",name:"description",title:e.translate("General_Description"),maxlength:100,required:!0,"inline-help":e.translate("UsersManager_AuthTokenPurpose"),modelValue:e.tokenDescription,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.tokenDescription=t})},null,8,["title","inline-help","modelValue"]),Object(o["createElementVNode"])("input",{type:"hidden",value:e.formNonce,name:"nonce"},null,8,Bs),Object(o["createElementVNode"])("input",{type:"submit",value:e.translate("UsersManager_CreateNewToken"),class:"btn",style:{"margin-right":"3.5px"}},null,8,_s),Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.cancelLink)},null,8,Ds)],8,Ms)]})),_:1},8,["content-title"])}var Ls=Object(o["defineComponent"])({props:{noDescription:Boolean,formNonce:String},components:{ContentBlock:g["ContentBlock"],Field:f["Field"]},data:function(){return{tokenDescription:""}},computed:{addNewTokenFormUrl:function(){return"?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"addNewToken"})))},cancelLink:function(){var e="?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"userSecurity"})));return Object(g["translate"])("General_OrCancel","<a class='entityCancelLink' href='".concat(e,"'>"),"</a>")}}});Ls.render=xs;var Rs=Ls,Ps=Object(o["createElementVNode"])("br",null,null,-1),Fs={style:{"font-size":"40px"},class:"generatedTokenAuth"},Hs=["href"];function Is(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("ContentBlock"),l=Object(o["resolveDirective"])("select-on-focus");return Object(o["openBlock"])(),Object(o["createBlock"])(a,{"content-title":e.translate("UsersManager_TokenSuccessfullyGenerated")},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("p",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_PleaseStoreToken"))+" ",1),Ps,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("UsersManager_DoNotStoreToken")),1)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("pre",Fs,[Object(o["createElementVNode"])("code",null,Object(o["toDisplayString"])(e.generatedToken),1)],512),[[l,{}]]),Object(o["createElementVNode"])("a",{href:e.userSecurityLink,class:"btn",style:{height:"auto"}},Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmTokenCopied"))+" "+Object(o["toDisplayString"])(e.translate("UsersManager_GoBackSecurityPage")),9,Hs)]})),_:1},8,["content-title"])}var qs=Object(o["defineComponent"])({props:{generatedToken:{type:String,required:!0}},components:{ContentBlock:g["ContentBlock"]},directives:{SelectOnFocus:g["SelectOnFocus"]},computed:{userSecurityLink:function(){return"?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"userSecurity"})))}}});qs.render=Is;var $s=qs,Gs=["action"],zs=["value"],Ws={key:0},Ys={class:"alert alert-info"},Xs=["value"],Js={key:1},Ks={class:"alert alert-danger"},Qs=["innerHTML"],Zs={ref:"afterPassword"},er=Object(o["createElementVNode"])("a",{name:"authtokens",id:"authtokens"},null,-1),tr={key:0},nr={class:"listAuthTokens"},sr=["title"],rr={key:0},or=["colspan","innerHTML"],ir={class:"creationDate"},ar=["title"],lr=["action"],cr=["value"],dr=["value"],ur=["title"],mr=Object(o["createElementVNode"])("span",{class:"icon-delete"},null,-1),br=[mr],pr={class:"tableActionBar"},gr=["href"],fr=Object(o["createElementVNode"])("span",{class:"icon-add"},null,-1),hr=["action"],Or=["value"],jr=Object(o["createElementVNode"])("input",{name:"idtokenauth",type:"hidden",value:"all"},null,-1),vr={type:"submit",class:"table-action"},Cr=Object(o["createElementVNode"])("span",{class:"icon-delete"},null,-1);function kr(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("ContentBlock"),c=Object(o["resolveDirective"])("content-table");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",null,[e.isUsersAdminEnabled?(Object(o["openBlock"])(),Object(o["createBlock"])(l,{key:0,"content-title":e.translate("General_ChangePassword"),feature:"true"},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("form",{id:"userSettingsTable",method:"post",action:e.recordPasswordChangeAction},[Object(o["createElementVNode"])("input",{type:"hidden",value:e.changePasswordNonce,name:"nonce"},null,8,zs),e.isValidHost?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ws,[Object(o["createVNode"])(a,{uicontrol:"password",name:"password",autocomplete:!1,modelValue:e.password,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.password=t}),title:e.translate("Login_NewPassword"),"inline-help":e.translate("UsersManager_IfYouWouldLikeToChangeThePasswordTypeANewOne")},null,8,["modelValue","title","inline-help"]),Object(o["createVNode"])(a,{uicontrol:"password",name:"passwordBis",autocomplete:!1,modelValue:e.passwordBis,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.passwordBis=t}),title:e.translate("Login_NewPasswordRepeat"),"inline-help":e.translate("UsersManager_TypeYourPasswordAgain")},null,8,["modelValue","title","inline-help"]),Object(o["createVNode"])(a,{uicontrol:"password",name:"passwordConfirmation",autocomplete:!1,modelValue:e.passwordConfirmation,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.passwordConfirmation=t}),title:e.translate("UsersManager_YourCurrentPassword"),"inline-help":e.translate("UsersManager_TypeYourCurrentPassword")},null,8,["modelValue","title","inline-help"]),Object(o["createElementVNode"])("div",Ys,Object(o["toDisplayString"])(e.translate("UsersManager_PasswordChangeTerminatesOtherSessions")),1),Object(o["createElementVNode"])("input",{type:"submit",value:e.translate("General_Save"),class:"btn"},null,8,Xs)])):Object(o["createCommentVNode"])("",!0),e.isValidHost?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Js,[Object(o["createElementVNode"])("div",Ks,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_InjectedHostCannotChangePwd",e.invalidHost))+" ",1),e.isSuperUser?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,innerHTML:e.$sanitize(e.emailYourAdminText)},null,8,Qs))])]))],8,Gs)]})),_:1},8,["content-title"])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",Zs,[e.isUsersAdminEnabled&&e.afterPasswordComponent?(Object(o["openBlock"])(),Object(o["createBlock"])(Object(o["resolveDynamicComponent"])(e.afterPasswordComponent),{key:0})):Object(o["createCommentVNode"])("",!0)],512),er,Object(o["createVNode"])(l,{"content-title":e.translate("UsersManager_AuthTokens")},{default:Object(o["withCtx"])((function(){var t,n;return[Object(o["createElementVNode"])("p",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_TokenAuthIntro"))+" ",1),e.hasTokensWithExpireDate?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",tr,Object(o["toDisplayString"])(e.translate("UsersManager_ExpiredTokensDeleteAutomatically")),1)):Object(o["createCommentVNode"])("",!0)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("table",nr,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_CreationDate")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Description")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("UsersManager_LastUsed")),1),e.hasTokensWithExpireDate?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",{key:0,title:e.translate("UsersManager_TokensWithExpireDateCreationBySystem")},Object(o["toDisplayString"])(e.translate("UsersManager_ExpireDate")),9,sr)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Actions")),1)])]),Object(o["createElementVNode"])("tbody",null,[null!==(t=e.tokens)&&void 0!==t&&t.length?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",rr,[Object(o["createElementVNode"])("td",{colspan:e.hasTokensWithExpireDate?5:4,innerHTML:e.$sanitize(e.noTokenCreatedYetText)},null,8,or)])),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.tokens||[],(function(t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",{key:t.idusertokenauth},[Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("span",ir,Object(o["toDisplayString"])(t.date_created),1)]),Object(o["createElementVNode"])("td",null,Object(o["toDisplayString"])(t.description),1),Object(o["createElementVNode"])("td",null,Object(o["toDisplayString"])(t.last_used?t.last_used:e.translate("General_Never")),1),e.hasTokensWithExpireDate?(Object(o["openBlock"])(),Object(o["createElementBlock"])("td",{key:0,title:e.translate("UsersManager_TokensWithExpireDateCreationBySystem")},Object(o["toDisplayString"])(t.date_expired?t.date_expired:e.translate("General_Never")),9,ar)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("form",{method:"post",action:e.deleteTokenAction,style:{display:"inline"}},[Object(o["createElementVNode"])("input",{name:"nonce",type:"hidden",value:e.deleteTokenNonce},null,8,cr),Object(o["createElementVNode"])("input",{name:"idtokenauth",type:"hidden",value:t.idusertokenauth},null,8,dr),Object(o["createElementVNode"])("button",{type:"submit",class:"table-action",title:e.translate("General_Delete")},br,8,ur)],8,lr)])])})),128))])],512),[[c]]),Object(o["createElementVNode"])("div",pr,[Object(o["createElementVNode"])("a",{href:e.addNewTokenLink,class:"addNewToken"},[fr,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("UsersManager_CreateNewToken")),1)],8,gr),null!==(n=e.tokens)&&void 0!==n&&n.length?(Object(o["openBlock"])(),Object(o["createElementBlock"])("form",{key:0,method:"post",action:e.deleteTokenAction,style:{display:"inline"}},[Object(o["createElementVNode"])("input",{name:"nonce",type:"hidden",value:e.deleteTokenNonce},null,8,Or),jr,Object(o["createElementVNode"])("button",vr,[Cr,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("UsersManager_DeleteAllTokens")),1)])],8,hr)):Object(o["createCommentVNode"])("",!0)])]})),_:1},8,["content-title"])])}var yr=Object(o["defineComponent"])({props:{deleteTokenNonce:String,tokens:Array,hasTokensWithExpireDate:Boolean,isUsersAdminEnabled:Boolean,changePasswordNonce:String,isValidHost:Boolean,isSuperUser:Boolean,invalidHost:String,afterPasswordEventContent:String,invalidHostMailLinkStart:String},components:{ContentBlock:g["ContentBlock"],Field:f["Field"]},directives:{ContentTable:g["ContentTable"]},data:function(){return{password:"",passwordBis:"",passwordConfirmation:""}},mounted:function(){var e=this.$refs.afterPassword;g["Matomo"].helper.compileVueEntryComponents(e)},computed:{recordPasswordChangeAction:function(){return"?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"recordPasswordChange"})))},emailYourAdminText:function(){return Object(g["translate"])("UsersManager_EmailYourAdministrator",this.invalidHostMailLinkStart||"","</a>")},noTokenCreatedYetText:function(){var e="?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"addNewToken"})));return Object(g["translate"])("UsersManager_NoTokenCreatedYetCreateNow",'<a href="'.concat(e,'">'),"</a>")},deleteTokenAction:function(){return"?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"deleteToken"})))},addNewTokenLink:function(){return"?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"addNewToken"})))},afterPasswordComponent:function(){if(!this.afterPasswordEventContent)return null;var e=this.$refs.afterPassword;return Object(o["markRaw"])({template:this.afterPasswordEventContent,beforeUnmount:function(){g["Matomo"].helper.destroyVueComponent(e)}})}}});yr.render=kr;var Nr=yr,Sr=["innerHTML"],Vr={style:{"margin-left":"20px"}},Ur=["href"],Er=Object(o["createElementVNode"])("br",null,null,-1);function wr(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("PersonalSettings"),l=Object(o["resolveComponent"])("NewsletterSettings"),c=Object(o["resolveComponent"])("PluginSettings"),d=Object(o["resolveComponent"])("ContentBlock");return Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],null,[Object(o["createVNode"])(a,{"is-users-admin-enabled":e.isUsersAdminEnabled,title:e.title,"user-login":e.userLogin,"user-email":e.userEmail,"current-language-code":e.currentLanguageCode,"language-options":e.languageOptions,"current-timeformat":e.currentTimeformat,"time-formats":e.timeFormats,"default-report":e.defaultReport,"default-report-options":e.defaultReportOptions,"default-report-id-site":e.defaultReportIdSite,"default-report-site-name":e.defaultReportSiteName,"default-date":e.defaultDate,"available-default-dates":e.availableDefaultDates},null,8,["is-users-admin-enabled","title","user-login","user-email","current-language-code","language-options","current-timeformat","time-formats","default-report","default-report-options","default-report-id-site","default-report-site-name","default-date","available-default-dates"]),e.showNewsletterSignup?(Object(o["openBlock"])(),Object(o["createBlock"])(l,{key:0})):Object(o["createCommentVNode"])("",!0),Object(o["createVNode"])(c,{mode:"user"}),Object(o["createVNode"])(d,{"content-title":e.translate("UsersManager_ExcludeVisitsViaCookie")},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("p",{innerHTML:e.$sanitize(e.yourVisitsAreText)},null,8,Sr),Object(o["createElementVNode"])("span",Vr,[Object(o["createElementVNode"])("a",{href:e.setIgnoreCookieLink},[Object(o["createTextVNode"])(" › "+Object(o["toDisplayString"])(e.ignoreCookieSet?e.translate("UsersManager_ClickHereToDeleteTheCookie"):e.translate("UsersManager_ClickHereToSetTheCookieOnDomain",e.piwikHost))+" ",1),Er],8,Ur)])]})),_:1},8,["content-title"])],64)}var Ar=Object(o["defineComponent"])({props:{isUsersAdminEnabled:{type:Boolean,required:!0},title:{type:String,required:!0},userLogin:{type:String,required:!0},userEmail:{type:String,required:!0},currentLanguageCode:{type:String,required:!0},languageOptions:{type:Object,required:!0},currentTimeformat:{type:Number,required:!0},timeFormats:{type:Object,required:!0},defaultReport:{type:[String,Number],required:!0},defaultReportOptions:{type:Object,required:!0},defaultReportIdSite:{type:[String,Number],required:!0},defaultReportSiteName:{type:String,required:!0},defaultDate:{type:String,required:!0},availableDefaultDates:{type:Object,required:!0},showNewsletterSignup:Boolean,ignoreCookieSet:Boolean,ignoreSalt:[String,Number,Boolean],piwikHost:{type:String,required:!0}},components:{ContentBlock:g["ContentBlock"],PersonalSettings:ws,NewsletterSettings:Cs,PluginSettings:f["PluginSettings"]},computed:{yourVisitsAreText:function(){return this.ignoreCookieSet?Object(g["translate"])("UsersManager_YourVisitsAreIgnoredOnDomain","<strong>",this.piwikHost,"</strong>"):Object(g["translate"])("UsersManager_YourVisitsAreNotIgnored","<strong>","</strong>")},setIgnoreCookieLink:function(){return"?".concat(g["MatomoUrl"].stringify({ignoreSalt:this.ignoreSalt,module:"UsersManager",action:"setIgnoreCookie"}),"#excludeCookie")}}});Ar.render=wr;var Tr=Ar; + */var C=function(){function e(){var t=this;h(this,e),v(this,"privateState",Object(o["reactive"])({isLoading:!1,capabilities:[]})),v(this,"state",Object(o["computed"])((function(){return Object(o["readonly"])(t.privateState)}))),v(this,"capabilities",Object(o["computed"])((function(){return t.state.value.capabilities}))),v(this,"isLoading",Object(o["computed"])((function(){return t.state.value.isLoading}))),v(this,"fetchPromise",void 0)}return j(e,[{key:"init",value:function(){return this.fetchCapabilities()}},{key:"fetchCapabilities",value:function(){var e=this;return this.fetchPromise||(this.privateState.isLoading=!0,this.fetchPromise=g["AjaxHelper"].fetch({method:"UsersManager.getAvailableCapabilities"}).then((function(t){return e.privateState.capabilities=t,e.capabilities.value})).finally((function(){e.privateState.isLoading=!1}))),this.fetchPromise}}]),e}(),k=new C,y=window,N=y.$,S=Object(o["defineComponent"])({props:{idsite:[String,Number],siteName:{type:String,required:!0},userLogin:{type:String,required:!0},userRole:{type:String,required:!0},capabilities:Array},components:{Field:f["Field"]},data:function(){return{theCapabilities:this.capabilities||[],isBusy:!1,isAddingCapability:!1,capabilityToAddId:null,capabilityToRemoveId:null,capabilityToAddOrRemove:null}},emits:["change"],watch:{capabilities:function(e){e&&(this.theCapabilities=e)}},created:function(){var e=this;k.init(),this.capabilities?this.theCapabilities=this.capabilities:(this.isBusy=!0,g["AjaxHelper"].fetch({method:"UsersManager.getUsersPlusRole",limit:"1",filter_search:this.userLogin}).then((function(e){return e&&e.capabilities?e.capabilities:[]})).then((function(t){e.theCapabilities=t})).finally((function(){e.isBusy=!1})))},methods:{onToggleCapability:function(e){var t=this;this.isAddingCapability=e;var n=e?this.capabilityToAddId:this.capabilityToRemoveId;this.capabilityToAddOrRemove=null,this.availableCapabilities.forEach((function(e){e.id===n&&(t.capabilityToAddOrRemove=e)})),this.$refs.confirmCapabilityToggleModal&&N(this.$refs.confirmCapabilityToggleModal).modal({dismissible:!1,yes:function(){return null}}).modal("open")},toggleCapability:function(){this.isAddingCapability?this.addCapability(this.capabilityToAddOrRemove):this.removeCapability(this.capabilityToAddOrRemove)},isIncludedInRole:function(e){return-1!==(e.includedInRoles||[]).indexOf(this.userRole)},getCapabilitiesList:function(){var e=this,t=[];return this.availableCapabilities.forEach((function(n){e.isIncludedInRole(n)||e.capabilitiesSet[n.id]&&t.push(n.id)})),t},addCapability:function(e){var t=this;this.isBusy=!0,g["AjaxHelper"].post({method:"UsersManager.addCapabilities"},{userLogin:this.userLogin,capabilities:e.id,idSites:this.idsite}).then((function(){t.$emit("change",t.getCapabilitiesList())})).finally((function(){t.isBusy=!1,t.capabilityToAddOrRemove=null,t.capabilityToAddId=null,t.capabilityToRemoveId=null}))},removeCapability:function(e){var t=this;this.isBusy=!0,g["AjaxHelper"].post({method:"UsersManager.removeCapabilities"},{userLogin:this.userLogin,capabilities:e.id,idSites:this.idsite}).then((function(){t.$emit("change",t.getCapabilitiesList())})).finally((function(){t.isBusy=!1,t.capabilityToAddOrRemove=null,t.capabilityToAddId=null,t.capabilityToRemoveId=null}))}},computed:{availableCapabilities:function(){return k.capabilities.value},confirmAddCapabilityToggleContent:function(){return Object(g["translate"])("UsersManager_AreYouSureAddCapability","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.capabilityToAddOrRemove?this.capabilityToAddOrRemove.name:"","</strong>"),"<strong>".concat(this.siteNameText,"</strong>"))},confirmCapabilityToggleContent:function(){return Object(g["translate"])("UsersManager_AreYouSureRemoveCapability","<strong>".concat(this.capabilityToAddOrRemove?this.capabilityToAddOrRemove.name:"","</strong>"),"<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.siteNameText,"</strong>"))},siteNameText:function(){return g["Matomo"].helper.htmlEntities(this.siteName)},availableCapabilitiesGrouped:function(){var e=this,t=this.availableCapabilities.filter((function(t){return!e.capabilitiesSet[t.id]})).map((function(e){return{group:e.category,key:e.id,value:e.name,tooltip:e.description}}));return t.sort((function(e,t){return e.group===t.group?e.value===t.value?0:e.value<t.value?-1:1:e.group<t.group?-1:1})),t},capabilitiesSet:function(){var e=this,t={},n=this.theCapabilities;return(n||[]).forEach((function(e){t[e]=!0})),(this.availableCapabilities||[]).forEach((function(n){e.isIncludedInRole(n)&&(t[n.id]=!0)})),t},actualCapabilities:function(){var e=this.capabilitiesSet;return this.availableCapabilities.filter((function(t){return!!e[t.id]}))}}});S.render=p;var V=S,U={key:0,class:"row"},E={class:"row to-all-websites"},w={class:"col s12"},A={style:{"margin-right":"3.5px"}},T={id:"all-sites-access-select",style:{"margin-right":"3.5px"}},M={style:{"margin-top":"18px"}},B={class:"filters row"},_={class:"col s12 m12 l8"},D={class:"input-field bulk-actions",style:{"margin-right":"3.5px"}},x={id:"user-permissions-edit-bulk-actions",class:"dropdown-content"},L={class:"dropdown-trigger","data-target":"user-permissions-bulk-set-access"},R={id:"user-permissions-bulk-set-access",class:"dropdown-content"},P=["onClick"],F={class:"input-field site-filter",style:{"margin-right":"3.5px"}},H=["value","placeholder"],I={class:"input-field access-filter",style:{"margin-right":"3.5px"}},q={key:0,class:"col s12 m12 l4 sites-for-permission-pagination-container"},$={class:"sites-for-permission-pagination"},G={class:"counter"},z=["textContent"],W={class:"roles-help-notification"},Y=["innerHTML"],X={class:"capabilities-help-notification"},J={id:"sitesForPermission"},K={class:"select-cell"},Q={class:"checkbox-container"},Z=["checked"],ee=Object(o["createElementVNode"])("span",null,null,-1),te={class:"role_header"},ne=["innerHTML"],se=Object(o["createElementVNode"])("span",{class:"icon-help"},null,-1),re=[se],oe={class:"capabilities_header"},ie=["innerHTML"],ae=Object(o["createElementVNode"])("span",{class:"icon-help"},null,-1),le=[ae],ce={key:0,class:"select-all-row"},de={colspan:"4"},ue={key:0},me=["innerHTML"],be=["innerHTML"],pe={key:1},ge=["innerHTML"],fe=["innerHTML"],he={class:"select-cell"},Oe={class:"checkbox-container"},je=["id","onUpdate:modelValue"],ve=Object(o["createElementVNode"])("span",null,null,-1),Ce={class:"role-select"},ke={class:"delete-access-confirm-modal modal",ref:"deleteAccessConfirmModal"},ye={class:"modal-content"},Ne=["innerHTML"],Se=["innerHTML"],Ve={class:"modal-footer"},Ue={class:"change-access-confirm-modal modal",ref:"changeAccessConfirmModal"},Ee={class:"modal-content"},we=["innerHTML"],Ae=["innerHTML"],Te={class:"modal-footer"},Me={class:"confirm-give-access-all-sites modal",ref:"confirmGiveAccessAllSitesModal"},Be={class:"modal-content"},_e=["innerHTML"],De={class:"modal-footer"};function xe(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Notification"),l=Object(o["resolveComponent"])("Field"),c=Object(o["resolveComponent"])("CapabilitiesEdit"),d=Object(o["resolveDirective"])("dropdown-menu"),u=Object(o["resolveDirective"])("content-table");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])(["userPermissionsEdit",{loading:e.isLoadingAccess}])},[e.hasAccessToAtLeastOneSite?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",U,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{context:"warning",type:"transient",noclear:!0},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("strong",null,Object(o["toDisplayString"])(e.translate("General_Warning"))+":",1),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("UsersManager_NoAccessWarning")),1)]})),_:1})])])),Object(o["createElementVNode"])("div",E,[Object(o["createElementVNode"])("div",w,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("span",A,Object(o["toDisplayString"])(e.translate("UsersManager_GiveAccessToAll"))+":",1),Object(o["createElementVNode"])("div",T,[Object(o["createVNode"])(l,{modelValue:e.allWebsitesAccssLevelSet,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.allWebsitesAccssLevelSet=t}),uicontrol:"select",options:e.filteredAccessLevels,"full-width":!0},null,8,["modelValue","options"])]),Object(o["createElementVNode"])("a",{href:"",class:Object(o["normalizeClass"])(["btn",{disabled:e.isGivingAccessToAllSites}]),onClick:t[1]||(t[1]=Object(o["withModifiers"])((function(t){return e.showChangeAccessAllSitesModal()}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_Apply")),3)]),Object(o["createElementVNode"])("p",M,Object(o["toDisplayString"])(e.translate("UsersManager_OrManageIndividually"))+":",1)])]),Object(o["createElementVNode"])("div",B,[Object(o["createElementVNode"])("div",_,[Object(o["createElementVNode"])("div",D,[Object(o["withDirectives"])(Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["dropdown-trigger btn",{disabled:e.isBulkActionsDisabled}]),href:"","data-target":"user-permissions-edit-bulk-actions"},[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_BulkActions")),1)],2),[[d,{activates:"#user-permissions-edit-bulk-actions"}]]),Object(o["createElementVNode"])("ul",x,[Object(o["createElementVNode"])("li",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("a",L,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_SetPermission")),1)],512),[[d,{activates:"#user-permissions-bulk-set-access"}]]),Object(o["createElementVNode"])("ul",R,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.filteredAccessLevels,(function(t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{key:t.key},[Object(o["createElementVNode"])("a",{href:"",onClick:Object(o["withModifiers"])((function(n){e.siteAccessToChange=null,e.roleToChangeTo=t.key,e.showChangeAccessConfirm()}),["prevent"])},Object(o["toDisplayString"])(t.value),9,P)])})),128))])]),Object(o["createElementVNode"])("li",null,[Object(o["createElementVNode"])("a",{href:"",onClick:t[2]||(t[2]=Object(o["withModifiers"])((function(t){e.siteAccessToChange=null,e.roleToChangeTo="noaccess",e.showRemoveAccessConfirm()}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_RemovePermissions")),1)])])]),Object(o["createElementVNode"])("div",F,[Object(o["createElementVNode"])("input",{type:"text",value:e.siteNameFilter,onKeydown:t[3]||(t[3]=function(t){e.onChangeSiteFilter(t)}),onChange:t[4]||(t[4]=function(t){e.onChangeSiteFilter(t)}),placeholder:e.translate("UsersManager_FilterByWebsite")},null,40,H)]),Object(o["createElementVNode"])("div",I,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(l,{modelValue:e.accessLevelFilter,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.accessLevelFilter=t}),uicontrol:"select",options:e.filteredSelectAccessLevels,"full-width":!0,placeholder:e.translate("UsersManager_FilterByAccess")},null,8,["modelValue","options","placeholder"])])])]),e.totalEntries>e.limit?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",q,[Object(o["createElementVNode"])("div",$,[Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["prev",{disabled:e.offset<=0}])},[Object(o["createElementVNode"])("span",{class:"pointer",onClick:t[6]||(t[6]=function(t){return e.gotoPreviousPage()})},"« "+Object(o["toDisplayString"])(e.translate("General_Previous")),1)],2),Object(o["createElementVNode"])("span",G,[Object(o["createElementVNode"])("span",{textContent:Object(o["toDisplayString"])(e.paginationText)},null,8,z)]),Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["next",{disabled:e.offset+e.limit>=e.totalEntries}])},[Object(o["createElementVNode"])("span",{class:"pointer",onClick:t[7]||(t[7]=function(t){return e.gotoNextPage()})},Object(o["toDisplayString"])(e.translate("General_Next"))+" »",1)],2)])])):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",W,[e.isRoleHelpToggled?(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,context:"info",type:"persistent",noclear:!0},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.rolesHelpText)},null,8,Y)]})),_:1})):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",X,[e.isCapabilitiesHelpToggled?(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,context:"info",type:"persistent",noclear:!0},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.translate("UsersManager_CapabilitiesHelp")),1)]})),_:1})):Object(o["createCommentVNode"])("",!0)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("table",J,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",K,[Object(o["createElementVNode"])("span",Q,[Object(o["createElementVNode"])("label",null,[Object(o["createElementVNode"])("input",{type:"checkbox",id:"perm_edit_select_all",checked:e.isAllCheckboxSelected,onChange:t[8]||(t[8]=function(t){return e.onAllCheckboxChange(t)})},null,40,Z),ee])])]),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Name")),1),Object(o["createElementVNode"])("th",te,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize("".concat(e.translate("UsersManager_Role")," "))},null,8,ne),Object(o["createElementVNode"])("a",{href:"",class:Object(o["normalizeClass"])(["helpIcon",{sticky:e.isRoleHelpToggled}]),onClick:t[9]||(t[9]=Object(o["withModifiers"])((function(t){return e.isRoleHelpToggled=!e.isRoleHelpToggled}),["prevent"]))},re,2)]),Object(o["createElementVNode"])("th",oe,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize("".concat(e.translate("UsersManager_Capabilities")," "))},null,8,ie),Object(o["createElementVNode"])("a",{href:"",class:Object(o["normalizeClass"])(["helpIcon",{sticky:e.isCapabilitiesHelpToggled}]),onClick:t[10]||(t[10]=Object(o["withModifiers"])((function(t){return e.isCapabilitiesHelpToggled=!e.isCapabilitiesHelpToggled}),["prevent"]))},le,2)])])]),Object(o["createElementVNode"])("tbody",null,[e.isAllCheckboxSelected&&e.siteAccess.length<e.totalEntries?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",ce,[Object(o["createElementVNode"])("td",de,[e.areAllResultsSelected?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ue,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.theDisplayedWebsitesAreSelectedText),style:{"margin-right":"3.5px"}},null,8,me),Object(o["createElementVNode"])("a",{href:"#",onClick:t[11]||(t[11]=Object(o["withModifiers"])((function(t){return e.areAllResultsSelected=!e.areAllResultsSelected}),["prevent"])),innerHTML:e.$sanitize(e.clickToSelectAllText)},null,8,be)])),e.areAllResultsSelected?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",pe,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.allWebsitesAreSelectedText),style:{"margin-right":"3.5px"}},null,8,ge),Object(o["createElementVNode"])("a",{href:"#",onClick:t[12]||(t[12]=Object(o["withModifiers"])((function(t){return e.areAllResultsSelected=!e.areAllResultsSelected}),["prevent"])),innerHTML:e.$sanitize(e.clickToSelectDisplayedWebsitesText)},null,8,fe)])):Object(o["createCommentVNode"])("",!0)])])):Object(o["createCommentVNode"])("",!0),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.siteAccess,(function(n,s){return Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",{key:n.idsite},[Object(o["createElementVNode"])("td",he,[Object(o["createElementVNode"])("span",Oe,[Object(o["createElementVNode"])("label",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"checkbox",id:"perm_edit_select_row".concat(s),"onUpdate:modelValue":function(t){return e.selectedRows[s]=t},onClick:t[13]||(t[13]=function(t){return e.onRowSelected()})},null,8,je),[[o["vModelCheckbox"],e.selectedRows[s]]]),ve])])]),Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(n.site_name),1)]),Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("div",Ce,[Object(o["createVNode"])(l,{"model-value":n.role,"onUpdate:modelValue":function(t){e.onRoleChange(n,t)},uicontrol:"select",options:e.filteredAccessLevels,"full-width":!0},null,8,["model-value","onUpdate:modelValue","options"])])]),Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(c,{idsite:n.idsite,"site-name":n.site_name,"user-login":e.userLogin,"user-role":n.role,capabilities:n.capabilities,onChange:t[14]||(t[14]=function(t){return e.fetchAccess()})},null,8,["idsite","site-name","user-login","user-role","capabilities"])])])])})),128))])],512),[[u]]),Object(o["createElementVNode"])("div",ke,[Object(o["createElementVNode"])("div",ye,[e.siteAccessToChange?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h3",{key:0,innerHTML:e.$sanitize(e.deletePermConfirmSingleText)},null,8,Ne)):Object(o["createCommentVNode"])("",!0),e.siteAccessToChange?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",{key:1,innerHTML:e.$sanitize(e.deletePermConfirmMultipleText)},null,8,Se))]),Object(o["createElementVNode"])("div",Ve,[Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[15]||(t[15]=Object(o["withModifiers"])((function(t){return e.changeUserRole()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("General_Yes")),1),Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[16]||(t[16]=Object(o["withModifiers"])((function(t){e.siteAccessToChange=null,e.roleToChangeTo=null}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_No")),1)])],512),Object(o["createElementVNode"])("div",Ue,[Object(o["createElementVNode"])("div",Ee,[e.siteAccessToChange?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h3",{key:0,innerHTML:e.$sanitize(e.changePermToSiteConfirmSingleText)},null,8,we)):Object(o["createCommentVNode"])("",!0),e.siteAccessToChange?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",{key:1,innerHTML:e.$sanitize(e.changePermToSiteConfirmMultipleText)},null,8,Ae))]),Object(o["createElementVNode"])("div",Te,[Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[17]||(t[17]=Object(o["withModifiers"])((function(t){return e.changeUserRole()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("General_Yes")),1),Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[18]||(t[18]=Object(o["withModifiers"])((function(t){e.siteAccessToChange.role=e.previousRole,e.siteAccessToChange=null,e.roleToChangeTo=null}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_No")),1)])],512),Object(o["createElementVNode"])("div",Me,[Object(o["createElementVNode"])("div",Be,[Object(o["createElementVNode"])("h3",{innerHTML:e.$sanitize(e.changePermToAllSitesConfirmText)},null,8,_e),Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ChangePermToAllSitesConfirm2")),1)]),Object(o["createElementVNode"])("div",De,[Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[19]||(t[19]=Object(o["withModifiers"])((function(t){return e.giveAccessToAllSites()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("General_Yes")),1),Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[20]||(t[20]=function(e){return e.preventDefault()})},Object(o["toDisplayString"])(e.translate("General_No")),1)])],512)],2)}var Le=window,Re=Le.$,Pe=Object(o["defineComponent"])({props:{userLogin:{type:String,required:!0},limit:{type:Number,default:10},accessLevels:{type:Array,required:!0},filterAccessLevels:{type:Array,required:!0}},components:{Notification:g["Notification"],Field:f["Field"],CapabilitiesEdit:V},directives:{DropdownMenu:g["DropdownMenu"],ContentTable:g["ContentTable"]},data:function(){return{siteAccess:[],offset:0,totalEntries:null,accessLevelFilter:"",siteNameFilter:"",isLoadingAccess:!1,allWebsitesAccssLevelSet:"view",isAllCheckboxSelected:!1,selectedRows:{},isBulkActionsDisabled:!0,areAllResultsSelected:!1,previousRole:null,hasAccessToAtLeastOneSite:!0,isRoleHelpToggled:!1,isCapabilitiesHelpToggled:!1,isGivingAccessToAllSites:!1,roleToChangeTo:null,siteAccessToChange:null}},emits:["userHasAccessDetected","accessChanged"],created:function(){var e=this;this.onChangeSiteFilter=Object(g["debounce"])(this.onChangeSiteFilter,300),Object(o["watch"])((function(){return e.allPropsWatch}),(function(){e.limit&&e.fetchAccess()})),this.fetchAccess()},watch:{accessLevelFilter:function(){this.offset=0,this.fetchAccess()}},methods:{onAllCheckboxChange:function(e){var t=this;this.isAllCheckboxSelected=e.target.checked,this.isAllCheckboxSelected?(this.siteAccess.forEach((function(e,n){t.selectedRows[n]=!0})),this.isBulkActionsDisabled=!1):this.clearSelection()},clearSelection:function(){this.selectedRows={},this.areAllResultsSelected=!1,this.isBulkActionsDisabled=!0,this.isAllCheckboxSelected=!1,this.siteAccessToChange=null},onRowSelected:function(){var e=this;setTimeout((function(){var t=e.selectedRowsCount;e.isBulkActionsDisabled=0===t,e.isAllCheckboxSelected=t===e.siteAccess.length}))},fetchAccess:function(){var e=this;return this.isLoadingAccess=!0,g["AjaxHelper"].fetch({method:"UsersManager.getSitesAccessForUser",limit:this.limit,offset:this.offset,filter_search:this.siteNameFilter,filter_access:this.accessLevelFilter,userLogin:this.userLogin},{returnResponseObject:!0}).then((function(t){var n=t.getRequestHandle();e.isLoadingAccess=!1,e.siteAccess=n.responseJSON,e.totalEntries=parseInt(n.getResponseHeader("x-matomo-total-results"),10)||0,e.hasAccessToAtLeastOneSite=!!n.getResponseHeader("x-matomo-has-some"),e.$emit("userHasAccessDetected",{hasAccess:e.hasAccessToAtLeastOneSite}),e.clearSelection()})).catch((function(){e.isLoadingAccess=!1,e.clearSelection()}))},gotoPreviousPage:function(){this.offset=Math.max(0,this.offset-this.limit),this.fetchAccess()},gotoNextPage:function(){var e=this.offset+this.limit;e>=(this.totalEntries||0)||(this.offset=e,this.fetchAccess())},showRemoveAccessConfirm:function(){Re(this.$refs.deleteAccessConfirmModal).modal({dismissible:!1}).modal("open")},changeUserRole:function(){var e=this,t=function(){var t=[];return Object.keys(e.selectedRows).forEach((function(n){e.selectedRows[n]&&e.siteAccess[n]&&t.push(e.siteAccess[n].idsite)})),t},n=function(){return g["AjaxHelper"].fetch({method:"UsersManager.getSitesAccessForUser",filter_search:e.siteNameFilter,filter_access:e.accessLevelFilter,userLogin:e.userLogin,filter_limit:"-1"}).then((function(e){return e.map((function(e){return e.idsite}))}))};return this.isLoadingAccess=!0,Promise.resolve().then((function(){return e.siteAccessToChange?[e.siteAccessToChange.idsite]:e.areAllResultsSelected?n():t()})).then((function(t){return g["AjaxHelper"].post({method:"UsersManager.setUserAccess"},{userLogin:e.userLogin,access:e.roleToChangeTo,idSites:t})})).catch((function(){})).then((function(){return e.$emit("accessChanged"),e.fetchAccess()}))},showChangeAccessConfirm:function(){Re(this.$refs.changeAccessConfirmModal).modal({dismissible:!1}).modal("open")},getRoleDisplay:function(e){var t=null;return this.filteredAccessLevels.forEach((function(n){n.key===e&&(t=n.value)})),t},giveAccessToAllSites:function(){var e=this;this.isGivingAccessToAllSites=!0,g["AjaxHelper"].fetch({method:"SitesManager.getSitesWithAdminAccess",filter_limit:-1}).then((function(t){var n=t.map((function(e){return e.idsite}));return g["AjaxHelper"].post({method:"UsersManager.setUserAccess"},{userLogin:e.userLogin,access:e.allWebsitesAccssLevelSet,idSites:n})})).then((function(){return e.fetchAccess()})).finally((function(){e.isGivingAccessToAllSites=!1}))},showChangeAccessAllSitesModal:function(){Re(this.$refs.confirmGiveAccessAllSitesModal).modal({dismissible:!1}).modal("open")},onChangeSiteFilter:function(e){var t=this;setTimeout((function(){var n=e.target.value;t.siteNameFilter!==n&&(t.siteNameFilter=n,t.offset=0,t.fetchAccess())}))},onRoleChange:function(e,t){this.previousRole=e.role,this.roleToChangeTo=t,this.siteAccessToChange=e,this.showChangeAccessConfirm()}},computed:{rolesHelpText:function(){return Object(g["translate"])("UsersManager_RolesHelp",'<a href="https://matomo.org/faq/general/faq_70/" target="_blank" rel="noreferrer noopener">',"</a>",'<a href="https://matomo.org/faq/general/faq_69/" target="_blank" rel="noreferrer noopener">',"</a>")},theDisplayedWebsitesAreSelectedText:function(){var e=Object(g["translate"])("UsersManager_TheDisplayedWebsitesAreSelected","<strong>".concat(this.siteAccess.length,"</strong>"));return"".concat(e," ")},clickToSelectAllText:function(){return Object(g["translate"])("UsersManager_ClickToSelectAll","<strong>".concat(this.totalEntries,"</strong>"))},allWebsitesAreSelectedText:function(){return Object(g["translate"])("UsersManager_AllWebsitesAreSelected","<strong>".concat(this.totalEntries,"</strong>"))},clickToSelectDisplayedWebsitesText:function(){return Object(g["translate"])("UsersManager_ClickToSelectDisplayedWebsites","<strong>".concat(this.siteAccess.length,"</strong>"))},deletePermConfirmSingleText:function(){return Object(g["translate"])("UsersManager_DeletePermConfirmSingle","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.siteAccessToChangeName,"</strong>"))},deletePermConfirmMultipleText:function(){return Object(g["translate"])("UsersManager_DeletePermConfirmMultiple","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.affectedSitesCount,"</strong>"))},changePermToSiteConfirmSingleText:function(){return Object(g["translate"])("UsersManager_ChangePermToSiteConfirmSingle","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.siteAccessToChangeName,"</strong>"),"<strong>".concat(this.getRoleDisplay(this.roleToChangeTo),"</strong>"))},changePermToSiteConfirmMultipleText:function(){return Object(g["translate"])("UsersManager_ChangePermToSiteConfirmMultiple","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.affectedSitesCount,"</strong>"),"<strong>".concat(this.getRoleDisplay(this.roleToChangeTo),"</strong>"))},changePermToAllSitesConfirmText:function(){return Object(g["translate"])("UsersManager_ChangePermToAllSitesConfirm","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.getRoleDisplay(this.allWebsitesAccssLevelSet),"</strong>"))},paginationLowerBound:function(){return this.offset+1},paginationUpperBound:function(){return this.totalEntries?Math.min(this.offset+this.limit,this.totalEntries):"?"},filteredAccessLevels:function(){return this.accessLevels.filter((function(e){return"superuser"!==e.key&&"role"===e.type}))},filteredSelectAccessLevels:function(){return this.filterAccessLevels.filter((function(e){return"superuser"!==e.key}))},selectedRowsCount:function(){var e=0;return Object.values(this.selectedRows).forEach((function(t){t&&(e+=1)})),e},affectedSitesCount:function(){return this.areAllResultsSelected?this.totalEntries:this.selectedRowsCount},allPropsWatch:function(){return this.userLogin,this.limit,this.accessLevels,this.filterAccessLevels,Date.now()},siteAccessToChangeName:function(){return this.siteAccessToChange?g["Matomo"].helper.htmlEntities(this.siteAccessToChange.site_name):""},paginationText:function(){var e=Object(g["translate"])("General_Pagination","".concat(this.paginationLowerBound),"".concat(this.paginationUpperBound),"".concat(this.totalEntries));return" ".concat(e," ")}}});Pe.render=xe;var Fe=Pe,He={class:"row"},Ie={key:0,class:"col s12 m6 invite-notes"},qe={class:"form-help"},$e=["innerHTML"],Ge={key:1,class:"col m2 entityList"},ze={class:"listCircle"},We={key:0,class:"icon-warning"},Ye=Object(o["createElementVNode"])("div",{class:"save-button-spacer hide-on-small-only"},null,-1),Xe={href:"",class:"entityCancelLink"},Je=Object(o["createElementVNode"])("span",{class:"icon-arrow-left-2"},null,-1),Ke={class:"visibleTab col m10"},Qe={key:0,class:"basic-info-tab"},Ze={class:"form-group row",style:{position:"relative"}},et={class:"col s12 m6 save-button"},tt={key:0,class:"resend-notes"},nt=["innerHTML"],st={key:0,class:"entityCancel"},rt=Object(o["createElementVNode"])("span",{class:"icon icon-arrow-left-2"},null,-1),ot={key:1,class:"user-permissions"},it={key:0},at={key:1,class:"alert alert-info"},lt={key:2,class:"superuser-access form-group"},ct={key:0},dt={key:1},ut={key:3,class:"twofa-reset form-group"},mt={class:"resetTwoFa"},bt=["innerHTML"];function pt(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("SaveButton"),c=Object(o["resolveComponent"])("PasswordConfirmation"),d=Object(o["resolveComponent"])("UserPermissionsEdit"),u=Object(o["resolveComponent"])("ContentBlock"),m=Object(o["resolveDirective"])("form");return Object(o["openBlock"])(),Object(o["createBlock"])(u,{class:Object(o["normalizeClass"])(["userEditForm",{loading:e.isSavingUserInfo}]),"content-title":"".concat(e.formTitle," ").concat(e.isAdd?"":"".concat(e.theUser.login))},{default:Object(o["withCtx"])((function(){return[Object(o["withDirectives"])(Object(o["createElementVNode"])("div",He,[e.isAdd?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ie,[Object(o["createElementVNode"])("div",qe,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.translate("UsersManager_InviteSuccessNotification",[e.inviteTokenExpiryDays]))},null,8,$e)])])):Object(o["createCommentVNode"])("",!0),e.isAdd?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ge,[Object(o["createElementVNode"])("ul",ze,[Object(o["createElementVNode"])("li",{class:Object(o["normalizeClass"])([{active:"basic"===e.activeTab},"menuBasicInfo"])},[Object(o["createElementVNode"])("a",{href:"",onClick:t[0]||(t[0]=Object(o["withModifiers"])((function(t){return e.activeTab="basic"}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_BasicInformation")),1)],2),Object(o["createElementVNode"])("li",{class:Object(o["normalizeClass"])([{active:"permissions"===e.activeTab},"menuPermissions"])},[Object(o["createElementVNode"])("a",{href:"",onClick:t[1]||(t[1]=Object(o["withModifiers"])((function(t){return e.activeTab="permissions"}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("UsersManager_Permissions")),1),e.userHasAccess||e.theUser.superuser_access?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",We))],2),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{key:0,class:Object(o["normalizeClass"])([{active:"superuser"===e.activeTab},"menuSuperuser"])},[Object(o["createElementVNode"])("a",{href:"",onClick:t[2]||(t[2]=Object(o["withModifiers"])((function(t){return e.activeTab="superuser"}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_SuperUserAccess")),1)],2)):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole&&e.theUser.uses_2fa&&!e.isAdd?(Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{key:1,class:Object(o["normalizeClass"])([{active:"2fa"===e.activeTab},"menuUserTwoFa"])},[Object(o["createElementVNode"])("a",{href:"",onClick:t[3]||(t[3]=Object(o["withModifiers"])((function(t){return e.activeTab="2fa"}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_TwoFactorAuthentication")),1)],2)):Object(o["createCommentVNode"])("",!0)]),Ye,Object(o["createElementVNode"])("div",{class:"entityCancel",onClick:t[4]||(t[4]=Object(o["withModifiers"])((function(t){return e.onDoneEditing()}),["prevent"]))},[Object(o["createElementVNode"])("a",Xe,[Je,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("UsersManager_BackToUser")),1)])])])),Object(o["createElementVNode"])("div",Ke,["basic"===e.activeTab?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Qe,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{modelValue:e.theUser.login,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.theUser.login=t}),disabled:e.isSavingUserInfo||!e.isAdd||e.isShowingPasswordConfirm,uicontrol:"text",name:"user_login",maxlength:100,title:e.translate("General_Username")},null,8,["modelValue","disabled","title"])]),Object(o["createElementVNode"])("div",null,[e.isPending?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,"model-value":e.theUser.password,disabled:e.isSavingUserInfo||"superuser"!==e.currentUserRole&&!e.isAdd||e.isShowingPasswordConfirm,"onUpdate:modelValue":t[6]||(t[6]=function(t){e.theUser.password=t,e.isPasswordModified=!0}),uicontrol:"password",name:"user_password",title:e.translate("General_Password")},null,8,["model-value","disabled","title"]))]),Object(o["createElementVNode"])("div",null,["superuser"===e.currentUserRole||e.isAdd?(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,modelValue:e.theUser.email,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.theUser.email=t}),disabled:e.isSavingUserInfo||"superuser"!==e.currentUserRole&&!e.isAdd||e.isShowingPasswordConfirm,uicontrol:"text",name:"user_email",maxlength:100,title:e.translate("UsersManager_Email")},null,8,["modelValue","disabled","title"])):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",null,[e.isAdd?(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,modelValue:e.firstSiteAccess,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.firstSiteAccess=t}),disabled:e.isSavingUserInfo,uicontrol:"site",name:"user_site","ui-control-attributes":{onlySitesWithAdminAccess:!0},title:e.translate("UsersManager_FirstWebsitePermission"),"inline-help":e.translate("UsersManager_FirstSiteInlineHelp")},null,8,["modelValue","disabled","title","inline-help"])):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("div",Ze,[Object(o["createElementVNode"])("div",et,["superuser"===e.currentUserRole||e.isAdd?(Object(o["openBlock"])(),Object(o["createBlock"])(l,{key:0,value:e.saveButtonLabel,disabled:e.isAdd&&(!e.firstSiteAccess||!e.firstSiteAccess.id),saving:e.isSavingUserInfo,onConfirm:e.saveUserInfo},null,8,["value","disabled","saving","onConfirm"])):Object(o["createCommentVNode"])("",!0)])]),e.user&&e.isPending?(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",tt,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_InvitationSent"))+" ",1),Object(o["createElementVNode"])("span",{class:"resend-link",onClick:t[9]||(t[9]=function(){return e.resendRequestedUser&&e.resendRequestedUser.apply(e,arguments)}),innerHTML:e.$sanitize(e.translate("UsersManager_ResendInvite")+"/"+e.translate("UsersManager_CopyLink"))},null,8,nt)])):Object(o["createCommentVNode"])("",!0),Object(o["createVNode"])(c,{modelValue:e.showPasswordConfirmationForInviteUser,"onUpdate:modelValue":t[10]||(t[10]=function(t){return e.showPasswordConfirmationForInviteUser=t}),onConfirmed:e.inviteUser},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])]),e.isAdd?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",st,[Object(o["createElementVNode"])("a",{href:"",class:"entityCancelLink",onClick:t[11]||(t[11]=Object(o["withModifiers"])((function(t){return e.onDoneEditing()}),["prevent"]))},[rt,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("UsersManager_BackToUser")),1)])])):Object(o["createCommentVNode"])("",!0)])):Object(o["createCommentVNode"])("",!0),e.isAdd?Object(o["createCommentVNode"])("",!0):Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ot,[e.theUser.superuser_access?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",it,[Object(o["createVNode"])(d,{"user-login":e.theUser.login,onUserHasAccessDetected:t[12]||(t[12]=function(t){return e.userHasAccess=t.hasAccess}),onAccessChanged:t[13]||(t[13]=function(t){return e.isUserModified=!0}),"access-levels":e.accessLevels,"filter-access-levels":e.filterAccessLevels},null,8,["user-login","access-levels","filter-access-levels"])])),e.theUser.superuser_access?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",at,Object(o["toDisplayString"])(e.translate("UsersManager_SuperUsersPermissionsNotice")),1)):Object(o["createCommentVNode"])("",!0)],512)),[[o["vShow"],"permissions"===e.activeTab]]),"superuser"!==e.activeTab||"superuser"!==e.currentUserRole||e.isAdd?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",lt,[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_SuperUserIntro1")),1),Object(o["createElementVNode"])("p",null,[Object(o["createElementVNode"])("strong",null,Object(o["toDisplayString"])(e.translate("UsersManager_SuperUserIntro2")),1)]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{modelValue:e.superUserAccessChecked,"onUpdate:modelValue":t[14]||(t[14]=function(t){return e.superUserAccessChecked=t}),onClick:t[15]||(t[15]=function(t){return e.confirmSuperUserChange()}),disabled:e.isSavingUserInfo,uicontrol:"checkbox",name:"superuser_access",title:e.translate("UsersManager_HasSuperUserAccess")},null,8,["modelValue","disabled","title"])]),Object(o["createVNode"])(c,{modelValue:e.showPasswordConfirmationForSuperUser,"onUpdate:modelValue":t[16]||(t[16]=function(t){return e.showPasswordConfirmationForSuperUser=t}),onConfirmed:e.toggleSuperuserAccess,onAborted:t[17]||(t[17]=function(t){return e.setSuperUserAccessChecked()})},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("UsersManager_AreYouSure")),1),e.theUser.superuser_access?(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",ct,Object(o["toDisplayString"])(e.translate("UsersManager_RemoveSuperuserAccessConfirm")),1)):Object(o["createCommentVNode"])("",!0),e.theUser.superuser_access?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",dt,Object(o["toDisplayString"])(e.translate("UsersManager_AddSuperuserAccessConfirm")),1))]})),_:1},8,["modelValue","onConfirmed"])])),"superuser"!==e.currentUserRole||e.isAdd?Object(o["createCommentVNode"])("",!0):Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ut,[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ResetTwoFactorAuthenticationInfo")),1),Object(o["createElementVNode"])("div",mt,[Object(o["createVNode"])(l,{saving:e.isResetting2FA,onConfirm:t[18]||(t[18]=function(t){return e.confirmReset2FA()}),value:e.translate("UsersManager_ResetTwoFactorAuthentication")},null,8,["saving","value"])]),Object(o["createVNode"])(c,{modelValue:e.showPasswordConfirmationFor2FA,"onUpdate:modelValue":t[19]||(t[19]=function(t){return e.showPasswordConfirmationFor2FA=t}),onConfirmed:e.reset2FA},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("UsersManager_AreYouSure")),1),Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])],512)),[[o["vShow"],"2fa"===e.activeTab]])])],512),[[m]]),Object(o["createVNode"])(c,{modelValue:e.isShowingPasswordConfirm,"onUpdate:modelValue":t[20]||(t[20]=function(t){return e.isShowingPasswordConfirm=t}),onConfirmed:e.updateUser},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("h2",{innerHTML:e.$sanitize(e.changePasswordTitle)},null,8,bt),Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])]})),_:1},8,["class","content-title"])}var gt={login:"",superuser_access:!1,uses_2fa:!1,password:"",email:"",invite_status:""},ft=Object(o["defineComponent"])({props:{user:Object,currentUserRole:{type:String,required:!0},accessLevels:{type:Array,required:!0},filterAccessLevels:{type:Array,required:!0},initialSiteId:{type:[String,Number],required:!0},initialSiteName:{type:String,required:!0},inviteTokenExpiryDays:{type:String,required:!0}},components:{ContentBlock:g["ContentBlock"],Field:f["Field"],SaveButton:f["SaveButton"],UserPermissionsEdit:Fe,PasswordConfirmation:f["PasswordConfirmation"]},directives:{Form:f["Form"]},data:function(){return{theUser:this.user||Object.assign({},gt),activeTab:"basic",permissionsForIdSite:1,isSavingUserInfo:!1,userHasAccess:!0,firstSiteAccess:{id:this.initialSiteId,name:this.initialSiteName},isUserModified:!1,isPasswordModified:!1,superUserAccessChecked:null,showPasswordConfirmationForSuperUser:!1,showPasswordConfirmationFor2FA:!1,showPasswordConfirmationForInviteUser:!1,isResetting2FA:!1,isShowingPasswordConfirm:!1}},emits:["done","updated","resendInvite"],watch:{user:function(e){this.onUserChange(e)}},created:function(){this.onUserChange(this.user)},methods:{onUserChange:function(e){this.theUser=e||Object.assign({},gt),this.theUser.password||this.resetPasswordVar(),this.setSuperUserAccessChecked()},confirmSuperUserChange:function(){this.showPasswordConfirmationForSuperUser=!0},confirmReset2FA:function(){this.showPasswordConfirmationFor2FA=!0},toggleSuperuserAccess:function(e){var t=this;this.isSavingUserInfo=!0,g["AjaxHelper"].post({method:"UsersManager.setSuperUserAccess"},{userLogin:this.theUser.login,hasSuperUserAccess:this.theUser.superuser_access?"0":"1",passwordConfirmation:e}).then((function(){t.theUser.superuser_access=!t.theUser.superuser_access})).catch((function(){})).then((function(){t.isSavingUserInfo=!1,t.setSuperUserAccessChecked()}))},saveUserInfo:function(){this.isAdd?this.showPasswordConfirmationForInviteUser=!0:this.isShowingPasswordConfirm=!0},resendRequestedUser:function(){this.$emit("resendInvite",{user:this.user})},inviteUser:function(e){var t=this;return this.isSavingUserInfo=!0,g["AjaxHelper"].post({method:"UsersManager.inviteUser"},{userLogin:this.theUser.login,email:this.theUser.email,initialIdSite:this.firstSiteAccess?this.firstSiteAccess.id:void 0,passwordConfirmation:e}).catch((function(e){throw t.isSavingUserInfo=!1,e})).then((function(){t.firstSiteAccess=null,t.isSavingUserInfo=!1,t.isUserModified=!0,t.theUser.invite_status="pending",t.resetPasswordVar(),t.showUserCreatedNotification(),t.$emit("updated",{user:Object(o["readonly"])(t.theUser)})}))},resetPasswordVar:function(){this.isAdd||(this.theUser.password="XXXXXXXX")},showUserSavedNotification:function(){g["NotificationsStore"].show({message:Object(g["translate"])("General_YourChangesHaveBeenSaved"),context:"success",type:"toast"})},showUserCreatedNotification:function(){g["NotificationsStore"].show({message:Object(g["translate"])("UsersManager_InviteSuccess"),context:"success",type:"toast"})},reset2FA:function(e){var t=this;return this.isResetting2FA=!0,g["AjaxHelper"].post({method:"TwoFactorAuth.resetTwoFactorAuth",userLogin:this.theUser.login,passwordConfirmation:e}).catch((function(e){throw t.isResetting2FA=!1,e})).then((function(){t.isResetting2FA=!1,t.theUser.uses_2fa=!1,t.activeTab="basic",t.showUserSavedNotification()}))},updateUser:function(e){var t=this;return this.isSavingUserInfo=!0,g["AjaxHelper"].post({method:"UsersManager.updateUser"},{userLogin:this.theUser.login,password:this.isPasswordModified&&this.theUser.password?this.theUser.password:void 0,passwordConfirmation:e,email:this.theUser.email}).then((function(){t.isSavingUserInfo=!1,t.isUserModified=!0,t.isPasswordModified=!1,t.resetPasswordVar(),t.showUserSavedNotification(),t.$emit("updated",{user:Object(o["readonly"])(t.theUser)})})).catch((function(){t.isSavingUserInfo=!1}))},setSuperUserAccessChecked:function(){this.superUserAccessChecked=!!this.theUser.superuser_access},onDoneEditing:function(){this.$emit("done",{isUserModified:this.isUserModified})}},computed:{formTitle:function(){return this.isAdd?Object(g["translate"])("UsersManager_AddNewUser"):""},saveButtonLabel:function(){return this.isAdd?Object(g["translate"])("UsersManager_InviteUser"):Object(g["translate"])("UsersManager_SaveBasicInfo")},isPending:function(){return!this.user||!("pending"!==this.user.invite_status&&!Number.isInteger(this.user.invite_status))},isAdd:function(){return!this.user},changePasswordTitle:function(){return Object(g["translate"])("UsersManager_AreYouSureChangeDetails","<strong>".concat(this.theUser.login,"</strong>"))}}});ft.render=pt;var ht=ft,Ot={class:"userListFilters row"},jt={class:"col s12 m12 l8"},vt={class:"input-field col s12 m3 l3"},Ct={id:"user-list-bulk-actions",class:"dropdown-content"},kt={class:"dropdown-trigger","data-target":"bulk-set-access"},yt={id:"bulk-set-access",class:"dropdown-content"},Nt=["onClick"],St={key:0},Vt={class:"input-field col s12 m3 l3"},Ut={class:"permissions-for-selector"},Et={class:"input-field col s12 m3 l3"},wt={class:"input-field col s12 m3 l3"},At={key:0,class:"input-field col s12 m12 l4 users-list-pagination-container"},Tt={class:"usersListPagination"},Mt={class:"pointer"},Bt={class:"counter"},_t={class:"pointer"},Dt={key:0,class:"roles-help-notification"},xt=["innerHTML"],Lt={class:"select-cell"},Rt={class:"checkbox-container"},Pt=Object(o["createElementVNode"])("span",null,null,-1),Ft={class:"first"},Ht={class:"role_header"},It={style:{"margin-right":"3.5px"}},qt=Object(o["createElementVNode"])("span",{class:"icon-help"},null,-1),$t=[qt],Gt={key:0},zt=["title"],Wt={key:2},Yt={class:"actions-cell-header"},Xt={key:0,class:"select-all-row"},Jt={colspan:"8"},Kt={key:0},Qt=["innerHTML"],Zt=["innerHTML"],en={key:1},tn=["innerHTML"],nn=["innerHTML"],sn=["id"],rn={class:"select-cell"},on={class:"checkbox-container"},an=["id","onUpdate:modelValue"],ln=Object(o["createElementVNode"])("span",null,null,-1),cn={id:"userLogin"},dn={class:"access-cell"},un={key:0,id:"email"},mn={key:1,id:"twofa"},bn={key:0,class:"icon-ok"},pn={key:1,class:"icon-close"},gn={key:2,id:"last_seen"},fn={id:"status"},hn=["title"],On={class:"center actions-cell"},jn=["onClick"],vn=Object(o["createElementVNode"])("span",{class:"icon-email"},null,-1),Cn=[vn],kn=["onClick"],yn=Object(o["createElementVNode"])("span",{class:"icon-edit"},null,-1),Nn=[yn],Sn=["onClick"],Vn=Object(o["createElementVNode"])("span",{class:"icon-delete"},null,-1),Un=[Vn],En=["innerHTML"],wn=["innerHTML"],An={class:"change-user-role-confirm-modal modal",ref:"changeUserRoleConfirmModal"},Tn={class:"modal-content"},Mn=["innerHTML"],Bn={key:1},_n=["innerHTML"],Dn=["innerHTML"],xn={class:"modal-footer"};function Ln(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("ActivityIndicator"),c=Object(o["resolveComponent"])("Notification"),d=Object(o["resolveComponent"])("ContentBlock"),u=Object(o["resolveComponent"])("PasswordConfirmation"),m=Object(o["resolveDirective"])("dropdown-menu"),b=Object(o["resolveDirective"])("content-table");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])(["pagedUsersList",{loading:e.isLoadingUsers}])},[Object(o["createElementVNode"])("div",Ot,[Object(o["createElementVNode"])("div",jt,[Object(o["createElementVNode"])("div",vt,[Object(o["withDirectives"])(Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["dropdown-trigger btn bulk-actions",{disabled:e.isBulkActionsDisabled}]),href:"","data-target":"user-list-bulk-actions"},[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_BulkActions")),1)],2),[[m]]),Object(o["createElementVNode"])("ul",Ct,[Object(o["createElementVNode"])("li",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("a",kt,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_SetPermission")),1)],512),[[m]]),Object(o["createElementVNode"])("ul",yt,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.bulkActionAccessLevels,(function(t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{key:t.key},[Object(o["createElementVNode"])("a",{href:"",onClick:Object(o["withModifiers"])((function(n){e.userToChange=null,e.roleToChangeTo=t.key,e.showAccessChangeConfirm()}),["prevent"])},Object(o["toDisplayString"])(t.value),9,Nt)])})),128))])]),Object(o["createElementVNode"])("li",null,[Object(o["createElementVNode"])("a",{href:"",onClick:t[0]||(t[0]=Object(o["withModifiers"])((function(t){e.userToChange=null,e.roleToChangeTo="noaccess",e.showAccessChangeConfirm()}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_RemovePermissions")),1)]),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("li",St,[Object(o["createElementVNode"])("a",{href:"",onClick:t[1]||(t[1]=Object(o["withModifiers"])((function(t){return e.showDeleteConfirm()}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_DeleteUsers")),1)])):Object(o["createCommentVNode"])("",!0)])]),Object(o["createElementVNode"])("div",Vt,[Object(o["createElementVNode"])("div",Ut,[Object(o["createVNode"])(a,{"model-value":e.userTextFilter,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.onUserTextFilterChange(t)}),name:"user-text-filter",uicontrol:"text","full-width":!0,placeholder:e.translate("UsersManager_UserSearch")},null,8,["model-value","placeholder"])])]),Object(o["createElementVNode"])("div",Et,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{"model-value":e.accessLevelFilter,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.accessLevelFilter=t,e.changeSearch({filter_access:e.accessLevelFilter,offset:0})}),name:"access-level-filter",uicontrol:"select",options:e.filterAccessLevels,"full-width":!0,placeholder:e.translate("UsersManager_FilterByAccess")},null,8,["model-value","options","placeholder"])])]),Object(o["createElementVNode"])("div",wt,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{"model-value":e.statusLevelFilter,"onUpdate:modelValue":t[4]||(t[4]=function(t){e.statusLevelFilter=t,e.changeSearch({filter_status:e.statusLevelFilter,offset:0})}),name:"status-level-filter",uicontrol:"select",options:e.filterStatusLevels,"full-width":!0,placeholder:e.translate("UsersManager_FilterByStatus")},null,8,["model-value","options","placeholder"])])])]),e.totalEntries>e.searchParams.limit?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",At,[Object(o["createElementVNode"])("div",Tt,[Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["btn prev",{disabled:e.searchParams.offset<=0}]),onClick:t[5]||(t[5]=Object(o["withModifiers"])((function(t){return e.gotoPreviousPage()}),["prevent"]))},[Object(o["createElementVNode"])("span",Mt,"« "+Object(o["toDisplayString"])(e.translate("General_Previous")),1)],2),Object(o["createElementVNode"])("div",Bt,[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])({visibility:e.isLoadingUsers?"hidden":"visible"})},Object(o["toDisplayString"])(e.translate("General_Pagination",e.paginationLowerBound,e.paginationUpperBound,e.totalEntries)),3),Object(o["createVNode"])(l,{loading:e.isLoadingUsers},null,8,["loading"])]),Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["btn next",{disabled:e.searchParams.offset+e.searchParams.limit>=e.totalEntries}]),onClick:t[6]||(t[6]=Object(o["withModifiers"])((function(t){return e.gotoNextPage()}),["prevent"]))},[Object(o["createElementVNode"])("span",_t,Object(o["toDisplayString"])(e.translate("General_Next"))+" »",1)],2)])])):Object(o["createCommentVNode"])("",!0)]),e.isRoleHelpToggled?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Dt,[Object(o["createVNode"])(c,{context:"info",type:"persistent",noclear:!0},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.rolesHelpText)},null,8,xt)]})),_:1})])):Object(o["createCommentVNode"])("",!0),Object(o["createVNode"])(d,null,{default:Object(o["withCtx"])((function(){return[Object(o["withDirectives"])(Object(o["createElementVNode"])("table",{id:"manageUsersTable",class:Object(o["normalizeClass"])({loading:e.isLoadingUsers})},[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",Lt,[Object(o["createElementVNode"])("span",Rt,[Object(o["createElementVNode"])("label",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"checkbox",id:"paged_users_select_all",checked:"checked","onUpdate:modelValue":t[7]||(t[7]=function(t){return e.isAllCheckboxSelected=t}),onChange:t[8]||(t[8]=function(t){return e.onAllCheckboxChange()})},null,544),[[o["vModelCheckbox"],e.isAllCheckboxSelected]]),Pt])])]),Object(o["createElementVNode"])("th",Ft,Object(o["toDisplayString"])(e.translate("UsersManager_Username")),1),Object(o["createElementVNode"])("th",Ht,[Object(o["createElementVNode"])("span",It,Object(o["toDisplayString"])(e.translate("UsersManager_RoleFor")),1),Object(o["createElementVNode"])("a",{href:"",class:Object(o["normalizeClass"])(["helpIcon",{sticky:e.isRoleHelpToggled}]),onClick:t[9]||(t[9]=Object(o["withModifiers"])((function(t){return e.isRoleHelpToggled=!e.isRoleHelpToggled}),["prevent"]))},$t,2),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{class:"permissions-for-selector","model-value":e.permissionsForSite,"onUpdate:modelValue":t[10]||(t[10]=function(t){e.onPermissionsForUpdate(t)}),uicontrol:"site","ui-control-attributes":{onlySitesWithAdminAccess:"superuser"!==e.currentUserRole}},null,8,["model-value","ui-control-attributes"])])]),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",Gt,Object(o["toDisplayString"])(e.translate("UsersManager_Email")),1)):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",{key:1,title:e.translate("UsersManager_UsesTwoFactorAuthentication")},Object(o["toDisplayString"])(e.translate("UsersManager_2FA")),9,zt)):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",Wt,Object(o["toDisplayString"])(e.translate("UsersManager_LastSeen")),1)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("UsersManager_Status")),1),Object(o["createElementVNode"])("th",Yt,[Object(o["createElementVNode"])("div",null,Object(o["toDisplayString"])(e.translate("General_Actions")),1)])])]),Object(o["createElementVNode"])("tbody",null,[e.isAllCheckboxSelected&&e.users.length&&e.users.length<e.totalEntries?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",Xt,[Object(o["createElementVNode"])("td",Jt,[e.areAllResultsSelected?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Kt,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.translate("UsersManager_TheDisplayedUsersAreSelected","<strong>".concat(e.users.length,"</strong>"))),style:{"margin-right":"3.5px"}},null,8,Qt),Object(o["createElementVNode"])("a",{class:"toggle-select-all-in-search",href:"#",onClick:t[11]||(t[11]=Object(o["withModifiers"])((function(t){return e.areAllResultsSelected=!e.areAllResultsSelected}),["prevent"])),innerHTML:e.$sanitize(e.translate("UsersManager_ClickToSelectAll","<strong>".concat(e.totalEntries,"</strong>")))},null,8,Zt)])),e.areAllResultsSelected?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",en,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.translate("UsersManager_AllUsersAreSelected","<strong>".concat(e.totalEntries,"</strong>"))),style:{"margin-right":"3.5px"}},null,8,tn),Object(o["createElementVNode"])("a",{class:"toggle-select-all-in-search",href:"#",onClick:t[12]||(t[12]=Object(o["withModifiers"])((function(t){return e.areAllResultsSelected=!e.areAllResultsSelected}),["prevent"])),innerHTML:e.$sanitize(e.translate("UsersManager_ClickToSelectDisplayedUsers","<strong>".concat(e.users.length,"</strong>")))},null,8,nn)])):Object(o["createCommentVNode"])("",!0)])])):Object(o["createCommentVNode"])("",!0),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.users,(function(n,s){return Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",{id:"row".concat(s),key:n.login},[Object(o["createElementVNode"])("td",rn,[Object(o["createElementVNode"])("span",on,[Object(o["createElementVNode"])("label",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"checkbox",id:"paged_users_select_row".concat(s),"onUpdate:modelValue":function(t){return e.selectedRows[s]=t},onClick:t[13]||(t[13]=function(t){return e.onRowSelected()})},null,8,an),[[o["vModelCheckbox"],e.selectedRows[s]]]),ln])])]),Object(o["createElementVNode"])("td",cn,Object(o["toDisplayString"])(n.login),1),Object(o["createElementVNode"])("td",dn,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{"model-value":n.role,"onUpdate:modelValue":function(t){e.userToChange=n,e.roleToChangeTo=t,e.showAccessChangeConfirm()},disabled:"superuser"===n.role,uicontrol:"select",options:"anonymous"===n.login?e.anonymousAccessLevels:"noaccess"===n.role?e.onlyRoleAccessLevels:e.accessLevels},null,8,["model-value","onUpdate:modelValue","disabled","options"])])]),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("td",un,Object(o["toDisplayString"])(n.email),1)):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("td",mn,[n.uses_2fa?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",bn)):Object(o["createCommentVNode"])("",!0),n.uses_2fa?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",pn))])):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("td",gn,Object(o["toDisplayString"])(n.last_seen?"".concat(n.last_seen," ago"):"-"),1)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("td",fn,[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(Number.isInteger(n.invite_status)?"pending":n.invite_status),title:"expired"===n.invite_status?e.translate("UsersManager_ExpiredInviteAutomaticallyRemoved","3"):""},Object(o["toDisplayString"])(e.getInviteStatus(n.invite_status)),11,hn)]),Object(o["createElementVNode"])("td",On,[("superuser"===e.currentUserRole||"admin"===e.currentUserRole&&n.invited_by===e.currentUserLogin)&&"active"!==n.invite_status?(Object(o["openBlock"])(),Object(o["createElementBlock"])("button",{key:0,class:"resend table-action",title:"Resend/Copy Invite Link",onClick:function(t){e.userToChange=n,e.resendRequestedUser()}},Cn,8,jn)):Object(o["createCommentVNode"])("",!0),"anonymous"!==n.login?(Object(o["openBlock"])(),Object(o["createElementBlock"])("button",{key:1,class:"edituser table-action",title:"Edit",onClick:function(t){return e.$emit("editUser",{user:n})}},Nn,8,kn)):Object(o["createCommentVNode"])("",!0),("superuser"===e.currentUserRole||"admin"===e.currentUserRole&&n.invited_by===e.currentUserLogin)&&"anonymous"!==n.login?(Object(o["openBlock"])(),Object(o["createElementBlock"])("button",{key:2,class:"deleteuser table-action",title:"Delete",onClick:function(t){e.userToChange=n,e.showDeleteConfirm()}},Un,8,Sn)):Object(o["createCommentVNode"])("",!0)])],8,sn)})),128))])],2),[[b]])]})),_:1}),Object(o["createVNode"])(u,{modelValue:e.showPasswordConfirmationForUserRemoval,"onUpdate:modelValue":t[14]||(t[14]=function(t){return e.showPasswordConfirmationForUserRemoval=t}),onConfirmed:e.deleteRequestedUsers,onAborted:t[15]||(t[15]=function(t){e.userToChange=null,e.roleToChangeTo=null})},{default:Object(o["withCtx"])((function(){return[e.userToChange?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h2",{key:0,innerHTML:e.$sanitize(e.translate("UsersManager_DeleteUserConfirmSingle","<strong>".concat(e.userToChange.login,"</strong>")))},null,8,En)):Object(o["createCommentVNode"])("",!0),e.userToChange?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("h2",{key:1,innerHTML:e.$sanitize(e.translate("UsersManager_DeleteUserConfirmMultiple","<strong>".concat(e.affectedUsersCount,"</strong>")))},null,8,wn)),Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"]),Object(o["createElementVNode"])("div",An,[Object(o["createElementVNode"])("div",Tn,[e.userToChange?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h3",{key:0,innerHTML:e.$sanitize(e.deleteUserPermConfirmSingleText)},null,8,Mn)):Object(o["createCommentVNode"])("",!0),e.userToChange&&"anonymous"===e.userToChange.login&&"view"===e.roleToChangeTo?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h3",Bn,[Object(o["createElementVNode"])("em",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_Note"))+": ",1),Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.translate("UsersManager_AnonymousUserRoleChangeWarning","anonymous",e.getRoleDisplay(e.roleToChangeTo)))},null,8,_n)])])):Object(o["createCommentVNode"])("",!0),e.userToChange?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",{key:2,innerHTML:e.$sanitize(e.deleteUserPermConfirmMultipleText)},null,8,Dn))]),Object(o["createElementVNode"])("div",xn,[Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[16]||(t[16]=Object(o["withModifiers"])((function(t){return e.changeUserRole()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("General_Yes")),1),Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[17]||(t[17]=Object(o["withModifiers"])((function(t){e.userToChange=null,e.roleToChangeTo=null}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_No")),1)])],512)],2)}var Rn=window,Pn=Rn.$,Fn=Object(o["defineComponent"])({props:{initialSiteId:{type:[String,Number],required:!0},initialSiteName:{type:String,required:!0},currentUserRole:String,isLoadingUsers:Boolean,accessLevels:{type:Array,required:!0},filterAccessLevels:{type:Array,required:!0},filterStatusLevels:{type:Array,required:!0},totalEntries:Number,users:{type:Array,required:!0},searchParams:{type:Object,required:!0}},components:{Field:f["Field"],ActivityIndicator:g["ActivityIndicator"],Notification:g["Notification"],ContentBlock:g["ContentBlock"],PasswordConfirmation:f["PasswordConfirmation"]},directives:{DropdownMenu:g["DropdownMenu"],ContentTable:g["ContentTable"]},data:function(){return{areAllResultsSelected:!1,selectedRows:{},isAllCheckboxSelected:!1,isBulkActionsDisabled:!0,userToChange:null,roleToChangeTo:null,accessLevelFilter:null,statusLevelFilter:null,isRoleHelpToggled:!1,userTextFilter:"",permissionsForSite:{id:this.initialSiteId,name:this.initialSiteName},showPasswordConfirmationForUserRemoval:!1}},emits:["editUser","changeUserRole","deleteUser","searchChange","resendInvite"],created:function(){this.onUserTextFilterChange=Object(g["debounce"])(this.onUserTextFilterChange,300)},watch:{users:function(){this.clearSelection()}},methods:{getInviteStatus:function(e){return Number.isInteger(e)?Object(g["translate"])("UsersManager_InviteDayLeft",e):"expired"===e?Object(g["translate"])("UsersManager_Expired"):Object(g["translate"])("UsersManager_Active")},onPermissionsForUpdate:function(e){this.permissionsForSite=e,this.changeSearch({idSite:this.permissionsForSite.id})},clearSelection:function(){this.selectedRows={},this.areAllResultsSelected=!1,this.isBulkActionsDisabled=!0,this.isAllCheckboxSelected=!1,this.userToChange=null},onAllCheckboxChange:function(){if(this.isAllCheckboxSelected){for(var e=0;e!==this.users.length;e+=1)this.selectedRows[e]=!0;this.isBulkActionsDisabled=!1}else this.clearSelection()},changeUserRole:function(){this.$emit("changeUserRole",{users:this.userOperationSubject,role:this.roleToChangeTo})},onRowSelected:function(){var e=this;setTimeout((function(){var t=e.selectedCount;e.isBulkActionsDisabled=0===t,e.isAllCheckboxSelected=t===e.users.length}))},deleteRequestedUsers:function(e){this.$emit("deleteUser",{users:this.userOperationSubject,password:e})},resendRequestedUser:function(){this.$emit("resendInvite",{user:this.userToChange})},showDeleteConfirm:function(){this.showPasswordConfirmationForUserRemoval=!0},showAccessChangeConfirm:function(){Pn(this.$refs.changeUserRoleConfirmModal).modal({dismissible:!1}).modal("open")},getRoleDisplay:function(e){var t=null;return this.accessLevels.forEach((function(n){n.key===e&&(t=n.value)})),t},changeSearch:function(e){var t=Object.assign(Object.assign({},this.searchParams),e);this.$emit("searchChange",{params:t})},gotoPreviousPage:function(){this.changeSearch({offset:Math.max(0,this.searchParams.offset-this.searchParams.limit)})},gotoNextPage:function(){var e=this.searchParams.offset+this.searchParams.limit;e>=this.totalEntries||this.changeSearch({offset:e})},onUserTextFilterChange:function(e){this.userTextFilter=e,this.changeSearch({filter_search:e,offset:0})}},computed:{currentUserLogin:function(){return g["Matomo"].userLogin},paginationLowerBound:function(){return this.searchParams.offset+1},paginationUpperBound:function(){if(null===this.totalEntries)return"?";var e=this.searchParams;return Math.min(e.offset+e.limit,this.totalEntries)},userOperationSubject:function(){return this.userToChange?[this.userToChange]:this.areAllResultsSelected?"all":this.selectedUsers},selectedUsers:function(){var e=this,t=this.users,n=[];return Object.keys(this.selectedRows).forEach((function(s){var r=parseInt(s,10);e.selectedRows[s]&&t[r]&&n.push(t[r])})),n},rolesHelpText:function(){var e="https://matomo.org/faq/general/faq_70/",t="https://matomo.org/faq/general/faq_69/";return Object(g["translate"])("UsersManager_RolesHelp",'<a href="'.concat(e,'" target="_blank" rel="noreferrer noopener">'),"</a>",'<a href="'.concat(t,'" target="_blank" rel="noreferrer noopener">'),"</a>")},affectedUsersCount:function(){return this.areAllResultsSelected?this.totalEntries||0:this.selectedCount},selectedCount:function(){var e=this,t=0;return Object.keys(this.selectedRows).forEach((function(n){e.selectedRows[n]&&(t+=1)})),t},deleteUserPermConfirmSingleText:function(){var e,t;return Object(g["translate"])("UsersManager_DeleteUserPermConfirmSingle","<strong>".concat((null===(e=this.userToChange)||void 0===e?void 0:e.login)||"","</strong>"),"<strong>".concat(this.getRoleDisplay(this.roleToChangeTo),"</strong>"),"<strong>".concat(g["Matomo"].helper.htmlEntities((null===(t=this.permissionsForSite)||void 0===t?void 0:t.name)||""),"</strong>"))},deleteUserPermConfirmMultipleText:function(){var e;return Object(g["translate"])("UsersManager_DeleteUserPermConfirmMultiple","<strong>".concat(this.affectedUsersCount,"</strong>"),"<strong>".concat(this.getRoleDisplay(this.roleToChangeTo),"</strong>"),"<strong>".concat(g["Matomo"].helper.htmlEntities((null===(e=this.permissionsForSite)||void 0===e?void 0:e.name)||""),"</strong>"))},bulkActionAccessLevels:function(){return this.accessLevels.filter((function(e){return"noaccess"!==e.key&&"superuser"!==e.key}))},anonymousAccessLevels:function(){return this.accessLevels.filter((function(e){return"noaccess"===e.key||"view"===e.key}))},onlyRoleAccessLevels:function(){return this.accessLevels.filter((function(e){return"role"===e.type}))}}});Fn.render=Ln;var Hn=Fn,In={class:"usersManager"},qn={key:0},$n={key:1},Gn={class:"row add-user-container"},zn={class:"col s12"},Wn={class:"input-field",style:{"margin-right":"3.5px"}},Yn={key:0,class:"input-field"},Xn={key:0},Jn={class:"resend-invite-confirm-modal modal",ref:"resendInviteConfirmModal"},Kn=Object(o["createElementVNode"])("div",{class:"btn-close modal-close"},[Object(o["createElementVNode"])("i",{class:"icon-close"})],-1),Qn={class:"modal-content"},Zn={class:"modal-title"},es=["innerHTML"],ts={class:"modal-footer"},ns={key:0,class:"success-copied"},ss=Object(o["createElementVNode"])("i",{class:"icon-success"},null,-1),rs={class:"add-existing-user-modal modal",ref:"addExistingUserModal"},os={class:"modal-content"},is={class:"modal-footer"};function as(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("EnrichedHeadline"),l=Object(o["resolveComponent"])("PagedUsersList"),c=Object(o["resolveComponent"])("UserEditForm"),d=Object(o["resolveComponent"])("Field"),u=Object(o["resolveComponent"])("PasswordConfirmation"),m=Object(o["resolveDirective"])("content-intro"),b=Object(o["resolveDirective"])("tooltips");return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",In,[Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("h2",null,[Object(o["createVNode"])(a,{"help-url":"https://matomo.org/docs/manage-users/","feature-name":"Users Management"},{default:Object(o["withCtx"])((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_ManageUsers")),1)]})),_:1})]),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",qn,Object(o["toDisplayString"])(e.translate("UsersManager_ManageUsersDesc")),1)):Object(o["createCommentVNode"])("",!0),"admin"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",$n,Object(o["toDisplayString"])(e.translate("UsersManager_ManageUsersAdminDesc")),1)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",Gn,[Object(o["createElementVNode"])("div",zn,[Object(o["createElementVNode"])("div",Wn,[Object(o["createElementVNode"])("a",{class:"btn add-new-user",onClick:t[0]||(t[0]=function(t){return e.onAddNewUser()})},Object(o["toDisplayString"])(e.translate("UsersManager_InviteNewUser")),1)]),"superuser"!==e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Yn,[Object(o["createElementVNode"])("a",{class:"btn add-existing-user",onClick:t[1]||(t[1]=function(t){return e.showAddExistingUserModal()})},Object(o["toDisplayString"])(e.translate("UsersManager_AddExistingUser")),1)])):Object(o["createCommentVNode"])("",!0)])]),Object(o["createVNode"])(l,{onEditUser:t[2]||(t[2]=function(t){return e.onEditUser(t.user)}),onChangeUserRole:t[3]||(t[3]=function(t){return e.onChangeUserRole(t.users,t.role)}),onDeleteUser:t[4]||(t[4]=function(t){return e.onDeleteUser(t.users,t.password)}),onSearchChange:t[5]||(t[5]=function(t){e.searchParams=t.params,e.fetchUsers()}),onResendInvite:t[6]||(t[6]=function(t){return e.showResendPopup(t.user)}),"initial-site-id":e.initialSiteId,"initial-site-name":e.initialSiteName,"is-loading-users":e.isLoadingUsers,"current-user-role":e.currentUserRole,"access-levels":e.accessLevels,"filter-access-levels":e.filterAccessLevels,"filter-status-levels":e.filterStatusLevels,"search-params":e.searchParams,users:e.users,"total-entries":e.totalEntries},null,8,["initial-site-id","initial-site-name","is-loading-users","current-user-role","access-levels","filter-access-levels","filter-status-levels","search-params","users","total-entries"])],512),[[m]])],512),[[o["vShow"],!e.isEditing]]),e.isEditing?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Xn,[Object(o["createVNode"])(c,{onDone:t[7]||(t[7]=function(t){return e.onDoneEditing(t.isUserModified)}),user:e.userBeingEdited,"current-user-role":e.currentUserRole,"invite-token-expiry-days":e.inviteTokenExpiryDays,"access-levels":e.accessLevels,"filter-access-levels":e.filterAccessLevels,"initial-site-id":e.initialSiteId,"initial-site-name":e.initialSiteName,onResendInvite:t[8]||(t[8]=function(t){return e.showResendPopup(t.user)}),onUpdated:t[9]||(t[9]=function(t){return e.userBeingEdited=t.user})},null,8,["user","current-user-role","invite-token-expiry-days","access-levels","filter-access-levels","initial-site-id","initial-site-name"])])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",Jn,[Kn,Object(o["createElementVNode"])("div",Qn,[Object(o["createElementVNode"])("h2",Zn,Object(o["toDisplayString"])(e.translate("UsersManager_ResendInvite")),1),e.userBeingEdited?(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",{key:0,innerHTML:e.$sanitize(e.translate("UsersManager_InviteConfirmMessage",["<strong>".concat(e.userBeingEdited.login,"</strong>"),"<strong>".concat(e.userBeingEdited.email,"</strong>")]))},null,8,es)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("p",null,[Object(o["createElementVNode"])("strong",null,Object(o["toDisplayString"])(e.translate("UsersManager_InviteActionNotes",e.inviteTokenExpiryDays)),1)])]),Object(o["createElementVNode"])("div",ts,[e.copied?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",ns,[ss,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("UsersManager_LinkCopied")),1)])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("button",{onClick:t[10]||(t[10]=function(t){return e.showInviteActionPasswordConfirm("copy")}),class:"btn btn-copy-link modal-action",style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("UsersManager_CopyLink")),1),Object(o["createElementVNode"])("button",{class:"btn btn-resend modal-action modal-no",onClick:t[11]||(t[11]=function(t){return e.showInviteActionPasswordConfirm("send")})},Object(o["toDisplayString"])(e.translate("UsersManager_ResendInvite")),1)])],512),Object(o["createElementVNode"])("div",rs,[Object(o["createElementVNode"])("div",os,[Object(o["createElementVNode"])("h3",null,Object(o["toDisplayString"])(e.translate("UsersManager_AddExistingUser")),1),Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_EnterUsernameOrEmail"))+":",1),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(d,{modelValue:e.addNewUserLoginEmail,"onUpdate:modelValue":t[12]||(t[12]=function(t){return e.addNewUserLoginEmail=t}),name:"add-existing-user-email",uicontrol:"text"},null,8,["modelValue"])])]),Object(o["createElementVNode"])("div",is,[Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[13]||(t[13]=Object(o["withModifiers"])((function(t){return e.addExistingUser()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("General_Add")),1),Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[14]||(t[14]=Object(o["withModifiers"])((function(t){return e.addNewUserLoginEmail=null}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_Cancel")),1)])],512),Object(o["createVNode"])(u,{modelValue:e.showPasswordConfirmationForInviteAction,"onUpdate:modelValue":t[15]||(t[15]=function(t){return e.showPasswordConfirmationForInviteAction=t}),onConfirmed:e.onInviteAction},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])],512)),[[b]])}var ls=20,cs=window,ds=cs.$,us=Object(o["defineComponent"])({props:{currentUserRole:{type:String,required:!0},initialSiteName:{type:String,required:!0},initialSiteId:{type:String,required:!0},accessLevels:{type:Array,required:!0},filterAccessLevels:{type:Array,required:!0},filterStatusLevels:{type:Array,required:!0},inviteTokenExpiryDays:{type:String,required:!0}},components:{PasswordConfirmation:f["PasswordConfirmation"],EnrichedHeadline:g["EnrichedHeadline"],PagedUsersList:Hn,UserEditForm:ht,Field:f["Field"]},directives:{ContentIntro:g["ContentIntro"],Tooltips:g["Tooltips"]},data:function(){return{isEditing:!!g["MatomoUrl"].urlParsed.value.showadduser,isCurrentUserSuperUser:!0,users:[],totalEntries:null,searchParams:{offset:0,limit:ls,filter_search:"",filter_access:"",filter_status:"",idSite:this.initialSiteId},isLoadingUsers:!1,userBeingEdited:null,addNewUserLoginEmail:"",copied:!1,loading:!1,showPasswordConfirmationForInviteAction:!1,inviteAction:""}},created:function(){this.fetchUsers()},watch:{limit:function(){this.fetchUsers()}},methods:{showInviteActionPasswordConfirm:function(e){this.loading||(this.showPasswordConfirmationForInviteAction=!0,this.inviteAction=e)},showResendPopup:function(e){this.userBeingEdited=e,ds(this.$refs.resendInviteConfirmModal).modal({dismissible:!1}).modal("open"),this.copied=!1},onInviteAction:function(e){"send"===this.inviteAction?this.onResendInvite(e):this.generateInviteLink(e)},onEditUser:function(e){g["Matomo"].helper.lazyScrollToContent(),this.isEditing=!0,this.userBeingEdited=e},onDoneEditing:function(e){this.isEditing=!1,e&&this.fetchUsers()},showAddExistingUserModal:function(){ds(this.$refs.addExistingUserModal).modal({dismissible:!1}).modal("open")},onChangeUserRole:function(e,t){var n=this;this.isLoadingUsers=!0,Promise.resolve().then((function(){return"all"===e?n.getAllUsersInSearch():e})).then((function(e){return e.filter((function(e){return"superuser"!==e.role})).map((function(e){return e.login}))})).then((function(e){var s,r=n.accessLevels.filter((function(e){return e.key===t})).map((function(e){return e.type}));return s=r.length&&"capability"===r[0]?e.map((function(e){return{method:"UsersManager.addCapabilities",userLogin:e,capabilities:t,idSites:n.searchParams.idSite}})):e.map((function(e){return{method:"UsersManager.setUserAccess",userLogin:e,access:t,idSites:n.searchParams.idSite}})),g["AjaxHelper"].fetch(s,{createErrorNotification:!0})})).catch((function(){})).then((function(){return n.fetchUsers()}))},getAllUsersInSearch:function(){return g["AjaxHelper"].fetch({method:"UsersManager.getUsersPlusRole",filter_search:this.searchParams.filter_search,filter_access:this.searchParams.filter_access,filter_status:this.searchParams.filter_status,idSite:this.searchParams.idSite,filter_limit:"-1"})},onDeleteUser:function(e,t){var n=this;this.isLoadingUsers=!0,Promise.resolve().then((function(){return"all"===e?n.getAllUsersInSearch():e})).then((function(e){return e.map((function(e){return e.login}))})).then((function(e){var n=e.map((function(e){return{method:"UsersManager.deleteUser",userLogin:e,passwordConfirmation:t}}));return g["AjaxHelper"].fetch(n,{createErrorNotification:!0})})).then((function(){g["NotificationsStore"].scrollToNotification(g["NotificationsStore"].show({id:"removeUserSuccess",message:Object(g["translate"])("UsersManager_DeleteSuccess"),context:"success",type:"toast"})),n.fetchUsers()}),(function(){"all"!==e&&e.length>1&&g["NotificationsStore"].show({id:"removeUserSuccess",message:Object(g["translate"])("UsersManager_DeleteNotSuccessful"),context:"warning",type:"toast"}),n.fetchUsers()}))},generateInviteLink:async function(e){if(!this.loading){this.loading=!0;try{var t=await g["AjaxHelper"].fetch({method:"UsersManager.generateInviteLink",userLogin:this.userBeingEdited.login,passwordConfirmation:e});await this.copyToClipboard(t.value)}catch(n){}this.loading=!1}},copyToClipboard:async function(e){try{var t=document.createElement("input");t.style.top="-100px",t.style.left="0",t.style.position="fixed",t.value=e,document.body.appendChild(t),t.select(),"https:"!==window.location.protocol?document.execCommand("copy"):await navigator.clipboard.writeText(t.value),document.body.removeChild(t),this.copied=!0}catch(s){var n=g["NotificationsStore"].show({message:"<strong>".concat(Object(g["translate"])("UsersManager_CopyDenied"),"</strong><br>\n").concat(Object(g["translate"])("UsersManager_CopyDeniedHints",['<br><span class="invite-link">'.concat(e,"</span>")])),id:"copyError",context:"error",type:"transient"});g["NotificationsStore"].scrollToNotification(n)}},onResendInvite:function(e){var t=this;""!==e&&g["AjaxHelper"].fetch({method:"UsersManager.resendInvite",userLogin:this.userBeingEdited.login,passwordConfirmation:e}).then((function(){t.fetchUsers(),ds(t.$refs.resendInviteConfirmModal).modal("close");var e=g["NotificationsStore"].show({message:Object(g["translate"])("UsersManager_InviteSuccess"),id:"resendInvite",context:"success",type:"transient"});g["NotificationsStore"].scrollToNotification(e)}))},fetchUsers:function(){var e=this;return this.isLoadingUsers=!0,g["AjaxHelper"].fetch(Object.assign(Object.assign({},this.searchParams),{},{method:"UsersManager.getUsersPlusRole"}),{returnResponseObject:!0}).then((function(t){var n=t.getRequestHandle();e.totalEntries=parseInt(n.getResponseHeader("x-matomo-total-results")||"0",10),e.users=n.responseJSON,e.isLoadingUsers=!1})).catch((function(){e.isLoadingUsers=!1}))},addExistingUser:function(){var e=this;return this.isLoadingUsers=!0,g["AjaxHelper"].fetch({method:"UsersManager.userExists",userLogin:this.addNewUserLoginEmail}).then((function(t){return t&&t.value?e.addNewUserLoginEmail:g["AjaxHelper"].fetch({method:"UsersManager.getUserLoginFromUserEmail",userEmail:e.addNewUserLoginEmail}).then((function(e){return e.value}))})).then((function(t){return g["AjaxHelper"].post({method:"UsersManager.setUserAccess"},{userLogin:t,access:"view",idSites:e.searchParams.idSite})})).then((function(){return e.fetchUsers()})).catch((function(){e.isLoadingUsers=!1}))},onAddNewUser:function(){var e={isAllowed:!0};g["Matomo"].postEvent("UsersManager.initAddUser",e),e&&!e.isAllowed||(this.isEditing=!0,this.userBeingEdited=null)}}});us.render=as;var ms=us,bs={key:0,class:"alert alert-info"},ps={key:1};function gs(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("SaveButton"),c=Object(o["resolveComponent"])("ContentBlock"),d=Object(o["resolveDirective"])("form");return Object(o["openBlock"])(),Object(o["createBlock"])(c,{"content-title":e.title},{default:Object(o["withCtx"])((function(){return[0===e.anonymousSites.length?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",bs,Object(o["toDisplayString"])(e.translate("UsersManager_NoteNoAnonymousUserAccessSettingsWontBeUsed2")),1)):Object(o["createCommentVNode"])("",!0),e.anonymousSites.length>0?Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ps,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"radio",name:"anonymousDefaultReport",modelValue:e.defaultReport,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.defaultReport=t}),introduction:e.translate("UsersManager_WhenUsersAreNotLoggedInAndVisitPiwikTheyShouldAccess"),options:e.defaultReportOptions},null,8,["modelValue","introduction","options"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"select",name:"anonymousDefaultReportWebsite",modelValue:e.defaultReportWebsite,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.defaultReportWebsite=t}),options:e.anonymousSites},null,8,["modelValue","options"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"radio",name:"anonymousDefaultDate",modelValue:e.defaultDate,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.defaultDate=t}),introduction:e.translate("UsersManager_ForAnonymousUsersReportDateToLoadByDefault"),options:e.availableDefaultDates},null,8,["modelValue","introduction","options"])]),Object(o["createVNode"])(l,{saving:e.loading,onConfirm:t[3]||(t[3]=function(t){return e.save()})},null,8,["saving"])],512)),[[d]]):Object(o["createCommentVNode"])("",!0)]})),_:1},8,["content-title"])}var fs=Object(o["defineComponent"])({props:{title:{type:String,required:!0},anonymousSites:{type:Array,required:!0},anonymousDefaultReport:{type:[String,Number],required:!0},anonymousDefaultSite:{type:String,required:!0},anonymousDefaultDate:{type:String,required:!0},availableDefaultDates:{type:Object,required:!0},defaultReportOptions:{type:Object,required:!0}},components:{ContentBlock:g["ContentBlock"],SaveButton:f["SaveButton"],Field:f["Field"]},directives:{Form:f["Form"]},data:function(){return{loading:!1,defaultReport:"".concat(this.anonymousDefaultReport),defaultReportWebsite:this.anonymousDefaultSite,defaultDate:this.anonymousDefaultDate}},methods:{save:function(){var e=this,t={anonymousDefaultReport:"1"===this.defaultReport?this.defaultReportWebsite:this.defaultReport,anonymousDefaultDate:this.defaultDate};this.loading=!0,g["AjaxHelper"].post({module:"UsersManager",action:"recordAnonymousUserSettings",format:"json"},t,{withTokenInUrl:!0}).then((function(){var e=g["NotificationsStore"].show({message:Object(g["translate"])("CoreAdminHome_SettingsSaveSuccess"),id:"anonymousUserSettings",context:"success",type:"transient"});g["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.loading=!1}))}}});fs.render=gs;var hs=fs,Os={id:"newsletterSignup"};function js(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("SaveButton"),c=Object(o["resolveComponent"])("ContentBlock");return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Os,[Object(o["createVNode"])(c,{"content-title":e.translate("UsersManager_NewsletterSignupTitle")},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"checkbox",name:"newsletterSignupCheckbox",id:"newsletterSignupCheckbox",modelValue:e.newsletterSignupCheckbox,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.newsletterSignupCheckbox=t}),"full-width":!0,title:e.signupTitleText},null,8,["modelValue","title"])]),Object(o["createVNode"])(l,{id:"newsletterSignupBtn",onConfirm:t[1]||(t[1]=function(t){return e.signupForNewsletter()}),disabled:!e.newsletterSignupCheckbox,value:e.newsletterSignupButtonTitle,saving:e.isProcessingNewsletterSignup},null,8,["disabled","value","saving"])]})),_:1},8,["content-title"])],512)),[[o["vShow"],e.showNewsletterSignup]])}var vs=Object(o["defineComponent"])({data:function(){return{showNewsletterSignup:!0,newsletterSignupCheckbox:!1,isProcessingNewsletterSignup:!1,newsletterSignupButtonTitle:Object(g["translate"])("General_Save")}},components:{ContentBlock:g["ContentBlock"],SaveButton:f["SaveButton"],Field:f["Field"]},computed:{signupTitleText:function(){return Object(g["translate"])("UsersManager_NewsletterSignupMessage",'<a href="https://matomo.org/privacy-policy/" target="_blank">',"</a>")}},methods:{signupForNewsletter:function(){var e=this;this.newsletterSignupButtonTitle=Object(g["translate"])("General_Loading"),this.isProcessingNewsletterSignup=!0,g["AjaxHelper"].fetch({module:"API",method:"UsersManager.newsletterSignup"},{withTokenInUrl:!0}).then((function(){e.isProcessingNewsletterSignup=!1,e.showNewsletterSignup=!1;var t=g["NotificationsStore"].show({message:Object(g["translate"])("UsersManager_NewsletterSignupSuccessMessage"),id:"newslettersignup",context:"success",type:"transient"});g["NotificationsStore"].scrollToNotification(t)})).catch((function(){e.isProcessingNewsletterSignup=!1;var t=g["NotificationsStore"].show({message:Object(g["translate"])("UsersManager_NewsletterSignupFailureMessage"),id:"newslettersignup",context:"error",type:"transient"});g["NotificationsStore"].scrollToNotification(t),e.newsletterSignupButtonTitle=Object(g["translate"])("General_PleaseTryAgain")}))}}});vs.render=js;var Cs=vs,ks={id:"userSettingsTable"},ys={key:0},Ns={id:"languageHelp",class:"inline-help-node"},Ss={target:"_blank",rel:"noreferrer noopener",href:"https://matomo.org/translations/"},Vs={class:"sites_autocomplete"};function Us(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("SiteSelector"),c=Object(o["resolveComponent"])("SaveButton"),d=Object(o["resolveComponent"])("PasswordConfirmation"),u=Object(o["resolveComponent"])("ContentBlock"),m=Object(o["resolveDirective"])("form");return Object(o["openBlock"])(),Object(o["createBlock"])(u,{"content-title":e.title,feature:"true"},{default:Object(o["withCtx"])((function(){return[Object(o["withDirectives"])(Object(o["createElementVNode"])("form",ks,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"text",name:"username",title:e.translate("General_Username"),disabled:!0,modelValue:e.username,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.username=t}),"inline-help":e.translate("UsersManager_YourUsernameCannotBeChanged")},null,8,["title","modelValue","inline-help"])]),e.isUsersAdminEnabled?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ys,[Object(o["createVNode"])(a,{uicontrol:"text",name:"email","model-value":e.email,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.email=t,e.doesRequirePasswordConfirmation=!0}),maxlength:100,title:e.translate("UsersManager_Email")},null,8,["model-value","title"])])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",Ns,[Object(o["createElementVNode"])("a",Ss,Object(o["toDisplayString"])(e.translate("LanguagesManager_AboutPiwikTranslations")),1)]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"select",name:"language",modelValue:e.language,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.language=t}),title:e.translate("General_Language"),options:e.languageOptions,"inline-help":"#languageHelp"},null,8,["modelValue","title","options"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"select",name:"timeformat",modelValue:e.timeformat,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.timeformat=t}),title:e.translate("General_TimeFormat"),options:e.timeFormats},null,8,["modelValue","title","options"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"radio",name:"defaultReport",modelValue:e.theDefaultReport,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.theDefaultReport=t}),introduction:e.translate("UsersManager_ReportToLoadByDefault"),title:e.translate("General_AllWebsitesDashboard"),options:e.defaultReportOptions},null,8,["modelValue","introduction","title","options"])]),Object(o["createElementVNode"])("div",Vs,[Object(o["createVNode"])(l,{modelValue:e.site,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.site=t}),"show-selected-site":!0,"switch-site-on-select":!1,"show-all-sites-item":!1,showselectedsite:!0,id:"defaultReportSiteSelector"},null,8,["modelValue"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"radio",name:"defaultDate",modelValue:e.theDefaultDate,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.theDefaultDate=t}),introduction:e.translate("UsersManager_ReportDateToLoadByDefault"),options:e.availableDefaultDates},null,8,["modelValue","introduction","options"])]),Object(o["createVNode"])(c,{onConfirm:t[7]||(t[7]=function(t){return e.save()}),saving:e.loading},null,8,["saving"]),Object(o["createVNode"])(d,{modelValue:e.showPasswordConfirmation,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.showPasswordConfirmation=t}),onConfirmed:e.doSave},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])],512),[[m]])]})),_:1},8,["content-title"])}var Es=Object(o["defineComponent"])({props:{isUsersAdminEnabled:{type:Boolean,required:!0},title:{type:String,required:!0},userLogin:{type:String,required:!0},userEmail:{type:String,required:!0},currentLanguageCode:{type:String,required:!0},languageOptions:{type:Object,required:!0},currentTimeformat:{type:Number,required:!0},timeFormats:{type:Object,required:!0},defaultReport:{type:[String,Number],required:!0},defaultReportOptions:{type:Object,required:!0},defaultReportIdSite:{type:[String,Number],required:!0},defaultReportSiteName:{type:String,required:!0},defaultDate:{type:String,required:!0},availableDefaultDates:{type:Object,required:!0}},components:{ContentBlock:g["ContentBlock"],SaveButton:f["SaveButton"],Field:f["Field"],SiteSelector:g["SiteSelector"],PasswordConfirmation:f["PasswordConfirmation"]},directives:{Form:f["Form"]},data:function(){return{doesRequirePasswordConfirmation:!1,username:this.userLogin,email:this.userEmail,language:this.currentLanguageCode,timeformat:this.currentTimeformat,theDefaultReport:this.defaultReport,site:{id:this.defaultReportIdSite,name:g["Matomo"].helper.htmlDecode(this.defaultReportSiteName)},theDefaultDate:this.defaultDate,loading:!1,showPasswordConfirmation:!1}},methods:{save:function(){this.doesRequirePasswordConfirmation?this.showPasswordConfirmation=!0:this.doSave()},doSave:function(e){var t=this,n={email:this.email,defaultReport:"MultiSites"===this.theDefaultReport?this.theDefaultReport:this.site.id,defaultDate:this.theDefaultDate,language:this.language,timeformat:this.timeformat};e&&(n.passwordConfirmation=e),this.loading=!0,g["AjaxHelper"].post({module:"UsersManager",action:"recordUserSettings",format:"json"},n,{withTokenInUrl:!0}).then((function(){var e=g["NotificationsStore"].show({message:Object(g["translate"])("CoreAdminHome_SettingsSaveSuccess"),id:"PersonalSettingsSuccess",context:"success",type:"transient"});g["NotificationsStore"].scrollToNotification(e),t.doesRequirePasswordConfirmation=!1,t.loading=!1})).catch((function(){t.loading=!1}))}}});Es.render=Us;var ws=Es,As={key:0},Ts={key:1,class:"alert alert-danger"},Ms=["action"],Bs=["value"],_s=["value"],Ds=["innerHTML"];function xs(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("ContentBlock");return Object(o["openBlock"])(),Object(o["createBlock"])(l,{"content-title":e.translate("UsersManager_AuthTokens")},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_TokenAuthIntro")),1),e.noDescription?(Object(o["openBlock"])(),Object(o["createElementBlock"])("br",As)):Object(o["createCommentVNode"])("",!0),e.noDescription?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ts,Object(o["toDisplayString"])(e.translate("General_Description"))+": "+Object(o["toDisplayString"])(e.translate("General_ValidatorErrorEmptyValue")),1)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("form",{action:e.addNewTokenFormUrl,method:"post",class:"addTokenForm"},[Object(o["createVNode"])(a,{uicontrol:"text",name:"description",title:e.translate("General_Description"),maxlength:100,required:!0,"inline-help":e.translate("UsersManager_AuthTokenPurpose"),modelValue:e.tokenDescription,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.tokenDescription=t})},null,8,["title","inline-help","modelValue"]),Object(o["createElementVNode"])("input",{type:"hidden",value:e.formNonce,name:"nonce"},null,8,Bs),Object(o["createElementVNode"])("input",{type:"submit",value:e.translate("UsersManager_CreateNewToken"),class:"btn",style:{"margin-right":"3.5px"}},null,8,_s),Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.cancelLink)},null,8,Ds)],8,Ms)]})),_:1},8,["content-title"])}var Ls=Object(o["defineComponent"])({props:{noDescription:Boolean,formNonce:String},components:{ContentBlock:g["ContentBlock"],Field:f["Field"]},data:function(){return{tokenDescription:""}},computed:{addNewTokenFormUrl:function(){return"?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"addNewToken"})))},cancelLink:function(){var e="?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"userSecurity"})));return Object(g["translate"])("General_OrCancel","<a class='entityCancelLink' href='".concat(e,"'>"),"</a>")}}});Ls.render=xs;var Rs=Ls,Ps=Object(o["createElementVNode"])("br",null,null,-1),Fs={style:{"font-size":"40px"},class:"generatedTokenAuth"},Hs=["href"];function Is(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("ContentBlock"),l=Object(o["resolveDirective"])("select-on-focus");return Object(o["openBlock"])(),Object(o["createBlock"])(a,{"content-title":e.translate("UsersManager_TokenSuccessfullyGenerated")},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("p",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_PleaseStoreToken"))+" ",1),Ps,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("UsersManager_DoNotStoreToken")),1)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("pre",Fs,[Object(o["createElementVNode"])("code",null,Object(o["toDisplayString"])(e.generatedToken),1)],512),[[l,{}]]),Object(o["createElementVNode"])("a",{href:e.userSecurityLink,class:"btn",style:{height:"auto"}},Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmTokenCopied"))+" "+Object(o["toDisplayString"])(e.translate("UsersManager_GoBackSecurityPage")),9,Hs)]})),_:1},8,["content-title"])}var qs=Object(o["defineComponent"])({props:{generatedToken:{type:String,required:!0}},components:{ContentBlock:g["ContentBlock"]},directives:{SelectOnFocus:g["SelectOnFocus"]},computed:{userSecurityLink:function(){return"?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"userSecurity"})))}}});qs.render=Is;var $s=qs,Gs=["action"],zs=["value"],Ws={key:0},Ys={class:"alert alert-info"},Xs=["value"],Js={key:1},Ks={class:"alert alert-danger"},Qs=["innerHTML"],Zs={ref:"afterPassword"},er=Object(o["createElementVNode"])("a",{name:"authtokens",id:"authtokens"},null,-1),tr={key:0},nr={class:"listAuthTokens"},sr=["title"],rr={key:0},or=["colspan","innerHTML"],ir={class:"creationDate"},ar=["title"],lr=["action"],cr=["value"],dr=["value"],ur=["title"],mr=Object(o["createElementVNode"])("span",{class:"icon-delete"},null,-1),br=[mr],pr={class:"tableActionBar"},gr=["href"],fr=Object(o["createElementVNode"])("span",{class:"icon-add"},null,-1),hr=["action"],Or=["value"],jr=Object(o["createElementVNode"])("input",{name:"idtokenauth",type:"hidden",value:"all"},null,-1),vr={type:"submit",class:"table-action"},Cr=Object(o["createElementVNode"])("span",{class:"icon-delete"},null,-1);function kr(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("ContentBlock"),c=Object(o["resolveDirective"])("content-table");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",null,[e.isUsersAdminEnabled?(Object(o["openBlock"])(),Object(o["createBlock"])(l,{key:0,"content-title":e.translate("General_ChangePassword"),feature:"true"},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("form",{id:"userSettingsTable",method:"post",action:e.recordPasswordChangeAction},[Object(o["createElementVNode"])("input",{type:"hidden",value:e.changePasswordNonce,name:"nonce"},null,8,zs),e.isValidHost?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ws,[Object(o["createVNode"])(a,{uicontrol:"password",name:"password",autocomplete:!1,modelValue:e.password,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.password=t}),title:e.translate("Login_NewPassword"),"inline-help":e.translate("UsersManager_IfYouWouldLikeToChangeThePasswordTypeANewOne")},null,8,["modelValue","title","inline-help"]),Object(o["createVNode"])(a,{uicontrol:"password",name:"passwordBis",autocomplete:!1,modelValue:e.passwordBis,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.passwordBis=t}),title:e.translate("Login_NewPasswordRepeat"),"inline-help":e.translate("UsersManager_TypeYourPasswordAgain")},null,8,["modelValue","title","inline-help"]),Object(o["createVNode"])(a,{uicontrol:"password",name:"passwordConfirmation",autocomplete:!1,modelValue:e.passwordConfirmation,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.passwordConfirmation=t}),title:e.translate("UsersManager_YourCurrentPassword"),"inline-help":e.translate("UsersManager_TypeYourCurrentPassword")},null,8,["modelValue","title","inline-help"]),Object(o["createElementVNode"])("div",Ys,Object(o["toDisplayString"])(e.translate("UsersManager_PasswordChangeTerminatesOtherSessions")),1),Object(o["createElementVNode"])("input",{type:"submit",value:e.translate("General_Save"),class:"btn"},null,8,Xs)])):Object(o["createCommentVNode"])("",!0),e.isValidHost?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Js,[Object(o["createElementVNode"])("div",Ks,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_InjectedHostCannotChangePwd",e.invalidHost))+" ",1),e.isSuperUser?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,innerHTML:e.$sanitize(e.emailYourAdminText)},null,8,Qs))])]))],8,Gs)]})),_:1},8,["content-title"])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",Zs,[e.isUsersAdminEnabled&&e.afterPasswordComponent?(Object(o["openBlock"])(),Object(o["createBlock"])(Object(o["resolveDynamicComponent"])(e.afterPasswordComponent),{key:0})):Object(o["createCommentVNode"])("",!0)],512),er,Object(o["createVNode"])(l,{"content-title":e.translate("UsersManager_AuthTokens")},{default:Object(o["withCtx"])((function(){var t,n;return[Object(o["createElementVNode"])("p",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_TokenAuthIntro"))+" ",1),e.hasTokensWithExpireDate?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",tr,Object(o["toDisplayString"])(e.translate("UsersManager_ExpiredTokensDeleteAutomatically")),1)):Object(o["createCommentVNode"])("",!0)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("table",nr,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_CreationDate")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Description")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("UsersManager_LastUsed")),1),e.hasTokensWithExpireDate?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",{key:0,title:e.translate("UsersManager_TokensWithExpireDateCreationBySystem")},Object(o["toDisplayString"])(e.translate("UsersManager_ExpireDate")),9,sr)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Actions")),1)])]),Object(o["createElementVNode"])("tbody",null,[null!==(t=e.tokens)&&void 0!==t&&t.length?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",rr,[Object(o["createElementVNode"])("td",{colspan:e.hasTokensWithExpireDate?5:4,innerHTML:e.$sanitize(e.noTokenCreatedYetText)},null,8,or)])),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.tokens||[],(function(t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",{key:t.idusertokenauth},[Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("span",ir,Object(o["toDisplayString"])(t.date_created),1)]),Object(o["createElementVNode"])("td",null,Object(o["toDisplayString"])(t.description),1),Object(o["createElementVNode"])("td",null,Object(o["toDisplayString"])(t.last_used?t.last_used:e.translate("General_Never")),1),e.hasTokensWithExpireDate?(Object(o["openBlock"])(),Object(o["createElementBlock"])("td",{key:0,title:e.translate("UsersManager_TokensWithExpireDateCreationBySystem")},Object(o["toDisplayString"])(t.date_expired?t.date_expired:e.translate("General_Never")),9,ar)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("form",{method:"post",action:e.deleteTokenAction,style:{display:"inline"}},[Object(o["createElementVNode"])("input",{name:"nonce",type:"hidden",value:e.deleteTokenNonce},null,8,cr),Object(o["createElementVNode"])("input",{name:"idtokenauth",type:"hidden",value:t.idusertokenauth},null,8,dr),Object(o["createElementVNode"])("button",{type:"submit",class:"table-action",title:e.translate("General_Delete")},br,8,ur)],8,lr)])])})),128))])],512),[[c]]),Object(o["createElementVNode"])("div",pr,[Object(o["createElementVNode"])("a",{href:e.addNewTokenLink,class:"addNewToken"},[fr,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("UsersManager_CreateNewToken")),1)],8,gr),null!==(n=e.tokens)&&void 0!==n&&n.length?(Object(o["openBlock"])(),Object(o["createElementBlock"])("form",{key:0,method:"post",action:e.deleteTokenAction,style:{display:"inline"}},[Object(o["createElementVNode"])("input",{name:"nonce",type:"hidden",value:e.deleteTokenNonce},null,8,Or),jr,Object(o["createElementVNode"])("button",vr,[Cr,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("UsersManager_DeleteAllTokens")),1)])],8,hr)):Object(o["createCommentVNode"])("",!0)])]})),_:1},8,["content-title"])])}var yr=Object(o["defineComponent"])({props:{deleteTokenNonce:String,tokens:Array,hasTokensWithExpireDate:Boolean,isUsersAdminEnabled:Boolean,changePasswordNonce:String,isValidHost:Boolean,isSuperUser:Boolean,invalidHost:String,afterPasswordEventContent:String,invalidHostMailLinkStart:String},components:{ContentBlock:g["ContentBlock"],Field:f["Field"]},directives:{ContentTable:g["ContentTable"]},data:function(){return{password:"",passwordBis:"",passwordConfirmation:""}},mounted:function(){var e=this.$refs.afterPassword;g["Matomo"].helper.compileVueEntryComponents(e)},computed:{recordPasswordChangeAction:function(){return"?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"recordPasswordChange"})))},emailYourAdminText:function(){return Object(g["translate"])("UsersManager_EmailYourAdministrator",this.invalidHostMailLinkStart||"","</a>")},noTokenCreatedYetText:function(){var e="?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"addNewToken"})));return Object(g["translate"])("UsersManager_NoTokenCreatedYetCreateNow",'<a href="'.concat(e,'">'),"</a>")},deleteTokenAction:function(){return"?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"deleteToken"})))},addNewTokenLink:function(){return"?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"addNewToken"})))},afterPasswordComponent:function(){if(!this.afterPasswordEventContent)return null;var e=this.$refs.afterPassword;return Object(o["markRaw"])({template:this.afterPasswordEventContent,beforeUnmount:function(){g["Matomo"].helper.destroyVueComponent(e)}})}}});yr.render=kr;var Nr=yr,Sr=["innerHTML"],Vr={style:{"margin-left":"20px"}},Ur=["href"],Er=Object(o["createElementVNode"])("br",null,null,-1);function wr(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("PersonalSettings"),l=Object(o["resolveComponent"])("NewsletterSettings"),c=Object(o["resolveComponent"])("PluginSettings"),d=Object(o["resolveComponent"])("ContentBlock");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",null,[Object(o["createVNode"])(a,{"is-users-admin-enabled":e.isUsersAdminEnabled,title:e.title,"user-login":e.userLogin,"user-email":e.userEmail,"current-language-code":e.currentLanguageCode,"language-options":e.languageOptions,"current-timeformat":e.currentTimeformat,"time-formats":e.timeFormats,"default-report":e.defaultReport,"default-report-options":e.defaultReportOptions,"default-report-id-site":e.defaultReportIdSite,"default-report-site-name":e.defaultReportSiteName,"default-date":e.defaultDate,"available-default-dates":e.availableDefaultDates},null,8,["is-users-admin-enabled","title","user-login","user-email","current-language-code","language-options","current-timeformat","time-formats","default-report","default-report-options","default-report-id-site","default-report-site-name","default-date","available-default-dates"]),e.showNewsletterSignup?(Object(o["openBlock"])(),Object(o["createBlock"])(l,{key:0})):Object(o["createCommentVNode"])("",!0),Object(o["createVNode"])(c,{mode:"user"}),Object(o["createVNode"])(d,{"content-title":e.translate("UsersManager_ExcludeVisitsViaCookie")},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("p",{innerHTML:e.$sanitize(e.yourVisitsAreText)},null,8,Sr),Object(o["createElementVNode"])("span",Vr,[Object(o["createElementVNode"])("a",{href:e.setIgnoreCookieLink},[Object(o["createTextVNode"])(" › "+Object(o["toDisplayString"])(e.ignoreCookieSet?e.translate("UsersManager_ClickHereToDeleteTheCookie"):e.translate("UsersManager_ClickHereToSetTheCookieOnDomain",e.piwikHost))+" ",1),Er],8,Ur)])]})),_:1},8,["content-title"])])}var Ar=Object(o["defineComponent"])({props:{isUsersAdminEnabled:{type:Boolean,required:!0},title:{type:String,required:!0},userLogin:{type:String,required:!0},userEmail:{type:String,required:!0},currentLanguageCode:{type:String,required:!0},languageOptions:{type:Object,required:!0},currentTimeformat:{type:Number,required:!0},timeFormats:{type:Object,required:!0},defaultReport:{type:[String,Number],required:!0},defaultReportOptions:{type:Object,required:!0},defaultReportIdSite:{type:[String,Number],required:!0},defaultReportSiteName:{type:String,required:!0},defaultDate:{type:String,required:!0},availableDefaultDates:{type:Object,required:!0},showNewsletterSignup:Boolean,ignoreCookieSet:Boolean,ignoreSalt:[String,Number,Boolean],piwikHost:{type:String,required:!0}},components:{ContentBlock:g["ContentBlock"],PersonalSettings:ws,NewsletterSettings:Cs,PluginSettings:f["PluginSettings"]},computed:{yourVisitsAreText:function(){return this.ignoreCookieSet?Object(g["translate"])("UsersManager_YourVisitsAreIgnoredOnDomain","<strong>",this.piwikHost,"</strong>"):Object(g["translate"])("UsersManager_YourVisitsAreNotIgnored","<strong>","</strong>")},setIgnoreCookieLink:function(){return"?".concat(g["MatomoUrl"].stringify({ignoreSalt:this.ignoreSalt,module:"UsersManager",action:"setIgnoreCookie"}),"#excludeCookie")}}});Ar.render=wr;var Tr=Ar; /*! * Matomo - free/libre analytics platform * diff --git a/plugins/UsersManager/vue/src/UserSettings/UserSettings.vue b/plugins/UsersManager/vue/src/UserSettings/UserSettings.vue index 3d6ad96972..ac366628c1 100644 --- a/plugins/UsersManager/vue/src/UserSettings/UserSettings.vue +++ b/plugins/UsersManager/vue/src/UserSettings/UserSettings.vue @@ -5,40 +5,42 @@ --> <template> - <PersonalSettings - :is-users-admin-enabled="isUsersAdminEnabled" - :title="title" - :user-login="userLogin" - :user-email="userEmail" - :current-language-code="currentLanguageCode" - :language-options="languageOptions" - :current-timeformat="currentTimeformat" - :time-formats="timeFormats" - :default-report="defaultReport" - :default-report-options="defaultReportOptions" - :default-report-id-site="defaultReportIdSite" - :default-report-site-name="defaultReportSiteName" - :default-date="defaultDate" - :available-default-dates="availableDefaultDates" - /> + <div> + <PersonalSettings + :is-users-admin-enabled="isUsersAdminEnabled" + :title="title" + :user-login="userLogin" + :user-email="userEmail" + :current-language-code="currentLanguageCode" + :language-options="languageOptions" + :current-timeformat="currentTimeformat" + :time-formats="timeFormats" + :default-report="defaultReport" + :default-report-options="defaultReportOptions" + :default-report-id-site="defaultReportIdSite" + :default-report-site-name="defaultReportSiteName" + :default-date="defaultDate" + :available-default-dates="availableDefaultDates" + /> - <NewsletterSettings v-if="showNewsletterSignup"></NewsletterSettings> + <NewsletterSettings v-if="showNewsletterSignup"></NewsletterSettings> - <PluginSettings mode="user"></PluginSettings> + <PluginSettings mode="user"></PluginSettings> - <ContentBlock - :content-title="translate('UsersManager_ExcludeVisitsViaCookie')" - > - <p v-html="$sanitize(yourVisitsAreText)"></p> - <span style="margin-left:20px;"> - <a :href="setIgnoreCookieLink"> - › {{ ignoreCookieSet - ? translate('UsersManager_ClickHereToDeleteTheCookie') - : translate('UsersManager_ClickHereToSetTheCookieOnDomain', piwikHost) }} - <br/> - </a> - </span> - </ContentBlock> + <ContentBlock + :content-title="translate('UsersManager_ExcludeVisitsViaCookie')" + > + <p v-html="$sanitize(yourVisitsAreText)"></p> + <span style="margin-left:20px;"> + <a :href="setIgnoreCookieLink"> + › {{ ignoreCookieSet + ? translate('UsersManager_ClickHereToDeleteTheCookie') + : translate('UsersManager_ClickHereToSetTheCookieOnDomain', piwikHost) }} + <br/> + </a> + </span> + </ContentBlock> + </div> </template> <script lang="ts"> diff --git a/plugins/Widgetize/templates/iframe.twig b/plugins/Widgetize/templates/iframe.twig index f96df61f01..fb20d0bb6f 100644 --- a/plugins/Widgetize/templates/iframe.twig +++ b/plugins/Widgetize/templates/iframe.twig @@ -1,5 +1,5 @@ <!DOCTYPE html> -<html id="ng-app" ng-app="piwikApp"> +<html id="ng-app"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex,nofollow"> @@ -7,7 +7,7 @@ {% include "_jsGlobalVariables.twig" %} {% include "_jsCssIncludes.twig" %} </head> - <body ng-app="app" class="widgetized"> + <body class="widgetized"> <div class="widget"> {{ content|raw }} </div> |