diff options
Diffstat (limited to 'plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.min.js')
-rw-r--r-- | plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.min.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.min.js b/plugins/CoreAdminHome/vue/dist/CoreAdminHome.umd.min.js index aa90cafd3f..daffcebdcc 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 r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.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 r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));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 Y})),n.d(t,"SmtpSettings",(function(){return te})),n.d(t,"JsTrackingCodeGenerator",(function(){return bt})),n.d(t,"ImageTrackingCodeGenerator",(function(){return Gt})),n.d(t,"TrackingFailures",(function(){return bn})),"undefined"!==typeof window){var o=window.document.currentScript,r=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(n.p=r[1])}var a=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"],f={class:"form-description"},v={class:"col s12 m6"},O={key:0,class:"form-help"},C={key:0},k=Object(a["createElementVNode"])("br",null,null,-1),V=Object(a["createElementVNode"])("br",null,null,-1),S=Object(a["createElementVNode"])("br",null,null,-1);function N(e,t,n,o,r,N){var y=Object(a["resolveComponent"])("SaveButton"),T=Object(a["resolveComponent"])("ContentBlock");return Object(a["openBlock"])(),Object(a["createBlock"])(T,{"content-title":e.translate("CoreAdminHome_ArchivingSettings"),anchor:"archivingSettings",class:"matomo-archiving-settings"},{default:Object(a["withCtx"])((function(){return[Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("div",i,[Object(a["createElementVNode"])("h3",l,Object(a["toDisplayString"])(e.translate("General_AllowPiwikArchivingToTriggerBrowser")),1),Object(a["createElementVNode"])("div",c,[Object(a["createElementVNode"])("p",null,[Object(a["createElementVNode"])("label",null,[Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{type:"radio",id:"enableBrowserTriggerArchiving1",name:"enableBrowserTriggerArchiving",value:"1","onUpdate:modelValue":t[0]||(t[0]=function(t){return e.enableBrowserTriggerArchivingValue=t})},null,512),[[a["vModelRadio"],e.enableBrowserTriggerArchivingValue]]),Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(e.translate("General_Yes")),1),Object(a["createElementVNode"])("span",s,Object(a["toDisplayString"])(e.translate("General_Default")),1)])]),Object(a["createElementVNode"])("p",null,[Object(a["createElementVNode"])("label",d,[Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{type:"radio",id:"enableBrowserTriggerArchiving2",name:"enableBrowserTriggerArchiving",value:"0","onUpdate:modelValue":t[1]||(t[1]=function(t){return e.enableBrowserTriggerArchivingValue=t})},null,512),[[a["vModelRadio"],e.enableBrowserTriggerArchivingValue]]),Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(e.translate("General_No")),1),Object(a["createElementVNode"])("span",{class:"form-description",innerHTML:e.$sanitize(e.archivingTriggerDesc),style:{"margin-left":"4px"}},null,8,u)])])]),Object(a["createElementVNode"])("div",m,[Object(a["createElementVNode"])("div",{class:"form-help",innerHTML:e.$sanitize(e.archivingInlineHelp)},null,8,g)])]),Object(a["createElementVNode"])("div",p,[Object(a["createElementVNode"])("h3",b,Object(a["toDisplayString"])(e.translate("General_ReportsContainingTodayWillBeProcessedAtMostEvery")),1),Object(a["createElementVNode"])("div",h,[Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{type:"text","onUpdate:modelValue":t[2]||(t[2]=function(t){return e.todayArchiveTimeToLiveValue=t}),id:"todayArchiveTimeToLive",disabled:!e.isGeneralSettingsAdminEnabled},null,8,j),[[a["vModelText"],e.todayArchiveTimeToLiveValue]]),Object(a["createElementVNode"])("span",f,Object(a["toDisplayString"])(e.translate("General_RearchiveTimeIntervalOnlyForTodayReports")),1)]),Object(a["createElementVNode"])("div",v,[e.isGeneralSettingsAdminEnabled?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",O,[e.showWarningCron?(Object(a["openBlock"])(),Object(a["createElementBlock"])("strong",C,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("General_NewReportsWillBeProcessedByCron")),1),k,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("General_ReportsWillBeProcessedAtMostEveryHour"))+" "+Object(a["toDisplayString"])(e.translate("General_IfArchivingIsFastYouCanSetupCronRunMoreOften")),1),V])):Object(a["createCommentVNode"])("",!0),Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("General_SmallTrafficYouCanLeaveDefault",e.todayArchiveTimeToLiveDefault))+" ",1),S,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("General_MediumToHighTrafficItIsRecommendedTo",1800,3600)),1)])):Object(a["createCommentVNode"])("",!0)])]),Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(y,{saving:e.isLoading,onConfirm:t[3]||(t[3]=function(t){return e.save()})},null,8,["saving"])])])]})),_:1},8,["content-title"])}var y=n("19dc"),T=n("a5a2"),A=Object(a["defineComponent"])({props:{enableBrowserTriggerArchiving:Boolean,showSegmentArchiveTriggerInfo:Boolean,isGeneralSettingsAdminEnabled:Boolean,showWarningCron:Boolean,todayArchiveTimeToLive:Number,todayArchiveTimeToLiveDefault:Number},components:{ContentBlock:y["ContentBlock"],SaveButton:T["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(y["translate"])("General_ArchivingTriggerDescription",'<a target="_blank" rel="noreferrer noopener" href="https://matomo.org/docs/setup-auto-archiving/">',"</a>"),this.showSegmentArchiveTriggerInfo&&(e+=Object(y["translate"])("General_ArchivingTriggerSegment")),e},archivingInlineHelp:function(){var e=Object(y["translate"])("General_ArchivingInlineHelp");return e+="<br/>",e+=Object(y["translate"])("General_SeeTheOfficialDocumentationForMoreInformation",'<a target="_blank" rel="noreferrer noopener" href="https://matomo.org/docs/setup-auto-archiving/">',"</a>"),e}},methods:{save:function(){var e=this;this.isLoading=!0,y["AjaxHelper"].post({module:"API",method:"CoreAdminHome.setArchiveSettings"},{enableBrowserTriggerArchiving:this.enableBrowserTriggerArchivingValue,todayArchiveTimeToLive:this.todayArchiveTimeToLiveValue}).then((function(){e.isLoading=!1;var t=y["NotificationsStore"].show({message:Object(y["translate"])("CoreAdminHome_SettingsSaveSuccess"),type:"transient",id:"generalSettings",context:"success"});y["NotificationsStore"].scrollToNotification(t)})).finally((function(){e.isLoading=!1}))}}});A.render=N;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"],L=Object(a["createElementVNode"])("input",{type:"hidden",name:"force_api_session",value:"1"},null,-1),x={key:0},B={key:0,class:"alert alert-warning uploaderror"},U={class:"row"},F={class:"col s12"},I=["src"],G={class:"row"},P={class:"col s12"},M=["src"],q={key:1},J=["innerHTML"],R={key:1},W={class:"alert alert-warning"};function $(e,t,n,o,r,i){var l=Object(a["resolveComponent"])("Field"),c=Object(a["resolveComponent"])("SaveButton"),s=Object(a["resolveComponent"])("ContentBlock"),d=Object(a["resolveDirective"])("form");return Object(a["openBlock"])(),Object(a["createBlock"])(s,{"content-title":e.translate("CoreAdminHome_BrandingSettings"),anchor:"brandingSettings"},{default:Object(a["withCtx"])((function(){return[Object(a["withDirectives"])(Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("p",null,Object(a["toDisplayString"])(e.translate("CoreAdminHome_CustomLogoHelpText")),1),Object(a["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(a["withDirectives"])(Object(a["createElementVNode"])("div",w,[Object(a["createElementVNode"])("form",_,[e.fileUploadEnabled?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",H,[Object(a["createElementVNode"])("input",{type:"hidden",name:"token_auth",value:e.tokenAuth},null,8,D),L,e.logosWriteable?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",x,[Object(a["createVNode"])(a["Transition"],{name:"fade-out"},{default:Object(a["withCtx"])((function(){return[e.showUploadError?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",B,Object(a["toDisplayString"])(e.translate("CoreAdminHome_LogoUploadFailed")),1)):Object(a["createCommentVNode"])("",!0)]})),_:1}),Object(a["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(a["createElementVNode"])("div",U,[Object(a["createElementVNode"])("div",F,[Object(a["createElementVNode"])("img",{src:e.pathUserLogoWithBuster,id:"currentLogo",style:{"max-height":"150px"},ref:"currentLogo"},null,8,I)])]),Object(a["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(a["createElementVNode"])("div",G,[Object(a["createElementVNode"])("div",P,[Object(a["createElementVNode"])("img",{src:e.pathUserFaviconWithBuster,id:"currentFavicon",width:"16",height:"16",ref:"currentFavicon"},null,8,M)])])])):Object(a["createCommentVNode"])("",!0),e.logosWriteable?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",q,[Object(a["createElementVNode"])("div",{class:"alert alert-warning",innerHTML:e.$sanitize(e.logosNotWriteableWarning)},null,8,J)]))])):Object(a["createCommentVNode"])("",!0),e.fileUploadEnabled?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",R,[Object(a["createElementVNode"])("div",W,Object(a["toDisplayString"])(e.translate("CoreAdminHome_FileUploadDisabled","file_uploads=1")),1)]))],512)],512),[[a["vShow"],e.enabled]]),Object(a["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 K=window,z=K.$,Q=Object(a["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:T["Field"],ContentBlock:y["ContentBlock"],SaveButton:T["SaveButton"]},directives:{Form:T["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 y["Matomo"].token_auth},logosNotWriteableWarning:function(){return Object(y["translate"])("CoreAdminHome_LogoNotWriteableInstruction","<code>".concat(this.pathUserLogoDirectory,"</code><br/>"),"".concat(this.pathUserLogo,", ").concat(this.pathUserLogoSmall,", ").concat(this.pathUserLogoSvg))},help:function(){if(this.isPluginsAdminEnabled){var e='"'.concat(Object(y["translate"])("General_GiveUsYourFeedback"),'"'),t='<a href="?module=CorePluginsAdmin&action=plugins" rel="noreferrer noopener" target="_blank">';return Object(y["translate"])("CoreAdminHome_CustomLogoFeedbackInfo",e,t,"</a>")}},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,y["AjaxHelper"].post({module:"API",method:"CoreAdminHome.setBrandingSettings"},{useCustomLogo:this.enabled?"1":"0"}).then((function(){var e=y["NotificationsStore"].show({message:Object(y["translate"])("CoreAdminHome_SettingsSaveSuccess"),type:"transient",id:"generalSettings",context:"success"});y["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()),r=z('<iframe name="'.concat(o,'" />'));r.css("display","none"),r.on("load",(function(){setTimeout((function(){var o=(z(r.contents()).find("body").html()||"").trim();"0"===o?e.showUploadError=!0:(t&&(e.currentLogoSrcExists=!0,e.currentLogoCacheBuster=(new Date).getTime()),n&&(e.currentFaviconSrcExists=!0,e.currentFaviconCacheBuster=(new Date).getTime())),"1"!==o&&"0"!==o||r.remove()}),1e3)})),z("body:first").append(r);var a=z(this.$refs.logoUploadForm);a.attr("target",o),a.submit(),this.customLogo="",this.customFavicon=""}}}});Q.render=$;var Y=Q,X={id:"smtpSettings"};function Z(e,t,n,o,r,i){var l=Object(a["resolveComponent"])("Field"),c=Object(a["resolveComponent"])("SaveButton"),s=Object(a["resolveComponent"])("ContentBlock"),d=Object(a["resolveDirective"])("form");return Object(a["openBlock"])(),Object(a["createBlock"])(s,{"content-title":e.translate("CoreAdminHome_EmailServerSettings"),anchor:"mailSettings"},{default:Object(a["withCtx"])((function(){return[Object(a["withDirectives"])(Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"mailUseSmtp",modelValue:e.enabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.enabled=t}),title:e.translate("General_UseSMTPServerForEmail"),"inline-help":e.translate("General_SelectYesIfYouWantToSendEmailsViaServer")},null,8,["modelValue","title","inline-help"]),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",X,[Object(a["createVNode"])(l,{uicontrol:"text",name:"mailHost","model-value":e.mailHost,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.onUpdateMailHost(t)}),title:e.translate("General_SmtpServerAddress")},null,8,["model-value","title"]),Object(a["createVNode"])(l,{uicontrol:"text",name:"mailPort",modelValue:e.mailPort,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.mailPort=t}),title:e.translate("General_SmtpPort"),"inline-help":e.translate("General_OptionalSmtpPort")},null,8,["modelValue","title","inline-help"]),Object(a["createVNode"])(l,{uicontrol:"select",name:"mailType",modelValue:e.mailType,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.mailType=t}),title:e.translate("General_AuthenticationMethodSmtp"),options:e.mailTypes,"inline-help":e.translate("General_OnlyUsedIfUserPwdIsSet")},null,8,["modelValue","title","options","inline-help"]),Object(a["createVNode"])(l,{uicontrol:"text",name:"mailUsername",modelValue:e.mailUsername,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.mailUsername=t}),title:e.translate("General_SmtpUsername"),"inline-help":e.translate("General_OnlyEnterIfRequired"),autocomplete:!1},null,8,["modelValue","title","inline-help"]),Object(a["createVNode"])(l,{uicontrol:"password",name:"mailPassword","model-value":e.mailPassword,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.onMailPasswordChange(t)}),onClick:t[6]||(t[6]=function(t){!e.passwordChanged&&t.target.select()}),title:e.translate("General_SmtpPassword"),"inline-help":e.passwordHelp,autocomplete:!1},null,8,["model-value","title","inline-help"]),Object(a["createVNode"])(l,{uicontrol:"text",name:"mailFromAddress",modelValue:e.mailFromAddress,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.mailFromAddress=t}),title:e.translate("General_SmtpFromAddress"),"inline-help":e.translate("General_SmtpFromEmailHelp",e.mailHost),autocomplete:!1},null,8,["modelValue","title","inline-help"]),Object(a["createVNode"])(l,{uicontrol:"text",name:"mailFromName",modelValue:e.mailFromName,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.mailFromName=t}),title:e.translate("General_SmtpFromName"),"inline-help":e.translate("General_NameShownInTheSenderColumn"),autocomplete:!1},null,8,["modelValue","title","inline-help"]),Object(a["createVNode"])(l,{uicontrol:"select",name:"mailEncryption",modelValue:e.mailEncryption,"onUpdate:modelValue":t[9]||(t[9]=function(t){return e.mailEncryption=t}),title:e.translate("General_SmtpEncryption"),options:e.mailEncryptions,"inline-help":e.translate("General_EncryptedSmtpTransport")},null,8,["modelValue","title","options","inline-help"])],512),[[a["vShow"],e.enabled]]),Object(a["createVNode"])(c,{onConfirm:t[10]||(t[10]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])],512),[[d]])]})),_:1},8,["content-title"])}var ee=Object(a["defineComponent"])({props:{mail:{type:Object,required:!0},mailTypes:{type:Object,required:!0},mailEncryptions:{type:Object,required:!0}},data:function(){var e=this.mail;return{isLoading:!1,enabled:"smtp"===e.transport,mailHost:e.host,passwordChanged:!1,mailPort:e.port,mailType:e.type,mailUsername:e.username,mailPassword:e.password?"******":"",mailFromAddress:e.noreply_email_address,mailFromName:e.noreply_email_name,mailEncryption:e.encryption}},components:{ContentBlock:y["ContentBlock"],Field:T["Field"],SaveButton:T["SaveButton"]},directives:{Form:T["Form"]},computed:{passwordHelp:function(){var e="".concat(Object(y["translate"])("General_OnlyEnterIfRequiredPassword"),"<br/>"),t="".concat(Object(y["translate"])("General_WarningPasswordStored","<strong>","</strong>"),"<br/>");return"".concat(e,"\n").concat(t)}},methods:{onUpdateMailHost:function(e){this.mailHost=e,this.passwordChanged||(this.mailPassword="",this.passwordChanged=!0)},onMailPasswordChange:function(e){this.mailPassword=e,this.passwordChanged=!0},save:function(){var e=this;this.isLoading=!0;var t={mailUseSmtp:this.enabled?"1":"0",mailPort:this.mailPort,mailHost:this.mailHost,mailType:this.mailType,mailUsername:this.mailUsername,mailFromAddress:this.mailFromAddress,mailFromName:this.mailFromName,mailEncryption:this.mailEncryption};this.passwordChanged&&(t.mailPassword=this.mailPassword),y["AjaxHelper"].post({module:"CoreAdminHome",action:"setMailSettings"},t,{withTokenInUrl:!0}).then((function(){var e=y["NotificationsStore"].show({message:Object(y["translate"])("CoreAdminHome_SettingsSaveSuccess"),type:"transient",id:"generalSettings",context:"success"});y["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.isLoading=!1}))}}});ee.render=Z;var te=ee,ne={id:"js-code-options"},oe=Object(a["createElementVNode"])("br",null,null,-1),re=Object(a["createElementVNode"])("br",null,null,-1),ae=["innerHTML"],ie=["innerHTML"],le=Object(a["createElementVNode"])("br",null,null,-1),ce=Object(a["createElementVNode"])("br",null,null,-1),se=["innerHTML"],de=Object(a["createElementVNode"])("br",null,null,-1),ue=Object(a["createElementVNode"])("br",null,null,-1),me=["innerHTML"],ge=Object(a["createElementVNode"])("br",null,null,-1),pe=Object(a["createElementVNode"])("br",null,null,-1),be=Object(a["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),he=Object(a["createTextVNode"])(" | "),je=Object(a["createElementVNode"])("a",{href:"https://matomo.org/faq/new-to-piwik/how-do-i-integrate-matomo-with-squarespace-website/",target:"_blank",rel:"noopener"},"Squarespace",-1),fe=Object(a["createTextVNode"])(" | "),ve=Object(a["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),Oe=Object(a["createTextVNode"])(" | "),Ce=Object(a["createElementVNode"])("a",{href:"https://matomo.org/faq/how-to-install/faq_19424/",target:"_blank",rel:"noopener"},"SharePoint",-1),ke=Object(a["createTextVNode"])(" | "),Ve=Object(a["createElementVNode"])("a",{href:"https://matomo.org/faq/new-to-piwik/how-do-i-install-the-matomo-analytics-tracking-code-on-joomla/",target:"_blank",rel:"noopener"},"Joomla",-1),Se=Object(a["createTextVNode"])(" | "),Ne=Object(a["createElementVNode"])("a",{href:"https://matomo.org/faq/new-to-piwik/how-do-i-install-the-matomo-tracking-code-on-my-shopify-store/",target:"_blank",rel:"noopener"},"Shopify",-1),ye=Object(a["createTextVNode"])(" | "),Te=Object(a["createElementVNode"])("a",{href:"https://matomo.org/faq/new-to-piwik/how-do-i-use-matomo-analytics-within-gtm-google-tag-manager/",target:"_blank",rel:"noopener"},"Google Tag Manager",-1),Ae={id:"javascript-output-section"},Ee={class:"valign-wrapper trackingHelpHeader matchWidth"},we={id:"javascript-text"},_e=["textContent"],He={id:"optional-js-tracking-options"},De={id:"jsTrackAllSubdomainsInlineHelp",class:"inline-help-node"},Le=["innerHTML"],xe=["innerHTML"],Be={id:"jsTrackGroupByDomainInlineHelp",class:"inline-help-node"},Ue={id:"jsTrackAllAliasesInlineHelp",class:"inline-help-node"},Fe={id:"javascript-advanced-options"},Ie={id:"javascript-tracking-visitor-cv"},Ge={class:"row"},Pe={class:"col s12 m3"},Me={class:"col s12 m3"},qe={class:"col s12 m6 l3"},Je=["onKeydown"],Re={class:"col s12 m6 l3"},We=["onKeydown"],$e={class:"row"},Ke={class:"col s12"},ze=Object(a["createElementVNode"])("span",{class:"icon-add"},null,-1),Qe={id:"jsCrossDomain",class:"inline-help-node"},Ye=Object(a["createElementVNode"])("br",null,null,-1),Xe={id:"jsDoNotTrackInlineHelp",class:"inline-help-node"},Ze={key:0},et=Object(a["createElementVNode"])("br",null,null,-1),tt=["innerHTML"],nt={id:"js-campaign-query-param-extra"},ot={class:"row"},rt={class:"col s12"},at={class:"row"},it={class:"col s12"};function lt(e,t,n,o,r,i){var l=Object(a["resolveComponent"])("Field"),c=Object(a["resolveComponent"])("ContentBlock"),s=Object(a["resolveDirective"])("select-on-focus");return Object(a["openBlock"])(),Object(a["createBlock"])(c,{anchor:"javaScriptTracking","content-title":e.translate("CoreAdminHome_JavaScriptTracking")},{default:Object(a["withCtx"])((function(){return[Object(a["createElementVNode"])("div",ne,[Object(a["createElementVNode"])("p",null,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("CoreAdminHome_JSTrackingIntro1"))+" ",1),oe,re,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("CoreAdminHome_JSTrackingIntro2"))+" ",1),Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.jsTrackingIntro3a)},null,8,ae),Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(" "+e.jsTrackingIntro3b)},null,8,ie),le,ce,Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.jsTrackingIntro4a)},null,8,se),de,ue,Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.jsTrackingIntro5)},null,8,me),ge,pe,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("SitesManager_InstallationGuides"))+" : ",1),be,he,je,fe,ve,Oe,Ce,ke,Ve,Se,Ne,ye,Te]),Object(a["createVNode"])(l,{uicontrol:"site",name:"js-tracker-website",class:"jsTrackingCodeWebsite",modelValue:e.site,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.site=t}),introduction:e.translate("General_Website")},null,8,["modelValue","introduction"]),Object(a["createElementVNode"])("div",Ae,[Object(a["createElementVNode"])("div",Ee,[Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("h3",null,Object(a["toDisplayString"])(e.translate("General_JsTrackingTag")),1),Object(a["createElementVNode"])("p",null,Object(a["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_CodeNoteBeforeClosingHead","</head>")),1)]),Object(a["createElementVNode"])("button",{class:"btn",id:"emailJsBtn",onClick:t[1]||(t[1]=function(t){return e.sendEmail()})},Object(a["toDisplayString"])(e.translate("SitesManager_EmailInstructionsButton")),1)]),Object(a["createElementVNode"])("div",we,[Object(a["withDirectives"])(Object(a["createElementVNode"])("pre",{class:"codeblock",textContent:Object(a["toDisplayString"])(e.trackingCode),ref:"trackingCode"},null,8,_e),[[s,{}]])])]),Object(a["createElementVNode"])("div",He,[Object(a["createElementVNode"])("div",De,[Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.mergeSubdomainsDesc)},null,8,Le),Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.learnMoreText)},null,8,xe)]),Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-all-subdomains","model-value":e.trackAllSubdomains,"onUpdate:modelValue":t[2]||(t[2]=function(t){e.trackAllSubdomains=t,e.updateTrackingCode()}),disabled:e.isLoading,introduction:e.translate("General_Options"),title:"".concat(e.translate("CoreAdminHome_JSTracking_MergeSubdomains")," ").concat(e.currentSiteName),"inline-help":"#jsTrackAllSubdomainsInlineHelp"},null,8,["model-value","disabled","introduction","title"])]),Object(a["createElementVNode"])("div",Be,Object(a["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_GroupPageTitlesByDomainDesc1",e.currentSiteHost)),1),Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-group-by-domain","model-value":e.groupByDomain,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.groupByDomain=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_GroupPageTitlesByDomain"),"inline-help":"#jsTrackGroupByDomainInlineHelp"},null,8,["model-value","disabled","title"]),Object(a["createElementVNode"])("div",Ue,Object(a["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_MergeAliasesDesc",e.currentSiteAlias)),1),Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-all-aliases","model-value":e.trackAllAliases,"onUpdate:modelValue":t[4]||(t[4]=function(t){e.trackAllAliases=t,e.updateTrackingCode()}),disabled:e.isLoading,title:"".concat(e.translate("CoreAdminHome_JSTracking_MergeAliases")," ").concat(e.currentSiteName),"inline-help":"#jsTrackAllAliasesInlineHelp"},null,8,["model-value","disabled","title"])]),Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-noscript","model-value":e.trackNoScript,"onUpdate:modelValue":t[5]||(t[5]=function(t){e.trackNoScript=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_TrackNoScript")},null,8,["model-value","disabled","title"]),Object(a["createElementVNode"])("h3",null,Object(a["toDisplayString"])(e.translate("Mobile_Advanced")),1),Object(a["createElementVNode"])("p",null,[Object(a["withDirectives"])(Object(a["createElementVNode"])("a",{href:"javascript:;",onClick:t[6]||(t[6]=Object(a["withModifiers"])((function(t){return e.showAdvanced=!0}),["prevent"]))},Object(a["toDisplayString"])(e.translate("General_Show")),513),[[a["vShow"],!e.showAdvanced]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("a",{href:"javascript:;",onClick:t[7]||(t[7]=Object(a["withModifiers"])((function(t){return e.showAdvanced=!1}),["prevent"]))},Object(a["toDisplayString"])(e.translate("General_Hide")),513),[[a["vShow"],e.showAdvanced]])]),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",Fe,[Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-visitor-cv-check","model-value":e.trackCustomVars,"onUpdate:modelValue":t[8]||(t[8]=function(t){e.trackCustomVars=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_VisitorCustomVars"),"inline-help":e.translate("CoreAdminHome_JSTracking_VisitorCustomVarsDesc")},null,8,["model-value","disabled","title","inline-help"]),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",Ie,[Object(a["createElementVNode"])("div",Ge,[Object(a["createElementVNode"])("div",Pe,Object(a["toDisplayString"])(e.translate("General_Name")),1),Object(a["createElementVNode"])("div",Me,Object(a["toDisplayString"])(e.translate("General_Value")),1)]),(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.customVars,(function(t,n){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{class:"row",key:n},[Object(a["createElementVNode"])("div",qe,[Object(a["createElementVNode"])("input",{type:"text",class:"custom-variable-name",onKeydown:function(t){return e.onCustomVarNameKeydown(t,n)},placeholder:"e.g. Type"},null,40,Je)]),Object(a["createElementVNode"])("div",Re,[Object(a["createElementVNode"])("input",{type:"text",class:"custom-variable-value",onKeydown:function(t){return e.onCustomVarValueKeydown(t,n)},placeholder:"e.g. Customer"},null,40,We)])])})),128)),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",$e,[Object(a["createElementVNode"])("div",Ke,[Object(a["createElementVNode"])("a",{href:"javascript:;",onClick:t[9]||(t[9]=function(t){return e.addCustomVar()}),class:"add-custom-variable"},[ze,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("General_Add")),1)])])],512),[[a["vShow"],e.canAddMoreCustomVariables]])],512),[[a["vShow"],e.trackCustomVars]]),Object(a["createElementVNode"])("div",Qe,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_CrossDomain"))+" ",1),Ye,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_CrossDomain_NeedsMultipleDomains")),1)]),Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-cross-domain","model-value":e.crossDomain,"onUpdate:modelValue":t[10]||(t[10]=function(t){e.crossDomain=t,e.updateTrackingCode(),e.onCrossDomainToggle()}),disabled:e.isLoading||!e.hasManySiteUrls,title:e.translate("CoreAdminHome_JSTracking_EnableCrossDomainLinking"),"inline-help":"#jsCrossDomain"},null,8,["model-value","disabled","title"]),Object(a["createElementVNode"])("div",Xe,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_EnableDoNotTrackDesc"))+" ",1),e.serverSideDoNotTrackEnabled?(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",Ze,[et,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_EnableDoNotTrack_AlreadyEnabled")),1)])):Object(a["createCommentVNode"])("",!0)]),Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-do-not-track","model-value":e.doNotTrack,"onUpdate:modelValue":t[11]||(t[11]=function(t){e.doNotTrack=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_EnableDoNotTrack"),"inline-help":"#jsDoNotTrackInlineHelp"},null,8,["model-value","disabled","title"]),Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-disable-cookies","model-value":e.disableCookies,"onUpdate:modelValue":t[12]||(t[12]=function(t){e.disableCookies=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_DisableCookies"),"inline-help":e.translate("CoreAdminHome_JSTracking_DisableCookiesDesc")},null,8,["model-value","disabled","title","inline-help"]),Object(a["createElementVNode"])("div",{id:"jsTrackCampaignParamsInlineHelp",class:"inline-help-node",innerHTML:e.$sanitize(e.jsTrackCampaignParamsInlineHelp)},null,8,tt),Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"custom-campaign-query-params-check","model-value":e.useCustomCampaignParams,"onUpdate:modelValue":t[13]||(t[13]=function(t){e.useCustomCampaignParams=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_CustomCampaignQueryParam"),"inline-help":"#jsTrackCampaignParamsInlineHelp"},null,8,["model-value","disabled","title"]),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",nt,[Object(a["createElementVNode"])("div",ot,[Object(a["createElementVNode"])("div",rt,[Object(a["createVNode"])(l,{uicontrol:"text",name:"custom-campaign-name-query-param","model-value":e.customCampaignName,"onUpdate:modelValue":t[14]||(t[14]=function(t){e.customCampaignName=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_CampaignNameParam")},null,8,["model-value","disabled","title"])])]),Object(a["createElementVNode"])("div",at,[Object(a["createElementVNode"])("div",it,[Object(a["createVNode"])(l,{uicontrol:"text",name:"custom-campaign-keyword-query-param","model-value":e.customCampaignKeyword,"onUpdate:modelValue":t[15]||(t[15]=function(t){e.customCampaignKeyword=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_CampaignKwdParam")},null,8,["model-value","disabled","title"])])])],512),[[a["vShow"],e.useCustomCampaignParams]])],512),[[a["vShow"],e.showAdvanced]])]})),_:1},8,["content-title"])}function ct(e){var t=new URL(e);return t.hostname}function st(e){return e.map((function(e){return[e.name,e.value]}))}var dt=window,ut=dt.$,mt=window.location.host,gt=window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/")),pt=Object(a["defineComponent"])({props:{defaultSite:{type:Object,required:!0},maxCustomVariables:Number,serverSideDoNotTrackEnabled:Boolean},data:function(){return{showAdvanced:!1,site:this.defaultSite,trackingCode:"",trackAllSubdomains:!1,isLoading:!1,siteUrls:{},siteExcludedQueryParams:{},siteExcludedReferrers:{},crossDomain:!1,groupByDomain:!1,trackAllAliases:!1,trackNoScript:!1,trackCustomVars:!1,customVars:[],canAddMoreCustomVariables:!!this.maxCustomVariables&&this.maxCustomVariables>0,doNotTrack:!1,disableCookies:!1,useCustomCampaignParams:!1,customCampaignName:"",customCampaignKeyword:"",trackingCodeAbortController:null,isHighlighting:!1}},components:{ContentBlock:y["ContentBlock"],Field:T["Field"]},directives:{SelectOnFocus:y["SelectOnFocus"]},created:function(){this.onCustomVarNameKeydown=Object(y["debounce"])(this.onCustomVarNameKeydown,100),this.onCustomVarValueKeydown=Object(y["debounce"])(this.onCustomVarValueKeydown,100),this.addCustomVar(),this.site&&this.site.id&&this.onSiteChanged(this.site)},watch:{site:function(e){this.onSiteChanged(e)}},methods:{onSiteChanged:function(e){var t=this,n=e.id,o=[];this.siteUrls[n]||(this.isLoading=!0,o.push(y["AjaxHelper"].fetch({module:"API",method:"SitesManager.getSiteUrlsFromId",idSite:n,filter_limit:"-1"}).then((function(e){t.siteUrls[n]=e||[]})))),this.siteExcludedQueryParams[n]||(this.isLoading=!0,o.push(y["AjaxHelper"].fetch({module:"API",method:"Overlay.getExcludedQueryParameters",idSite:n,filter_limit:"-1"}).then((function(e){t.siteExcludedQueryParams[n]=e||[]})))),this.siteExcludedReferrers[n]||(this.isLoading=!0,o.push(y["AjaxHelper"].fetch({module:"API",method:"SitesManager.getExcludedReferrers",idSite:n,filter_limit:"-1"}).then((function(e){t.siteExcludedReferrers[n]=[],Object.values(e||[]).forEach((function(e){t.siteExcludedReferrers[n].push(e.replace(/^https?:\/\//,""))}))})))),Promise.all(o).then((function(){t.isLoading=!1,t.updateCurrentSiteInfo(),t.updateTrackingCode()}))},sendEmail:function(){var e=Object(y["translate"])("SitesManager_EmailInstructionsSubject");e=encodeURIComponent(e);var t=this.trackingCode;t=t.replace(/<[^>]+>/g,"");var n="".concat(Object(y["translate"])("SitesManager_JsTrackingTagHelp"),". ").concat(Object(y["translate"])("CoreAdminHome_JSTracking_CodeNoteBeforeClosingHeadEmail","'head"),"\n").concat(t);n=encodeURIComponent(n);var o="mailto:?subject=".concat(e,"&body=").concat(n);window.location.href=o},onCrossDomainToggle:function(){this.crossDomain&&(this.trackAllAliases=!0)},updateTrackingCode:function(){var e=this,t=this.site,n={piwikUrl:"".concat(mt).concat(gt),groupPageTitlesByDomain:this.groupByDomain?1:0,mergeSubdomains:this.trackAllSubdomains?1:0,mergeAliasUrls:this.trackAllAliases?1:0,visitorCustomVariables:this.trackCustomVars?st(this.customVars):0,customCampaignNameQueryParam:null,customCampaignKeywordParam:null,doNotTrack:this.doNotTrack?1:0,disableCookies:this.disableCookies?1:0,crossDomain:this.crossDomain?1:0,trackNoScript:this.trackNoScript?1:0,forceMatomoEndpoint:1};this.siteExcludedQueryParams[t.id]&&(n.excludedQueryParams=this.siteExcludedQueryParams[t.id]),this.siteExcludedReferrers[t.id]&&(n.excludedReferrers=this.siteExcludedReferrers[t.id]),this.useCustomCampaignParams&&(n.customCampaignNameQueryParam=this.customCampaignName,n.customCampaignKeywordParam=this.customCampaignKeyword),this.trackingCodeAbortController&&(this.trackingCodeAbortController.abort(),this.trackingCodeAbortController=null),this.trackingCodeAbortController=new AbortController,y["AjaxHelper"].post({module:"API",format:"json",method:"SitesManager.getJavascriptTag",idSite:t.id},n,{abortController:this.trackingCodeAbortController}).then((function(t){e.trackingCodeAbortController=null,e.trackingCode=t.value;var n=ut(e.$refs.trackingCode);n&&!e.isHighlighting&&(e.isHighlighting=!0,n.effect("highlight",{complete:function(){e.isHighlighting=!1}},1500))}))},updateCurrentSiteInfo:function(){this.hasManySiteUrls||(this.crossDomain=!1)},addCustomVar:function(){this.canAddMoreCustomVariables&&this.customVars.push({name:"",value:""}),this.canAddMoreCustomVariables=!!this.maxCustomVariables&&this.maxCustomVariables>this.customVars.length},onCustomVarNameKeydown:function(e,t){var n=this;setTimeout((function(){n.customVars[t].name=e.target.value,n.updateTrackingCode()}))},onCustomVarValueKeydown:function(e,t){var n=this;setTimeout((function(){n.customVars[t].value=e.target.value,n.updateTrackingCode()}))}},computed:{hasManySiteUrls:function(){var e=this.site;return this.siteUrls[e.id]&&this.siteUrls[e.id].length>1},currentSiteHost:function(){var e,t=null===(e=this.siteUrls[this.site.id])||void 0===e?void 0:e[0];return t?ct(t):""},currentSiteAlias:function(){var e,t="x.".concat(this.currentSiteHost),n=null===(e=this.siteUrls[this.site.id])||void 0===e?void 0:e[1];return n||t},currentSiteName:function(){return y["Matomo"].helper.htmlEntities(this.site.name)},jsTrackingIntro3a:function(){return Object(y["translate"])("CoreAdminHome_JSTrackingIntro3a",'<a href="https://matomo.org/integrate/" rel="noreferrer noopener" target="_blank">',"</a>")},jsTrackingIntro3b:function(){return Object(y["translate"])("CoreAdminHome_JSTrackingIntro3b")},jsTrackingIntro4a:function(){return Object(y["translate"])("CoreAdminHome_JSTrackingIntro4",'<a href="#image-tracking-link">',"</a>")},jsTrackingIntro5:function(){return Object(y["translate"])("CoreAdminHome_JSTrackingIntro5",'<a rel="noreferrer noopener" target="_blank" href="https://developer.matomo.org/guides/tracking-javascript-guide">',"</a>")},mergeSubdomainsDesc:function(){return Object(y["translate"])("CoreAdminHome_JSTracking_MergeSubdomainsDesc","x.".concat(this.currentSiteHost),"y.".concat(this.currentSiteHost))},learnMoreText:function(){var e="https://developer.matomo.org/guides/tracking-javascript-guide#measuring-domains-andor-sub-domains";return Object(y["translate"])("General_LearnMore",' (<a href="'.concat(e,'" rel="noreferrer noopener" target="_blank">'),"</a>)")},jsTrackCampaignParamsInlineHelp:function(){return Object(y["translate"])("CoreAdminHome_JSTracking_CustomCampaignQueryParamDesc",'<a href="https://matomo.org/faq/general/faq_119" rel="noreferrer noopener" target="_blank">',"</a>")}}});pt.render=lt;var bt=pt,ht=Object(a["createElementVNode"])("a",{name:"image-tracking-link"},null,-1),jt={id:"image-tracking-code-options"},ft=["innerHTML"],vt=["innerHTML"],Ot={id:"image-tracking-goal-sub"},Ct={class:"row"},kt={class:"col s12 m6"},Vt={class:"col s12 m6"},St={id:"image-link-output-section"},Nt={id:"image-tracking-text"},yt=["textContent"];function Tt(e,t,n,o,r,i){var l=Object(a["resolveComponent"])("Field"),c=Object(a["resolveComponent"])("ContentBlock"),s=Object(a["resolveDirective"])("select-on-focus");return Object(a["openBlock"])(),Object(a["createBlock"])(c,{"content-title":e.translate("CoreAdminHome_ImageTracking"),anchor:"imageTracking"},{default:Object(a["withCtx"])((function(){return[ht,Object(a["createElementVNode"])("div",jt,[Object(a["createElementVNode"])("p",{innerHTML:e.$sanitize(e.imageTrackingIntro)},null,8,ft),Object(a["createElementVNode"])("p",{innerHTML:e.$sanitize(e.imageTrackingIntro3)},null,8,vt),Object(a["createVNode"])(l,{uicontrol:"site",name:"image-tracker-website",modelValue:e.site,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.site=t}),introduction:e.translate("General_Website")},null,8,["modelValue","introduction"]),Object(a["createVNode"])(l,{uicontrol:"text",name:"image-tracker-action-name","model-value":e.pageName,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.pageName=t,e.updateTrackingCode()}),disabled:e.isLoading,introduction:e.translate("General_Options"),title:e.translate("Actions_ColumnPageName")},null,8,["model-value","disabled","introduction","title"]),Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"image-tracking-goal-check","model-value":e.trackGoal,"onUpdate:modelValue":t[2]||(t[2]=function(t){e.trackGoal=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_TrackAGoal")},null,8,["model-value","disabled","title"]),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",Ot,[Object(a["createElementVNode"])("div",Ct,[Object(a["createElementVNode"])("div",kt,[Object(a["createVNode"])(l,{uicontrol:"select",name:"image-tracker-goal",options:e.siteGoals,disabled:e.isLoading,"model-value":e.trackIdGoal,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.trackIdGoal=t,e.updateTrackingCode()})},null,8,["options","disabled","model-value"])]),Object(a["createElementVNode"])("div",Vt,[Object(a["createVNode"])(l,{uicontrol:"text",name:"image-revenue","model-value":e.revenue,"onUpdate:modelValue":t[4]||(t[4]=function(t){e.revenue=t,e.updateTrackingCode()}),disabled:e.isLoading,"full-width":!0,title:"".concat(e.translate("CoreAdminHome_WithOptionalRevenue")," ").concat(e.currentSiteCurrency)},null,8,["model-value","disabled","title"])])])],512),[[a["vShow"],e.trackGoal]]),Object(a["createElementVNode"])("div",St,[Object(a["createElementVNode"])("h3",null,Object(a["toDisplayString"])(e.translate("CoreAdminHome_ImageTrackingLink")),1),Object(a["createElementVNode"])("div",Nt,[Object(a["withDirectives"])(Object(a["createElementVNode"])("pre",{textContent:Object(a["toDisplayString"])(e.trackingCode),ref:"trackingCode"},null,8,yt),[[s,{}]])])])])]})),_:1},8,["content-title"])}function At(e,t){return Dt(e)||Ht(e,t)||wt(e,t)||Et()}function Et(){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 _t(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)?_t(e,t):void 0}}function _t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Ht(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(o=n.next()).done);i=!0)if(a.push(o.value),t&&a.length===t)break}catch(c){l=!0,r=c}finally{try{i||null==n["return"]||n["return"]()}finally{if(l)throw r}}return a}}function Dt(e){if(Array.isArray(e))return e}var Lt=null,xt=window,Bt=xt.$,Ut=window.location.host,Ft=window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/")),It=Object(a["defineComponent"])({props:{defaultSite:{type:Object,required:!0}},components:{ContentBlock:y["ContentBlock"],Field:T["Field"]},directives:{SelectOnFocus:y["SelectOnFocus"]},data:function(){return{isLoading:!1,site:this.defaultSite,pageName:"",trackGoal:!1,trackIdGoal:null,revenue:"",trackingCode:"",sites:{},goals:{},trackingCodeAbortController:null,isHighlighting:!1}},created:function(){this.updateTrackingCode=Object(y["debounce"])(this.updateTrackingCode),this.site&&this.site.id&&this.onSiteChanged(this.site)},watch:{site:function(e){this.onSiteChanged(e)}},methods:{onSiteChanged:function(e){var t,n,o,r=this;return this.trackIdGoal=null,Lt?t=Promise.resolve(Lt):(this.isLoading=!0,t=y["AjaxHelper"].fetch({method:"SitesManager.getCurrencySymbols",filter_limit:"-1"})),this.sites[e.id]?n=Promise.resolve(this.sites[e.id]):(this.isLoading=!0,n=y["AjaxHelper"].fetch({module:"API",method:"SitesManager.getSiteFromId",idSite:e.id})),this.goals[e.id]?o=Promise.resolve(this.goals[e.id]):(this.isLoading=!0,o=y["AjaxHelper"].fetch({module:"API",method:"Goals.getGoals",filter_limit:"-1",idSite:e.id})),Promise.all([t,n,o]).then((function(t){var n=At(t,3),o=n[0],a=n[1],i=n[2];r.isLoading=!1,Lt=o,r.sites[e.id]=a,r.goals[e.id]=i,r.updateTrackingCode()}))},updateTrackingCode:function(){var e=this,t={piwikUrl:"".concat(Ut).concat(Ft),actionName:this.pageName,forceMatomoEndpoint:1};this.trackGoal&&this.trackIdGoal&&(t.idGoal=this.trackIdGoal,t.revenue=this.revenue),this.trackingCodeAbortController&&(this.trackingCodeAbortController.abort(),this.trackingCodeAbortController=null),this.trackingCodeAbortController=new AbortController,y["AjaxHelper"].post({module:"API",format:"json",method:"SitesManager.getImageTrackingCode",idSite:this.site.id},t,{abortController:this.trackingCodeAbortController}).then((function(t){e.trackingCodeAbortController=null,e.trackingCode=t.value;var n=Bt(e.$refs.trackingCode);n&&!e.isHighlighting&&(e.isHighlighting=!0,n.effect("highlight",{complete:function(){e.isHighlighting=!1}},1500))}))}},computed:{currentSiteCurrency:function(){return Lt?Lt[(this.sites[this.site.id].currency||"").toUpperCase()]:""},siteGoals:function(){var e=this.goals[this.site.id];return[{key:"",value:Object(y["translate"])("UserCountryMap_None")}].concat(Object.values(e||[]).map((function(e){return{key:"".concat(e.idgoal),value:e.name}})))},imageTrackingIntro:function(){var e=Object(y["translate"])("CoreAdminHome_ImageTrackingIntro1"),t=Object(y["translate"])("CoreAdminHome_ImageTrackingIntro2","<code><noscript></noscript></code>");return"".concat(e," ").concat(t)},imageTrackingIntro3:function(){var e="https://matomo.org/docs/tracking-api/reference/";return Object(y["translate"])("CoreAdminHome_ImageTrackingIntro3",'<a href="'.concat(e,'" rel="noreferrer noopener" target="_blank">'),"</a>")}}});It.render=Tt;var Gt=It,Pt=Object(a["createElementVNode"])("br",null,null,-1),Mt=Object(a["createElementVNode"])("br",null,null,-1),qt=["value"],Jt={class:"action"},Rt={colspan:"7"},Wt=Object(a["createElementVNode"])("span",{class:"icon-ok"},null,-1),$t={class:"ui-confirm",id:"confirmDeleteAllTrackingFailures"},Kt=["value"],zt=["value"],Qt={class:"ui-confirm",id:"confirmDeleteThisTrackingFailure"},Yt=["value"],Xt=["value"];function Zt(e,t,n,o,r,i){var l=Object(a["resolveComponent"])("ActivityIndicator"),c=Object(a["resolveComponent"])("FailureRow"),s=Object(a["resolveComponent"])("ContentBlock"),d=Object(a["resolveDirective"])("content-table");return Object(a["openBlock"])(),Object(a["createBlock"])(s,{class:"matomoTrackingFailures","content-title":e.translate("CoreAdminHome_TrackingFailures")},{default:Object(a["withCtx"])((function(){return[Object(a["createElementVNode"])("p",null,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("CoreAdminHome_TrackingFailuresIntroduction","2"))+" ",1),Pt,Mt,Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{class:"btn deleteAllFailures",type:"button",onClick:t[0]||(t[0]=function(t){return e.deleteAll()}),value:e.translate("CoreAdminHome_DeleteAllFailures")},null,8,qt),[[a["vShow"],!e.isLoading&&e.failures.length>0]])]),Object(a["createVNode"])(l,{loading:e.isLoading},null,8,["loading"]),Object(a["withDirectives"])(Object(a["createElementVNode"])("table",null,[Object(a["createElementVNode"])("thead",null,[Object(a["createElementVNode"])("tr",null,[Object(a["createElementVNode"])("th",{onClick:t[1]||(t[1]=function(t){return e.changeSortOrder("idsite")})},Object(a["toDisplayString"])(e.translate("General_Measurable")),1),Object(a["createElementVNode"])("th",{onClick:t[2]||(t[2]=function(t){return e.changeSortOrder("problem")})},Object(a["toDisplayString"])(e.translate("CoreAdminHome_Problem")),1),Object(a["createElementVNode"])("th",{onClick:t[3]||(t[3]=function(t){return e.changeSortOrder("solution")})},Object(a["toDisplayString"])(e.translate("CoreAdminHome_Solution")),1),Object(a["createElementVNode"])("th",{onClick:t[4]||(t[4]=function(t){return e.changeSortOrder("date_first_occurred")})},Object(a["toDisplayString"])(e.translate("General_Date")),1),Object(a["createElementVNode"])("th",{onClick:t[5]||(t[5]=function(t){return e.changeSortOrder("url")})},Object(a["toDisplayString"])(e.translate("Actions_ColumnPageURL")),1),Object(a["createElementVNode"])("th",{onClick:t[6]||(t[6]=function(t){return e.changeSortOrder("request_url")})},Object(a["toDisplayString"])(e.translate("CoreAdminHome_TrackingURL")),1),Object(a["createElementVNode"])("th",Jt,Object(a["toDisplayString"])(e.translate("General_Action")),1)])]),Object(a["createElementVNode"])("tbody",null,[Object(a["createElementVNode"])("tr",null,[Object(a["withDirectives"])(Object(a["createElementVNode"])("td",Rt,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("CoreAdminHome_NoKnownFailures"))+" ",1),Wt],512),[[a["vShow"],!e.isLoading&&0===e.failures.length]])]),(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.sortedFailures,(function(n,o){return Object(a["openBlock"])(),Object(a["createElementBlock"])("tr",{key:o},[Object(a["createVNode"])(c,{failure:n,onDelete:t[7]||(t[7]=function(t){return e.deleteFailure(t.idSite,t.idFailure)})},null,8,["failure"])])})),128))])],512),[[d]]),Object(a["createElementVNode"])("div",$t,[Object(a["createElementVNode"])("h2",null,Object(a["toDisplayString"])(e.translate("CoreAdminHome_ConfirmDeleteAllTrackingFailures")),1),Object(a["createElementVNode"])("input",{type:"button",role:"yes",value:e.translate("General_Yes")},null,8,Kt),Object(a["createElementVNode"])("input",{type:"button",role:"no",value:e.translate("General_No")},null,8,zt)]),Object(a["createElementVNode"])("div",Qt,[Object(a["createElementVNode"])("h2",null,Object(a["toDisplayString"])(e.translate("CoreAdminHome_ConfirmDeleteThisTrackingFailure")),1),Object(a["createElementVNode"])("input",{type:"button",role:"yes",value:e.translate("General_Yes")},null,8,Yt),Object(a["createElementVNode"])("input",{type:"button",role:"no",value:e.translate("General_No")},null,8,Xt)])]})),_:1},8,["content-title"])}var en=["href"],tn={class:"datetime"},nn=["title"],on=["title"];function rn(e,t,n,o,r,i){return Object(a["openBlock"])(),Object(a["createElementBlock"])(a["Fragment"],null,[Object(a["createElementVNode"])("td",null,Object(a["toDisplayString"])(e.failure.site_name)+" ("+Object(a["toDisplayString"])(e.translate("General_Id"))+" "+Object(a["toDisplayString"])(e.failure.idsite)+")",1),Object(a["createElementVNode"])("td",null,Object(a["toDisplayString"])(e.failure.problem),1),Object(a["createElementVNode"])("td",null,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.failure.solution)+" ",1),Object(a["withDirectives"])(Object(a["createElementVNode"])("a",{rel:"noopener noreferrer",href:e.failure.solution_url},Object(a["toDisplayString"])(e.translate("CoreAdminHome_LearnMore")),9,en),[[a["vShow"],e.failure.solution_url]])]),Object(a["createElementVNode"])("td",tn,Object(a["toDisplayString"])(e.failure.pretty_date_first_occurred),1),Object(a["createElementVNode"])("td",null,Object(a["toDisplayString"])(e.failure.url),1),Object(a["createElementVNode"])("td",null,[Object(a["withDirectives"])(Object(a["createElementVNode"])("span",{onClick:t[0]||(t[0]=function(t){return e.showFullRequestUrl=!0}),title:e.translate("CoreHome_ClickToSeeFullInformation")},Object(a["toDisplayString"])(e.limtedRequestUrl)+"...",9,nn),[[a["vShow"],!e.showFullRequestUrl]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(e.failure.request_url),513),[[a["vShow"],e.failure.showFullRequestUrl]])]),Object(a["createElementVNode"])("td",null,[Object(a["createElementVNode"])("span",{class:"table-action icon-delete",onClick:t[1]||(t[1]=function(t){return e.deleteFailure(e.failure.idsite,e.failure.idfailure)}),title:e.translate("General_Delete")},null,8,on)])],64)}var an=Object(a["defineComponent"])({props:{failure:{type:Object,required:!0}},emits:["delete"],data:function(){return{showFullRequestUrl:!1}},computed:{limtedRequestUrl:function(){return this.failure.request_url.substring(0,100)}},methods:{deleteFailure:function(e,t){this.$emit("delete",{idSite:e,idFailure:t})}}});an.render=rn;var ln=an;function cn(e){return mn(e)||un(e)||dn(e)||sn()}function sn(){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 dn(e,t){if(e){if("string"===typeof e)return gn(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)?gn(e,t):void 0}}function un(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function mn(e){if(Array.isArray(e))return gn(e)}function gn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var pn=Object(a["defineComponent"])({components:{ContentBlock:y["ContentBlock"],ActivityIndicator:y["ActivityIndicator"],FailureRow:ln},directives:{ContentTable:y["ContentTable"]},data:function(){return{failures:[],sortColumn:"idsite",sortReverse:!1,isLoading:!1}},created:function(){this.fetchAll()},methods:{changeSortOrder:function(e){this.sortColumn===e?this.sortReverse=!this.sortReverse:this.sortColumn=e},fetchAll:function(){var e=this;this.failures=[],this.isLoading=!0,y["AjaxHelper"].fetch({method:"CoreAdminHome.getTrackingFailures",filter_limit:"-1"}).then((function(t){e.failures=t,e.isLoading=!1})).finally((function(){e.isLoading=!1}))},deleteAll:function(){var e=this;y["Matomo"].helper.modalConfirm("#confirmDeleteAllTrackingFailures",{yes:function(){e.failures=[],y["AjaxHelper"].fetch({method:"CoreAdminHome.deleteAllTrackingFailures"}).then((function(){e.fetchAll()}))}})},deleteFailure:function(e,t){var n=this;y["Matomo"].helper.modalConfirm("#confirmDeleteThisTrackingFailure",{yes:function(){n.failures=[],y["AjaxHelper"].fetch({method:"CoreAdminHome.deleteTrackingFailure",idSite:e,idFailure:t}).then((function(){n.fetchAll()}))}})}},computed:{sortedFailures:function(){var e=this.sortColumn,t=cn(this.failures);return this.sortReverse?t.sort((function(t,n){return t[e]>n[e]?-1:t[e]<n[e]?1:0})):t.sort((function(t,n){return t[e]<n[e]?-1:t[e]>n[e]?1:0})),t}}});pn.render=Zt;var bn=pn; +(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 r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.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 r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));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 Y})),n.d(t,"SmtpSettings",(function(){return te})),n.d(t,"JsTrackingCodeGenerator",(function(){return bt})),n.d(t,"ImageTrackingCodeGenerator",(function(){return Gt})),n.d(t,"TrackingFailures",(function(){return bn})),"undefined"!==typeof window){var o=window.document.currentScript,r=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(n.p=r[1])}var a=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"],f={class:"form-description"},v={class:"col s12 m6"},O={key:0,class:"form-help"},C={key:0},k=Object(a["createElementVNode"])("br",null,null,-1),V=Object(a["createElementVNode"])("br",null,null,-1),S=Object(a["createElementVNode"])("br",null,null,-1);function N(e,t,n,o,r,N){var y=Object(a["resolveComponent"])("SaveButton"),T=Object(a["resolveComponent"])("ContentBlock");return Object(a["openBlock"])(),Object(a["createBlock"])(T,{"content-title":e.translate("CoreAdminHome_ArchivingSettings"),anchor:"archivingSettings",class:"matomo-archiving-settings"},{default:Object(a["withCtx"])((function(){return[Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("div",i,[Object(a["createElementVNode"])("h3",l,Object(a["toDisplayString"])(e.translate("General_AllowPiwikArchivingToTriggerBrowser")),1),Object(a["createElementVNode"])("div",c,[Object(a["createElementVNode"])("p",null,[Object(a["createElementVNode"])("label",null,[Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{type:"radio",id:"enableBrowserTriggerArchiving1",name:"enableBrowserTriggerArchiving",value:"1","onUpdate:modelValue":t[0]||(t[0]=function(t){return e.enableBrowserTriggerArchivingValue=t})},null,512),[[a["vModelRadio"],e.enableBrowserTriggerArchivingValue]]),Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(e.translate("General_Yes")),1),Object(a["createElementVNode"])("span",s,Object(a["toDisplayString"])(e.translate("General_Default")),1)])]),Object(a["createElementVNode"])("p",null,[Object(a["createElementVNode"])("label",d,[Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{type:"radio",id:"enableBrowserTriggerArchiving2",name:"enableBrowserTriggerArchiving",value:"0","onUpdate:modelValue":t[1]||(t[1]=function(t){return e.enableBrowserTriggerArchivingValue=t})},null,512),[[a["vModelRadio"],e.enableBrowserTriggerArchivingValue]]),Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(e.translate("General_No")),1),Object(a["createElementVNode"])("span",{class:"form-description",innerHTML:e.$sanitize(e.archivingTriggerDesc),style:{"margin-left":"4px"}},null,8,u)])])]),Object(a["createElementVNode"])("div",m,[Object(a["createElementVNode"])("div",{class:"form-help",innerHTML:e.$sanitize(e.archivingInlineHelp)},null,8,g)])]),Object(a["createElementVNode"])("div",p,[Object(a["createElementVNode"])("h3",b,Object(a["toDisplayString"])(e.translate("General_ReportsContainingTodayWillBeProcessedAtMostEvery")),1),Object(a["createElementVNode"])("div",h,[Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{type:"text","onUpdate:modelValue":t[2]||(t[2]=function(t){return e.todayArchiveTimeToLiveValue=t}),id:"todayArchiveTimeToLive",disabled:!e.isGeneralSettingsAdminEnabled},null,8,j),[[a["vModelText"],e.todayArchiveTimeToLiveValue]]),Object(a["createElementVNode"])("span",f,Object(a["toDisplayString"])(e.translate("General_RearchiveTimeIntervalOnlyForTodayReports")),1)]),Object(a["createElementVNode"])("div",v,[e.isGeneralSettingsAdminEnabled?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",O,[e.showWarningCron?(Object(a["openBlock"])(),Object(a["createElementBlock"])("strong",C,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("General_NewReportsWillBeProcessedByCron")),1),k,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("General_ReportsWillBeProcessedAtMostEveryHour"))+" "+Object(a["toDisplayString"])(e.translate("General_IfArchivingIsFastYouCanSetupCronRunMoreOften")),1),V])):Object(a["createCommentVNode"])("",!0),Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("General_SmallTrafficYouCanLeaveDefault",e.todayArchiveTimeToLiveDefault))+" ",1),S,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("General_MediumToHighTrafficItIsRecommendedTo",1800,3600)),1)])):Object(a["createCommentVNode"])("",!0)])]),Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(y,{saving:e.isLoading,onConfirm:t[3]||(t[3]=function(t){return e.save()})},null,8,["saving"])])])]})),_:1},8,["content-title"])}var y=n("19dc"),T=n("a5a2"),A=Object(a["defineComponent"])({props:{enableBrowserTriggerArchiving:Boolean,showSegmentArchiveTriggerInfo:Boolean,isGeneralSettingsAdminEnabled:Boolean,showWarningCron:Boolean,todayArchiveTimeToLive:Number,todayArchiveTimeToLiveDefault:Number},components:{ContentBlock:y["ContentBlock"],SaveButton:T["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(y["translate"])("General_ArchivingTriggerDescription",'<a target="_blank" rel="noreferrer noopener" href="https://matomo.org/docs/setup-auto-archiving/">',"</a>"),this.showSegmentArchiveTriggerInfo&&(e+=Object(y["translate"])("General_ArchivingTriggerSegment")),e},archivingInlineHelp:function(){var e=Object(y["translate"])("General_ArchivingInlineHelp");return e+="<br/>",e+=Object(y["translate"])("General_SeeTheOfficialDocumentationForMoreInformation",'<a target="_blank" rel="noreferrer noopener" href="https://matomo.org/docs/setup-auto-archiving/">',"</a>"),e}},methods:{save:function(){var e=this;this.isLoading=!0,y["AjaxHelper"].post({module:"API",method:"CoreAdminHome.setArchiveSettings"},{enableBrowserTriggerArchiving:this.enableBrowserTriggerArchivingValue,todayArchiveTimeToLive:this.todayArchiveTimeToLiveValue}).then((function(){e.isLoading=!1;var t=y["NotificationsStore"].show({message:Object(y["translate"])("CoreAdminHome_SettingsSaveSuccess"),type:"transient",id:"generalSettings",context:"success"});y["NotificationsStore"].scrollToNotification(t)})).finally((function(){e.isLoading=!1}))}}});A.render=N;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"],L=Object(a["createElementVNode"])("input",{type:"hidden",name:"force_api_session",value:"1"},null,-1),x={key:0},B={key:0,class:"alert alert-warning uploaderror"},U={class:"row"},F={class:"col s12"},I=["src"],G={class:"row"},P={class:"col s12"},M=["src"],q={key:1},J=["innerHTML"],R={key:1},W={class:"alert alert-warning"};function $(e,t,n,o,r,i){var l=Object(a["resolveComponent"])("Field"),c=Object(a["resolveComponent"])("SaveButton"),s=Object(a["resolveComponent"])("ContentBlock"),d=Object(a["resolveDirective"])("form");return Object(a["openBlock"])(),Object(a["createBlock"])(s,{"content-title":e.translate("CoreAdminHome_BrandingSettings"),anchor:"brandingSettings"},{default:Object(a["withCtx"])((function(){return[Object(a["withDirectives"])(Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("p",null,Object(a["toDisplayString"])(e.translate("CoreAdminHome_CustomLogoHelpText")),1),Object(a["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(a["withDirectives"])(Object(a["createElementVNode"])("div",w,[Object(a["createElementVNode"])("form",_,[e.fileUploadEnabled?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",H,[Object(a["createElementVNode"])("input",{type:"hidden",name:"token_auth",value:e.tokenAuth},null,8,D),L,e.logosWriteable?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",x,[Object(a["createVNode"])(a["Transition"],{name:"fade-out"},{default:Object(a["withCtx"])((function(){return[e.showUploadError?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",B,Object(a["toDisplayString"])(e.translate("CoreAdminHome_LogoUploadFailed")),1)):Object(a["createCommentVNode"])("",!0)]})),_:1}),Object(a["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(a["createElementVNode"])("div",U,[Object(a["createElementVNode"])("div",F,[Object(a["createElementVNode"])("img",{src:e.pathUserLogoWithBuster,id:"currentLogo",style:{"max-height":"150px"},ref:"currentLogo"},null,8,I)])]),Object(a["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(a["createElementVNode"])("div",G,[Object(a["createElementVNode"])("div",P,[Object(a["createElementVNode"])("img",{src:e.pathUserFaviconWithBuster,id:"currentFavicon",width:"16",height:"16",ref:"currentFavicon"},null,8,M)])])])):Object(a["createCommentVNode"])("",!0),e.logosWriteable?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",q,[Object(a["createElementVNode"])("div",{class:"alert alert-warning",innerHTML:e.$sanitize(e.logosNotWriteableWarning)},null,8,J)]))])):Object(a["createCommentVNode"])("",!0),e.fileUploadEnabled?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",R,[Object(a["createElementVNode"])("div",W,Object(a["toDisplayString"])(e.translate("CoreAdminHome_FileUploadDisabled","file_uploads=1")),1)]))],512)],512),[[a["vShow"],e.enabled]]),Object(a["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 K=window,z=K.$,Q=Object(a["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:T["Field"],ContentBlock:y["ContentBlock"],SaveButton:T["SaveButton"]},directives:{Form:T["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 y["Matomo"].token_auth},logosNotWriteableWarning:function(){return Object(y["translate"])("CoreAdminHome_LogoNotWriteableInstruction","<code>".concat(this.pathUserLogoDirectory,"</code><br/>"),"".concat(this.pathUserLogo,", ").concat(this.pathUserLogoSmall,", ").concat(this.pathUserLogoSvg))},help:function(){if(this.isPluginsAdminEnabled){var e='"'.concat(Object(y["translate"])("General_GiveUsYourFeedback"),'"'),t='<a href="?module=CorePluginsAdmin&action=plugins" rel="noreferrer noopener" target="_blank">';return Object(y["translate"])("CoreAdminHome_CustomLogoFeedbackInfo",e,t,"</a>")}},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,y["AjaxHelper"].post({module:"API",method:"CoreAdminHome.setBrandingSettings"},{useCustomLogo:this.enabled?"1":"0"}).then((function(){var e=y["NotificationsStore"].show({message:Object(y["translate"])("CoreAdminHome_SettingsSaveSuccess"),type:"transient",id:"generalSettings",context:"success"});y["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()),r=z('<iframe name="'.concat(o,'" />'));r.css("display","none"),r.on("load",(function(){setTimeout((function(){var o=(z(r.contents()).find("body").html()||"").trim();"0"===o?e.showUploadError=!0:(t&&(e.currentLogoSrcExists=!0,e.currentLogoCacheBuster=(new Date).getTime()),n&&(e.currentFaviconSrcExists=!0,e.currentFaviconCacheBuster=(new Date).getTime())),"1"!==o&&"0"!==o||r.remove()}),1e3)})),z("body:first").append(r);var a=z(this.$refs.logoUploadForm);a.attr("target",o),a.submit(),this.customLogo="",this.customFavicon=""}}}});Q.render=$;var Y=Q,X={id:"smtpSettings"};function Z(e,t,n,o,r,i){var l=Object(a["resolveComponent"])("Field"),c=Object(a["resolveComponent"])("SaveButton"),s=Object(a["resolveComponent"])("ContentBlock"),d=Object(a["resolveDirective"])("form");return Object(a["openBlock"])(),Object(a["createBlock"])(s,{"content-title":e.translate("CoreAdminHome_EmailServerSettings"),anchor:"mailSettings"},{default:Object(a["withCtx"])((function(){return[Object(a["withDirectives"])(Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"mailUseSmtp",modelValue:e.enabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.enabled=t}),title:e.translate("General_UseSMTPServerForEmail"),"inline-help":e.translate("General_SelectYesIfYouWantToSendEmailsViaServer")},null,8,["modelValue","title","inline-help"]),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",X,[Object(a["createVNode"])(l,{uicontrol:"text",name:"mailHost","model-value":e.mailHost,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.onUpdateMailHost(t)}),title:e.translate("General_SmtpServerAddress")},null,8,["model-value","title"]),Object(a["createVNode"])(l,{uicontrol:"text",name:"mailPort",modelValue:e.mailPort,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.mailPort=t}),title:e.translate("General_SmtpPort"),"inline-help":e.translate("General_OptionalSmtpPort")},null,8,["modelValue","title","inline-help"]),Object(a["createVNode"])(l,{uicontrol:"select",name:"mailType",modelValue:e.mailType,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.mailType=t}),title:e.translate("General_AuthenticationMethodSmtp"),options:e.mailTypes,"inline-help":e.translate("General_OnlyUsedIfUserPwdIsSet")},null,8,["modelValue","title","options","inline-help"]),Object(a["createVNode"])(l,{uicontrol:"text",name:"mailUsername",modelValue:e.mailUsername,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.mailUsername=t}),title:e.translate("General_SmtpUsername"),"inline-help":e.translate("General_OnlyEnterIfRequired"),autocomplete:"off"},null,8,["modelValue","title","inline-help"]),Object(a["createVNode"])(l,{uicontrol:"password",name:"mailPassword","model-value":e.mailPassword,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.onMailPasswordChange(t)}),onClick:t[6]||(t[6]=function(t){!e.passwordChanged&&t.target.select()}),title:e.translate("General_SmtpPassword"),"inline-help":e.passwordHelp,autocomplete:"off"},null,8,["model-value","title","inline-help"]),Object(a["createVNode"])(l,{uicontrol:"text",name:"mailFromAddress",modelValue:e.mailFromAddress,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.mailFromAddress=t}),title:e.translate("General_SmtpFromAddress"),"inline-help":e.translate("General_SmtpFromEmailHelp",e.mailHost),autocomplete:"off"},null,8,["modelValue","title","inline-help"]),Object(a["createVNode"])(l,{uicontrol:"text",name:"mailFromName",modelValue:e.mailFromName,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.mailFromName=t}),title:e.translate("General_SmtpFromName"),"inline-help":e.translate("General_NameShownInTheSenderColumn"),autocomplete:"off"},null,8,["modelValue","title","inline-help"]),Object(a["createVNode"])(l,{uicontrol:"select",name:"mailEncryption",modelValue:e.mailEncryption,"onUpdate:modelValue":t[9]||(t[9]=function(t){return e.mailEncryption=t}),title:e.translate("General_SmtpEncryption"),options:e.mailEncryptions,"inline-help":e.translate("General_EncryptedSmtpTransport")},null,8,["modelValue","title","options","inline-help"])],512),[[a["vShow"],e.enabled]]),Object(a["createVNode"])(c,{onConfirm:t[10]||(t[10]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])],512),[[d]])]})),_:1},8,["content-title"])}var ee=Object(a["defineComponent"])({props:{mail:{type:Object,required:!0},mailTypes:{type:Object,required:!0},mailEncryptions:{type:Object,required:!0}},data:function(){var e=this.mail;return{isLoading:!1,enabled:"smtp"===e.transport,mailHost:e.host,passwordChanged:!1,mailPort:e.port,mailType:e.type,mailUsername:e.username,mailPassword:e.password?"******":"",mailFromAddress:e.noreply_email_address,mailFromName:e.noreply_email_name,mailEncryption:e.encryption}},components:{ContentBlock:y["ContentBlock"],Field:T["Field"],SaveButton:T["SaveButton"]},directives:{Form:T["Form"]},computed:{passwordHelp:function(){var e="".concat(Object(y["translate"])("General_OnlyEnterIfRequiredPassword"),"<br/>"),t="".concat(Object(y["translate"])("General_WarningPasswordStored","<strong>","</strong>"),"<br/>");return"".concat(e,"\n").concat(t)}},methods:{onUpdateMailHost:function(e){this.mailHost=e,this.passwordChanged||(this.mailPassword="",this.passwordChanged=!0)},onMailPasswordChange:function(e){this.mailPassword=e,this.passwordChanged=!0},save:function(){var e=this;this.isLoading=!0;var t={mailUseSmtp:this.enabled?"1":"0",mailPort:this.mailPort,mailHost:this.mailHost,mailType:this.mailType,mailUsername:this.mailUsername,mailFromAddress:this.mailFromAddress,mailFromName:this.mailFromName,mailEncryption:this.mailEncryption};this.passwordChanged&&(t.mailPassword=this.mailPassword),y["AjaxHelper"].post({module:"CoreAdminHome",action:"setMailSettings"},t,{withTokenInUrl:!0}).then((function(){var e=y["NotificationsStore"].show({message:Object(y["translate"])("CoreAdminHome_SettingsSaveSuccess"),type:"transient",id:"generalSettings",context:"success"});y["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.isLoading=!1}))}}});ee.render=Z;var te=ee,ne={id:"js-code-options"},oe=Object(a["createElementVNode"])("br",null,null,-1),re=Object(a["createElementVNode"])("br",null,null,-1),ae=["innerHTML"],ie=["innerHTML"],le=Object(a["createElementVNode"])("br",null,null,-1),ce=Object(a["createElementVNode"])("br",null,null,-1),se=["innerHTML"],de=Object(a["createElementVNode"])("br",null,null,-1),ue=Object(a["createElementVNode"])("br",null,null,-1),me=["innerHTML"],ge=Object(a["createElementVNode"])("br",null,null,-1),pe=Object(a["createElementVNode"])("br",null,null,-1),be=Object(a["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),he=Object(a["createTextVNode"])(" | "),je=Object(a["createElementVNode"])("a",{href:"https://matomo.org/faq/new-to-piwik/how-do-i-integrate-matomo-with-squarespace-website/",target:"_blank",rel:"noopener"},"Squarespace",-1),fe=Object(a["createTextVNode"])(" | "),ve=Object(a["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),Oe=Object(a["createTextVNode"])(" | "),Ce=Object(a["createElementVNode"])("a",{href:"https://matomo.org/faq/how-to-install/faq_19424/",target:"_blank",rel:"noopener"},"SharePoint",-1),ke=Object(a["createTextVNode"])(" | "),Ve=Object(a["createElementVNode"])("a",{href:"https://matomo.org/faq/new-to-piwik/how-do-i-install-the-matomo-analytics-tracking-code-on-joomla/",target:"_blank",rel:"noopener"},"Joomla",-1),Se=Object(a["createTextVNode"])(" | "),Ne=Object(a["createElementVNode"])("a",{href:"https://matomo.org/faq/new-to-piwik/how-do-i-install-the-matomo-tracking-code-on-my-shopify-store/",target:"_blank",rel:"noopener"},"Shopify",-1),ye=Object(a["createTextVNode"])(" | "),Te=Object(a["createElementVNode"])("a",{href:"https://matomo.org/faq/new-to-piwik/how-do-i-use-matomo-analytics-within-gtm-google-tag-manager/",target:"_blank",rel:"noopener"},"Google Tag Manager",-1),Ae={id:"javascript-output-section"},Ee={class:"valign-wrapper trackingHelpHeader matchWidth"},we={id:"javascript-text"},_e=["textContent"],He={id:"optional-js-tracking-options"},De={id:"jsTrackAllSubdomainsInlineHelp",class:"inline-help-node"},Le=["innerHTML"],xe=["innerHTML"],Be={id:"jsTrackGroupByDomainInlineHelp",class:"inline-help-node"},Ue={id:"jsTrackAllAliasesInlineHelp",class:"inline-help-node"},Fe={id:"javascript-advanced-options"},Ie={id:"javascript-tracking-visitor-cv"},Ge={class:"row"},Pe={class:"col s12 m3"},Me={class:"col s12 m3"},qe={class:"col s12 m6 l3"},Je=["onKeydown"],Re={class:"col s12 m6 l3"},We=["onKeydown"],$e={class:"row"},Ke={class:"col s12"},ze=Object(a["createElementVNode"])("span",{class:"icon-add"},null,-1),Qe={id:"jsCrossDomain",class:"inline-help-node"},Ye=Object(a["createElementVNode"])("br",null,null,-1),Xe={id:"jsDoNotTrackInlineHelp",class:"inline-help-node"},Ze={key:0},et=Object(a["createElementVNode"])("br",null,null,-1),tt=["innerHTML"],nt={id:"js-campaign-query-param-extra"},ot={class:"row"},rt={class:"col s12"},at={class:"row"},it={class:"col s12"};function lt(e,t,n,o,r,i){var l=Object(a["resolveComponent"])("Field"),c=Object(a["resolveComponent"])("ContentBlock"),s=Object(a["resolveDirective"])("select-on-focus");return Object(a["openBlock"])(),Object(a["createBlock"])(c,{anchor:"javaScriptTracking","content-title":e.translate("CoreAdminHome_JavaScriptTracking")},{default:Object(a["withCtx"])((function(){return[Object(a["createElementVNode"])("div",ne,[Object(a["createElementVNode"])("p",null,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("CoreAdminHome_JSTrackingIntro1"))+" ",1),oe,re,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("CoreAdminHome_JSTrackingIntro2"))+" ",1),Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.jsTrackingIntro3a)},null,8,ae),Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(" "+e.jsTrackingIntro3b)},null,8,ie),le,ce,Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.jsTrackingIntro4a)},null,8,se),de,ue,Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.jsTrackingIntro5)},null,8,me),ge,pe,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("SitesManager_InstallationGuides"))+" : ",1),be,he,je,fe,ve,Oe,Ce,ke,Ve,Se,Ne,ye,Te]),Object(a["createVNode"])(l,{uicontrol:"site",name:"js-tracker-website",class:"jsTrackingCodeWebsite",modelValue:e.site,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.site=t}),introduction:e.translate("General_Website")},null,8,["modelValue","introduction"]),Object(a["createElementVNode"])("div",Ae,[Object(a["createElementVNode"])("div",Ee,[Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("h3",null,Object(a["toDisplayString"])(e.translate("General_JsTrackingTag")),1),Object(a["createElementVNode"])("p",null,Object(a["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_CodeNoteBeforeClosingHead","</head>")),1)]),Object(a["createElementVNode"])("button",{class:"btn",id:"emailJsBtn",onClick:t[1]||(t[1]=function(t){return e.sendEmail()})},Object(a["toDisplayString"])(e.translate("SitesManager_EmailInstructionsButton")),1)]),Object(a["createElementVNode"])("div",we,[Object(a["withDirectives"])(Object(a["createElementVNode"])("pre",{class:"codeblock",textContent:Object(a["toDisplayString"])(e.trackingCode),ref:"trackingCode"},null,8,_e),[[s,{}]])])]),Object(a["createElementVNode"])("div",He,[Object(a["createElementVNode"])("div",De,[Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.mergeSubdomainsDesc)},null,8,Le),Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.learnMoreText)},null,8,xe)]),Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-all-subdomains","model-value":e.trackAllSubdomains,"onUpdate:modelValue":t[2]||(t[2]=function(t){e.trackAllSubdomains=t,e.updateTrackingCode()}),disabled:e.isLoading,introduction:e.translate("General_Options"),title:"".concat(e.translate("CoreAdminHome_JSTracking_MergeSubdomains")," ").concat(e.currentSiteName),"inline-help":"#jsTrackAllSubdomainsInlineHelp"},null,8,["model-value","disabled","introduction","title"])]),Object(a["createElementVNode"])("div",Be,Object(a["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_GroupPageTitlesByDomainDesc1",e.currentSiteHost)),1),Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-group-by-domain","model-value":e.groupByDomain,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.groupByDomain=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_GroupPageTitlesByDomain"),"inline-help":"#jsTrackGroupByDomainInlineHelp"},null,8,["model-value","disabled","title"]),Object(a["createElementVNode"])("div",Ue,Object(a["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_MergeAliasesDesc",e.currentSiteAlias)),1),Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-all-aliases","model-value":e.trackAllAliases,"onUpdate:modelValue":t[4]||(t[4]=function(t){e.trackAllAliases=t,e.updateTrackingCode()}),disabled:e.isLoading,title:"".concat(e.translate("CoreAdminHome_JSTracking_MergeAliases")," ").concat(e.currentSiteName),"inline-help":"#jsTrackAllAliasesInlineHelp"},null,8,["model-value","disabled","title"])]),Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-noscript","model-value":e.trackNoScript,"onUpdate:modelValue":t[5]||(t[5]=function(t){e.trackNoScript=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_TrackNoScript")},null,8,["model-value","disabled","title"]),Object(a["createElementVNode"])("h3",null,Object(a["toDisplayString"])(e.translate("Mobile_Advanced")),1),Object(a["createElementVNode"])("p",null,[Object(a["withDirectives"])(Object(a["createElementVNode"])("a",{href:"javascript:;",onClick:t[6]||(t[6]=Object(a["withModifiers"])((function(t){return e.showAdvanced=!0}),["prevent"]))},Object(a["toDisplayString"])(e.translate("General_Show")),513),[[a["vShow"],!e.showAdvanced]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("a",{href:"javascript:;",onClick:t[7]||(t[7]=Object(a["withModifiers"])((function(t){return e.showAdvanced=!1}),["prevent"]))},Object(a["toDisplayString"])(e.translate("General_Hide")),513),[[a["vShow"],e.showAdvanced]])]),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",Fe,[Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-visitor-cv-check","model-value":e.trackCustomVars,"onUpdate:modelValue":t[8]||(t[8]=function(t){e.trackCustomVars=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_VisitorCustomVars"),"inline-help":e.translate("CoreAdminHome_JSTracking_VisitorCustomVarsDesc")},null,8,["model-value","disabled","title","inline-help"]),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",Ie,[Object(a["createElementVNode"])("div",Ge,[Object(a["createElementVNode"])("div",Pe,Object(a["toDisplayString"])(e.translate("General_Name")),1),Object(a["createElementVNode"])("div",Me,Object(a["toDisplayString"])(e.translate("General_Value")),1)]),(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.customVars,(function(t,n){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{class:"row",key:n},[Object(a["createElementVNode"])("div",qe,[Object(a["createElementVNode"])("input",{type:"text",class:"custom-variable-name",onKeydown:function(t){return e.onCustomVarNameKeydown(t,n)},placeholder:"e.g. Type"},null,40,Je)]),Object(a["createElementVNode"])("div",Re,[Object(a["createElementVNode"])("input",{type:"text",class:"custom-variable-value",onKeydown:function(t){return e.onCustomVarValueKeydown(t,n)},placeholder:"e.g. Customer"},null,40,We)])])})),128)),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",$e,[Object(a["createElementVNode"])("div",Ke,[Object(a["createElementVNode"])("a",{href:"javascript:;",onClick:t[9]||(t[9]=function(t){return e.addCustomVar()}),class:"add-custom-variable"},[ze,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("General_Add")),1)])])],512),[[a["vShow"],e.canAddMoreCustomVariables]])],512),[[a["vShow"],e.trackCustomVars]]),Object(a["createElementVNode"])("div",Qe,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_CrossDomain"))+" ",1),Ye,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_CrossDomain_NeedsMultipleDomains")),1)]),Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-cross-domain","model-value":e.crossDomain,"onUpdate:modelValue":t[10]||(t[10]=function(t){e.crossDomain=t,e.updateTrackingCode(),e.onCrossDomainToggle()}),disabled:e.isLoading||!e.hasManySiteUrls,title:e.translate("CoreAdminHome_JSTracking_EnableCrossDomainLinking"),"inline-help":"#jsCrossDomain"},null,8,["model-value","disabled","title"]),Object(a["createElementVNode"])("div",Xe,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_EnableDoNotTrackDesc"))+" ",1),e.serverSideDoNotTrackEnabled?(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",Ze,[et,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("CoreAdminHome_JSTracking_EnableDoNotTrack_AlreadyEnabled")),1)])):Object(a["createCommentVNode"])("",!0)]),Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-do-not-track","model-value":e.doNotTrack,"onUpdate:modelValue":t[11]||(t[11]=function(t){e.doNotTrack=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_EnableDoNotTrack"),"inline-help":"#jsDoNotTrackInlineHelp"},null,8,["model-value","disabled","title"]),Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"javascript-tracking-disable-cookies","model-value":e.disableCookies,"onUpdate:modelValue":t[12]||(t[12]=function(t){e.disableCookies=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_DisableCookies"),"inline-help":e.translate("CoreAdminHome_JSTracking_DisableCookiesDesc")},null,8,["model-value","disabled","title","inline-help"]),Object(a["createElementVNode"])("div",{id:"jsTrackCampaignParamsInlineHelp",class:"inline-help-node",innerHTML:e.$sanitize(e.jsTrackCampaignParamsInlineHelp)},null,8,tt),Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"custom-campaign-query-params-check","model-value":e.useCustomCampaignParams,"onUpdate:modelValue":t[13]||(t[13]=function(t){e.useCustomCampaignParams=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_CustomCampaignQueryParam"),"inline-help":"#jsTrackCampaignParamsInlineHelp"},null,8,["model-value","disabled","title"]),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",nt,[Object(a["createElementVNode"])("div",ot,[Object(a["createElementVNode"])("div",rt,[Object(a["createVNode"])(l,{uicontrol:"text",name:"custom-campaign-name-query-param","model-value":e.customCampaignName,"onUpdate:modelValue":t[14]||(t[14]=function(t){e.customCampaignName=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_CampaignNameParam")},null,8,["model-value","disabled","title"])])]),Object(a["createElementVNode"])("div",at,[Object(a["createElementVNode"])("div",it,[Object(a["createVNode"])(l,{uicontrol:"text",name:"custom-campaign-keyword-query-param","model-value":e.customCampaignKeyword,"onUpdate:modelValue":t[15]||(t[15]=function(t){e.customCampaignKeyword=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_JSTracking_CampaignKwdParam")},null,8,["model-value","disabled","title"])])])],512),[[a["vShow"],e.useCustomCampaignParams]])],512),[[a["vShow"],e.showAdvanced]])]})),_:1},8,["content-title"])}function ct(e){var t=new URL(e);return t.hostname}function st(e){return e.map((function(e){return[e.name,e.value]}))}var dt=window,ut=dt.$,mt=window.location.host,gt=window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/")),pt=Object(a["defineComponent"])({props:{defaultSite:{type:Object,required:!0},maxCustomVariables:Number,serverSideDoNotTrackEnabled:Boolean},data:function(){return{showAdvanced:!1,site:this.defaultSite,trackingCode:"",trackAllSubdomains:!1,isLoading:!1,siteUrls:{},siteExcludedQueryParams:{},siteExcludedReferrers:{},crossDomain:!1,groupByDomain:!1,trackAllAliases:!1,trackNoScript:!1,trackCustomVars:!1,customVars:[],canAddMoreCustomVariables:!!this.maxCustomVariables&&this.maxCustomVariables>0,doNotTrack:!1,disableCookies:!1,useCustomCampaignParams:!1,customCampaignName:"",customCampaignKeyword:"",trackingCodeAbortController:null,isHighlighting:!1}},components:{ContentBlock:y["ContentBlock"],Field:T["Field"]},directives:{SelectOnFocus:y["SelectOnFocus"]},created:function(){this.onCustomVarNameKeydown=Object(y["debounce"])(this.onCustomVarNameKeydown,100),this.onCustomVarValueKeydown=Object(y["debounce"])(this.onCustomVarValueKeydown,100),this.addCustomVar(),this.site&&this.site.id&&this.onSiteChanged(this.site)},watch:{site:function(e){this.onSiteChanged(e)}},methods:{onSiteChanged:function(e){var t=this,n=e.id,o=[];this.siteUrls[n]||(this.isLoading=!0,o.push(y["AjaxHelper"].fetch({module:"API",method:"SitesManager.getSiteUrlsFromId",idSite:n,filter_limit:"-1"}).then((function(e){t.siteUrls[n]=e||[]})))),this.siteExcludedQueryParams[n]||(this.isLoading=!0,o.push(y["AjaxHelper"].fetch({module:"API",method:"Overlay.getExcludedQueryParameters",idSite:n,filter_limit:"-1"}).then((function(e){t.siteExcludedQueryParams[n]=e||[]})))),this.siteExcludedReferrers[n]||(this.isLoading=!0,o.push(y["AjaxHelper"].fetch({module:"API",method:"SitesManager.getExcludedReferrers",idSite:n,filter_limit:"-1"}).then((function(e){t.siteExcludedReferrers[n]=[],Object.values(e||[]).forEach((function(e){t.siteExcludedReferrers[n].push(e.replace(/^https?:\/\//,""))}))})))),Promise.all(o).then((function(){t.isLoading=!1,t.updateCurrentSiteInfo(),t.updateTrackingCode()}))},sendEmail:function(){var e=Object(y["translate"])("SitesManager_EmailInstructionsSubject");e=encodeURIComponent(e);var t=this.trackingCode;t=t.replace(/<[^>]+>/g,"");var n="".concat(Object(y["translate"])("SitesManager_JsTrackingTagHelp"),". ").concat(Object(y["translate"])("CoreAdminHome_JSTracking_CodeNoteBeforeClosingHeadEmail","'head"),"\n").concat(t);n=encodeURIComponent(n);var o="mailto:?subject=".concat(e,"&body=").concat(n);window.location.href=o},onCrossDomainToggle:function(){this.crossDomain&&(this.trackAllAliases=!0)},updateTrackingCode:function(){var e=this,t=this.site,n={piwikUrl:"".concat(mt).concat(gt),groupPageTitlesByDomain:this.groupByDomain?1:0,mergeSubdomains:this.trackAllSubdomains?1:0,mergeAliasUrls:this.trackAllAliases?1:0,visitorCustomVariables:this.trackCustomVars?st(this.customVars):0,customCampaignNameQueryParam:null,customCampaignKeywordParam:null,doNotTrack:this.doNotTrack?1:0,disableCookies:this.disableCookies?1:0,crossDomain:this.crossDomain?1:0,trackNoScript:this.trackNoScript?1:0,forceMatomoEndpoint:1};this.siteExcludedQueryParams[t.id]&&(n.excludedQueryParams=this.siteExcludedQueryParams[t.id]),this.siteExcludedReferrers[t.id]&&(n.excludedReferrers=this.siteExcludedReferrers[t.id]),this.useCustomCampaignParams&&(n.customCampaignNameQueryParam=this.customCampaignName,n.customCampaignKeywordParam=this.customCampaignKeyword),this.trackingCodeAbortController&&(this.trackingCodeAbortController.abort(),this.trackingCodeAbortController=null),this.trackingCodeAbortController=new AbortController,y["AjaxHelper"].post({module:"API",format:"json",method:"SitesManager.getJavascriptTag",idSite:t.id},n,{abortController:this.trackingCodeAbortController}).then((function(t){e.trackingCodeAbortController=null,e.trackingCode=t.value;var n=ut(e.$refs.trackingCode);n&&!e.isHighlighting&&(e.isHighlighting=!0,n.effect("highlight",{complete:function(){e.isHighlighting=!1}},1500))}))},updateCurrentSiteInfo:function(){this.hasManySiteUrls||(this.crossDomain=!1)},addCustomVar:function(){this.canAddMoreCustomVariables&&this.customVars.push({name:"",value:""}),this.canAddMoreCustomVariables=!!this.maxCustomVariables&&this.maxCustomVariables>this.customVars.length},onCustomVarNameKeydown:function(e,t){var n=this;setTimeout((function(){n.customVars[t].name=e.target.value,n.updateTrackingCode()}))},onCustomVarValueKeydown:function(e,t){var n=this;setTimeout((function(){n.customVars[t].value=e.target.value,n.updateTrackingCode()}))}},computed:{hasManySiteUrls:function(){var e=this.site;return this.siteUrls[e.id]&&this.siteUrls[e.id].length>1},currentSiteHost:function(){var e,t=null===(e=this.siteUrls[this.site.id])||void 0===e?void 0:e[0];return t?ct(t):""},currentSiteAlias:function(){var e,t="x.".concat(this.currentSiteHost),n=null===(e=this.siteUrls[this.site.id])||void 0===e?void 0:e[1];return n||t},currentSiteName:function(){return y["Matomo"].helper.htmlEntities(this.site.name)},jsTrackingIntro3a:function(){return Object(y["translate"])("CoreAdminHome_JSTrackingIntro3a",'<a href="https://matomo.org/integrate/" rel="noreferrer noopener" target="_blank">',"</a>")},jsTrackingIntro3b:function(){return Object(y["translate"])("CoreAdminHome_JSTrackingIntro3b")},jsTrackingIntro4a:function(){return Object(y["translate"])("CoreAdminHome_JSTrackingIntro4",'<a href="#image-tracking-link">',"</a>")},jsTrackingIntro5:function(){return Object(y["translate"])("CoreAdminHome_JSTrackingIntro5",'<a rel="noreferrer noopener" target="_blank" href="https://developer.matomo.org/guides/tracking-javascript-guide">',"</a>")},mergeSubdomainsDesc:function(){return Object(y["translate"])("CoreAdminHome_JSTracking_MergeSubdomainsDesc","x.".concat(this.currentSiteHost),"y.".concat(this.currentSiteHost))},learnMoreText:function(){var e="https://developer.matomo.org/guides/tracking-javascript-guide#measuring-domains-andor-sub-domains";return Object(y["translate"])("General_LearnMore",' (<a href="'.concat(e,'" rel="noreferrer noopener" target="_blank">'),"</a>)")},jsTrackCampaignParamsInlineHelp:function(){return Object(y["translate"])("CoreAdminHome_JSTracking_CustomCampaignQueryParamDesc",'<a href="https://matomo.org/faq/general/faq_119" rel="noreferrer noopener" target="_blank">',"</a>")}}});pt.render=lt;var bt=pt,ht=Object(a["createElementVNode"])("a",{name:"image-tracking-link"},null,-1),jt={id:"image-tracking-code-options"},ft=["innerHTML"],vt=["innerHTML"],Ot={id:"image-tracking-goal-sub"},Ct={class:"row"},kt={class:"col s12 m6"},Vt={class:"col s12 m6"},St={id:"image-link-output-section"},Nt={id:"image-tracking-text"},yt=["textContent"];function Tt(e,t,n,o,r,i){var l=Object(a["resolveComponent"])("Field"),c=Object(a["resolveComponent"])("ContentBlock"),s=Object(a["resolveDirective"])("select-on-focus");return Object(a["openBlock"])(),Object(a["createBlock"])(c,{"content-title":e.translate("CoreAdminHome_ImageTracking"),anchor:"imageTracking"},{default:Object(a["withCtx"])((function(){return[ht,Object(a["createElementVNode"])("div",jt,[Object(a["createElementVNode"])("p",{innerHTML:e.$sanitize(e.imageTrackingIntro)},null,8,ft),Object(a["createElementVNode"])("p",{innerHTML:e.$sanitize(e.imageTrackingIntro3)},null,8,vt),Object(a["createVNode"])(l,{uicontrol:"site",name:"image-tracker-website",modelValue:e.site,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.site=t}),introduction:e.translate("General_Website")},null,8,["modelValue","introduction"]),Object(a["createVNode"])(l,{uicontrol:"text",name:"image-tracker-action-name","model-value":e.pageName,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.pageName=t,e.updateTrackingCode()}),disabled:e.isLoading,introduction:e.translate("General_Options"),title:e.translate("Actions_ColumnPageName")},null,8,["model-value","disabled","introduction","title"]),Object(a["createVNode"])(l,{uicontrol:"checkbox",name:"image-tracking-goal-check","model-value":e.trackGoal,"onUpdate:modelValue":t[2]||(t[2]=function(t){e.trackGoal=t,e.updateTrackingCode()}),disabled:e.isLoading,title:e.translate("CoreAdminHome_TrackAGoal")},null,8,["model-value","disabled","title"]),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",Ot,[Object(a["createElementVNode"])("div",Ct,[Object(a["createElementVNode"])("div",kt,[Object(a["createVNode"])(l,{uicontrol:"select",name:"image-tracker-goal",options:e.siteGoals,disabled:e.isLoading,"model-value":e.trackIdGoal,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.trackIdGoal=t,e.updateTrackingCode()})},null,8,["options","disabled","model-value"])]),Object(a["createElementVNode"])("div",Vt,[Object(a["createVNode"])(l,{uicontrol:"text",name:"image-revenue","model-value":e.revenue,"onUpdate:modelValue":t[4]||(t[4]=function(t){e.revenue=t,e.updateTrackingCode()}),disabled:e.isLoading,"full-width":!0,title:"".concat(e.translate("CoreAdminHome_WithOptionalRevenue")," ").concat(e.currentSiteCurrency)},null,8,["model-value","disabled","title"])])])],512),[[a["vShow"],e.trackGoal]]),Object(a["createElementVNode"])("div",St,[Object(a["createElementVNode"])("h3",null,Object(a["toDisplayString"])(e.translate("CoreAdminHome_ImageTrackingLink")),1),Object(a["createElementVNode"])("div",Nt,[Object(a["withDirectives"])(Object(a["createElementVNode"])("pre",{textContent:Object(a["toDisplayString"])(e.trackingCode),ref:"trackingCode"},null,8,yt),[[s,{}]])])])])]})),_:1},8,["content-title"])}function At(e,t){return Dt(e)||Ht(e,t)||wt(e,t)||Et()}function Et(){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 _t(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)?_t(e,t):void 0}}function _t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Ht(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(o=n.next()).done);i=!0)if(a.push(o.value),t&&a.length===t)break}catch(c){l=!0,r=c}finally{try{i||null==n["return"]||n["return"]()}finally{if(l)throw r}}return a}}function Dt(e){if(Array.isArray(e))return e}var Lt=null,xt=window,Bt=xt.$,Ut=window.location.host,Ft=window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/")),It=Object(a["defineComponent"])({props:{defaultSite:{type:Object,required:!0}},components:{ContentBlock:y["ContentBlock"],Field:T["Field"]},directives:{SelectOnFocus:y["SelectOnFocus"]},data:function(){return{isLoading:!1,site:this.defaultSite,pageName:"",trackGoal:!1,trackIdGoal:null,revenue:"",trackingCode:"",sites:{},goals:{},trackingCodeAbortController:null,isHighlighting:!1}},created:function(){this.updateTrackingCode=Object(y["debounce"])(this.updateTrackingCode),this.site&&this.site.id&&this.onSiteChanged(this.site)},watch:{site:function(e){this.onSiteChanged(e)}},methods:{onSiteChanged:function(e){var t,n,o,r=this;return this.trackIdGoal=null,Lt?t=Promise.resolve(Lt):(this.isLoading=!0,t=y["AjaxHelper"].fetch({method:"SitesManager.getCurrencySymbols",filter_limit:"-1"})),this.sites[e.id]?n=Promise.resolve(this.sites[e.id]):(this.isLoading=!0,n=y["AjaxHelper"].fetch({module:"API",method:"SitesManager.getSiteFromId",idSite:e.id})),this.goals[e.id]?o=Promise.resolve(this.goals[e.id]):(this.isLoading=!0,o=y["AjaxHelper"].fetch({module:"API",method:"Goals.getGoals",filter_limit:"-1",idSite:e.id})),Promise.all([t,n,o]).then((function(t){var n=At(t,3),o=n[0],a=n[1],i=n[2];r.isLoading=!1,Lt=o,r.sites[e.id]=a,r.goals[e.id]=i,r.updateTrackingCode()}))},updateTrackingCode:function(){var e=this,t={piwikUrl:"".concat(Ut).concat(Ft),actionName:this.pageName,forceMatomoEndpoint:1};this.trackGoal&&this.trackIdGoal&&(t.idGoal=this.trackIdGoal,t.revenue=this.revenue),this.trackingCodeAbortController&&(this.trackingCodeAbortController.abort(),this.trackingCodeAbortController=null),this.trackingCodeAbortController=new AbortController,y["AjaxHelper"].post({module:"API",format:"json",method:"SitesManager.getImageTrackingCode",idSite:this.site.id},t,{abortController:this.trackingCodeAbortController}).then((function(t){e.trackingCodeAbortController=null,e.trackingCode=t.value;var n=Bt(e.$refs.trackingCode);n&&!e.isHighlighting&&(e.isHighlighting=!0,n.effect("highlight",{complete:function(){e.isHighlighting=!1}},1500))}))}},computed:{currentSiteCurrency:function(){return Lt?Lt[(this.sites[this.site.id].currency||"").toUpperCase()]:""},siteGoals:function(){var e=this.goals[this.site.id];return[{key:"",value:Object(y["translate"])("UserCountryMap_None")}].concat(Object.values(e||[]).map((function(e){return{key:"".concat(e.idgoal),value:e.name}})))},imageTrackingIntro:function(){var e=Object(y["translate"])("CoreAdminHome_ImageTrackingIntro1"),t=Object(y["translate"])("CoreAdminHome_ImageTrackingIntro2","<code><noscript></noscript></code>");return"".concat(e," ").concat(t)},imageTrackingIntro3:function(){var e="https://matomo.org/docs/tracking-api/reference/";return Object(y["translate"])("CoreAdminHome_ImageTrackingIntro3",'<a href="'.concat(e,'" rel="noreferrer noopener" target="_blank">'),"</a>")}}});It.render=Tt;var Gt=It,Pt=Object(a["createElementVNode"])("br",null,null,-1),Mt=Object(a["createElementVNode"])("br",null,null,-1),qt=["value"],Jt={class:"action"},Rt={colspan:"7"},Wt=Object(a["createElementVNode"])("span",{class:"icon-ok"},null,-1),$t={class:"ui-confirm",id:"confirmDeleteAllTrackingFailures"},Kt=["value"],zt=["value"],Qt={class:"ui-confirm",id:"confirmDeleteThisTrackingFailure"},Yt=["value"],Xt=["value"];function Zt(e,t,n,o,r,i){var l=Object(a["resolveComponent"])("ActivityIndicator"),c=Object(a["resolveComponent"])("FailureRow"),s=Object(a["resolveComponent"])("ContentBlock"),d=Object(a["resolveDirective"])("content-table");return Object(a["openBlock"])(),Object(a["createBlock"])(s,{class:"matomoTrackingFailures","content-title":e.translate("CoreAdminHome_TrackingFailures")},{default:Object(a["withCtx"])((function(){return[Object(a["createElementVNode"])("p",null,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("CoreAdminHome_TrackingFailuresIntroduction","2"))+" ",1),Pt,Mt,Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{class:"btn deleteAllFailures",type:"button",onClick:t[0]||(t[0]=function(t){return e.deleteAll()}),value:e.translate("CoreAdminHome_DeleteAllFailures")},null,8,qt),[[a["vShow"],!e.isLoading&&e.failures.length>0]])]),Object(a["createVNode"])(l,{loading:e.isLoading},null,8,["loading"]),Object(a["withDirectives"])(Object(a["createElementVNode"])("table",null,[Object(a["createElementVNode"])("thead",null,[Object(a["createElementVNode"])("tr",null,[Object(a["createElementVNode"])("th",{onClick:t[1]||(t[1]=function(t){return e.changeSortOrder("idsite")})},Object(a["toDisplayString"])(e.translate("General_Measurable")),1),Object(a["createElementVNode"])("th",{onClick:t[2]||(t[2]=function(t){return e.changeSortOrder("problem")})},Object(a["toDisplayString"])(e.translate("CoreAdminHome_Problem")),1),Object(a["createElementVNode"])("th",{onClick:t[3]||(t[3]=function(t){return e.changeSortOrder("solution")})},Object(a["toDisplayString"])(e.translate("CoreAdminHome_Solution")),1),Object(a["createElementVNode"])("th",{onClick:t[4]||(t[4]=function(t){return e.changeSortOrder("date_first_occurred")})},Object(a["toDisplayString"])(e.translate("General_Date")),1),Object(a["createElementVNode"])("th",{onClick:t[5]||(t[5]=function(t){return e.changeSortOrder("url")})},Object(a["toDisplayString"])(e.translate("Actions_ColumnPageURL")),1),Object(a["createElementVNode"])("th",{onClick:t[6]||(t[6]=function(t){return e.changeSortOrder("request_url")})},Object(a["toDisplayString"])(e.translate("CoreAdminHome_TrackingURL")),1),Object(a["createElementVNode"])("th",Jt,Object(a["toDisplayString"])(e.translate("General_Action")),1)])]),Object(a["createElementVNode"])("tbody",null,[Object(a["createElementVNode"])("tr",null,[Object(a["withDirectives"])(Object(a["createElementVNode"])("td",Rt,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("CoreAdminHome_NoKnownFailures"))+" ",1),Wt],512),[[a["vShow"],!e.isLoading&&0===e.failures.length]])]),(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.sortedFailures,(function(n,o){return Object(a["openBlock"])(),Object(a["createElementBlock"])("tr",{key:o},[Object(a["createVNode"])(c,{failure:n,onDelete:t[7]||(t[7]=function(t){return e.deleteFailure(t.idSite,t.idFailure)})},null,8,["failure"])])})),128))])],512),[[d]]),Object(a["createElementVNode"])("div",$t,[Object(a["createElementVNode"])("h2",null,Object(a["toDisplayString"])(e.translate("CoreAdminHome_ConfirmDeleteAllTrackingFailures")),1),Object(a["createElementVNode"])("input",{type:"button",role:"yes",value:e.translate("General_Yes")},null,8,Kt),Object(a["createElementVNode"])("input",{type:"button",role:"no",value:e.translate("General_No")},null,8,zt)]),Object(a["createElementVNode"])("div",Qt,[Object(a["createElementVNode"])("h2",null,Object(a["toDisplayString"])(e.translate("CoreAdminHome_ConfirmDeleteThisTrackingFailure")),1),Object(a["createElementVNode"])("input",{type:"button",role:"yes",value:e.translate("General_Yes")},null,8,Yt),Object(a["createElementVNode"])("input",{type:"button",role:"no",value:e.translate("General_No")},null,8,Xt)])]})),_:1},8,["content-title"])}var en=["href"],tn={class:"datetime"},nn=["title"],on=["title"];function rn(e,t,n,o,r,i){return Object(a["openBlock"])(),Object(a["createElementBlock"])(a["Fragment"],null,[Object(a["createElementVNode"])("td",null,Object(a["toDisplayString"])(e.failure.site_name)+" ("+Object(a["toDisplayString"])(e.translate("General_Id"))+" "+Object(a["toDisplayString"])(e.failure.idsite)+")",1),Object(a["createElementVNode"])("td",null,Object(a["toDisplayString"])(e.failure.problem),1),Object(a["createElementVNode"])("td",null,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.failure.solution)+" ",1),Object(a["withDirectives"])(Object(a["createElementVNode"])("a",{rel:"noopener noreferrer",href:e.failure.solution_url},Object(a["toDisplayString"])(e.translate("CoreAdminHome_LearnMore")),9,en),[[a["vShow"],e.failure.solution_url]])]),Object(a["createElementVNode"])("td",tn,Object(a["toDisplayString"])(e.failure.pretty_date_first_occurred),1),Object(a["createElementVNode"])("td",null,Object(a["toDisplayString"])(e.failure.url),1),Object(a["createElementVNode"])("td",null,[Object(a["withDirectives"])(Object(a["createElementVNode"])("span",{onClick:t[0]||(t[0]=function(t){return e.showFullRequestUrl=!0}),title:e.translate("CoreHome_ClickToSeeFullInformation")},Object(a["toDisplayString"])(e.limtedRequestUrl)+"...",9,nn),[[a["vShow"],!e.showFullRequestUrl]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("span",null,Object(a["toDisplayString"])(e.failure.request_url),513),[[a["vShow"],e.failure.showFullRequestUrl]])]),Object(a["createElementVNode"])("td",null,[Object(a["createElementVNode"])("span",{class:"table-action icon-delete",onClick:t[1]||(t[1]=function(t){return e.deleteFailure(e.failure.idsite,e.failure.idfailure)}),title:e.translate("General_Delete")},null,8,on)])],64)}var an=Object(a["defineComponent"])({props:{failure:{type:Object,required:!0}},emits:["delete"],data:function(){return{showFullRequestUrl:!1}},computed:{limtedRequestUrl:function(){return this.failure.request_url.substring(0,100)}},methods:{deleteFailure:function(e,t){this.$emit("delete",{idSite:e,idFailure:t})}}});an.render=rn;var ln=an;function cn(e){return mn(e)||un(e)||dn(e)||sn()}function sn(){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 dn(e,t){if(e){if("string"===typeof e)return gn(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)?gn(e,t):void 0}}function un(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function mn(e){if(Array.isArray(e))return gn(e)}function gn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var pn=Object(a["defineComponent"])({components:{ContentBlock:y["ContentBlock"],ActivityIndicator:y["ActivityIndicator"],FailureRow:ln},directives:{ContentTable:y["ContentTable"]},data:function(){return{failures:[],sortColumn:"idsite",sortReverse:!1,isLoading:!1}},created:function(){this.fetchAll()},methods:{changeSortOrder:function(e){this.sortColumn===e?this.sortReverse=!this.sortReverse:this.sortColumn=e},fetchAll:function(){var e=this;this.failures=[],this.isLoading=!0,y["AjaxHelper"].fetch({method:"CoreAdminHome.getTrackingFailures",filter_limit:"-1"}).then((function(t){e.failures=t,e.isLoading=!1})).finally((function(){e.isLoading=!1}))},deleteAll:function(){var e=this;y["Matomo"].helper.modalConfirm("#confirmDeleteAllTrackingFailures",{yes:function(){e.failures=[],y["AjaxHelper"].fetch({method:"CoreAdminHome.deleteAllTrackingFailures"}).then((function(){e.fetchAll()}))}})},deleteFailure:function(e,t){var n=this;y["Matomo"].helper.modalConfirm("#confirmDeleteThisTrackingFailure",{yes:function(){n.failures=[],y["AjaxHelper"].fetch({method:"CoreAdminHome.deleteTrackingFailure",idSite:e,idFailure:t}).then((function(){n.fetchAll()}))}})}},computed:{sortedFailures:function(){var e=this.sortColumn,t=cn(this.failures);return this.sortReverse?t.sort((function(t,n){return t[e]>n[e]?-1:t[e]<n[e]?1:0})):t.sort((function(t,n){return t[e]<n[e]?-1:t[e]>n[e]?1:0})),t}}});pn.render=Zt;var bn=pn; /*! * Matomo - free/libre analytics platform * |