diff --git a/core/SiteContentDetector.php b/core/SiteContentDetector.php index d551164c2f5..7747c8014ea 100644 --- a/core/SiteContentDetector.php +++ b/core/SiteContentDetector.php @@ -12,20 +12,21 @@ use Matomo\Cache\Lazy; use Piwik\Config\GeneralConfig; -use Piwik\Plugins\SitesManager\GtmSiteTypeGuesser; -use Piwik\Plugins\SitesManager\SitesManager; +use Piwik\Container\StaticContainer; +use Piwik\Plugins\SitesManager\SiteContentDetection\ConsentManagerDetectionAbstract; +use Piwik\Plugins\SitesManager\SiteContentDetection\SiteContentDetectionAbstract; /** * This class provides detection functions for specific content on a site. It can be used to easily detect the * presence of known third party code. * - * Note: Calling the detect() method will create a HTTP request to the site to retrieve data, only the main site URL + * Note: Calling the `detectContent()` method will create a HTTP request to the site to retrieve data, only the main site URL * will be checked * * Usage: * * $contentDetector = new SiteContentDetector(); - * $contentDetector->detectContent([SiteContentDetector::GA3]); + * $contentDetector->detectContent([GoogleAnalytics3::getId()]); * if ($contentDetector->ga3) { * // site is using GA3 * } @@ -34,26 +35,18 @@ */ class SiteContentDetector { - // Content types - const ALL_CONTENT = 1; - const CONSENT_MANAGER = 2; - const GA3 = 3; - const GA4 = 4; - const GTM = 5; - const CMS = 6; - const JS_FRAMEWORK = 7; - - // Detection detail - public $consentManagerId; // Id of the detected consent manager, eg. 'osano' - public $consentManagerName; // Display name of the detected consent manager, eg. 'Osano' - public $consentManagerUrl; // Url for the configuration guide for the detected consent manager - public $isConnected = false; // True if the detected consent manager is already connected with Matomo - public $ga3; // True if GA3 was detected on the site - public $ga4; // True if GA4 was detected on the site - public $gtm; // True if GTM was detected on the site - public $cms; // The CMS that was detected on the site - public $cloudflare; // true if website is hosted on cloudflare - public $jsFramework; // The JS framework that was detected on the site + /** + * @var array> + */ + public $detectedContent = [ + SiteContentDetectionAbstract::TYPE_TRACKER => [], + SiteContentDetectionAbstract::TYPE_CMS => [], + SiteContentDetectionAbstract::TYPE_JS_FRAMEWORK => [], + SiteContentDetectionAbstract::TYPE_CONSENT_MANAGER => [], + SiteContentDetectionAbstract::TYPE_OTHER => [], + ]; + + public $connectedConsentManagers = []; private $siteResponse = [ 'data' => '', @@ -63,11 +56,6 @@ class SiteContentDetector /** @var Lazy */ private $cache; - /** - * @var GtmSiteTypeGuesser - */ - private $siteGuesser; - public function __construct(?Lazy $cache = null) { if ($cache === null) { @@ -75,26 +63,66 @@ public function __construct(?Lazy $cache = null) } else { $this->cache = $cache; } - $this->siteGuesser = new GtmSiteTypeGuesser(); } + /** - * Reset the detection properties + * @return array + */ + public static function getSiteContentDetectionsByType(): array + { + $instancesByType = []; + $classes = self::getAllSiteContentDetectionClasses(); + + foreach ($classes as $className) { + $instancesByType[$className::getContentType()][] = StaticContainer::get($className); + } + + return $instancesByType; + } + + /** + * Returns the site content detection object with the provided id, or null if it can't be found + * + * @param string $id + * @return SiteContentDetectionAbstract|null + */ + public function getSiteContentDetectionById(string $id): ?SiteContentDetectionAbstract + { + $classes = $this->getAllSiteContentDetectionClasses(); + + foreach ($classes as $className) { + if ($className::getId() === $id) { + return StaticContainer::get($className); + } + } + + return null; + } + + /** + * @return string[] + */ + protected static function getAllSiteContentDetectionClasses(): array + { + return Plugin\Manager::getInstance()->findMultipleComponents('SiteContentDetection', SiteContentDetectionAbstract::class); + } + + /** + * Reset the detections * * @return void */ - private function resetDetectionProperties(): void + private function resetDetections(): void { - $this->consentManagerId = null; - $this->consentManagerUrl = null; - $this->consentManagerName = null; - $this->isConnected = false; - $this->ga3 = false; - $this->ga4 = false; - $this->gtm = false; - $this->cms = SitesManager::SITE_TYPE_UNKNOWN; - $this->cloudflare = false; - $this->jsFramework = SitesManager::JS_FRAMEWORK_UNKNOWN; + $this->detectedContent = [ + SiteContentDetectionAbstract::TYPE_TRACKER => [], + SiteContentDetectionAbstract::TYPE_CMS => [], + SiteContentDetectionAbstract::TYPE_JS_FRAMEWORK => [], + SiteContentDetectionAbstract::TYPE_CONSENT_MANAGER => [], + SiteContentDetectionAbstract::TYPE_OTHER => [], + ]; + $this->connectedConsentManagers = []; } /** @@ -102,17 +130,21 @@ private function resetDetectionProperties(): void * the details of the detected content * * @param array $detectContent Array of content type for which to check, defaults to all, limiting this list - * will speed up the detection check + * will speed up the detection check. + * Allowed values are: + * * empty array - to run all detections + * * an array containing ids of detections, e.g. Wordpress::getId() or any of the + * type constants, e.g. SiteContentDetectionAbstract::TYPE_TRACKER * @param ?int $idSite Override the site ID, will use the site from the current request if null * @param ?array $siteResponse String containing the site data to search, if blank then data will be retrieved * from the current request site via an http request * @param int $timeOut How long to wait for the site to response, defaults to 5 seconds * @return void */ - public function detectContent(array $detectContent = [SiteContentDetector::ALL_CONTENT], + public function detectContent(array $detectContent = [], ?int $idSite = null, ?array $siteResponse = null, int $timeOut = 5): void { - $this->resetDetectionProperties(); + $this->resetDetections(); // If site data was passed in, then just run the detection checks against it and return. if ($siteResponse) { @@ -123,11 +155,7 @@ public function detectContent(array $detectContent = [SiteContentDetector::ALL_C // Get the site id from the request object if not explicitly passed if ($idSite === null) { - if (!isset($_REQUEST['idSite'])) { - return; - } - - $idSite = Common::getRequestVar('idSite', null, 'int'); + $idSite = Request::fromRequest()->getIntegerParameter('idSite', 0); if (!$idSite) { return; @@ -137,13 +165,13 @@ public function detectContent(array $detectContent = [SiteContentDetector::ALL_C $url = Site::getMainUrlFor($idSite); // Check and load previously cached site content detection data if it exists - $cacheKey = 'SiteContentDetector_' . md5($url); - $requiredProperties = $this->getRequiredProperties($detectContent); + $cacheKey = 'SiteContentDetection_' . md5($url); $siteContentDetectionCache = $this->cache->fetch($cacheKey); if ($siteContentDetectionCache !== false) { - if ($this->checkCacheHasRequiredProperties($requiredProperties, $siteContentDetectionCache)) { - $this->loadRequiredPropertiesFromCache($requiredProperties, $siteContentDetectionCache); + if ($this->checkCacheHasRequiredProperties($detectContent, $siteContentDetectionCache)) { + $this->detectedContent = $siteContentDetectionCache['detectedContent']; + $this->connectedConsentManagers = $siteContentDetectionCache['connectedConsentManagers']; return; } } @@ -163,97 +191,104 @@ public function detectContent(array $detectContent = [SiteContentDetector::ALL_C // A request was made to get this data and it isn't currently cached, so write it to the cache now $cacheLife = (60 * 60 * 24 * 7); - $this->savePropertiesToCache($cacheKey, $requiredProperties, $cacheLife); + $this->saveToCache($cacheKey, $cacheLife); } /** - * Returns an array of properties required by the detect content array + * Returns if the detection with the provided id was detected or not * - * @param array $detectContent + * Note: self::detectContent needs to be called before. * - * @return array + * @param string $detectionClassId + * @return bool */ - private function getRequiredProperties(array $detectContent): array + public function wasDetected(string $detectionClassId): bool { - $requiredProperties = []; - - if (in_array(SiteContentDetector::CONSENT_MANAGER, $detectContent) || in_array(SiteContentDetector::ALL_CONTENT, $detectContent)) { - $requiredProperties = array_merge($requiredProperties, ['consentManagerId', 'consentManagerName', 'consentManagerUrl', 'isConnected']); - } - - if (in_array(SiteContentDetector::GA3, $detectContent) || in_array(SiteContentDetector::ALL_CONTENT, $detectContent)) { - $requiredProperties[] = 'ga3'; - } - - if (in_array(SiteContentDetector::GA4, $detectContent) || in_array(SiteContentDetector::ALL_CONTENT, $detectContent)) { - $requiredProperties[] = 'ga4'; - } - - if (in_array(SiteContentDetector::GTM, $detectContent) || in_array(SiteContentDetector::ALL_CONTENT, $detectContent)) { - $requiredProperties[] = 'gtm'; - } - - if (in_array(SiteContentDetector::CMS, $detectContent) || in_array(SiteContentDetector::ALL_CONTENT, $detectContent)) { - $requiredProperties[] = 'cms'; - } - - if (in_array(SiteContentDetector::JS_FRAMEWORK, $detectContent) || in_array(SiteContentDetector::ALL_CONTENT, $detectContent)) { - $requiredProperties[] = 'jsFramework'; + foreach ($this->detectedContent as $type => $detectedClassIds) { + if (array_key_exists($detectionClassId, $detectedClassIds)) { + return $detectedClassIds[$detectionClassId] ?? false; + } } - return $requiredProperties; + return false; } /** - * Checks that all required properties are in the cache array - * - * @param array $properties - * @param array $cache + * Returns an array containing ids of all detected detections of the given type * - * @return bool + * @param string $type One of the SiteContentDetectionAbstract::TYPE_* constants + * @return array */ - private function checkCacheHasRequiredProperties(array $properties, array $cache): bool + public function getDetectsByType(string $type): array { - foreach ($properties as $prop) { - if (!array_key_exists($prop, $cache)) { - return false; + $detected = []; + + foreach ($this->detectedContent[$type] as $objId => $wasDetected) { + if (true === $wasDetected) { + $detected[] = $objId; } } - return true; + return $detected; } /** - * Load object properties from the cache array + * Checks that all required detections are in the cache array * - * @param array $properties + * @param array $detectContent * @param array $cache * - * @return void + * @return bool */ - private function loadRequiredPropertiesFromCache(array $properties, array $cache): void + private function checkCacheHasRequiredProperties(array $detectContent, array $cache): bool { - foreach ($properties as $prop) { - if (!array_key_exists($prop, $cache)) { - continue; + if (empty($detectContent)) { + foreach (self::getSiteContentDetectionsByType() as $type => $entries) { + foreach ($entries as $entry) { + if (!isset($cache['detectedContent'][$type][$entry::getId()])) { + return false; // random detection missing + } + } } - $this->{$prop} = $cache[$prop]; + return true; + } + + foreach ($detectContent as $requestedDetection) { + if (is_string($requestedDetection)) { // specific detection + $detectionObj = $this->getSiteContentDetectionById($requestedDetection); + if (null !== $detectionObj && !isset($cache['detectedContent'][$detectionObj::getContentType()][$detectionObj::getId()])) { + return false; // specific detection was run before + } + } elseif (is_int($requestedDetection)) { // detection type requested + $detectionsByType = self::getSiteContentDetectionsByType(); + if (isset($detectionsByType[$requestedDetection])) { + foreach ($detectionsByType[$requestedDetection] as $detectionObj) { + if (!isset($cache['detectedContent'][$requestedDetection][$detectionObj::getId()])) { + return false; // random detection missing + } + } + } + } } + + return true; } /** - * Save properties to the cache + * Save data to the cache * * @param string $cacheKey - * @param array $properties * @param int $cacheLife * * @return void */ - private function savePropertiesToCache(string $cacheKey, array $properties, int $cacheLife): void + private function saveToCache(string $cacheKey, int $cacheLife): void { - $cacheData = []; + $cacheData = [ + 'detectedContent' => [], + 'connectedConsentManagers' => [], + ]; // Load any existing cached values $siteContentDetectionCache = $this->cache->fetch($cacheKey); @@ -262,10 +297,18 @@ private function savePropertiesToCache(string $cacheKey, array $properties, int $cacheData = $siteContentDetectionCache; } - foreach ($properties as $prop) { - $cacheData[$prop] = $this->{$prop}; + foreach ($this->detectedContent as $type => $detections) { + if (!isset($cacheData['detectedContent'][$type])) { + $cacheData['detectedContent'][$type] = []; + } + foreach ($detections as $detectionId => $wasDetected) + if (null !== $wasDetected) { + $cacheData['detectedContent'][$type][$detectionId] = $wasDetected; + } } + $cacheData['connectedConsentManagers'] = array_merge($cacheData['connectedConsentManagers'], $this->connectedConsentManagers); + $this->cache->save($cacheKey, $cacheData, $cacheLife); } @@ -276,41 +319,29 @@ private function savePropertiesToCache(string $cacheKey, array $properties, int * * @return void */ - private function detectionChecks($detectContent): void + private function detectionChecks(array $detectContent): void { - if (in_array(SiteContentDetector::CONSENT_MANAGER, $detectContent) || in_array(SiteContentDetector::ALL_CONTENT, $detectContent)) { - $this->detectConsentManager(); - } - - if (in_array(SiteContentDetector::GA3, $detectContent) || in_array(SiteContentDetector::ALL_CONTENT, $detectContent)) { - $this->ga3 = $this->siteGuesser->detectGA3FromResponse($this->siteResponse); - } - - if (in_array(SiteContentDetector::GA4, $detectContent) || in_array(SiteContentDetector::ALL_CONTENT, $detectContent)) { - $this->ga4 = $this->siteGuesser->detectGA4FromResponse($this->siteResponse); - } - - if (in_array(SiteContentDetector::GTM, $detectContent) || in_array(SiteContentDetector::ALL_CONTENT, $detectContent)) { - $this->gtm = $this->siteGuesser->guessGtmFromResponse($this->siteResponse); - } - - if (in_array(SiteContentDetector::CMS, $detectContent) || in_array(SiteContentDetector::ALL_CONTENT, $detectContent)) { - $this->cms = $this->siteGuesser->guessSiteTypeFromResponse($this->siteResponse); - } - - if (in_array(SiteContentDetector::JS_FRAMEWORK, $detectContent) || in_array(SiteContentDetector::ALL_CONTENT, $detectContent)) { - $this->jsFramework = $this->siteGuesser->guessJsFrameworkFromResponse($this->siteResponse); - } - - if ( - (!empty($this->siteResponse['headers']['server']) && stripos($this->siteResponse['headers']['server'], 'cloudflare') !== false) || - (!empty($this->siteResponse['headers']['Server']) && stripos($this->siteResponse['headers']['Server'], 'cloudflare') !== false) || - (!empty($this->siteResponse['headers']['SERVER']) && stripos($this->siteResponse['headers']['SERVER'], 'cloudflare') !== false) || - !empty($this->siteResponse['headers']['cf-ray']) || - !empty($this->siteResponse['headers']['Cf-Ray']) || - !empty($this->siteResponse['headers']['CF-RAY']) - ) { - $this->cloudflare = true; + $detections = $this->getSiteContentDetectionsByType(); + + foreach ($detections as $type => $typeDetections) { + foreach ($typeDetections as $typeDetection) { + $this->detectedContent[$type][$typeDetection::getId()] = null; + + if (in_array($type, $detectContent) || + in_array($typeDetection::getId(), $detectContent) || + empty($detectContent)) + { + $this->detectedContent[$type][$typeDetection::getId()] = false; + + if ($typeDetection->isDetected($this->siteResponse['data'], $this->siteResponse['headers'])) { + if ($typeDetection instanceof ConsentManagerDetectionAbstract + && $typeDetection->checkIsConnected($this->siteResponse['data'], $this->siteResponse['headers']) ) { + $this->connectedConsentManagers[] = $typeDetection::getId(); + } + $this->detectedContent[$type][$typeDetection::getId()] = true; + } + } + } } } @@ -344,53 +375,6 @@ private function requestSiteResponse(string $url, int $timeOut): array return $siteData; } - /** - * Detect known consent managers in the site data - * - * Populate this object's properties with the results - * - * @return void - */ - private function detectConsentManager(): void - { - $defs = self::getConsentManagerDefinitions(); - - if (!$defs) { - return; - } - - if (empty($this->siteResponse['data'])) { - return; - } - - foreach ($defs as $consentManagerId => $consentManagerDef) { - foreach ($consentManagerDef['detectStrings'] as $dStr) { - if (empty($dStr)) { - continue; // skip empty detections - } - - if (strpos($this->siteResponse['data'], $dStr) !== false && array_key_exists($consentManagerId, $defs)) { - $this->consentManagerId = $consentManagerId; - $this->consentManagerName = $consentManagerDef['name']; - $this->consentManagerUrl = $consentManagerDef['url']; - break 2; - } - } - } - - if (!isset($defs[$this->consentManagerId]['connectedStrings'])) { - return; - } - - // If a consent manager was detected then perform an additional check to see if it has been connected to Matomo - foreach ($defs[$this->consentManagerId]['connectedStrings'] as $cStr) { - if (strpos($this->siteResponse['data'], $cStr) !== false) { - $this->isConnected = true; - break; - } - } - } - /** * Return an array of consent manager definitions which can be used to detect their presence on the site and show * the associated guide links @@ -401,55 +385,20 @@ private function detectConsentManager(): void * * @return array[] */ - public static function getConsentManagerDefinitions(): array + public static function getKnownConsentManagers(): array { - return [ - - 'osano' => [ - 'name' => 'Osano', - 'detectStrings' => ['osano.com'], - 'connectedStrings' => ["Osano.cm.addEventListener('osano-cm-consent-changed', (change) => { console.log('cm-change'); consentSet(change); });"], - 'url' => 'https://matomo.org/faq/how-to/using-osano-consent-manager-with-matomo', - ], - - 'cookiebot' => [ - 'name' => 'Cookiebot', - 'detectStrings' => ['cookiebot.com'], - 'connectedStrings' => ["typeof _paq === 'undefined' || typeof Cookiebot === 'undefined'"], - 'url' => 'https://matomo.org/faq/how-to/using-cookiebot-consent-manager-with-matomo', - ], - - 'cookieyes' => [ - 'name' => 'CookieYes', - 'detectStrings' => ['cookieyes.com'], - 'connectedStrings' => ['document.addEventListener("cookieyes_consent_update", function (eventData)'], - 'url' => 'https://matomo.org/faq/how-to/using-cookieyes-consent-manager-with-matomo', - ], - - // Note: tarte au citron pro is configured server side so we cannot tell if it has been connected by - // crawling the website, however setup of Matomo with the pro version is automatic, so displaying the guide - // link for pro isn't necessary. Only the open source version is detected by this definition. - 'tarteaucitron' => [ - 'name' => 'Tarte au Citron', - 'detectStrings' => ['tarteaucitron.js'], - 'connectedStrings' => ['tarteaucitron.user.matomoHost'], - 'url' => 'https://matomo.org/faq/how-to/using-tarte-au-citron-consent-manager-with-matomo', - ], - - 'klaro' => [ - 'name' => 'Klaro', - 'detectStrings' => ['klaro.js', 'kiprotect.com'], - 'connectedStrings' => ['KlaroWatcher()', "title: 'Matomo',"], - 'url' => 'https://matomo.org/faq/how-to/using-klaro-consent-manager-with-matomo', - ], - - 'complianz' => [ - 'name' => 'Complianz', - 'detectStrings' => ['complianz-gdpr'], - 'connectedStrings' => ["if (!cmplz_in_array( 'statistics', consentedCategories )) { - _paq.push(['forgetCookieConsentGiven']);"], - 'url' => 'https://matomo.org/faq/how-to/using-complianz-for-wordpress-consent-manager-with-matomo', - ], + $detections = self::getSiteContentDetectionsByType(); + $cmDetections = $detections[SiteContentDetectionAbstract::TYPE_CONSENT_MANAGER]; + + $consentManagers = []; + + foreach ($cmDetections as $detection) { + $consentManagers[$detection::getId()] = [ + 'name' => $detection::getName(), + 'instructionUrl' => $detection::getInstructionUrl(), ]; + } + + return $consentManagers; } } diff --git a/core/Version.php b/core/Version.php index fa4caa77ccb..0af96d04ac2 100644 --- a/core/Version.php +++ b/core/Version.php @@ -21,7 +21,7 @@ final class Version * The current Matomo version. * @var string */ - const VERSION = '5.0.0-rc2'; + const VERSION = '5.0.0-rc3'; const MAJOR_VERSION = 5; diff --git a/plugins/CoreAdminHome/Tasks.php b/plugins/CoreAdminHome/Tasks.php index 6e6c7fb7346..58cf89a910f 100644 --- a/plugins/CoreAdminHome/Tasks.php +++ b/plugins/CoreAdminHome/Tasks.php @@ -147,7 +147,7 @@ public function checkSiteHasTrackedVisits($idSite) { $this->rememberTrackingCodeReminderRan($idSite); - if (!SitesManager::shouldPerormEmptySiteCheck($idSite)) { + if (!SitesManager::shouldPerformEmptySiteCheck($idSite)) { return; } diff --git a/plugins/CoreAdminHome/stylesheets/trackingCodeGenerator.less b/plugins/CoreAdminHome/stylesheets/trackingCodeGenerator.less index 65800dd93bb..e5237adddbf 100644 --- a/plugins/CoreAdminHome/stylesheets/trackingCodeGenerator.less +++ b/plugins/CoreAdminHome/stylesheets/trackingCodeGenerator.less @@ -18,7 +18,7 @@ } } -#tracking-code li .trackingCodeAdvancedOptions .advance-option { +.site-without-data #matomo li .trackingCodeAdvancedOptions .advance-option { margin-top: 1rem; margin-left: 1.25rem } \ No newline at end of file diff --git a/plugins/CoreAdminHome/templates/trackingCodeGenerator.twig b/plugins/CoreAdminHome/templates/trackingCodeGenerator.twig index 98752120a55..e7becb052d9 100644 --- a/plugins/CoreAdminHome/templates/trackingCodeGenerator.twig +++ b/plugins/CoreAdminHome/templates/trackingCodeGenerator.twig @@ -25,7 +25,7 @@ {{ 'CoreAdminHome_HttpTrackingApi'|translate }} {{ 'SitesManager_SiteWithoutDataSinglePageApplication'|translate }} {{ 'SitesManager_SiteWithoutDataGoogleTagManager'|translate }} - Wordpress + WordPress Cloudflare Vue.js React.js @@ -71,7 +71,7 @@

{{ 'CoreAdminHome_GoogleTagManagerDescription'|translate('','')|raw }}

-
+

{{ 'CoreAdminHome_WordpressDescription'|translate('','')|raw }}

diff --git a/plugins/CoreAdminHome/tests/UI/expected-screenshots/TrackingCodeGenerator_initial.png b/plugins/CoreAdminHome/tests/UI/expected-screenshots/TrackingCodeGenerator_initial.png index b2d641907b4..cbd018dcb11 100644 --- a/plugins/CoreAdminHome/tests/UI/expected-screenshots/TrackingCodeGenerator_initial.png +++ b/plugins/CoreAdminHome/tests/UI/expected-screenshots/TrackingCodeGenerator_initial.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:81c79f7594265d187981f437b19798f09f0f94adf658be14bf08475ed7457085 -size 466865 +oid sha256:179d2b0697e16f0b34badec5cc59a8d14e28ca3d64a165f9ffe6ec9ef75723bb +size 466822 diff --git a/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.js b/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.js index 09aaf861def..318194f774a 100644 --- a/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.js +++ b/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.js @@ -914,58 +914,58 @@ function SmtpSettingsvue_type_template_id_14e9a186_render(_ctx, _cache, $props, SmtpSettingsvue_type_script_lang_ts.render = SmtpSettingsvue_type_template_id_14e9a186_render /* harmony default export */ var SmtpSettings = (SmtpSettingsvue_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/CoreAdminHome/vue/src/JsTrackingCodeGenerator/JsTrackingCodeGenerator.vue?vue&type=template&id=7dd382c0 +// 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/CoreAdminHome/vue/src/JsTrackingCodeGenerator/JsTrackingCodeGenerator.vue?vue&type=template&id=0055e292 -var JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_1 = { +var JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_1 = { id: "js-code-options" }; -var JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_2 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); +var JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_2 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -var JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_3 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); +var JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_3 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -var JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_4 = ["innerHTML"]; -var JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_5 = ["innerHTML"]; +var JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_4 = ["innerHTML"]; +var JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_5 = ["innerHTML"]; -var JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_6 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); +var JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_6 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -var JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_7 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); +var JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_7 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -var JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_8 = ["innerHTML"]; +var JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_8 = ["innerHTML"]; -var JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_9 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); +var JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_9 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -var JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_10 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); +var JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_10 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -var JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_11 = ["innerHTML"]; +var JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_11 = ["innerHTML"]; -var JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_12 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); +var JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_12 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -var JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_13 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); +var JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_13 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -var JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_14 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { +var JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_14 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { href: "https://matomo.org/faq/new-to-piwik/how-do-i-install-the-matomo-tracking-code-on-wordpress/", target: "_blank", rel: "noopener" }, "WordPress", -1); -var JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_15 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" | "); +var JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_15 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" | "); -var JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_16 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { +var JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_16 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { href: "https://matomo.org/faq/new-to-piwik/how-do-i-integrate-matomo-with-squarespace-website/", target: "_blank", rel: "noopener" }, "Squarespace", -1); -var JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_17 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" | "); +var JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_17 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" | "); -var JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_18 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { +var JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_18 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { href: "https://matomo.org/faq/new-to-piwik/how-do-i-install-the-matomo-analytics-tracking-code-on-wix/", target: "_blank", rel: "noopener" }, "Wix", -1); -var JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_19 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" | "); +var JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_19 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" | "); var _hoisted_20 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { href: "https://matomo.org/faq/how-to-install/faq_19424/", @@ -1010,7 +1010,7 @@ var _hoisted_30 = { id: "javascript-text" }; var _hoisted_31 = ["textContent"]; -function JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_render(_ctx, _cache, $props, $setup, $data, $options) { +function JsTrackingCodeGeneratorvue_type_template_id_0055e292_render(_ctx, _cache, $props, $setup, $data, $options) { var _component_Field = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Field"); var _component_JsTrackingCodeAdvancedOptions = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("JsTrackingCodeAdvancedOptions"); @@ -1024,15 +1024,15 @@ function JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_render(_ctx, _cach "content-title": _ctx.translate('CoreAdminHome_JavaScriptTracking') }, { default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { - return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_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('CoreAdminHome_JSTrackingIntro1')) + " ", 1), JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_2, JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CoreAdminHome_JSTrackingIntro2')) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_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('CoreAdminHome_JSTrackingIntro1')) + " ", 1), JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_2, JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CoreAdminHome_JSTrackingIntro2')) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { innerHTML: _ctx.$sanitize(_ctx.jsTrackingIntro3a) - }, null, 8, JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_4), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + }, null, 8, JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_4), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { innerHTML: _ctx.$sanitize(' ' + _ctx.jsTrackingIntro3b) - }, null, 8, JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_5), JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_6, JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_7, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + }, null, 8, JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_5), JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_6, JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_7, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { innerHTML: _ctx.$sanitize(_ctx.jsTrackingIntro4a) - }, null, 8, JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_8), JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_9, JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_10, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + }, null, 8, JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_8), JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_9, JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_10, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { innerHTML: _ctx.$sanitize(_ctx.jsTrackingIntro5) - }, null, 8, JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_11), JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_12, JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_13, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_InstallationGuides')) + " : ", 1), JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_14, JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_15, JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_16, JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_17, JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_18, JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_hoisted_19, _hoisted_20, _hoisted_21, _hoisted_22, _hoisted_23, _hoisted_24, _hoisted_25, _hoisted_26]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + }, null, 8, JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_11), JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_12, JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_13, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_InstallationGuides')) + " : ", 1), JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_14, JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_15, JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_16, JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_17, JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_18, JsTrackingCodeGeneratorvue_type_template_id_0055e292_hoisted_19, _hoisted_20, _hoisted_21, _hoisted_22, _hoisted_23, _hoisted_24, _hoisted_25, _hoisted_26]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { uicontrol: "site", name: "js-tracker-website", class: "jsTrackingCodeWebsite", @@ -1062,7 +1062,7 @@ function JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_render(_ctx, _cach _: 1 }, 8, ["content-title"]); } -// CONCATENATED MODULE: ./plugins/CoreAdminHome/vue/src/JsTrackingCodeGenerator/JsTrackingCodeGenerator.vue?vue&type=template&id=7dd382c0 +// CONCATENATED MODULE: ./plugins/CoreAdminHome/vue/src/JsTrackingCodeGenerator/JsTrackingCodeGenerator.vue?vue&type=template&id=0055e292 // 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/CoreAdminHome/vue/src/JsTrackingCodeGenerator/JsTrackingCodeAdvancedOptions.vue?vue&type=template&id=cc111ec2 @@ -1681,7 +1681,7 @@ JsTrackingCodeAdvancedOptionsvue_type_script_lang_ts.render = JsTrackingCodeAdva external_CoreHome_["AjaxHelper"].fetch({ module: 'API', format: 'json', - method: 'Tour.detectConsentManager', + method: 'SitesManager.detectConsentManager', idSite: idSite, filter_limit: '-1' }).then(function (response) { @@ -1737,7 +1737,7 @@ JsTrackingCodeAdvancedOptionsvue_type_script_lang_ts.render = JsTrackingCodeAdva -JsTrackingCodeGeneratorvue_type_script_lang_ts.render = JsTrackingCodeGeneratorvue_type_template_id_7dd382c0_render +JsTrackingCodeGeneratorvue_type_script_lang_ts.render = JsTrackingCodeGeneratorvue_type_template_id_0055e292_render /* harmony default export */ var JsTrackingCodeGenerator = (JsTrackingCodeGeneratorvue_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/CoreAdminHome/vue/src/JsTrackingCodeGenerator/JsTrackingCodeGeneratorSitesWithoutData.vue?vue&type=template&id=06b9935e diff --git a/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.min.js b/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.min.js index 28429eec1c3..4a89ffc5f94 100644 --- a/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.min.js +++ b/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.min.js @@ -1,4 +1,4 @@ -(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["CoreAdminHome"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["CoreAdminHome"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,n){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var a=t[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},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 o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(o,a,function(t){return e[t]}.bind(null,a));return o},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/CoreAdminHome/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},a5a2:function(e,t){e.exports=n},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"ArchivingSettings",(function(){return E})),n.d(t,"BrandingSettings",(function(){return X})),n.d(t,"SmtpSettings",(function(){return ne})),n.d(t,"JsTrackingCodeGenerator",(function(){return Vt})),n.d(t,"JsTrackingCodeGeneratorSitesWithoutData",(function(){return wt})),n.d(t,"ImageTrackingCodeGenerator",(function(){return tn})),n.d(t,"TrackingFailures",(function(){return wn})),"undefined"!==typeof window){var o=window.document.currentScript,a=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);a&&(n.p=a[1])}var r=n("8bbf"),i={class:"form-group row"},l={class:"col s12"},c={class:"col s12 m6"},s={class:"form-description",style:{"margin-left":"4px"}},d={for:"enableBrowserTriggerArchiving2"},u=["innerHTML"],m={class:"col s12 m6"},g=["innerHTML"],p={class:"form-group row"},b={class:"col s12"},h={class:"input-field col s12 m6"},j=["disabled"],v={class:"form-description"},f={class:"col s12 m6"},O={key:0,class:"form-help"},C={key:0},k=Object(r["createElementVNode"])("br",null,null,-1),V=Object(r["createElementVNode"])("br",null,null,-1),N=Object(r["createElementVNode"])("br",null,null,-1);function S(e,t,n,o,a,S){var T=Object(r["resolveComponent"])("SaveButton"),y=Object(r["resolveComponent"])("ContentBlock");return Object(r["openBlock"])(),Object(r["createBlock"])(y,{"content-title":e.translate("CoreAdminHome_ArchivingSettings"),anchor:"archivingSettings",class:"matomo-archiving-settings"},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("div",i,[Object(r["createElementVNode"])("h3",l,Object(r["toDisplayString"])(e.translate("General_AllowPiwikArchivingToTriggerBrowser")),1),Object(r["createElementVNode"])("div",c,[Object(r["createElementVNode"])("p",null,[Object(r["createElementVNode"])("label",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{type:"radio",id:"enableBrowserTriggerArchiving1",name:"enableBrowserTriggerArchiving",value:"1","onUpdate:modelValue":t[0]||(t[0]=function(t){return e.enableBrowserTriggerArchivingValue=t})},null,512),[[r["vModelRadio"],e.enableBrowserTriggerArchivingValue]]),Object(r["createElementVNode"])("span",null,Object(r["toDisplayString"])(e.translate("General_Yes")),1),Object(r["createElementVNode"])("span",s,Object(r["toDisplayString"])(e.translate("General_Default")),1)])]),Object(r["createElementVNode"])("p",null,[Object(r["createElementVNode"])("label",d,[Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{type:"radio",id:"enableBrowserTriggerArchiving2",name:"enableBrowserTriggerArchiving",value:"0","onUpdate:modelValue":t[1]||(t[1]=function(t){return e.enableBrowserTriggerArchivingValue=t})},null,512),[[r["vModelRadio"],e.enableBrowserTriggerArchivingValue]]),Object(r["createElementVNode"])("span",null,Object(r["toDisplayString"])(e.translate("General_No")),1),Object(r["createElementVNode"])("span",{class:"form-description",innerHTML:e.$sanitize(e.archivingTriggerDesc),style:{"margin-left":"4px"}},null,8,u)])])]),Object(r["createElementVNode"])("div",m,[Object(r["createElementVNode"])("div",{class:"form-help",innerHTML:e.$sanitize(e.archivingInlineHelp)},null,8,g)])]),Object(r["createElementVNode"])("div",p,[Object(r["createElementVNode"])("h3",b,Object(r["toDisplayString"])(e.translate("General_ReportsContainingTodayWillBeProcessedAtMostEvery")),1),Object(r["createElementVNode"])("div",h,[Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{type:"text","onUpdate:modelValue":t[2]||(t[2]=function(t){return e.todayArchiveTimeToLiveValue=t}),id:"todayArchiveTimeToLive",disabled:!e.isGeneralSettingsAdminEnabled},null,8,j),[[r["vModelText"],e.todayArchiveTimeToLiveValue]]),Object(r["createElementVNode"])("span",v,Object(r["toDisplayString"])(e.translate("General_RearchiveTimeIntervalOnlyForTodayReports")),1)]),Object(r["createElementVNode"])("div",f,[e.isGeneralSettingsAdminEnabled?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",O,[e.showWarningCron?(Object(r["openBlock"])(),Object(r["createElementBlock"])("strong",C,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("General_NewReportsWillBeProcessedByCron")),1),k,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_ReportsWillBeProcessedAtMostEveryHour"))+" "+Object(r["toDisplayString"])(e.translate("General_IfArchivingIsFastYouCanSetupCronRunMoreOften")),1),V])):Object(r["createCommentVNode"])("",!0),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_SmallTrafficYouCanLeaveDefault",e.todayArchiveTimeToLiveDefault))+" ",1),N,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_MediumToHighTrafficItIsRecommendedTo",1800,3600)),1)])):Object(r["createCommentVNode"])("",!0)])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(T,{saving:e.isLoading,onConfirm:t[3]||(t[3]=function(t){return e.save()})},null,8,["saving"])])])]})),_:1},8,["content-title"])}var T=n("19dc"),y=n("a5a2"),A=Object(r["defineComponent"])({props:{enableBrowserTriggerArchiving:Boolean,showSegmentArchiveTriggerInfo:Boolean,isGeneralSettingsAdminEnabled:Boolean,showWarningCron:Boolean,todayArchiveTimeToLive:Number,todayArchiveTimeToLiveDefault:Number},components:{ContentBlock:T["ContentBlock"],SaveButton:y["SaveButton"]},data:function(){return{isLoading:!1,enableBrowserTriggerArchivingValue:this.enableBrowserTriggerArchiving?1:0,todayArchiveTimeToLiveValue:this.todayArchiveTimeToLive}},watch:{enableBrowserTriggerArchiving:function(e){this.enableBrowserTriggerArchivingValue=e?1:0},todayArchiveTimeToLive:function(e){this.todayArchiveTimeToLiveValue=e}},computed:{archivingTriggerDesc:function(){var e="";return e+=Object(T["translate"])("General_ArchivingTriggerDescription",'',""),this.showSegmentArchiveTriggerInfo&&(e+=Object(T["translate"])("General_ArchivingTriggerSegment")),e},archivingInlineHelp:function(){var e=Object(T["translate"])("General_ArchivingInlineHelp");return e+="
",e+=Object(T["translate"])("General_SeeTheOfficialDocumentationForMoreInformation",'',""),e}},methods:{save:function(){var e=this;this.isLoading=!0,T["AjaxHelper"].post({module:"API",method:"CoreAdminHome.setArchiveSettings"},{enableBrowserTriggerArchiving:this.enableBrowserTriggerArchivingValue,todayArchiveTimeToLive:this.todayArchiveTimeToLiveValue}).then((function(){e.isLoading=!1;var t=T["NotificationsStore"].show({message:Object(T["translate"])("CoreAdminHome_SettingsSaveSuccess"),type:"transient",id:"generalSettings",context:"success"});T["NotificationsStore"].scrollToNotification(t)})).finally((function(){e.isLoading=!1}))}}});A.render=S;var E=A,w={id:"logoSettings"},_={id:"logoUploadForm",ref:"logoUploadForm",method:"post",enctype:"multipart/form-data",action:"index.php?module=CoreAdminHome&format=json&action=uploadCustomLogo"},H={key:0},D=["value"],x=Object(r["createElementVNode"])("input",{type:"hidden",name:"force_api_session",value:"1"},null,-1),L={key:0},B={key:0,class:"alert alert-warning uploaderror"},U={class:"row"},F={class:"col s12"},I=["src"],M={class:"row"},P={class:"col s12"},G=["src"],J={key:1},q=["innerHTML"],R={key:1},W={class:"alert alert-warning"};function K(e,t,n,o,a,i){var l=Object(r["resolveComponent"])("Field"),c=Object(r["resolveComponent"])("SaveButton"),s=Object(r["resolveComponent"])("ContentBlock"),d=Object(r["resolveDirective"])("form");return Object(r["openBlock"])(),Object(r["createBlock"])(s,{"content-title":e.translate("CoreAdminHome_BrandingSettings"),anchor:"brandingSettings"},{default:Object(r["withCtx"])((function(){return[Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("CoreAdminHome_CustomLogoHelpText")),1),Object(r["createVNode"])(l,{name:"useCustomLogo",uicontrol:"checkbox","model-value":e.enabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onUseCustomLogoChange(t)}),title:e.translate("CoreAdminHome_UseCustomLogo"),"inline-help":e.help},null,8,["model-value","title","inline-help"]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",w,[Object(r["createElementVNode"])("form",_,[e.fileUploadEnabled?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",H,[Object(r["createElementVNode"])("input",{type:"hidden",name:"token_auth",value:e.tokenAuth},null,8,D),x,e.logosWriteable?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",L,[Object(r["createVNode"])(r["Transition"],{name:"fade-out"},{default:Object(r["withCtx"])((function(){return[e.showUploadError?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",B,Object(r["toDisplayString"])(e.translate("CoreAdminHome_LogoUploadFailed")),1)):Object(r["createCommentVNode"])("",!0)]})),_:1}),Object(r["createVNode"])(l,{uicontrol:"file",name:"customLogo","model-value":e.customLogo,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.onCustomLogoChange(t)}),title:e.translate("CoreAdminHome_LogoUpload"),"inline-help":e.translate("CoreAdminHome_LogoUploadHelp","JPG / PNG / GIF","110")},null,8,["model-value","title","inline-help"]),Object(r["createElementVNode"])("div",U,[Object(r["createElementVNode"])("div",F,[Object(r["createElementVNode"])("img",{src:e.pathUserLogoWithBuster,id:"currentLogo",style:{"max-height":"150px"},ref:"currentLogo"},null,8,I)])]),Object(r["createVNode"])(l,{uicontrol:"file",name:"customFavicon","model-value":e.customFavicon,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.onFaviconChange(t)}),title:e.translate("CoreAdminHome_FaviconUpload"),"inline-help":e.translate("CoreAdminHome_LogoUploadHelp","JPG / PNG / GIF","16")},null,8,["model-value","title","inline-help"]),Object(r["createElementVNode"])("div",M,[Object(r["createElementVNode"])("div",P,[Object(r["createElementVNode"])("img",{src:e.pathUserFaviconWithBuster,id:"currentFavicon",width:"16",height:"16",ref:"currentFavicon"},null,8,G)])])])):Object(r["createCommentVNode"])("",!0),e.logosWriteable?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",J,[Object(r["createElementVNode"])("div",{class:"alert alert-warning",innerHTML:e.$sanitize(e.logosNotWriteableWarning)},null,8,q)]))])):Object(r["createCommentVNode"])("",!0),e.fileUploadEnabled?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",R,[Object(r["createElementVNode"])("div",W,Object(r["toDisplayString"])(e.translate("CoreAdminHome_FileUploadDisabled","file_uploads=1")),1)]))],512)],512),[[r["vShow"],e.enabled]]),Object(r["createVNode"])(c,{onConfirm:t[3]||(t[3]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])],512),[[d]])]})),_:1},8,["content-title"])}var z=window,Q=z.$,Y=Object(r["defineComponent"])({props:{fileUploadEnabled:{type:Boolean,required:!0},logosWriteable:{type:Boolean,required:!0},useCustomLogo:{type:Boolean,required:!0},pathUserLogoDirectory:{type:String,required:!0},pathUserLogo:{type:String,required:!0},pathUserLogoSmall:{type:String,required:!0},pathUserLogoSvg:{type:String,required:!0},hasUserLogo:{type:Boolean,required:!0},pathUserFavicon:{type:String,required:!0},hasUserFavicon:{type:Boolean,required:!0},isPluginsAdminEnabled:{type:Boolean,required:!0}},components:{Field:y["Field"],ContentBlock:T["ContentBlock"],SaveButton:y["SaveButton"]},directives:{Form:y["Form"]},data:function(){return{isLoading:!1,enabled:this.useCustomLogo,customLogo:this.pathUserLogo,customFavicon:this.pathUserFavicon,showUploadError:!1,currentLogoSrcExists:this.hasUserLogo,currentFaviconSrcExists:this.hasUserFavicon,currentLogoCacheBuster:(new Date).getTime(),currentFaviconCacheBuster:(new Date).getTime()}},computed:{tokenAuth:function(){return T["Matomo"].token_auth},logosNotWriteableWarning:function(){return Object(T["translate"])("CoreAdminHome_LogoNotWriteableInstruction","".concat(this.pathUserLogoDirectory,"
"),"".concat(this.pathUserLogo,", ").concat(this.pathUserLogoSmall,", ").concat(this.pathUserLogoSvg))},help:function(){if(this.isPluginsAdminEnabled){var e='"'.concat(Object(T["translate"])("General_GiveUsYourFeedback"),'"'),t='';return Object(T["translate"])("CoreAdminHome_CustomLogoFeedbackInfo",e,t,"")}},pathUserLogoWithBuster:function(){return this.currentLogoSrcExists&&this.pathUserLogo?"".concat(this.pathUserLogo,"?").concat(this.currentLogoCacheBuster):""},pathUserFaviconWithBuster:function(){return this.currentFaviconSrcExists&&this.pathUserFavicon?"".concat(this.pathUserFavicon,"?").concat(this.currentFaviconCacheBuster):""}},methods:{onUseCustomLogoChange:function(e){this.enabled=e},onCustomLogoChange:function(e){this.customLogo=e,this.updateLogo()},onFaviconChange:function(e){this.customFavicon=e,this.updateLogo()},save:function(){var e=this;this.isLoading=!0,T["AjaxHelper"].post({module:"API",method:"CoreAdminHome.setBrandingSettings"},{useCustomLogo:this.enabled?"1":"0"}).then((function(){var e=T["NotificationsStore"].show({message:Object(T["translate"])("CoreAdminHome_SettingsSaveSuccess"),type:"transient",id:"generalSettings",context:"success"});T["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.isLoading=!1}))},updateLogo:function(){var e=this,t=!!this.customLogo,n=!!this.customFavicon;if(t||n){this.showUploadError=!1;var o="upload".concat((new Date).getTime()),a=Q('