Do.isComparing()&&!window.broadcast.isNoDataPage()),t=Object(E["computed"])(()=>Do.getSegmentComparisons()),o=Object(E["computed"])(()=>Do.getPeriodComparisons()),i=Do.getSeriesColor.bind(Do);function n(){const e=window.$(this).attr("title");return e?window.vueSanitize(e.replace(/\n/g,"
")):e}return{isComparing:e,segmentComparisons:t,periodComparisons:o,getSeriesColor:i,transformTooltipContent:n}},methods:{comparisonHasSegment(e){return"undefined"!==typeof e.params.segment},removeSegmentComparison(e){window.$(this.$refs.root).tooltip("destroy"),Do.removeSegmentComparison(e)},getComparisonPeriodType(e){const{period:t}=e.params;if("range"===t)return a("CoreHome_PeriodRange");const o=a(`Intl_Period${t.substring(0,1).toUpperCase()}${t.substring(1)}`);return o.substring(0,1).toUpperCase()+o.substring(1)},getComparisonTooltip(e,t){if(this.comparisonTooltips&&Object.keys(this.comparisonTooltips).length)return(this.comparisonTooltips[t.index]||{})[e.index]},getTitleTooltip(e){return this.htmlentities(e.title)+"
"+this.htmlentities(decodeURIComponent(e.params.segment))},getUrlToSegment(e){const t=Object.assign({},H.hashParsed.value);return delete t.comparePeriods,delete t.compareDates,delete t.compareSegments,t.segment=e,`${window.location.search}#?${H.stringify(t)}`},onComparisonsChanged(){if(this.comparisonTooltips=null,!Do.isComparing())return;const e=Do.getPeriodComparisons(),t=Do.getSegmentComparisons();K.fetch({method:"API.getProcessedReport",apiModule:"VisitsSummary",apiAction:"get",compare:"1",compareSegments:H.getSearchParam("compareSegments"),comparePeriods:H.getSearchParam("comparePeriods"),compareDates:H.getSearchParam("compareDates"),format_metrics:"1"}).then(o=>{this.comparisonTooltips={},e.forEach(e=>{this.comparisonTooltips[e.index]={},t.forEach(t=>{const i=this.generateComparisonTooltip(o,e,t);this.comparisonTooltips[e.index][t.index]=i})})})},generateComparisonTooltip(e,t,o){if(!e.reportData.comparisons)return"";const i=Do.getComparisonSeriesIndex(t.index,0),n=e.reportData.comparisons[i],r=Do.getComparisonSeriesIndex(t.index,o.index),s=e.reportData.comparisons[r],l=e.reportData.comparisons[o.index];let c='',d=(s.nb_visits/n.nb_visits*100).toFixed(2);return d+="%",c+=a("General_ComparisonCardTooltip1",[`'${this.htmlentities(s.compareSegmentPretty)}'`,s.comparePeriodPretty,d,s.nb_visits.toString(),n.nb_visits.toString()]),t.index>0&&(c+="
",c+=a("General_ComparisonCardTooltip2",[s.nb_visits_change.toString(),this.htmlentities(l.compareSegmentPretty),l.comparePeriodPretty])),c+="
",c},htmlentities(e){return M.helper.htmlEntities(e)}},mounted(){M.on("piwikComparisonsChanged",()=>{this.onComparisonsChanged()}),this.onComparisonsChanged()}});Po.render=vo;var To=Po;const Vo={ref:"root",class:"menuDropdown"},No=["title"],xo=["innerHTML"],Bo=Object(E["createElementVNode"])("span",{class:"icon-chevron-down reporting-menu-sub-icon"},null,-1),Mo={class:"items"},Io={key:0,class:"search"},Fo=["placeholder"],Lo=["title"],Ao=["title"];function _o(e,t,o,i,n,a){const r=Object(E["resolveDirective"])("focus-if"),s=Object(E["resolveDirective"])("focus-anywhere-but-here");return Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Vo,[Object(E["createElementVNode"])("span",{class:"title",onClick:t[0]||(t[0]=t=>e.showItems=!e.showItems),title:e.tooltip},[Object(E["createElementVNode"])("span",{class:"title-label",innerHTML:e.$sanitize(this.actualMenuTitle)},null,8,xo),Bo],8,No),Object(E["withDirectives"])(Object(E["createElementVNode"])("div",Mo,[e.showSearch&&e.showItems?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Io,[Object(E["withDirectives"])(Object(E["createElementVNode"])("input",{type:"text","onUpdate:modelValue":t[1]||(t[1]=t=>e.searchTerm=t),onKeydown:t[2]||(t[2]=t=>e.onSearchTermKeydown(t)),placeholder:e.translate("General_Search")},null,40,Fo),[[E["vModelText"],e.searchTerm],[r,{focused:e.showItems}]]),Object(E["withDirectives"])(Object(E["createElementVNode"])("div",{class:"search_ico icon-search",title:e.translate("General_Search")},null,8,Lo),[[E["vShow"],!e.searchTerm]]),Object(E["withDirectives"])(Object(E["createElementVNode"])("div",{onClick:t[3]||(t[3]=t=>{e.searchTerm="",e.searchItems("")}),class:"reset icon-close",title:e.translate("General_Clear")},null,8,Ao),[[E["vShow"],e.searchTerm]])])):Object(E["createCommentVNode"])("",!0),Object(E["createElementVNode"])("div",{onClick:t[4]||(t[4]=t=>e.selectItem(t))},[Object(E["renderSlot"])(e.$slots,"default")])],512),[[E["vShow"],e.showItems]])])),[[s,{blur:e.lostFocus}]])}const{$:Ro}=window;var Ho=Object(E["defineComponent"])({props:{menuTitle:String,tooltip:String,showSearch:Boolean,menuTitleChangeOnClick:Boolean},directives:{FocusAnywhereButHere:Je,FocusIf:Qe},emits:["afterSelect"],watch:{menuTitle(){this.actualMenuTitle=this.menuTitle}},data(){return{showItems:!1,searchTerm:"",actualMenuTitle:this.menuTitle}},methods:{lostFocus(){this.showItems=!1},selectItem(e){const t=e.target.classList;!t.contains("item")||t.contains("disabled")||t.contains("separator")||(this.menuTitleChangeOnClick&&(this.actualMenuTitle=(e.target.textContent||"").replace(/[\u0000-\u2666]/g,e=>`${e.charCodeAt(0)};`)),this.showItems=!1,Ro(this.$slots.default()[0].el).find(".item").removeClass("active"),t.add("active"),this.$emit("afterSelect",e.target))},onSearchTermKeydown(){setTimeout(()=>{this.searchItems(this.searchTerm)})},searchItems(e){const t=e.toLowerCase();Ro(this.$refs.root).find(".item").each((e,o)=>{const i=Ro(o);-1===i.text().toLowerCase().indexOf(t)?i.hide():i.show()})}}});Ho.render=_o;var $o=Ho;const Uo={ref:"root"};function qo(e,t,o,i,n,a){return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Uo,null,512)}const Wo=1,{$:zo}=window;var Go=Object(E["defineComponent"])({props:{selectedDateStart:Date,selectedDateEnd:Date,highlightedDateStart:Date,highlightedDateEnd:Date,viewDate:[String,Date],stepMonths:Number,disableMonthDropdown:Boolean,options:Object},emits:["cellHover","cellHoverLeave","dateSelect"],setup(e,t){const o=Object(E["ref"])(null);function i(t,o){const i=t.children("a");if(e.selectedDateStart&&e.selectedDateEnd&&o>=e.selectedDateStart&&o<=e.selectedDateEnd?t.addClass("ui-datepicker-current-period"):t.removeClass("ui-datepicker-current-period"),e.highlightedDateStart&&e.highlightedDateEnd&&o>=e.highlightedDateStart&&o<=e.highlightedDateEnd){const e=i.length?i:t;e.addClass("ui-state-hover")}else t.removeClass("ui-state-hover"),i.removeClass("ui-state-hover")}function n(e,t,o){if(e.hasClass("ui-datepicker-other-month"))return a(e,t,o);const i=parseInt(e.children("a,span").text(),10);return new Date(o,t,i)}function a(e,t,o){let i;const a=e.parent(),r=a.children("td");if(a.is(":first-child")){const s=a.children("td:not(.ui-datepicker-other-month)").first();return i=n(s,t,o),i.setDate(r.index(e)-r.index(s)+1),i}const s=a.children("td:not(.ui-datepicker-other-month)").last();return i=n(s,t,o),i.setDate(i.getDate()+r.index(e)-r.index(s)),i}function r(){const e=zo(o.value),t=e.find("td[data-month]"),i=parseInt(t.attr("data-month"),10),n=parseInt(t.attr("data-year"),10);return[i,n]}function s(){const e=zo(o.value),t=e.find(".ui-datepicker-calendar"),a=r(),s=t.find("td"),l=s.first(),c=n(l,a[0],a[1]);s.each((function(){i(zo(this),c),c.setDate(c.getDate()+1)}))}function l(){if(!e.viewDate)return!1;let t;if("string"===typeof e.viewDate)try{t=m(e.viewDate)}catch(a){return!1}else t=e.viewDate;const i=zo(o.value),n=r();return(n[0]!==t.getMonth()||n[1]!==t.getFullYear())&&(i.datepicker("setDate",t),!0)}function c(){const e=zo(o.value);e.find("td[data-event]").off("click"),e.find(".ui-state-active").removeClass("ui-state-active"),e.find(".ui-datepicker-current-day").removeClass("ui-datepicker-current-day"),e.find(".ui-datepicker-prev,.ui-datepicker-next").attr("href","")}function d(){const t=zo(o.value),i=e.stepMonths||Wo;if(t.datepicker("option","stepMonths")===i)return!1;const n=zo(".ui-datepicker-month",t).val(),a=zo(".ui-datepicker-year",t).val();return t.datepicker("option","stepMonths",i).datepicker("setDate",new Date(a,n)),c(),!0}function u(){const t=zo(o.value),i=t.find(".ui-datepicker-month")[0];i&&(i.disabled=e.disableMonthDropdown)}function p(){if(!zo(this).hasClass("ui-state-hover"))return;const e=zo(this).parent(),t=e.parent();e.is(":first-child")?t.find("a").first().click():t.find("a").last().click()}function h(){u(),s()}return Object(E["watch"])(()=>Object.assign({},e),(e,t)=>{let o=!1;[e=>e.selectedDateStart,e=>e.selectedDateEnd,e=>e.highlightedDateStart,e=>e.highlightedDateEnd].forEach(i=>{if(o)return;const n=i(e),a=i(t);!n&&a&&(o=!0),n&&!a&&(o=!0),n&&a&&n.getTime()!==a.getTime()&&(o=!0)}),e.viewDate!==t.viewDate&&l()&&(o=!0),e.stepMonths!==t.stepMonths&&d(),e.disableMonthDropdown!==t.disableMonthDropdown&&u(),o&&s()}),Object(E["onMounted"])(()=>{const i=zo(o.value),a=e.options||{},m=Object.assign(Object.assign(Object.assign({},M.getBaseDatePickerOptions()),a),{},{onChangeMonthYear:()=>{setTimeout(()=>{c()})}});i.datepicker(m),i.on("mouseover","tbody td a",e=>{e.originalEvent&&s()}),i.on("mouseenter","tbody td",(function(){const e=r(),o=zo(this),i=n(o,e[0],e[1]);t.emit("cellHover",{date:i,$cell:o})})),i.on("mouseout","tbody td a",()=>{s()}),i.on("mouseleave","table",()=>t.emit("cellHoverLeave")).on("mouseenter","thead",()=>t.emit("cellHoverLeave")),i.on("click","tbody td.ui-datepicker-other-month",p),i.on("click",e=>{e.preventDefault();const t=zo(e.target).closest("a");(t.is(".ui-datepicker-next")||t.is(".ui-datepicker-prev"))&&h()}),i.on("click","td[data-month]",e=>{const o=zo(e.target).closest("td"),i=parseInt(o.attr("data-month"),10),n=parseInt(o.attr("data-year"),10),a=parseInt(o.children("a,span").text(),10);t.emit("dateSelect",{date:new Date(n,i,a)})});const g=d();l(),u(),g||c(),s()}),{root:o}}});Go.render=qo;var Yo=Go;const Jo={class:"dateRangePicker"},Ko={id:"calendarRangeFrom"},Qo={id:"calendarRangeTo"};function Xo(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("DatePicker");return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Jo,[Object(E["createElementVNode"])("div",Ko,[Object(E["createElementVNode"])("h6",null,[Object(E["createTextVNode"])(Object(E["toDisplayString"])(e.translate("General_DateRangeFrom"))+" ",1),Object(E["withDirectives"])(Object(E["createElementVNode"])("input",{type:"text",id:"inputCalendarFrom",name:"inputCalendarFrom",class:"browser-default","onUpdate:modelValue":t[0]||(t[0]=t=>e.startDateText=t),onKeydown:t[1]||(t[1]=t=>e.onRangeInputChanged("from",t)),onKeyup:t[2]||(t[2]=t=>e.handleEnterPress(t))},null,544),[[E["vModelText"],e.startDateText]])]),Object(E["createVNode"])(r,{id:"calendarFrom","view-date":e.startDate,"selected-date-start":e.fromPickerSelectedDates[0],"selected-date-end":e.fromPickerSelectedDates[1],"highlighted-date-start":e.fromPickerHighlightedDates[0],"highlighted-date-end":e.fromPickerHighlightedDates[1],onDateSelect:t[3]||(t[3]=t=>e.setStartRangeDate(t.date)),onCellHover:t[4]||(t[4]=t=>e.fromPickerHighlightedDates=e.getNewHighlightedDates(t.date,t.$cell)),onCellHoverLeave:t[5]||(t[5]=t=>e.fromPickerHighlightedDates=[null,null])},null,8,["view-date","selected-date-start","selected-date-end","highlighted-date-start","highlighted-date-end"])]),Object(E["createElementVNode"])("div",Qo,[Object(E["createElementVNode"])("h6",null,[Object(E["createTextVNode"])(Object(E["toDisplayString"])(e.translate("General_DateRangeTo"))+" ",1),Object(E["withDirectives"])(Object(E["createElementVNode"])("input",{type:"text",id:"inputCalendarTo",name:"inputCalendarTo",class:"browser-default","onUpdate:modelValue":t[6]||(t[6]=t=>e.endDateText=t),onKeydown:t[7]||(t[7]=t=>e.onRangeInputChanged("to",t)),onKeyup:t[8]||(t[8]=t=>e.handleEnterPress(t))},null,544),[[E["vModelText"],e.endDateText]])]),Object(E["createVNode"])(r,{id:"calendarTo","view-date":e.endDate,"selected-date-start":e.toPickerSelectedDates[0],"selected-date-end":e.toPickerSelectedDates[1],"highlighted-date-start":e.toPickerHighlightedDates[0],"highlighted-date-end":e.toPickerHighlightedDates[1],onDateSelect:t[9]||(t[9]=t=>e.setEndRangeDate(t.date)),onCellHover:t[10]||(t[10]=t=>e.toPickerHighlightedDates=e.getNewHighlightedDates(t.date,t.$cell)),onCellHoverLeave:t[11]||(t[11]=t=>e.toPickerHighlightedDates=[null,null])},null,8,["view-date","selected-date-start","selected-date-end","highlighted-date-start","highlighted-date-end"])])])}const Zo="YYYY-MM-DD";var ei=Object(E["defineComponent"])({props:{startDate:String,endDate:String},components:{DatePicker:Yo},data(){let e=null;try{this.startDate&&(e=m(this.startDate))}catch(o){}let t=null;try{this.endDate&&(t=m(this.endDate))}catch(o){}return{fromPickerSelectedDates:[e,e],toPickerSelectedDates:[t,t],fromPickerHighlightedDates:[null,null],toPickerHighlightedDates:[null,null],startDateText:this.startDate,endDateText:this.endDate,startDateInvalid:!1,endDateInvalid:!1}},emits:["rangeChange","submit"],watch:{startDate(){this.startDateText=this.startDate,this.setStartRangeDateFromStr(this.startDate)},endDate(){this.endDateText=this.endDate,this.setEndRangeDateFromStr(this.endDate)}},mounted(){this.rangeChanged()},methods:{setStartRangeDate(e){this.fromPickerSelectedDates=[e,e],this.rangeChanged()},setEndRangeDate(e){this.toPickerSelectedDates=[e,e],this.rangeChanged()},onRangeInputChanged(e,t){setTimeout(()=>{"from"===e?this.setStartRangeDateFromStr(t.target.value):this.setEndRangeDateFromStr(t.target.value)})},getNewHighlightedDates(e,t){return t.hasClass("ui-datepicker-unselectable")?null:[e,e]},handleEnterPress(e){13===e.keyCode&&this.$emit("submit",{start:this.startDate,end:this.endDate})},setStartRangeDateFromStr(e){this.startDateInvalid=!0;let t=null;try{e&&e.length===Zo.length&&(t=m(e))}catch(o){}t&&(this.fromPickerSelectedDates=[t,t],this.startDateInvalid=!1,this.rangeChanged())},setEndRangeDateFromStr(e){this.endDateInvalid=!0;let t=null;try{e&&e.length===Zo.length&&(t=m(e))}catch(o){}t&&(this.toPickerSelectedDates=[t,t],this.endDateInvalid=!1,this.rangeChanged())},rangeChanged(){this.$emit("rangeChange",{start:this.fromPickerSelectedDates[0]?d(this.fromPickerSelectedDates[0]):null,end:this.toPickerSelectedDates[0]?d(this.toPickerSelectedDates[0]):null})}}});ei.render=Xo;var ti=ei;function oi(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("DatePicker");return Object(E["openBlock"])(),Object(E["createBlock"])(r,{"selected-date-start":e.selectedDates[0],"selected-date-end":e.selectedDates[1],"highlighted-date-start":e.highlightedDates[0],"highlighted-date-end":e.highlightedDates[1],"view-date":e.viewDate,"step-months":"year"===e.period?12:1,"disable-month-dropdown":"year"===e.period,onCellHover:t[0]||(t[0]=t=>e.onHoverNormalCell(t.date,t.$cell)),onCellHoverLeave:t[1]||(t[1]=t=>e.onHoverLeaveNormalCells()),onDateSelect:t[2]||(t[2]=t=>e.onDateSelected(t.date))},null,8,["selected-date-start","selected-date-end","highlighted-date-start","highlighted-date-end","view-date","step-months","disable-month-dropdown"])}const ii=new Date(M.minDateYear,M.minDateMonth-1,M.minDateDay),ni=new Date(M.maxDateYear,M.maxDateMonth-1,M.maxDateDay);var ai=Object(E["defineComponent"])({props:{period:{type:String,required:!0},date:[String,Date]},components:{DatePicker:Yo},emits:["select"],setup(e,t){const o=Object(E["ref"])(e.date),i=Object(E["ref"])([null,null]),n=Object(E["ref"])([null,null]);function a(t){const o=c.get(e.period).parse(t).getDateRange();return o[0]=iio[1]?o[1]:ni,o}function r(t,o){const i=tni,r=o.hasClass("ui-datepicker-other-month")&&("month"===e.period||"day"===e.period);n.value=i||r?[null,null]:a(t)}function s(){n.value=[null,null]}function l(e){t.emit("select",{date:e})}function d(){if(!e.period||!e.date)return i.value=[null,null],void(o.value=null);i.value=a(e.date),o.value=m(e.date)}return Object(E["watch"])(e,d),d(),{selectedDates:i,highlightedDates:n,viewDate:o,onHoverNormalCell:r,onHoverLeaveNormalCells:s,onDateSelected:l}}});ai.render=oi;var ri=ai;const si={key:0},li=["data-notification-instance-id"],ci={key:1},di={class:"notification-body"},ui=["innerHTML"],mi={key:1};function pi(e,t,o,i,n,a){return Object(E["openBlock"])(),Object(E["createBlock"])(E["Transition"],{name:"toast"===e.type?"slow-fade-out":void 0,onAfterLeave:t[1]||(t[1]=t=>e.toastClosed())},{default:Object(E["withCtx"])(()=>[e.deleted?Object(E["createCommentVNode"])("",!0):(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",si,[Object(E["createVNode"])(E["Transition"],{name:"toast"===e.type?"toast-slide-up":void 0,appear:""},{default:Object(E["withCtx"])(()=>[Object(E["createElementVNode"])("div",null,[Object(E["createVNode"])(E["Transition"],{name:e.animate?"fade-in":void 0,appear:""},{default:Object(E["withCtx"])(()=>[Object(E["createElementVNode"])("div",{class:Object(E["normalizeClass"])(["notification system",e.cssClasses]),style:Object(E["normalizeStyle"])(e.style),ref:"root","data-notification-instance-id":e.notificationInstanceId},[e.canClose?(Object(E["openBlock"])(),Object(E["createElementBlock"])("button",{key:0,type:"button",class:"close","data-dismiss":"alert",onClick:t[0]||(t[0]=t=>e.closeNotification(t))}," × ")):Object(E["createCommentVNode"])("",!0),e.title?(Object(E["openBlock"])(),Object(E["createElementBlock"])("strong",ci,Object(E["toDisplayString"])(e.title),1)):Object(E["createCommentVNode"])("",!0),Object(E["createElementVNode"])("div",di,[e.message?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{key:0,innerHTML:e.$sanitize(e.message)},null,8,ui)):Object(E["createCommentVNode"])("",!0),e.message?Object(E["createCommentVNode"])("",!0):(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",mi,[Object(E["renderSlot"])(e.$slots,"default")]))])],14,li)]),_:3},8,["name"])])]),_:3},8,["name"])]))]),_:3},8,["name"])}const{$:hi}=window;var gi=Object(E["defineComponent"])({props:{notificationId:String,notificationInstanceId:String,title:String,context:String,type:String,noclear:Boolean,toastLength:{type:Number,default:12e3},style:[String,Object],animate:Boolean,message:String,cssClass:String},computed:{cssClasses(){const e={};return this.context&&(e["notification-"+this.context]=!0),this.cssClass&&(e[this.cssClass]=!0),e},canClose(){return"persistent"===this.type||!this.noclear}},emits:["closed"],data(){return{deleted:!1}},mounted(){const e=()=>{setTimeout(()=>{this.deleted=!0},this.toastLength)};"toast"===this.type&&e(),this.style&&hi(this.$refs.root).css(this.style)},methods:{toastClosed(){Object(E["nextTick"])(()=>{this.$emit("closed")})},closeNotification(e){this.canClose&&e&&e.target&&(this.deleted=!0,Object(E["nextTick"])(()=>{this.$emit("closed")})),this.markNotificationAsRead()},markNotificationAsRead(){this.notificationId&&K.post({module:"CoreHome",action:"markNotificationAsRead"},{notificationId:this.notificationId},{withTokenInUrl:!0})}}});gi.render=pi;var bi=gi;const fi={class:"notification-group"},vi=["innerHTML"];function Oi(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("Notification");return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",fi,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.notifications,(t,o)=>(Object(E["openBlock"])(),Object(E["createBlock"])(r,{key:t.id||"no-id-"+o,"notification-id":t.id,title:t.title,context:t.context,type:t.type,noclear:t.noclear,"toast-length":t.toastLength,style:Object(E["normalizeStyle"])(t.style),animate:t.animate,message:t.message,"notification-instance-id":t.notificationInstanceId,"css-class":t.class,onClosed:o=>e.removeNotification(t.id)},{default:Object(E["withCtx"])(()=>[Object(E["createElementVNode"])("div",{innerHTML:e.$sanitize(t.message)},null,8,vi)]),_:2},1032,["notification-id","title","context","type","noclear","toast-length","style","animate","message","notification-instance-id","css-class","onClosed"]))),128))])}function ji(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/const{$:yi}=window;class wi{constructor(){ji(this,"privateState",Object(E["reactive"])({notifications:[]})),ji(this,"nextNotificationId",0)}get state(){return Object(E["readonly"])(this.privateState)}appendNotification(e){this.checkMessage(e.message),e.id&&this.remove(e.id),this.privateState.notifications.push(e)}prependNotification(e){this.checkMessage(e.message),e.id&&this.remove(e.id),this.privateState.notifications.unshift(e)}remove(e){this.privateState.notifications=this.privateState.notifications.filter(t=>t.id!==e)}parseNotificationDivs(){const e=yi('[data-role="notification"]'),t=[];e.each((o,i)=>{const n=yi(i),a=n.data(),r=n.html();r&&t.push(Object.assign(Object.assign({},a),{},{message:r,animate:!1})),e.remove()}),t.forEach(e=>this.show(e))}clearTransientNotifications(){this.privateState.notifications=this.privateState.notifications.filter(e=>"transient"!==e.type)}show(e){this.checkMessage(e.message);let t=e.prepend?this.prependNotification:this.appendNotification,o="#notificationContainer";if(e.placeat)o=e.placeat;else{const e=".modal.open .modal-content",i=document.querySelector(e);i&&(i.querySelector("#modalNotificationContainer")||yi(i).prepend(''),o=e+" #modalNotificationContainer",t=this.prependNotification)}const i=e.group||(o?o.toString():"");this.initializeNotificationContainer(o,i);const n=(this.nextNotificationId+=1).toString();return t.call(this,Object.assign(Object.assign({},e),{},{noclear:!!e.noclear,group:i,notificationId:e.id,notificationInstanceId:n,type:e.type||"transient"})),n}scrollToNotification(e){setTimeout(()=>{const t=document.querySelector(`[data-notification-instance-id='${e}']`);t&&M.helper.lazyScrollTo(t,250)})}toast(e){this.checkMessage(e.message);const t=e.placeat?yi(e.placeat):void 0;if(!t||!t.length)throw new Error("A valid selector is required for the placeat option when using Notification.toast().");const o=document.createElement("div");o.style.position="absolute",o.style.top=t.offset().top+"px",o.style.left=t.offset().left+"px",o.style.zIndex="1000",document.body.appendChild(o);const i=me({render:()=>Object(E["createVNode"])(bi,Object.assign(Object.assign({},e),{},{notificationId:e.id,type:"toast",onClosed:()=>{i.unmount()}}))});i.mount(o)}initializeNotificationContainer(e,t){if(!e)return;const o=yi(e);if(o.children(".notification-group").length)return;const i=window.CoreHome.NotificationGroup,n=me({template:'',data:()=>({group:t})});n.component("NotificationGroup",i),n.mount(o[0])}checkMessage(e){if(!e)throw new Error("No message given, cannot display notification")}}const Si=new wi;var ki=Si;yi(()=>Si.parseNotificationDivs());var Ci=Object(E["defineComponent"])({props:{group:String},components:{Notification:bi},computed:{notifications(){return ki.state.notifications.filter(e=>this.group?this.group===e.group:!e.group)}},methods:{removeNotification(e){ki.remove(e)}}});Ci.render=Oi;var Ei=Ci;
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/const Di=Object(E["createElementVNode"])("span",{class:"icon-help"},null,-1),Pi=[Di];function Ti(e,t,o,i,n,a){return Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{class:"item-help-icon",tabindex:"5",href:"javascript:",onClick:t[0]||(t[0]=(...t)=>e.showHelp&&e.showHelp(...t))},Pi)}const Vi="reportingMenu-help";var Ni=Object(E["defineComponent"])({props:{message:{type:String,required:!0},name:{type:String,required:!0}},data(){return{currentName:""}},methods:{showHelp(){if(""!==this.currentName)return ki.remove(Vi),void(this.currentName="");ki.show({context:"info",id:Vi,type:"help",noclear:!0,class:"help-notification",message:this.message,placeat:"#notificationContainer",prepend:!0}),""!==this.name&&(this.currentName=this.name)}}});Ni.render=Ti;var xi=Ni;function Bi(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/class Mi{constructor(){Bi(this,"state",Object(E["reactive"])({initialSites:[],isInitialized:!1})),Bi(this,"stateFiltered",Object(E["reactive"])({initialSites:[],isInitialized:!1,excludedSites:[],onlySitesWithAdminAccess:!1,onlySitesWithAtLeastWriteAccess:!1,siteTypesToExclude:[]})),Bi(this,"currentRequestAbort",null),Bi(this,"limitRequest",void 0),Bi(this,"initialSites",Object(E["computed"])(()=>Object(E["readonly"])(this.state.initialSites))),Bi(this,"initialSitesFiltered",Object(E["computed"])(()=>Object(E["readonly"])(this.stateFiltered.initialSites)))}isFiltered(e=!1,t=[],o=!1,i=[]){return t.length>0||e||o||i.length>0}matchesCurrentFilteredState(e=!1,t=[],o=!1,i=[]){return!this.stateFiltered.isInitialized&&!this.isFiltered(e,t,o,i)||this.stateFiltered.isInitialized&&t.length===this.stateFiltered.excludedSites.length&&t.every((e,t)=>e===this.stateFiltered.excludedSites[t])&&e===this.stateFiltered.onlySitesWithAdminAccess&&o===this.stateFiltered.onlySitesWithAtLeastWriteAccess&&i.length===this.stateFiltered.siteTypesToExclude.length&&i.every((e,t)=>e===this.stateFiltered.siteTypesToExclude[t])}loadInitialSites(e=!1,t=[],o=!1,i=[]){return this.state.isInitialized&&!this.isFiltered(e,t,o,i)?Promise.resolve(Object(E["readonly"])(this.state.initialSites)):this.stateFiltered.isInitialized&&this.matchesCurrentFilteredState(e,t,o,i)?Promise.resolve(Object(E["readonly"])(this.stateFiltered.initialSites)):this.isFiltered(e,t,o,i)?this.searchSite("%",e,t,o,i).then(n=>(this.stateFiltered.isInitialized=!0,this.stateFiltered.excludedSites=t,this.stateFiltered.onlySitesWithAdminAccess=e,this.stateFiltered.onlySitesWithAtLeastWriteAccess=o,this.stateFiltered.siteTypesToExclude=i,null!==n&&(this.stateFiltered.initialSites=n),n)):this.state.isInitialized?Promise.resolve(Object(E["readonly"])(this.state.initialSites)):this.searchSite("%",e,t,o,i).then(e=>(this.state.isInitialized=!0,null!==e&&(this.state.initialSites=e),e))}loadSite(e){"all"===e?H.updateUrl(Object.assign(Object.assign({},H.urlParsed.value),{},{module:"MultiSites",action:"index",date:H.parsed.value.date,period:H.parsed.value.period})):H.updateUrl(Object.assign(Object.assign({},H.urlParsed.value),{},{segment:"",idSite:e}),Object.assign(Object.assign({},H.hashParsed.value),{},{segment:"",idSite:e}))}searchSite(e,t=!1,o=[],i=!1,n=[]){return e?(this.currentRequestAbort&&this.currentRequestAbort.abort(),this.limitRequest||(this.limitRequest=K.fetch({method:"SitesManager.getNumWebsitesToDisplayPerPage"})),this.limitRequest.then(a=>{const r=a.value;let s="view";return t?s="admin":i&&(s="write"),this.currentRequestAbort=new AbortController,K.fetch({method:"SitesManager.getSitesWithMinimumAccess",permission:s,limit:r,pattern:e,sitesToExclude:o,siteTypesToExclude:n},{abortController:this.currentRequestAbort,abortable:!1})}).then(e=>e?this.processWebsitesList(e):null).finally(()=>{this.currentRequestAbort=null})):this.loadInitialSites(t,o,i,n)}processWebsitesList(e){let t=e;return t&&t.length?(t=t.map(e=>Object.assign(Object.assign({},e),{},{name:e.group?`[${e.group}] ${e.name}`:e.name})),t.sort((e,t)=>e.name.toLowerCase()t.name.toLowerCase()?1:0),t):[]}}var Ii=new Mi;const Fi=["value","name"],Li=["title"],Ai=["textContent"],_i={key:1,class:"placeholder"},Ri={class:"dropdown"},Hi={class:"custom_select_search"},$i=["placeholder"],Ui={key:0},qi={class:"custom_select_container"},Wi=["onClick"],zi=["innerHTML","href","title"],Gi={class:"custom_select_ul_list"},Yi={class:"noresult"},Ji={key:1};function Ki(e,t,o,i,n,a){var r,s,l,c;const d=Object(E["resolveComponent"])("AllSitesLink"),u=Object(E["resolveDirective"])("tooltips"),m=Object(E["resolveDirective"])("focus-if"),p=Object(E["resolveDirective"])("focus-anywhere-but-here");return Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{class:Object(E["normalizeClass"])(["siteSelector piwikSelector borderedControl",{expanded:e.showSitesList,disabled:!e.hasMultipleSites}])},[e.name?(Object(E["openBlock"])(),Object(E["createElementBlock"])("input",{key:0,type:"hidden",value:null===(r=e.displayedModelValue)||void 0===r?void 0:r.id,name:e.name},null,8,Fi)):Object(E["createCommentVNode"])("",!0),Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{ref:"selectorLink",onClick:t[0]||(t[0]=(...t)=>e.onClickSelector&&e.onClickSelector(...t)),onKeydown:t[1]||(t[1]=t=>e.onPressEnter(t)),href:"javascript:void(0)",class:Object(E["normalizeClass"])([{loading:e.isLoading},"title"]),tabindex:"4",title:e.selectorLinkTitle},[Object(E["createElementVNode"])("span",{class:Object(E["normalizeClass"])(["icon icon-chevron-down",{iconHidden:e.isLoading,collapsed:!e.showSitesList}])},null,2),Object(E["createElementVNode"])("span",null,[null!==(s=e.displayedModelValue)&&void 0!==s&&s.name||!e.placeholder?(Object(E["openBlock"])(),Object(E["createElementBlock"])("span",{key:0,textContent:Object(E["toDisplayString"])((null===(l=e.displayedModelValue)||void 0===l?void 0:l.name)||e.firstSiteName)},null,8,Ai)):Object(E["createCommentVNode"])("",!0),null!==(c=e.displayedModelValue)&&void 0!==c&&c.name||!e.placeholder?Object(E["createCommentVNode"])("",!0):(Object(E["openBlock"])(),Object(E["createElementBlock"])("span",_i,Object(E["toDisplayString"])(e.placeholder),1))])],42,Li)),[[u]]),Object(E["withDirectives"])(Object(E["createElementVNode"])("div",Ri,[Object(E["withDirectives"])(Object(E["createElementVNode"])("div",Hi,[Object(E["withDirectives"])(Object(E["createElementVNode"])("input",{type:"text",onClick:t[2]||(t[2]=t=>{e.searchTerm="",e.loadInitialSites()}),"onUpdate:modelValue":t[3]||(t[3]=t=>e.searchTerm=t),tabindex:"4",class:"websiteSearch inp browser-default",placeholder:e.translate("General_Search")},null,8,$i),[[E["vModelText"],e.searchTerm],[m,{focused:e.shouldFocusOnSearch}]]),Object(E["withDirectives"])(Object(E["createElementVNode"])("img",{title:"Clear",onClick:t[4]||(t[4]=t=>{e.searchTerm="",e.loadInitialSites()}),class:"reset",src:"plugins/CoreHome/images/reset_search.png"},null,512),[[E["vShow"],e.searchTerm]])],512),[[E["vShow"],e.autocompleteMinSites<=e.sites.length||e.searchTerm]]),"top"===e.allSitesLocation&&e.showAllSitesItem?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Ui,[Object(E["createVNode"])(d,{href:e.urlAllSites,"all-sites-text":e.allSitesText,onClick:t[5]||(t[5]=t=>e.onAllSitesClick(t))},null,8,["href","all-sites-text"])])):Object(E["createCommentVNode"])("",!0),Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("div",qi,[Object(E["createElementVNode"])("ul",{class:"custom_select_ul_list",onClick:t[7]||(t[7]=t=>e.showSitesList=!1)},[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.sites,(o,i)=>Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{onClick:t=>e.switchSite(Object.assign(Object.assign({},o),{},{id:o.idsite}),t),key:i},[Object(E["createElementVNode"])("a",{onClick:t[6]||(t[6]=e=>e.preventDefault()),innerHTML:e.$sanitize(e.getMatchedSiteName(o.name)),tabindex:"4",href:e.getUrlForSiteId(o.idsite),title:o.name},null,8,zi)],8,Wi)),[[E["vShow"],!(!e.showSelectedSite&&""+e.activeSiteId===""+o.idsite)]])),128))]),Object(E["withDirectives"])(Object(E["createElementVNode"])("ul",Gi,[Object(E["createElementVNode"])("li",null,[Object(E["createElementVNode"])("div",Yi,Object(E["toDisplayString"])(e.translate("SitesManager_NotFound")+" "+e.searchTerm),1)])],512),[[E["vShow"],!e.sites.length&&e.searchTerm]])])),[[u,{content:e.tooltipContent}]]),"bottom"===e.allSitesLocation&&e.showAllSitesItem?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Ji,[Object(E["createVNode"])(d,{href:e.urlAllSites,"all-sites-text":e.allSitesText,onClick:t[8]||(t[8]=t=>e.onAllSitesClick(t))},null,8,["href","all-sites-text"])])):Object(E["createCommentVNode"])("",!0)],512),[[E["vShow"],e.showSitesList]])],2)),[[p,{blur:e.onBlur}]])}const Qi=["innerHTML","href"];function Xi(e,t,o,i,n,a){return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{onClick:t[1]||(t[1]=e=>this.onClick(e)),class:"custom_select_all"},[Object(E["createElementVNode"])("a",{onClick:t[0]||(t[0]=e=>e.preventDefault()),innerHTML:e.$sanitize(e.allSitesText),tabindex:"4",href:e.href},null,8,Qi)])}var Zi=Object(E["defineComponent"])({props:{href:String,allSitesText:String},emits:["click"],methods:{onClick(e){this.$emit("click",e)}}});Zi.render=Xi;var en=Zi,tn=Object(E["defineComponent"])({props:{modelValue:Object,showSelectedSite:{type:Boolean,default:!1},showAllSitesItem:{type:Boolean,default:!0},switchSiteOnSelect:{type:Boolean,default:!0},onlySitesWithAdminAccess:{type:Boolean,default:!1},name:{type:String,default:""},allSitesText:{type:String,default:a("General_MultiSitesSummary")},allSitesLocation:{type:String,default:"bottom"},placeholder:String,defaultToFirstSite:Boolean,sitesToExclude:{type:Array,default:()=>[]},onlySitesWithAtLeastWriteAccess:{type:Boolean,default:!1},siteTypesToExclude:{type:Array,default:()=>[]}},emits:["update:modelValue","blur"],components:{AllSitesLink:en},directives:{FocusAnywhereButHere:Je,FocusIf:Qe,Tooltips:tt},watch:{searchTerm(){this.onSearchTermChanged()}},data(){return{searchTerm:"",activeSiteId:""+M.idSite,showSitesList:!1,isLoading:!1,sites:[],autocompleteMinSites:parseInt(M.config.autocomplete_min_sites,10)}},created(){this.searchSite=we(this.searchSite),!this.modelValue&&M.idSite&&this.$emit("update:modelValue",{id:M.idSite,name:M.helper.htmlDecode(M.siteName)})},mounted(){window.initTopControls(),this.loadInitialSites().then(()=>{this.shouldDefaultToFirstSite&&this.$emit("update:modelValue",{id:this.sites[0].idsite,name:this.sites[0].name})});const e=a("CoreHome_ShortcutWebsiteSelector");M.helper.registerShortcut("w",e,e=>{if(e.altKey)return;e.preventDefault?e.preventDefault():e.returnValue=!1;const t=this.$refs.selectorLink;t&&(t.click(),t.focus())})},computed:{shouldFocusOnSearch(){return this.showSitesList&&this.autocompleteMinSites<=this.sites.length||this.searchTerm},selectorLinkTitle(){return this.hasMultipleSites&&this.displayedModelValue?a("CoreHome_ChangeCurrentWebsite",this.htmlEntities(this.displayedModelValue.name)):""},hasMultipleSites(){const e=Ii.matchesCurrentFilteredState(this.onlySitesWithAdminAccess,this.sitesToExclude?this.sitesToExclude:[],this.onlySitesWithAtLeastWriteAccess,this.siteTypesToExclude?this.siteTypesToExclude:[])&&Ii.initialSitesFiltered.value&&Ii.initialSitesFiltered.value.length?Ii.initialSitesFiltered.value:Ii.initialSites.value;return e&&e.length>1},firstSiteName(){const e=Ii.initialSitesFiltered.value&&Ii.initialSitesFiltered.value.length?Ii.initialSitesFiltered.value:Ii.initialSites.value;return e&&e.length>0?e[0].name:""},urlAllSites(){const e=H.stringify(Object.assign(Object.assign({},H.urlParsed.value),{},{module:"MultiSites",action:"index",date:H.parsed.value.date,period:H.parsed.value.period}));return"?"+e},shouldDefaultToFirstSite(){var e;return!(null!==(e=this.modelValue)&&void 0!==e&&e.id)&&(!this.hasMultipleSites||this.defaultToFirstSite)&&this.sites[0]},displayedModelValue(){return this.modelValue?this.modelValue:M.idSite?{id:M.idSite,name:M.helper.htmlDecode(M.siteName)}:this.shouldDefaultToFirstSite?{id:this.sites[0].idsite,name:this.sites[0].name}:null},tooltipContent(){return function(){const e=$(this).attr("title")||"";return M.helper.htmlEntities(e)}}},methods:{onSearchTermChanged(){this.searchTerm?(this.isLoading=!0,this.searchSite(this.searchTerm)):(this.isLoading=!1,this.loadInitialSites())},onAllSitesClick(e){this.switchSite({id:"all",name:this.$props.allSitesText},e),this.showSitesList=!1},switchSite(e,t){const o=-1!==navigator.userAgent.indexOf("Mac OS X")?t.metaKey:t.ctrlKey;t&&o&&t.target&&t.target.href?window.open(t.target.href,"_blank"):(this.$emit("update:modelValue",{id:e.id,name:e.name}),this.switchSiteOnSelect&&this.activeSiteId!==e.id&&Ii.loadSite(e.id))},onBlur(){this.showSitesList=!1,this.$emit("blur")},onClickSelector(){this.hasMultipleSites&&(this.showSitesList=!this.showSitesList,this.isLoading||this.searchTerm||this.loadInitialSites())},onPressEnter(e){"Enter"===e.key&&(e.preventDefault(),this.showSitesList=!this.showSitesList,this.showSitesList&&!this.isLoading&&this.loadInitialSites())},getMatchedSiteName(e){const t=e.toUpperCase().indexOf(this.searchTerm.toUpperCase());if(-1===t||this.isLoading)return this.htmlEntities(e);const o=this.htmlEntities(e.substring(0,t)),i=this.htmlEntities(e.substring(t+this.searchTerm.length));return`${o}${this.searchTerm}${i}`},loadInitialSites(){return Ii.loadInitialSites(this.onlySitesWithAdminAccess,this.sitesToExclude?this.sitesToExclude:[],this.onlySitesWithAtLeastWriteAccess,this.siteTypesToExclude?this.siteTypesToExclude:[]).then(e=>{this.sites=e||[]})},searchSite(e){this.isLoading=!0,Ii.searchSite(e,this.onlySitesWithAdminAccess,this.sitesToExclude?this.sitesToExclude:[],this.onlySitesWithAtLeastWriteAccess,this.siteTypesToExclude?this.siteTypesToExclude:[]).then(t=>{e===this.searchTerm&&t&&(this.sites=t)}).finally(()=>{this.isLoading=!1})},getUrlForSiteId(e){const t=H.stringify(Object.assign(Object.assign({},H.urlParsed.value),{},{segment:"",idSite:e})),o=H.stringify(Object.assign(Object.assign({},H.hashParsed.value),{},{segment:"",idSite:e}));return`?${t}#?${o}`},htmlEntities(e){return M.helper.htmlEntities(e)}}});tn.render=Ki;var on=tn;const nn={ref:"root",class:"quickAccessInside"},an=["title","placeholder"],rn={class:"dropdown"},sn={class:"no-result"},ln=["onClick"],cn=["onMouseenter","onClick"],dn={class:"quickAccessMatomoSearch"},un=["onMouseenter","onClick"],mn=["textContent"],pn={class:"quick-access-category helpCategory"},hn=["href"];function gn(e,t,o,i,n,a){const r=Object(E["resolveDirective"])("focus-if"),s=Object(E["resolveDirective"])("tooltips"),l=Object(E["resolveDirective"])("focus-anywhere-but-here");return Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("div",nn,[Object(E["createElementVNode"])("span",{class:"icon-search",onMouseenter:t[0]||(t[0]=t=>e.searchActive=!0)},null,32),Object(E["withDirectives"])(Object(E["createElementVNode"])("input",{class:"s",onKeydown:t[1]||(t[1]=t=>e.onKeypress(t)),onFocus:t[2]||(t[2]=t=>e.searchActive=!0),"onUpdate:modelValue":t[3]||(t[3]=t=>e.searchTerm=t),type:"text",tabindex:"2",title:e.quickAccessTitle,placeholder:e.translate("General_Search"),ref:"input"},null,40,an),[[E["vModelText"],e.searchTerm],[r,{focused:e.searchActive}],[s]]),Object(E["withDirectives"])(Object(E["createElementVNode"])("div",rn,[Object(E["withDirectives"])(Object(E["createElementVNode"])("ul",null,[Object(E["createElementVNode"])("li",sn,Object(E["toDisplayString"])(e.translate("General_SearchNoResults")),1)],512),[[E["vShow"],!(e.numMenuItems>0||e.sites.length)]]),(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.menuItems,t=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("ul",{key:t.title},[Object(E["createElementVNode"])("li",{class:"quick-access-category",onClick:o=>{e.searchTerm=t.title,e.searchMenu(e.searchTerm)}},Object(E["toDisplayString"])(t.title),9,ln),(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(t.items,t=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{class:Object(E["normalizeClass"])(["result",{selected:t.menuIndex===e.searchIndex}]),onMouseenter:o=>e.searchIndex=t.menuIndex,onClick:o=>e.selectMenuItem(t.index),key:t.index},[Object(E["createElementVNode"])("a",null,Object(E["toDisplayString"])(t.name.trim()),1)],42,cn))),128))]))),128)),Object(E["createElementVNode"])("ul",dn,[Object(E["withDirectives"])(Object(E["createElementVNode"])("li",{class:"quick-access-category websiteCategory"},Object(E["toDisplayString"])(e.translate("SitesManager_Sites")),513),[[E["vShow"],e.hasSitesSelector&&e.sites.length||e.isLoading]]),Object(E["withDirectives"])(Object(E["createElementVNode"])("li",{class:"no-result"},Object(E["toDisplayString"])(e.translate("MultiSites_LoadingWebsites")),513),[[E["vShow"],e.hasSitesSelector&&e.isLoading]]),(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.sites,(t,o)=>Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{class:Object(E["normalizeClass"])(["result",{selected:e.numMenuItems+o===e.searchIndex}]),onMouseenter:t=>e.searchIndex=e.numMenuItems+o,onClick:o=>e.selectSite(t.idsite),key:t.idsite},[Object(E["createElementVNode"])("a",{textContent:Object(E["toDisplayString"])(t.name)},null,8,mn)],42,un)),[[E["vShow"],e.hasSitesSelector&&!e.isLoading]])),128))]),Object(E["createElementVNode"])("ul",null,[Object(E["createElementVNode"])("li",pn,Object(E["toDisplayString"])(e.translate("General_HelpResources")),1),Object(E["createElementVNode"])("li",{class:Object(E["normalizeClass"])([{selected:"help"===e.searchIndex},"quick-access-help"]),onMouseenter:t[4]||(t[4]=t=>e.searchIndex="help")},[Object(E["createElementVNode"])("a",{href:"https://matomo.org?mtm_campaign=App_Help&mtm_source=Matomo_App&mtm_keyword=QuickSearch&s="+encodeURIComponent(e.searchTerm),target:"_blank"},Object(E["toDisplayString"])(e.translate("CoreHome_SearchOnMatomo",e.searchTerm)),9,hn)],34)])],512),[[E["vShow"],e.searchTerm&&e.searchActive]])])),[[l,{blur:e.onBlur}]])}const{ListingFormatter:bn}=window;function fn(e){const t=e.getBoundingClientRect(),o=window.$(window);return t.top>=0&&t.left>=0&&t.bottom<=o.height()&&t.right<=o.width()}function vn(e){e&&e.scrollIntoView&&e.scrollIntoView()}var On=Object(E["defineComponent"])({directives:{FocusAnywhereButHere:Je,FocusIf:Qe,Tooltips:tt},watch:{searchActive(e){const t=this.$refs.root;if(!t||!t.parentElement)return;const o=t.parentElement.classList;o.toggle("active",e),o.toggle("expanded",e)}},mounted(){const e=this.$refs.root;e&&e.parentElement&&e.parentElement.classList.add("quick-access","piwikSelector"),"undefined"!==typeof window.initTopControls&&window.initTopControls&&window.initTopControls(),M.helper.registerShortcut("f",a("CoreHome_ShortcutSearch"),e=>{e.altKey||(e.preventDefault(),vn(this.$refs.root),this.activateSearch())})},data(){const e=!!document.querySelector(".segmentEditorPanel");return{menuItems:[],numMenuItems:0,searchActive:!1,searchTerm:"",searchIndex:0,menuIndexCounter:-1,topMenuItems:null,leftMenuItems:null,segmentItems:null,hasSegmentSelector:e,sites:[],isLoading:!1}},created(){this.searchMenu=we(this.searchMenu.bind(this))},computed:{hasSitesSelector(){return!!document.querySelector('.top_controls .siteSelector,.top_controls [vue-entry="CoreHome.SiteSelector"]')},quickAccessTitle(){const e=[a("CoreHome_MenuEntries")];return this.hasSegmentSelector&&e.push(a("CoreHome_Segments")),this.hasSitesSelector&&e.push(a("SitesManager_Sites")),a("CoreHome_QuickAccessTitle",bn.formatAnd(e))}},emits:["itemSelected","blur"],methods:{onKeypress(e){const t=this.searchTerm&&this.searchActive,o=9===e.which,i=27===e.which;38===e.which?(this.highlightPreviousItem(),e.preventDefault()):40===e.which?(this.highlightNextItem(),e.preventDefault()):13===e.which?this.clickQuickAccessMenuItem():o&&t||i&&t?this.deactivateSearch():setTimeout(()=>{this.searchActive=!0,this.searchMenu(this.searchTerm)})},highlightPreviousItem(){this.searchIndex-1<0?this.searchIndex=0:this.searchIndex-=1,this.makeSureSelectedItemIsInViewport()},highlightNextItem(){const e=this.$refs.root.querySelectorAll("li.result").length;e<=this.searchIndex+1?this.searchIndex=e-1:this.searchIndex+=1,this.makeSureSelectedItemIsInViewport()},clickQuickAccessMenuItem(){const e=this.getCurrentlySelectedElement();e&&setTimeout(()=>{e.click(),this.$emit("itemSelected",e)},20)},deactivateSearch(){this.searchTerm="",this.searchActive=!1,this.$refs.input&&this.$refs.input.blur()},makeSureSelectedItemIsInViewport(){const e=this.getCurrentlySelectedElement();e&&!fn(e)&&vn(e)},getCurrentlySelectedElement(){const e=this.$refs.root.querySelectorAll("li.result");if(e&&e.length&&e.item(this.searchIndex))return e.item(this.searchIndex)},searchMenu(e){const t=e.toLowerCase();let o=-1;const i={},n=[],a=e=>{const t=Object.assign({},e);o+=1,t.menuIndex=o;const{category:a}=t;a in i||(n.push({title:a,items:[]}),i[a]=n.length-1);const r=i[a];n[r].items.push(t)};this.resetSearchIndex(),this.hasSitesSelector&&(this.isLoading=!0,Ii.searchSite(t).then(e=>{e&&(this.sites=e)}).finally(()=>{this.isLoading=!1}));const r=e=>-1!==e.name.toLowerCase().indexOf(t)||-1!==e.category.toLowerCase().indexOf(t);null===this.topMenuItems&&(this.topMenuItems=this.getTopMenuItems()),null===this.leftMenuItems&&(this.leftMenuItems=this.getLeftMenuItems()),null===this.segmentItems&&(this.segmentItems=this.getSegmentItems());const s=this.topMenuItems.filter(r),l=this.leftMenuItems.filter(r),c=this.segmentItems.filter(r);s.forEach(a),l.forEach(a),c.forEach(a),this.numMenuItems=s.length+l.length+c.length,this.menuItems=n},resetSearchIndex(){this.searchIndex=0,this.makeSureSelectedItemIsInViewport()},selectSite(e){Ii.loadSite(e)},selectMenuItem(e){const t=document.querySelector(`[quick_access='${e}']`);if(t){this.deactivateSearch();const e=t.getAttribute("href");if(e&&e.length>10&&t&&t.click)try{t.click()}catch(o){window.$(t).click()}else window.$(t).click()}},onBlur(){this.searchActive=!1,this.$emit("blur")},activateSearch(){this.searchActive=!0},getTopMenuItems(){const e=a("CoreHome_Menu"),t=[];return document.querySelectorAll("nav .sidenav li > a, nav .sidenav li > div > a").forEach(o=>{var i;let n=null===(i=o.textContent)||void 0===i?void 0:i.trim();var a;(!n||null!=o.parentElement&&null!=o.parentElement.tagName&&"DIV"===o.parentElement.tagName)&&(n=null===(a=o.getAttribute("title"))||void 0===a?void 0:a.trim());n&&(t.push({name:n,index:this.menuIndexCounter+=1,category:e}),o.setAttribute("quick_access",""+this.menuIndexCounter))}),t},getLeftMenuItems(){const e=[];return document.querySelectorAll("#secondNavBar .menuTab").forEach(t=>{var o;const i=window.$(t).find("> .item");let n=(null===(o=i[0])||void 0===o?void 0:o.innerText.trim())||"";n&&-1!==n.lastIndexOf("\n")&&(n=n.slice(0,n.lastIndexOf("\n")).trim()),window.$(t).find("li .item").each((t,o)=>{var i;const a=null===(i=o.textContent)||void 0===i?void 0:i.trim();a&&(e.push({name:a,category:n,index:this.menuIndexCounter+=1}),o.setAttribute("quick_access",""+this.menuIndexCounter))})}),e},getSegmentItems(){if(!this.hasSegmentSelector)return[];const e=a("CoreHome_Segments"),t=[];return document.querySelectorAll(".segmentList [data-idsegment]").forEach(o=>{var i;const n=null===(i=o.querySelector(".segname"))||void 0===i||null===(i=i.textContent)||void 0===i?void 0:i.trim();n&&(t.push({name:n,category:e,index:this.menuIndexCounter+=1}),o.setAttribute("quick_access",""+this.menuIndexCounter))}),t}}});On.render=gn;var jn=On;const yn={class:"fieldArray form-group"},wn={key:0,class:"fieldUiControl"},Sn=["onClick","title"];function kn(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("Field");return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",yn,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.modelValue,(t,o)=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{class:Object(E["normalizeClass"])(["fieldArrayTable multiple valign-wrapper",{["fieldArrayTable"+o]:!0}]),key:o},[e.field.uiControl?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",wn,[Object(E["createVNode"])(r,{"full-width":!0,"model-value":t,options:e.field.availableValues,"onUpdate:modelValue":t=>e.onEntryChange(t,o),"model-modifiers":e.field.modelModifiers,placeholder:" ",uicontrol:e.field.uiControl,title:e.field.title,name:`${e.name}-${o}`,id:`${e.id}-${o}`,"template-file":e.field.templateFile,component:e.field.component},null,8,["model-value","options","onUpdate:modelValue","model-modifiers","uicontrol","title","name","id","template-file","component"])])):Object(E["createCommentVNode"])("",!0),Object(E["withDirectives"])(Object(E["createElementVNode"])("span",{onClick:t=>e.removeEntry(o),class:"icon-minus valign",title:e.translate("General_Remove")},null,8,Sn),[[E["vShow"],o+1!==e.modelValue.length]])],2))),128))])}const Cn=ve("CorePluginsAdmin","Field");var En=Object(E["defineComponent"])({props:{modelValue:Array,name:String,id:String,field:Object,rows:String},components:{Field:Cn},emits:["update:modelValue"],watch:{modelValue(e){this.checkEmptyModelValue(e)}},mounted(){this.checkEmptyModelValue(this.modelValue)},methods:{checkEmptyModelValue(e){e&&e.length&&""===e.slice(-1)[0]||this.rows&&!((this.modelValue||[]).length-1&&this.modelValue){const t=this.modelValue.filter((t,o)=>o!==e);this.$emit("update:modelValue",t)}}}});En.render=kn;var Dn=En;const Pn={class:"multiPairField form-group"},Tn={key:1,class:"fieldUiControl fieldUiControl2"},Vn={key:2,class:"fieldUiControl fieldUiControl3"},Nn={key:3,class:"fieldUiControl fieldUiControl4"},xn=["onClick","title"];function Bn(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("Field");return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Pn,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.modelValue,(t,o)=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{class:Object(E["normalizeClass"])(["multiPairFieldTable multiple valign-wrapper",{["multiPairFieldTable"+o]:!0,[`has${e.fieldCount}Fields`]:!0}]),key:o},[e.field1?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{key:0,class:Object(E["normalizeClass"])(["fieldUiControl fieldUiControl1",{hasMultiFields:e.field1.type&&e.field2.type}])},[Object(E["createVNode"])(r,{"full-width":!0,"model-value":t[e.field1.key],options:e.field1.availableValues,"onUpdate:modelValue":t=>e.onEntryChange(o,e.field1.key,t),"model-modifiers":e.field1.modelModifiers,placeholder:" ",uicontrol:e.field1.uiControl,name:`${e.name}-p1-${o}`,id:`${e.id}-p1-${o}`,title:e.field1.title,"template-file":e.field1.templateFile,component:e.field1.component},null,8,["model-value","options","onUpdate:modelValue","model-modifiers","uicontrol","name","id","title","template-file","component"])],2)):Object(E["createCommentVNode"])("",!0),e.field2?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Tn,[Object(E["createVNode"])(r,{"full-width":!0,options:e.field2.availableValues,"onUpdate:modelValue":t=>e.onEntryChange(o,e.field2.key,t),"model-value":t[e.field2.key],"model-modifiers":e.field2.modelModifiers,placeholder:" ",uicontrol:e.field2.uiControl,name:`${e.name}-p2-${o}`,id:`${e.id}-p2-${o}`,title:e.field2.title,"template-file":e.field2.templateFile,component:e.field2.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","name","id","title","template-file","component"])])):Object(E["createCommentVNode"])("",!0),e.field3?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Vn,[Object(E["createVNode"])(r,{"full-width":!0,options:e.field3.availableValues,"onUpdate:modelValue":t=>e.onEntryChange(o,e.field3.key,t),"model-value":t[e.field3.key],"model-modifiers":e.field3.modelModifiers,placeholder:" ",uicontrol:e.field3.uiControl,name:`${e.name}-p3-${o}`,id:`${e.id}-p3-${o}`,title:e.field3.title,"template-file":e.field3.templateFile,component:e.field3.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","name","id","title","template-file","component"])])):Object(E["createCommentVNode"])("",!0),e.field4?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Nn,[Object(E["createVNode"])(r,{"full-width":!0,options:e.field4.availableValues,"onUpdate:modelValue":t=>e.onEntryChange(o,e.field4.key,t),"model-value":t[e.field4.key],"model-modifiers":e.field4.modelModifiers,placeholder:" ",uicontrol:e.field4.uiControl,name:`${e.name}-p4-${o}`,id:`${e.id}-p4-${o}`,title:e.field4.title,"template-file":e.field4.templateFile,component:e.field4.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","name","id","title","template-file","component"])])):Object(E["createCommentVNode"])("",!0),Object(E["withDirectives"])(Object(E["createElementVNode"])("span",{onClick:t=>e.removeEntry(o),class:"icon-minus valign",title:e.translate("General_Remove")},null,8,xn),[[E["vShow"],o+1!==e.modelValue.length]])],2))),128))])}const Mn=ve("CorePluginsAdmin","Field");var In=Object(E["defineComponent"])({props:{modelValue:Array,name:String,id:String,field1:Object,field2:Object,field3:Object,field4:Object,rows:Number},components:{Field:Mn},computed:{fieldCount(){return this.field1&&this.field2&&this.field3&&this.field4?4:this.field1&&this.field2&&this.field3?3:this.field1&&this.field2?2:this.field1?1:0}},emits:["update:modelValue"],watch:{modelValue(e){this.checkEmptyModelValue(e)}},mounted(){this.checkEmptyModelValue(this.modelValue)},methods:{checkEmptyModelValue(e){e&&e.length&&!this.isEmptyValue(e.slice(-1)[0])||this.rows&&!(this.modelValue.length-1&&this.modelValue){const t=this.modelValue.filter((t,o)=>o!==e);this.$emit("update:modelValue",t)}},isEmptyValue(e){const{fieldCount:t}=this;if(4===t){if(!e[this.field1.key]&&!e[this.field2.key]&&!e[this.field3.key]&&!e[this.field4.key])return!1}else if(3===t){if(!e[this.field1.key]&&!e[this.field2.key]&&!e[this.field3.key])return!1}else if(2===t){if(!e[this.field1.key]&&!e[this.field2.key])return!1}else if(1===t&&!e[this.field1.key])return!1;return!0},makeEmptyValue(){const e={};return this.field1&&this.field1.key&&(e[this.field1.key]=""),this.field2&&this.field2.key&&(e[this.field2.key]=""),this.field3&&this.field3.key&&(e[this.field3.key]=""),this.field4&&this.field4.key&&(e[this.field4.key]=""),e}}});In.render=Bn;var Fn=In;const Ln=["disabled"],An=Object(E["createElementVNode"])("span",{class:"icon-chevron-left"},null,-1),_n=[An],Rn=["title"],Hn=Object(E["createElementVNode"])("span",{class:"icon icon-calendar"},null,-1),$n={id:"periodMore",class:"dropdown"},Un={class:"flex"},qn={key:0,class:"period-date"},Wn={class:"period-type"},zn={id:"otherPeriods"},Gn=["onDblclick","title"],Yn=["id","checked","onChange","onDblclick"],Jn={key:0,class:"compare-checkbox"},Kn={id:"comparePeriodToDropdown"},Qn={key:1,class:"compare-date-range"},Xn={id:"comparePeriodStartDate"},Zn=Object(E["createElementVNode"])("span",{class:"compare-dates-separator"},null,-1),ea={id:"comparePeriodEndDate"},ta={class:"apply-button-container"},oa=["disabled","value"],ia={key:2,id:"ajaxLoadingCalendar"},na={class:"loadingSegment"},aa=["disabled"],ra=Object(E["createElementVNode"])("span",{class:"icon-chevron-right"},null,-1),sa=[ra];function la(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("DateRangePicker"),s=Object(E["resolveComponent"])("PeriodDatePicker"),l=Object(E["resolveComponent"])("Field"),c=Object(E["resolveComponent"])("ActivityIndicator"),d=Object(E["resolveDirective"])("tooltips"),u=Object(E["resolveDirective"])("expand-on-click");return Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{ref:"root",class:Object(E["normalizeClass"])(["periodSelector piwikSelector",{"periodSelector-withPrevNext":e.canShowMovePeriod}])},[e.canShowMovePeriod?(Object(E["openBlock"])(),Object(E["createElementBlock"])("button",{key:0,class:"move-period move-period-prev",onClick:t[0]||(t[0]=t=>e.movePeriod(-1)),disabled:e.isPeriodMoveDisabled(-1)},_n,8,Ln)):Object(E["createCommentVNode"])("",!0),Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("button",{ref:"title",id:"date",class:"title",tabindex:"4",title:e.translate("General_ChooseDate",e.currentlyViewingText)},[Hn,Object(E["createTextVNode"])(" "+Object(E["toDisplayString"])(e.currentlyViewingText),1)],8,Rn)),[[d]]),Object(E["createElementVNode"])("div",$n,[Object(E["createElementVNode"])("div",Un,[Object(E["createElementVNode"])("div",null,[Object(E["withDirectives"])(Object(E["createVNode"])(r,{class:"period-range","start-date":e.startRangeDate,"end-date":e.endRangeDate,onRangeChange:t[1]||(t[1]=t=>e.onRangeChange(t.start,t.end)),onSubmit:t[2]||(t[2]=t=>e.onApplyClicked())},null,8,["start-date","end-date"]),[[E["vShow"],"range"===e.selectedPeriod]]),"range"!==e.selectedPeriod?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",qn,[Object(E["createVNode"])(s,{id:"datepicker",period:e.selectedPeriod,date:e.periodValue===e.selectedPeriod?e.dateValue:null,onSelect:t[3]||(t[3]=t=>e.setPiwikPeriodAndDate(e.selectedPeriod,t.date))},null,8,["period","date"])])):Object(E["createCommentVNode"])("",!0)]),Object(E["createElementVNode"])("div",Wn,[Object(E["createElementVNode"])("h6",null,Object(E["toDisplayString"])(e.translate("General_Period")),1),Object(E["createElementVNode"])("div",zn,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.periodsFiltered,o=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("p",{key:o},[Object(E["createElementVNode"])("label",{class:Object(E["normalizeClass"])({"selected-period-label":o===e.selectedPeriod}),onDblclick:t=>e.changeViewedPeriod(o),title:o===e.periodValue?"":e.translate("General_DoubleClickToChangePeriod")},[Object(E["withDirectives"])(Object(E["createElementVNode"])("input",{type:"radio",name:"period",id:"period_id_"+o,"onUpdate:modelValue":t[4]||(t[4]=t=>e.selectedPeriod=t),checked:e.selectedPeriod===o,onChange:t=>e.selectedPeriod=o,onDblclick:t=>e.changeViewedPeriod(o)},null,40,Yn),[[E["vModelRadio"],e.selectedPeriod]]),Object(E["createElementVNode"])("span",null,Object(E["toDisplayString"])(e.getPeriodDisplayText(o)),1)],42,Gn)]))),128))])])]),e.isComparisonEnabled?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Jn,[Object(E["createElementVNode"])("label",null,[Object(E["withDirectives"])(Object(E["createElementVNode"])("input",{id:"comparePeriodTo",type:"checkbox","onUpdate:modelValue":t[5]||(t[5]=t=>e.isComparing=t)},null,512),[[E["vModelCheckbox"],e.isComparing]]),Object(E["createElementVNode"])("span",null,Object(E["toDisplayString"])(e.translate("General_CompareTo")),1)]),Object(E["createElementVNode"])("div",Kn,[Object(E["createVNode"])(l,{modelValue:e.comparePeriodType,"onUpdate:modelValue":t[6]||(t[6]=t=>e.comparePeriodType=t),style:Object(E["normalizeStyle"])({visibility:e.isComparing?"visible":"hidden"}),name:"comparePeriodToDropdown",uicontrol:"select",options:e.comparePeriodDropdownOptions,"full-width":!0,disabled:!e.isComparing},null,8,["modelValue","style","options","disabled"])])])):Object(E["createCommentVNode"])("",!0),e.isComparing&&"custom"===e.comparePeriodType?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Qn,[Object(E["createElementVNode"])("div",null,[Object(E["createElementVNode"])("div",Xn,[Object(E["createElementVNode"])("div",null,[Object(E["createVNode"])(l,{modelValue:e.compareStartDate,"onUpdate:modelValue":t[7]||(t[7]=t=>e.compareStartDate=t),name:"comparePeriodStartDate",uicontrol:"text","full-width":!0,title:e.translate("CoreHome_StartDate"),placeholder:"YYYY-MM-DD"},null,8,["modelValue","title"])])]),Zn,Object(E["createElementVNode"])("div",ea,[Object(E["createElementVNode"])("div",null,[Object(E["createVNode"])(l,{modelValue:e.compareEndDate,"onUpdate:modelValue":t[8]||(t[8]=t=>e.compareEndDate=t),name:"comparePeriodEndDate",uicontrol:"text","full-width":!0,title:e.translate("CoreHome_EndDate"),placeholder:"YYYY-MM-DD"},null,8,["modelValue","title"])])])])])):Object(E["createCommentVNode"])("",!0),Object(E["createElementVNode"])("div",ta,[Object(E["createElementVNode"])("input",{type:"submit",id:"calendarApply",class:"btn",onClick:t[9]||(t[9]=t=>e.onApplyClicked()),disabled:!e.isApplyEnabled(),value:e.translate("General_Apply")},null,8,oa)]),e.isLoadingNewPage?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",ia,[Object(E["createVNode"])(c,{loading:!0}),Object(E["createElementVNode"])("div",na,Object(E["toDisplayString"])(e.translate("SegmentEditor_LoadingSegmentedDataMayTakeSomeTime")),1)])):Object(E["createCommentVNode"])("",!0)]),e.canShowMovePeriod?(Object(E["openBlock"])(),Object(E["createElementBlock"])("button",{key:1,class:"move-period move-period-next",onClick:t[10]||(t[10]=t=>e.movePeriod(1)),disabled:e.isPeriodMoveDisabled(1)},sa,8,aa)):Object(E["createCommentVNode"])("",!0)],2)),[[u,{expander:"title",onExpand:e.onExpand,onClosed:e.onClosed}]])}const ca=ve("CorePluginsAdmin","Field"),da=M.helper.htmlDecode(" "),ua=["custom","previousPeriod","previousYear"],ma=[{key:"custom",value:a("General_Custom")},{key:"previousPeriod",value:a("General_PreviousPeriod").replace(/\s+/,da)},{key:"previousYear",value:a("General_PreviousYear").replace(/\s+/,da)}],pa=new Date(M.minDateYear,M.minDateMonth-1,M.minDateDay),ha=new Date(M.maxDateYear,M.maxDateMonth-1,M.maxDateDay);function ga(e){return"[object Date]"===Object.prototype.toString.call(e)&&!Number.isNaN(e.getTime())}var ba=Object(E["defineComponent"])({props:{periods:Array},components:{DateRangePicker:ti,PeriodDatePicker:ri,Field:ca,ActivityIndicator:_e},directives:{ExpandOnClick:ht,Tooltips:tt},data(){const e=H.parsed.value.period;return{comparePeriodDropdownOptions:ma,periodValue:e,dateValue:null,selectedPeriod:e,startRangeDate:null,endRangeDate:null,isRangeValid:null,isLoadingNewPage:!1,isComparing:null,comparePeriodType:"previousPeriod",compareStartDate:"",compareEndDate:""}},mounted(){M.on("hidePeriodSelector",()=>{window.$(this.$refs.root).parent("#periodString").hide()}),M.on("matomoPageChange",()=>{window.$(this.$refs.root).parent("#periodString").show()}),this.isComparing=Do.isComparingPeriods(),Object(E["watch"])(()=>Do.isComparingPeriods(),e=>{this.isComparing=e}),this.updateSelectedValuesFromHash(),Object(E["watch"])(()=>H.parsed.value,this.updateSelectedValuesFromHash),this.updateComparisonValuesFromStore(),Object(E["watch"])(()=>Do.getPeriodComparisons(),this.updateComparisonValuesFromStore),window.initTopControls(),this.handleZIndexPositionRelativeCompareDropdownIssue()},computed:{currentlyViewingText(){let e;if("range"===this.periodValue){if(!this.startRangeDate||!this.endRangeDate)return a("General_Error");e=`${this.startRangeDate},${this.endRangeDate}`}else{if(!this.dateValue)return a("General_Error");e=d(this.dateValue)}try{return c.parse(this.periodValue,e).getPrettyString()}catch(t){return a("General_Error")}},isComparisonEnabled(){return Do.isComparisonEnabled()},periodsFiltered(){return(this.periods||[]).filter(e=>c.isRecognizedPeriod(e))},selectedComparisonParams(){if(!this.isComparing)return{};if("custom"===this.comparePeriodType)return{comparePeriods:["range"],comparePeriodType:"custom",compareDates:[`${this.compareStartDate},${this.compareEndDate}`]};if("previousPeriod"===this.comparePeriodType)return{comparePeriods:[this.selectedPeriod],comparePeriodType:"previousPeriod",compareDates:[this.previousPeriodDateToSelectedPeriod]};if("previousYear"===this.comparePeriodType){const e="range"===this.selectedPeriod?`${this.startRangeDate},${this.endRangeDate}`:d(this.dateValue),t=c.parse(this.selectedPeriod,e).getDateRange();return t[0].setFullYear(t[0].getFullYear()-1),t[1].setFullYear(t[1].getFullYear()-1),"range"===this.selectedPeriod?{comparePeriods:["range"],comparePeriodType:"previousYear",compareDates:[`${d(t[0])},${d(t[1])}`]}:{comparePeriods:[this.selectedPeriod],comparePeriodType:"previousYear",compareDates:[d(t[0])]}}return console.warn("Unknown compare period type: "+this.comparePeriodType),{}},previousPeriodDateToSelectedPeriod(){if("range"===this.selectedPeriod){const e=m(this.startRangeDate),t=m(this.endRangeDate),o=C.getLastNRange("day",2,e).startDate,i=Math.floor((t.valueOf()-e.valueOf())/864e5),n=C.getLastNRange("day",1+i,o);return`${d(n.startDate)},${d(n.endDate)}`}const e=C.getLastNRange(this.selectedPeriod,2,this.dateValue).startDate;return d(e)},selectedDateString(){if("range"===this.selectedPeriod){const e=this.startRangeDate,t=this.endRangeDate,o=m(e),i=m(t);return!ga(o)||!ga(i)||o>i?(window.$("#alert").find("h2").text(a("General_InvalidDateRange")),M.helper.modalConfirm("#alert",{}),null):`${e},${t}`}return d(this.dateValue)},isErrorDisplayed(){return this.currentlyViewingText===a("General_Error")},isRangeSelection(){return"range"===this.periodValue},canShowMovePeriod(){return!this.isRangeSelection&&!this.isErrorDisplayed}},methods:{onExpand(e){const t=0===e.detail;t&&window.$(this.$refs.root).find(".ui-datepicker-month").focus()},onClosed(e){const t=0===e.detail;t&&window.$(this.$refs.title).focus()},handleZIndexPositionRelativeCompareDropdownIssue(){const e=window.$(this.$refs.root);e.on("focus","#comparePeriodToDropdown .select-dropdown",()=>{e.addClass("compare-dropdown-open")}).on("blur","#comparePeriodToDropdown .select-dropdown",()=>{e.removeClass("compare-dropdown-open")})},changeViewedPeriod(e){e!==this.periodValue&&"range"!==e&&this.setPiwikPeriodAndDate(e,this.dateValue)},setPiwikPeriodAndDate(e,t){this.periodValue=e,this.selectedPeriod=e,this.dateValue=t;const o=d(t);this.setRangeStartEndFromPeriod(e,o),this.propagateNewUrlParams(o,this.selectedPeriod),window.initTopControls()},propagateNewUrlParams(e,t){const o=this.selectedComparisonParams;let i;M.helper.isReportingPage()?(this.closePeriodSelector(),i=H.hashParsed.value):(this.isLoadingNewPage=!0,i=H.parsed.value);const n=Object.assign({},i);delete n.comparePeriods,delete n.comparePeriodType,delete n.compareDates,H.updateLocation(Object.assign(Object.assign({},n),{},{date:e,period:t},o))},onApplyClicked(){if("range"===this.selectedPeriod){const e=this.selectedDateString;if(!e)return;return this.periodValue="range",void this.propagateNewUrlParams(e,"range")}this.setPiwikPeriodAndDate(this.selectedPeriod,this.dateValue)},updateComparisonValuesFromStore(){this.comparePeriodType="previousPeriod",this.compareStartDate="",this.compareEndDate="";const e=Do.getPeriodComparisons();if(e.length<2)return;const t=H.parsed.value.comparePeriodType;if(!ua.includes(t))return;if(this.comparePeriodType=t,"custom"!==this.comparePeriodType||"range"!==e[1].params.period)return;let o;try{o=c.parse(e[1].params.period,e[1].params.date)}catch(a){return}const[i,n]=o.getDateRange();this.compareStartDate=d(i),this.compareEndDate=d(n)},updateSelectedValuesFromHash(){const e=H.parsed.value.date,t=H.parsed.value.period;this.periodValue=t,this.selectedPeriod=t,this.dateValue=null,this.startRangeDate=null,this.endRangeDate=null;try{c.parse(t,e)}catch(o){return}if("range"===t){const o=c.get(t).parse(e),[i,n]=o.getDateRange();this.dateValue=i,this.startRangeDate=d(i),this.endRangeDate=d(n)}else this.dateValue=m(e),this.setRangeStartEndFromPeriod(t,e)},setRangeStartEndFromPeriod(e,t){const o=c.parse(e,t).getDateRange();this.startRangeDate=d(o[0]ha?ha:o[1])},getPeriodDisplayText(e){return c.get(e).getDisplayText()},onRangeChange(e,t){e&&t?(this.isRangeValid=!0,this.startRangeDate=e,this.endRangeDate=t):this.isRangeValid=!1},isApplyEnabled(){return!("range"===this.selectedPeriod&&!this.isRangeValid)&&!(this.isComparing&&"custom"===this.comparePeriodType&&!this.isCompareRangeValid())},closePeriodSelector(){this.$refs.root.classList.remove("expanded")},isCompareRangeValid(){try{m(this.compareStartDate)}catch(e){return!1}try{m(this.compareEndDate)}catch(e){return!1}return!0},movePeriod(e){if(!this.canMovePeriod(e))return;let t=new Date;switch(null!=this.dateValue&&(t=this.dateValue),this.periodValue){case"day":t.setDate(t.getDate()+e);break;case"week":t.setDate(t.getDate()+7*e);break;case"month":t.setMonth(t.getMonth()+e);break;case"year":t.setFullYear(t.getFullYear()+e);break;default:break}this.dateValueha&&(this.dateValue=ha),this.onApplyClicked()},isPeriodMoveDisabled(e){return null===this.dateValue?this.isRangeSelection:this.isRangeSelection||!this.canMovePeriod(e)},canMovePeriod(e){if(null===this.dateValue)return!1;const t=-1===e?pa:ha;return!g(this.dateValue,t,this.periodValue)}}});ba.render=la;var fa=ba;const va={class:"reportingMenu"},Oa=["aria-label"],ja=["data-category-id"],ya=["onClick"],wa={class:"hidden"},Sa={key:2,role:"menu"},ka=["href","onClick","title"],Ca=["href","onClick"],Ea=["onClick"],Da=Object(E["createElementVNode"])("span",{class:"icon-help"},null,-1),Pa=[Da],Ta={id:"mobile-left-menu",class:"sidenav sidenav--reporting-menu-mobile hide-on-large-only"},Va=["data-category-id"],Na={key:1,class:"collapsible collapsible-accordion"},xa={class:"collapsible-header"},Ba={class:"collapsible-body"},Ma=["onClick","href"],Ia=["onClick","href"];function Fa(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("MenuItemsDropdown"),s=Object(E["resolveDirective"])("side-nav");return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",va,[Object(E["createElementVNode"])("ul",{class:"navbar hide-on-med-and-down collapsible",role:"menu","aria-label":e.translate("CoreHome_MainNavigation")},[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.menu,t=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{class:Object(E["normalizeClass"])(["menuTab",{active:t.id===e.activeCategory}]),role:"menuitem",key:t.id,"data-category-id":t.id},[t.component?(Object(E["openBlock"])(),Object(E["createBlock"])(Object(E["resolveDynamicComponent"])(t.component),{key:0,onAction:o=>e.loadCategory(t)},null,40,["onAction"])):Object(E["createCommentVNode"])("",!0),t.component?Object(E["createCommentVNode"])("",!0):(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:1,class:"item",tabindex:"5",href:"",onClick:Object(E["withModifiers"])(o=>e.loadCategory(t),["prevent"])},[Object(E["createElementVNode"])("span",{class:Object(E["normalizeClass"])("menu-icon "+(t.icon?t.icon:t.subcategories&&t.id===e.activeCategory?"icon-chevron-down":"icon-chevron-right"))},null,2),Object(E["createTextVNode"])(Object(E["toDisplayString"])(t.name)+" ",1),Object(E["createElementVNode"])("span",wa,Object(E["toDisplayString"])(e.translate("CoreHome_Menu")),1)],8,ya)),t.component?Object(E["createCommentVNode"])("",!0):(Object(E["openBlock"])(),Object(E["createElementBlock"])("ul",Sa,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(t.subcategories,o=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{role:"menuitem",class:Object(E["normalizeClass"])({active:(o.id===e.displayedSubcategory||o.isGroup&&e.activeSubsubcategory===e.displayedSubcategory)&&t.id===e.displayedCategory}),key:o.id},[o.isGroup?(Object(E["openBlock"])(),Object(E["createBlock"])(r,{key:0,"show-search":!0,"menu-title":e.htmlEntities(o.name)},{default:Object(E["withCtx"])(()=>[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(o.subcategories,i=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{class:Object(E["normalizeClass"])(["item",{active:i.id===e.activeSubsubcategory&&o.id===e.displayedSubcategory&&t.id===e.displayedCategory}]),tabindex:"5",href:"#?"+e.makeUrl(t,i),onClick:o=>e.loadSubcategory(t,i,o),title:i.tooltip,key:i.id},Object(E["toDisplayString"])(i.name),11,ka))),128))]),_:2},1032,["menu-title"])):Object(E["createCommentVNode"])("",!0),o.isGroup?Object(E["createCommentVNode"])("",!0):(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:1,href:"#?"+e.makeUrl(t,o),class:"item",onClick:i=>e.loadSubcategory(t,o,i),tabindex:"5"},Object(E["toDisplayString"])(o.name),9,Ca)),o.help?(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:2,class:Object(E["normalizeClass"])(["item-help-icon",{active:e.helpShownCategory&&e.helpShownCategory.subcategory===o.id&&e.helpShownCategory.category===t.id&&o.help}]),tabindex:"5",href:"javascript:",onClick:i=>e.showHelp(t,o,i)},Pa,10,Ea)):Object(E["createCommentVNode"])("",!0)],2))),128))]))],10,ja))),128))],8,Oa),Object(E["createElementVNode"])("ul",Ta,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.menu,t=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{class:"no-padding",key:t.id,"data-category-id":t.id},[t.component?(Object(E["openBlock"])(),Object(E["createBlock"])(Object(E["resolveDynamicComponent"])(t.component),{key:0,onAction:o=>e.loadCategory(t)},null,40,["onAction"])):Object(E["createCommentVNode"])("",!0),t.component?Object(E["createCommentVNode"])("",!0):Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("ul",Na,[Object(E["createElementVNode"])("li",null,[Object(E["createElementVNode"])("a",xa,[Object(E["createElementVNode"])("i",{class:Object(E["normalizeClass"])(t.icon?t.icon:"icon-chevron-down")},null,2),Object(E["createTextVNode"])(Object(E["toDisplayString"])(t.name),1)]),Object(E["createElementVNode"])("div",Ba,[Object(E["createElementVNode"])("ul",null,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(t.subcategories,o=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{key:o.id},[o.isGroup?(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],{key:0},Object(E["renderList"])(o.subcategories,o=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{onClick:i=>e.loadSubcategory(t,o),href:"#?"+e.makeUrl(t,o),key:o.id},Object(E["toDisplayString"])(o.name),9,Ma))),128)):Object(E["createCommentVNode"])("",!0),o.isGroup?Object(E["createCommentVNode"])("",!0):(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:1,onClick:i=>e.loadSubcategory(t,o),href:"#?"+e.makeUrl(t,o)},Object(E["toDisplayString"])(o.name),9,Ia))]))),128))])])])])),[[s,{activator:e.sideNavActivator}]])],8,Va))),128))])])}function La(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/class Aa{constructor(){La(this,"privateState",Object(E["reactive"])({pages:[]})),La(this,"state",Object(E["computed"])(()=>Object(E["readonly"])(this.privateState))),La(this,"fetchAllPagesPromise",void 0),La(this,"pages",Object(E["computed"])(()=>this.state.value.pages))}findPageInCategory(e){return this.pages.value.find(t=>t&&t.category&&t.category.id===e&&t.subcategory&&t.subcategory.id)}findPage(e,t){return this.pages.value.find(o=>o&&o.category&&o.subcategory&&o.category.id===e&&""+o.subcategory.id===t)}reloadAllPages(){return delete this.fetchAllPagesPromise,this.getAllPages()}getAllPages(){return this.fetchAllPagesPromise||(this.fetchAllPagesPromise=K.fetch({method:"API.getReportPagesMetadata",filter_limit:"-1"}).then(e=>(this.privateState.pages=e,this.pages.value))),this.fetchAllPagesPromise.then(()=>this.pages.value)}}var _a=new Aa;
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/function Ra(e){const t=[...e||[]];return t.sort((e,t)=>e.ordert.order?1:0),t}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/function Ha(e){const t=e;return t.subcategories?t.subcategories:[]}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/function $a(e){const t=e;return t.subcategories?t.subcategories:[]}function Ua(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/function qa(e){const t=parseFloat(e);return!Number.isNaN(t)&&Number.isFinite(t)}class Wa{constructor(){Ua(this,"privateState",Object(E["reactive"])({activeSubcategoryId:null,activeSubsubcategoryId:null})),Ua(this,"state",Object(E["computed"])(()=>Object(E["readonly"])(this.privateState))),Ua(this,"activeCategory",Object(E["computed"])(()=>"undefined"!==typeof this.state.value.activeCategoryId?this.state.value.activeCategoryId:H.parsed.value.category)),Ua(this,"activeSubcategory",Object(E["computed"])(()=>this.state.value.activeSubcategoryId||H.parsed.value.subcategory)),Ua(this,"activeSubsubcategory",Object(E["computed"])(()=>{const e=this.state.value.activeSubsubcategoryId;if(e)return e;const t=this.findSubcategory(this.activeCategory.value,this.activeSubcategory.value);return t.subsubcategory&&t.subsubcategory.id===this.activeSubcategory.value?t.subsubcategory.id:null})),Ua(this,"menu",Object(E["computed"])(()=>this.buildMenuFromPages()))}fetchMenuItems(){return _a.getAllPages().then(()=>this.menu.value)}reloadMenuItems(){return _a.reloadAllPages().then(()=>this.menu.value)}findSubcategory(e,t){let o=void 0,i=void 0,n=void 0;return this.menu.value.forEach(a=>{a.id===e&&(Ha(a)||[]).forEach(e=>{e.id===t&&(o=a,i=e),e.isGroup&&($a(e)||[]).forEach(r=>{r.id===t&&(o=a,i=e,n=r)})})}),{category:o,subcategory:i,subsubcategory:n}}buildMenuFromPages(){const e=[],t=H.parsed.value.category,o=H.parsed.value.subcategory,i=_a.pages.value,n={};return i.forEach(r=>{const s=Object.assign({},r.category),l=s.id,c=l===t;if(n[l])return;n[l]=!0,s.subcategories=[];let d=null;const u=i.filter(e=>e.category.id===l);u.forEach(e=>{const t=Object.assign({},e.subcategory),i=t.id===o&&c;if(e.widgets&&e.widgets[0]&&qa(e.subcategory.id)){d||(d=Object.assign({},t),d.name=a("CoreHome_ChooseX",[s.name]),d.isGroup=!0,d.subcategories=[],d.order=10),i&&(d.name=t.name);const e=t.id;return t.tooltip=`${t.name} (id = ${e})`,void d.subcategories.push(t)}s.subcategories.push(t)}),d&&d.subcategories&&d.subcategories.length<=5?d.subcategories.forEach(e=>s.subcategories.push(e)):d&&s.subcategories.push(d),s.subcategories=Ra(Ha(s)),e.push(s)}),Ra(e)}toggleCategory(e){return this.privateState.activeSubcategoryId=null,this.privateState.activeSubsubcategoryId=null,this.activeCategory.value===e.id?(this.privateState.activeCategoryId=null,!1):(this.privateState.activeCategoryId=e.id,!0)}enterSubcategory(e,t,o){e&&t&&(this.privateState.activeCategoryId=e.id,this.privateState.activeSubcategoryId=t.id,o&&(this.privateState.activeSubsubcategoryId=o.id))}}var za=new Wa;function Ga(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/function Ya(e){const t=e;return t.widgets?t.widgets:[]}class Ja{constructor(){Ga(this,"privateState",Object(E["reactive"])({isFetchedFirstTime:!1,categorizedWidgets:{}})),Ga(this,"state",Object(E["computed"])(()=>(this.privateState.isFetchedFirstTime||this.fetchAvailableWidgets(),Object(E["readonly"])(this.privateState)))),Ga(this,"widgets",Object(E["computed"])(()=>this.state.value.categorizedWidgets))}fetchAvailableWidgets(){return H.parsed.value.idSite?(this.privateState.isFetchedFirstTime=!0,new Promise((e,t)=>{try{window.widgetsHelper.getAvailableWidgets(t=>{const o=t;this.privateState.categorizedWidgets=o,e(this.widgets.value)})}catch(o){t(o)}})):Promise.resolve(this.widgets.value)}reloadAvailableWidgets(){window.widgetsHelper.clearAvailableWidgets();const e=this.fetchAvailableWidgets();return e.then(()=>{M.postEvent("WidgetsStore.reloaded")}),e}}var Ka=new Ja;const Qa="reportingmenu-help";var Xa=Object(E["defineComponent"])({components:{MenuItemsDropdown:$o},directives:{SideNav:Bt},props:{},data(){return{showSubcategoryHelpOnLoad:null,initialLoad:!0,helpShownCategory:null}},computed:{sideNavActivator(){return document.querySelector("nav .activateLeftMenu")},menu(){const e=za.menu.value;return e.forEach(e=>{if(e.widget&&e.widget.indexOf(".")>0){const[t,o]=e.widget.split(".");e.component=ve(t,o)}}),e},activeCategory(){return za.activeCategory.value},activeSubcategory(){return za.activeSubcategory.value},activeSubsubcategory(){return za.activeSubsubcategory.value},displayedCategory(){return H.parsed.value.category},displayedSubcategory(){return H.parsed.value.subcategory}},created(){za.fetchMenuItems().then(e=>{if(!H.parsed.value.subcategory){const t=e[0],o=t.subcategories[0];za.enterSubcategory(t,o),this.propagateUrlChange(t,o)}}),Object(E["watch"])(()=>H.parsed.value,e=>{const t=za.findSubcategory(e.category,e.subcategory);za.enterSubcategory(t.category,t.subcategory,t.subsubcategory)}),M.on("matomoPageChange",()=>{this.initialLoad||window.globalAjaxQueue.abort(),this.helpShownCategory=null,this.showSubcategoryHelpOnLoad&&(this.showHelp(this.showSubcategoryHelpOnLoad.category,this.showSubcategoryHelpOnLoad.subcategory),this.showSubcategoryHelpOnLoad=null),window.$("#loadingError,#loadingRateLimitError").hide(),this.initialLoad=!1}),M.on("updateReportingMenu",()=>{za.reloadMenuItems().then(()=>{const e=H.parsed.value.category,t=H.parsed.value.subcategory;if(e&&t){const o=za.findSubcategory(e,t);o.category&&za.enterSubcategory(o.category,o.subcategory,o.subsubcategory)}}),Ka.reloadAvailableWidgets()})},methods:{propagateUrlChange(e,t){const o=H.parsed.value;o.category===e.id&&o.subcategory===t.id?this.loadSubcategory(e,t):H.updateHash(Object.assign(Object.assign({},H.hashParsed.value),{},{category:e.id,subcategory:t.id}))},loadCategory(e){ki.remove(Qa);const t=za.toggleCategory(e),{subcategories:o}=e,i=o&&1===o.length||e.widget&&o&&o.length;if(t&&i){this.helpShownCategory=null;const t=e.subcategories[0];this.propagateUrlChange(e,t)}},loadSubcategory(e,t,o){o&&(o.shiftKey||o.ctrlKey||o.metaKey)||(ki.remove(Qa),t&&t.id===H.parsed.value.subcategory&&e.id===H.parsed.value.category&&(this.helpShownCategory=null,setTimeout(()=>{M.postEvent("loadPage",e.id,t.id)})))},makeUrl(e,t){const{idSite:o,period:i,date:n,segment:a,comparePeriods:r,compareDates:s,compareSegments:l}=H.parsed.value;return H.stringify({idSite:o,period:i,date:n,segment:a,comparePeriods:r,compareDates:s,compareSegments:l,category:e.id,subcategory:t.id})},htmlEntities(e){return M.helper.htmlEntities(e)},showHelp(e,t,o){const i=H.parsed.value,n=i.category,r=i.subcategory;if((n!==e.id||r!==t.id)&&o)return this.showSubcategoryHelpOnLoad={category:e,subcategory:t},void H.updateHash(Object.assign(Object.assign({},H.hashParsed.value),{},{category:e.id,subcategory:t.id}));if(this.helpShownCategory&&e.id===this.helpShownCategory.category&&t.id===this.helpShownCategory.subcategory)return ki.remove(Qa),void(this.helpShownCategory=null);const s=a("CoreHome_ReportingCategoryHelpPrefix",e.name,t.name),l=`${s}
`;ki.show({context:"info",id:Qa,type:"help",noclear:!0,class:"help-notification",message:l+t.help,placeat:"#notificationContainer",prepend:!0}),this.helpShownCategory={category:e.id,subcategory:t.id}}}});Xa.render=Fa;var Za=Xa;function er(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/class tr{constructor(){er(this,"privateState",Object(E["reactive"])({reports:[]})),er(this,"state",Object(E["readonly"])(this.privateState)),er(this,"reports",Object(E["computed"])(()=>this.state.reports)),er(this,"reportsPromise",void 0)}findReport(e,t){return this.reports.value.find(o=>o.module===e&&o.action===t)}fetchReportMetadata(){return this.reportsPromise||(this.reportsPromise=K.fetch({method:"API.getReportMetadata",filter_limit:"-1",idSite:M.idSite||H.parsed.value.idSite}).then(e=>(this.privateState.reports=e,e))),this.reportsPromise.then(()=>this.reports.value)}}var or=new tr;const ir={class:"widgetLoader"},nr={key:0},ar={key:1,class:"notification system notification-error"},rr=["href"],sr={key:2,class:"notification system notification-error"},lr={class:"theWidgetContent",ref:"widgetContent"};function cr(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("ActivityIndicator");return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",ir,[Object(E["createVNode"])(r,{"loading-message":e.finalLoadingMessage,loading:e.loading},null,8,["loading-message","loading"]),Object(E["withDirectives"])(Object(E["createElementVNode"])("div",null,[e.widgetName?(Object(E["openBlock"])(),Object(E["createElementBlock"])("h2",nr,Object(E["toDisplayString"])(e.widgetName),1)):Object(E["createCommentVNode"])("",!0),e.loadingFailedRateLimit?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",sr,Object(E["toDisplayString"])(e.translate("General_ErrorRateLimit")),1)):(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",ar,[Object(E["createTextVNode"])(Object(E["toDisplayString"])(e.translate("General_ErrorRequest","",""))+" ",1),e.hasErrorFaqLink?(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:0,rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://matomo.org/faq/troubleshooting/faq_19489/")},Object(E["toDisplayString"])(e.translate("General_ErrorRequestFaqLink")),9,rr)):Object(E["createCommentVNode"])("",!0)]))],512),[[E["vShow"],e.loadingFailed]]),Object(E["createElementVNode"])("div",lr,null,512)])}function dr(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/class ur{constructor(){dr(this,"privateState",Object(E["reactive"])({module:"",action:"",category:"",subcategory:"",idSite:"",widgetSearchFilters:{}})),dr(this,"state",Object(E["computed"])(()=>Object(E["readonly"])(this.privateState))),M.on("matomoPageChange",()=>{this.isCurrentPage()||this.resetSearchFilters(),this.updateCurrentRoutingFromUrl()})}resetSearchFilters(){this.privateState.widgetSearchFilters={}}getSearchFilters(e){return this.state.value.widgetSearchFilters[e]||{}}setSearchFilters(e,t){e&&(this.privateState.widgetSearchFilters[e]=t)}updateCurrentRoutingFromUrl(){const e=H.parsed.value;this.privateState.module=e.module,this.privateState.action=e.action,this.privateState.category=e.category,this.privateState.subcategory=e.subcategory,this.privateState.idSite=e.idSite}isCurrentPage(){const e=H.parsed.value;return this.state.value.module===e.module&&this.state.value.action===e.action&&this.state.value.category===e.category&&this.state.value.subcategory===e.subcategory&&this.state.value.idSite===e.idSite}}var mr=new ur,pr=Object(E["defineComponent"])({props:{widgetParams:Object,widgetName:String,loadingMessage:String},components:{ActivityIndicator:_e},data(){return{loading:!1,loadingFailed:!1,loadingFailedRateLimit:!1,changeCounter:0,lastWidgetAbortController:null}},watch:{widgetParams(e){e&&this.loadWidgetUrl(e,this.changeCounter+=1)}},computed:{finalLoadingMessage(){return this.loadingMessage?this.loadingMessage:this.widgetName?a("General_LoadingPopover",this.widgetName):a("General_LoadingData")},hasErrorFaqLink(){const e=M.config.enable_general_settings_admin,t=M.config.enable_plugins_admin;return M.hasSuperUserAccess&&(e||t)}},mounted(){this.widgetParams&&this.loadWidgetUrl(this.widgetParams,this.changeCounter+=1)},beforeUnmount(){this.cleanupLastWidgetContent()},methods:{abortHttpRequestIfNeeded(){this.lastWidgetAbortController&&(this.lastWidgetAbortController.abort(),this.lastWidgetAbortController=null)},cleanupLastWidgetContent(){const e=this.$refs.widgetContent;M.helper.destroyVueComponent(e),e&&(e.innerHTML="")},getWidgetUrl(e){const t=H.parsed.value;let o=Object.assign({},e||{});const i=Object.keys(Object.assign(Object.assign({},H.hashParsed.value),{},{idSite:"",period:"",date:"",segment:"",widget:""}));return i.forEach(e=>{"category"!==e&&"subcategory"!==e&&(e in o||(o[e]=t[e]))}),Do.isComparisonEnabled()&&(o=Object.assign(Object.assign({},o),{},{comparePeriods:t.comparePeriods,compareDates:t.compareDates,compareSegments:t.compareSegments})),e&&"showtitle"in e||(o.showtitle="1"),M.shouldPropagateTokenAuth&&t.token_auth&&(M.broadcast.isWidgetizeRequestWithoutSession()||(o.force_api_session="1"),o.token_auth=t.token_auth),o.random=Math.floor(1e4*Math.random()),o},loadWidgetUrl(e,t){this.loading=!0,this.abortHttpRequestIfNeeded(),this.cleanupLastWidgetContent(),this.lastWidgetAbortController=new AbortController;let o={};e.uniqueId&&(o=mr.getSearchFilters(e.uniqueId)),K.fetch(this.getWidgetUrl(Object.assign(e,o)),{format:"html",abortController:this.lastWidgetAbortController}).then(o=>{if(t!==this.changeCounter||"string"!==typeof o)return;this.lastWidgetAbortController=null,this.loading=!1,this.loadingFailed=!1;const i=this.$refs.widgetContent;window.$(i).html(o);const n=window.$(i).children();if(this.widgetName){let e=n.find("> .card-content .card-title");e.length||(e=n.find("> h2")),e.length&&e.html(M.helper.htmlEntities(this.widgetName))}M.helper.compileVueEntryComponents(n),ki.parseNotificationDivs(),setTimeout(()=>{M.postEvent("widget:loaded",{parameters:e,element:n})})}).catch(e=>{t===this.changeCounter&&(this.lastWidgetAbortController=null,this.cleanupLastWidgetContent(),this.loading=!1,"abort"!==e.xhrStatus&&(429===e.status&&(this.loadingFailedRateLimit=!0),this.loadingFailed=!0))})}}});pr.render=cr;var hr=pr;const gr={class:"widget-container"};function br(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("Widget");return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",gr,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.actualContainer,(e,t)=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{key:t},[Object(E["createElementVNode"])("div",null,[Object(E["createVNode"])(r,{widget:e,"prevent-recursion":!0},null,8,["widget"])])]))),128))])}const fr=ve("CoreHome","Widget");var vr=Object(E["defineComponent"])({props:{container:{type:Array,required:!0}},components:{Widget:fr},computed:{actualContainer(){var e,t,o;const i=this.container;if(null===i||void 0===i||null===(e=i[0])||void 0===e||!e.parameters)return i;const[n]=i,a="1"===(null===(t=n.parameters)||void 0===t?void 0:t.widget)||1===(null===(o=n.parameters)||void 0===o?void 0:o.widget),r=a&&"graphEvolution"===n.viewDataTable,s=r?Object.assign(Object.assign({},n),{},{parameters:Object.assign(Object.assign({},n.parameters),{},{showtitle:"0"})}):n;return[s,...i.slice(1)]}}});vr.render=br;var Or=vr;const jr={class:"reportsByDimensionView"},yr={class:"entityList"},wr={class:"listCircle"},Sr=["onClick"],kr={class:"dimension"},Cr={class:"reportContainer"},Er=Object(E["createElementVNode"])("div",{class:"clear"},null,-1);function Dr(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("WidgetLoader");return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",jr,[Object(E["createElementVNode"])("div",yr,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.widgetsByCategory,t=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{class:"dimensionCategory",key:t.name},[Object(E["createTextVNode"])(Object(E["toDisplayString"])(t.name)+" ",1),Object(E["createElementVNode"])("ul",wr,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(t.widgets,t=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{class:Object(E["normalizeClass"])(["reportDimension",{activeDimension:e.selectedWidget.uniqueId===t.uniqueId}]),key:t.uniqueId,onClick:o=>e.selectWidget(t)},[Object(E["createElementVNode"])("span",kr,Object(E["toDisplayString"])(t.name),1)],10,Sr))),128))])]))),128))]),Object(E["createElementVNode"])("div",Cr,[e.selectedWidget.parameters?(Object(E["openBlock"])(),Object(E["createBlock"])(r,{key:0,"widget-params":e.selectedWidget.parameters,class:"dimensionReport"},null,8,["widget-params"])):Object(E["createCommentVNode"])("",!0)]),Er])}var Pr=Object(E["defineComponent"])({props:{widgets:Array},components:{WidgetLoader:hr},data(){return{selectedWidget:null}},created(){[this.selectedWidget]=this.widgetsSorted},computed:{widgetsSorted(){return Ra(this.widgets)},widgetsByCategory(){const e={};return this.widgetsSorted.forEach(t=>{var o;const i=null===(o=t.subcategory)||void 0===o?void 0:o.name;i&&(e[i]||(e[i]={name:i,order:t.order,widgets:[]}),e[i].widgets.push(t))}),Ra(Object.values(e))}},methods:{selectWidget(e){this.selectedWidget=Object.assign({},e)}}});Pr.render=Dr;var Tr=Pr;const Vr=["id"],Nr={key:1},xr={key:2};function Br(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("WidgetLoader"),s=Object(E["resolveComponent"])("WidgetContainer"),l=Object(E["resolveComponent"])("WidgetByDimensionContainer"),c=Object(E["resolveDirective"])("tooltips");return e.actualWidget&&e.showWidget?Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{key:0,class:Object(E["normalizeClass"])(["matomo-widget",{isFirstWidgetInPage:e.actualWidget.isFirstInPage}]),id:e.actualWidget.uniqueId},[!e.actualWidget.isContainer&&e.actualWidget.parameters?(Object(E["openBlock"])(),Object(E["createBlock"])(r,{key:0,"widget-params":e.actualWidget.parameters,"widget-name":e.actualWidget.name},null,8,["widget-params","widget-name"])):Object(E["createCommentVNode"])("",!0),e.actualWidget.isContainer&&"ByDimension"!==e.actualWidget.layout&&!this.preventRecursion?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Nr,[Object(E["createElementVNode"])("div",null,[Object(E["createVNode"])(s,{container:e.actualWidget.widgets},null,8,["container"])])])):Object(E["createCommentVNode"])("",!0),e.actualWidget.isContainer&&"ByDimension"===e.actualWidget.layout?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",xr,[Object(E["createElementVNode"])("div",null,[Object(E["createVNode"])(l,{widgets:e.actualWidget.widgets},null,8,["widgets"])])])):Object(E["createCommentVNode"])("",!0)],10,Vr)),[[c,{content:e.tooltipContent}]]):Object(E["createCommentVNode"])("",!0)}function Mr(e,t){let o=void 0;return Object.values(e||{}).some(e=>(o=e.find(e=>{var o;return e&&e.isContainer&&(null===(o=e.parameters)||void 0===o?void 0:o.containerId)===t}),o)),o}var Ir=Object(E["defineComponent"])({props:{widget:Object,widgetized:Boolean,containerid:String,preventRecursion:Boolean},components:{WidgetLoader:hr,WidgetContainer:Or,WidgetByDimensionContainer:Tr},directives:{Tooltips:tt},data(){return{showWidget:!1}},setup(){function e(){const e=window.$(this);if(e.hasClass("matomo-form-field"))return"";const t=window.$(this).attr("title")||"";return window.vueSanitize(t.replace(/\n/g,"
"))}return{tooltipContent:e}},created(){const{actualWidget:e}=this;if(e&&e.middlewareParameters){const t=e.middlewareParameters;K.fetch(t).then(e=>{this.showWidget=!!e})}else this.showWidget=!0},computed:{allWidgets(){return Ka.widgets.value},actualWidget(){const e=this.widget;if(e){const t=Object.assign({},e);if(e&&e.isReport&&!e.documentation){const o=or.findReport(e.module,e.action);o&&o.documentation&&(t.documentation=o.documentation)}return e.uniqueId&&(t.parameters=Object.assign(Object.assign({},t.parameters),{},{uniqueId:e.uniqueId})),t}if(this.containerid){const e=Mr(this.allWidgets,this.containerid);if(e){const t=Object.assign({},e);if(this.widgetized){t.isFirstInPage=!0,t.parameters=Object.assign(Object.assign({},t.parameters),{},{widget:"1"});const e=Ya(t);e&&(t.widgets=e.map(e=>Object.assign(Object.assign({},e),{},{parameters:Object.assign(Object.assign({},e.parameters),{},{widget:"1",containerId:this.containerid})})))}return t}}return null}}});Ir.render=Br;var Fr=Ir;const Lr={class:"reporting-page"},Ar={key:1,class:"col s12 l6 leftWidgetColumn"},_r={key:2,class:"col s12 l6 rightWidgetColumn"};function Rr(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("ActivityIndicator"),s=Object(E["resolveComponent"])("Widget");return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Lr,[Object(E["createVNode"])(r,{loading:e.loading},null,8,["loading"]),Object(E["withDirectives"])(Object(E["createElementVNode"])("div",null,Object(E["toDisplayString"])(e.translate("CoreHome_NoSuchPage")),513),[[E["vShow"],e.hasNoPage]]),(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.widgets,e=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{class:"row",key:e.uniqueId},[e.group?Object(E["createCommentVNode"])("",!0):(Object(E["openBlock"])(),Object(E["createBlock"])(s,{key:0,class:"col s12 fullWidgetColumn",widget:e},null,8,["widget"])),e.group?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Ar,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.left,e=>(Object(E["openBlock"])(),Object(E["createBlock"])(s,{widget:e,key:e.uniqueId},null,8,["widget"]))),128))])):Object(E["createCommentVNode"])("",!0),e.group?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",_r,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.right,e=>(Object(E["openBlock"])(),Object(E["createBlock"])(s,{widget:e,key:e.uniqueId},null,8,["widget"]))),128))])):Object(E["createCommentVNode"])("",!0)]))),128))])}function Hr(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/function $r(e){return!!(e.isContainer&&e.layout&&"ByDimension"===e.layout||"bydimension"===e.viewDataTable)||(!!e.isWide||e.viewDataTable&&("tableAllColumns"===e.viewDataTable||"sparklines"===e.viewDataTable||"graphEvolution"===e.viewDataTable))}function Ur(e){if(e&&e[0]){const t=[...e],o=e[0];return o.group?t[0]=Object.assign(Object.assign({},t[0]),{},{left:Ur(o.left||[]),right:Ur(o.right||[])}):t[0]=Object.assign(Object.assign({},t[0]),{},{isFirstInPage:!0}),t}return e}class qr{constructor(){Hr(this,"privateState",Object(E["reactive"])({})),Hr(this,"state",Object(E["computed"])(()=>Object(E["readonly"])(this.privateState))),Hr(this,"page",Object(E["computed"])(()=>this.state.value.page)),Hr(this,"widgets",Object(E["computed"])(()=>{const e=this.page.value;if(!e)return[];let t=[];const o={},i=e=>e.isReport&&o[`${e.module}.${e.action}`],n=e=>{if(!e.isReport)return[];const t=or.findReport(e.module,e.action);return t&&t.relatedReports?t.relatedReports:[]};if((e.widgets||[]).forEach(e=>{i(e)||(n(e).forEach(e=>{o[`${e.module}.${e.action}`]=!0}),t.push(e))}),t=Ra(t),1===t.length)return Ur(t);const a=[];for(let s=0;s(this.privateState.page=_a.findPage(e,t),this.page.value))}resetPage(){this.privateState.page=void 0}}var Wr=new qr;function zr(){const e="category=General_Visitors&subcategory=Live_VisitorLog",t=window.broadcast.buildReportingUrl(e);let o=a("CoreHome_PeriodHasOnlyRawData",``,"");M.visitorLogEnabled||(o=a("CoreHome_PeriodHasOnlyRawDataNoVisitsLog")),ki.show({id:"onlyRawData",animate:!1,context:"info",message:o,type:"transient"})}function Gr(){ki.remove("onlyRawData")}var Yr=Object(E["defineComponent"])({components:{ActivityIndicator:_e,Widget:Fr},data(){return{loading:!1,hasRawData:!1,hasNoVisits:!1,dateLastChecked:null,hasNoPage:!1}},created(){Wr.resetPage(),this.loading=!0,this.renderInitialPage(),Object(E["watch"])(()=>H.parsed.value,(e,t)=>{e.category===t.category&&e.subcategory===t.subcategory&&e.period===t.period&&e.date===t.date&&e.segment===t.segment&&JSON.stringify(e.compareDates)===JSON.stringify(t.compareDates)&&JSON.stringify(e.comparePeriods)===JSON.stringify(t.comparePeriods)&&JSON.stringify(e.compareSegments)===JSON.stringify(t.compareSegments)&&JSON.stringify(e.columns||"")===JSON.stringify(t.columns||"")||(e.date===t.date&&e.period===t.period||(Gr(),this.dateLastChecked=null,this.hasRawData=!1,this.hasNoVisits=!1),this.renderPage(e.category,e.subcategory,e.period,e.date,e.segment))}),M.on("loadPage",(e,t)=>{const o=H.parsed.value;this.renderPage(e,t,o.period,o.date,o.segment)})},computed:{widgets(){return Wr.widgets.value}},methods:{renderPage(e,t,o,i,n){if(!e||!t)return Wr.resetPage(),void(this.loading=!1);try{c.parse(o,i)}catch(s){return ki.show({id:"invalidDate",animate:!1,context:"error",message:a("CoreHome_DateInvalid"),type:"transient"}),Wr.resetPage(),void(this.loading=!1)}ki.remove("invalidDate"),M.postEvent("matomoPageChange",{}),ki.clearTransientNotifications(),c.parse(o,i).containsToday()&&this.showOnlyRawDataMessageIfRequired(e,t,o,i,n);const r={category:e,subcategory:t};if(M.postEvent("ReportingPage.loadPage",r),r.promise)return this.loading=!0,void Promise.resolve(r.promise).finally(()=>{this.loading=!1});Wr.fetchPage(e,t).then(()=>{const t=!Wr.page.value;if(t){const t=_a.findPageInCategory(e);if(t&&t.subcategory)return void H.updateHash(Object.assign(Object.assign({},H.hashParsed.value),{},{subcategory:t.subcategory.id}))}this.hasNoPage=t,this.loading=!1})},renderInitialPage(){const e=H.parsed.value;this.renderPage(e.category,e.subcategory,e.period,e.date,e.segment)},showOnlyRawDataMessageIfRequired(e,t,o,i,n){if(this.hasRawData&&this.hasNoVisits&&zr(),n)return void Gr();const a=["Live_VisitorLog","General_RealTime","UserCountryMap_RealTimeMap","MediaAnalytics_TypeAudienceLog","MediaAnalytics_TypeRealTime","FormAnalytics_TypeRealTime","Goals_AddNewGoal"],r=["HeatmapSessionRecording_Heatmaps","HeatmapSessionRecording_SessionRecordings","Marketplace_Marketplace"];if(-1!==a.indexOf(t)||-1!==r.indexOf(e)||-1!==t.toLowerCase().indexOf("manage"))return void Gr();const s=6e4;this.dateLastChecked&&(new Date).valueOf()-this.dateLastChecked.valueOf()(this.dateLastChecked=new Date,e.value>0?(this.hasNoVisits=!1,void Gr()):(this.hasNoVisits=!0,this.hasRawData?void zr():K.fetch({method:"Live.getMostRecentVisitsDateTime",date:i,period:o}).then(e=>{if(!e||""===e.value)return this.hasRawData=!1,void Gr();this.hasRawData=!0,zr()}))))}}});Yr.render=Rr;var Jr=Yr;const Kr={class:"report-export-popover row",id:"reportExport"},Qr={class:"col l6"},Xr={name:"format"},Zr={name:"option_flat"},es={name:"option_show_dimensions"},ts={name:"option_expanded"},os={name:"option_format_metrics"},is={class:"col l6"},ns={name:"filter_type"},as={class:"filter_limit"},rs={name:"filter_limit_all"},ss={key:0,name:"filter_limit"},ls={key:1,name:"filter_limit"},cs={class:"col l12"},ds=["value"],us=["innerHTML"],ms={class:"col l12"},ps=["href","title"],hs=["innerHTML"];function gs(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("Field"),s=Object(E["resolveDirective"])("select-on-focus");return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Kr,[Object(E["createElementVNode"])("div",Qr,[Object(E["createElementVNode"])("div",Xr,[Object(E["createVNode"])(r,{uicontrol:"radio",name:"format",title:e.translate("CoreHome_ExportFormat"),modelValue:e.reportFormat,"onUpdate:modelValue":t[0]||(t[0]=t=>e.reportFormat=t),"full-width":!0,options:e.availableReportFormats[e.reportType]},null,8,["title","modelValue","options"])]),Object(E["createElementVNode"])("div",null,[Object(E["createElementVNode"])("div",Zr,[Object(E["withDirectives"])(Object(E["createVNode"])(r,{uicontrol:"checkbox",name:"option_flat",title:e.translate("CoreHome_FlattenReport"),modelValue:e.optionFlatModel,"onUpdate:modelValue":t[1]||(t[1]=t=>e.optionFlatModel=t)},null,8,["title","modelValue"]),[[E["vShow"],e.canExportFlat]])])]),Object(E["createElementVNode"])("div",null,[Object(E["createElementVNode"])("div",es,[Object(E["withDirectives"])(Object(E["createVNode"])(r,{uicontrol:"checkbox",name:"option_show_dimensions",title:e.translate("CoreHome_IncludeDimensionsSeparately"),modelValue:e.optionShowDimensions,"onUpdate:modelValue":t[2]||(t[2]=t=>e.optionShowDimensions=t)},null,8,["title","modelValue"]),[[E["vShow"],e.canExportFlat&&e.hasMultipleDimensions&&e.optionFlatModel]])])]),Object(E["createElementVNode"])("div",null,[Object(E["createElementVNode"])("div",ts,[Object(E["withDirectives"])(Object(E["createVNode"])(r,{uicontrol:"checkbox",name:"option_expanded",title:e.translate("CoreHome_ExpandSubtables"),modelValue:e.optionExpandedModel,"onUpdate:modelValue":t[3]||(t[3]=t=>e.optionExpandedModel=t)},null,8,["title","modelValue"]),[[E["vShow"],e.hasSubtables&&!e.isCsvOrTsv]])])]),Object(E["createElementVNode"])("div",null,[Object(E["createElementVNode"])("div",os,[Object(E["createVNode"])(r,{uicontrol:"checkbox",name:"option_format_metrics",title:e.translate("CoreHome_FormatMetrics"),modelValue:e.optionFormatMetrics,"onUpdate:modelValue":t[4]||(t[4]=t=>e.optionFormatMetrics=t)},null,8,["title","modelValue"])])])]),Object(E["createElementVNode"])("div",is,[Object(E["createElementVNode"])("div",null,[Object(E["createElementVNode"])("div",ns,[Object(E["createVNode"])(r,{uicontrol:"radio",name:"filter_type",title:e.translate("CoreHome_ReportType"),modelValue:e.reportType,"onUpdate:modelValue":t[5]||(t[5]=t=>e.reportType=t),"full-width":!0,options:e.availableReportTypes},null,8,["title","modelValue","options"])])]),Object(E["createElementVNode"])("div",as,[Object(E["withDirectives"])(Object(E["createElementVNode"])("div",rs,[Object(E["createVNode"])(r,{uicontrol:"radio",name:"filter_limit_all",title:e.translate("CoreHome_RowLimit"),modelValue:e.reportLimitAll,"onUpdate:modelValue":t[6]||(t[6]=t=>e.reportLimitAll=t),"full-width":!0,options:e.limitAllOptions},null,8,["title","modelValue","options"])],512),[[E["vShow"],!e.maxFilterLimit||e.maxFilterLimit<=0]]),"no"===e.reportLimitAll&&e.maxFilterLimit<=0?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",ss,[Object(E["createVNode"])(r,{uicontrol:"number",name:"filter_limit",min:1,modelValue:e.reportLimit,"onUpdate:modelValue":t[7]||(t[7]=t=>e.reportLimit=t),"full-width":!0},null,8,["modelValue"])])):Object(E["createCommentVNode"])("",!0),"no"===e.reportLimitAll&&e.maxFilterLimit>0?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",ls,[Object(E["createVNode"])(r,{uicontrol:"number",name:"filter_limit",min:1,max:e.maxFilterLimit,modelValue:e.reportLimit,"onUpdate:modelValue":t[8]||(t[8]=t=>e.reportLimit=t),value:e.reportLimit,"full-width":!0,title:e.filterLimitTooltip},null,8,["max","modelValue","value","title"])])):Object(E["createCommentVNode"])("",!0)])]),Object(E["withDirectives"])(Object(E["createElementVNode"])("div",cs,[Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("textarea",{readonly:"",class:"exportFullUrl",value:e.exportLinkWithoutToken},[Object(E["createTextVNode"])("\n ")],8,ds)),[[s,{}]]),Object(E["createElementVNode"])("div",{class:"tooltip",innerHTML:e.$sanitize(e.translate("CoreHome_ExportTooltipWithLink","","","ENTER_YOUR_TOKEN_AUTH_HERE"))},null,8,us)],512),[[E["vShow"],e.showUrl]]),Object(E["createElementVNode"])("div",ms,[Object(E["createElementVNode"])("a",{class:"btn",href:e.exportLink,target:"_new",title:e.translate("CoreHome_ExportTooltip")},Object(E["toDisplayString"])(e.translate("General_Export")),9,ps),Object(E["createElementVNode"])("a",{href:"javascript:",onClick:t[9]||(t[9]=t=>e.showUrl=!e.showUrl),class:"toggle-export-url"},[Object(E["withDirectives"])(Object(E["createElementVNode"])("span",null,Object(E["toDisplayString"])(e.translate("CoreHome_ShowExportUrl")),513),[[E["vShow"],!e.showUrl]]),Object(E["withDirectives"])(Object(E["createElementVNode"])("span",null,Object(E["toDisplayString"])(e.translate("CoreHome_HideExportUrl")),513),[[E["vShow"],e.showUrl]])])]),e.additionalContent?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{key:0,class:"col l12 report-export-popover-footer",innerHTML:e.$sanitize(e.additionalContent)},null,8,hs)):Object(E["createCommentVNode"])("",!0)])}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/const bs=["CSV","TSV"];function fs(e){return bs.includes(e)}function vs(e,t,o){return e?fs(o)?{hasUserPreference:!1,preferredMode:null}:{hasUserPreference:!0,preferredMode:"flat"}:t?{hasUserPreference:!0,preferredMode:"expanded"}:{hasUserPreference:!0,preferredMode:null}}function Os(e,t,o,i){const{hasUserPreference:n,preferredMode:a}=i;return e?fs(o)?t?{optionFlat:!n||"flat"===a,optionExpanded:!1}:{optionFlat:!1,optionExpanded:!1}:n?"flat"===a?t?{optionFlat:!0,optionExpanded:!1}:{optionFlat:!1,optionExpanded:!0}:"expanded"===a?{optionFlat:!1,optionExpanded:!0}:{optionFlat:!1,optionExpanded:!1}:{optionFlat:!1,optionExpanded:!0}:{optionFlat:!1,optionExpanded:!1}}const js=ve("CorePluginsAdmin","Field");var ys=Object(E["defineComponent"])({components:{Field:js},directives:{SelectOnFocus:Tt},props:{hasSubtables:Boolean,canExportFlat:{type:Boolean,default:!1},availableReportTypes:Object,availableReportFormats:{type:Object,required:!0},maxFilterLimit:Number,limitAllOptions:Object,dataTable:{type:Object,required:!0},requestParams:[Object,String],apiMethod:{type:String,required:!0},initialReportType:{type:String,default:"default"},initialReportLimit:{type:[String,Number],default:100},initialReportLimitAll:{type:String,default:"yes"},initialOptionFlat:{type:Boolean,default:!1},initialOptionShowDimensions:{type:Boolean,default:!1},initialOptionExpanded:{type:Boolean,default:!0},initialOptionFormatMetrics:{type:Boolean,default:!1},initialReportFormat:{type:String,default:"TSV"}},mounted(){const e={content:this.additionalContent,dataTable:this.dataTable};M.postEvent("ReportExportPopover.additionalContent",e),this.additionalContent=e.content},data(){return{showUrl:!1,reportFormat:this.initialReportFormat,optionShowDimensions:this.initialOptionShowDimensions,subtablePreference:vs(this.initialOptionFlat,this.initialOptionExpanded,this.initialReportFormat),optionFormatMetrics:this.initialOptionFormatMetrics,reportType:this.initialReportType,reportLimitAll:this.initialReportLimitAll,reportLimit:"string"===typeof this.initialReportLimit?parseInt(this.initialReportLimit,10):this.initialReportLimit,additionalContent:""}},watch:{reportType(e){this.availableReportFormats[e][this.reportFormat]||(this.reportFormat="JSON")},reportLimit(e,t){this.maxFilterLimit&&this.maxFilterLimit>0&&e>this.maxFilterLimit&&(this.reportLimit=t)}},computed:{hasMultipleDimensions(){var e,t;return"function"===typeof(null===(e=this.dataTable)||void 0===e?void 0:e.getReportMetadata)&&Object.keys((null===(t=this.dataTable)||void 0===t?void 0:t.getReportMetadata().dimensions)||{}).length>1},filterLimitTooltip(){const e=a("CoreHome_RowLimit"),t=this.maxFilterLimit?a("General_ComputedMetricMax",this.maxFilterLimit.toString()):"";return`${e} (${t})`},isCsvOrTsv(){return fs(this.reportFormat)},effectiveSubtableOptions(){return Os(this.hasSubtables,this.canExportFlat,this.reportFormat,this.subtablePreference)},optionFlatModel:{get(){return this.effectiveSubtableOptions.optionFlat},set(e){this.hasSubtables&&this.canExportFlat&&(e?this.subtablePreference={hasUserPreference:!0,preferredMode:"flat"}:this.optionExpandedModel||(this.subtablePreference={hasUserPreference:!0,preferredMode:null}))}},optionExpandedModel:{get(){return this.effectiveSubtableOptions.optionExpanded},set(e){this.hasSubtables&&!fs(this.reportFormat)&&(e?this.subtablePreference={hasUserPreference:!0,preferredMode:"expanded"}:this.optionFlatModel||(this.subtablePreference={hasUserPreference:!0,preferredMode:null}))}},exportLink(){return this.getExportLink(!0)},exportLinkWithoutToken(){return this.getExportLink(!1)}},methods:{getExportLink(e=!0){const{reportFormat:t,apiMethod:o,reportType:i}=this,n=this.dataTable;if(!t)return;let a={};const r="yes"===this.reportLimitAll?-1:this.reportLimit;this.requestParams&&"string"===typeof this.requestParams?a=JSON.parse(this.requestParams):this.requestParams&&"object"===typeof this.requestParams&&(a=this.requestParams);const{segment:s,label:l,idGoal:c,idDimension:d,idSite:u}=n.param;let{date:m,period:p}=n.param;"RSS"===t&&(m="last10"),"undefined"!==typeof n.param.dateUsedInGraph&&(m=n.param.dateUsedInGraph);const h=M.config.datatable_export_range_as_day.toLowerCase();-1!==h.indexOf(t.toLowerCase())&&"range"===n.param.period&&(p="day"),"range"===n.param.period&&"graphEvolution"===n.param.viewDataTable&&(p="day");const g={module:"API",format:t,idSite:u,period:p,date:m};"processed"===i?(g.method="API.getProcessedReport",[g.apiModule,g.apiAction]=o.split(".")):g.method=o,n.param.compareDates&&n.param.compareDates.length&&(g.compareDates=n.param.compareDates,g.compare="1"),n.param.comparePeriods&&n.param.comparePeriods.length&&(g.comparePeriods=n.param.comparePeriods,g.compare="1"),n.param.compareSegments&&n.param.compareSegments.length&&(g.compareSegments=n.param.compareSegments,g.compare="1"),"undefined"!==typeof n.param.filter_pattern&&(g.filter_pattern=n.param.filter_pattern),"undefined"!==typeof n.param.filter_pattern_recursive&&(g.filter_pattern_recursive=n.param.filter_pattern_recursive),window.$.isPlainObject(a)&&Object.entries(a).forEach(([e,t])=>{let o=t;!0===o?o=1:!1===o&&(o=0),g[e]=o});const{optionFlat:b,optionExpanded:f}=this.effectiveSubtableOptions;if(b&&(g.flat=1,this.optionShowDimensions&&(g.show_dimensions=1),"undefined"!==typeof n.param.include_aggregate_rows&&"1"===n.param.include_aggregate_rows&&(g.include_aggregate_rows=1)),this.hasSubtables&&!b&&f&&(g.expanded=1),this.optionFormatMetrics&&(g.format_metrics=1),n.param.pivotBy&&(g.pivotBy=n.param.pivotBy,g.pivotByColumnLimit=20,n.props.pivot_by_column&&(g.pivotByColumn=n.props.pivot_by_column)),"CSV"!==t&&"TSV"!==t&&"RSS"!==t||(g.translateColumnNames=1,g.language=M.language),"undefined"!==typeof s&&(g.segment=decodeURIComponent(s)),"undefined"!==typeof c&&"-1"!==c&&(g.idGoal=c),"undefined"!==typeof d&&"-1"!==d&&(g.idDimension=d),l){const e=l.split(",");e.length>1?g.label=e:[g.label]=e}g.showMetadata=0,g.token_auth="ENTER_YOUR_TOKEN_AUTH_HERE",!0===e&&(g.token_auth=M.token_auth,g.force_api_session=1),g.filter_limit=r;const v=window.location.href.split("?")[0];return`${v}?${H.stringify(g)}`}}});ys.render=gs;var ws=ys;
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/const{$:Ss}=window;var ks={mounted(e,t){e.addEventListener("click",()=>{var o;const i=H.hashParsed.value.popover,n=Ss(e).closest("[data-report]").data("uiControlObject"),r=window.Piwik_Popover.showLoading("Export"),s=t.value.reportFormats;let l=n.param.filter_limit;t.value.maxFilterLimit>0&&(l=Math.min(l,t.value.maxFilterLimit));const c=!0===n.param.flat||1===n.param.flat||"1"===n.param.flat,d=!0===n.param.show_dimensions||1===n.param.show_dimensions||"1"===n.param.show_dimensions,u=c||n.numberOfSubtables>0,m=(null!==(o=t.value.canExportFlat)&&void 0!==o?o:u)&&u,p=m,h=!1,g={initialReportType:"default",initialReportFormat:"TSV",initialReportLimit:l>0?l:100,initialReportLimitAll:-1===l?"yes":"no",initialOptionFlat:p,initialOptionShowDimensions:d,initialOptionExpanded:h,initialOptionFormatMetrics:!1,hasSubtables:u,canExportFlat:m,availableReportFormats:{default:s,processed:{JSON:s.JSON,XML:s.XML}},availableReportTypes:{default:a("CoreHome_StandardReport"),processed:a("CoreHome_ReportWithMetadata")},limitAllOptions:{yes:a("General_All"),no:a("CoreHome_CustomLimit")},maxFilterLimit:t.value.maxFilterLimit,dataTable:n,requestParams:t.value.requestParams,apiMethod:t.value.apiMethod},b=me({template:'\n ',data(){return{bind:g}}});b.component("popover",ws);const f=document.createElement("div");b.mount(f);const{reportTitle:v}=t.value;window.Piwik_Popover.setTitle(`${a("General_Export")} ${M.helper.htmlEntities(v)}`),window.Piwik_Popover.setContent(f),window.Piwik_Popover.onClose(()=>{b.unmount(),""!==i&&setTimeout(()=>{H.updateHash(Object.assign(Object.assign({},H.hashParsed.value),{},{popover:i})),t.value.onClose&&t.value.onClose()},100)}),setTimeout(()=>{r.dialog(),Ss(".exportFullUrl, .btn",r).tooltip({track:!0,show:!1,hide:!1})},100)})}};const Cs=["src","width","height"];function Es(e,t,o,i,n,a){return Object(E["openBlock"])(),Object(E["createElementBlock"])("img",{class:"sparklineImg",loading:"lazy",alt:"",src:e.sparklineUrl,width:e.width,height:e.height},null,8,Cs)}var Ds=Object(E["defineComponent"])({props:{seriesIndices:Array,params:[Object,String],width:Number,height:Number},data(){return{isWidget:!1}},mounted(){this.isWidget=!!this.$el.closest("[widgetId]")},computed:{sparklineUrl(){const{seriesIndices:e,params:t}=this,o=M.getSparklineColors();e&&(o.lineColor=o.lineColor.filter((t,o)=>-1!==e.indexOf(o)));const i=JSON.stringify(o),n={forceView:"1",viewDataTable:"sparkline",widget:this.isWidget?"1":"0",showtitle:"1",colors:i,random:Date.now(),date:this.defaultDate,segment:H.parsed.value.segment},a="object"===typeof t?t:H.parse(t.substring(t.indexOf("?")+1)),r=new K,s=r.mixinDefaultGetParams(Object.assign(Object.assign({},n),a)),l=H.parsed.value.token_auth;return l&&l.length&&M.shouldPropagateTokenAuth&&(s.token_auth=l),"?"+H.stringify(s)},defaultDate(){if("range"===M.period)return`${M.startDateString},${M.endDateString}`;const e=C.getLastNRange(M.period,30,M.currentDateString).getDateRange(),t=new Date(M.minDateYear,M.minDateMonth-1,M.minDateDay);e[0]100?100:this.progress<0?0:this.progress}}});Bs.render=xs;var Ms=Bs,Is={mounted(e){e.classList.add("piwik-content-intro")},updated(e){Object(E["nextTick"])(()=>{e.classList.add("piwik-content-intro")})}},Fs={mounted(e,t){var o;null!==t&&void 0!==t&&null!==(o=t.value)&&void 0!==o&&o.off||e.classList.add("card","card-table","entityTable")},updated(e,t){var o;null!==t&&void 0!==t&&null!==(o=t.value)&&void 0!==o&&o.off||Object(E["nextTick"])(()=>{e.classList.add("card","card-table","entityTable")})}};
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/const Ls={ref:"root"};function As(e,t,o,i,n,a){return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Ls,[Object(E["renderSlot"])(e.$slots,"default",{formData:e.formData,submitApiMethod:e.submitApiMethod,sendJsonPayload:e.sendJsonPayload,noErrorNotification:e.noErrorNotification,noSuccessNotification:e.noSuccessNotification,submitForm:e.submitForm,isSubmitting:e.isSubmitting,successfulPostResponse:e.successfulPostResponse,errorPostResponse:e.errorPostResponse})],512)}const{$:_s}=window;var Rs=Object(E["defineComponent"])({props:{formData:{type:Object,required:!0},submitApiMethod:{type:String,required:!0},sendJsonPayload:Boolean,noErrorNotification:Boolean,noSuccessNotification:Boolean},data(){return{isSubmitting:!1,successfulPostResponse:null,errorPostResponse:null}},emits:["update:modelValue"],mounted(){_s(this.$refs.root).on("click","input[type=submit]",()=>{this.submitForm()})},methods:{submitForm(){this.successfulPostResponse=null,this.errorPostResponse=null;let e=this.formData;this.sendJsonPayload&&(e={data:JSON.stringify(this.formData)}),this.isSubmitting=!0,K.post({module:"API",method:this.submitApiMethod},e,{createErrorNotification:!this.noErrorNotification}).then(e=>{if(this.successfulPostResponse=e,!this.noSuccessNotification){const e=ki.show({message:a("General_YourChangesHaveBeenSaved"),context:"success",type:"toast",id:"ajaxHelper"});ki.scrollToNotification(e)}}).catch(e=>{this.errorPostResponse=e.message}).finally(()=>{this.isSubmitting=!1})}}});Rs.render=As;var Hs=Rs;function $s(e,t,o,i,n,a){return Object(E["renderSlot"])(e.$slots,"default")}var Us=Object(E["defineComponent"])({});Us.render=$s;var qs=Us;const Ws={key:0},zs=["data-target","title"],Gs=Object(E["createElementVNode"])("span",{class:"icon-configure"},null,-1),Ys={class:"visually-hidden"},Js=["data-target"],Ks=["title"],Qs=["title","src"],Xs=["id"],Zs=["data-footer-icon-id"],el=["title"],tl=["title","src"],ol={key:2},il=Object(E["createElementVNode"])("li",{class:"divider"},null,-1),nl=Object(E["createElementVNode"])("li",{class:"divider"},null,-1),al=["title"],rl=Object(E["createElementVNode"])("span",{class:"icon-export"},null,-1),sl={class:"visually-hidden"},ll=["title"],cl=Object(E["createElementVNode"])("span",{class:"icon-image"},null,-1),dl=[cl],ul=["title"],ml=Object(E["createElementVNode"])("span",{class:"icon-annotation"},null,-1),pl=[ml],hl=["title"],gl=Object(E["createElementVNode"])("span",{class:"icon-search",draggable:"false"},null,-1),bl=["title"],fl=["id","title"],vl=["title"],Ol=["title","src"],jl=["id"],yl={key:0},wl=["innerHTML"],Sl={key:1},kl=["innerHTML"],Cl={key:2},El=["innerHTML"],Dl={key:3},Pl=["innerHTML"],Tl={key:4},Vl=["innerHTML"],Nl={key:5},xl=["innerHTML"],Bl=["title","data-target"],Ml=Object(E["createElementVNode"])("span",{class:"icon-calendar"},null,-1),Il={class:"periodName"},Fl=["id"],Ll=["data-period"];function Al(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("Passthrough"),s=Object(E["resolveDirective"])("dropdown-button"),l=Object(E["resolveDirective"])("report-export");return e.showFooter&&e.showFooterIcons?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Ws,[e.hasConfigItems&&(e.isAnyConfigureIconHighlighted||e.isTableView)?Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:0,class:Object(E["normalizeClass"])(["dropdown-button dropdownConfigureIcon dataTableAction",{highlighted:e.isAnyConfigureIconHighlighted}]),href:"",onClick:t[0]||(t[0]=Object(E["withModifiers"])(()=>{},["prevent"])),"data-target":"dropdownConfigure"+e.randomIdForDropdown,title:e.translate("CoreHome_ReportConfigure"),style:{"margin-right":"3.5px"}},[Gs,Object(E["createElementVNode"])("span",Ys,Object(E["toDisplayString"])(e.translate("CoreHome_ReportConfiguration")),1)],10,zs)),[[s]]):Object(E["createCommentVNode"])("",!0),e.hasFooterIconsToShow?Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:1,class:"dropdown-button dataTableAction activateVisualizationSelection",href:"","data-target":"dropdownVisualizations"+e.randomIdForDropdown,style:{"margin-right":"3.5px"},onClick:t[1]||(t[1]=Object(E["withModifiers"])(()=>{},["prevent"]))},[/^icon-/.test(e.activeFooterIcon||"")?(Object(E["openBlock"])(),Object(E["createElementBlock"])("span",{key:0,title:e.translate("CoreHome_ChangeVisualization"),class:Object(E["normalizeClass"])(e.activeFooterIcon)},null,10,Ks)):(Object(E["openBlock"])(),Object(E["createElementBlock"])("img",{key:1,title:e.translate("CoreHome_ChangeVisualization"),width:"16",height:"16",src:e.activeFooterIcon},null,8,Qs))],8,Js)),[[s]]):Object(E["createCommentVNode"])("",!0),e.showFooterIcons?(Object(E["openBlock"])(),Object(E["createElementBlock"])("ul",{key:2,id:"dropdownVisualizations"+e.randomIdForDropdown,class:"dropdown-content dataTableFooterIcons"},[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.footerIcons,(t,o)=>(Object(E["openBlock"])(),Object(E["createBlock"])(r,{key:o},{default:Object(E["withCtx"])(()=>[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(t.buttons.filter(e=>!!e.icon),o=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{key:o.id},[Object(E["createElementVNode"])("a",{class:Object(E["normalizeClass"])(`${t.class} tableIcon\n ${-1!==e.activeFooterIconIds.indexOf(o.id)?"activeIcon":""}`),"data-footer-icon-id":o.id},[/^icon-/.test(o.icon||"")?(Object(E["openBlock"])(),Object(E["createElementBlock"])("span",{key:0,title:o.title,class:Object(E["normalizeClass"])(o.icon),style:{"margin-right":"5.5px"}},null,10,el)):(Object(E["openBlock"])(),Object(E["createElementBlock"])("img",{key:1,width:"16",height:"16",title:o.title,src:o.icon,style:{"margin-right":"5.5px"}},null,8,tl)),o.title?(Object(E["openBlock"])(),Object(E["createElementBlock"])("span",ol,Object(E["toDisplayString"])(o.title),1)):Object(E["createCommentVNode"])("",!0)],10,Zs)]))),128)),il]),_:2},1024))),128)),nl],8,Xs)):Object(E["createCommentVNode"])("",!0),e.showExport?Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:3,class:"dataTableAction activateExportSelection",title:e.translate("General_ExportThisReport"),href:"",style:{"margin-right":"3.5px"},onClick:t[2]||(t[2]=Object(E["withModifiers"])(()=>{},["prevent"]))},[rl,Object(E["createElementVNode"])("span",sl,Object(E["toDisplayString"])(e.translate("General_ExportThisReport")),1)],8,al)),[[l,{reportTitle:e.reportTitle,requestParams:e.requestParams,apiMethod:e.apiMethodToRequestDataTable,reportFormats:e.reportFormats,maxFilterLimit:e.maxFilterLimit}]]):Object(E["createCommentVNode"])("",!0),e.showExportAsImageIcon?(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:4,class:"dataTableAction tableIcon",href:"",id:"dataTableFooterExportAsImageIcon",onClick:t[3]||(t[3]=Object(E["withModifiers"])(t=>e.showExportImage(t),["prevent"])),title:e.translate("General_ExportAsImage"),style:{"margin-right":"3.5px"}},dl,8,ll)):Object(E["createCommentVNode"])("",!0),e.showAnnotations?(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:5,class:"dataTableAction annotationView",href:"",title:e.translate("Annotations_Annotations"),onClick:t[4]||(t[4]=Object(E["withModifiers"])(()=>{},["prevent"])),style:{"margin-right":"3.5px"}},pl,8,ul)):Object(E["createCommentVNode"])("",!0),e.showSearch?(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:6,class:"dropdown-button dataTableAction searchAction",href:"",title:e.translate("General_Search"),style:{"margin-right":"3.5px"},draggable:"false",onClick:t[5]||(t[5]=Object(E["withModifiers"])(()=>{},["prevent"]))},[gl,Object(E["createElementVNode"])("span",{class:"icon-close",draggable:"false",title:e.translate("CoreHome_CloseSearch")},null,8,bl),Object(E["createElementVNode"])("input",{id:`widgetSearch_${e.reportId}_${e.placement}`,title:e.translate("CoreHome_DataTableHowToSearch"),type:"text",class:"dataTableSearchInput"},null,8,fl)],8,hl)):Object(E["createCommentVNode"])("",!0),(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.dataTableActions,e=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:e.id,class:Object(E["normalizeClass"])("dataTableAction "+e.id),href:"",onClick:t[6]||(t[6]=Object(E["withModifiers"])(()=>{},["prevent"])),title:e.title,style:{"margin-right":"3.5px"}},[/^icon-/.test(e.icon||"")?(Object(E["openBlock"])(),Object(E["createElementBlock"])("span",{key:0,class:Object(E["normalizeClass"])(e.icon)},null,2)):(Object(E["openBlock"])(),Object(E["createElementBlock"])("img",{key:1,width:"16",height:"16",title:e.title,src:e.icon},null,8,Ol))],10,vl))),128)),Object(E["createElementVNode"])("ul",{id:"dropdownConfigure"+e.randomIdForDropdown,class:"dropdown-content tableConfiguration"},[e.showFlattenTable?(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",yl,[Object(E["createElementVNode"])("div",{class:"configItem dataTableFlatten",innerHTML:e.$sanitize(e.flattenItemText)},null,8,wl)])):Object(E["createCommentVNode"])("",!0),e.showDimensionsConfigItem?(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",Sl,[Object(E["createElementVNode"])("div",{class:"configItem dataTableShowDimensions",innerHTML:e.$sanitize(e.showDimensionsText)},null,8,kl)])):Object(E["createCommentVNode"])("",!0),e.showFlatConfigItem?(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",Cl,[Object(E["createElementVNode"])("div",{class:"configItem dataTableIncludeAggregateRows",innerHTML:e.$sanitize(e.includeAggregateRowsText)},null,8,El)])):Object(E["createCommentVNode"])("",!0),e.showTotalsConfigItem?(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",Dl,[Object(E["createElementVNode"])("div",{class:"configItem dataTableShowTotalsRow",innerHTML:e.$sanitize(e.keepTotalsRowText)},null,8,Pl)])):Object(E["createCommentVNode"])("",!0),e.showExcludeLowPopulation?(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",Tl,[Object(E["createElementVNode"])("div",{class:"configItem dataTableExcludeLowPopulation",innerHTML:e.$sanitize(e.excludeLowPopText)},null,8,Vl)])):Object(E["createCommentVNode"])("",!0),e.showPivotBySubtable?(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",Nl,[Object(E["createElementVNode"])("div",{class:"configItem dataTablePivotBySubtable",innerHTML:e.$sanitize(e.pivotByText)},null,8,xl)])):Object(E["createCommentVNode"])("",!0)],8,jl),e.showPeriods?Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:7,class:"dropdown-button dataTableAction activatePeriodsSelection",href:"",onClick:t[7]||(t[7]=Object(E["withModifiers"])(()=>{},["prevent"])),title:e.translate("CoreHome_ChangePeriod"),"data-target":"dropdownPeriods"+e.randomIdForDropdown},[Object(E["createElementVNode"])("div",null,[Ml,Object(E["createElementVNode"])("span",Il,Object(E["toDisplayString"])(e.translations[e.clientSideParameters.period]||e.clientSideParameters.period),1)])],8,Bl)),[[s]]):Object(E["createCommentVNode"])("",!0),e.showPeriods?(Object(E["openBlock"])(),Object(E["createElementBlock"])("ul",{key:8,id:"dropdownPeriods"+e.randomIdForDropdown,class:"dropdown-content dataTablePeriods"},[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.selectablePeriods,t=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{key:t},[Object(E["createElementVNode"])("a",{"data-period":t,class:Object(E["normalizeClass"])("tableIcon "+(e.clientSideParameters.period===t?"activeIcon":""))},[Object(E["createElementVNode"])("span",null,Object(E["toDisplayString"])(e.translations[t]||t),1)],10,Ll)]))),128))],8,Fl)):Object(E["createCommentVNode"])("",!0)])):Object(E["createCommentVNode"])("",!0)}const{$:_l}=window;function Rl(e,t,o){if(/(%(.\$)?s+)/g.test(a(e))){const i=['
'];o&&i.push(o);let n=a(e,...i);return t&&(n+=` (${a("CoreHome_Default")})`),n+="",n}return a(e)}function Hl(e,t,o){return e?Rl(t,!0):Rl(o)}function $l(e){return!!e&&"0"!==e}var Ul=Object(E["defineComponent"])({props:{showPeriods:Boolean,showFooter:Boolean,showFooterIcons:Boolean,showSearch:Boolean,showFlattenTable:Boolean,footerIcons:{type:Array,required:!0},viewDataTable:{type:String,required:!0},reportTitle:String,requestParams:{type:Object,required:!0},apiMethodToRequestDataTable:{type:String,required:!0},maxFilterLimit:{type:Number,required:!0},showExport:Boolean,showExportAsImageIcon:Boolean,showAnnotations:Boolean,reportId:{type:String,required:!0},dataTableActions:{type:Array,required:!0},clientSideParameters:{type:Object,required:!0},hasMultipleDimensions:Boolean,isDataTableEmpty:Boolean,showTotalsRow:Boolean,showExcludeLowPopulation:Boolean,showPivotBySubtable:Boolean,selectablePeriods:Array,translations:{type:Object,required:!0},pivotDimensionName:String,placement:{type:String,default:"footer"}},components:{Passthrough:qs},directives:{DropdownButton:kt,ReportExport:ks},methods:{showExportImage(e){_l(e.target).closest(".dataTable").find("div.jqplot-target").trigger("piwikExportAsImage")}},computed:{randomIdForDropdown(){return Math.floor(999999*Math.random())},allFooterIcons(){return this.footerIcons.reduce((e,t)=>(e.push(...t.buttons),e),[])},activeFooterIcons(){const e=this.clientSideParameters,t=[this.viewDataTable];return 0===e.abandonedCarts||"0"===e.abandonedCarts?t.push("ecommerceOrder"):1!==e.abandonedCarts&&"1"!==e.abandonedCarts||t.push("ecommerceAbandonedCart"),t.map(e=>this.allFooterIcons.find(t=>t.id===e)).filter(e=>!!e)},activeFooterIcon(){var e;return null===(e=this.activeFooterIcons[0])||void 0===e?void 0:e.icon},activeFooterIconIds(){return this.activeFooterIcons.map(e=>e.id)},numIcons(){return this.allFooterIcons.length},hasFooterIconsToShow(){return!!this.activeFooterIcons.length&&this.numIcons>1},reportFormats(){const e={TSV:"TSV (Excel)",HTML:"HTML",JSON:"JSON",XML:"XML",CSV:"CSV",RSS:"RSS"};return e},showDimensionsConfigItem(){return this.showFlattenTable&&""+this.clientSideParameters.flat==="1"&&this.hasMultipleDimensions},showFlatConfigItem(){return this.showFlattenTable&&""+this.clientSideParameters.flat==="1"},showTotalsConfigItem(){return!this.isDataTableEmpty&&this.showTotalsRow},hasConfigItems(){return this.showFlattenTable||this.showDimensionsConfigItem||this.showFlatConfigItem||this.showTotalsConfigItem||this.showExcludeLowPopulation||this.showPivotBySubtable},flattenItemText(){const e=this.clientSideParameters;return Hl($l(e.flat),"CoreHome_UnFlattenDataTable","CoreHome_FlattenDataTable")},keepTotalsRowText(){const e=this.clientSideParameters;return Hl($l(e.keep_totals_row),"CoreHome_RemoveTotalsRowDataTable","CoreHome_AddTotalsRowDataTable")},includeAggregateRowsText(){const e=this.clientSideParameters;return Hl($l(e.include_aggregate_rows),"CoreHome_DataTableExcludeAggregateRows","CoreHome_DataTableIncludeAggregateRows")},showDimensionsText(){const e=this.clientSideParameters;return Hl($l(e.show_dimensions),"CoreHome_DataTableCombineDimensions","CoreHome_DataTableShowDimensions")},pivotByText(){const e=this.clientSideParameters;return $l(e.pivotBy)?Rl("CoreHome_UndoPivotBySubtable",!0):Rl("CoreHome_PivotBySubtable",!1,this.pivotDimensionName)},excludeLowPopText(){const e=this.clientSideParameters;return Hl($l(e.enable_filter_excludelowpop),"CoreHome_IncludeRowsWithLowPopulation","CoreHome_ExcludeRowsWithLowPopulation")},isAnyConfigureIconHighlighted(){const e=this.clientSideParameters;return $l(e.flat)||$l(e.keep_totals_row)||$l(e.include_aggregate_rows)||$l(e.show_dimensions)||$l(e.pivotBy)||$l(e.enable_filter_excludelowpop)},isTableView(){return"table"===this.viewDataTable||"tableAllColumns"===this.viewDataTable||"tableGoals"===this.viewDataTable}}});Ul.render=Al;var ql=Ul;const Wl={key:0,class:"title",style:{cursor:"pointer"},ref:"expander"},zl=Object(E["createElementVNode"])("span",{class:"icon-warning"},null,-1),Gl={key:1,class:"title",href:"?module=CoreUpdater&action=newVersionAvailable",style:{cursor:"pointer"},ref:"expander"},Yl=Object(E["createElementVNode"])("span",{class:"icon-warning"},null,-1),Jl=["innerHTML"],Kl=["href"],Ql={id:"updateCheckLinkContainer"},Xl={class:"dropdown positionInViewport"},Zl=["innerHTML"],ec=["innerHTML"];function tc(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("Passthrough"),s=Object(E["resolveDirective"])("expand-on-hover");return Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{id:"header_message",class:Object(E["normalizeClass"])(["piwikSelector",{header_info:!e.latestVersionAvailable||e.lastUpdateCheckFailed,update_available:e.latestVersionAvailable}])},[e.latestVersionAvailable?(Object(E["openBlock"])(),Object(E["createBlock"])(r,{key:0},{default:Object(E["withCtx"])(()=>[e.isMultiServerEnvironment?(Object(E["openBlock"])(),Object(E["createElementBlock"])("span",Wl,[Object(E["createTextVNode"])(Object(E["toDisplayString"])(e.translate("General_NewUpdatePiwikX",e.latestVersionAvailable))+" ",1),zl],512)):(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",Gl,[Object(E["createTextVNode"])(Object(E["toDisplayString"])(e.translate("General_NewUpdatePiwikX",e.latestVersionAvailable))+" ",1),Yl],512))]),_:1})):e.isSuperUser&&(e.isAdminArea||e.lastUpdateCheckFailed)?(Object(E["openBlock"])(),Object(E["createBlock"])(r,{key:1},{default:Object(E["withCtx"])(()=>[e.isInternetEnabled?(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:0,class:"title",innerHTML:e.$sanitize(e.updateCheck)},null,8,Jl)):(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:1,class:"title",href:e.externalRawLink("https://matomo.org/changelog/"),target:"_blank",rel:"noreferrer noopener"},[Object(E["createElementVNode"])("span",Ql,Object(E["toDisplayString"])(e.translate("CoreHome_SeeAvailableVersions")),1)],8,Kl))]),_:1})):Object(E["createCommentVNode"])("",!0),Object(E["createElementVNode"])("div",Xl,[e.latestVersionAvailable&&e.isSuperUser?(Object(E["openBlock"])(),Object(E["createElementBlock"])("span",{key:0,innerHTML:e.$sanitize(e.updateNowText)},null,8,Zl)):e.latestVersionAvailable&&e.hasSomeViewAccess&&!e.isAnonymous?(Object(E["openBlock"])(),Object(E["createElementBlock"])("span",{key:1,innerHTML:e.$sanitize(e.updateAvailableText)},null,8,ec)):Object(E["createCommentVNode"])("",!0),Object(E["createTextVNode"])(" "+Object(E["toDisplayString"])(e.translate("General_YouAreCurrentlyUsing",e.piwikVersion)),1)])],2)),[[s,{expander:"expander"}]])}var oc=Object(E["defineComponent"])({props:{isMultiServerEnvironment:Boolean,lastUpdateCheckFailed:Boolean,latestVersionAvailable:String,isSuperUser:Boolean,isAdminArea:Boolean,isInternetEnabled:Boolean,updateCheck:String,isAnonymous:Boolean,hasSomeViewAccess:Boolean,contactEmail:String,piwikVersion:String},components:{Passthrough:qs},directives:{ExpandOnHover:jt},computed:{updateNowText(){let e="";if(this.isMultiServerEnvironment){const t=ae(`https://builds.matomo.org/matomo-${this.latestVersionAvailable}.zip`);e=a("CoreHome_OneClickUpdateNotPossibleAsMultiServerEnvironment",`builds.matomo.org`)}else e=a("General_PiwikXIsAvailablePleaseUpdateNow",this.latestVersionAvailable||"",'
',"",re("https://matomo.org/changelog/"),"