Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CustomDimensions.umd.min.js « dist « vue « CustomDimensions « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 153d745042a32c9ca729331dcce9fa9908bfbc61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["CustomDimensions"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["CustomDimensions"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,n){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/CustomDimensions/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},a5a2:function(e,t){e.exports=n},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"CustomDimensionsStore",(function(){return B})),n.d(t,"Edit",(function(){return P})),n.d(t,"List",(function(){return pe})),n.d(t,"Manage",(function(){return Se})),"undefined"!==typeof window){var i=window.document.currentScript,o=i&&i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);o&&(n.p=o[1])}var s=n("19dc"),a=n("8bbf"),c={class:"editCustomDimension"},r={class:"loadingPiwik"},l=Object(a["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),u={class:"row form-group"},m={class:"col s12"},d={class:"col s12 m6"},p={class:"row"},b={class:"col s12 m6"},f={class:"col s12 m6"},v={class:"col s12"},O=["onClick"],j={class:"row"},h={class:"col s12"},D={class:"col s12 m6 form-help"},C=["value","disabled"],g=["value","disabled"],V={class:"btn cancel",type:"button",href:"#list"},E={class:"alert alert-info howToTrackInfo"},S=["innerHTML"],N=["innerHTML"],y=["innerHTML"],x=["innerHTML"];function w(e,t,n,i,o,s){var w=Object(a["resolveComponent"])("Field"),k=Object(a["resolveComponent"])("ContentBlock"),_=Object(a["resolveDirective"])("select-on-focus");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",c,[Object(a["createVNode"])(k,{"content-title":e.contentTitleText},{default:Object(a["withCtx"])((function(){var n;return[Object(a["withDirectives"])(Object(a["createElementVNode"])("p",null,[Object(a["createElementVNode"])("span",r,[l,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("General_LoadingData")),1)])],512),[[a["vShow"],e.isLoading||e.isUpdating]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("form",{onSubmit:t[4]||(t[4]=Object(a["withModifiers"])((function(t){return e.edit?e.updateCustomDimension():e.createCustomDimension()}),["prevent"]))},[Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(w,{uicontrol:"text",name:"name",modelValue:e.dimension.name,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.dimension.name=t}),maxlength:255,required:!0,title:e.translate("General_Name"),"inline-help":e.translate("CustomDimensions_NameAllowedCharacters")},null,8,["modelValue","title","inline-help"])]),Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(w,{uicontrol:"checkbox",name:"active",modelValue:e.dimension.active,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.dimension.active=t}),title:e.translate("CorePluginsAdmin_Active"),"inline-help":e.translate("CustomDimensions_CannotBeDeleted")},null,8,["modelValue","title","inline-help"])]),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",u,[Object(a["createElementVNode"])("h3",m,Object(a["toDisplayString"])(e.translate("CustomDimensions_ExtractValue")),1),Object(a["createElementVNode"])("div",d,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.dimension.extractions,(function(n,i){return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{class:Object(a["normalizeClass"])("".concat(i,"extraction ")),key:i},[Object(a["createElementVNode"])("div",p,[Object(a["createElementVNode"])("div",b,[Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(w,{uicontrol:"select",name:"".concat(i,"dimension"),modelValue:n.dimension,"onUpdate:modelValue":function(e){return n.dimension=e},"full-width":!0,options:e.extractionDimensionsOptions},null,8,["name","modelValue","onUpdate:modelValue","options"])])]),Object(a["createElementVNode"])("div",f,[Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(w,{uicontrol:"text",name:"".concat(i,"pattern"),modelValue:n.pattern,"onUpdate:modelValue":function(e){return n.pattern=e},"full-width":!0,title:"urlparam"===n.dimension?e.translate("CustomDimensions_UrlQueryStringParameter"):"eg. /blog/(.*)/"},null,8,["name","modelValue","onUpdate:modelValue","title"])])]),Object(a["createElementVNode"])("div",v,[Object(a["withDirectives"])(Object(a["createElementVNode"])("span",{class:"icon-plus",onClick:t[2]||(t[2]=function(t){return e.addExtraction()})},null,512),[[a["vShow"],n.pattern]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("span",{class:"icon-minus",onClick:function(t){return e.removeExtraction(i)}},null,8,O),[[a["vShow"],e.dimension.extractions.length>1]])])])],2)})),128)),Object(a["createElementVNode"])("div",j,[Object(a["createElementVNode"])("div",h,[Object(a["createElementVNode"])("div",null,[Object(a["withDirectives"])(Object(a["createVNode"])(w,{uicontrol:"checkbox",name:"casesensitive",modelValue:e.dimension.case_sensitive,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.dimension.case_sensitive=t}),title:e.translate("Goals_CaseSensitive")},null,8,["modelValue","title"]),[[a["vShow"],null===(n=e.dimension.extractions[0])||void 0===n?void 0:n.pattern]])])])])]),Object(a["createElementVNode"])("div",D,Object(a["toDisplayString"])(e.translate("CustomDimensions_ExtractionsHelp")),1)],512),[[a["vShow"],e.doesScopeSupportExtraction]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{class:"btn update",type:"submit",value:e.translate("General_Update"),disabled:e.isUpdating,style:{"margin-right":"3.5px"}},null,8,C),[[a["vShow"],e.edit]]),Object(a["withDirectives"])(Object(a["createElementVNode"])("input",{class:"btn create",type:"submit",value:e.translate("General_Create"),disabled:e.isUpdating,style:{"margin-right":"3.5px"}},null,8,g),[[a["vShow"],e.create]]),Object(a["createElementVNode"])("a",V,Object(a["toDisplayString"])(e.translate("General_Cancel")),1)],32),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",E,[Object(a["createElementVNode"])("strong",null,Object(a["toDisplayString"])(e.translate("CustomDimensions_HowToTrackManuallyTitle")),1),Object(a["createElementVNode"])("p",null,Object(a["toDisplayString"])(e.translate("CustomDimensions_HowToTrackManuallyViaJs")),1),Object(a["withDirectives"])(Object(a["createElementVNode"])("pre",null,[Object(a["createElementVNode"])("code",{innerHTML:e.$sanitize(e.manuallyTrackCodeViaJs(e.dimension))},null,8,S)],512),[[_,{}]]),Object(a["createElementVNode"])("p",{innerHTML:e.$sanitize(e.howToTrackManuallyText)},null,8,N),Object(a["createElementVNode"])("p",null,Object(a["toDisplayString"])(e.translate("CustomDimensions_HowToTrackManuallyViaPhp")),1),Object(a["withDirectives"])(Object(a["createElementVNode"])("pre",null,[Object(a["createElementVNode"])("code",{innerHTML:e.$sanitize(e.manuallyTrackCodeViaPhp(e.dimension))},null,8,y)],512),[[_,{}]]),Object(a["createElementVNode"])("p",null,Object(a["toDisplayString"])(e.translate("CustomDimensions_HowToTrackManuallyViaHttp")),1),Object(a["withDirectives"])(Object(a["createElementVNode"])("pre",null,[Object(a["createElementVNode"])("code",{innerHTML:e.$sanitize(e.manuallyTrackCode)},null,8,x)],512),[[_,{}]])],512),[[a["vShow"],e.edit]])],512),[[a["vShow"],!e.isLoading]])]})),_:1},8,["content-title"])])}var k=n("a5a2");function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function M(e,t,n){return t&&T(e.prototype,t),n&&T(e,n),e}function A(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */var U=function(){function e(){var t=this;_(this,e),A(this,"privateState",Object(a["reactive"])({customDimensions:[],availableScopes:[],extractionDimensions:[],isLoading:!1,isUpdating:!1})),A(this,"state",Object(a["computed"])((function(){return Object(a["readonly"])(t.privateState)}))),A(this,"isLoading",Object(a["computed"])((function(){return t.state.value.isLoading}))),A(this,"isUpdating",Object(a["computed"])((function(){return t.state.value.isUpdating}))),A(this,"extractionDimensions",Object(a["computed"])((function(){return t.state.value.extractionDimensions}))),A(this,"extractionDimensionsOptions",Object(a["computed"])((function(){return t.extractionDimensions.value.map((function(e){return{key:e.value,value:e.name}}))}))),A(this,"availableScopes",Object(a["computed"])((function(){return t.state.value.availableScopes}))),A(this,"customDimensions",Object(a["computed"])((function(){return t.state.value.customDimensions}))),A(this,"customDimensionsById",Object(a["computed"])((function(){var e={};return t.customDimensions.value.forEach((function(t){e["".concat(t.idcustomdimension)]=t})),e}))),A(this,"reloadPromise",null)}return M(e,[{key:"reload",value:function(){return this.privateState.customDimensions=[],this.privateState.availableScopes=[],this.privateState.extractionDimensions=[],this.reloadPromise=null,this.fetch()}},{key:"fetch",value:function(){var e=this;return this.reloadPromise||(this.privateState.isLoading=!0,this.reloadPromise=Promise.all([this.fetchConfiguredCustomDimensions(),this.fetchAvailableExtractionDimensions(),this.fetchAvailableScopes()]).finally((function(){e.privateState.isLoading=!1}))),this.reloadPromise}},{key:"fetchConfiguredCustomDimensions",value:function(){var e=this;return s["AjaxHelper"].fetch({method:"CustomDimensions.getConfiguredCustomDimensions",filter_limit:"-1"}).then((function(t){e.privateState.customDimensions=t}))}},{key:"fetchAvailableExtractionDimensions",value:function(){var e=this;return s["AjaxHelper"].fetch({method:"CustomDimensions.getAvailableExtractionDimensions",filter_limit:"-1"}).then((function(t){e.privateState.extractionDimensions=t}))}},{key:"fetchAvailableScopes",value:function(){var e=this;return s["AjaxHelper"].fetch({method:"CustomDimensions.getAvailableScopes",filter_limit:"-1"}).then((function(t){e.privateState.availableScopes=t}))}},{key:"createOrUpdateDimension",value:function(e,t){var n=this;return this.privateState.isUpdating=!0,s["AjaxHelper"].post({method:t,scope:e.scope,idDimension:e.idcustomdimension,idSite:e.idsite,name:e.name,active:e.active?"1":"0",caseSensitive:e.case_sensitive?"1":"0"},{extractions:e.extractions}).finally((function(){n.privateState.isUpdating=!1}))}}]),e}(),B=new U;
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */
function L(e){return"".concat(e[0].toUpperCase()).concat(e.slice(1))}var H="customdimensions",I=Object(a["defineComponent"])({props:{dimensionId:Number,dimensionScope:{type:String,required:!0}},components:{ContentBlock:s["ContentBlock"],Field:k["Field"]},directives:{SelectOnFocus:s["SelectOnFocus"]},data:function(){return{dimension:{extractions:[]},isUpdatingDim:!1}},created:function(){this.init()},watch:{dimensionId:function(){this.init()}},methods:{removeAnyCustomDimensionNotification:function(){s["NotificationsStore"].remove(H)},showNotification:function(e,t){s["NotificationsStore"].show({message:e,context:t,id:H,type:"transient"})},init:function(){var e=this;null!==this.dimensionId&&this.removeAnyCustomDimensionNotification(),B.fetch().then((function(){e.edit&&e.dimensionId?(e.dimension=Object(s["clone"])(B.customDimensionsById.value[e.dimensionId]),e.dimension&&!e.dimension.extractions.length&&e.addExtraction()):e.create&&(e.dimension={idsite:s["Matomo"].idSite,name:"",active:!1,extractions:[],scope:e.dimensionScope,case_sensitive:!0},e.addExtraction())}))},removeExtraction:function(e){e>-1&&this.dimension.extractions.splice(e,1)},addExtraction:function(){this.doesScopeSupportExtraction&&this.dimension.extractions.push({dimension:"url",pattern:""})},createCustomDimension:function(){var e=this;this.isUpdatingDim=!0,B.createOrUpdateDimension(this.dimension,"CustomDimensions.configureNewCustomDimension").then((function(){e.showNotification(Object(s["translate"])("CustomDimensions_DimensionCreated"),"success"),B.reload(),s["MatomoUrl"].updateHashToUrl("/list")})).finally((function(){e.isUpdatingDim=!1}))},updateCustomDimension:function(){var e=this;this.isUpdatingDim=!0,B.createOrUpdateDimension(this.dimension,"CustomDimensions.configureExistingCustomDimension").then((function(){e.showNotification(Object(s["translate"])("CustomDimensions_DimensionUpdated"),"success"),B.reload(),s["MatomoUrl"].updateHashToUrl("/list")})).finally((function(){e.isUpdatingDim=!1}))},manuallyTrackCodeViaJs:function(e){return"_paq.push(['setCustomDimension', ".concat(e.idcustomdimension,", ")+"'".concat(Object(s["translate"])("CustomDimensions_ExampleValue"),"']);")},manuallyTrackCodeViaPhp:function(e){return"$tracker->setCustomDimension('".concat(e.idcustomdimension,"', ")+"'".concat(Object(s["translate"])("CustomDimensions_ExampleValue"),"');")}},computed:{isLoading:function(){return B.isLoading.value},isUpdating:function(){return B.isUpdating.value||this.isUpdatingDim},create:function(){return 0===this.dimensionId},edit:function(){return!this.create},extractionDimensionsOptions:function(){return B.extractionDimensionsOptions.value},availableScopes:function(){return B.availableScopes.value},doesScopeSupportExtraction:function(){var e,t=this;if(null===(e=this.dimension)||void 0===e||!e.scope||!this.availableScopes)return!1;var n=this.availableScopes.find((function(e){return e.value===t.dimension.scope}));return null===n||void 0===n?void 0:n.supportsExtractions},contentTitleText:function(){var e;return Object(s["translate"])("CustomDimensions_ConfigureDimension",L(this.dimensionScope),"".concat((null===(e=this.dimension)||void 0===e?void 0:e.index)||""))},howToTrackManuallyText:function(){var e="https://developer.piwik.org/guides/tracking-javascript-guide#custom-dimensions";return Object(s["translate"])("CustomDimensions_HowToTrackManuallyViaJsDetails",'<a target=_blank href="'.concat(e,'" rel="noreferrer noopener">'),"</a>")},manuallyTrackCode:function(){var e=Object(s["translate"])("CustomDimensions_ExampleValue");return"&dimension".concat(this.dimension.idcustomdimension,"=").concat(e)}}});I.render=w;var P=I,q=(Object(s["createAngularJsAdapter"])({component:P,scope:{dimensionId:{angularJsBind:"=",transform:s["transformAngularJsIntAttr"]},dimensionScope:{angularJsBind:"="}},directiveName:"piwikCustomDimensionsEdit"}),["innerHTML"]),z={class:"loadingPiwik"},F=Object(a["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),G={class:"index"},J={class:"name"},$={class:"active"},Q={class:"action"},X={colspan:"5"},Y={class:"index"},K={class:"name"},R={class:"extractions"},W={class:"active"},Z={class:"action"},ee=["href"],te={class:"tableActionBar"},ne=["disabled","onClick"],ie=Object(a["createElementVNode"])("span",{class:"icon-add"},null,-1),oe={class:"info"};
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */function se(e,t,n,i,o,s){var c=Object(a["resolveComponent"])("EnrichedHeadline"),r=Object(a["resolveComponent"])("ContentBlock"),l=Object(a["resolveDirective"])("content-intro"),u=Object(a["resolveDirective"])("content-table");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",null,[Object(a["withDirectives"])(Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("h2",null,[Object(a["createVNode"])(c,null,{default:Object(a["withCtx"])((function(){return[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("CustomDimensions_CustomDimensions")),1)]})),_:1})]),Object(a["createElementVNode"])("p",{innerHTML:e.$sanitize(e.contentIntroText)},null,8,q),Object(a["withDirectives"])(Object(a["createElementVNode"])("p",null,[Object(a["createElementVNode"])("span",z,[F,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("General_LoadingData")),1)])],512),[[a["vShow"],e.isLoading]])],512),[[l]]),(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.availableScopes,(function(t){return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{key:t.value},[Object(a["createVNode"])(r,{"content-title":"".concat(t.name," Dimensions")},{default:Object(a["withCtx"])((function(){return[Object(a["createElementVNode"])("p",null,Object(a["toDisplayString"])(e.translate("CustomDimensions_ScopeDescription".concat(e.ucfirst(t.value))))+" "+Object(a["toDisplayString"])(e.translate("CustomDimensions_ScopeDescription".concat(e.ucfirst(t.value),"MoreInfo"))),1),Object(a["withDirectives"])(Object(a["createElementVNode"])("table",null,[Object(a["createElementVNode"])("thead",null,[Object(a["createElementVNode"])("tr",null,[Object(a["createElementVNode"])("th",G,Object(a["toDisplayString"])(e.translate("General_Id")),1),Object(a["createElementVNode"])("th",J,Object(a["toDisplayString"])(e.translate("General_Name")),1),Object(a["withDirectives"])(Object(a["createElementVNode"])("th",{class:"extractions"},Object(a["toDisplayString"])(e.translate("CustomDimensions_Extractions")),513),[[a["vShow"],t.supportsExtractions]]),Object(a["createElementVNode"])("th",$,Object(a["toDisplayString"])(e.translate("CorePluginsAdmin_Active")),1),Object(a["createElementVNode"])("th",Q,Object(a["toDisplayString"])(e.translate("General_Action")),1)])]),Object(a["createElementVNode"])("tbody",null,[Object(a["withDirectives"])(Object(a["createElementVNode"])("tr",null,[Object(a["createElementVNode"])("td",X,Object(a["toDisplayString"])(e.translate("CustomDimensions_NoCustomDimensionConfigured")),1)],512),[[a["vShow"],0===t.numSlotsUsed&&!e.isLoading]]),(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.sortedCustomDimensionsByScope[t.value],(function(e){var n;return Object(a["openBlock"])(),Object(a["createElementBlock"])("tr",{class:Object(a["normalizeClass"])(["customdimension",e.idcustomdimension]),key:e.idcustomdimension},[Object(a["createElementVNode"])("td",Y,Object(a["toDisplayString"])(e.idcustomdimension),1),Object(a["createElementVNode"])("td",K,Object(a["toDisplayString"])(e.name),1),Object(a["withDirectives"])(Object(a["createElementVNode"])("td",R,[Object(a["createElementVNode"])("span",{class:Object(a["normalizeClass"])({"icon-ok":null===(n=e.extractions[0])||void 0===n?void 0:n.pattern})},null,2)],512),[[a["vShow"],t.supportsExtractions]]),Object(a["createElementVNode"])("td",W,[Object(a["createElementVNode"])("span",{class:Object(a["normalizeClass"])({"icon-ok":e.active})},null,2)]),Object(a["createElementVNode"])("td",Z,[Object(a["createElementVNode"])("a",{class:"table-action icon-edit",href:"#?idDimension=".concat(e.idcustomdimension,"&scope=").concat(t.value)},null,8,ee)])],2)})),128))])],512),[[u]]),Object(a["createElementVNode"])("div",te,[Object(a["withDirectives"])(Object(a["createElementVNode"])("button",{class:"btn",disabled:!t.numSlotsLeft,onClick:function(n){return e.addDimension(t.value)}},[ie,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("CustomDimensions_ConfigureNewDimension"))+" ",1),Object(a["createElementVNode"])("span",oe,"("+Object(a["toDisplayString"])(e.translate("CustomDimensions_XofYLeft",t.numSlotsLeft,t.numSlotsAvailable))+")",1)],8,ne),[[a["vShow"],!e.isLoading]])])]})),_:2},1032,["content-title"])],512)),[[a["vShow"],!e.isLoading]])})),128))])}function ae(e){return ue(e)||le(e)||re(e)||ce()}function ce(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function re(e,t){if(e){if("string"===typeof e)return me(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?me(e,t):void 0}}function le(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function ue(e){if(Array.isArray(e))return me(e)}function me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var de=Object(a["defineComponent"])({name:"listcustomdimensions",components:{EnrichedHeadline:s["EnrichedHeadline"],ContentBlock:s["ContentBlock"]},directives:{ContentIntro:s["ContentIntro"],ContentTable:s["ContentTable"]},created:function(){B.fetch()},methods:{ucfirst:function(e){return L(e)},addDimension:function(e){s["MatomoUrl"].updateHashToUrl("/?idDimension=0&scope=".concat(e))}},computed:{isLoading:function(){return B.isLoading.value},availableScopes:function(){return B.availableScopes.value},contentIntroText:function(){var e=Object(s["translate"])("CustomDimensions_CustomDimensionsIntroNext",'<a target=_blank href="https://piwik.org/docs/custom-variables">',"</a>",'<a target=_blank href="https://piwik.org/faq/general/faq_21117">',"</a>"),t=Object(s["translate"])("CustomDimensions_CustomDimensionsIntro",'<a target=_blank href="https://piwik.org/docs/custom-dimensions">',"</a>",this.siteName);return"".concat(e).concat(t)},customDimensions:function(){return B.customDimensions.value},sortedCustomDimensions:function(){var e=ae(this.customDimensions);return e.sort((function(e,t){var n=parseInt("".concat(e.idcustomdimension),10),i=parseInt("".concat(t.idcustomdimension),10);return n-i})),e},sortedCustomDimensionsByScope:function(){var e={};return this.sortedCustomDimensions.reduce((function(e,t){return e[t.scope]=e[t.scope]||[],e[t.scope].push(t),e}),e),e},siteName:function(){return s["Matomo"].helper.htmlDecode(s["Matomo"].siteName)}}});de.render=se;var pe=de,be=(Object(s["createAngularJsAdapter"])({component:pe,directiveName:"piwikCustomDimensionsList"}),{class:"manageCustomDimensions"}),fe={key:0},ve=Object(a["createElementVNode"])("br",null,null,-1),Oe=Object(a["createElementVNode"])("br",null,null,-1),je=Object(a["createElementVNode"])("br",null,null,-1),he=Object(a["createElementVNode"])("br",null,null,-1),De=["textContent"],Ce=["textContent"],ge={key:1};
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */function Ve(e,t,n,i,o,s){var c=Object(a["resolveComponent"])("CustomDimensionsList"),r=Object(a["resolveComponent"])("ContentBlock"),l=Object(a["resolveComponent"])("CustomDimensionsEdit"),u=Object(a["resolveDirective"])("select-on-focus");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",be,[e.editMode?Object(a["createCommentVNode"])("",!0):(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",fe,[Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(c)]),Object(a["createVNode"])(r,{id:"customDimensionsCreateMoreDimensions","content-title":e.translate("CustomDimensions_IncreaseAvailableCustomDimensionsTitle")},{default:Object(a["withCtx"])((function(){return[Object(a["createElementVNode"])("p",null,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("CustomDimensions_IncreaseAvailableCustomDimensionsTakesLong"))+" ",1),ve,Oe,Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("CustomDimensions_HowToCreateCustomDimension"))+" ",1),je,he]),Object(a["withDirectives"])(Object(a["createElementVNode"])("pre",null,[Object(a["createElementVNode"])("code",{textContent:Object(a["toDisplayString"])(e.addCustomDimCode)},null,8,De)],512),[[u,{}]]),Object(a["createElementVNode"])("p",null,Object(a["toDisplayString"])(e.translate("CustomDimensions_HowToManyCreateCustomDimensions"))+" "+Object(a["toDisplayString"])(e.translate("CustomDimensions_ExampleCreateCustomDimensions",5)),1),Object(a["withDirectives"])(Object(a["createElementVNode"])("pre",null,[Object(a["createElementVNode"])("code",{textContent:Object(a["toDisplayString"])(e.addMultipleCustomDimCode)},null,8,Ce)],512),[[u,{}]])]})),_:1},8,["content-title"])])),e.editMode?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",ge,[Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(l,{"dimension-id":e.dimensionId,"dimension-scope":e.dimensionScope},null,8,["dimension-id","dimension-scope"])])])):Object(a["createCommentVNode"])("",!0)])}var Ee=Object(a["defineComponent"])({components:{CustomDimensionsList:pe,ContentBlock:s["ContentBlock"],CustomDimensionsEdit:P},directives:{SelectOnFocus:s["SelectOnFocus"]},data:function(){return{editMode:!1,dimensionId:null,dimensionScope:""}},created:function(){var e=this;Object(a["watch"])((function(){return s["MatomoUrl"].hashParsed.value}),(function(){e.initState()})),this.initState()},methods:{getValidDimensionScope:function(e){return-1!==["action","visit"].indexOf(e)?e:""},initState:function(){var e=s["MatomoUrl"].hashParsed.value.idDimension;if(e){var t=this.getValidDimensionScope(s["MatomoUrl"].hashParsed.value.scope);if("0"===e){var n={isAllowed:!0,scope:t};if(s["Matomo"].postEvent("CustomDimensions.initAddDimension",n),n&&!n.isAllowed)return this.editMode=!1,this.dimensionId=null,void(this.dimensionScope="")}this.editMode=!0,this.dimensionId=parseInt(e,10),this.dimensionScope=t}else this.editMode=!1,this.dimensionId=null,this.dimensionScope="";s["Matomo"].helper.lazyScrollToContent()}},computed:{addCustomDimCode:function(){return"./console customdimensions:add-custom-dimension --scope=action\n./console customdimensions:add-custom-dimension --scope=visit"},addMultipleCustomDimCode:function(){return"./console customdimensions:add-custom-dimension --scope=action --count=5"}}});Ee.render=Ve;var Se=Ee;
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */Object(s["createAngularJsAdapter"])({component:Se,directiveName:"piwikCustomDimensionsManage"})}})}));
//# sourceMappingURL=CustomDimensions.umd.min.js.map