diff --git a/api/org.integratedmodelling.klab.api/src/org/integratedmodelling/klab/api/API.java b/api/org.integratedmodelling.klab.api/src/org/integratedmodelling/klab/api/API.java index 234e25166..dc7cc92b4 100644 --- a/api/org.integratedmodelling.klab.api/src/org/integratedmodelling/klab/api/API.java +++ b/api/org.integratedmodelling.klab.api/src/org/integratedmodelling/klab/api/API.java @@ -470,6 +470,10 @@ public static interface HUB { * Base URL path for custom properties related to a single user. */ public static final String USER_ID_CUSTOM_PROPERTIES = USER_BASE_ID + "/custom-properties"; + /** + * URL path for get SPA pages + */ + public static final String UI = "/ui/*"; public static interface PARAMETERS { /** diff --git a/klab.hub/src/main/java/org/integratedmodelling/klab/hub/security/HubRequestMatchers.java b/klab.hub/src/main/java/org/integratedmodelling/klab/hub/security/HubRequestMatchers.java index d8ed82ab8..9b5ffda3c 100644 --- a/klab.hub/src/main/java/org/integratedmodelling/klab/hub/security/HubRequestMatchers.java +++ b/klab.hub/src/main/java/org/integratedmodelling/klab/hub/security/HubRequestMatchers.java @@ -3,55 +3,23 @@ import org.integratedmodelling.klab.api.API; public final class HubRequestMatchers { - - private static final String[] authentication = new String[] { - API.HUB.AUTHENTICATE_ENGINE, - API.HUB.AUTHENTICATE_LEVER, - API.HUB.AUTHENTICATE_NODE, - API.HUB.AUTHENTICATE_USER, - }; - - private static final String[] usersPost = new String[] { - API.HUB.USER_BASE+".*" + API.HUB.PARAMETERS.USER_ACTIVATION + ".*", - API.HUB.USER_BASE+".*" + API.HUB.PARAMETERS.USER_LOST_PASSWORD + ".*", - API.HUB.USER_BASE+".*" + API.HUB.PARAMETERS.USER_SET_PASSWORD + ".*", - API.HUB.USER_BASE+".*" + API.HUB.PARAMETERS.USER_VERIFICATION + ".*", - API.HUB.USER_BASE+"$" - }; - - private static final String[] usersPut = new String[] { - API.HUB.USER_BASE+".*" + API.HUB.PARAMETERS.USER_SET_EMAIL + ".*", - API.HUB.USER_BASE+"$" - }; - - private static final String[] agreements = new String[] { - API.HUB.AGREEMENT_TEMPLATE_TYPE_LEVEL+"*" - }; - - private static final String[] usersGet = new String[] { - API.HUB.USER_BASE_NOAUTH+".*" + API.HUB.PARAMETERS.USER_GET + ".*", - API.HUB.USER_BASE+"$" - }; - - public static String[] getAuthentication() { - return authentication; - } - - public static String[] getUsersPost() { - return usersPost; - } - - public static String[] getAgreements() { - return agreements; - } - public static String[] getUsersGet() { - return usersGet; - } + private static final String[] authentication = new String[]{API.HUB.AUTHENTICATE_ENGINE, API.HUB.AUTHENTICATE_LEVER, + API.HUB.AUTHENTICATE_NODE}; + + private static final String[] agreements = new String[]{API.HUB.AGREEMENT_TEMPLATE_TYPE_LEVEL + "*"}; - public static String[] getUsersPut() { - return usersPut; - } + private static final String[] ui = new String[]{API.HUB.UI + "*"}; + + public static String[] getAuthentication() { + return authentication; + } - + public static String[] getAgreements() { + return agreements; + } + + public static String[] getUi() { + return ui; + } } diff --git a/klab.hub/src/main/java/org/integratedmodelling/klab/hub/security/WebSecurityConfiguration.java b/klab.hub/src/main/java/org/integratedmodelling/klab/hub/security/WebSecurityConfiguration.java index 04e34996c..c73d72c8b 100644 --- a/klab.hub/src/main/java/org/integratedmodelling/klab/hub/security/WebSecurityConfiguration.java +++ b/klab.hub/src/main/java/org/integratedmodelling/klab/hub/security/WebSecurityConfiguration.java @@ -11,9 +11,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; +import org.springframework.http.HttpMethod; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.core.authority.mapping.SimpleAuthorityMapper; import org.springframework.security.crypto.password.LdapShaPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; @@ -53,27 +55,17 @@ public KeycloakConfigResolver KeycloakConfigResolver() { @Override protected void configure(HttpSecurity http) throws Exception { super.configure(http); - http.cors().and().csrf().disable().authorizeRequests().anyRequest().permitAll(); - + http.cors().and().csrf().disable().authorizeRequests().antMatchers(HttpMethod.GET, HubRequestMatchers.getAgreements()) + .permitAll().antMatchers(HttpMethod.POST, HubRequestMatchers.getAuthentication()).permitAll() + .antMatchers(HttpMethod.GET, HubRequestMatchers.getUi()).permitAll().anyRequest().authenticated().and() + .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS); } -// @Override -// protected void configure(HttpSecurity http) throws Exception { -// super.configure(http); -// http.cors().and().csrf().disable().authorizeRequests().antMatchers(HttpMethod.GET, HubRequestMatchers.getAgreements()) -// .permitAll().antMatchers(HttpMethod.POST, HubRequestMatchers.getAuthentication()).permitAll() -// .regexMatchers(HttpMethod.POST, HubRequestMatchers.getUsersPost()).permitAll() -// .regexMatchers(HttpMethod.GET, HubRequestMatchers.getUsersGet()).permitAll() -// .regexMatchers(HttpMethod.PUT, HubRequestMatchers.getUsersPut()).permitAll().anyRequest().authenticated().and() -// .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS); -// } - @Bean CorsConfigurationSource corsConfigurationSource() { final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); final CorsConfiguration config = new CorsConfiguration(); config.setAllowCredentials(false); - config.setAllowedOrigins(Arrays.asList(corsHostsAllow)); config.setAllowedHeaders(Collections.singletonList("*")); config.addExposedHeader("Content-disposition"); diff --git a/klab.hub/src/main/resources/static/ui/index.html b/klab.hub/src/main/resources/static/ui/index.html index 6e27d1e5e..a505a0382 100644 --- a/klab.hub/src/main/resources/static/ui/index.html +++ b/klab.hub/src/main/resources/static/ui/index.html @@ -1 +1,2 @@ -k.Hub
\ No newline at end of file +k.Hub
\ No newline at end of file diff --git a/klab.hub/src/main/resources/static/ui/js/app.cf864f95.js b/klab.hub/src/main/resources/static/ui/js/app.27ebeff1.js similarity index 84% rename from klab.hub/src/main/resources/static/ui/js/app.cf864f95.js rename to klab.hub/src/main/resources/static/ui/js/app.27ebeff1.js index 301dead56..1de21db45 100644 --- a/klab.hub/src/main/resources/static/ui/js/app.cf864f95.js +++ b/klab.hub/src/main/resources/static/ui/js/app.27ebeff1.js @@ -1 +1 @@ -(function(e){function t(t){for(var a,o,l=t[0],n=t[1],c=t[2],u=0,d=[];ue.isAuthenticated,authStatus:e=>e.isAuthenticated,existProfile:e=>e.existProfile,profile:e=>e.profile,agreement:e=>e.agreement,username:e=>e.profile&&e.profile.name,profileIsLoad:e=>"undefined"!==typeof e.profile.name,needPassword:e=>e.needPassword,admin:e=>e.profile.roles.includes("ROLE_ADMINISTRATOR"),notifications:e=>e.notifications},ae={AUTH_SUCCESS(e,{token:t,profile:s}){e.isAuthenticated=!0,e.status="success",e.token=t,e.profile=s,e.agreement=s.agreements[0].agreement},AUTH_ERROR(e,t){e.status="error",e.statusError=t},LOGOUT(e){e.isAuthenticated=!1,e.status="",e.token="",e.profile={roles:[],groups:[]},e.clickback=""},AUTH_PROFILE_EXIST(e,t){e.existProfile=t},AUTH_PROFILE(e,t){e.profile=t,e.agreement=t.agreements[0].agreement,e.profileLoaded=!0},groups_request_success(e){e.status="success"},groups_request_failure(e){e.status="error"},CERT_REQUEST_SUCCESS(e){e.status="success"},CERT_REQUEST_FAILURE(e){e.status="error"},EMAIL_REQUEST_SUCCESS(e){e.status="success",e.clickback=clickback},EMAIL_REQUEST_FAILURE(e){e.status="failure",e.clickback=""},PASSWORD_REQUEST_SUCCESS(e,t){e.status="success",e.clickback=t},PASSWORD_REQUEST_FAILURE(e){e.status="success",e.clickback=""},PASSWORD_SET_SUCCESS(e){e.status="success",e.clickback=""},PASSWORD_SET_FAILURE(e){e.status="failure",e.clickback=""},REGISTER_SUCCESS(e){e.status="success"},REGISTER_FAILURE(e){e.status="failure"},ACTIVATE_SUCCESS(e,{profile:t,clickback:s}){e.status="success",e.profile=t,e.clickback=s},ACTIVATE_FAILURE(e){e.status="failure"},NOTIFICATIONS_LOADED(e,t){e.status="success",e.notifications=t}},oe=(s("88a7"),s("271a"),s("5494"),s("cee4")),re=s("7cca");const ie=oe["a"].create({baseUrl:__ENV__.BASE_URL,headers:{"Content-Type":"application/json"}});var le=({Vue:e})=>{e.prototype.$http=ie;const t=localStorage.getItem(re["g"].TOKEN);t&&(e.prototype.$http.defaults.headers.common.Authorization=re["g"].BEARER+t)},ne=(s("14d9"),s("bc78")),ce=s("8847"),ue=s("8c4f"),de=s("1dce"),pe=s.n(de),me=function(){var e=this,t=e._self._c;return t("div",[t("q-layout",{staticClass:"kh-layout-page",style:{opacity:e.loggingOut?0:1},attrs:{view:"lHr lpr lfr"}},[t("q-header",{staticClass:"bg-white text-black",attrs:{bordered:""}},[t("q-toolbar",{staticClass:"bg-white text-grey-8 kh-toolbar",attrs:{id:"kh-toolbar"}},[t("q-avatar",[t("klab-spinner",{attrs:{"store-controlled":!0,size:50,ball:4,wrapperId:"kh-toolbar",ballColor:e.COLORS.PRIMARY}})],1),t("klab-brand",{attrs:{customClasses:["kh-app-name "]}}),t("div",{staticClass:"kh-menu"},e._l(e.filteredMenu,(function(s,a){return t("div",{key:`kh-menu-${a}`,staticClass:"kh-menu-item"},[s.route&&null!==s.route?t("router-link",{attrs:{to:{name:s.route},custom:""},scopedSlots:e._u([{key:"default",fn:function({route:a,navigate:o}){return[t("q-btn",{class:[e.isRouteActive(a)?"disabled":""],attrs:{to:a,label:s.label,disable:s.route===e.$route.name,flat:""},on:{click:function(t){e.isRouteActive(a)}}})]}}],null,!0)}):t("q-btn",{attrs:{type:"a",target:s.target,href:s.href,flat:""}},[e._v(e._s(s.label)),"_blank"===s.target?t("q-icon",{staticClass:"q-ma-xs",attrs:{name:"mdi-open-in-new",size:"1em",color:"primary"}}):e._e()],1)],1)})),0),t("q-space"),e._l(e.links,(function(s,a){return t("div",{key:`kh-link-${a}`,staticClass:"kh-link-container"},[t("a",{staticClass:"kh-link",style:{"border-bottom-color":s.color?s.color:e.COLORS.MAIN_COLOR,color:s.color?s.color:e.COLORS.MAIN_COLOR},attrs:{href:s.url,title:s.title,target:"_blank"}},[s.icon?t("i",{class:s.icon}):e._e(),s.img?t("img",{style:{...s.imgWidth&&{width:s.imgWidth}},attrs:{src:s.img,alt:s.title||s.label}}):e._e(),t("span",{domProps:{innerHTML:e._s(s.label)}})])])})),t("q-btn",{staticClass:"small-round",attrs:{round:"",flat:"",icon:"mdi-logout"},on:{click:e.logout}})],2)],1),t("q-page-container",[t("transition",{attrs:{name:"fade",mode:"out-in"}},[t("router-view")],1)],1),t("klab-loading",{attrs:{loading:e.loading,message:""}})],1),t("SignAgreement",{attrs:{open:e.open,agreementText:e.agreementText,register:e.register},on:{"update:open":function(t){e.open=t}}})],1)},he=[],ge=function(){var e=this,t=e._self._c;return t("div",{staticClass:"ks-container"},[t("div",{staticClass:"ks-inner",style:{width:`${e.size}px`,height:`${e.size}px`}},[t("svg",{staticClass:"ks-spinner",attrs:{width:e.size,height:e.size,viewBox:"-120 -120 250 250",version:"1.1",xmlns:"http://www.w3.org/2000/svg"}},[t("g",[t("path",{style:{fill:e.computedLogoColor},attrs:{d:"m -16.409592,-90.96723 c -12.731141,3.59794 -48.295273,15.083119 -67.807071,61.025834 -14.253345,33.488415 -9.270515,65.732442 11.486766,85.52103 11.762457,11.070564 26.293601,22.141638 56.460848,18.543704 0,0 0.413685,11.899764 -28.646647,13.421956 -0.138604,0 -0.137607,-6.24e-4 -0.275681,0.13782 0.691951,0.415268 1.521665,0.830861 2.213562,1.24598 24.355214,8.579676 40.6831588,-6.365553 50.7850434,-21.44918 0,0 15.4987796,14.53115 2.7676326,32.935946 -0.1386,0.27668 0.0019,0.55137 0.278385,0.55137 4.289845,-0.1386 8.441295,-0.55133 12.454363,-1.24328 44.974093,-8.71801 79.015461,-48.29683 79.015461,-95.761805 -0.13859,-23.524924 -8.303479,-44.973534 -22.003241,-61.717741 -2.629265,3.459554 -14.666883,17.988557 -31.549442,15.497686 -50.9245092,-7.611015 -64.486968,15.914431 -64.763747,43.45242 -0.276678,22.971358 -12.178682,33.349477 -12.178682,33.349477 -15.775524,14.253336 -47.880078,1.384892 -41.514544,-45.94168 4.843361,-36.53279 27.953112,-63.239411 53.968907,-76.385668 l -1.659498,-1.108134 c 0,0 1.105979,-2.075735 0.967585,-2.075735 z M 9.7451084,5.900034 c 1.2454676,0 2.3541156,1.105994 2.3541156,2.351411 0,1.245462 -1.108648,2.354112 -2.3541156,2.354112 -1.2454064,0 -2.3514093,-1.10865 -2.3514093,-2.354112 0,-1.245417 1.1060029,-2.351411 2.3514093,-2.351411 z"}})])]),t("div",{staticClass:"ks-circle-container",class:{moving:e.moving},style:{width:`${e.size}px`,height:`${e.size}px`,padding:`${e.circleContainerPadding}px`}},[t("svg",{staticClass:"ks-circle-path",style:{"margin-top":-e.ball+"px"},attrs:{width:2*e.ball,height:2*e.ball,version:"1.1",xmlns:"http://www.w3.org/2000/svg"}},[t("circle",{staticClass:"ks-ball",style:{fill:e.computedBallColor},attrs:{cx:e.ball,cy:e.ball,r:e.ball}})])])])])},be=[],fe={props:{size:{type:Number,default:200},ball:{type:Number,default:12},color:{type:String,default:ne["a"].getBrand("k-main")},logoColor:{type:String,default:re["n"].SPINNER_ELEPHANT_DEFAULT_COLOR},ballColor:{type:String,default:ne["a"].getBrand("primary")},stroke:{type:String,default:"none"},animated:{type:Boolean,default:!0},storeControlled:{type:Boolean,default:!0},wrapperId:{type:String,required:!0}},computed:{...Object(W["c"])("view",["spinner"]),circleContainerPadding(){return this.size*re["o"].WHITE_SPACE_PERCENTAGE},computedLogoColor(){return this.storeControlled&&this.spinner.logoColor||this.logoColor},computedBallColor(){return this.storeControlled&&this.spinner.ballColor||this.ballColor},moving(){return this.storeControlled?this.spinner.animated:this.animated},errorMessage(){return this.spinner.errorMessage},isVisible(){let e;return null!==this.wrapperId&&(e=document.getElementById(this.wrapperId),!(!e||null==e||!e.style)&&!("none"===e.style.display))}},methods:{getBrand(e){return ne["a"].getBrand(e)}},watch:{errorMessage(e){if(this.spinner.showNotifications&&this.isVisible&&null!==e){let t;t=e instanceof Error?e.message:e,this.$q.notify({message:t,color:"negative",timeout:1e3})}}}},Ee=fe,ve=(s("85d2"),Object(X["a"])(Ee,ge,be,!1,null,"186b76c9",null)),ke=ve.exports,_e=function(){var e=this,t=e._self._c;return t("q-dialog",{attrs:{"no-esc-dismiss":"","no-backdrop-dismiss":""},model:{value:e.loading,callback:function(t){e.loading=t},expression:"loading"}},[t("div",{staticClass:"absolute-center kh-loading"},[t("q-spinner",{attrs:{size:"4em"}}),""!==e.computedMessage?t("div",[e._v(e._s(e.computedMessage))]):e._e()],1)])},Te=[],we={name:"KlabLoading",props:{message:{type:String,default:null},loading:{type:Boolean,required:!0}},data(){return{}},computed:{computedMessage(){return this.message||this.$t("messages.loadingData")}}},ye=we,Ce=(s("3c75"),s("eebe")),Se=s.n(Ce),Ae=Object(X["a"])(ye,_e,Te,!1,null,null,null),qe=Ae.exports;Se()(Ae,"components",{QDialog:x["a"],QSpinner:U["a"]});var Oe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"app-name",class:e.customClasses,domProps:{innerHTML:e._s(e.htmlAppName)}})},Re=[],$e={appName:"k.Hub",appDescription:"k.Hub",appColor:"#0088ff"},Pe={props:{customClasses:Array,default:()=>[]},data(){return{appName:$e.appName,appColor:$e.appColor}},computed:{htmlAppName(){return this.appName.replace(".",`.`)}}},Ne=Pe,xe=(s("60e3"),Object(X["a"])(Ne,Oe,Re,!1,null,null,null)),Ue=xe.exports,Ie=[{name:"aries",label:"ARIES",img:"https://integratedmodelling.org/statics/logos/aries-logo.svg",imgWidth:"16px",title:"ARIES",url:"https://aries.integratedmodelling.org",color:"rgb(70,161,74)"},{name:"integratedModelling",label:"Integrated Modelling",img:"https://integratedmodelling.org/statics/logos/klab-logo-2020.svg",imgWidth:"16px",title:"Integrated Modelling",url:"https://integratedmodelling.org",color:"#666"},{name:"confluence",img:"https://integratedmodelling.org/statics/logos/confluence-logo.svg",label:"Confluence",title:"Integrated modelling confluence",url:"https://integratedmodelling.org/confluence",color:"rgb(7,71,166)"},{name:"bitbucket",img:"https://integratedmodelling.org/statics/logos/bitbucket-logo.svg",label:"Bitbucket",title:"Bitbucket repositories",url:"https://bitbucket.org/integratedmodelling/workspace/projects/",color:"rgb(7,71,166)"}];const Le=[{name:"home",label:ce["b"].tc("menu.home"),route:"home"},{name:"profile",label:ce["b"].tc("menu.profile"),route:"profileView"},{name:"adminHome",label:ce["b"].tc("menu.admin"),route:"adminHome",admin:!0},{name:"stats",label:ce["b"].tc("menu.stats"),route:"stats",admin:!0}],De=[{name:"profile",label:ce["b"].tc("menu.profile"),route:"profileView"},{name:"groups",label:ce["b"].tc("menu.groups"),route:"groupView"},{name:"certificate",label:ce["b"].tc("menu.certificate"),route:"certificate"}],Ge=[{name:"users",label:ce["b"].tc("menu.users"),route:"adminUsers"},{name:"groups",label:ce["b"].tc("menu.groups"),route:"adminGroups",disabled:!0},{name:"tasks",label:ce["b"].tc("menu.tasks"),route:"adminTasks"},{name:"agreementTemplate",label:ce["b"].tc("menu.agreementTemplates"),route:"adminAgreementTemplates"}],Me=[{name:"queries",label:ce["b"].tc("menu.queries"),route:"statsQueries"},{name:"userStats",label:ce["b"].tc("menu.userStats"),route:"userStats"},{name:"observationMap",label:ce["b"].tc("menu.observationMap"),route:"observationMap"}];var Qe=s("15a2");const je={url:re["g"].URL,realm:re["g"].REALM,clientId:re["g"].CLIENT_ID,enableCors:!0},Fe=new Qe["a"](je),Be={install(e){e.$keycloak=Fe}};Be.install=e=>{e.$keycloak=Fe,Object.defineProperties(e.prototype,{$keycloak:{get(){return Fe}}})},a["a"].use(Be);var Ve=Be;const Ye=Object.freeze({SUCCESS:"SUCCESS",ERROR:"ERROR",WARNING:"WARNING",INFO:"INFO"});var Ke=Ye;const We=Object.freeze({USER:"USER",GROUP:"GROUP"});var He=We;const ze=Object.freeze({downloadCertificateChangeEmail:"downloadCertificateChangeEmail"});var Xe=ze,Ze=function(){var e=this,t=e._self._c;return t("q-dialog",{model:{value:e.open,callback:function(t){e.open=t},expression:"open"}},[t("q-card",[t("q-card-section",{staticClass:"row items-center"},[t("q-banner",{staticClass:"bg-yellow-1",staticStyle:{"margin-top":"1em","margin-bottom":"1.5em"},attrs:{rounded:"",dense:""}},[t("div",{staticClass:"justify-start q-gutter-xs",staticStyle:{"font-size":"12px"}},[t("i",{staticClass:"mdi mdi-24px mdi-alert text-k-yellow"}),t("span",[e._v(e._s(e.$t("messages.acceptAgreement")))])])]),t("div",{staticClass:"q-ml-sm",domProps:{innerHTML:e._s(this.agreementText)}})],1),t("q-card-actions",{attrs:{align:"right"}},[t("q-btn",{attrs:{flat:"",label:e.$t("labels.btnCancel"),color:"k-main"},on:{click:e.cancel}}),t("q-btn",{attrs:{label:e.$t("labels.btnAccept"),color:"k-main"},on:{click:e.submit}})],1)],1)],1)},Je=[],et={name:"SignAgreement",props:["open","agreementText","register"],computed:{},methods:{submit(){this.$store.dispatch("auth/register",this.register).then((()=>{this.$q.notify({message:this.$t("messages.registeringOk"),color:"positive"}),this.$store.dispatch("auth/getProfile")})).catch((e=>{409===e.status||400===e.status?this.$q.notify({message:e.message,color:"negative"}):this.$q.notify({message:this.$t("messages.errorRegistering"),color:"negative"})})),this.$store.commit("keycloak/SIGN_AGREEMENT"),this.close()},cancel(){this.$q.dialog({title:this.$t("labels.notice"),message:this.$t("messages.dialogCancelAgreeemet"),ok:{color:"k-controls",push:!0,flat:!0},cancel:{color:"k-controls",push:!0,flat:!0},persistent:!0}).onOk((()=>{this.$store.dispatch("auth/logout")}))},close(){this.$emit("update:open",!1)}}},tt=et,st=s("54e1"),at=Object(X["a"])(tt,Ze,Je,!1,null,null,null),ot=at.exports;Se()(at,"components",{QDialog:x["a"],QCard:q["a"],QCardSection:M["a"],QBanner:st["a"],QCardActions:Q["a"],QBtn:p["a"]}),a["a"].use(Ve);var rt={name:"Default",components:{KlabSpinner:ke,KlabBrand:Ue,KlabLoading:qe,SignAgreement:ot},data(){return{tab:"",menu:Le,links:Ie,COLORS:re["e"],loggingOut:!1,open:!1,register:{email:"",username:"",agreementType:"USER",agreementLevel:"NON_PROFIT"},agreementText:""}},computed:{...Object(W["c"])("view",["spinnerColor","isConnectionDown"]),loading:{get(){return this.loggingOut||!this.$store.getters["auth/profileIsLoad"]},set(){}},loadingMessage(){return this.loggingOut?this.$t("messages.loggingOut"):this.$t("messages.loadingData")},filteredMenu(){return this.menu.filter((e=>!e.admin||this.$store.getters["auth/admin"]))}},methods:{getStartPath(e){if(e&&""!==e){const t=e.lastIndexOf("/");return 0===t?e:e.substring(0,t)}return""},isRouteActive(e){return this.getStartPath(this.$router.currentRoute.path)===this.getStartPath(e.path)},logout(){this.loggingOut=!0,setTimeout((()=>{this.$store.dispatch("auth/logout")}),500)}},beforeMount(){setTimeout((()=>{this.$store.getters["keycloak/isAuthenticated"]&&this.$store.dispatch("auth/getAgreementTemplate",{agreementType:this.register.agreementType,agreementLevel:this.register.agreementLevel}).then((e=>{this.agreementText=e.agreementTemplate.text}))}),500)},mounted(){this.$store.dispatch("view/setSpinner",{...re["o"].SPINNER_STOPPED,owner:"layout"},{root:!0}),this.$store.getters["auth/profileIsLoad"]||setTimeout((()=>{a["a"].$keycloak.loadUserProfile().then((e=>{this.$store.commit("keycloak/AUTH_KEYCLOAK",e),this.$store.getters["auth/profileLoaded"]||this.$store.dispatch("auth/getProfile").then((t=>{if(console.log(t),204===t.status&&this.agreementText)console.debug("First login in kHub"),this.register.username=e.username,this.register.email=e.email,this.open=!0,this.$store.commit("keycloak/SIGN_AGREEMENT");else if(t.email&&t.email!==e.email){console.debug("Email has change");const s={type:Ke.WARNING,iTagElement:He.USER,iTagElementId:t.id,name:Xe.downloadCertificateChangeEmail,title:"",message:"",visible:!0};this.$store.dispatch("auth/createNotification",s),t.email=e.email,this.$store.dispatch("auth/updateProfile",t),this.$store.dispatch("auth/getNotifications",{username:t.name})}})).catch((()=>{this.$store.dispatch("auth/logout")}))}))}),700)},beforeRouteUpdate(e,t,s){t.path===e.path?s(!1):s()}},it=rt,lt=(s("6751"),Object(X["a"])(it,me,he,!1,null,null,null)),nt=lt.exports;Se()(lt,"components",{QLayout:r["a"],QHeader:i["a"],QToolbar:u["a"],QAvatar:A["a"],QBtn:p["a"],QIcon:m["a"],QSpace:$["a"],QPageContainer:n["a"]});var ct=function(){var e=this,t=e._self._c;return t("khub-default-container",{attrs:{"menu-items":e.menuItems}},[t("User",{attrs:{profile:e.profile,admin:!1}}),t("klab-loading",{attrs:{loading:e.waiting,message:e.$t("messages.doingThings")}})],1)},ut=[],dt=s("cd23"),pt={methods:{fieldRequired(e){return!!e||this.$t("messages.fieldRequired")},emailValidation(e){return er.email.test(e)||this.$t("messages.emailValidationError")},usernameValidation(e,t=re["d"].USERNAME_MIN_LENGTH){return er.username.test(e)?e.length>=t||this.$t("messages.usernameFormatLengthError"):this.$t("messages.usernameFormatValidationError")},passwordValidation(e,t=re["d"].PSW_MIN_LENGTH,s=re["d"].PSW_MAX_LENGTH){return e.length>=t&&e.length<=s||this.$t("messages.passwordValidationError")},phoneValidation(e,t=!1){return!(t||"undefined"!==typeof e&&null!==e&&""!==e)||(er.phone.test(e)||this.$t("messages.phoneValidationError"))}}},mt=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"full-width row"},[t("div",{staticClass:"col kp-col kh-headers"},[t("h3",{staticClass:"kh-h-first"},[e._v(e._s(e.$t("labels.accountHeader")))]),t("div",{staticClass:"kp-content col"},[t("div",{staticClass:"row kp-text-row"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.username")))]),t("div",{staticClass:"kd-field col"},[e._v(e._s(e.profile.name))])]),t("div",{staticClass:"row kp-text-row"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.roles")))]),t("div",{staticClass:"kd-field col"},e._l(e.profile.roles,(function(s,a){return t("div",{key:a},[t("div",{staticClass:"ka-roles-icon"},[t("q-icon",{attrs:{name:e.roles[s].icon}},[t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0]}},[e._v(e._s(e.roles[s].name))])],1)],1)])})),0)]),t("div",{staticClass:"row kp-text-row"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.email")))]),e.admin?t("div",{staticClass:"kd-field col"},[t("q-input",{ref:"email",attrs:{color:"k-main",dense:"",placeholder:e.$t("labels.email"),rules:[t=>!t||0===t.length||e.emailValidation(t)],"no-error-icon":"",autocomplete:"email"},model:{value:e.profile.email,callback:function(t){e.$set(e.profile,"email",t)},expression:"profile.email"}})],1):e._e(),e.admin?e._e():t("div",{staticClass:"kd-field col"},[e._v(e._s(e.profile.email))])]),t("div",{staticClass:"row kp-text-row"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.registrationDate")))]),t("div",{staticClass:"kd-field col",class:{"ka-not-available":!e.profile.registrationDate},domProps:{innerHTML:e._s(e.formatDate(e.profile.registrationDate))}})]),t("div",{staticClass:"row kp-text-row"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.lastConnection")))]),t("div",{staticClass:"kd-field col",class:{"ka-not-available":!e.profile.lastConnection},domProps:{innerHTML:e._s(e.formatDate(e.profile.lastConnection))}})])]),t("h3",{staticClass:"kp-header row"},[e._v(e._s(e.$t("labels.personalHeader")))]),t("div",{staticClass:"kp-content col"},[t("div",{staticClass:"row kp-input-row items-baseline justify-start"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.firstName")))]),t("div",{staticClass:"kd-field col"},[t("q-input",{ref:"first-name",attrs:{color:"k-main",dense:"",placeholder:e.$t("labels.firstName"),rules:[t=>!e.checking||e.fieldRequired(t)],"no-error-icon":"",autocomplete:"given-name",autofocus:"",disable:!e.admin},model:{value:e.profile.firstName,callback:function(t){e.$set(e.profile,"firstName",t)},expression:"profile.firstName"}})],1)]),t("div",{staticClass:"row kp-input-row items-baseline justify-start"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.lastName")))]),t("div",{staticClass:"kd-field col"},[t("q-input",{ref:"last-name",attrs:{color:"k-main",dense:"",placeholder:e.$t("labels.lastName"),rules:[t=>!e.checking||e.fieldRequired(t)],"no-error-icon":"",autocomplete:"family-name",disable:!e.admin},model:{value:e.profile.lastName,callback:function(t){e.$set(e.profile,"lastName",t)},expression:"profile.lastName"}})],1)]),t("div",{staticClass:"row kp-input-row items-baseline justify-start"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.middleName")))]),t("div",{staticClass:"kd-field col"},[t("q-input",{ref:"middle-name",staticClass:"q-field--with-bottom",attrs:{color:"k-main",dense:"",placeholder:e.$t("labels.middleName"),autocomplete:"middle-name",disable:!e.admin},model:{value:e.profile.initials,callback:function(t){e.$set(e.profile,"initials",t)},expression:"profile.initials"}})],1)]),t("div",{staticClass:"row kp-input-row items-baseline justify-start"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.address")))]),t("div",{staticClass:"kd-field col"},[t("q-input",{ref:"address",staticClass:"q-field--with-bottom",attrs:{color:"k-main",dense:"",placeholder:e.$t("labels.addressPlaceholder"),autocomplete:"street-address",disable:!e.admin},model:{value:e.profile.address,callback:function(t){e.$set(e.profile,"address",t)},expression:"profile.address"}})],1)]),t("div",{staticClass:"row kp-input-row items-baseline justify-start"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.phone")))]),t("div",{staticClass:"kd-field col"},[t("q-input",{ref:"phone",attrs:{color:"k-main",dense:"",placeholder:e.$t("labels.phone"),rules:[t=>!e.checking||!t||0===t.length||e.phoneValidation(t)],"no-error-icon":"",autocomplete:"tel",disable:!e.admin},model:{value:e.profile.phone,callback:function(t){e.$set(e.profile,"phone",t)},expression:"profile.phone"}})],1)]),t("div",{staticClass:"row kp-input-row items-baseline justify-start"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.affiliation")))]),t("div",{staticClass:"kd-field col"},[t("q-input",{ref:"affiliation",staticClass:"q-field--with-bottom",attrs:{color:"k-main",dense:"",placeholder:e.$t("labels.affiliation"),disable:!e.admin},model:{value:e.profile.affiliation,callback:function(t){e.$set(e.profile,"affiliation",t)},expression:"profile.affiliation"}})],1)]),t("div",{staticClass:"row kp-input-row items-baseline justify-start"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.jobTitle")))]),t("div",{staticClass:"kd-field col"},[t("q-input",{ref:"job-title",staticClass:"q-field--with-bottom",attrs:{color:"k-main",dense:"",placeholder:e.$t("labels.jobTitle"),autocomplete:"organization-title",disable:!e.admin},model:{value:e.profile.jobTitle,callback:function(t){e.$set(e.profile,"jobTitle",t)},expression:"profile.jobTitle"}})],1)])]),e.admin?e._e():t("div",{staticClass:"kp-send-updates row q-mt-xs"},[t("q-checkbox",{attrs:{color:"k-main",label:e.$t("messages.sendUpdates")},model:{value:e.profile.sendUpdates,callback:function(t){e.$set(e.profile,"sendUpdates",t)},expression:"profile.sendUpdates"}})],1)]),t("div",{staticClass:"col kp-col kh-headers"},[t("h3",{staticClass:"kp-header row",staticStyle:{"margin-top":"0px"}},[e._v(e._s(e.$t("labels.groupCustomProperties")))]),t("KhubCustomPropertiesEditableTable",{attrs:{customProperties:this.profile.customProperties,type:"USER",admin:e.admin}})],1)]),t("div",{staticClass:"row kp-update-btn justify-end q-mb-md q-mr-md"},[e.admin?t("q-btn",{attrs:{label:e.$t("labels.btnClose"),color:"k-red",tabindex:"55"},on:{click:e.closeDialog}}):e._e(),t("q-btn",{attrs:{color:"k-main",label:e.$t("labels.updateProfileBtn"),disabled:!e.modified&&!e.admin},on:{click:e.updateProfile}}),e.isExternalLink?t("a",e._b({attrs:{href:e.to,target:"_blank"}},"a",e.$attrs,!1),[e._t("default")],2):t("router-link",e._b({attrs:{custom:""},scopedSlots:e._u([{key:"default",fn:function({isActive:s,href:a,navigate:o}){return[t("a",e._b({class:s?e.activeClass:e.inactiveClass,attrs:{href:a},on:{click:o}},"a",e.$attrs,!1),[e._t("default")],2)]}}],null,!0)},"router-link",e.$props,!1))],1)])},ht=[],gt=s("c1df"),bt=s.n(gt),ft=function(){var e=this,t=e._self._c;return t("q-input",{ref:"dateInput",class:e.classes,attrs:{color:e.color,rules:[t=>e.validateDate(t)],dense:e.dense,clearable:"",label:e.label,disable:e.disable,tabindex:e.tabindex},on:{blur:function(t){return e.formatDate()},clear:function(t){return e.formatDate()}},scopedSlots:e._u([{key:"append",fn:function(){return[e.modelChange&&!e.$refs["dateInput"].hasError?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-check",title:e.$t("labels.updateField")},on:{click:function(t){return e.formatDate()}}}):e._e(),t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-calendar"}},[t("q-popup-proxy",{ref:"popupProxy",attrs:{"transition-show":"scale","transition-hide":"scale"}},[t("q-date",{attrs:{mask:"DD-MM-YYYY",minimal:""},on:{input:e.changeDate},model:{value:e.dateValue,callback:function(t){e.dateValue=t},expression:"dateValue"}})],1)],1)]},proxy:!0}]),model:{value:e.dateValue,callback:function(t){e.dateValue=t},expression:"dateValue"}})},Et=[],vt={name:"KInputDate",props:{value:String,classes:String,dense:String,label:{type:String,required:!0},color:String,disable:{type:Boolean,default:!1},tabindex:{type:[String,Number],default:-1},rule:{type:Function,default:()=>{}}},data(){return{dateValue:this.value,modelChange:!1}},methods:{reset(){this.dateValue=null,this.$emit("input",this.dateValue),this.$nextTick((()=>{this.modelChange=!1}))},changeDate(){this.$refs.popupProxy.hide(),this.formatDate(!0)},generateMomentDate(e=!1){if(""===this.dateValue)return this.dateValue=null,null;if(null===this.dateValue)return null;const t=bt()(this.dateValue,e?"DD-MM-YYYY":["L","MM/DD/YYYY","YYYY/MM/DD","DD/MM/YYYY"]);return t},validateDate(){const e=this.generateMomentDate();return null===e||e.isValid()},formatDate(e=!1){const t=this.generateMomentDate(e);null!==t&&t.isValid()&&(this.dateValue=t.format("L")),this.$emit("input",this.dateValue),this.$nextTick((()=>{this.modelChange=!1}))}},watch:{dateValue(){this.modelChange=!0}}},kt=vt,_t=Object(X["a"])(kt,ft,Et,!1,null,null,null),Tt=_t.exports;Se()(_t,"components",{QInput:E["a"],QIcon:m["a"],QPopupProxy:y["a"],QDate:w["a"]});var wt=function(){var e=this,t=e._self._c;return t("div",[t("q-btn",{attrs:{icon:"mdi-pencil",color:"k-controls",round:"",size:"sm",disabled:"active"!==e.profile.accountStatus},on:{click:function(t){return e.openDialog()}}},[t("q-tooltip",{attrs:{anchor:"bottom middle",self:"top middle",offset:[0,8],delay:600}},[e._v(e._s(e.$t("labels.editEmail")))])],1),t("q-dialog",{model:{value:e.show,callback:function(t){e.show=t},expression:"show"}},[t("q-card",{attrs:{bordered:""}},[t("form",{attrs:{autocomplete:"on"},on:{submit:function(t){return t.preventDefault(),e.doChange()}}},[t("q-card-section",[t("div",{staticClass:"row"},[t("h5",{staticClass:"q-px-md q-my-xs"},[e._v(e._s(e.$t("labels.updateEmailTitle")))]),t("q-space"),t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{icon:"close",flat:"",round:"",dense:""}})],1)]),t("q-separator"),t("q-card-section",[t("div",{staticClass:"q-px-md q-py-xs q-item-label q-item__label--caption"},[t("div",{staticClass:"text-caption",staticStyle:{"line-height":"1.2em"}},[e._v("\n "+e._s(e.$t("messages.emailChangeVerification"))+"\n ")])]),t("div",{staticClass:"q-px-md q-py-xs q-gutter-sm"},[t("q-banner",{staticClass:"bg-teal-1 q-item__label--caption",attrs:{rounded:"",dense:""}},[t("div",{staticClass:"text-caption"},[e._v("\n "+e._s(e.$t("messages.emailChangeVerificationInfo"))+"\n ")])])],1),t("div",{staticClass:"row justify-center"},[t("div",{staticClass:"col-9"},[t("input",{staticStyle:{display:"none"},attrs:{type:"text",name:"username",autocomplete:"username"},domProps:{value:e.username}}),t("q-input",{ref:"mail-input",staticClass:"kh-input",attrs:{color:"k-main",rules:[t=>0===t.length&&!e.checking||this.emailConfirmValidation("email",t)],"no-error-icon":"","min-length":"8","max-length":"32",type:e.isPwd?"email":"text",placeholder:e.$t("labels.newEmail"),autocomplete:"current-email",autofocus:""},scopedSlots:e._u([{key:"prepend",fn:function(){return[t("q-icon",{attrs:{name:"mdi-email"}})]},proxy:!0}]),model:{value:e.email,callback:function(t){e.email=t},expression:"email"}}),t("q-input",{ref:"conf-input",staticClass:"kh-input",attrs:{icon:"mdi-email",color:"k-main",rules:[t=>0===t.length&&!e.checking||this.emailConfirmValidation("confirm",t)],"no-error-icon":"","min-length":"8","max-length":"32",type:e.isPwdConfirm?"email":"text",placeholder:e.$t("labels.newEmailConfirmation"),autocomplete:"current-email"},scopedSlots:e._u([{key:"prepend",fn:function(){return[t("q-icon",{attrs:{name:"mdi-email"}})]},proxy:!0}]),model:{value:e.emailConfirmation,callback:function(t){e.emailConfirmation=t},expression:"emailConfirmation"}})],1)])]),t("q-card-actions",{staticClass:"q-mb-lg",attrs:{align:"center"}},[t("q-btn",{attrs:{label:e.$t("labels.sendVerificationEmail"),color:"k-controls",type:"submit",disabled:this.buttonDisable()}})],1)],1)])],1),t("klab-loading",{attrs:{loading:e.waiting,message:e.$t("messages.doingThings")}})],1)},yt=[],Ct={name:"ChangePassword",components:{KhubDefaultContainer:dt["a"],KlabLoading:qe},props:["profile"],mixins:[pt],data(){return{menuItems:De,isPwd:!0,isPwdConfirm:!0,changingPassword:!1,checking:!1,show:!1,emailData:"",emailConfirmation:"",waiting:!1}},computed:{email:{get(){return this.emailData},set(e){this.emailData=e}},username(){return this.$store.getters["auth/username"]},profileIsLoad(){return this.$store.getters["auth/profileIsLoad"]}},methods:{openDialog(){const e=this.$store.getters["keycloak/profile"];console.log(e),this.show=!0},resetValidation(e){e.target.resetValidation()},buttonDisable(){return this.email&&this.$refs["mail-input"].hasError||this.emailConfirmation&&this.$refs["conf-input"].hasError},emailConfirmValidation(e,t){return"email"==e?er.email.test(t)||this.$t("messages.emailValidationError"):er.email.test(t)?!this.email||0===this.email.length||(t===this.email||this.$t("messages.emailConfirmationError")):this.$t("messages.emailValidationError")},doChange(){this.$refs["mail-input"].validate(),this.$refs["conf-input"].validate(),this.$refs["mail-input"].hasError||this.$refs["conf-input"].hasError||(this.waiting=!0,this.email===this.emailConfirmation?this.$store.dispatch("keycloak/getAccount",{email:this.email}).then((()=>{this.waiting=!1,this.show=!1})).catch((e=>{this.waiting=!1,this.$q.notify({message:e.message})})):this.$q.notify({message:this.$t("messages.emailDoesNotMatch"),color:"negative"}))}},watch:{email(){this.$refs["conf-input"].validate()}}},St=Ct,At=(s("bb03"),Object(X["a"])(St,wt,yt,!1,null,null,null)),qt=At.exports;Se()(At,"components",{QBtn:p["a"],QTooltip:R["a"],QDialog:x["a"],QCard:q["a"],QCardSection:M["a"],QSpace:$["a"],QSeparator:O["a"],QItemLabel:f["a"],QItem:g["a"],QBanner:st["a"],QInput:E["a"],QIcon:m["a"],QCardActions:Q["a"]}),Se()(At,"directives",{ClosePopup:F["a"]});var Ot=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"q-app"}},[t("q-item",[t("q-item-section",["USER"!==e.type?t("q-item-label",[e._v(e._s(e.$t("labels.groupCustomProperties")))]):e._e()],1),t("q-item-section",{staticClass:"col-1",attrs:{side:""}},[e.admin?t("q-btn",{staticClass:"gfc-buttons",attrs:{icon:"mdi-plus",round:"",color:"k-controls",size:"xs"},on:{click:function(t){return e.newitem()}}}):e._e()],1),t("q-item-section",{staticClass:"col-1",attrs:{side:""}},[t("q-btn",{staticClass:"gfc-buttons",attrs:{disable:1!==e.selected.length,icon:"mdi-pencil",round:"",color:e.admin?"k-main":"k-controls",size:"xs"},on:{click:e.editItem}})],1),t("q-item-section",{attrs:{side:""}},[e.admin?t("q-btn",{staticClass:"gfc-buttons",attrs:{disable:0===e.selected.length,icon:"mdi-trash-can",round:"",color:"k-red",size:"xs"},on:{click:e.deleteItem}}):e._e()],1)],1),t("q-item",[t("q-item-section",[t("div",{staticClass:"q-pa-sm q-gutter-sm"},[t("q-table",{attrs:{flat:"",bordered:"",dense:"",data:this.customProperties,columns:this.columns,"row-key":"name",separator:"cell","hide-bottom":"","wrap-cells":"","auto-width":"","rows-per-page-options":[0],"visible-columns":e.visibleColumns},on:{"row-click":e.onRowClick},scopedSlots:e._u([{key:"body",fn:function(s){return[t("q-tr",{staticClass:"cursor-pointer",class:-1!=e.selected.indexOf(s.row)?"selected":"",attrs:{props:s},on:{click:function(t){return e.onRowClick(s.row)}}},[t("q-td",{key:"key",attrs:{props:s}},[e._v("\n "+e._s(s.row.key)+"\n ")]),t("q-td",{key:"value",attrs:{props:s}},[e._v(e._s(s.row.value))]),e.admin?t("q-td",{key:"onlyAdmin",attrs:{props:s}},[t("q-btn",{attrs:{size:"sm",round:"",dense:"",flat:"",icon:s.row.onlyAdmin?"check":"close"}})],1):e._e()],1)]}}])})],1)])],1),t("div",{staticClass:"q-pa-sm q-gutter-sm"},[t("q-dialog",{model:{value:e.show_dialog,callback:function(t){e.show_dialog=t},expression:"show_dialog"}},[t("q-card",{staticStyle:{width:"600px","max-width":"80vw"}},[t("q-card-section",[t("div",{staticClass:"kh-headers-dialog"},[t("h5",{staticClass:"q-my-xs"},[e._v(e._s(this.dialogTitle))])])]),t("q-card-section",[t("div",{staticClass:"row q-col-gutter-sm"},[t("div",[t("q-select",{staticStyle:{width:"13rem"},attrs:{outlined:"","use-input":"","hide-selected":"","fill-input":"","input-debounce":"0",options:e.options,label:e.$t("labels.key"),"new-value-mode":"add-unique","hide-dropdown-icon":"",color:"k-controls",disable:this.update,error:e.error.key.showError,"error-message":e.error.key.errorMessage},on:{filter:e.filterFn,"new-value":e.createValue,blur:e.handleBlur},model:{value:this.editedItem.key,callback:function(t){e.$set(this.editedItem,"key",t)},expression:"this.editedItem.key"}})],1),t("div",[t("q-input",{attrs:{outlined:"",label:e.$t("labels.value"),color:"k-controls",error:e.error.value.showError,"error-message":e.error.value.errorMessage},on:{blur:e.handleBlurValue},model:{value:e.editedItem.value,callback:function(t){e.$set(e.editedItem,"value",t)},expression:"editedItem.value"}})],1),t("div",[e.admin?t("q-checkbox",{ref:"customProperty-onlyAdmin",staticClass:"q-pa-sm",attrs:{color:"k-controls",label:e.$t("labels.visible")},model:{value:e.editedItem.onlyAdmin,callback:function(t){e.$set(e.editedItem,"onlyAdmin",t)},expression:"editedItem.onlyAdmin"}}):e._e()],1)])]),t("q-separator",{attrs:{spaced:""}}),t("q-card-actions",{attrs:{align:"right"}},[t("q-btn",{attrs:{flat:"",label:e.$t("labels.cancel"),color:"k-red"},on:{click:e.close}}),t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{label:e.$t("labels.ok"),color:"k-controls",disable:!e.error.key.valid||!e.error.value.valid},on:{click:e.addRow}})],1)],1)],1)],1)],1)},Rt=[],$t={name:"KhubCustomPropertiesEditableTable",props:["customProperties","type","admin"],data(){return{defaultItem:{key:"",value:"",onlyAdmin:!1},editedItem:{key:"",value:"",onlyAdmin:""},selected:[],open:!1,columns:[{name:"key",required:!0,label:this.$t("labels.key"),align:"left",field:e=>e.key,format:e=>`${e}`,sortable:!0,classes:"ellipsis",style:"max-width: 12rem",rules:e=>""===e||"Value can not be empty"},{name:"value",required:!0,align:"left",label:this.$t("labels.value"),field:e=>e.value,sortable:!0,classes:"ellipsis",style:"max-width: 12rem"},{name:"onlyAdmin",align:"center",label:this.$t("labels.visible"),field:e=>e.onlyAdmin,style:"width:6em",sortable:!0}],defaultOptions:this.getCustomProperties,options:this.defaultOptions,modelAddUnique:null,createNewValue:!1,update:!1,show_dialog:!1,error:{key:{valid:!1,showError:!1,errorMessage:""},value:{valid:!1,showError:!1,errorMessage:""},onlyAdmin:{valid:!1,showError:!1,errorMessage:""}},dialogTitle:""}},computed:{visibleColumns(){let e=["key","value"];return this.admin&&e.push("onlyAdmin"),e}},methods:{...Object(W["b"])("admin",["loadCustomProperties","createNewCustomPropertyKey"]),newitem(){this.update=!1,this.defaultOptions=this.getCustomProperties(this.type),this.dialogTitle=this.$t("labels.newProperty"),this.show_dialog=!0},addRow(){this.createNewValue&&this.createNewCustomPropertyKey({type:this.type,name:this.editedItem.key}),this.editedIndex>-1?Object.assign(this.customProperties[this.editedIndex],this.editedItem):this.customProperties?this.customProperties.push(this.editedItem):this.customProperties=[this.editedItem],this.close()},deleteItem(){this.$q.dialog({title:this.$t("messages.confirmRemoveTitle"),message:this.$t("messages.confirmRemoveMsg"),ok:{color:"k-controls"},cancel:{color:"k-red"},persistent:!0}).onOk((()=>{this.deleteConfirm()}))},deleteConfirm(){this.selected.map((e=>{const t=this.customProperties.findIndex((t=>t.key===e.key));return this.customProperties.splice(t,1),null})),this.selected=[]},editItem(){this.error.key.valid=!0,this.error.value.valid=!0,this.error.onlyAdmin.valid=!0,this.update=!0,this.editedIndex=this.selected[0].index,this.editedItem=Object.assign({},this.selected[0]),this.dialogTitle=this.$t("labels.editProperty"),this.show_dialog=!0},close(){this.show_dialog=!1,this.resetValidation(),setTimeout((()=>{this.editedItem=Object.assign({},this.defaultItem),this.editedIndex=-1}),300)},onRowClick(e){e.index=this.customProperties.indexOf(e),-1===this.selected.indexOf(e)?this.selected.push(e):this.selected.splice(this.selected.indexOf(e),1)},getCustomProperties(e){this.loadCustomProperties(e).then((e=>(this.customProperties?this.defaultOptions=e.data.filter((e=>!this.customProperties.map((e=>e.key)).includes(e.name))):this.defaultOptions=e.data,this.defaultOptions)))},filterFn(e,t,s){e.length<2?s():t((()=>{const t=e.toLowerCase();this.defaultOptions&&(this.options=this.defaultOptions.map((e=>e.name)).filter((e=>e.toLowerCase().indexOf(t)>-1)))}))},createValue(e,t){this.createNewValue=!0,t(e,"add-unique")},handleBlur(e){this.editedItem.key=e.target.value,this.keyValidation()},handleBlurValue(){""===this.editedItem.value?(this.error.value.valid=!1,this.error.value.showError=!0,this.error.value.errorMessage="This field must be required."):(this.error.value.valid=!0,this.error.value.showError=!1,this.error.value.errorMessage="")},updateCustomProperties(e){this.customProperties=e},keyValidation(){if(""===this.editedItem.key)this.error.key.valid=!1,this.error.key.showError=!0,this.error.key.errorMessage="This field must be required.";else{const e=/^[A-Z]+(?:_[A-Z]+)*$/,t=e.test(this.editedItem.key);t?(this.error.key.valid=!0,this.error.key.showError=!1,this.error.key.errorMessage=""):(this.error.key.valid=!1,this.error.key.showError=!0,this.error.key.errorMessage="Please enter a valid key. Only avoid mayus and underscore.")}},resetValidation(){this.error.key.showError=!1,this.error.key.valid=!1,this.error.value.showError=!1,this.error.value.valid=!1,this.error.onlyAdmin.valid=!1}}},Pt=$t,Nt=Object(X["a"])(Pt,Ot,Rt,!1,null,null,null),xt=Nt.exports;Se()(Nt,"components",{QItem:g["a"],QItemSection:b["a"],QItemLabel:f["a"],QBtn:p["a"],QTable:I["a"],QTr:D["a"],QTd:L["a"],QDialog:x["a"],QCard:q["a"],QCardSection:M["a"],QSelect:k["a"],QInput:E["a"],QCheckbox:T["a"],QSeparator:O["a"],QCardActions:Q["a"]}),Se()(Nt,"directives",{ClosePopup:F["a"]});var Ut={name:"UsersComponent",props:["profile","admin"],components:{KInputDate:Tt,KlabLoading:qe,ChangeEmail:qt,KhubCustomPropertiesEditableTable:xt},mixins:[pt],data(){return{roles:re["l"],refreshing:!1,waiting:!1,modified:!1,checking:!1,mail:{mail:"",confirmMail:""},errorConfirmMail:{show:!1,message:"message"}}},computed:{...Object(W["c"])("admin",["groups","groupsIcons"])},methods:{...Object(W["b"])("admin",["loadUser","loadUsers","resetUser"]),updateProfile(){if(this.admin){if(this.checking=!0,this.$refs["first-name"].validate(),this.$refs["last-name"].validate(),this.$refs.phone.validate(),this.checking=!1,this.$refs["first-name"].hasError||this.$refs["last-name"].hasError||this.$refs.phone.hasError)return;this.waiting=!0,this.$store.dispatch("auth/updateProfile",this.profile).then((()=>{this.closeDialog(),this.$q.notify({message:this.$t("messages.profileUpdated"),color:"positive"}),this.waiting=!1,this.loadUser()})).catch((e=>{console.error(`Problem updating profile: ${e.message}`),-1!==e.message.toLowerCase().indexOf("duplicated key")?this.$q.notify({message:this.$t("messages.emailAlreadyInUse"),color:"warning"}):this.$q.notify({message:this.$t("messages.errorUpdatingProfile"),color:"negative"}),this.waiting=!1}))}else window.open(re["g"].URL+"/"+re["t"].WS_KEYCLOAK,"_blank")},formatDate:ar,confirm(e,t,s,a){this.$q.dialog({title:e,message:t,ok:{color:"k-controls",push:!0,flat:!0},cancel:{color:"k-controls",push:!0,flat:!0},persistent:!0}).onOk((()=>{s()})).onCancel((()=>{a()}))},copyTextToClipboard(e,t){e.stopPropagation(),mr(t),this.$q.notify({message:this.$t("messages.textCopied"),type:"info",icon:"mdi-information",timeout:500})},closeDialog(){this.$emit("closeDialog",!1)}},watch:{profile:{handler(){this.modified=!0},deep:!0}},created(){bt.a.locale(this.$q.lang.getLocale())},mounted(){}},It=Ut,Lt=(s("baf1"),s("8572")),Dt=Object(X["a"])(It,mt,ht,!1,null,null,null),Gt=Dt.exports;Se()(Dt,"components",{QIcon:m["a"],QTooltip:R["a"],QInput:E["a"],QField:Lt["a"],QCheckbox:T["a"],QBtn:p["a"],QChip:_["a"],QAvatar:A["a"]});var Mt={name:"ProfileView",components:{KhubDefaultContainer:dt["a"],KlabLoading:qe,User:Gt},mixins:[pt],data(){return{menuItems:De,updated:[],waiting:!1,show_dialog:!1,ROLES:re["l"]}},computed:{profile(){return this.$store.getters["auth/profile"]}},methods:{openDialog(){this.show_dialog=!0}},created(){this.$store.dispatch("auth/getProfile")},watch:{}},Qt=Mt,jt=Object(X["a"])(Qt,ct,ut,!1,null,null,null),Ft=jt.exports,Bt=function(){var e=this,t=e._self._c;return t("khub-default-container",{attrs:{"menu-items":e.menuItems}},[t("h4",{staticClass:"kp-header row kh-h-first"},[e._v(e._s(e.$t("labels.groupOptIn")))]),e.profileGroupEntries.length>0?[t("div",{staticClass:"row justify-center"},[t("div",{staticClass:"col-md-5 col-xs-12"},[t("span",[e._v(e._s(e.$t("labels.groupUnsubscribed")))]),t("draggable",e._b({staticClass:"list-group",attrs:{id:"unsubscribe",tag:"ul"},on:{start:function(t){e.drag=!0},end:function(t){e.drag=!1},change:function(t){return e.onAdd(t,"unsubscribe")}},model:{value:e.availableOptInGroups,callback:function(t){e.availableOptInGroups=t},expression:"availableOptInGroups"}},"draggable",e.dragOptions,!1),[t("transition-group",{attrs:{type:"transition",name:"flip-list"}},e._l(e.availableOptInGroups,(function(s){return t("q-list",{key:`${s.order}-${s.name.group.name}-availableOptInGroupsList`,staticClass:"list-group-item",attrs:{padding:"",dense:""}},[t("KhubGroupList",{key:`${s.order}-${s.name.group.name}-availableOptInGroups`,attrs:{groups:s,emptyVisible:e.availableOptInGroupsEmpty,emptyMessage:e.$t("messages.noAvailableGroups")}})],1)})),1)],1)],1),t("div",{staticClass:"col-md-5 offset-md-1 col-xs-12"},[t("span",[e._v(e._s(e.$t("labels.groupSubscribed")))]),t("draggable",e._b({attrs:{id:"subscribe",entry:"span"},on:{start:function(t){e.drag=!0},end:function(t){e.drag=!1},change:function(t){return e.onAdd(t,"subscribe")}},model:{value:e.profileOptInGroups,callback:function(t){e.profileOptInGroups=t},expression:"profileOptInGroups"}},"draggable",e.dragOptions,!1),[t("transition-group",{staticClass:"list-group",attrs:{name:"no",tag:"ul"}},e._l(e.profileOptInGroups,(function(s){return t("q-list",{key:`${s.order}-${s.name.group.name}-profileOptInGroupsList`,staticClass:"list-group-item",attrs:{id:`${s.order}-profileOptInGroupsList`,padding:"",dense:""}},[t("KhubGroupList",{key:`${s.order}-${s.name.group.name}-profileOptInGroups`,attrs:{groups:s,updateVisible:"true",emptyVisible:e.profileOptInGroupsEmpty,emptyMessage:e.$t("messages.noGroupsAssigned")},on:{updatedGroup:e.updateGroup}})],1)})),1)],1)],1)])]:[t("div",{staticClass:"kp-no-group",domProps:{innerHTML:e._s(e.$t("messages.noGroupsAssigned"))}})],t("h3",{staticClass:"kp-header row"},[e._v(e._s(e.$t("labels.groupNoOptin")))]),[t("div",{staticClass:"row justify-start"},[t("div",{staticClass:"col-md-12"},[e._l(e.profileNotOptInGroups,(function(s){return t("q-list",{key:`${s.order}-profileNotOptInGroupsList`,staticClass:"list-group-item",attrs:{padding:"",dense:""}},[t("KhubGroupList",{key:`${s.order}-profileNotOptInGroups`,attrs:{groups:s,deleteVisible:"true",updateVisible:"true"},on:{removedGroup:e.removeGroup,updatedGroup:e.updateGroup}})],1)})),t("div",{staticClass:"kp-make-request q-ma-lg"},[t("q-btn",{staticClass:"float-right",attrs:{icon:"mdi-account-multiple-plus",color:"k-controls",label:e.$t("labels.requestGroups")},on:{click:e.loadAvailableGroups}}),t("q-dialog",{model:{value:e.request,callback:function(t){e.request=t},expression:"request"}},[t("q-card",{staticClass:"ka-dialog"},[t("q-card-section",{staticClass:"ka-dialog-title"},[e._v(e._s(e.$t("labels.requestGroups")))]),t("q-separator"),t("q-card-section",{staticClass:"q-pa-xs"},[t("q-list",[e.availableGroupsForRequest.length>0?[t("q-item",[t("q-item-section",[t("q-item-label",[e._v(e._s(e.$t("labels.requestGroupsText")))])],1)],1),t("q-item",[t("q-item-section",[t("q-item-label",[e._v(e._s(e.$t("labels.updateAvailableGroups")))])],1)],1),t("q-item",[t("q-item-section",e._l(e.availableGroupsForRequest,(function(s){return t("q-list",{key:s.order,staticClass:"list-group-item",attrs:{padding:"",dense:""}},[t("KhubGroupList",{key:"availableGroupsForRequest",attrs:{groups:s,checkBoxVisible:"true"},on:{checkClicked:e.handleCheck}})],1)})),1)],1)]:[t("q-item",[t("q-item-section",[t("strong",[e._v(e._s(e.$t("messages.noAvailableGroups")))])])],1)],t("q-item",[t("q-item-section",{staticClass:"absolute-bottom-right q-ma-sm"},[t("div",[0!==e.availableGroupsForRequest.length?[t("q-btn",{attrs:{color:"k-controls",label:e.$t("labels.requestGroupsButton")},on:{click:e.requestGroups}}),t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{color:"k-red",label:e.$t("labels.btnCancel")}})]:[t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{color:"k-controls",label:e.$t("labels.btnClose")}})]],2)])],1)],2)],1)],1)],1)],1)],2)])],t("klab-loading",{attrs:{loading:e.waiting,message:e.$t("messages.doingThings")}})],2)},Vt=[],Yt=function(){var e=this,t=e._self._c;return t("div",["Empty"===e.entry.name.group.name?t("div",{directives:[{name:"show",rawName:"v-show",value:!e.emptyVisible,expression:"!emptyVisible"}]},[t("q-item",[t("q-item-section",{attrs:{avatar:""}}),t("q-item-section",[t("q-item-label",{staticClass:"label-italic",attrs:{caption:""}},[e._v(e._s(e.emptyMessage))])],1)],1)],1):t("div",[t("q-item",{key:e.entry.name.group.name,staticClass:"app-custom-item",attrs:{"data-id":e.entry.name.group.name}},[e.checkBox?t("div",[t("q-item-section",{attrs:{side:"",top:""}},[t("q-checkbox",{staticClass:"q-pa-xs q-ma-none",attrs:{val:e.entry.name.group.name,color:"k-controls"},on:{input:function(t){return e.handleCheck(e.requesting,e.entry.name.group.name)}},model:{value:e.requesting,callback:function(t){e.requesting=t},expression:"requesting"}})],1)],1):e._e(),t("q-item-section",{attrs:{avatar:""}},[e.entry.name.group.iconUrl?t("img",{attrs:{valign:"middle",src:e.entry.name.group.iconUrl,title:e.entry.name.group.groupName,alt:e.entry.name.group.groupName,width:"30"}}):t("span",{staticClass:"ka-no-group-icon ka-medium",attrs:{title:e.entry.name.group.groupName}},[e._v(e._s(e.entry.name.group.name.charAt(0).toUpperCase()))])]),t("q-item-section",[t("q-item-label",[e._v(e._s(e.entry.name.group.name))]),t("q-item-label",{attrs:{caption:""}},[e._v(e._s(e.entry.name.group.description))])],1),e.entry.expiration?t("q-item-section",{attrs:{side:""}},[t("div",{staticClass:"gt-xs kp-group-expires",class:e.isExpiring(e.entry.expiration,0)?"kp-group-expired":e.isExpiring(e.entry.expiration)?"kp-group-expiring":""},[t("span",[e._v(e._s(e.$t("labels.expireDate"))+": "+e._s(e.formatDate(e.expiration,!0)))])])]):e._e(),t("q-item-section",{attrs:{side:""}},[t("div",{staticClass:"q-gutter-xs"},[e.entry.expiration&&e.updateVisible?t("q-btn",{staticClass:"gt-xs",attrs:{round:"",color:"k-controls",size:"sm",icon:"update",disable:!e.isExpiring(e.entry.expiration)||e.updated.includes(e.entry.name.group.name)},on:{click:function(t){return e.handleUpdate(e.entry.name.group.name)}}},[t("q-tooltip",{attrs:{anchor:"bottom middle",self:"top middle",offset:[0,8],delay:600}},[e.updated.includes(e.entry.name.group.name)?t("span",[e._v(e._s(e.$t("messages.waitForRenewalAcceptance")))]):e.isExpiring(e.entry.expiration)?t("span",[e._v(e._s(e.$t("messages.askForRenewal")))]):t("span",[e._v(e._s(e.$t("messages.renewalIsNotNecessary")))])])],1):e._e(),e.deleteVisible?t("q-btn",{attrs:{disable:(e.entry.name.group.complimentary||e.entry.name.group.worldview)&&!e.entry.name.group.optIn||e.updated.includes(e.entry.name.group.name),round:"",color:"k-red",size:"sm",icon:"delete"},on:{click:function(t){return e.handleRemove(e.entry.name.group.name)}}},[!e.entry.name.group.complimentary&&!e.entry.name.group.worldview||e.entry.name.group.optIn?e._e():t("q-tooltip",{staticClass:"bg-k-red",attrs:{anchor:"bottom middle",self:"top middle",offset:[0,8],delay:600}},[t("span",[e._v(e._s(e.$t("messages.notDeletableGroup",{reason:e.$t("messages.notDeletableGroupWorldview")})))])])],1):e._e()],1)])],1),t("q-separator",{staticClass:"separator-list",attrs:{spaced:"",inset:"item"}}),e.isExpiring(e.entry.expiration)?e._e():t("div")],1)])},Kt=[],Wt={name:"KhubGroupList",props:["groups","checkBoxVisible","deleteVisible","requestVisible","updateVisible","emptyVisible","emptyMessage"],data(){return{defaultItem:{key:"",value:"",onlyAdmin:!1},editedItem:{key:"",value:"",onlyAdmin:""},selected:[],open:!1,entry:this.groups,checkBox:this.checkBoxVisible,requesting:[],updated:[]}},methods:{formatDate:ar,isExpiring(e,t=30){return bt()().diff(e,"day")>-t},handleCheck(e,t){this.$emit("checkClicked",{selected:0!==e.length,name:t})},handleRemove(e){this.$emit("removedGroup",{value:e})},handleUpdate(e){this.$emit("updatedGroup",{value:e})}}},Ht=Wt,zt=(s("4a8e"),Object(X["a"])(Ht,Yt,Kt,!1,null,null,null)),Xt=zt.exports;Se()(zt,"components",{QItem:g["a"],QItemSection:b["a"],QItemLabel:f["a"],QCheckbox:T["a"],QBtn:p["a"],QTooltip:R["a"],QSeparator:O["a"]});var Zt=s("b76a"),Jt=s.n(Zt),es={name:"GroupView",components:{KhubDefaultContainer:dt["a"],KlabLoading:qe,draggable:Jt.a,KhubGroupList:Xt},mixins:[pt],data(){return{menuItems:De,edit:!1,groupAdd:!1,modified:!1,checking:!1,request:!1,requesting:[],updated:[],waiting:!1,editable:!0,drag:!1,availableGroups:[],availableOptInGroupsEmpty:!1,profileOptInGroupsEmpty:!1}},computed:{...Object(W["c"])("auth",["profile"]),profileGroupEntries(){return this.profile&&this.profile.agreements&&this.profile.agreements[0].agreement.groupEntries?this.profile.agreements[0].agreement.groupEntries:[]},availableGroupsForRequest(){return this.availableGroups.filter((e=>!e.group.optIn)).map(((e,t)=>({name:e,order:t+1,fixed:!1})))},availableOptInGroups:{get(){let e=this.availableGroups.filter((e=>e.group.optIn)).map(((e,t)=>({name:e,order:t+1,fixed:!1})));return 0===e.length&&(e=[{order:-1,fixed:!0,name:{group:{name:"Empty"}}}]),e},set(){let e=this.availableGroups.filter((e=>e.group.optIn)).map(((e,t)=>({name:e,order:t+1,fixed:!1})));return 0===e.length&&(e=[{order:-1,fixed:!0,name:{group:{name:"Empty"}}}]),e}},profileOptInGroups:{get(){let e=this.profileGroupEntries.filter((e=>e.group.optIn)).map(((e,t)=>({name:e,order:t+1,fixed:!1})));return 0===e.length&&(e=[{order:-1,fixed:!0,name:{group:{name:"Empty"}}}]),e},set(){let e=this.profileGroupEntries.filter((e=>e.group.optIn)).map(((e,t)=>({name:e,order:t+1,fixed:!1})));return 0===e.length&&(e=[{order:-1,fixed:!0,name:{group:{name:"Empty"}}}]),e}},profileNotOptInGroups(){return this.profileGroupEntries.filter((e=>!e.group.optIn)).map(((e,t)=>({name:e,order:t+1,fixed:!1})))},dragOptions(){return{animation:0,group:"description",disabled:!this.editable,ghostClass:"ghost"}}},methods:{...Object(W["b"])("auth",["getProfile","getGroupsSummary"]),updateAvailableGroups(){return new Promise((e=>{this.getProfile().then((async t=>{const s=t.data;let a=[];if(s.agreements[0].agreement.groupEntries){const e=await this.getGroupsSummary(),t=new Map(s.agreements[0].agreement.groupEntries.map((e=>[e.group.name,e])));a=e.filter((e=>!t.has(e.name))).map((e=>({group:e})))}e(a)}))}))},loadAvailableGroups(){this.waiting=!0,this.getGroupsSummary().then((()=>{this.$nextTick((()=>{this.request=!0,this.waiting=!1}))})).catch((e=>{console.error(`Error loading available groups: ${e.message}`),this.$q.notify({message:this.$t("messages.errorLoadingAvailableGroups"),color:"negative"}),this.waiting=!1}))},handleCheck(e){const t=this.requesting.indexOf(e.name);-1!==t?e.selected||this.requesting.splice(t,1):e.selected&&this.requesting.push(e.name)},requestGroups(){this.waiting=!0,this.$store.dispatch("auth/requestGroups",this.requesting).then((()=>{this.request=!1,this.requesting=[],this.getProfile().then((()=>{this.waiting=!1})),this.$q.notify({message:this.$t("messages.requestSent"),color:"positive"})})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.requestSentError"),color:"negative"}),this.waiting=!1}))},updateGroup(e){this.waiting=!0,this.$store.dispatch("auth/requestGroups",[e]).then((()=>{this.getProfile().then((()=>{this.waiting=!1})),this.$q.notify({message:this.$t("messages.requestSent"),color:"positive"}),this.updated.push(e)})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.requestSentError"),color:"negative"}),this.waiting=!1}))},removeGroup(e){e=e.value,this.$q.dialog({title:this.$t("messages.confirmRemoveTitle"),message:this.$t("messages.confirmRemoveGroup",{group:e}),ok:{color:"k-controls"},cancel:{color:"k-red"},persistent:!0}).onOk((()=>{this.waitin=!0,this.$store.dispatch("auth/removeGroup",[e]).then((()=>{this.getProfile().then((()=>{this.waiting=!1})),this.$q.notify({message:this.$t("messages.requestSent"),color:"positive"}),this.updated.push(e)})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.requestSentError"),color:"negative"})}))}))},formatDate:ar,onAdd(e,t){e.added&&("subscribe"===t?(this.profileOptInGroupsEmpty=!0,this.waiting=!0,this.$store.dispatch("auth/requestGroups",[e.added.element.name.group.name]).then((()=>{this.updateAvailableGroups().then((e=>{this.availableGroups=e,this.waiting=!1}))})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.requestSentError"),color:"negative"}),this.waiting=!1}))):"unsubscribe"===t&&(this.availableOptInGroupsEmpty=!0,this.waiting=!0,this.$store.dispatch("auth/removeGroup",[e.added.element.name.group.name]).then((()=>{this.updateAvailableGroups().then((e=>{this.availableGroups=e,this.waiting=!1}))})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.requestSentError"),color:"negative"}),this.waiting=!1}))))}},watch:{drag(e){e||this.$nextTick((()=>{this.availableOptInGroupsEmpty=!1,this.profileOptInGroupsEmpty=!1}))}},created(){const e=async()=>{this.availableGroups=await this.updateAvailableGroups()};e()}},ts=es,ss=(s("45ff"),Object(X["a"])(ts,Bt,Vt,!1,null,null,null)),as=ss.exports;Se()(ss,"components",{QList:h["a"],QBtn:p["a"],QDialog:x["a"],QCard:q["a"],QCardSection:M["a"],QSeparator:O["a"],QItem:g["a"],QItemSection:b["a"],QItemLabel:f["a"]}),Se()(ss,"directives",{ClosePopup:F["a"]});var os=function(){var e=this,t=e._self._c;return t("khub-default-container",{attrs:{"menu-items":e.menuItems}},[t("div",{staticClass:"kh-cp-container"},[t("h2",{staticClass:"kh-h-first"},[e._v(e._s(e.$t("messages.changePasswordTitle")))]),t("form",{on:{submit:function(t){return t.preventDefault(),e.doChange()}}},[t("input",{staticStyle:{display:"none"},attrs:{type:"text",name:"username",autocomplete:"username"},domProps:{value:e.username}}),t("q-input",{ref:"psw-input",staticClass:"kh-input",attrs:{color:"k-main",rules:[t=>0===t.length&&!e.checking||e.passwordValidation(t)],"no-error-icon":"","min-length":"8","max-length":"32",type:e.isPwd?"password":"text",placeholder:e.$t("labels.newPassword"),autocomplete:"current-password",autofocus:""},scopedSlots:e._u([{key:"prepend",fn:function(){return[t("q-icon",{attrs:{name:"mdi-key"}})]},proxy:!0},{key:"append",fn:function(){return[t("q-icon",{staticClass:"cursor-pointer",attrs:{name:e.isPwd?"mdi-eye-off-outline":"mdi-eye-outline"},on:{mousedown:function(t){e.isPwd=!1},mouseup:function(t){e.isPwd=!0}}})]},proxy:!0}]),model:{value:e.passwordRequest.password,callback:function(t){e.$set(e.passwordRequest,"password",t)},expression:"passwordRequest.password"}}),t("q-input",{ref:"conf-input",staticClass:"kh-input",attrs:{color:"k-main",rules:[t=>0===t.length&&!e.checking||e.passwordValidation(t)],"no-error-icon":"","min-length":"8","max-length":"32",type:e.isPwdConfirm?"password":"text",placeholder:e.$t("labels.newPasswordConfirmation"),autocomplete:"current-password"},scopedSlots:e._u([{key:"prepend",fn:function(){return[t("q-icon",{attrs:{name:"mdi-key"}})]},proxy:!0},{key:"append",fn:function(){return[t("q-icon",{staticClass:"cursor-pointer",attrs:{name:e.isPwdConfirm?"mdi-eye-off-outline":"mdi-eye-outline"},on:{mousedown:function(t){e.isPwdConfirm=!1},mouseup:function(t){e.isPwdConfirm=!0}}})]},proxy:!0}]),model:{value:e.passwordRequest.confirmation,callback:function(t){e.$set(e.passwordRequest,"confirmation",t)},expression:"passwordRequest.confirmation"}}),t("div",{staticClass:"cp-button-container col text-right"},[t("q-btn",{staticClass:"right",attrs:{type:"submit",color:"k-main",label:e.$t("labels.changePasswordConfirmation"),disabled:""===e.passwordRequest.password||""===e.passwordRequest.confirmation}})],1)],1)]),t("klab-loading",{attrs:{loading:e.changingPassword,message:e.$t("messages.changingPassword")}})],1)},rs=[],is={name:"ChangePassword",components:{KhubDefaultContainer:dt["a"],KlabLoading:qe},mixins:[pt],data(){return{menuItems:De,passwordRequest:{password:"",confirmation:""},isPwd:!0,isPwdConfirm:!0,changingPassword:!1,checking:!1}},computed:{username(){return this.$store.getters["auth/username"]},profileIsLoad(){return this.$store.getters["auth/profileIsLoad"]}},methods:{resetValidation(e){e.target.resetValidation()},doChange(){this.checking=!0,this.$refs["psw-input"].validate(),this.$refs["conf-input"].validate(),this.checking=!1,this.$refs["psw-input"].hasError||this.$refs["conf-input"].hasError||(this.passwordRequest.password===this.passwordRequest.confirmation?this.profileIsLoad&&this.username?(this.changingPassword=!0,this.$store.dispatch("auth/requestNewPassword",this.username).then((()=>{console.debug("Token loaded"),this.$store.dispatch("auth/setNewPassword",{passwordRequest:this.passwordRequest}).then((()=>{this.changingPassword=!1,this.$q.notify({message:this.$t("messages.passwordChanged"),color:"positive"})})).catch((e=>{this.changingPassword=!1,console.error(`Error ${e.status} changing password: ${e.message}`),e.message.startsWith("Error sending email")?this.$q.notify({message:this.$t("messages.passwordMailError"),color:"warning"}):this.$q.notify({message:this.$t("messages.passwordChangedError"),color:"negative"})}))})).catch((e=>{console.error(`Problem retrieving token: ${e.message}`),this.changingPassword=!1,this.$q.notify({message:this.$t("messages.passwordUnableToDo"),color:"negative"})}))):(console.error(`Problems loading token: profile is${this.profileIsLoad?"":"n't"} loaded and username is not set`),this.$q.notify({message:"Unable to change user password",color:"negative"})):this.$q.notify({message:this.$t("messages.passwordDoesNotMatch"),color:"negative"}))}},watch:{}},ls=is,ns=(s("d782"),Object(X["a"])(ls,os,rs,!1,null,null,null));ns.exports;Se()(ns,"components",{QInput:E["a"],QIcon:m["a"],QBtn:p["a"]});var cs=function(){var e=this,t=e._self._c;return t("khub-default-container",{attrs:{"menu-items":e.menuItems}},[t("h2",{staticClass:"kh-h-first"},[e._v(e._s(e.$t("contents.certificateTitle")))]),t("div",{domProps:{innerHTML:e._s(e.$t("contents.certificateContentBeforeEULA"))}}),t("h4",{staticClass:"kh-eula-title"},[e._v("k.LAB End user license agreement\n "),t("span",{staticClass:"kh-lang-selection"},[e._v("["),t("em",{staticClass:"kh-link",class:{disabled:"en"===e.eulaLang},on:{click:function(t){e.eulaLang="en"}}},[e._v("English")]),e._v("]\n / ["),t("em",{staticClass:"kh-link",class:{disabled:"es"===e.eulaLang},on:{click:function(t){e.eulaLang="es"}}},[e._v("Español")]),e._v("]")])]),t("div",{staticClass:"kh-eula-container"},[t("iframe",{attrs:{id:"kh-eula",width:"100%",height:"300px",frameBorder:"0",src:`https://integratedmodelling.org/statics/eula/BC3-EULA-Not-For-Profit-Individual_${e.eulaLang.toUpperCase()}.txt`}})]),t("div",{domProps:{innerHTML:e._s(e.$t("contents.certificateContentAfterEULA"))}}),t("div",{staticClass:"row"},[t("div",{staticClass:"col"},[t("q-checkbox",{attrs:{color:"k-main",label:e.$t("messages.acceptEULA")},model:{value:e.accept,callback:function(t){e.accept=t},expression:"accept"}})],1),t("div",{staticClass:"col text-right"},[t("q-btn",{attrs:{color:"k-main",label:e.$t("labels.acceptEULA"),disabled:!e.accept},on:{click:e.downloadCertificate}}),t("q-btn",{attrs:{color:"k-main",outline:"",label:e.$t("labels.declineEULA")},on:{click:e.mustAccept}})],1)]),t("klab-loading",{attrs:{loading:e.downloading,message:e.$t("messages.downloadingCertificate")}})],1)},us=[],ds={name:"Certificate",components:{KhubDefaultContainer:dt["a"],KlabLoading:qe},data(){return{menuItems:De,eulaLang:"en",accept:!1,downloading:!1}},computed:{profile(){return this.$store.getters["auth/profile"]},agreement(){return this.$store.getters["auth/agreement"]}},methods:{downloadCertificate(){if(this.accept){this.downloading=!0;const e={username:this.profile.name,agreementId:this.agreement.id};this.$store.dispatch("auth/getCertificate",e).then((()=>{this.downloading=!1})).catch((e=>{console.error(`Error ${e.status}: ${e.message}`),this.$q.notify({message:this.$t("messages.errorGeneratingCertificate"),color:"negative"}),this.downloading=!1}))}else this.mustAccept()},mustAccept(){this.$q.notify({message:this.$t("messages.mustAcceptEULA"),color:"negative"})}},mounted(){}},ps=ds,ms=(s("1fe1"),Object(X["a"])(ps,cs,us,!1,null,null,null)),hs=ms.exports;Se()(ms,"components",{QCheckbox:T["a"],QBtn:p["a"]});var gs=function(){var e=this,t=e._self._c;return t("khub-default-container",{attrs:{"menu-items":e.menuItems}},[t("transition",{attrs:{name:"fade",mode:"out-in"}},[t("router-view")],1)],1)},bs=[],fs={name:"AdminPage",components:{KhubDefaultContainer:dt["a"]},data(){return{menuItems:Ge}},methods:{...Object(W["b"])("admin",["loadSenders"])},created(){this.loadSenders().then((e=>{console.info(`Loaded ${e.length} senders`)})).catch((e=>{console.error(e.message)}))}},Es=fs,vs=(s("15da"),Object(X["a"])(Es,gs,bs,!1,null,null,null)),ks=vs.exports,_s=function(){var e=this,t=e._self._c;return t("khub-default-container",{attrs:{"menu-items":e.menuItems}},[t("transition",{attrs:{name:"fade",mode:"out-in"}},[t("router-view")],1)],1)},Ts=[],ws={name:"StatsPage",components:{KhubDefaultContainer:dt["a"]},data(){return{menuItems:Me}},methods:{...Object(W["b"])("admin",["loadSenders"])},created(){this.loadSenders().then((e=>{console.info(`Loaded ${e.length} senders`)})).catch((e=>{console.error(e.message)}))}},ys=ws,Cs=(s("f594"),Object(X["a"])(ys,_s,Ts,!1,null,null,null)),Ss=Cs.exports,As=function(){var e=this,t=e._self._c;return t("div",{staticClass:"ka-content"},[t("h2",{staticClass:"kh-h-first"},[e._v(e._s(e.$t("contents.adminHomeTitle")))]),t("div",{domProps:{innerHTML:e._s(e.$t("contents.adminHomeContent"))}})])},qs=[],Os={data(){return{}}},Rs=Os,$s=Object(X["a"])(Rs,As,qs,!1,null,null,null),Ps=$s.exports,Ns=function(){var e=this,t=e._self._c;return t("div",{staticClass:"ka-content"},[t("h2",{staticClass:"kh-h-first"},[e._v(e._s(e.$t("contents.adminUsersTitle"))+"\n "),t("q-icon",{staticClass:"cursor-pointer text-k-controls ka-refresh",class:{"ka-refreshing":e.refreshing},attrs:{name:"mdi-refresh"},on:{click:function(t){return e.refreshUsers(e.pagination,e.filter)}}},[t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0]}},[e._v(e._s(e.$t("labels.refreshUsers")))])],1)],1),t("div",{staticClass:"ka-no-updates",attrs:{id:"info-user-noupdates"}},[e._v(e._s(e.$t("messages.userNoSendUpdates")))]),t("div",[t("div",{staticClass:"row full-width ka-filters",class:[e.filtered?"ka-filtered":""]},[t("div",{staticClass:"row full-width"},[t("div",{staticClass:"col-6"},[t("div",{staticClass:"row full-width"},[t("q-input",{staticClass:"q-pa-sm col-4",attrs:{color:"k-controls",dense:"",clearable:"",label:e.$t("labels.username"),tabindex:"1"},model:{value:e.filter.username,callback:function(t){e.$set(e.filter,"username",t)},expression:"filter.username"}}),t("q-input",{staticClass:"q-pa-sm col-4",attrs:{color:"k-controls",dense:"",clearable:"",label:e.$t("labels.email"),tabindex:"2"},model:{value:e.filter.email,callback:function(t){e.$set(e.filter,"email",t)},expression:"filter.email"}}),t("q-select",{staticClass:"q-pa-sm col-4",attrs:{color:"k-controls","options-selected-class":"text-k-controls",options:e.accountStatusOptions,label:e.$t("labels.accountStatus"),dense:"","options-dense":"",clearable:"",multiple:"",tabindex:"3"},model:{value:e.filter.accountStatus,callback:function(t){e.$set(e.filter,"accountStatus",t)},expression:"filter.accountStatus"}})],1),t("div",{staticClass:"row full-width"},[t("q-select",{staticClass:"q-pa-sm col-6",attrs:{color:"k-controls",options:e.rolesOptions,label:e.$t("labels.roles"),dense:"","options-dense":"",multiple:"","use-chips":"",clearable:"",tabindex:"4"},scopedSlots:e._u([{key:"option",fn:function(s){return[t("q-item",e._g(e._b({},"q-item",s.itemProps,!1),s.itemEvents),[t("q-item-section",{attrs:{avatar:""}},[t("q-icon",{attrs:{name:s.opt.icon}})],1),t("q-item-section",[t("q-item-label",{domProps:{innerHTML:e._s(s.opt.name)}})],1)],1)]}},{key:"selected-item",fn:function(s){return[t("q-chip",{staticClass:"q-ma-none",attrs:{removable:"",dense:"",tabindex:s.tabindex,color:"white","text-color":"k-controls"},on:{remove:function(e){return s.removeAtIndex(s.index)}}},[t("q-icon",{attrs:{name:s.opt.icon}}),e._v(e._s(s.opt.name)+"\n ")],1)]}}]),model:{value:e.filter.roles,callback:function(t){e.$set(e.filter,"roles",t)},expression:"filter.roles"}}),t("div",{staticClass:"q-pa-sm col-6 row"},[t("q-toggle",{attrs:{color:"k-controls",label:e.$t("labels.rolesAll"),"true-value":"all","false-value":"any",tabindex:"5"},model:{value:e.filter.rolesAllAny,callback:function(t){e.$set(e.filter,"rolesAllAny",t)},expression:"filter.rolesAllAny"}})],1)],1),t("div",{staticClass:"row full-width"},[t("q-select",{staticClass:"q-pa-sm col-6",attrs:{color:"k-controls",options:e.groupsOptions,label:e.$t("labels.groups"),disable:e.filter.noGroups,dense:"","options-dense":"",multiple:"","use-chips":"",clearable:"",tabindex:"6"},scopedSlots:e._u([{key:"option",fn:function(s){return[t("q-item",e._g(e._b({},"q-item",s.itemProps,!1),s.itemEvents),[null!==s.opt.icon?t("q-item-section",{attrs:{avatar:""}},[t("img",{staticClass:"ka-group-icon",attrs:{src:s.opt.icon,width:"25",alt:s.opt.label}})]):t("q-item-section",{attrs:{avatar:""}},[t("div",{staticClass:"ka-no-group-icon ka-small"},[e._v(e._s(s.opt.label.charAt(0).toUpperCase()))])]),t("q-item-section",[t("q-item-label",{domProps:{innerHTML:e._s(s.opt.label)}}),t("q-item-label",{attrs:{caption:""}},[e._v(e._s(s.opt.description))])],1)],1)]}},{key:"selected-item",fn:function(s){return[t("q-chip",{staticClass:"q-ma-none",attrs:{removable:"",dense:"",tabindex:s.tabindex,color:"white","text-color":"k-controls"},on:{remove:function(e){return s.removeAtIndex(s.index)}}},[null!==s.opt.icon?t("img",{staticClass:"ka-group-icon",attrs:{src:s.opt.icon,width:"15",alt:s.opt.name}}):t("div",{staticClass:"ka-no-group-icon ka-small"},[e._v(e._s(s.opt.label.charAt(0).toUpperCase()))]),e._v("\n "+e._s(s.opt.name)+"\n ")])]}}]),model:{value:e.filter.groups,callback:function(t){e.$set(e.filter,"groups",t)},expression:"filter.groups"}}),t("div",{staticClass:"q-pa-sm col-6 row"},[t("q-toggle",{staticClass:"col-6",attrs:{color:"k-controls",label:e.$t("labels.groupsAll"),"true-value":"all","false-value":"any",disable:e.filter.noGroups,tabindex:"7"},model:{value:e.filter.groupsAllAny,callback:function(t){e.$set(e.filter,"groupsAllAny",t)},expression:"filter.groupsAllAny"}}),t("q-checkbox",{staticClass:"col-6",attrs:{color:"k-controls",dense:"",label:e.$t("labels.noGroups"),"left-label":"",tabindex:"8"},model:{value:e.filter.noGroups,callback:function(t){e.$set(e.filter,"noGroups",t)},expression:"filter.noGroups"}})],1)],1)]),t("div",{staticClass:"col-6"},[t("div",{staticClass:"row full-width"},[t("k-input-date",{ref:"lastConnectionFrom",attrs:{classes:"q-pa-sm col-4",dense:"",color:"k-controls",label:e.$t("labels.lastConnectionFrom"),disable:e.filter.noLastConnection,tabindex:"10"},on:{input:function(t){return e.checkDates("lastConnection","From")}},model:{value:e.filter.lastConnectionFrom,callback:function(t){e.$set(e.filter,"lastConnectionFrom",t)},expression:"filter.lastConnectionFrom"}}),t("k-input-date",{ref:"lastLoginFrom",attrs:{classes:"q-pa-sm col-4",color:"k-controls",dense:"",label:e.$t("labels.lastLoginFrom"),disable:e.filter.noLastLogin,tabindex:"20"},on:{input:function(t){return e.checkDates("login","From")}},model:{value:e.filter.lastLoginFrom,callback:function(t){e.$set(e.filter,"lastLoginFrom",t)},expression:"filter.lastLoginFrom"}}),t("k-input-date",{ref:"registrationDateFrom",attrs:{classes:"q-pa-sm col-4",color:"k-controls",dense:"",label:e.$t("labels.registrationDateFrom"),disable:e.filter.noRegistrationDate,tabindex:"30"},on:{input:function(t){return e.checkDates("registration","From")}},model:{value:e.filter.registrationDateFrom,callback:function(t){e.$set(e.filter,"registrationDateFrom",t)},expression:"filter.registrationDateFrom"}})],1),t("div",{staticClass:"row full-width"},[t("k-input-date",{ref:"lastConnectionTo",attrs:{classes:"q-pa-sm col-4",color:"k-controls",dense:"",label:e.$t("labels.lastConnectionTo"),disable:e.filter.noLastConnection,tabindex:"11"},on:{input:function(t){return e.checkDates("lastConnection","To")}},model:{value:e.filter.lastConnectionTo,callback:function(t){e.$set(e.filter,"lastConnectionTo",t)},expression:"filter.lastConnectionTo"}}),t("k-input-date",{ref:"lastLoginTo",attrs:{classes:"q-pa-sm col-4",color:"k-controls",dense:"",label:e.$t("labels.lastLoginTo"),disable:e.filter.noLastLogin,tabindex:"21"},on:{input:function(t){return e.checkDates("login","To")}},model:{value:e.filter.lastLoginTo,callback:function(t){e.$set(e.filter,"lastLoginTo",t)},expression:"filter.lastLoginTo"}}),t("k-input-date",{ref:"registrationDateTo",attrs:{classes:"q-pa-sm col-4",color:"k-controls",dense:"",label:e.$t("labels.registrationDateTo"),disable:e.filter.noRegistrationDate,tabindex:"31"},on:{input:function(t){return e.checkDates("registration","To")}},model:{value:e.filter.registrationDateTo,callback:function(t){e.$set(e.filter,"registrationDateTo",t)},expression:"filter.registrationDateTo"}})],1),t("div",{staticClass:"row full-width"},[t("q-checkbox",{staticClass:"q-pa-sm col-4",staticStyle:{height:"56px"},attrs:{color:"k-controls",dense:"",label:e.$t("labels.hasLastConnection"),"left-label":"",tabindex:"12"},model:{value:e.filter.noLastConnection,callback:function(t){e.$set(e.filter,"noLastConnection",t)},expression:"filter.noLastConnection"}}),t("q-checkbox",{staticClass:"q-pa-sm col-4",staticStyle:{height:"56px"},attrs:{color:"k-controls",dense:"",label:e.$t("labels.hasLastLogin"),"left-label":"",tabindex:"22"},model:{value:e.filter.noLastLogin,callback:function(t){e.$set(e.filter,"noLastLogin",t)},expression:"filter.noLastLogin"}}),t("q-checkbox",{staticClass:"q-pa-sm col-4",staticStyle:{height:"56px"},attrs:{color:"k-controls",dense:"",label:e.$t("labels.hasRegistrationDate"),"left-label":"",tabindex:"32"},model:{value:e.filter.noRegistrationDate,callback:function(t){e.$set(e.filter,"noRegistrationDate",t)},expression:"filter.noRegistrationDate"}})],1)])]),t("div",{staticClass:"row full-width ka-filter-info q-pa-sm"},[t("div",{staticClass:"col-10 self-end"},[e._v(e._s(e.$t("labels.filterInfo",{filtered:e.filtered?e.$t("labels.filtered"):e.$t("labels.all"),element:e.$t("menu.users"),number:e.rowsNumber})))]),t("div",{staticClass:"col text-right"},[t("q-btn",{staticClass:"ka-action-button",attrs:{label:e.$t("labels.clearSearch"),color:"k-main"},on:{click:e.initializeFilter}})],1),t("div",{staticClass:"col text-right"},[t("q-btn",{staticClass:"ka-action-button",attrs:{label:e.$t("labels.applyFilters"),disabled:!e.filtered,color:"k-controls"},on:{click:function(t){return e.refreshUsers(e.pagination,e.filter)}}})],1)])]),t("div",{staticClass:"row full-width ka-actions q-ma-md"},[t("div",{staticClass:"row full-width q-pa-xs ka-selected-info"},[t("div",{staticClass:"inline-block",domProps:{innerHTML:e._s(e.$t("labels.selectedInfo",{selected:e.selected.length,total:e.users.length,type:e.$t("labels.users")}))}}),e.selected.length>0?t("div",{staticClass:"inline-block q-pa-xs"},[t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-checkbox-multiple-blank-outline",size:"1.8em"},on:{click:function(t){return e.selected.splice(0,e.selected.length)}}},[t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0]}},[e._v(e._s(e.$t("labels.unselectAll")))])],1)],1):e._e(),e.selected.length0},on:{click:function(t){return e.deleteUserConfirm(s.row.name)}}},[t("q-tooltip",{attrs:{anchor:"bottom middle",self:"top middle",offset:[0,8],delay:600}},[e._v(e._s(e.$t("labels.deleteUser",{username:s.row.name})))])],1)],1)],1)]}}])})],1),t("group-selection-dialog",{attrs:{"dialog-action":e.modifyGroupsAction,action:e.modifyGroups,"select-label":e.modifyGroups===e.ACTIONS.ADD_GROUPS_ACTION?e.$t("labels.assignGroups"):e.$t("labels.removeGroups")}}),t("klab-delete-confirm-dialog",{attrs:{element:this.$t("labels.user").toLowerCase(),elementName:e.usernameToDelete,open:e.openDelete,confirmFunction:e.deleteConfirm},on:{"update:open":function(t){e.openDelete=t}}}),t("q-dialog",{staticClass:"ka-dialog",attrs:{persistent:""},model:{value:e.sendingEmails,callback:function(t){e.sendingEmails=t},expression:"sendingEmails"}},[t("q-card",{staticStyle:{"min-width":"600px"}},[t("q-card-section",[t("div",{staticClass:"text-h6 q-pa-sm ka-dialog-title",domProps:{innerHTML:e._s(e.$t("labels.sendingToUsers",{users:`${e.selected.length}`}))}}),0!==e.userWithNoSend?t("q-checkbox",{staticClass:"q-pa-xs",attrs:{color:"k-red","left-label":"",tabindex:"50"},model:{value:e.mail.forceSendingEmail,callback:function(t){e.$set(e.mail,"forceSendingEmail",t)},expression:"mail.forceSendingEmail"}},[t("span",{staticClass:"ka-nosend-advice",domProps:{innerHTML:e._s(e.$t("labels.forceSend",{users:e.userWithNoSend}))}})]):e._e()],1),t("q-card-section",[t("q-select",{staticClass:"q-pa-sm",attrs:{color:"k-controls",options:e.senders,label:e.$t("labels.emailSenders"),"options-sanitize":!0,dense:"","options-dense":"",clearable:"",tabindex:"51"},model:{value:e.mail.sender,callback:function(t){e.$set(e.mail,"sender",t)},expression:"mail.sender"}}),t("q-input",{staticClass:"q-pa-sm",attrs:{color:"k-controls",dense:"",label:e.$t("labels.emailSubject"),tabindex:"52"},model:{value:e.mail.subject,callback:function(t){e.$set(e.mail,"subject",t)},expression:"mail.subject"}}),t("div",{staticClass:"q-pa-sm ka-field-title"},[e._v(e._s(e.$t("labels.emailContent")))]),t("q-editor",{staticClass:"q-ma-sm",attrs:{"min-height":"10rem",dense:"",tabindex:"53"},model:{value:e.mail.content,callback:function(t){e.$set(e.mail,"content",t)},expression:"mail.content"}})],1),t("q-card-actions",{staticClass:"q-ma-md text-primary",attrs:{align:"right"}},[t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",label:e.$t("labels.btnCancel"),color:"k-controls",tabindex:"55"}}),t("q-btn",{attrs:{label:e.$t("labels.sendEmail"),disabled:null===e.mail.sender||null===e.mail.subject||""===e.mail.subject||null===e.mail.content||""===e.mail.content,color:"k-controls",tabindex:"54"},on:{click:e.sendEmailAction}})],1)],1)],1),t("user-form-card",{attrs:{open:e.open},on:{showDialog:e.showDialog}}),t("klab-loading",{attrs:{loading:e.waiting||e.refreshing,message:e.$t("messages.doingThings")}})],1)},xs=[];const Us=e=>new Promise(((t,s)=>{sr({type:re["u"].SEND_EMAIL.method,url:re["u"].SEND_EMAIL.url,needAuth:!0,params:e},((e,s)=>{t(e),s()}),(e=>{s(e)}))}));var Is=function(){var e=this,t=e._self._c;return t("q-dialog",{staticClass:"ka-dialog",attrs:{persistent:""},on:{"before-show":e.resetGroupDependencies},model:{value:e.dialogOpen,callback:function(t){e.dialogOpen=t},expression:"dialogOpen"}},[t("q-card",{staticStyle:{"min-width":"350px"}},[t("q-card-section",[t("div",{staticClass:"text-h6 q-pa-sm ka-dialog-title"},[e._v(e._s(e.action===e.ACTIONS.ADD_GROUPS_ACTION?e.$t("labels.assignGroups"):e.$t("labels.removeGroups")))])]),t("q-card-section",e._l(e.groupsOptions,(function(s,a){return t("div",{key:a},[t("q-checkbox",{staticClass:"q-pa-xs q-ma-none",attrs:{disable:e.groupDependencies.includes(s.label),val:s.label,color:"k-controls"},model:{value:e.selectedGroups,callback:function(t){e.selectedGroups=t},expression:"selectedGroups"}},[null!==s.icon?t("q-chip",{attrs:{color:"white"}},[t("q-avatar",{attrs:{color:"white"}},[t("img",{attrs:{src:s.icon,width:"30",alt:s.label}})]),e._v("\n "+e._s(s.label)+"\n ")],1):t("div",{staticClass:"ka-no-group-chip"},[t("span",{staticClass:"ka-no-group-icon ka-medium"},[e._v(e._s(s.label.charAt(0).toUpperCase()))]),e._v(e._s(s.label))])],1)],1)})),0),t("q-card-actions",{staticClass:"text-k-main",attrs:{align:"right"}},[t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",label:e.$t("labels.btnCancel"),color:"k-controls"},on:{click:function(t){return e.dialogAction(null)}}}),t("q-btn",{attrs:{label:null===e.selectLabel?this.$t("labels.selectGroupButtonDefault"):e.selectLabel,disabled:0===e.selectedGroups.length,color:"k-controls"},on:{click:function(t){return e.dialogAction(e.selectedGroups)}}})],1)],1)],1)},Ls=[],Ds={name:"GroupSelectionDialog",props:{dialogAction:{type:Function,required:!0},action:{type:String,default:null},selectLabel:{type:String,default:null}},data(){return{groupDependencies:[],selectedGroups:[],ACTIONS:re["a"]}},computed:{...Object(W["c"])("admin",["groups","groupsOptions"]),dialogOpen:{get(){return null!==this.action},set(){}}},methods:{...Object(W["b"])("admin",["loadGroups"]),resetGroupDependencies(){this.groupDependencies.splice(0,this.groupDependencies.length)}},watch:{selectedGroups(){if(this.selectedGroups.length>0){let e,t;e=this.action===re["a"].ADD_GROUPS_ACTION?this.groupsOptions.filter((e=>this.selectedGroups.includes(e.label))):this.groupsOptions.filter((e=>!this.selectedGroups.includes(e.label))),this.action===re["a"].ADD_GROUPS_ACTION&&(t=e.reduce(((e,t)=>(t.dependencies&&t.dependencies.length>0&&t.dependencies.forEach((t=>{e.includes(t)||e.push(t)})),e)),[])),this.action===re["a"].REMOVE_GROUPS_ACTION&&(t=[],e.forEach((e=>{e.dependencies&&e.dependencies.length>0&&e.dependencies.some((e=>this.selectedGroups.indexOf(e)>=0))&&t.push(e.value)}))),this.$nextTick((()=>{this.groupDependencies.splice(0,this.groupDependencies.length),this.groupDependencies.push(...t),this.groupDependencies.forEach((e=>{this.selectedGroups.includes(e)||this.selectedGroups.push(e)}))}))}},action(e){null!==e&&this.selectedGroups.splice(0,this.selectedGroups.length)}},created(){this.loadGroups()}},Gs=Ds,Ms=Object(X["a"])(Gs,Is,Ls,!1,null,null,null),Qs=Ms.exports;Se()(Ms,"components",{QDialog:x["a"],QCard:q["a"],QCardSection:M["a"],QCheckbox:T["a"],QChip:_["a"],QAvatar:A["a"],QCardActions:Q["a"],QBtn:p["a"]}),Se()(Ms,"directives",{ClosePopup:F["a"]});var js=function(){var e=this,t=e._self._c;return t("q-dialog",{attrs:{persistent:""},model:{value:e.open,callback:function(t){e.open=t},expression:"open"}},[t("q-card",{staticStyle:{width:"1600px","max-width":"80vw"}},[t("KhubDialogTitle",{attrs:{title:"Update user"},on:{closeDialog:function(t){return e.showDialog()}}}),t("div",{staticClass:"col"},[t("User",{attrs:{profile:e.user,type:"USER",admin:!0},on:{closeDialog:function(t){return e.showDialog()}}})],1),t("div",{staticClass:"col"})],1)],1)},Fs=[],Bs=function(){var e=this,t=e._self._c;return t("q-card-section",[t("div",{staticClass:"full-width row items-center q-pb-none"},[t("div",{staticClass:"text-h q-pa-sm ka-dialog-title"},[e._v(e._s(e.title))]),t("q-space"),e.close?t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],staticClass:"text-k-main",attrs:{icon:"close",flat:"",round:"",dense:""},on:{click:function(t){return e.closeDialog()}}}):e._e()],1),t("q-separator",{staticClass:"ka-dialog-title-separator"})],1)},Vs=[],Ys={props:["title","close"],data(){return{}},name:"DialogTitle",methods:{closeDialog(){this.$emit("closeDialog",!1)}}},Ks=Ys,Ws=Object(X["a"])(Ks,Bs,Vs,!1,null,null,null),Hs=Ws.exports;Se()(Ws,"components",{QCardSection:M["a"],QSpace:$["a"],QBtn:p["a"],QSeparator:O["a"]}),Se()(Ws,"directives",{ClosePopup:F["a"]});var zs={mixins:[pt],props:["open"],data(){return{ROLES:re["l"]}},name:"UserFormCard",components:{User:Gt,KhubDialogTitle:Hs,KhubCustomPropertiesEditableTable:xt},computed:{...Object(W["c"])("admin",["user"])},methods:{...Object(W["b"])("admin",[]),formatDate:ar,showDialog(){this.$emit("showDialog",!1)}},watch:{},mounted(){}},Xs=zs,Zs=Object(X["a"])(Xs,js,Fs,!1,null,null,null),Js=Zs.exports;Se()(Zs,"components",{QDialog:x["a"],QCard:q["a"]});var ea=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"q-app"}},[t("div",{staticClass:"q-pa-sm q-gutter-sm"},[t("q-dialog",{model:{value:e.open,callback:function(t){e.open=t},expression:"open"}},[t("q-card",[t("q-card-section",{staticClass:"q-pb-xs"},[t("div",{staticClass:"text-h6"},[e._v(" DELETE\n ")])]),t("q-separator",{attrs:{spaced:""}}),t("q-card-section",{attrs:{align:"center"}},[t("p",{staticStyle:{"font-size":"15px"},attrs:{size:"md"}},[e._v("Are you sure you want to delete "+e._s(e.element)+" "),t("b",[e._v(" "+e._s(e.elementName))]),e._v("?\n ")])]),"user"===e.element?t("q-card-section",{staticClass:"q-pt-xs"},[t("q-banner",{staticClass:"bg-red-1",attrs:{rounded:"",dense:""}},[t("div",{staticStyle:{"font-size":"12px"}},[e._v("\n "+e._s(e.$t("messages.cautionRemoveUser").replace("{element}",this.$t("labels.user").toLowerCase()))+"\n ")])])],1):e._e(),t("q-separator",{attrs:{spaced:""}}),t("q-card-actions",{attrs:{align:"right"}},[t("q-btn",{attrs:{label:e.$t("labels.cancel"),color:"k-main"},on:{click:e.close}}),t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],staticStyle:{"margin-right":"0.1rem"},attrs:{icon:"delete",label:e.$t("labels.delete"),color:"k-red"},on:{click:this.delete}})],1)],1)],1)],1)])},ta=[],sa={name:"KlabDeleteConfirmDialog",props:["confirmFunction","open","element","elementName"],computed:{modalOpen:{get(){return this.open},set(e){this.$emit("update:open",e)}}},methods:{delete(){this.confirmFunction(),this.close()},close(){this.$emit("update:open",!1)}}},aa=sa,oa=Object(X["a"])(aa,ea,ta,!1,null,null,null),ra=oa.exports;Se()(oa,"components",{QDialog:x["a"],QCard:q["a"],QCardSection:M["a"],QIcon:m["a"],QSeparator:O["a"],QBanner:st["a"],QCardActions:Q["a"],QBtn:p["a"]}),Se()(oa,"directives",{ClosePopup:F["a"]});const ia={username:"",email:"",registrationDateFrom:null,registrationDateTo:null,lastLoginFrom:null,lastLoginTo:null,lastConnectionFrom:null,lastConnectionTo:null,noRegistrationDate:!1,noLastLogin:!1,noLastConnection:!1,accountStatus:null,groups:null,groupsAllAny:"any",roles:null,rolesAllAny:"any",noGroups:!1};var la={name:"UsersComponent",components:{KInputDate:Tt,KlabLoading:qe,GroupSelectionDialog:Qs,UserFormCard:Js,KlabDeleteConfirmDialog:ra},data(){return{selected:[],pagination:{sortBy:"lastConnection",descending:!0,rowsPerPage:25,oldRowsPerPage:25,page:1,rowsNumber:0},accountStatusOptions:[{label:this.$t("labels.statusActive"),value:"active"},{label:this.$t("labels.statusPendingActivation"),value:"pendingActivation"},{label:this.$t("labels.statusInactive"),value:"inactive"}],rolesOptions:Object.keys(re["l"]).map((e=>re["l"][e])),groupDependencies:[],filter:{...ia},columns:[{name:"name",field:"name",required:!0,label:this.$t("labels.username"),align:"left",sortable:!0,headerStyle:"width: 10%"},{name:"email",field:"email",required:!0,label:this.$t("labels.email"),align:"left",sortable:!0,headerStyle:"width: 10%",classes:"ka-user-email"},{name:"roles",field:"roles",required:!0,label:this.$t("labels.roles"),align:"left",headerStyle:"width: 8%; text-align: center"},{name:"groups",field:"groups",required:!0,label:this.$t("labels.groups"),align:"left",headerStyle:"width: 10%; text-align: center"},{name:"lastConnection",field:"lastConnection",required:!0,label:this.$t("labels.lastConnection"),align:"center",sortable:!0,sort:(e,t)=>rr(e,t),headerStyle:"width: 13%"},{name:"lastLogin",field:"lastLogin",required:!0,label:this.$t("labels.lastLogin"),align:"center",sortable:!0,sort:(e,t)=>rr(e,t),headerStyle:"width: 13%"},{name:"registrationDate",field:"registrationDate",required:!0,label:this.$t("labels.registrationDate"),align:"center",sortable:!0,sort:(e,t)=>rr(e,t),headerStyle:"width: 13%"},{name:"status",field:"accountStatus",required:!0,label:this.$t("labels.accountStatus"),align:"center",headerStyle:"width: 6%"},{name:"edit",required:!0,align:"center",headerStyle:"width: 6%"}],roles:re["l"],ACTIONS:re["a"],rowsNumber:0,refreshing:!1,waiting:!1,modifyGroups:null,sendingEmails:!1,mail:{sender:null,subject:null,content:"",type:re["f"].HTML,forceSendingEmail:!1},open:!1,usernameToDelete:"",openDelete:!1}},computed:{...Object(W["c"])("admin",["users","groups","groupsIcons","groupsOptions","senders"]),filtered(){return!Jo(this.filter,ia)},userWithNoSend(){return null!==this.selected&&this.selected.length>0?this.selected.filter((e=>!e.sendUpdates)).length:0}},methods:{...Object(W["b"])("admin",["loadUsers","loadUser","resetUser","deleteUser","loadGroups","modifyUsersGroups"]),formatDate:ar,selectAll(){this.users.forEach((e=>{0!==this.selected.length&&-1!==this.selected.findIndex((t=>e.id===t.id))||this.selected.push(e)}))},formatStatus(e){switch(e){case"active":return this.$t("labels.statusActive");case"verified":return this.$t("labels.statusVerified");case"pendingActivation":return this.$t("labels.statusPendingActivation");case"inactive":return this.$t("labels.statusInactive");default:return e}},initializeFilter(){this.filter={...ia},this.$refs.lastConnectionFrom.reset(),this.$refs.lastConnectionTo.reset(),this.$refs.registrationDateFrom.reset(),this.$refs.registrationDateTo.reset(),this.$refs.lastLoginFrom.reset(),this.$refs.lastLoginTo.reset(),this.refreshUsers(this.pagination,this.filter)},filterArrays(e,t,s){const a=t.map((e=>e.value));return"all"===s?a.every((t=>e.includes(t))):e.some((e=>a.includes(e)))},sortDate(e,t){return e?t?new Date(e).getTime()-new Date(t).getTime():1:-1},checkDates(e,t){const s=`${e}From`,a=`${e}To`;null!==this.filter[s]&&null!==this.filter[a]&&bt()(this.filter[s],"L").isSameOrAfter(bt()(this.filter[a],"L"))&&(this.$refs[`${e}${t}`].reset(),this.$q.notify({message:this.$t("messages.errorDateFromTo",{type:e}),color:"negative"}))},getPaginationLabel(e,t,s){return this.rowsNumber=s,this.$t("labels.pagination",{firstRowIndex:e,endRowIndex:t,totalRowsNumber:s})},onRequest(e){this.refreshUsers(e.pagination?e.pagination:this.pagination,e.filter?e.filter:this.filter)},refreshUsers(e,t){this.refreshing=!0,this.loadUsers(pr(e,t)).then((t=>{this.pagination={...this.pagination,...e,...t},this.refreshing=!1,this.$q.notify({message:this.$t("messages.usersLoaded"),color:"positive",timeout:1e3})})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.usersLoadedError"),color:"negative",timeout:1500}),this.refreshing=!1}))},modifyGroupsAction(e){null!==e?e.length>0&&this.confirm(this.$t("labels.warning"),this.modifyGroups===re["a"].ADD_GROUPS_ACTION?this.$t("messages.usersGroupsAssignConfirm",{groupsNumber:e.length,usersNumber:this.selected.length}):this.$t("messages.usersGroupsRemoveConfirm",{groupsNumber:e.length,usersNumber:this.selected.length}),(()=>{this.waiting=!0,this.modifyUsersGroups({users:this.selected.map((e=>e.name)),groups:e,action:this.modifyGroups}).then((()=>{this.$q.notify({message:this.modifyGroups===re["a"].ADD_GROUPS_ACTION?this.$t("messages.usersGroupsAssign"):this.$t("messages.usersGroupsRemoved"),color:"positive",timeout:1e3}),this.waiting=!1,this.modifyGroups=null,this.refreshUsers(this.pagination,this.filter)})).catch((e=>{console.error(e),this.$q.notify({message:this.modifyGroups===re["a"].ADD_GROUPS_ACTION?this.$t("messages.usersGroupsAssignError"):this.$t("messages.usersGroupsRemoveError"),color:"negative",timeout:1e3}),this.waiting=!1,this.modifyGroups=null}))}),(()=>{this.modifyGroups=null})):this.modifyGroups=null},sendEmailAction(){if(null!==this.mail.sender&&this.selected.length>0){const e=this.selected.filter((e=>this.mail.forceSendingEmail||e.sendUpdates)).map((e=>e.email));if(0===e.length)return void this.$q.notify({message:this.$t("messages.emailWithNoReceipts"),color:"negative"});this.waiting=!0,Us({from:null,to:e,replayTo:[this.mail.sender],subject:this.mail.subject,content:this.mail.content,type:re["f"].HTML}).then((()=>{this.waiting=!1,this.sendingEmails=!1,this.$q.notify({message:this.$t("messages.emailSent"),color:"positive"})})).catch((e=>{this.waiting=!1,this.sendingEmails=!1,this.$q.notify({message:e.message,color:"negative"})}))}},confirm(e,t,s,a){this.$q.dialog({title:e,message:t,ok:{color:"k-controls",push:!0,flat:!0},cancel:{color:"k-controls",push:!0,flat:!0},persistent:!0}).onOk((()=>{s()})).onCancel((()=>{a()}))},deleteUserConfirm(e){this.usernameToDelete=e,this.openDelete=!0},deleteConfirm(){this.deleteUser(this.usernameToDelete).then((e=>{this.$q.notify({icon:"mdi-account-remove",message:this.$t("messages.userDeleted",{username:e.data.User}),type:"positive",timeout:5e3})})).catch((e=>console.error(e)))},copyTextToClipboard(e,t){e.stopPropagation(),mr(t),this.$q.notify({message:this.$t("messages.textCopied"),type:"info",icon:"mdi-information",timeout:500})},openDialog(e=null){this.loadUser(e).then((()=>{this.showDialog(!0)})).catch((e=>{console.error(e)}))},showDialog(e){this.open=e}},watch:{sendingEmails(e){e&&(this.mail={sender:null,subject:null,content:"",type:re["f"].HTML,forceSendingEmail:!1})}},created(){this.loadGroups().then((()=>{this.refreshUsers(this.pagination,this.filter)})),bt.a.locale(this.$q.lang.getLocale())},mounted(){}},na=la,ca=(s("9b2f"),Object(X["a"])(na,Ns,xs,!1,null,null,null)),ua=ca.exports;Se()(ca,"components",{QIcon:m["a"],QTooltip:R["a"],QInput:E["a"],QSelect:k["a"],QItem:g["a"],QItemSection:b["a"],QItemLabel:f["a"],QChip:_["a"],QToggle:C["a"],QCheckbox:T["a"],QBtn:p["a"],QTable:I["a"],QTr:D["a"],QTd:L["a"],QDialog:x["a"],QCard:q["a"],QCardSection:M["a"],QEditor:v["a"],QCardActions:Q["a"],QAvatar:A["a"]}),Se()(ca,"directives",{ClosePopup:F["a"]});var da=function(){var e=this,t=e._self._c;return t("div",{staticClass:"ka-content"},[t("h2",{staticClass:"kh-h-first"},[e._v(e._s(e.$t("contents.adminGroupsTitle"))+"\n "),t("q-icon",{staticClass:"cursor-pointer text-k-main ka-refresh",class:{"ka-refreshing":e.refreshing},attrs:{name:"mdi-refresh"},on:{click:e.refreshGroups}},[t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0],delay:600}},[e._v(e._s(e.$t("labels.refreshGroups")))])],1)],1),t("div",{staticClass:"row full-width ka-actions q-ma-md"},[t("div",{staticClass:"row full-width q-pa-sm ka-actions-row"},[t("div",{staticClass:"col-1 ka-action-desc"},[e._v(e._s(e.$t("labels.actionsGroups")))]),t("q-btn",{staticClass:"col-2 ka-action-button",attrs:{icon:"mdi-account-multiple-plus",label:e.$t("labels.createGroup"),color:"k-controls"},on:{click:function(t){return e.openDialog()}}})],1)]),e.groups.length>0?t("div",{},[t("q-table",{attrs:{grid:"",data:e.groups,columns:e.columns,"row-key":"icon","rows-per-page-options":[10,30,50,100,0]},scopedSlots:e._u([{key:"item",fn:function(s){return[t("div",{staticClass:"q-pa-xs col-sm-12 col-md-6 col-lg-4"},[t("q-card",{staticClass:"full-height"},[t("q-item",[t("q-item-section",{attrs:{avatar:""}},[s.row.iconUrl?t("img",{attrs:{width:"50",src:s.row.iconUrl}}):t("div",{staticClass:"ka-no-group-icon ka-large"},[e._v(e._s(s.row.name.charAt(0).toUpperCase()))])]),t("q-item-section",[t("div",{staticClass:"ka-group-name"},[e._v(e._s(s.row.name))])]),t("q-item-section",{staticClass:"q-pa-xs ka-group-buttons",attrs:{side:"","no-wrap":""}},[t("q-btn",{attrs:{icon:"mdi-pencil",round:"",color:"k-controls",size:"sm"},on:{click:function(t){return e.openDialog(s.row.name)}}},[t("q-tooltip",{attrs:{anchor:"bottom middle",self:"top middle",offset:[0,8],delay:600}},[e._v(e._s(e.$t("labels.editGroup")))])],1),t("div",{staticClass:"inline-block"},[t("q-btn",{attrs:{icon:"mdi-trash-can",round:"",color:"k-red",size:"sm",disable:e.usersCountCounter>0||s.row.usersCount>0},on:{click:function(t){return e.removeGroup(s.row.name)}}},[t("q-tooltip",{attrs:{anchor:"bottom middle",self:"top middle",offset:[0,8],delay:600}},[e._v(e._s(e.$t("labels.deleteGroup")))])],1),e.usersCountCounter>0||s.row.usersCount>0?t("q-tooltip",{staticClass:"bg-k-red",attrs:{anchor:"bottom middle",self:"top middle",offset:[0,8],delay:600}},[e.usersCountCounter>0?t("span",[e._v(e._s(e.$t("messages.notDeletableGroup",{reason:e.$t("messages.notDeletableGroupWaiting")})))]):s.row.usersCount>0?t("span",[e._v(e._s(e.$t("messages.notDeletableGroup",{reason:e.$t("messages.notDeletableGroupHasUsers")})))]):e._e()]):e._e()],1)],1)],1),t("q-item-label",{attrs:{caption:""}},[t("div",{staticClass:"ka-group-description q-pa-md"},[e._v(e._s(s.row.description))])]),t("q-separator"),t("q-list",{staticClass:"gc-items"},e._l(s.cols.filter((e=>"icon"!==e.name&&"name"!==e.name&&"description"!==e.name)),(function(s){return t("q-item",{key:s.name},[t("q-item-section",{staticClass:"gc-item-label"},[t("q-item-label",[e._v(e._s(s.label))])],1),s.value?Array.isArray(s.value)?t("q-item-section",{class:{"gc-multiple-item":s.value&&s.value.length>0&&!s.component}},[0===s.value.length?t("div",[t("q-item-label",{attrs:{caption:""},domProps:{innerHTML:e._s(e.$t("labels.groupNoValue"))}})],1):"table"===s.component?t("div",[t("q-table",{attrs:{flat:"",bordered:"",dense:"",data:s.value,columns:s.columns,"row-key":"key","hide-bottom":"","rows-per-page-options":[0],wrap:""}})],1):e._l(s.value,(function(a,o){return t("div",{key:o},["observables"===s.name?t("q-item-label",{class:{"gc-separator":a.separator},attrs:{caption:""}},[e._v(e._s(a.label)+"\n "),a.separator?e._e():t("q-tooltip",{attrs:{anchor:"center right",self:"center left","content-class":"bg-k-main","content-style":"font-size: 12px",delay:600,offset:[5,0]}},[e._v(e._s(a.description))])],1):t("q-item-label",{attrs:{caption:""}},[e._v(e._s(a)+"\n "),t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0]}},[e._v(e._s(a))])],1)],1)}))],2):t("q-item-section",{staticClass:"gc-item"},[t("q-item-label",{attrs:{caption:""}},[e._v(e._s(s.value))])],1):t("q-item-section",[t("q-item-label",{attrs:{caption:""},domProps:{innerHTML:e._s(e.$t("labels.groupNoValue"))}})],1)],1)})),1)],1)],1)]}}],null,!1,1971385468)}),t("group-form-card",{attrs:{"new-group":e.newGroup}})],1):e._e(),t("klab-loading",{attrs:{loading:e.waiting||e.refreshing,message:e.$t("messages.doingThings")}})],1)},pa=[];const ma=[{name:"milliseconds",scale:1e3},{name:"seconds",scale:60},{name:"minutes",scale:60},{name:"hours",scale:24}],ha=[{name:"year",scale:365},{name:"month",scale:30}];function ga(e){const t={};return ma.forEach((s=>{const a=Math.floor(e/s.scale),o=e-a*s.scale;t[s.name]=o,e=a})),ha.forEach((s=>{t[s.name]=0;while(e>=s.scale)t[s.name]+=1,e-=s.scale})),t.day=e,t}function ba(e){let t=0;return ha.forEach((s=>{e[s.name]&&(t+=e[s.name]*s.scale)})),e.day&&(t+=e.day),ma.forEach((e=>{t*=e.scale})),t}function fa(e){let t="";const s=["year","month","day"];return s.forEach((s=>{t&&(t+=" "),0!==e[s]&&(t+=`${e[s]} ${ce["b"].tc(`labels.${s}`)}`)})),""===t?ce["b"].tc("messages.unknownDate"):t}var Ea=function(){var e=this,t=e._self._c;return null!==e.group?t("q-dialog",{attrs:{persistent:""},model:{value:e.open,callback:function(t){e.open=t},expression:"open"}},[t("div",{staticClass:"ka-dialog"},[t("q-card",{staticClass:"full-height"},[t("q-list",[t("q-item",[t("q-item-section",[t("q-input",{ref:"group-name",attrs:{color:"k-controls",disable:!e.newGroup,label:e.$t("labels.groupName"),rules:[t=>e.fieldRequired(t)]},scopedSlots:e._u([{key:"append",fn:function(){return[e.group.name&&e.newGroup?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-close-circle",color:"k-main"},on:{click:function(t){t.stopPropagation(),e.group.name=null}}}):e._e()]},proxy:!0}],null,!1,3957828500),model:{value:e.group.name,callback:function(t){e.$set(e.group,"name",t)},expression:"group.name"}})],1)],1),t("q-item",[t("q-item-section",{staticClass:"col-10"},[t("q-input",{ref:"group-icon",attrs:{color:"k-controls",autogrow:"",label:e.$t("labels.groupIcon"),error:e.iconError,"error-message":e.$t("messages.iconNotValid")},on:{input:function(t){e.iconError=!1}},scopedSlots:e._u([{key:"append",fn:function(){return[e.group.iconUrl?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-close-circle",color:"k-main"},on:{click:function(t){t.stopPropagation(),e.group.iconUrl=null}}}):e._e()]},proxy:!0}],null,!1,734042839),model:{value:e.group.iconUrl,callback:function(t){e.$set(e.group,"iconUrl",t)},expression:"group.iconUrl"}})],1),t("q-item-section",{staticClass:"col-2"},[t("q-avatar",{attrs:{square:""}},[t("img",{attrs:{alt:e.group.label,src:e.iconSrc},on:{error:function(t){e.iconError=!0}}})])],1)],1),t("q-item",[t("q-item-section",[t("q-input",{ref:"group-description",attrs:{color:"k-controls",autogrow:"",label:e.$t("labels.groupDescription")},scopedSlots:e._u([{key:"append",fn:function(){return[e.group.description?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-close-circle",color:"k-main"},on:{click:function(t){t.stopPropagation(),e.group.description=null}}}):e._e()]},proxy:!0}],null,!1,4087788951),model:{value:e.group.description,callback:function(t){e.$set(e.group,"description",t)},expression:"group.description"}})],1)],1),t("q-item",[t("q-item-section",[t("q-select",{ref:"group-dependson",attrs:{color:"k-controls",label:e.$t("labels.groupDependsOn"),options:e.groupNames,multiple:""},on:{filter:e.filterGroups},scopedSlots:e._u([{key:"append",fn:function(){return[e.group.dependsOn?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-close-circle",color:"k-main"},on:{click:function(t){t.stopPropagation(),e.group.dependsOn=null}}}):e._e()]},proxy:!0}],null,!1,2249231703),model:{value:e.group.dependsOn,callback:function(t){e.$set(e.group,"dependsOn",t)},expression:"group.dependsOn"}})],1)],1),t("q-item",{staticStyle:{"padding-top":"1.5rem","padding-bottom":"1.5rem"}},[t("q-item-section",[t("q-item-label",[e._v(e._s(e.$t("labels.groupDefaultExpirationTime")))])],1),t("q-item-section",{attrs:{side:""}},[t("q-select",{ref:"group-desfaultExpirationTimeYear",attrs:{dense:"",standout:"bg-teal text-white",color:"k-controls",options:e.availableYears},model:{value:e.group.defaultExpirationTimePeriod.year,callback:function(t){e.$set(e.group.defaultExpirationTimePeriod,"year",t)},expression:"group.defaultExpirationTimePeriod.year"}})],1),t("q-item-section",{attrs:{side:""}},[t("q-item-label",[e._v(e._s(e.$t("labels.year")))])],1),t("q-item-section",{attrs:{side:""}},[t("q-select",{ref:"group-desfaultExpirationTimeMonth",attrs:{dense:"",standout:"bg-teal text-white",color:"k-controls",options:e.availableMonths},model:{value:e.group.defaultExpirationTimePeriod.month,callback:function(t){e.$set(e.group.defaultExpirationTimePeriod,"month",t)},expression:"group.defaultExpirationTimePeriod.month"}})],1),t("q-item-section",{attrs:{side:""}},[t("q-item-label",[e._v(e._s(e.$t("labels.month")))])],1),t("q-item-section",{attrs:{side:""}},[t("q-select",{ref:"group-desfaultExpirationTimeDay",attrs:{dense:"",standout:"bg-teal text-white",color:"k-controls",options:e.availableDays},model:{value:e.group.defaultExpirationTimePeriod.day,callback:function(t){e.$set(e.group.defaultExpirationTimePeriod,"day",t)},expression:"group.defaultExpirationTimePeriod.day"}})],1),t("q-item-section",{attrs:{side:""}},[t("q-item-label",[e._v(e._s(e.$t("labels.day")))])],1)],1),t("q-item",[t("q-item-section",[t("q-checkbox",{ref:"group-worldview",staticClass:"q-pa-sm",attrs:{color:"k-controls",label:e.$t("labels.chkWorldView")},model:{value:e.group.worldview,callback:function(t){e.$set(e.group,"worldview",t)},expression:"group.worldview"}})],1),t("q-item-section",[t("q-checkbox",{ref:"group-chkComplimentary",staticClass:"q-pa-sm",attrs:{color:"k-controls",label:e.$t("labels.chkComplimentary")},model:{value:e.group.complimentary,callback:function(t){e.$set(e.group,"complimentary",t)},expression:"group.complimentary"}})],1),t("q-item-section",[t("q-checkbox",{ref:"group-optin",staticClass:"q-pa-sm",attrs:{color:"k-controls","toggle-order":"ft",dense:"",label:e.$t("labels.chkOptIn")},model:{value:e.group.optIn,callback:function(t){e.$set(e.group,"optIn",t)},expression:"group.optIn"}})],1)],1),t("q-item",[t("q-item-section",[t("q-item-label",[e._v(e._s(e.$t("labels.groupProjectUrls")))])],1),t("q-item-section",{staticClass:"col-1",attrs:{side:""}},[t("q-btn",{staticClass:"gfc-buttons",attrs:{icon:"mdi-plus",round:"",color:"k-controls",size:"xs"},on:{click:e.newProjectUrl}})],1),t("q-item-section",{attrs:{side:""}},[t("q-btn",{staticClass:"gfc-buttons",attrs:{disable:-1===e.selectedProjectUrlIdx,icon:"mdi-trash-can",round:"",color:"k-red",size:"xs"},on:{click:e.deleteProjectUrl}})],1)],1),t("q-item",{staticClass:"gfc-list no-padding"},[t("q-list",{staticClass:"full-width",attrs:{dense:""}},e._l(e.group.projectUrls,(function(s,a){return t("q-item",{key:a,staticClass:"gfc-prjurl-item",attrs:{clickable:"",active:e.selectedProjectUrlIdx===a,"active-class":"gfc-active"},on:{click:function(t){e.selectedProjectUrlIdx===a?e.selectedProjectUrlIdx=-1:e.selectedProjectUrlIdx=a}}},[t("q-item-section",[t("q-item-label",{staticClass:"gfc-prjurl-label"},[e._v(e._s(s))])],1)],1)})),1)],1),t("q-item",[t("q-item-section",[t("q-input",{ref:"project-url",attrs:{color:"k-controls",label:e.$t("labels.groupProjectUrl"),dense:""},model:{value:e.projectUrl,callback:function(t){e.projectUrl=t},expression:"projectUrl"}})],1),t("q-item-section",{attrs:{side:""}},[t("q-btn",{staticClass:"gfc-buttons",attrs:{disable:null===e.projectUrl,icon:"mdi-check",round:"",color:"k-controls",size:"xs"},on:{click:e.applyProjectUrl}})],1)],1)],1),t("q-list",[t("q-item",[t("q-item-section",[t("q-item-label",[e._v(e._s(e.$t("labels.associatedObservables")))])],1),t("q-item-section",{staticClass:"col-1",attrs:{side:""}},[t("q-btn",{staticClass:"gfc-buttons",attrs:{icon:"mdi-plus",round:"",color:"k-controls",size:"xs"},on:{click:function(t){return e.openObservableDialog()}}})],1),t("q-item-section",{staticClass:"col-1",attrs:{side:""}},[t("q-btn",{staticClass:"gfc-buttons",attrs:{disable:!e.selectedObservable.obs,icon:"mdi-pencil",round:"",color:"k-main",size:"xs"},on:{click:function(t){return e.openObservableDialog(e.selectedObservable.index)}}})],1),t("q-item-section",{attrs:{side:""}},[t("q-btn",{staticClass:"gfc-buttons",attrs:{disable:!e.selectedObservable.obs,icon:"mdi-trash-can",round:"",color:"k-red",size:"xs"},on:{click:e.deleteObservable}})],1)],1),t("q-item",{staticClass:"gfc-list no-padding"},[t("q-list",{staticClass:"full-width",attrs:{dense:""}},e._l(e.filteredObservables,(function(s,a){return t("q-item",{key:a,staticClass:"gfc-observable",class:{"gfc-is-separator":s.separator},attrs:{clickable:"","data-observable":s.id,"active-class":"gfc-active",active:e.selectedObservable&&e.selectedObservable.index===a,id:`gfc-obs-${a}`},on:{click:function(t){return e.selectObservable(s,a)}}},[t("q-item-section",[t("q-item-label",[e._v(e._s(s.label))])],1)],1)})),1)],1),t("q-item",{staticClass:"no-margin"},[t("q-item-section",[t("q-input",{directives:[{name:"show",rawName:"v-show",value:0!==e.filteredObservables.length,expression:"filteredObservables.length !== 0"}],attrs:{color:"k-controls",dense:"","hide-bottom-space":""},scopedSlots:e._u([{key:"append",fn:function(){return[t("q-icon",{attrs:{name:"mdi-magnify",color:"k-main"}}),e.filter&&""!==e.filter?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-close-circle",color:"k-main"},on:{click:function(t){t.stopPropagation(),e.filter=null}}}):e._e()]},proxy:!0}],null,!1,1431778307),model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}})],1),t("q-item-section",{staticClass:"col-1",attrs:{side:""}},[t("q-btn",{staticClass:"gfc-buttons",attrs:{disable:!e.selectedObservable.obs,icon:"mdi-arrow-collapse-up",round:"",color:"k-main",size:"xs"},on:{click:function(t){return e.moveObservable("FIRST")}}})],1),t("q-item-section",{staticClass:"col-1",attrs:{side:""}},[t("q-btn",{staticClass:"gfc-buttons",attrs:{disable:!e.selectedObservable.obs,icon:"mdi-arrow-up",round:"",color:"k-main",size:"xs"},on:{click:function(t){return e.moveObservable("PREV")}}})],1),t("q-item-section",{staticClass:"col-1",attrs:{side:""}},[t("q-btn",{staticClass:"gfc-buttons",attrs:{disable:!e.selectedObservable.obs,icon:"mdi-arrow-down",round:"",color:"k-main",size:"xs"},on:{click:function(t){return e.moveObservable("NEXT")}}})],1),t("q-item-section",{attrs:{side:""}},[t("q-btn",{staticClass:"gfc-buttons",attrs:{disable:!e.selectedObservable.obs,icon:"mdi-arrow-collapse-down",round:"",color:"k-main",size:"xs"},on:{click:function(t){return e.moveObservable("LAST")}}})],1)],1),t("KhubCustomPropertiesEditableTable",{attrs:{customProperties:this.group.customProperties,type:"GROUP",admin:"true"}}),t("q-item",{staticClass:"q-pa-md"},[t("q-item-section",[t("q-btn",{attrs:{color:"k-controls",label:e.$t("labels.submitForm")},on:{click:e.submitGroup}})],1),t("q-item-section",[t("q-btn",{attrs:{color:"k-red",label:e.$t("labels.cancelForm")},on:{click:e.closeDialog}})],1)],1)],1)],1),e.selectedObservable.obs?t("q-dialog",{attrs:{"no-backdrop-dismiss":""},model:{value:e.observableDialog,callback:function(t){e.observableDialog=t},expression:"observableDialog"}},[t("q-card",{staticClass:"gfc-observable-card ka-dialog"},[t("q-card-section",{staticClass:"ka-dialog-title"},[e._v(e._s(e.selectedObservable.obs.label?e.selectedObservable.obs.label:e.$t("labels.observableAdd")))]),t("q-separator"),t("q-card-section",{staticClass:"q-pa-xs"},[t("q-list",[t("q-item",[t("q-item-section",[t("q-input",{ref:"obs-label",attrs:{color:"k-controls",dense:"",disable:-1!==e.selectedObservable.index,rules:[t=>e.fieldRequired(t)],label:e.$t("labels.observableLabel")},scopedSlots:e._u([{key:"append",fn:function(){return[e.selectedObservable.obs.label&&-1===e.selectedObservable.index?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-close-circle",color:"k-main"},on:{click:function(t){t.stopPropagation(),e.selectedObservable.obs.label=null}}}):e._e()]},proxy:!0}],null,!1,955453402),model:{value:e.selectedObservable.obs.label,callback:function(t){e.$set(e.selectedObservable.obs,"label",t)},expression:"selectedObservable.obs.label"}})],1)],1),t("q-item",[t("q-item-section",[t("q-checkbox",{ref:"obs-isseparator",attrs:{color:"k-controls",dense:"",label:e.$t("labels.observableIsSeparator")},model:{value:e.selectedObservable.obs.separator,callback:function(t){e.$set(e.selectedObservable.obs,"separator",t)},expression:"selectedObservable.obs.separator"}})],1)],1),t("q-item",[t("q-item-section",[t("q-input",{ref:"obs-observable",attrs:{color:"k-controls",dense:"",disable:e.selectedObservable.obs.separator,rules:[t=>e.selectedObservable.obs.separator||e.fieldRequired(t)],label:e.$t("labels.observableObservable")},model:{value:e.selectedObservable.obs.observable,callback:function(t){e.$set(e.selectedObservable.obs,"observable",t)},expression:"selectedObservable.obs.observable"}})],1)],1),t("q-item",[t("q-item-section",[t("q-select",{ref:"obs-semantic",attrs:{color:"k-controls",dense:"",disable:e.selectedObservable.obs.separator,rules:[t=>e.selectedObservable.obs.separator||e.fieldRequired(t)],label:e.$t("labels.observableSemantic"),options:e.semantics},scopedSlots:e._u([{key:"append",fn:function(){return[e.selectedObservable.obs.semantic?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-close-circle",color:"k-main"},on:{click:function(t){t.stopPropagation(),e.selectedObservable.obs.semantic=null}}}):e._e()]},proxy:!0}],null,!1,1821730903),model:{value:e.selectedObservable.obs.semantics,callback:function(t){e.$set(e.selectedObservable.obs,"semantics",t)},expression:"selectedObservable.obs.semantics"}})],1)],1),t("q-item",[t("q-item-section",[t("q-input",{ref:"obs-description",attrs:{color:"k-controls",dense:"",autogrow:"",label:e.$t("labels.observableDescription")},scopedSlots:e._u([{key:"append",fn:function(){return[e.selectedObservable.obs.description?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-close-circle",color:"k-main"},on:{click:function(t){t.stopPropagation(),e.selectedObservable.obs.description=null}}}):e._e()]},proxy:!0}],null,!1,2866138295),model:{value:e.selectedObservable.obs.description,callback:function(t){e.$set(e.selectedObservable.obs,"description",t)},expression:"selectedObservable.obs.description"}})],1)],1),t("q-item",[t("q-item-section",[t("q-select",{ref:"obs-state",attrs:{color:"k-controls",dense:"",disable:e.selectedObservable.obs.separator,rules:[t=>e.selectedObservable.obs.separator||e.fieldRequired(t)],label:e.$t("labels.observableState"),options:e.observableStates},model:{value:e.selectedObservable.obs.state,callback:function(t){e.$set(e.selectedObservable.obs,"state",t)},expression:"selectedObservable.obs.state"}})],1)],1),-1===e.selectedObservable.index?t("q-item",[t("q-item-section",[t("q-select",{ref:"obs-insertionPoint",attrs:{color:"k-controls",dense:"",label:e.$t("labels.observableInsertionPoint"),rules:[t=>e.fieldRequired(t)],options:e.insertionPoint},model:{value:e.selectedObservable.insertionPoint,callback:function(t){e.$set(e.selectedObservable,"insertionPoint",t)},expression:"selectedObservable.insertionPoint"}})],1)],1):e._e(),t("q-item",[t("q-item-section",[t("q-input",{ref:"obs-extdescription",attrs:{color:"k-controls",dense:"",disable:e.selectedObservable.obs.separator,autogrow:"",label:e.$t("labels.observableExtendedDescription")},scopedSlots:e._u([{key:"append",fn:function(){return[e.selectedObservable.obs.extendedDescription?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-close-circle",color:"k-main"},on:{click:function(t){t.stopPropagation(),e.selectedObservable.obs.extendedDescription=null}}}):e._e()]},proxy:!0}],null,!1,197310871),model:{value:e.selectedObservable.obs.extendedDescription,callback:function(t){e.$set(e.selectedObservable.obs,"extendedDescription",t)},expression:"selectedObservable.obs.extendedDescription"}})],1)],1)],1)],1),t("q-card-actions",{attrs:{align:"right"}},[t("q-btn",{attrs:{label:e.$t("labels.submitForm"),color:"k-controls"},on:{click:e.insertNewObservable}}),t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{label:e.$t("labels.cancelForm"),color:"k-red"},on:{click:e.resetNewObservable}})],1)],1)],1):e._e()],1)]):e._e()},va=[],ka={props:{newGroup:{type:Boolean,default:!1}},mixins:[pt],data(){return{availableYears:[...Array(100)].map(((e,t)=>t)),availableMonths:[...Array(13)].map(((e,t)=>t)),availableDays:[...Array(32)].map(((e,t)=>t)),availableRoles:Object.keys(re["l"]).map((e=>re["l"][e].value)),semantics:Object.keys(re["m"]).map((e=>e)),selectedObservable:{},selectedProjectUrlIdx:-1,projectUrl:null,observableDialog:!1,customPropertyDialog:!1,editedItem:{},filter:null,changed:!1,iconError:!1,observableStates:Object.keys(re["h"]).map((e=>e)),waiting:!1,columns:[{name:"key",required:!0,label:this.$t("labels.key"),align:"left",field:e=>e.key,format:e=>`${e}`,sortable:!0},{name:"value",required:!0,align:"left",label:this.$t("labels.value"),field:e=>e.value,sortable:!0}]}},name:"GroupEditCard",computed:{...Object(W["c"])("admin",["group","groups"]),open:{set(e){e||this.resetGroup()},get(){return null!==this.group}},iconSrc(){return!this.iconError&&this.group.iconUrl?this.group.iconUrl:re["d"].IMAGE_NOT_FOUND_SRC},availableGroups(){return this.groups.map((e=>e.name))},filteredObservables(){return this.group.observables?this.filter&&""!==this.filter?this.group.observables.filter((e=>-1!==e.label.toLowerCase().indexOf(this.filter))):this.group.observables:[]},insertionPoint(){const e=[this.FIRST_OBS,this.LAST_OBS,...this.group.observables.map(((e,t)=>({value:t+1,label:`After '${e.label}'`})))];return e},groupNames(){return this.groups.map((e=>e.name))}},methods:{...Object(W["b"])("admin",["resetGroup","updateGroup","deleteGroup","createGroup"]),submitGroup(){this.$refs["group-name"].validate(),this.group.defaultExpirationTime=ba(this.group.defaultExpirationTimePeriod),this.newGroup?this.createGroup(this.group).then((()=>{this.$q.notify({message:this.$t("messages.groupCreated",{group:this.group.name}),color:"positive",timeout:1e3}),this.resetGroup()})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.groupCreatedError"),color:"negative",timeout:1500}),this.resetGroup()})):this.updateGroup(this.group).then((()=>{this.$q.notify({message:this.$t("messages.groupUpdated",{group:this.group.name}),color:"positive",timeout:1e3}),this.resetGroup()})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.groupUpdatedError"),color:"negative",timeout:1500}),this.resetGroup()})),this.projectUrl="",this.selectedProjectUrlIdx=-1},closeDialog(){this.projectUrl="",this.selectedProjectUrlIdx=-1,this.open=!1},newProjectUrl(){this.projectUrl="",this.selectedProjectUrlIdx=-1,this.$refs["project-url"].focus()},applyProjectUrl(){this.projectUrl&&""!==this.projectUrl&&(-1===this.selectedProjectUrlIdx?(this.group.projectUrls.push(this.projectUrl),this.selectedProjectUrlIdx=this.group.projectUrls.length-1):this.group.projectUrls.splice(this.selectedProjectUrlIdx,1,this.projectUrl),this.projectUrl="",this.selectedProjectUrlIdx=-1)},deleteProjectUrl(){this.$q.dialog({title:this.$t("messages.confirmRemoveTitle"),message:this.$t("messages.confirmRemoveProjectUrlMsg"),ok:{color:"k-controls"},cancel:{color:"k-red"},persistent:!0}).onOk((()=>{-1!==this.selectedProjectUrlIdx&&(this.group.projectUrls.splice(this.selectedProjectUrlIdx,1),this.selectedProjectUrlIdx=-1)}))},openObservableDialog(e=-1){-1===e&&this.initNewObservable(),this.$nextTick((()=>{this.observableDialog=!0}))},selectObservable(e,t){if(this.selectedObservable.index===t)this.resetNewObservable();else{const s=0===t?this.insertionPoint[0]:t===this.group.observables.length-1?this.insertionPoint[1]:this.insertionPoint[t+2];this.selectedObservable={obs:e,index:t,insertionPoint:s}}},filterGroups(e,t){t(null!==e&&""!==e?()=>{const t=e.toLowerCase();this.groupNames=this.availableGroups.filter((e=>e.toLowerCase().indexOf(t)>-1))}:()=>{this.groupNames=this.availableGroups})},moveObservable(e){if(this.selectedObservable.obs){const t="NEXT"===e?this.selectedObservable.index+1:"PREV"===e?this.selectedObservable.index-1:"FIRST"===e?0:this.group.observables.length-1,s=or(this.group.observables,this.selectedObservable.index,t);this.selectedObservable.index=s,this.$nextTick((()=>{const e=document.getElementById(`gfc-obs-${s}`);e&&e.scrollIntoView({behavior:"smooth",block:"center"})}))}},insertNewObservable(){this.$refs["obs-label"].validate(),this.$refs["obs-observable"].validate(),this.$refs["obs-semantic"].validate(),this.$refs["obs-state"].validate(),this.$refs["obs-insertionPoint"]&&this.$refs["obs-insertionPoint"].validate(),this.$refs["obs-label"].hasError||this.$refs["obs-observable"].hasError||this.$refs["obs-semantic"].hasError||this.$refs["obs-state"].hasError||this.$refs["obs-insertionPoint"]&&this.$refs["obs-insertionPoint"].hasError||(this.group.observables?-1!==this.selectedObservable.index?this.group.observables.splice(this.selectedObservable.index,1,this.selectedObservable.obs):this.selectedObservable.insertionPoint.value===this.FIRST_OBS.value?this.group.observables.unshift(this.selectedObservable.obs):this.selectedObservable.insertionPoint.value===this.LAST_OBS.value?this.group.observables.push(this.selectedObservable.obs):this.group.observables.splice(this.selectedObservable.insertionPoint.value,0,this.selectedObservable.obs):(this.group.observables=[],this.group.observables.push(this.selectedObservable.obs)),this.observableDialog=!1)},initNewObservable(){this.selectedObservable={obs:{separator:!1},index:-1,insertionPoint:this.FIRST_OBS}},resetNewObservable(){this.selectedObservable={},this.observableDialog=!1},deleteObservable(){this.$q.dialog({title:this.$t("messages.confirmRemoveTitle"),message:this.$t("messages.confirmRemoveObservableMsg"),ok:{color:"k-controls"},cancel:{color:"k-red"},persistent:!0}).onOk((()=>{this.group.observables.splice(this.selectedObservable.index,1),this.resetNewObservable()}))},showCustomPropertyDialog(){this.customPropertyDialog=!0}},watch:{selectedProjectUrlIdx(e){this.projectUrl=-1===e?null:this.group.projectUrls[this.selectedProjectUrlIdx]}},mounted(){this.FIRST_OBS={value:"F",label:this.$t("labels.observableInsertFirst")},this.LAST_OBS={value:"L",label:this.$t("labels.observableInsertLast")}},components:{KhubCustomPropertiesEditableTable:xt}},_a=ka,Ta=(s("099e"),Object(X["a"])(_a,Ea,va,!1,null,null,null)),wa=Ta.exports;Se()(Ta,"components",{QDialog:x["a"],QCard:q["a"],QList:h["a"],QItem:g["a"],QItemSection:b["a"],QInput:E["a"],QIcon:m["a"],QAvatar:A["a"],QSelect:k["a"],QItemLabel:f["a"],QCheckbox:T["a"],QBtn:p["a"],QCardSection:M["a"],QSeparator:O["a"],QCardActions:Q["a"],QTable:I["a"]}),Se()(Ta,"directives",{ClosePopup:F["a"]});var ya={name:"GroupsComponent",components:{GroupFormCard:wa,KlabLoading:qe},data(){return{refreshing:!1,waiting:!1,newGroup:!1,columns:[{name:"icon",field:"iconUrl",required:!0,label:this.$t("labels.groupIcon"),align:"center",sortable:!0},{name:"name",field:"name",required:!0,label:this.$t("labels.groupName"),align:"center",sortable:!0},{name:"description",field:"description",required:!0,label:this.$t("labels.groupDescription"),align:"left",sortable:!0},{name:"dependsOn",field:"dependsOn",required:!1,label:this.$t("labels.groupDependsOn"),align:"left",sortable:!0},{name:"worldview",field:e=>e.worldview,format:e=>e?"🗹":"☐",required:!1,label:this.$t("labels.groupWorldView"),classes:"ka-dense"},{name:"complimentary",field:e=>e.complimentary,format:e=>e?"🗹":"☐",required:!1,label:this.$t("labels.groupComplimentary"),align:"left",classes:"ka-dense"},{name:"optIn",field:e=>e.optIn,format:e=>e?"🗹":"☐",required:!1,label:this.$t("labels.groupOptionOptIn"),style:"color: white"},{name:"defaultExpirationTime",field:e=>e.defaultExpirationTime,format:e=>fa(ga(e)),required:!1,label:this.$t("labels.groupDefaultExpirationTime"),align:"left"},{name:"projectUrls",field:"projectUrls",required:!1,label:this.$t("labels.groupProjectUrls"),align:"left",sortable:!0},{name:"observables",field:"observables",required:!1,label:this.$t("labels.groupObservables"),align:"left",sortable:!0},{name:"sshKey",field:"sshKey",required:!1,label:this.$t("labels.groupSshKey"),align:"left",sortable:!0},{name:"customProperties",component:"table",field:"customProperties",required:!1,label:this.$t("labels.groupCustomProperties"),align:"left",columns:[{name:"key",required:!0,label:this.$t("labels.key"),align:"left",field:e=>e.key,format:e=>`${e}`,style:"max-width: 5rem;",headerStyle:"max-width: 4rem",sortable:!0,classes:"ellipsis"},{name:"value",required:!0,align:"left",label:this.$t("labels.value"),field:e=>e.value,style:"max-width: 4rem",classes:"ellipsis",sortable:!0},{name:"onlyAdmin",required:!0,align:"center",label:this.$t("labels.visible"),field:e=>e.onlyAdmin,format:e=>e?"🗹":"☐",style:"max-width: 2rem;width: 2rem;",sortable:!0}]}],APP_CONSTANTS:re["d"],usersCountCounter:0}},computed:{...Object(W["c"])("admin",["groups","group"])},methods:{...Object(W["b"])("admin",["loadGroups","loadGroup","deleteGroup"]),refreshGroups(){this.refreshing=!0,this.loadGroups().then((()=>{this.refreshing=!1,this.$q.notify({message:this.$t("messages.groupsLoaded"),color:"positive",timeout:1e3}),this.usersCountCounter=this.groups.length,this.groups.forEach((e=>{sr({type:re["u"].USERS_WITH_GROUP.method,url:re["u"].USERS_WITH_GROUP.url.replace("{group}",e.name),needAuth:!0},((t,s)=>{t&&t.data&&(e.usersCount=t.data.length,this.usersCountCounter-=1),s()}))}))})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.groupsLoadedError"),color:"negative",timeout:1500}),this.refreshing=!1}))},removeGroup(e){this.$q.dialog({title:this.$t("messages.confirm"),message:this.$t("messages.confirmRemoveGroupMsg",{group:`${e}`}),html:!0,ok:{color:"k-controls"},cancel:{color:"k-red"},persistent:!0}).onOk((()=>{this.waiting=!0,this.deleteGroup(e).then((()=>{this.waiting=!1,this.$q.notify({message:this.$t("messages.groupDeleted",{group:e}),color:"positive",timeout:1e3}),this.loadGroups()})).catch((t=>{console.error(t),this.waiting=!1,this.$q.notify({message:this.$t("messages.groupDeletedError",{group:e}),color:"negative",timeout:1500})}))}))},openDialog(e=null){this.waiting=!0,this.loadGroup(e).then((()=>{this.waiting=!1,this.newGroup=null===e})).catch((e=>{console.error(e),this.waiting=!1,this.newGroup=!1}))}},mounted(){this.refreshGroups()}},Ca=ya,Sa=(s("8f27"),Object(X["a"])(Ca,da,pa,!1,null,null,null)),Aa=Sa.exports;Se()(Sa,"components",{QIcon:m["a"],QTooltip:R["a"],QBtn:p["a"],QTable:I["a"],QCard:q["a"],QItem:g["a"],QItemSection:b["a"],QItemLabel:f["a"],QSeparator:O["a"],QList:h["a"]});var qa=function(){var e=this,t=e._self._c;return t("div",{staticClass:"ka-content"},[t("h2",{staticClass:"kh-h-first"},[e._v(e._s(e.$t("contents.adminTasksTitle"))+"\n "),t("q-icon",{staticClass:"cursor-pointer text-k-main ka-refresh",class:{"ka-refreshing":e.refreshing},attrs:{name:"mdi-refresh"},on:{click:e.refreshTasks}},[t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0]}},[e._v(e._s(e.$t("labels.refreshTasks")))])],1)],1),e.tasks.length>0?t("div",[t("div",{staticClass:"row full-width ka-filters",class:[e.filtered?"ka-filtered":""]},[t("div",{staticClass:"row full-width"},[t("div",{staticClass:"col-6"},[t("div",{staticClass:"row full-width"},[t("q-input",{staticClass:"q-pa-sm col",attrs:{color:"k-controls",dense:"",clearable:"",label:e.$t("labels.taskUser"),tabindex:"1"},model:{value:e.filter.user,callback:function(t){e.$set(e.filter,"user",t)},expression:"filter.user"}})],1)]),t("div",{staticClass:"col-6"},[t("div",{staticClass:"row full-width"},[t("k-input-date",{ref:"issuedFrom",attrs:{classes:"q-pa-sm col-6",color:"k-controls",dense:"",label:e.$t("labels.taskIssuedFrom"),tabindex:"10"},on:{input:function(t){return e.checkDates("issued","From")}},model:{value:e.filter.issuedFrom,callback:function(t){e.$set(e.filter,"issuedFrom",t)},expression:"filter.issuedFrom"}}),t("k-input-date",{attrs:{classes:"q-pa-sm col-6",color:"k-controls",dense:"",label:e.$t("labels.taskClosedFrom"),disable:e.filter.open,tabindex:"12"},on:{input:function(t){return e.checkDates("closed","From")}},model:{value:e.filter.closedFrom,callback:function(t){e.$set(e.filter,"closedFrom",t)},expression:"filter.closedFrom"}})],1)])]),t("div",{staticClass:"row full-width"},[t("div",{staticClass:"col-6"},[t("div",{staticClass:"row full-width"},[t("q-select",{staticClass:"q-pa-sm col-6",attrs:{color:"k-controls","options-selected-class":"text-k-controls",options:e.taskStatusOptions,label:e.$t("labels.taskStatus"),dense:"","options-dense":"",clearable:"",multiple:"",tabindex:"1"},model:{value:e.filter.status,callback:function(t){e.$set(e.filter,"status",t)},expression:"filter.status"}}),t("q-select",{staticClass:"q-pa-sm col-6",attrs:{color:"k-controls","options-selected-class":"text-k-controls",options:e.types,label:e.$t("labels.taskType"),dense:"","options-dense":"",multiple:"",clearable:"",tabindex:"3"},model:{value:e.filter.type,callback:function(t){e.$set(e.filter,"type",t)},expression:"filter.type"}})],1)]),t("div",{staticClass:"col-6"},[t("div",{staticClass:"row full-width"},[t("k-input-date",{ref:"issuedTo",attrs:{classes:"q-pa-sm col-6",color:"k-controls",dense:"",label:e.$t("labels.taskIssuedTo"),tabindex:"11"},on:{input:function(t){return e.checkDates("issued","To")}},model:{value:e.filter.issuedTo,callback:function(t){e.$set(e.filter,"issuedTo",t)},expression:"filter.issuedTo"}}),t("k-input-date",{ref:"closedTo",attrs:{classes:"q-pa-sm col-6",color:"k-controls",dense:"",label:e.$t("labels.taskClosedTo"),disable:e.filter.open,tabindex:"13"},on:{input:function(t){return e.checkDates("closed","To")}},model:{value:e.filter.closedTo,callback:function(t){e.$set(e.filter,"closedTo",t)},expression:"filter.closedTo"}})],1),t("div",{staticClass:"row full-width"},[t("div",{staticClass:"q-pa-sm col-6"}),t("q-checkbox",{staticClass:"q-pa-sm col-6",staticStyle:{height:"56px"},attrs:{color:"k-main",dense:"",label:e.$t("labels.taskOpen"),"left-label":"",tabindex:"14"},model:{value:e.filter.open,callback:function(t){e.$set(e.filter,"open",t)},expression:"filter.open"}})],1)])]),t("div",{staticClass:"row full-width ka-filter-info q-pa-sm"},[t("div",{staticClass:"col-6 self-end"},[e._v(e._s(e.$t("labels.filterInfo",{filtered:e.filtered?e.$t("labels.filtered"):e.$t("labels.all"),element:e.$t("menu.tasks"),number:e.rowsNumber})))]),t("div",{staticClass:"col text-right"},[t("q-btn",{staticClass:"ka-action-button",attrs:{label:e.$t("labels.clearSearch"),disabled:!e.filtered,color:"k-main"},on:{click:e.initializeFilter}})],1)])]),t("div",{staticClass:"row full-width ka-actions q-ma-md"},[t("div",{staticClass:"row full-width q-pa-xs ka-selected-info"},[e.pendingTasks.length>0?t("div",{staticClass:"inline-block",domProps:{innerHTML:e._s(e.$t("labels.selectedInfo",{selected:e.selected.length,total:e.pendingTasks.length,type:e.$t("labels.tasks")}))}}):t("div",{staticClass:"inline-block"},[e._v(e._s(e.$t("messages.noPendingTasks")))]),e.selected.length>0?t("div",{staticClass:"inline-block q-pa-xs"},[t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-checkbox-multiple-blank-outline",size:"1.8em"},on:{click:function(t){return e.selected.splice(0,e.selected.length)}}},[t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0]}},[e._v(e._s(e.$t("labels.unselectAll")))])],1)],1):e._e(),e.selected.length0||s.row.requestGroups.length>0?t("q-icon",{attrs:{name:"mdi-information",color:"k-controls",size:"xs"}},[t("q-popup-proxy",{attrs:{"transition-show":"flip-up","transition-hide":"flip-down"}},[s.row.log.length>0?t("q-list",{staticClass:"ktc-log",attrs:{dense:"",color:"k-main"}},e._l(s.row.log,(function(a,o){return t("q-item",{key:o,staticClass:"ktc-log-item",class:{"ktc-error":s.row.status===e.status.TASK_ERROR.value,"ktc-accepted":s.row.status===e.status.TASK_ACCEPTED.value,"ktc-denied":s.row.status===e.status.TASK_DENIED.value}},[t("q-item-section",[e._v(e._s(a))])],1)})),1):t("q-list",{staticClass:"ktc-log",attrs:{dense:"",color:"k-main"}},e._l(s.row.requestGroups,(function(s,a){return t("q-item",{key:a,staticClass:"ktc-log-item"},[t("q-item-section",[e._v(e._s(s))])],1)})),1)],1)],1):e._e()],1),t("q-td",{key:"type",attrs:{props:s}},[e.types.find((e=>e.value===s.row.type))?t("span",[e._v(e._s(e.types.find((e=>e.value===s.row.type)).label))]):t("span",[e._v(e._s(e.$t("label.taskTypeUnknown",{type:s.row.type})))])])],1)]}}],null,!1,3137487919)})],1):t("div",[t("div",{staticClass:"tc-no-tasks"},[e._v(e._s(e.$t("messages.noTasks")))])]),t("q-dialog",{attrs:{persistent:""},on:{"before-show":function(t){e.deniedMessage=null}},model:{value:e.deniedMessageDialog,callback:function(t){e.deniedMessageDialog=t},expression:"deniedMessageDialog"}},[t("q-card",{staticStyle:{"min-width":"350px"}},[t("q-card-section",[t("div",{staticClass:"text-h6"},[e._v(e._s(e.$t("messages.taskDeniedMessage")))])]),t("q-card-section",[t("q-input",{attrs:{dense:"",color:"k-controls",autofocus:""},on:{keyup:function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;e.deniedMessageDialog=!1}},model:{value:e.deniedMessage,callback:function(t){e.deniedMessage=t},expression:"deniedMessage"}})],1),t("q-card-actions",{attrs:{align:"right"}},[t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{label:e.$t("labels.btnCancel")}}),t("q-btn",{attrs:{label:e.$t("labels.btnAccept")},on:{click:e.denyTask}})],1)],1)],1),t("klab-loading",{attrs:{loading:e.waiting||e.refreshing,message:e.$t("messages.doingThings")}})],1)},Oa=[];const Ra={user:null,type:null,status:null,issuedFrom:null,issuedTo:null,closedFrom:null,closedTo:null,open:!1};var $a={name:"TasksComponent",components:{KInputDate:Tt,KlabLoading:qe},data(){return{selected:[],pagination:{sortBy:"issued",descending:!0,rowsPerPage:25,oldRowsPerPage:25},taskStatusOptions:[{label:re["p"].TASK_PENDING.label,value:re["p"].TASK_PENDING.value},{label:re["p"].TASK_ACCEPTED.label,value:re["p"].TASK_ACCEPTED.value},{label:re["p"].TASK_DENIED.label,value:re["p"].TASK_DENIED.value},{label:re["p"].TASK_ERROR.label,value:re["p"].TASK_ERROR.value}],filter:{...Ra},columns:[{name:"user",field:"user",required:!0,sortable:!0,label:this.$t("labels.taskUser"),align:"center",headerStyle:"width: 16%"},{name:"issued",field:"issued",required:!0,label:this.$t("labels.taskIssued"),align:"center",sortable:!0,sort:(e,t)=>rr(e,t),headerStyle:"width: 12%"},{name:"closed",field:"closed",required:!0,label:this.$t("labels.taskClosed"),align:"center",sortable:!0,sort:(e,t)=>rr(e,t),headerStyle:"width: 12%"},{name:"roleRequirement",field:"roleRequirement",required:!0,label:this.$t("labels.taskRoleRequirement"),align:"center",headerStyle:"width: 8%;"},{name:"autoAccepted",field:"autoAccepted",required:!0,label:this.$t("labels.taskAutoAccepted"),align:"center",headerStyle:"width: 12%; text-align: center"},{name:"next",field:"next",required:!0,label:this.$t("labels.taskNext"),align:"center",headerStyle:"width: 10%; text-align: center"},{name:"status",field:"status",required:!0,label:this.$t("labels.taskStatusLog"),align:"center",headerStyle:"width: 12%"},{name:"type",field:"type",required:!0,label:this.$t("labels.taskType"),align:"center",headerStyle:"width: 14%"}],roles:re["l"],status:re["p"],types:re["q"],rowsNumber:0,refreshing:!1,waiting:!1,deniedMessageDialog:!1,deniedMessage:null,statusAllAny:"any",typeAllAny:"any"}},computed:{...Object(W["c"])("admin",["tasks"]),pendingTasks(){return this.tasks.filter((e=>e.status===re["p"].TASK_PENDING.value))},filtered(){return!Jo(this.filter,Ra)}},methods:{...Object(W["b"])("admin",["loadTasks","loadGroups"]),formatDate:ar,selectAll(){this.tasks.forEach((e=>{e.status===re["p"].TASK_PENDING.value&&-1===this.selected.findIndex((t=>e.id===t.id))&&this.selected.push(e)})),0===this.selected.length&&this.$q.notify({message:this.$t("messages.noPendingTasks"),color:"warning"})},acceptTask(){const e=this.selected;e.forEach((e=>{this.$store.dispatch("admin/acceptTask",e.id).then((()=>{this.$q.notify({message:this.$t("messages.taskAccepted"),color:"positive"}),this.refreshTasks()})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.taskAcceptedError"),color:"negative"})}))}))},denyTask(){this.deniedMessageDialog=!1;const e=this.selected;e.forEach((e=>{this.$store.dispatch("admin/denyTask",{id:e.id,deniedMessage:this.deniedMessage}).then((()=>{this.$q.notify({message:this.$t("messages.taskDenied"),color:"positive"}),this.refreshTasks()})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.taskDeniedError"),color:"negative"})}))}))},formatStatus(e){switch(e){case re["p"].TASK_PENDING.value:return re["p"].TASK_PENDING.label;case re["p"].TASK_ACCEPTED.value:return re["p"].TASK_ACCEPTED.label;case re["p"].TASK_DENIED.value:return re["p"].TASK_DENIED.label;case re["p"].TASK_ERROR.value:return re["p"].TASK_ERROR.label;default:return e}},initializeFilter(){this.filter={...Ra},this.$refs.issuedFrom.reset(),this.$refs.issuedTo.reset(),this.$refs.closeFrom.reset(),this.$refs.closeTo.reset(),this.statusAllAny=!1,this.typeAllAny=!1},filterMethod(){return this.filtered?this.tasks.filter((e=>(null===this.filter.user||""===this.filter.user||e.user&&e.user.toLowerCase().includes(this.filter.user.toLowerCase()))&&(null===this.filter.type||0===this.filter.type.length||-1!==this.filter.type.findIndex((t=>t.value===e.type)))&&(null===this.filter.status||0===this.filter.status.length||-1!==this.filter.status.findIndex((t=>t.value===e.status)))&&(!this.filter.open||!e.closed)&&(null===this.filter.issuedFrom||e.issued&&bt()(this.filter.issuedFrom,"L").isSameOrBefore(e.issued))&&(null===this.filter.issuedTo||e.issued&&bt()(this.filter.issuedTo,"L").isSameOrAfter(e.issued))&&(null===this.filter.closedFrom||e.closed&&bt()(this.filter.closedFrom,"L").isSameOrBefore(e.closed)))):this.tasks},checkDates(e,t){const s=`${e}From`,a=`${e}To`;null!==this.filter[s]&&null!==this.filter[a]&&bt()(this.filter[s],"L").isSameOrAfter(bt()(this.filter[a],"L"))&&(this.$refs[`${e}${t}`].reset(),this.$q.notify({message:this.$t("messages.errorDateFromTo",{type:e}),color:"negative"}))},getPaginationLabel(e,t,s){return this.rowsNumber=s,this.$t("labels.pagination",{firstRowIndex:e,endRowIndex:t,totalRowsNumber:s})},refreshTasks(){this.refreshing=!0,this.loadTasks().then((()=>{this.refreshing=!1,this.$q.notify({message:this.$t("messages.tasksLoaded"),color:"positive",timeout:1e3}),this.selected.splice(0,this.selected.length)})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.tasksLoadedError"),color:"negative",timeout:1500}),this.refreshing=!1,this.selected.splice(0,this.selected.length)}))},confirm(e,t,s,a){this.$q.dialog({title:e,message:t,ok:{color:"k-controls",push:!0,flat:!0},cancel:{color:"k-controls",push:!0,flat:!0},persistent:!0}).onOk((()=>{s()})).onCancel((()=>{a()}))}},watch:{filtered(e){e?(this.pagination.oldRowsPerPage=this.pagination.rowsPerPage,this.pagination.rowsPerPage=0):this.pagination.rowsPerPage=this.pagination.oldRowsPerPage}},created(){this.refreshTasks(),bt.a.locale(this.$q.lang.getLocale())}},Pa=$a,Na=(s("bd3a"),Object(X["a"])(Pa,qa,Oa,!1,null,null,null)),xa=Na.exports;Se()(Na,"components",{QIcon:m["a"],QTooltip:R["a"],QInput:E["a"],QSelect:k["a"],QCheckbox:T["a"],QBtn:p["a"],QTable:I["a"],QTr:D["a"],QTh:G["a"],QTd:L["a"],QPopupProxy:y["a"],QList:h["a"],QItem:g["a"],QItemSection:b["a"],QDialog:x["a"],QCard:q["a"],QCardSection:M["a"],QCardActions:Q["a"]}),Se()(Na,"directives",{ClosePopup:F["a"]});var Ua=function(){var e=this,t=e._self._c;return t("div",{staticClass:"ka-content"},[t("h2",{staticClass:"kh-h-first"},[e._v(e._s(e.$t("contents.adminAgreementTemplatesTitle"))+"\n "),t("q-icon",{staticClass:"cursor-pointer text-k-controls ka-refresh",class:{"ka-refreshing":e.waiting},attrs:{name:"mdi-refresh"},on:{click:e.refreshAgreementTemplates}},[t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0]}},[e._v(e._s(e.$t("labels.refreshAgreementTemplates")))])],1)],1),t("div",{},[t("div",{staticClass:"row full-width ka-filters",class:[e.filtered?"ka-filtered":""]},[t("div",{staticClass:"row full-width"},[t("q-select",{staticClass:"q-pa-sm col-3",attrs:{color:"k-controls","options-selected-class":"text-k-controls",options:e.agreementLevelOptions,label:e.$t("labels.agreementLevel"),dense:"","options-dense":"",clearable:"",multiple:"",tabindex:"3"},model:{value:e.filter.agreementLevel,callback:function(t){e.$set(e.filter,"agreementLevel",t)},expression:"filter.agreementLevel"}}),t("q-select",{staticClass:"q-pa-sm col-3",attrs:{color:"k-controls","options-selected-class":"text-k-controls",options:e.agreementTypeOptions,label:e.$t("labels.agreementType"),dense:"","options-dense":"",clearable:"",multiple:"",tabindex:"3"},model:{value:e.filter.agreementType,callback:function(t){e.$set(e.filter,"agreementType",t)},expression:"filter.agreementType"}}),t("div",{staticClass:"q-pa-sm col-3"},[t("k-input-date",{ref:"registrationTo",attrs:{color:"k-controls",label:e.$t("labels.validDate"),dense:"",disable:e.filter.validDate,tabindex:"31"},on:{input:function(t){return e.checkDates("registration","To")}},model:{value:e.filter.validDate,callback:function(t){e.$set(e.filter,"validDate",t)},expression:"filter.validDate"}})],1),t("div",{staticClass:"q-pa-sm col-3"},[t("q-toggle",{attrs:{"toggle-indeterminate":"",label:e.$t("labels.toogleDefaultTemplate"),color:"k-controls"},model:{value:e.filter.defaultTemplate,callback:function(t){e.$set(e.filter,"defaultTemplate",t)},expression:"filter.defaultTemplate"}})],1),t("div",{staticClass:"row full-width"},[t("q-input",{staticClass:"q-pa-sm col-3",attrs:{color:"k-controls",dense:"",clearable:"",label:e.$t("labels.text")},model:{value:e.filter.text,callback:function(t){e.$set(e.filter,"text",t)},expression:"filter.text"}}),t("q-select",{staticClass:"q-pa-sm col-3",attrs:{color:"k-controls","options-selected-class":"text-k-controls",options:e.groupsOptions,label:e.$t("labels.defaultGroups"),dense:"","options-dense":"",clearable:"",multiple:"",tabindex:"3"},model:{value:e.filter.defaultGroup,callback:function(t){e.$set(e.filter,"defaultGroup",t)},expression:"filter.defaultGroup"}})],1)],1),t("div",{staticClass:"row full-width ka-filter-info q-pa-sm"},[t("div",{staticClass:"col-6 self-end"},[e._v(e._s(e.$t("labels.filterInfo",{filtered:e.filtered?e.$t("labels.filtered"):e.$t("labels.all"),element:e.$t("menu.agreementTemplates"),number:e.rowsNumber})))]),t("div",{staticClass:"col text-right"},[t("q-btn",{staticClass:"ka-action-button",attrs:{label:e.$t("labels.clearSearch"),disabled:!e.filtered,color:"k-controls"},on:{click:e.initializeFilter}})],1)])]),t("div",{staticClass:"row full-width ka-actions q-ma-md"},[t("div",{staticClass:"row full-width q-pa-xs ka-selected-info"},[t("div",{staticClass:"inline-block",domProps:{innerHTML:e._s(e.$t("labels.selectedInfo",{selected:e.selected.length,total:e.agreementTemplates.length,type:e.$t("labels.agreementTemplates")}))}}),e.selected.length>0?t("div",{staticClass:"inline-block q-pa-xs"},[t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-checkbox-multiple-blank-outline",size:"1.8em"},on:{click:function(t){return e.selected.splice(0,e.selected.length)}}},[t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0]}},[e._v(e._s(e.$t("labels.unselectAll")))])],1)],1):e._e(),e.selected.length0},on:{click:function(t){return e.showAgreementTemplateDialog(s.row.id)}}},[t("q-tooltip",{attrs:{anchor:"bottom middle",self:"top middle",offset:[0,8],delay:600}},[e._v(e._s(e.$t("labels.btnUpdateAgreementTemplate")))])],1),t("q-btn",{attrs:{icon:"mdi-trash-can",round:"",color:"k-red",size:"sm",disable:e.selected.length>0},on:{click:function(t){return e.removeAgreementTemplate([s.row])}}},[t("q-tooltip",{attrs:{anchor:"bottom middle",self:"top middle",offset:[0,8],delay:600}},[e._v(e._s(e.$t("labels.deleteAgreementTemplate")))])],1)],1)],1)]}}])})],1),t("q-dialog",{staticClass:"ka-dialog",model:{value:e.showTextDialogModel,callback:function(t){e.showTextDialogModel=t},expression:"showTextDialogModel"}},[t("q-card",{staticStyle:{"min-width":"600px"}},[t("q-card-section",[t("div",{staticClass:"text-h6 q-pa-sm ka-dialog-title"},[e._v("Agreement template's text")])]),t("q-card-section",[t("div",{staticClass:"q-ml-sm",domProps:{innerHTML:e._s(e.selectedRow)}})]),t("q-card-actions",{staticClass:"q-ma-md text-primary",attrs:{align:"right"}},[t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{label:e.$t("labels.btnClose"),color:"k-controls",tabindex:"55"}})],1)],1)],1),t("AgreementTemplateComponentDialog",{attrs:{newAgreementTemplate:e.newAgreementTemplate},on:{refreshPage:e.refreshAgreementTemplates}}),t("klab-loading",{attrs:{loading:e.waiting,message:e.$t("messages.doingThings")}})],1)},Ia=[];function La(e,t){const s=`${e}From`,a=`${e}To`;null!==this.filter[s]&&null!==this.filter[a]&&bt()(this.filter[s],"L").isSameOrAfter(bt()(this.filter[a],"L"))&&(this.$refs[`${e}${t}`].reset(),this.$q.notify({message:this.$t("messages.errorDateFromTo",{type:e}),color:"negative"}))}var Da=function(){var e=this,t=e._self._c;return null!==e.agreementTemplate?t("q-dialog",{attrs:{persistent:""},model:{value:e.open,callback:function(t){e.open=t},expression:"open"}},[t("div",{staticClass:"ka-dialog",staticStyle:{"max-width":"fit-content"}},[t("q-card",{staticStyle:{"max-width":"100%",width:"1300px",overflow:"hidden"}},[t("q-card-section",[t("div",{staticClass:"text-h2 q-pa-sm ka-dialog-title"},[e._v("Agreement template")]),t("q-separator",{staticClass:"ka-dialog-title-separator k-controls"})],1),t("q-card-section",[t("div",{staticClass:"row q-col-gutter-lg q-pa-sm"},[t("q-select",{ref:"agreementLevel",staticClass:"col-lg-3 col-xs-12 col-sm-6",attrs:{color:"k-controls","options-selected-class":"text-k-controls",label:e.$t("labels.agreementLevel"),clearable:"",tabindex:"1",options:e.agreementLevelOptions,rules:[t=>e.fieldRequired(t)]},model:{value:e.agreementLevelModel,callback:function(t){e.agreementLevelModel=t},expression:"agreementLevelModel"}}),t("q-select",{ref:"agreementType",staticClass:"col-lg-3 col-xs-12 col-sm-6",attrs:{color:"k-controls","options-selected-class":"text-k-controls",options:e.agreementTypeOptions,label:e.$t("labels.agreementType"),clearable:"",tabindex:"2",rules:[t=>e.fieldRequired(t)]},model:{value:e.agreementTypeModel,callback:function(t){e.agreementTypeModel=t},expression:"agreementTypeModel"}}),t("q-select",{staticClass:"col-lg-3 col-xs-12 col-sm-6",attrs:{options:e.groupsOptions,label:e.$t("labels.defaultGroups"),color:"k-controls",clearable:"","options-selected-class":"text-k-controls",multiple:"","emit-value":"",rules:[t=>e.fieldRequired(t)]},scopedSlots:e._u([{key:"option",fn:function(s){return[t("q-item",e._g(e._b({},"q-item",s.itemProps,!1),s.itemEvents),[t("q-item-section",{attrs:{avatar:""}},[t("img",{attrs:{src:s.opt.icon,width:"20"}})]),t("q-item-section",[t("q-item-label",[e._v(e._s(s.opt.label))]),t("q-item-label",{attrs:{caption:""}},[e._v(e._s(s.opt.description))])],1)],1)]}}],null,!1,4053758931),model:{value:e.defaultGroupModel,callback:function(t){e.defaultGroupModel=t},expression:"defaultGroupModel"}}),t("div",{staticClass:"col-lg-3 col-xs-12 col-sm-6"},[t("KInputDate",{key:"validDate",attrs:{name:"validDate",color:"k-controls",label:e.$t("labels.validDate"),tabindex:"31"},model:{value:e.agreementTemplate.validDate,callback:function(t){e.$set(e.agreementTemplate,"validDate",t)},expression:"agreementTemplate.validDate"}})],1),t("div",{staticClass:"fit q-col-gutter-md row col-xs-12 col-sm-12 col-lg-3 items-center wrap"},[t("div",{staticClass:"col-xs-12 col-sm-1 col-lg-auto"},[e._v("\n "+e._s(e.$t("labels.defaultDuration"))+"\n ")]),t("q-select",{ref:"group-desfaultExpirationTimeYear",staticClass:"col-lg-1 col-xs-6 col-sm-1",attrs:{dense:"",standout:"bg-teal text-white",color:"k-controls",options:e.availableYears},model:{value:e.agreementTemplate.defaultDurationPeriod.year,callback:function(t){e.$set(e.agreementTemplate.defaultDurationPeriod,"year",t)},expression:"agreementTemplate.defaultDurationPeriod.year"}}),t("div",{staticClass:"col-lg-1 col-xs-6 col-sm-1"},[e._v(e._s(e.$t("labels.year")))]),t("q-select",{ref:"group-desfaultExpirationTimeMonth",staticClass:"col-lg-1 col-xs-6 col-sm-1",attrs:{dense:"",standout:"bg-teal text-white",color:"k-controls",options:e.availableMonths},model:{value:e.agreementTemplate.defaultDurationPeriod.month,callback:function(t){e.$set(e.agreementTemplate.defaultDurationPeriod,"month",t)},expression:"agreementTemplate.defaultDurationPeriod.month"}}),t("div",{staticClass:"col-lg-1 col-xs-6 col-sm-1"},[e._v(e._s(e.$t("labels.month")))]),t("q-select",{ref:"group-desfaultExpirationTimeDay",staticClass:"col-lg-1 col-xs-6 col-sm-1",attrs:{dense:"",standout:"bg-teal text-white",color:"k-controls",options:e.availableDays},model:{value:e.agreementTemplate.defaultDurationPeriod.day,callback:function(t){e.$set(e.agreementTemplate.defaultDurationPeriod,"day",t)},expression:"agreementTemplate.defaultDurationPeriod.day"}}),t("div",{staticClass:"col-lg-1 col-xs-6 col-sm-1"},[e._v(e._s(e.$t("labels.day")))]),t("q-item",[t("q-item-section",[t("q-toggle",{staticClass:"col-lg-2 col-xs-12 col-sm-4",attrs:{label:e.$t("labels.toogleDefaultTemplate"),color:"k-controls"},model:{value:e.agreementTemplate.defaultTemplate,callback:function(t){e.$set(e.agreementTemplate,"defaultTemplate",t)},expression:"agreementTemplate.defaultTemplate"}})],1),t("q-item-section",{attrs:{side:""}},[t("q-btn",{attrs:{flat:"",round:"",icon:"mdi-information-outline"}},[t("q-popup-proxy",[t("q-banner",{scopedSlots:e._u([{key:"avatar",fn:function(){return[t("q-icon",{attrs:{name:"mdi-information-outline",color:"k-controls"}})]},proxy:!0}],null,!1,800219440)},[e._v("\n "+e._s(e.$t("messages.agreementTemplateDefaultTemplate"))+"\n ")])],1)],1)],1)],1)],1),t("div",{staticClass:"col-xs-12 q-pa-lg"},[t("q-field",{ref:"fieldRef",attrs:{"label-slot":"",borderless:"",rules:[t=>e.fieldRequired(t)]},scopedSlots:e._u([{key:"control",fn:function(){return[t("q-editor",{style:e.fieldRef&&e.fieldRef.hasError?"border-color: #C10015":"",attrs:{placeholder:e.$t("contents.placeholderAgreementText"),toolbar:[["left","center","right","justify"],["bold","italic","strike","underline","subscript","superscript"],["token","hr","link","custom_btn"],["quote","unordered","ordered","outdent","indent"],["undo","redo"],["viewsource"]]},model:{value:e.agreementTemplate.text,callback:function(t){e.$set(e.agreementTemplate,"text",t)},expression:"agreementTemplate.text"}})]},proxy:!0}],null,!1,1768847785),model:{value:e.agreementTemplate.text,callback:function(t){e.$set(e.agreementTemplate,"text",t)},expression:"agreementTemplate.text"}})],1)],1)]),t("q-card-actions",{staticClass:"q-ma-md",attrs:{align:"right"}},[t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{label:e.$t("labels.btnClose"),color:"k-red",tabindex:"55"}}),t("q-btn",{attrs:{color:"k-controls",label:e.$t("labels.submitForm")},on:{click:e.submitAgreementTemplate}})],1)],1)],1)]):e._e()},Ga=[],Ma={props:{newAgreementTemplate:{type:Boolean,default:!1}},mixins:[pt],data(){return{agreementTypeOptions:Object.values(re["c"]).map((e=>e)),agreementLevelOptions:Object.values(re["b"]).map((e=>e)),availableYears:[...Array(100)].map(((e,t)=>t)),availableMonths:[...Array(13)].map(((e,t)=>t)),availableDays:[...Array(32)].map(((e,t)=>t)),fieldRef:{}}},name:"AgreementTemplateCard",components:{KInputDate:Tt},computed:{...Object(W["c"])("admin",["agreementTemplate","groups","groupsOptions"]),open:{set(e){e||this.resetAgreementTemplate()},get(){return null!==this.agreementTemplate}},agreementLevelModel:{get(){return this.agreementTemplate.agreementLevel?re["b"][this.agreementTemplate.agreementLevel].label:""},set(e){this.agreementTemplate.agreementLevel=null!==e?e.value:null}},agreementTypeModel:{get(){return this.agreementTemplate.agreementType?re["c"][this.agreementTemplate.agreementType].label:""},set(e){this.agreementTemplate.agreementType=null!==e?e.value:null}},defaultGroupModel:{get(){const e=this.agreementTemplate.defaultGroups.map((e=>e.group.name?e.group.name:""));return e},set(e){if(null==e)this.agreementTemplate.defaultGroups=[];else{const t=this.agreementTemplate.defaultGroups,s=e.filter((e=>!t.some((t=>e===t.group.name)))),a=this.groups.find((e=>e.name===s[0]));this.agreementTemplate.defaultGroups.push({group:a})}}}},methods:{...Object(W["b"])("admin",["resetAgreementTemplate","updateAgreementTemplate","deleteAgreementTemplate","createAgreementTemplate"]),checkDates:La,submitAgreementTemplate(){this.$refs.agreementLevel.validate(),this.$refs.agreementType.validate(),this.$refs.fieldRef.validate(),this.agreementTemplate.defaultDuration=ba(this.agreementTemplate.defaultDurationPeriod),this.agreementTemplate.validDate=this.agreementTemplate.validDate?new Date(this.agreementTemplate.validDate.replace(/\//g,"-")):null,this.newAgreementTemplate?this.createAgreementTemplate(this.agreementTemplate).then((()=>{this.$q.notify({message:this.$t("messages.agreementTemplateCreated"),color:"positive",timeout:1e3}),this.resetAgreementTemplate()})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.agreementTemplateCreatedError"),color:"negative",timeout:1500}),this.resetAgreementTemplate()})):this.updateAgreementTemplate(this.agreementTemplate).then((()=>{this.$q.notify({message:this.$t("messages.agreementTemplateUpdated"),color:"positive",timeout:1e3}),this.resetAgreementTemplate()})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.agreementTemplateUpdatedError"),color:"negative",timeout:1500}),this.resetAgreementTemplate()}))}}},Qa=Ma,ja=Object(X["a"])(Qa,Da,Ga,!1,null,null,null),Fa=ja.exports;Se()(ja,"components",{QDialog:x["a"],QCard:q["a"],QCardSection:M["a"],QSeparator:O["a"],QSelect:k["a"],QItem:g["a"],QItemSection:b["a"],QItemLabel:f["a"],QToggle:C["a"],QBtn:p["a"],QPopupProxy:y["a"],QBanner:st["a"],QIcon:m["a"],QField:Lt["a"],QEditor:v["a"],QCardActions:Q["a"]}),Se()(ja,"directives",{ClosePopup:F["a"]});const Ba={id:"",agreementLevel:null,agreementType:null,text:null,defaultTemplate:!1,validDate:null,defaultGroup:null,defaultDuration:null};var Va={name:"AgreementTemplatesComponent",components:{KInputDate:Tt,KlabLoading:qe,AgreementTemplateComponentDialog:Fa},data(){return{newAgreementTemplate:!1,selected:[],filter:{...Ba},waiting:!1,rowsNumber:0,pagination:{sortBy:"agreementLevel",descending:!0,rowsPerPage:25,oldRowsPerPage:25},agreementTypeOptions:Object.keys(re["c"]).map((e=>re["c"][e])),agreementLevelOptions:Object.keys(re["b"]).map((e=>re["b"][e])),agreementTypes:re["c"],agreementLevels:re["b"],showTextDialogModel:!1,selectedRow:{},columns:[{name:"agreementLevel",field:"agreementLevel",required:!0,label:this.$t("labels.agreementLevel"),align:"left",sortable:!0,headerStyle:"width: 13%"},{name:"agreementType",field:"agreementType",required:!0,label:this.$t("labels.agreementType"),align:"left",sortable:!0,headerStyle:"width: 13%"},{name:"validDate",field:"validDate",required:!0,label:this.$t("labels.validDate"),align:"center",sortable:!0,sort:(e,t)=>rr(e,t),headerStyle:"width: 13%"},{name:"defaultTemplate",field:"defaultTemplate",required:!0,label:this.$t("labels.defaultTemplate"),align:"center",headerStyle:"width: 10%"},{name:"text",field:"text",required:!0,label:this.$t("labels.text"),align:"center",headerStyle:"width: 10%"},{name:"defaultGroups",field:"defaultGroups",required:!0,label:this.$t("labels.defaultGroups"),align:"center",headerStyle:"width: 13%"},{name:"defaultDuration",field:"defaultDuration",required:!0,label:this.$t("labels.defaultDuration"),align:"center",sortable:!0,headerStyle:"width: 13%"},{name:"actions",field:"actions",align:"center",headerStyle:"width: 13%"}]}},computed:{...Object(W["c"])("admin",["users","groups","groupsIcons","groupsOptions","senders","agreementTemplates"])},methods:{...Object(W["b"])("admin",["loadGroups","loadAgreementTemplates","loadAgreementTemplate","deleteAgreementTemplates"]),refreshAgreementTemplates(){const e={};this.waiting=!0,this.selected=[],this.loadAgreementTemplates(e).then((()=>{this.waiting=!1,this.$q.notify({message:this.$t("messages.agreementTemplatesLoaded"),color:"positive",timeout:1e3})})).catch((e=>{console.error(e),this.waiting=!1,this.$q.notify({message:this.$t("messages.agreementTemplatesLoadedError"),color:"negative",timeout:1500})}))},showAgreementTemplateDialog(e=null){this.waiting=!0;const t={id:e};this.loadAgreementTemplate(t).then((()=>{this.waiting=!1,this.newAgreementTemplate=null===e})).catch((e=>{console.error(e),this.waiting=!1,this.newAgreementTemplate=!1}))},filtered(){return!Jo(this.filter,Ba)},initializeFilter(){this.filter={...Ba}},selectAll(){this.agreementTemplates.forEach((e=>{0!==this.selected.length&&-1!==this.selected.findIndex((t=>e.id===t.id))||this.selected.push(e)}))},formatDate:ar,longToPeriod:ga,printPeriod:fa,checkDates:La,showTextDialog(e){this.selectedRow=e,this.showTextDialogModel=!0},filterMethod(){return this.filtered?this.agreementTemplate.filter((()=>null===this.filter.agreementLevel||""===this.filter.agreementLevel)):this.agreementTemplates},filterArrays(e,t,s){const a=t.map((e=>e.value));return"all"===s?a.every((t=>e.includes(t))):e.some((e=>a.includes(e)))},getPaginationLabel(e,t,s){return this.rowsNumber=s,this.$t("labels.pagination",{firstRowIndex:e,endRowIndex:t,totalRowsNumber:s})},removeAgreementTemplate(e){this.$q.dialog({title:this.$t("messages.confirm"),message:this.$t("messages.confirmRemoveElementMsg",{element:this.$t("labels.agreementTemplate")}),html:!0,ok:{color:"k-controls"},cancel:{color:"k-red"},persistent:!0}).onOk((()=>{this.waiting=!0,this.deleteAgreementTemplates(e).then((()=>{this.waiting=!1,this.$q.notify({message:this.$t("messages.agreementTemplateDeleted"),color:"positive",timeout:1e3}),this.loadAgreementTemplates(this.filter)})).catch((e=>{console.error(e),this.waiting=!1,this.$q.notify({message:this.$t("messages.agreementTemplateDeletedError"),color:"negative",timeout:1500})}))}))}},created(){this.loadGroups().then((()=>{this.refreshAgreementTemplates()})),bt.a.locale(this.$q.lang.getLocale())},mounted(){},watch:{filtered(e){e?(this.pagination.oldRowsPerPage=this.pagination.rowsPerPage,this.pagination.rowsPerPage=0):this.pagination.rowsPerPage=this.pagination.oldRowsPerPage}}},Ya=Va,Ka=(s("9e60"),Object(X["a"])(Ya,Ua,Ia,!1,null,null,null)),Wa=Ka.exports;Se()(Ka,"components",{QIcon:m["a"],QTooltip:R["a"],QSelect:k["a"],QToggle:C["a"],QInput:E["a"],QBtn:p["a"],QTable:I["a"],QTr:D["a"],QTd:L["a"],QCheckbox:T["a"],QDialog:x["a"],QCard:q["a"],QCardSection:M["a"],QCardActions:Q["a"]}),Se()(Ka,"directives",{ClosePopup:F["a"]});var Ha=function(){var e=this,t=e._self._c;return t("div",{staticClass:"ka-content"},[t("h2",{staticClass:"kh-h-first"},[e._v(" "+e._s(e.$t("contents.adminNodesTitle"))+"\n "),t("q-icon",{staticClass:"cursor-pointer text-k-main ka-refresh",class:{"ka-refreshing":e.refreshing},attrs:{name:"mdi-refresh"},on:{click:e.refreshGroups}},[t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0],delay:600}},[e._v(e._s(e.$t("labels.refreshNodes")))])],1)],1),t("div",{staticClass:"row full-width ka-actions q-ma-md"},[t("div",{staticClass:"row full-width q-pa-sm ka-actions-row"},[t("div",{staticClass:"col-1 ka-action-desc"},[e._v(e._s(e.$t("labels.actionsNodes")))]),t("q-btn",{staticClass:"col-2 ka-action-button",attrs:{icon:"mdi-account-multiple-plus",color:"k-controls",label:e.$t("labels.createNode")},on:{click:e.createNode}})],1)]),e.nodes.length>0?t("div",{},[t("q-table",{attrs:{grid:"",data:e.nodes,columns:e.columns,"hide-bottom":""},scopedSlots:e._u([{key:"item",fn:function(s){return[t("div",{staticClass:"q-pa-xs col-sm-8 col-md-5 col-lg-2"},[t("q-card",{staticClass:"full-height"},[t("div",{staticClass:"row"},[t("q-item-section",[t("q-item",{staticClass:"items-center"},[t("q-input",{staticClass:"col",attrs:{filled:"",disable:"",label:e.$t("labels.nodeName")},model:{value:s.row.name,callback:function(t){e.$set(s.row,"name",t)},expression:"props.row.name"}}),t("q-btn",{staticStyle:{float:"right"},attrs:{round:"",color:"red",size:"sm",icon:"file_copy"},on:{click:function(t){return e.downloadCertificate(s.row.name)}}}),t("q-btn",{staticStyle:{float:"right"},attrs:{round:"",color:"primary",size:"sm",icon:"edit"},on:{click:function(t){return e.editNode(s.row.name)}}}),t("q-btn",{staticStyle:{float:"right"},attrs:{round:"",color:"secondary",size:"sm",icon:"delete"},on:{click:function(t){return e.removeNode(s.row.name)}}})],1)],1)],1),t("q-list",{staticClass:"gc-items"},e._l(s.cols.filter((e=>"icon"!==e.name&&"name"!==e.name&&"groups"!==e.name&&"description"!==e.name)),(function(s){return t("q-item",{key:s.name},[t("q-item-section",{staticClass:"gc-item-label"},[t("q-item-label",[e._v(e._s(s.label))])],1),s.value?Array.isArray(s.value)?t("q-item",{class:{"gc-multiple-item":s.value&&s.value.length>0}},[0===s.value.length?t("div",[t("q-item-label",{attrs:{caption:""},domProps:{innerHTML:e._s(e.$t("labels.groupNoValue"))}})],1):e._e()]):t("q-item-section",{staticClass:"gc-item"},[t("q-item-label",{attrs:{caption:""}},[e._v(e._s(s.value))])],1):t("q-item-section",[t("q-item-label",{attrs:{caption:""},domProps:{innerHTML:e._s(e.$t("labels.groupNoValue"))}})],1)],1)})),1),t("q-item-section",[t("q-item",{staticClass:"justify-center"},[t("q-item-label",{attrs:{caption:""},domProps:{innerHTML:e._s(e.$t("labels.nodeGroups"))}})],1),t("q-item",{staticClass:"row wrap justify-around"},e._l(s.row.groups,(function(s,a){return t("div",{key:a,staticClass:"row justify-between content-between"},[t("q-item",{staticClass:"justify"},[t("q-icon",{attrs:{name:"img:"+s.iconUrl}}),t("q-item-label",{attrs:{caption:""}},[e._v(" "+e._s(s.name)+" ")])],1)],1)})),0)],1)],1)],1)]}}],null,!1,3657553187)})],1):e._e(),t("q-dialog",{model:{value:e.edit,callback:function(t){e.edit=t},expression:"edit"}},[t("NodeFormCard",{attrs:{"new-node":!1}})],1),t("q-dialog",{model:{value:e.create,callback:function(t){e.create=t},expression:"create"}},[t("NodeFormCard",{attrs:{"new-node":!0}})],1),t("klab-loading",{attrs:{loading:e.waiting||e.refreshing,message:e.$t("messages.doingThings")}})],1)},za=[],Xa=function(){var e=this,t=e._self._c;return null!==e.group?t("q-dialog",{attrs:{persistent:""},model:{value:e.open,callback:function(t){e.open=t},expression:"open"}},[t("div",{staticClass:"ka-dialog"},[t("q-card",{staticClass:"full-height"},[t("q-list",[t("q-item",[t("q-item-section",[t("q-input",{ref:"group-name",attrs:{color:"k-controls",disable:!e.newNode,label:e.$t("labels.nodepName"),rules:[t=>e.fieldRequired(t)]},scopedSlots:e._u([{key:"append",fn:function(){return[e.group.name&&e.newGroup?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-close-circle",color:"k-main"},on:{click:function(t){t.stopPropagation(),e.group.name=null}}}):e._e()]},proxy:!0}],null,!1,3957828500),model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1)],1),t("q-item",[t("q-item-section",{staticClass:"col-10"},[t("q-input",{ref:"group-icon",attrs:{color:"k-controls",autogrow:"",label:e.$t("labels.groupIcon"),error:e.iconError,"error-message":e.$t("messages.iconNotValid")},on:{input:function(t){e.iconError=!1}},scopedSlots:e._u([{key:"append",fn:function(){return[e.group.iconUrl?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-close-circle",color:"k-main"},on:{click:function(t){t.stopPropagation(),e.group.iconUrl=null}}}):e._e()]},proxy:!0}],null,!1,734042839),model:{value:e.group.iconUrl,callback:function(t){e.$set(e.group,"iconUrl",t)},expression:"group.iconUrl"}})],1)],1)],1)],1)],1)]):e._e()},Za=[],Ja={name:"NodeFormCard",props:{newNode:{type:Boolean,default:!1}},mixins:[pt],data(){return{form:{},groupNames:[],changed:!1,groupSelection:[]}},computed:{...Object(W["c"])("admin",["node","groups"]),availableGroups(){return this.groups.map((e=>e.name))}},methods:{...Object(W["b"])("admin",["updateNode","createNode","loadGroups"]),submit(){this.form.groups=this.getSelectedGroups(),this.newNode?this.createNode(this.form):this.updateNode(this.form)},cancel(){},getSelectedGroups(){const e=[];return this.availableGroups.forEach((t=>this.groupSelection.includes(t.name)?e.push(t):e)),e}},mounted(){this.form=this.node,this.loadGroups(),this.new||(this.groupNames=this.groups.map((e=>e.name))),this.groupSelection=this.form.groups.map((e=>e.name))}},eo=Ja,to=Object(X["a"])(eo,Xa,Za,!1,null,"4118013a",null),so=to.exports;Se()(to,"components",{QDialog:x["a"],QCard:q["a"],QList:h["a"],QItem:g["a"],QItemSection:b["a"],QInput:E["a"],QIcon:m["a"]});var ao={name:"NodeComponent",components:{NodeFormCard:so,KlabLoading:qe},data(){return{edit:!1,create:!1,columns:[{name:"name",field:"name",required:!0,label:this.$t("labels.nodeName"),align:"center",sortable:!0},{name:"email",field:"email",required:!0,label:this.$t("labels.nodeEmail"),align:"center",sortable:!0},{name:"url",field:"url",required:!0,label:this.$t("labels.nodeUrl"),align:"center",sortable:!0},{name:"groups",field:"groups",required:!0,label:this.$t("labels.groups"),align:"center",sortable:!0}],refreshing:!1}},computed:{...Object(W["c"])("admin",["nodes"])},methods:{...Object(W["b"])("admin",["loadNodes","loadNode","deleteNode","loadNewNode","downloadNodeCertificate"]),createNode(){this.loadNewNode().then((()=>{this.refreshing=!1,this.$q.notify({message:this.$t("messages.newGroupLoaded"),color:"positive",timeout:1e3}),this.create=!0})).catch((()=>{this.$q.notify({message:this.$t("messages.newGroupLoadedError"),color:"negative",timeout:1500}),this.refreshing=!1,this.create=!1}))},editNode(e){this.loadNode(e).then((()=>{this.refreshing=!1,this.$q.notify({message:this.$t("messages.nodeLoaded"),color:"positive",timeout:1e3}),this.edit=!0})).catch((()=>{this.$q.notify({message:this.$t("messages.nodeLoadedError"),color:"negative",timeout:1500}),this.refreshing=!1,this.edit=!1}))},removeNode(e){this.deleteNode(e).then((()=>{this.refreshing=!1,this.$q.notify({message:this.$t("messages.nodeDeleted"),color:"positive",timeout:1e3}),this.loadNodes()})).catch((()=>{this.$q.notify({message:this.$t("messages.nodeDeletedError"),color:"negative",timeout:1500}),this.refreshing=!1}))},downloadCertificate(e){this.downloadNodeCertificate(e).then((()=>{this.refreshing=!1,this.$q.notify({message:this.$t("messages.nodeCertificate"),color:"positive",timeout:1e3})})).catch((()=>{this.$q.notify({message:this.$t("messages.nodeCertificateError"),color:"negative",timeout:1500}),this.refreshing=!1}))}},created(){this.loadNodes()}},oo=ao,ro=(s("5428"),Object(X["a"])(oo,Ha,za,!1,null,null,null)),io=ro.exports;Se()(ro,"components",{QIcon:m["a"],QTooltip:R["a"],QBtn:p["a"],QTable:I["a"],QCard:q["a"],QItemSection:b["a"],QItem:g["a"],QInput:E["a"],QList:h["a"],QItemLabel:f["a"],QDialog:x["a"]});var lo=function(){var e=this,t=e._self._c;return t("div",{staticClass:"ka-content"},[t("h2",{staticClass:"kh-h-first"},[e._v(e._s(e.$t("contents.statsHomeTitle")))]),t("div",{domProps:{innerHTML:e._s(e.$t("contents.statsHomeContent"))}})])},no=[],co={data(){return{}}},uo=co,po=Object(X["a"])(uo,lo,no,!1,null,null,null),mo=po.exports,ho=function(){var e=this,t=e._self._c;return t("div",{staticClass:"ka-content row"},[t("h2",{staticClass:"kh-h-first"},[e._v(e._s(e.$t("contents.statsHomeTitle"))+"\n "),t("q-icon",{staticClass:"cursor-pointer text-k-controls ka-refresh",class:{"ka-refreshing":e.refreshing},attrs:{name:"mdi-refresh"},on:{click:e.refreshQueries}},[t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0]}},[e._v(e._s(e.$t("labels.refreshQueries")))])],1)],1),t("div",{staticClass:"row full-width ka-filters"},[t("div",{staticClass:"row full-width"},[t("div",{staticClass:"col-6"},[t("q-select",{staticClass:"q-pa-sm col",attrs:{value:"model",color:"k-controls",options:e.queriesOptions,label:e.$t("labels.queries"),"options-dense":"",clearable:"",tabindex:"4"},on:{input:function(t){return e.refreshQueryList(t)},change:function(t){return e.refreshQueryList(t)}},scopedSlots:e._u([{key:"option",fn:function(s){return[t("q-item",e._g(e._b({},"q-item",s.itemProps,!1),s.itemEvents),[t("q-item-section",[t("q-item-label",{domProps:{innerHTML:e._s(s.opt.name)}})],1)],1)]}},{key:"selected-item",fn:function(t){return[e._v(e._s(t.opt.name)+"\n ")]}}]),model:{value:e.single,callback:function(t){e.single=t},expression:"single"}})],1)]),t("div",{staticClass:"row full-width"},["QUERY_ASSET"===this.listOption?t("div",{staticClass:"q-pa-sm col-4"},[t("q-input",{staticStyle:{"max-width":"250px"},attrs:{type:"number",label:"Minimum Resolution Time",filled:"",clearable:""},on:{change:function(t){return e.refreshQueryList()},input:function(t){return e.refreshQueryList()}},model:{value:e.resolutionTimeMin,callback:function(t){e.resolutionTimeMin=e._n(t)},expression:"resolutionTimeMin"}})],1):e._e(),"QUERY_ASSET"===this.listOption?t("div",{staticClass:"q-pa-sm col-4"},[t("q-input",{staticStyle:{"max-width":"250px"},attrs:{type:"number",label:"Maximum Resolution Time",filled:"",clearable:""},on:{change:function(t){return e.refreshQueryList()},input:function(t){return e.refreshQueryList()}},model:{value:e.resolutionTimeMax,callback:function(t){e.resolutionTimeMax=e._n(t)},expression:"resolutionTimeMax"}})],1):e._e(),"QUERY_ASSET_NAME_GROUP_COUNT"===this.listOption||"QUERY_CONTEXT_NAME_COUNT"===this.listOption||"QUERY_REQUESTS_PER_USER"===this.listOption?t("div",{staticClass:"q-pa-sm col-4"},[t("q-input",{attrs:{type:"number",label:"Top",filled:"",clearable:""},on:{change:function(t){return e.refreshQueryList()}},model:{value:e.top,callback:function(t){e.top=e._n(t)},expression:"top"}})],1):e._e(),"QUERY_OUTCOME_AGGREGATE"===this.listOption||"QUERY_ASSET"===this.listOption?t("div",{staticClass:"q-pa-sm col-4"},[t("div",{staticClass:"q-gutter-md"},[t("q-select",{attrs:{outlined:"",options:e.aggregate_options,clearable:"",label:"Result"},on:{input:function(t){return e.refreshQueryList()},change:function(t){return e.refreshQueryList()}},model:{value:e.outcome,callback:function(t){e.outcome=t},expression:"outcome"}})],1)]):e._e(),"QUERY_QUERIES_PER"===this.listOption?t("div",{staticClass:"q-pa-sm col-4"},[t("q-select",{attrs:{outlined:"",options:e.groupBy_options,clearable:"",label:"Group By"},on:{input:function(t){return e.refreshQueryList()},change:function(t){return e.refreshQueryList()}},model:{value:e.groupBy,callback:function(t){e.groupBy=t},expression:"groupBy"}})],1):e._e(),"QUERY_TIME_RANGE"===this.listOption||"QUERY_REQUESTS_PER_USER"===this.listOption?t("div",{staticClass:"q-pa-sm col-4"},[t("q-input",{attrs:{filled:"",mask:"date",clearable:"",label:e.$t("labels.queriesFrom")},on:{change:function(t){return e.refreshQueryList()}},scopedSlots:e._u([{key:"append",fn:function(){return[t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"event"}},[t("q-popup-proxy",{ref:"qDateProxy",attrs:{"transition-show":"scale","transition-hide":"scale"}},[t("q-date",{attrs:{"Mask:":"","YYYY-MM-DD":""},on:{input:function(t){return e.refreshQueryList()}},model:{value:e.dateFrom,callback:function(t){e.dateFrom=t},expression:"dateFrom"}},[t("div",{staticClass:"row items-center justify-end"},[t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{label:"Close",color:"primary",flat:""}})],1)])],1)],1)]},proxy:!0}],null,!1,302866215),model:{value:e.dateFrom,callback:function(t){e.dateFrom=t},expression:"dateFrom"}})],1):e._e(),"QUERY_TIME_RANGE"===this.listOption||"QUERY_REQUESTS_PER_USER"===this.listOption?t("div",{staticClass:"q-pa-sm col-4"},[t("q-input",{attrs:{filled:"",clearable:"",mask:"date",label:e.$t("labels.queriesTo")},on:{change:function(t){return e.refreshQueryList()}},scopedSlots:e._u([{key:"append",fn:function(){return[t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"event"}},[t("q-popup-proxy",{ref:"qDateProxy",attrs:{"transition-show":"scale","transition-hide":"scale"}},[t("q-date",{attrs:{"Mask:":"","YYYY-MM-DD":""},on:{input:function(t){return e.refreshQueryList()}},model:{value:e.dateTo,callback:function(t){e.dateTo=t},expression:"dateTo"}},[t("div",{staticClass:"row items-center justify-end"},[t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{label:"Close",color:"primary",flat:""}})],1)])],1)],1)]},proxy:!0}],null,!1,1255382090),model:{value:e.dateTo,callback:function(t){e.dateTo=t},expression:"dateTo"}})],1):e._e()]),t("div",{staticClass:"row full-width ka-filter-info q-pa-sm"}),t("div",{staticClass:"row full-width ka-filter-info q-pa-sm text-bottom"},[t("div",{staticClass:"col-6"},[e._v(e._s(e.$t("labels.filterInfoQueries",{number:e.rowsNumber})))]),t("div",{staticClass:"col text-right"},[t("q-btn",{staticClass:"ka-action-button",attrs:{label:e.$t("labels.clearSearch"),color:"k-controls"},on:{click:e.initializeFields}}),t("q-btn",{staticClass:"ka-action-button",attrs:{label:"MAKE QUERY",color:"k-controls"},on:{click:function(t){return e.refreshQueries()}}})],1)])]),t("div",{staticClass:"row full-width ka-filter-info q-pa-sm"},[t("div",{staticClass:"col text-left"},[e.refreshBar&&"QUERY_ASSET"!=this.listOption&&"QUERY_OUTCOME_AGGREGATE"!=this.listOption&&"QUERY_TIME_RANGE"!=this.listOption?t("q-btn",{staticClass:"ka-action-button",attrs:{label:"Change View",color:"k-controls"},on:{click:e.changeViewTable}}):e._e()],1)]),t("div",{staticClass:"row full-width"},[e.refreshBar&&e.tableView&&this.queries.length>0?t("q-table",{ref:"ka-table",staticClass:"no-shadow ka-table full-width",attrs:{title:"Query Results",data:e.queries,filter:e.filter,"rows-per-page-options":[10,25,50,100,0],"pagination-label":e.getPaginationLabel,pagination:e.pagination,columns:e.columns,color:"k-controls"},on:{"update:pagination":function(t){e.pagination=t}},scopedSlots:e._u([{key:"top-right",fn:function(){return[t("q-input",{attrs:{borderless:"",dense:"",debounce:"300",placeholder:"Search"},scopedSlots:e._u([{key:"append",fn:function(){return[t("q-icon",{attrs:{name:"search"}})]},proxy:!0}],null,!1,4009527860),model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}})]},proxy:!0}],null,!1,2722981051)}):e._e()],1),[e.tableView?e._e():t("div",{staticClass:"full-width ka-filters"},[t("div",{staticClass:"q-pa-md",attrs:{id:"app"}},[e.refreshBar&&"QUERY_ASSET"!=this.listOption&&"QUERY_OUTCOME_AGGREGATE"!=this.listOption&&"QUERY_TIME_RANGE"!=this.listOption&&!e.tableView?t("bar-chart",{attrs:{"chart-data":e.chartData,options:e.chartOptions,height:1,width:4}}):e._e()],1)])],t("klab-loading",{attrs:{loading:e.waiting||e.refreshing,message:e.$t("messages.doingThings")}})],2)},go=[],bo=s("1fca");const{reactiveProp:fo}=bo["c"];var Eo={extends:bo["a"],mixins:[fo],props:["chartData","options"],mounted(){this.renderChart(this.chartData,this.options)}},vo={name:"StatsComponent",components:{KlabLoading:qe,BarChart:Eo},data(){return{data:[],selected:[],pagination:{descending:!0,rowsPerPage:25,oldRowsPerPage:25,sortBy:"count"},rowsNumber:0,refreshing:!1,filter:"",queriesOptions:Object.keys(re["i"]).map((e=>re["i"][e])),waiting:!1,statsUrl:null,top:10,resolutionTimeMin:null,resolutionTimeMax:null,aggregate_options:["Success","Error","Exception"],table_view_options:["Table View","Graph View"],groupBy_options:["Day","Month","Year"],outcome:null,listOption:null,single:null,dateFrom:null,dateTo:null,dateText:null,groupBy:null,refreshBar:!1,chartData:null,labels:null,tableView:!0,chartOptions:{label:"Asset count",backgroundColor:"#73cab4",height:10,width:100,hAxis:{title:"Users"},vAxis:{title:"Year"},maintainAspectRatio:!0,scales:{yAxes:[{ticks:{beginAtZero:!0}}]}},label:"Number of Instances",backgroundColor:"#73cab4"}},computed:{...Object(W["c"])("admin",["queries"]),columns(){return this.queries.length>0?Object.keys(this.queries[0]).map((e=>({name:e,label:this.$t(`tables.${e}`),align:"left",sortable:!0,field:e}))):null}},watch:{},methods:{...Object(W["b"])("admin",["loadQueries","senders"]),refreshQueries(){null!=this.listOption&&(this.refreshing=!0,this.refreshBar=!1,this.filter="",this.loadQueries(this.statsUrl).then((()=>{this.refreshing=!1,this.refreshBar=!0,"QUERY_TIME_RANGE"===this.listOption&&this.queries.length>0&&("undefined"===typeof this.queries[0].resolutionTime&&(this.queries[0].resolutionTime=0),"undefined"===typeof this.queries[0].observable&&(this.queries[0].observable="-")),this.queries.length>0?(this.$q.notify({message:this.$t("messages.queriesLoaded"),color:"positive",timeout:1e3}),this.fillData()):this.$q.notify({message:this.$t("messages.queriesNull"),color:"positive",timeout:1e3})})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.queriesLoadedError"),color:"negative",timeout:1500}),this.refreshing=!1})))},changeViewTable(){this.tableView=!this.tableView},getPaginationLabel(e,t,s){return this.rowsNumber=s,this.$t("labels.pagination",{firstRowIndex:e,endRowIndex:t,totalRowsNumber:s})},refreshQueryList(e){switch(e&&(this.listOption=e.value),this.listOption){case"QUERY_ASSET":this.statsUrl="?queryType=asset",this.labels=this.queries.map((e=>e.assetName)),null!==this.resolutionTimeMin&&(this.statsUrl+=`&resolutionTimeMin=${this.resolutionTimeMin}`),null!==this.resolutionTimeMax&&(this.statsUrl+=`&resolutionTimeMax=${this.resolutionTimeMax}`),this.outcome&&(this.statsUrl+=`&outcome=${this.outcome}`);break;case"QUERY_ASSET_NAME_GROUP_COUNT":this.statsUrl="?queryType=asset_name_group_count",10!==this.top&&(this.statsUrl+=`&top=${this.top}`);break;case"QUERY_OUTCOME_GROUP_COUNT":this.statsUrl="?queryType=outcome_group_count";break;case"QUERY_OUTCOME_AGGREGATE":this.statsUrl="?queryType=outcome_aggregate",this.outcome&&(this.statsUrl+=`&outcome=${this.outcome}`);break;case"QUERY_CONTEXT_NAME_COUNT":this.statsUrl="?queryType=context_name_count",10!==this.top&&(this.statsUrl+=`&top=${this.top}`);break;case"QUERY_TIME_RANGE":if(this.statsUrl="?queryType=time_range",this.dateFrom){this.dateText=this.dateFrom.toString().replace(/\//g,"-");const e=new Date(this.dateText),t=e.getTime();this.statsUrl+=`&from=${t}`}if(this.dateTo){this.dateText=this.dateTo.toString().replace(/\//g,"-");const e=new Date(this.dateText),t=e.getTime()+864e5;this.statsUrl+=`&to=${t}`}break;case"QUERY_QUERIES_PER":this.statsUrl="?queryType=queries_per",this.groupBy&&(this.statsUrl+=`&groupBy=${this.groupBy.toLowerCase()}`);break;case"QUERY_REQUESTS_PER_USER":if(this.statsUrl="?queryType=requests_per_user",10!==this.top&&(this.statsUrl+=`&top=${this.top}`),this.dateFrom){this.dateText=this.dateFrom.toString().replace(/\//g,"-");const e=new Date(this.dateText),t=e.getTime();this.statsUrl+=`&from=${t}`}if(this.dateTo){this.dateText=this.dateTo.toString().replace(/\//g,"-");const e=new Date(this.dateText),t=e.getTime()+864e5;this.statsUrl+=`&to=${t}`}break;default:this.statsUrl="";break}},initializeFields(){null!=this.listOption&&(this.top=10,this.outcome=null,this.resolutionTimeMin=null,this.resolutionTimeMax=null,this.statsUrl=null,this.dateFrom=null,this.dateTo=null,this.dateText=null,this.groupBy=null,this.filter="",this.refreshQueryList())},fillData(){if(this.queries.length>0){switch(this.listOption){case"QUERY_ASSET_NAME_GROUP_COUNT":this.labels=this.queries.map((e=>e.assetName));break;case"QUERY_OUTCOME_GROUP_COUNT":this.labels=this.queries.map((e=>e.outcome));break;case"QUERY_CONTEXT_NAME_COUNT":this.labels=this.queries.map((e=>e.contextName));break;case"QUERY_QUERIES_PER":this.labels=this.queries.map((e=>e.startDate));break;case"QUERY_REQUESTS_PER_USER":this.labels=this.queries.map((e=>e.principal));break;default:this.labels=null;break}this.chartData={labels:this.labels,datasets:[{barThickness:"flex",label:this.label,backgroundColor:this.backgroundColor,data:this.queries.map((e=>e.count)),height:1,width:4,hAxis:{title:"Users"},vAxis:{title:"Year"}}]},this.tableView=!0}}},created(){},mounted(){}},ko=vo,_o=Object(X["a"])(ko,ho,go,!1,null,null,null),To=_o.exports;Se()(_o,"components",{QIcon:m["a"],QTooltip:R["a"],QSelect:k["a"],QItem:g["a"],QItemSection:b["a"],QItemLabel:f["a"],QInput:E["a"],QPopupProxy:y["a"],QDate:w["a"],QBtn:p["a"],QTable:I["a"]}),Se()(_o,"directives",{ClosePopup:F["a"]});var wo=function(){var e=this,t=e._self._c;return t("div",{staticClass:"ka-content"},[t("h2",{staticClass:"kh-h-first"},[e._v(e._s(e.$t("contents.statsHomeTitle"))+"\n "),t("q-icon",{staticClass:"cursor-pointer text-k-controls ka-refresh",class:{"ka-refreshing":e.refreshing},attrs:{name:"mdi-refresh"},on:{click:e.refreshUserStatistics}},[t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0]}},[e._v(e._s(e.$t("labels.refreshQueries")))])],1)],1),t("div",{staticClass:"row full-width ka-filters"},[t("div",{staticClass:"row full-width"},[t("div",{staticClass:"col-10"},[t("div",{staticClass:"row full-width"},[t("q-select",{staticClass:"q-pa-sm col-5",attrs:{value:"model",color:"k-controls",options:e.registrationRange,label:e.$t("labels.registrationRange")},on:{input:function(t){return e.refreshQueryList(t)},change:function(t){return e.refreshQueryList(t)}},scopedSlots:e._u([{key:"option",fn:function(s){return[t("q-item",e._g(e._b({},"q-item",s.itemProps,!1),s.itemEvents),[t("q-item-section",[t("q-item-label",{domProps:{innerHTML:e._s(s.opt.name)}})],1)],1)]}},{key:"selected-item",fn:function(s){return[t("q-icon",{attrs:{name:s.opt.icon}}),e._v(e._s(s.opt.name)+"\n ")]}}]),model:{value:e.single,callback:function(t){e.single=t},expression:"single"}}),t("div",{staticClass:"q-pa-md col-5"},[t("div",{staticClass:"q-gutter-md"},[t("q-select",{attrs:{outlined:"",options:e.chartListOptions,label:"Chart Type"},on:{input:function(t){return e.refreshChartType(t)},change:function(t){return e.refreshChartType(t)}},model:{value:e.chartType,callback:function(t){e.chartType=t},expression:"chartType"}})],1)])],1),[t("div",{staticClass:"q-pa-md",attrs:{id:"app"}},[e.refreshBar&&"Bar Chart"==this.chartType?t("bar-chart",{attrs:{"chart-data":e.chartData,options:e.chartOptions,height:1,width:4}}):e._e(),e.refreshBar&&"Line Chart"==this.chartType?t("line-chart",{attrs:{"chart-data":e.chartData,options:e.chartOptions,height:1,width:4}}):e._e()],1)]],2)])])])},yo=[];const{reactiveProp:Co}=bo["c"];var So={extends:bo["b"],mixins:[Co],props:["chartData","options"],mounted(){this.renderChart(this.chartData,this.options)}};const Ao={queries:null,userStats:null,registeredUsers:null,labels:null};var qo={name:"UserStatsComponent",components:{BarChart:Eo,LineChart:So},data(){return{data:[],selected:[],filter:{...Ao},statsUrl:null,chartData:[],rowsNumber:0,refreshing:!1,registrationRange:Object.keys(re["s"]).map((e=>re["s"][e])),waiting:!1,listOption:null,single:null,refreshBar:!1,chartType:"Bar Chart",chartListOptions:["Bar Chart","Line Chart"],chartOptions:{height:10,width:100,hAxis:{title:"Users"},vAxis:{title:"Year"},maintainAspectRatio:!0,scales:{yAxes:[{ticks:{beginAtZero:!0}}]}},label:"Registrations per month",backgroundColor:"#73cab4",groupBy:"Month",groupByOptions:["Day","Month","Year"]}},computed:{...Object(W["c"])("admin",["userStats","registeredUsers","labels"])},watch:{},methods:{...Object(W["b"])("admin",["loadUserStats","senders"]),refreshUserStatistics(){this.refreshing=!0,this.refreshBar=!1,this.loadUserStats(this.statsUrl).then((()=>{this.refreshing=!1,this.$q.notify({message:this.$t("messages.userStatsLoaded"),color:"positive",timeout:1e3}),this.refreshBar=!0,this.fillData()})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.userStatsLoadedError"),color:"negative",timeout:1500}),this.refreshing=!1}))},refreshQueryList(e){switch(e&&(this.listOption=e.value),this.listOption){case"YEAR":this.statsUrl="?groupBy=year",this.label="Registrations per year",this.backgroundColor="#73cab4";break;case"MONTH_ACCUMULATION":this.statsUrl="?groupBy=monthAccumulation",this.label="Accumulated registrations per month",this.backgroundColor="#26a69a";break;case"YEAR_ACCUMULATION":this.statsUrl="?groupBy=yearAccumulation",this.label="Accumulated registrations per year",this.backgroundColor="#26a69a";break;default:this.statsUrl="?groupBy=yearMonth",this.label="Registrations per month",this.backgroundColor="#73cab4";break}this.refreshUserStatistics(),this.refreshing=!1},refreshChartType(e){e&&(this.chartType=e),this.refreshUserStatistics(),this.refreshing=!1},fillData(){this.chartData={labels:this.labels,datasets:[{label:this.label,backgroundColor:this.backgroundColor,data:this.registeredUsers,height:50,width:100,hAxis:{title:"Users"},vAxis:{title:"Year"}}]}},getPaginationLabel(e,t,s){return this.rowsNumber=s,this.$t("labels.pagination",{firstRowIndex:e,endRowIndex:t,totalRowsNumber:s})},initializeFields(){this.top=10,this.outcome=null,this.resolutionTimeMin=null,this.resolutionTimeMax=null,this.statsUrl=null,this.dateFrom=null,this.dateTo=null,this.dateText=null,this.refreshUserStatistics()}},created(){},mounted(){this.refreshUserStatistics()}},Oo=qo,Ro=Object(X["a"])(Oo,wo,yo,!1,null,null,null),$o=Ro.exports;Se()(Ro,"components",{QIcon:m["a"],QTooltip:R["a"],QSelect:k["a"],QItem:g["a"],QItemSection:b["a"],QItemLabel:f["a"],QInput:E["a"],QPopupProxy:y["a"],QDate:w["a"],QBtn:p["a"]}),Se()(Ro,"directives",{ClosePopup:F["a"]});var Po=function(){var e=this,t=e._self._c;return t("div",{staticClass:"row full-width"},[t("div",{staticClass:"q-pa-sm col-4"},[t("div",{staticClass:"q-gutter-md"},[t("q-input",{attrs:{type:"number",label:"Time Range",filled:""},model:{value:e.time_range,callback:function(t){e.time_range=e._n(t)},expression:"time_range"}})],1)]),t("div",{staticClass:"q-pa-sm col-4"},[t("div",{staticClass:"q-gutter-md"},[t("q-select",{attrs:{outlined:"",options:e.time_unit_options,clearable:"",label:"Time Unit"},model:{value:e.time_unit,callback:function(t){e.time_unit=t},expression:"time_unit"}})],1)]),t("div",{staticClass:"q-pa-sm col-4"},[t("q-btn",{staticClass:"ka-action-button",attrs:{label:"SHOW DATA",color:"k-controls"},on:{click:function(t){return e.fillMap()}}})],1),t("div",{staticStyle:{height:"700px",width:"100%"},attrs:{id:"map-div"}})])},No=[],xo=(s("6cc5"),s("8243"),s("3ac1"),s("e11e")),Uo=(s("2573"),s("c14d")),Io=s.n(Uo),Lo=s("36a6"),Do=s.n(Lo),Go=(s("6005"),s("b048"),{name:"ObservationMap",data(){return{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:'Map data © OpenStreetMap contributors',minZoom:2,maxZoom:18,maxBounds:[[-90,-180],[90,180]],map:null,span:"&span=days,1",time_unit_options:["Hour(s)","Day(s)","Week(s)","Month(s)","Year(s)"],time_unit:"Day(s)",time_range:1,unit:null,layerControl:null,polygonLayer:null,markerCluster:null,tileLayer:null,baseLayers:null}},created(){},methods:{fillMap(){switch(this.layerControl&&(this.map.eachLayer((e=>{this.map.removeLayer(e)})),this.layersControl=null),this.markerCluster&&(this.markerCluster.clearLayers(),this.map.removeLayer(this.markerCluster)),this.map&&(this.map.remove(),this.map=xo["map"]("map-div",{fullscreenControl:!0,minZoom:2,maxZoom:18,maxBounds:[[-90,-180],[90,180]]}).setView([0,0],2)),this.tileLayer&&this.map.removeLayer(this.tileLayer),this.tileLayer=xo["tileLayer"]("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'Map data © OpenStreetMap contributors',maxZoom:18}).addTo(this.map),this.time_unit){case"Hour(s)":this.unit="hours";break;case"Day(s)":this.unit="days";break;case"Week(s)":this.unit="weeks";break;case"Month(s)":this.unit="months";break;case"Year(s)":this.unit="years";break;default:this.unit="hours";break}this.span=`&span=${this.unit},${this.time_range}`;const e=`https://knowledge.integratedmodelling.org/stats/public/stats/geojson/events?polygons=True${this.span}`;fetch(e).then((e=>e.json())).then((e=>{this.map.setView([0,0],2);const t=["#0099FF","#0077FF","#0055FF","#0033FF","#0011FF"],s=e.features.map((e=>e.properties.scale_size)),a=Math.min(...s),o=Math.max(...s),r=e.features.sort(((e,t)=>t.properties.scale_size-e.properties.scale_size)),i=new Set,l=new Set;this.polygonLayer&&(this.map.removeLayer(this.polygonLayer),this.polygonLayer=null),this.polygonLayer=xo["layerGroup"]().addTo(this.map);const n={},c=new Set;r.forEach((e=>{"Polygon"===e.geometry.type&&(c.has(e.properties.context_id)||(c.add(e.properties.context_id),n[e.properties.context_id]=new Set),n[e.properties.context_id].add(e.properties.observation))})),r.forEach((e=>{if("Polygon"===e.geometry.type&&!l.has(e.properties.context_id)){l.add(e.properties.context_id);const s=e.geometry.coordinates[0],r=s.map((e=>[e[1],e[0]])),c=e.properties.scale_size,u=Math.floor((c-a)/(o-a)*(t.length-1)),d=t[u],p=e.properties["name:en"]||"";if(!i.has(JSON.stringify(r))){const t=xo["polygon"](r,{fill:!0,fillColor:d,fillOpacity:.05,stroke:!0,color:"#00008B",weight:.2,tooltip:p}).addTo(this.polygonLayer);i.add(JSON.stringify(r));const s=`\n

${p}

\n

Context: ${e.properties.context_name}

\n

Applications: ${e.properties.application}

\n

Observations:

\n
    \n ${Array.from(n[e.properties.context_id]).map((e=>`
  • ${e}
  • `)).join("\n")}\n
\n `;t.bindPopup(s)}}})),this.markerCluster&&(this.map.removeLayer(this.markerCluster),this.markerCluster=null),this.markerCluster=xo["markerClusterGroup"]().addTo(this.map);const u=new Set;e.features.forEach((e=>{if("Polygon"===e.geometry.type&&!u.has(e.properties.context_id)){u.add(e.properties.context_id);const t=e.geometry.coordinates[0],s=[t.reduce(((e,t)=>e+t[1]),0)/t.length,t.reduce(((e,t)=>e+t[0]),0)/t.length];let a;"Success"===e.properties.outcome?a=Io.a:"Failure"===e.properties.outcome&&(a=Do.a);const o=e.properties["name:en"]||"",r=xo["marker"](s,{icon:xo["icon"]({iconUrl:a,iconSize:[40,40],iconAnchor:[12,41],popupAnchor:[8,-40]}),title:o,alt:o}),i=`\n

${o}

\n

Context: ${e.properties.context_name}

\n

Applications: ${e.properties.application}

\n

Observations:

\n
    \n ${Array.from(n[e.properties.context_id]).map((e=>`
  • ${e}
  • `)).join("\n")}\n
\n `;r.bindPopup(i),this.markerCluster.addLayer(r)}})),this.baseLayers={OpenStreetMap:xo["tileLayer"]("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'Map data © OpenStreetMap contributors',maxZoom:18})};const d={Markers:this.markerCluster,Polygons:this.polygonLayer};this.layerControl=xo["control"].layers(this.baseLayers,d).addTo(this.map)})).catch((e=>{console.error("An error occurred while retrieving the GeoJSON :",e)}))}},mounted(){this.map=xo["map"]("map-div",{minZoom:2,maxBounds:[[-90,-180],[90,180]],fullscreenControl:!0}).setView([0,0],2),this.tileLayer=xo["tileLayer"]("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'Map data © OpenStreetMap contributors',maxZoom:18}).addTo(this.map)}}),Mo=Go,Qo=Object(X["a"])(Mo,Po,No,!1,null,null,null),jo=Qo.exports;Se()(Qo,"components",{QInput:E["a"],QSelect:k["a"],QBtn:p["a"]});const Fo=[{path:"/",redirect:"/home",component:nt,children:[{path:"/home",name:"home",meta:{requiresAuth:!0,isAuthenticated:!0,default:!0},component:()=>Promise.all([s.e(0),s.e(2)]).then(s.bind(null,"bc13"))},{path:"/profile/view",name:"profileView",component:Ft,meta:{requiresAuth:!0}},{path:"/groups/view",name:"groupView",component:as,meta:{requiresAuth:!0}},{path:"/profile/certificate",name:"certificate",component:hs,meta:{requiresAuth:!0}},{path:"/admin",component:ks,meta:{requiresAuth:!0,requiresAdmin:!0},children:[{path:"",name:"adminHome",component:Ps},{path:"users",name:"adminUsers",component:ua},{path:"groups",name:"adminGroups",component:Aa},{path:"tasks",name:"adminTasks",component:xa},{path:"agreementTemplates",name:"adminAgreementTemplates",component:Wa},{path:"nodes",name:"adminNodes",component:io}]},{path:"/stats",component:Ss,meta:{requiresAuth:!0,requiresAdmin:!0},children:[{path:"",name:"stats",component:mo},{path:"queries",name:"statsQueries",component:To},{path:"userStats",name:"userStats",component:$o},{path:"observationMap",name:"observationMap",component:jo}]}]}];Fo.push({path:"*",component:()=>s.e(3).then(s.bind(null,"e51e"))});var Bo=Fo;a["a"].use(ue["a"]),a["a"].use(pe.a);const Vo=new ue["a"]({scrollBehavior:()=>({y:0}),routes:Bo,mode:"history",base:"/hub/ui/"});Vo.beforeEach(((e,t,s)=>{""===e.hash&&"/hub/"===e.path||(""!==e.hash&&"/hub/"===e.path?s("/home"):s())}));var Yo=Vo;const{hexToRgb:Ko,getBrand:Wo,rgbToHex:Ho}=ne["a"],zo=/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/;function Xo(e){if("string"!==typeof e)throw new TypeError("Expected a string");const t=zo.exec(e);if(t){const e={r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)};return t[4]&&(e.a=parseFloat(t[4])),e}return Ko(e)}function Zo(e){let t,s;return 0===e.indexOf("#")?(s=e,t=Ko(e)):-1!==e.indexOf(",")?(t=Xo(e),s=Ho(t)):(s=Wo(e),t=Ko(s)),{rgb:t,hex:s,color:e}}function Jo(e,t){const s=Object.getOwnPropertyNames(t);for(let a=0;a()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,username:/^[a-zA-Z0-9_.-]*$/,phone:/^[+]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/};async function tr(e){if(e.response){console.error(e.response),403===e.response.status&&(e.response.statusText="Forbidden page for user role");const t={status:e.response.data.status||e.response.status,message:e.response.data.message||e.response.data||(""!==e.response.statusText?e.response.statusText:"Unknown"),axiosError:e};if(t.message instanceof Blob&&"application/json"===t.message.type){const e=await new Promise((e=>{const s=new FileReader;s.onload=function(){e(JSON.parse(this.result))},s.readAsText(t.message)}));return e}return console.error(t),t}return e.request?(console.error(e.request),{status:e.request.status,message:e.message,axiosError:e}):(console.error(e),{status:"UNKNOWN",message:e.message,axiosError:e})}async function sr(e,t,s=null){const{type:a,url:o,params:r={},needAuth:i=!1,owner:l="layout",base_url:n=re["j"].HUB}=e;if("GET"!==a&&"POST"!==a&&"PUT"!==a&&"DELETE"!==a||null===o||""===o)throw new Error(`Bad axios call, check type and url: ${a} / ${o}`);Pr.dispatch("view/setSpinner",{...re["o"].SPINNER_LOADING,owner:"layout"},{root:!0}).then((async()=>{const e="GET"===a?ie.get:"POST"===a?ie.post:"DELETE"===a?ie.delete:ie.put;let c;try{let s=o;if("GET"===a&&0!==Object.keys(r).length){const e=new URLSearchParams(r).toString();s=`${o}?${e}`,console.debug(`${__ENV__.BASE_URL}/${s}`)}n===re["j"].HUB?s=`${__ENV__.BASE_URL}/${s}`:n===re["j"].KEYCLOAK&&(s=`${__ENV__.KEYCLOAK_URL}/${s}`),c=await e(s,r),c&&(t?t(c,(()=>{Pr.dispatch("view/setSpinner",{...re["o"].SPINNER_STOPPED,owner:l},{root:!0})})):(console.warn("Doing nothing after axios call"),Pr.dispatch("view/setSpinner",{...re["o"].SPINNER_STOPPED,owner:l},{root:!0})))}catch(u){const e=await tr(u);if(Pr.dispatch("view/setSpinner",{...re["o"].SPINNER_ERROR,owner:l,errorMessage:e.message,showNotifications:!1},{root:!0}),i&&401===e.status)return console.warn("We are logged out from backoffice"),void Pr.dispatch("auth/logout",!0,{root:!0});if(e.message&&-1!==e.message.toLowerCase().indexOf("network error")&&Pr.dispatch("view/setConnectionDown",!0),null===s)throw e;s(e)}}))}function ar(e,t=!1){if(e&&""!==e){const s=bt()(e);return t?s.format("L"):s.format("L - HH:mm")}return ce["b"].tc("messages.unknownDate")}function or(e,t,s){return s>=e.length?s=0:s<0&&(s=e.length-1),e.splice(s,0,e.splice(t,1)[0]),s}function rr(e,t){return e?t?new Date(e).getTime()-new Date(t).getTime():1:-1}const ir={USERS_NO_GROUPS:"$NO_GROUPS$"},lr={EQUAL:"eq",NOT_EQUAL:"neq",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL_TO:"gte",LESS_THAN:"lt",LESS_THAN_OR_EQUAL_TO:"lte",IN:"in",NOT_IN:"nin",BETWEEN:"btn",CONTAINS:"like",NOT_CONTAINS:"notLike",IS_NULL:"isnull",IS_NOT_NULL:"isnotnull",START_WITH:"startwith",END_WITH:"endwith",IS_EMPTY:"isempty",IS_NOT_EMPTY:"isnotempty",JOIN:"jn",IS:"is"};function nr(e,t,s){return`${e}|${t}|${s}`}function cr(e){return`$DATE$${bt()(e,"L").format("YYYY-MM-DD")}`}function ur(e){return e.charAt(0).toUpperCase()+e.slice(1)}function dr(e,t,s){t[`no${ur(e)}`]?s.push(nr(e,lr.IS_NULL,!0)):(t[`${e}From`]&&s.push(nr(e,lr.GREATER_THAN_OR_EQUAL_TO,cr(t[`${e}From`]))),t[`${e}To`]&&s.push(nr(e,lr.LESS_THAN_OR_EQUAL_TO,cr(t[`${e}To`]))))}function pr(e,t){const s=[],a=[];if(null!==t.username&&""!==t.username&&s.push(nr("name",lr.CONTAINS,t.username.toLowerCase())),null!==t.email&&""!==t.email&&s.push(nr("email",lr.CONTAINS,t.email.toLowerCase())),t.roles&&0!==t.roles.length){const e="any"===t.rolesAllAny?a:s;t.roles.forEach((t=>{e.push(nr("roles",lr.EQUAL,t.value))}))}if(t.noGroups)s.push(nr("groups",lr.EQUAL,ir.USERS_NO_GROUPS));else if(t.groups&&0!==t.groups.length){const e="any"===t.groupsAllAny?a:s;t.groups.forEach((t=>{e.push(nr("groups",lr.EQUAL,t.value))}))}t.accountStatus&&0!==t.accountStatus.length&&t.accountStatus.forEach((e=>{s.push(nr("accountStatus",lr.EQUAL,e.value))})),dr("lastConnection",t,s),dr("lastLogin",t,s),dr("registrationDate",t,s);const{page:o,rowsPerPage:r,sortBy:i,descending:l}=e,n={page:o,size:r,orders:`${i}|${l?"DESC":"ASC"}`,filterAnd:s.join("&"),filterOr:a.join("&")};return n}function mr(e){const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t);const s=document.getSelection().rangeCount>0&&document.getSelection().getRangeAt(0);t.select(),document.execCommand("copy"),document.body.removeChild(t),s&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(s))}var hr={login:({commit:e},t)=>new Promise(((t,s)=>{sr({type:re["u"].GET_PROFILE.method,url:re["u"].GET_PROFILE.url,needAuth:!0},(s=>{if(204!==s.status){const t=s.data,a=localStorage.getItem(re["g"].TOKEN);e("AUTH_SUCCESS",{token:a,profile:t})}t(s)}),(t=>{e("AUTH_ERROR",t),s(t)}))})),logout:({state:e,commit:t},s=!1)=>new Promise(((e,s)=>{localStorage.removeItem(re["g"].TOKEN),localStorage.removeItem(re["g"].REFRESH_TOKEN),t("LOGOUT");var o={redirectUri:__ENV__.APP_BASE_URL};a["a"].$keycloak.logout(o).catch((e=>{console.error(e)}))})),register:({commit:e},t)=>new Promise(((s,a)=>{console.log(t),sr({type:re["u"].REGISTER_USER.method,url:re["u"].REGISTER_USER.url,params:t},((t,a)=>{e("REGISTER_SUCCESS"),s(t),a()}),(t=>{e("REGISTER_FAILURE"),a(t)}))})),createProfile:({},e)=>new Promise(((t,s)=>{sr({type:re["u"].CREATE_PROFILE.method,url:re["u"].CREATE_PROFILE.url.replace("{username}",e.username),params:{username:e.username,email:e.email},needAuth:!0},((e,s)=>{t(e),s()}),(e=>{s(e)}))})),getProfileWithToken:({state:e,commit:t},{user:s,clickback:a})=>new Promise(((e,o)=>{sr({type:re["u"].GET_USER_NOAUTH.method,url:re["u"].GET_USER_NOAUTH.url.replace("{username}",s).replace("{clickback}",a)},((t,s)=>{const a=t.data;e(a),s()}),(e=>{t("EMAIL_REQUEST_FAILURE"),o(e)}))})),getProfile:({commit:e})=>new Promise(((t,s)=>{sr({type:re["u"].GET_PROFILE.method,url:re["u"].GET_PROFILE.url,needAuth:!0},((s,a)=>{if(204===s.status)t(s);else{const a=s.data;e("AUTH_PROFILE",a),t(a)}a()}),(t=>{e("AUTH_ERROR"),localStorage.removeItem("token"),s(t)}))})),updateProfile:(e,t)=>new Promise(((e,s)=>{sr({type:re["u"].UPDATE_PROFILE.method,url:re["u"].UPDATE_PROFILE.url.replace("{username}",t.name),params:{profile:t},needAuth:!0},((t,s)=>{e(),s()}),(e=>{s(e)}))})),getGroupsSummary:()=>new Promise(((e,t)=>{sr({type:re["u"].GROUP_SUMMARY.method,url:re["u"].GROUP_SUMMARY.url,needAuth:!0},((t,s)=>{const a=t.data.groups;e(a),s()}),(e=>{t(e)}))})),requestGroups:({state:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].TASK_GROUPS_REQUEST.method,url:re["u"].TASK_GROUPS_REQUEST.url.replace("{username}",e.profile.name),params:t,needAuth:!0},((e,t)=>{s(),t()}),(e=>{a(e)}))})),removeGroup:({state:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].TASK_GROUPS_REMOVE.method,url:re["u"].TASK_GROUPS_REMOVE.url.replace("{username}",e.profile.name),params:t,needAuth:!0},((e,t)=>{s(),t()}),(e=>{a(e)}))})),getCertificate:({commit:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].GET_CERTIFICATE.method,url:re["u"].GET_CERTIFICATE.url.replace("{username}",t.username).replace("{agreement}",t.agreementId),params:{responseType:"blob",certificate:!0},needAuth:!0},((t,a)=>{const o=new Blob([t.data],{type:t.data.type}),r=window.URL.createObjectURL(o),i=document.createElement("a");i.href=r;const l=t.headers["content-disposition"];let n="unknown";if(l){const e=l.match(/filename=(.+)/);2===e.length&&([,n]=e)}i.setAttribute("download",n),document.body.appendChild(i),i.click(),i.remove(),window.URL.revokeObjectURL(r),e("CERT_REQUEST_SUCCESS"),s(t),a()}),(t=>{e("CERT_REQUEST_FAILURE"),a(t)}))})),requestNewEmail:({commit:e},{id:t,email:s})=>new Promise(((e,a)=>{sr({type:re["u"].REQUEST_NEW_EMAIL.method,url:re["u"].REQUEST_NEW_EMAIL.url.replace("{username}",t).replace("{email}",s),needAuth:!0},((t,s)=>{t&&t.data?(e(t),s()):a({status:400,message:"no clickback received",error:null}),s()}),(e=>{a(e)}))})),requestNewPassword:({commit:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].REQUEST_NEW_PASSWORD.method,url:re["u"].REQUEST_NEW_PASSWORD.url.replace("{username}",t),needAuth:!0},((t,o)=>{t&&t.data?(e("PASSWORD_REQUEST_SUCCESS",t.data.clickback),s(t.data.clickback)):a({status:400,message:"no clickback received",error:null}),o()}),(e=>{a(e)}))})),setNewPassword:({commit:e,state:t},{passwordRequest:s,user:a=null,clickback:o=null})=>new Promise(((r,i)=>{sr({type:re["u"].SET_PASSWORD.method,url:re["u"].SET_PASSWORD.url.replace("{username}",null!==a?a:t.profile.name).replace("{clickback}",null!==o?o:t.clickback),params:{newPassword:s.password,confirm:s.confirmation},needAuth:!0},((t,s)=>{t&&t.data?(e("PASSWORD_SET_SUCCESS"),r(t)):i({status:400,message:"no clickback received",error:null}),s()}),(t=>{e("PASSWORD_SET_FAILURE"),i(t)}))})),activateUser:({commit:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].VERIFY.method,url:re["u"].VERIFY.url.replace("{username}",t.user).replace("{clickback}",t.token),needAuth:!0},((t,o)=>{if(t&&t.data){const{profile:a,clickback:o}=t.data;e("ACTIVATE_SUCCESS",{profile:a,clickback:o}),s(t)}else a({status:400,message:"error in activation, no data received",error:null});o()}),(t=>{e("ACTIVATE_FAILURE"),a(t)}))})),getGroup:({dispatch:e},t)=>new Promise(((s,a)=>{sr({dispatch:e,type:"GET",url:`api/groups/${t}`,needAuth:!0},((e,o)=>{e&&e.data?s(t):a({status:400,message:"No response",error:null}),o()}),(e=>{a(e)}))})),invitedNewUser:({commit:e,dispatch:t},s)=>(t("view/setSpinner",{...re["o"].SPINNER_LOADING,owner:"layout"},{root:!0}),new Promise(((a,o)=>{ie.post(`${__ENV__.BASE_URL}/signup?groups=${s.token}&addGroups=${s.groups.join(",")}`,{username:s.username,email:s.email}).then((s=>{e("register_success"),t("view/setSpinner",{...re["o"].SPINNER_STOPPED,owner:"layout"},{root:!0}),a(s)})).catch((s=>{e("register_failure"),t("view/setSpinner",{...re["o"].SPINNER_ERROR,owner:"layout"},{root:!0}),o(s)}))}))),invitedOAuthUserGroups:({commit:e,dispatch:t},s)=>(t("view/setSpinner",{...re["o"].SPINNER_LOADING,owner:"layout"},{root:!0}),new Promise(((a,o)=>{ie.put(`${__ENV__.BASE_URL}/signup?token=${s.authToken}&groups=${s.token}&addGroups=${s.addGroups}`).then((s=>{e("register_success"),t("view/setSpinner",{...re["o"].SPINNER_STOPPED,owner:"layout"},{root:!0}),a(s)})).catch((s=>{e("register_failure"),t("view/setSpinner",{...re["o"].SPINNER_ERROR,owner:"layout"},{root:!0}),o(s)}))}))),oAuthLogin:({commit:e,dispatch:t},s)=>new Promise(((a,o)=>{localStorage.setItem("token",s),ie.defaults.headers.common.Authentication=s,ie.get(`${__ENV__.BASE_URL}/api/users/me`).then((o=>{const r=o.data;e("auth_success",{token:s,profile:r}),t("view/setSpinner",{...re["o"].SPINNER_STOPPED,owner:"layout"},{root:!0}),a(o)})).catch((s=>{e("auth_error"),localStorage.removeItem("token"),t("view/setSpinner",{...re["o"].SPINNER_ERROR,owner:"layout"},{root:!0}),o(s)}))})),getAgreementTemplate:(e,{agreementType:t,agreementLevel:s})=>new Promise(((e,a)=>{sr({type:re["u"].GET_AGREEMENT_TEMPLATE.method,url:re["u"].GET_AGREEMENT_TEMPLATE.url.replace("{agreementType}",t).replace("{agreementLevel}",s)},((t,s)=>{e(t.data),s()}),(e=>{a(e)}))})),addGroupToUser:(e,{group:t,profile:s})=>new Promise(((e,a)=>{const o=[s.name],r=[t.name];sr({type:re["u"].USERS_GROUPS_ADD.method,url:re["u"].USERS_GROUPS_ADD.url.replace("{groupname}",t.name),params:{usernames:o,groupnames:r}},((t,s)=>{e(t.data),s()}),(e=>{a(e)}))})),deleteGroupFromUser:(e,{group:t,profile:s})=>new Promise(((e,a)=>{const o=[s.name],r=[t.name];sr({type:re["u"].USERS_GROUPS_DELETE.method,url:re["u"].USERS_GROUPS_DELETE.url.replace("{groupname}",t.name),params:{usernames:o,groupnames:r}},((t,s)=>{e(t.data),s()}),(e=>{a(e)}))})),validateEmail:(e,{username:t,email:s,password:a,clickback:o})=>new Promise(((e,r)=>{const i=o;sr({type:re["u"].USERS_VALIDATE_EMAIL.method,url:re["u"].USERS_VALIDATE_EMAIL.url.replace("{username}",t),params:{username:t,email:s,password:a,token:i}},((t,s)=>{e(t.data),s()}),(e=>{r(e)}))})),getNotifications:({commit:e},{username:t})=>new Promise(((s,a)=>{sr({type:re["u"].GET_NOTIFICATIONS_BY_USER.method,url:re["u"].GET_NOTIFICATIONS_BY_USER.url.replace("{username}",t)},((t,a)=>{let o=t.data;e("NOTIFICATIONS_LOADED",o),s(t.data),a()}),(e=>{a(e)}))})),createNotification:(e,t)=>new Promise(((e,s)=>{console.log(t),sr({type:re["u"].CREATE_NOTIFICATION.method,url:re["u"].CREATE_NOTIFICATION.url,params:t},((t,s)=>{e(t.data),s()}),(e=>{s(e)}))})),deleteNotification:(e,{id:t})=>new Promise(((e,s)=>{sr({type:re["u"].DELETE_NOTIFICATION.method,url:re["u"].DELETE_NOTIFICATION.url.replace("{id}",t)},((t,s)=>{e(t.data),s()}),(e=>{s(e)}))}))},gr={namespaced:!0,state:te,getters:se,mutations:ae,actions:hr},br={spinner:re["o"].SPINNER_STOPPED,spinnerOwners:[],connectionDown:!1},fr={spinnerIsAnimated:e=>e.spinner.animated,spinner:e=>e.spinner,spinnerOwners:e=>e.spinnerOwners,spinnerColor:e=>"undefined"!==e.spinner&&null!==e.spinner?Zo(e.spinner.color):null,spinnerErrorMessage:e=>"undefined"!==e.spinner&&null!==e.spinner?e.spinner.errorMessage:null,isConnectionDown:e=>e.connectionDown},Er={SET_SPINNER_ANIMATED:(e,t)=>{e.spinner.animated=t},SET_SPINNER_COLOR:(e,t)=>{e.spinner.color=t},SET_SPINNER:(e,{animated:t,color:s,errorMessage:a=null,showNotifications:o=!1})=>{e.spinner={animated:t,color:s,errorMessage:a,showNotifications:o}},ADD_TO_SPINNER_OWNERS:(e,t)=>{const s=e.spinnerOwners.indexOf(t);-1===s&&e.spinnerOwners.push(t)},REMOVE_FROM_SPINNER_OWNERS:(e,t)=>{const s=e.spinnerOwners.indexOf(t);-1!==s&&e.spinnerOwners.splice(s,1)},SET_CONNECTION_DOWN:(e,t)=>{e.connectionDown=t}},vr={setSpinner:({commit:e,getters:t,dispatch:s},{animated:a,color:o,time:r=null,then:i=null,errorMessage:l=null,showNotifications:n=!1,owner:c})=>new Promise(((u,d)=>{c&&null!==c?(a?e("ADD_TO_SPINNER_OWNERS",c):(e("REMOVE_FROM_SPINNER_OWNERS",c),0!==t.spinnerOwners.length&&(a=!0,o!==re["o"].SPINNER_ERROR.color&&({color:o}=re["o"].SPINNER_LOADING))),e("SET_SPINNER",{animated:a,color:o,errorMessage:l,showNotifications:n}),null!==r&&null!==i&&setTimeout((()=>{s("setSpinner",{...i,owner:c})}),1e3*r),u()):d(new Error("No spinner owner!"))})),setConnectionDown:({commit:e},t)=>{e("SET_CONNECTION_DOWN",t)}},kr={namespaced:!0,state:br,getters:fr,mutations:Er,actions:vr},_r={agreementTemplate:null,agreementTemplates:[],stats:{},users:[],queries:{},userStats:[],labels:[],registeredUsers:[],groups:[],groupsOptions:[],groupsIcons:[],group:null,user:null,nodes:[],node:[],tasks:[],senders:{}},Tr={agreementTemplate:e=>e.agreementTemplate,agreementTemplates:e=>e.agreementTemplates,stats:e=>e.stats,users:e=>e.users,groups:e=>e.groups,groupsIcons:e=>e.groupsIcons,groupsOptions:e=>e.groupsOptions,senders:e=>e.senders,tasks:e=>e.tasks,nodes:e=>e.nodes,user:e=>e.user,group:e=>e.group,node:e=>e.node,queries:e=>e.queries,userStats:e=>e.userStats,registeredUsers:e=>e.registeredUsers,labels:e=>e.labels},wr={stat_success(e,t){e.stats=t},LOAD_AGREEMENT_TEMPLATES(e,t){e.agreementTemplates=t},LOAD_USERS(e,t){e.users=t},LOAD_QUERIES(e,t){e.queries=t},LOAD_USER_STATS(e,{labels:t,registeredUsers:s}){e.labels=t,e.registeredUsers=s},LOAD_GROUPS(e,t){e.groups=t,e.groupsIcons.splice(0,e.groupsIcons.length),e.groupsOptions.splice(0,e.groupsOptions.length),t.forEach((t=>{const s=t.iconUrl?t.iconUrl:null;e.groupsIcons[t.name]=s,e.groupsOptions.push({label:t.name,value:t.name,description:t.description,icon:s,dependencies:t.dependsOn})}))},LOAD_AGREEMENT_TEMPLATE(e,t){e.agreementTemplate=t},LOAD_USER(e,t){e.user=t},LOAD_GROUP(e,t){e.group=t},LOAD_NODES(e,t){e.nodes=t},LOAD_NODE(e,t){e.node=t},LOAD_NEW_NODE(e,t){e.node=t},LOAD_TASKS(e,t){e.tasks=t},LOAD_SENDERS(e,t){e.senders=t}},yr={loadUsers:({commit:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].USERS.method,url:re["u"].USERS.url,params:t,needAuth:!0},((o,r)=>{if(o.data){const{items:a}=o.data,r={...t.pagination,page:o.data.currentPage,rowsNumber:o.data.totalItems};a.forEach((e=>{e.agreements.length>0?e.groups=e.agreements[0].agreement.groupEntries.map((e=>e.group.name)):console.warn(`User without agreement: name:'${e.name}'/email:'${e.email}'`)})),e("LOAD_USERS",a),s(r)}else a(new Error("Error retrieving users: no data"));r()}),(e=>{a(e)}))})),loadUser:({commit:e},t=null)=>new Promise(((s,a)=>{null===t?a(new Error("No username selected")):sr({type:re["u"].GET_USER.method,url:re["u"].GET_USER.url.replace("{username}",t),needAuth:!0},((t,o)=>{t.data?(e("LOAD_USER",t.data),s(t.data)):a(new Error("Error retrieving user: no data")),o()}),(e=>{a(e)}))})),resetUser({commit:e}){e("LOAD_USER",null)},deleteUser:(e,t=null)=>new Promise(((e,s)=>{null===t?s(new Error("No username selected")):sr({type:re["u"].DELETE_USER.method,url:re["u"].DELETE_USER.url.replace("{username}",t),needAuth:!0},((t,a)=>{t?e(t):s(new Error("Error deleting user: no data")),a()}),(e=>{s(e)}))})),loadQueries:({commit:e},t="")=>new Promise(((s,a)=>{t||(t="");const o=re["u"].QUERIES.url.concat(t);sr({type:re["u"].QUERIES.method,url:o,needAuth:!0},((t,o)=>{t.data?(e("LOAD_QUERIES",t.data),s(t.data)):a(new Error("Error retrieving queries: no data")),o()}),(e=>{a(e)}))})),loadUserStats:({commit:e},t="")=>new Promise(((s,a)=>{t||(t="?groupBy=month");const o=re["u"].USER_STATS.url.concat(t);sr({type:re["u"].USER_STATS.method,url:o,needAuth:!0},((t,o)=>{t.data?(e("LOAD_USER_STATS",{labels:t.data.map((e=>e.dateString)),registeredUsers:t.data.map((e=>e.count))}),s(t.data.map((e=>e.dateString)),t.data.map((e=>e.count)))):a(new Error("Error retrieving queries: no data")),o()}),(e=>{a(e)}))})),loadTasks:({commit:e})=>new Promise(((t,s)=>{sr({type:re["u"].TASKS.method,url:re["u"].TASKS.url,needAuth:!0},((a,o)=>{a.data?(e("LOAD_TASKS",a.data),t(a)):s(new Error("Error retrieving tasks: no data")),o()}),(e=>{s(e)}))})),acceptTask:(e,t)=>new Promise(((e,s)=>{sr({type:re["u"].TASKS_ACCEPT.method,url:re["u"].TASKS_ACCEPT.url.replace("{id}",t),needAuth:!0},((t,a)=>{t.data?e(t.data):s(new Error("Error accepting tasks: no data")),a()}),(e=>{s(e)}))})),denyTask:(e,{id:t,deniedMessage:s})=>new Promise(((e,a)=>{sr({type:re["u"].TASKS_DENY.method,url:re["u"].TASKS_DENY.url.replace("{id}",t),needAuth:!0,params:{deniedMessage:s}},((t,s)=>{t.data?e(t.data):a(new Error("Error denying tasks: no data")),s()}),(e=>{a(e)}))})),loadSenders:({commit:e})=>new Promise(((t,s)=>{sr({type:re["u"].EMAIL_SENDERS.method,url:re["u"].EMAIL_SENDERS.url,needAuth:!0},((a,o)=>{if(a.data){const s=a.data;e("LOAD_SENDERS",s),t(s)}else s(new Error("Error retrieving senders: no data"));o()}),(e=>{s(e)}))})),modifyUsersGroups:(e,{users:t,groups:s,action:a})=>new Promise(((e,o)=>{if(t&&t.length>0&&s&&s.length>0){const r=a===re["a"].ADD_GROUPS_ACTION?re["r"].REQUEST_GROUP:a===re["a"].REMOVE_GROUPS_ACTION?re["r"].REMOVE_GROUP:"";sr({type:re["u"].REQUEST_USERS_GROUPS.method,url:re["u"].REQUEST_USERS_GROUPS.url.replace("{actionParam}",r),needAuth:!0,params:{usernames:t,groupnames:s}},((t,s)=>{e(t),s()}),(e=>{o(e)}))}else o(new Error("Empty users or groups"))})),loadGroups:({commit:e})=>new Promise(((t,s)=>{sr({type:re["u"].GROUPS.method,url:re["u"].GROUPS.url,needAuth:!0},(async(a,o)=>{if(a.data){const{groups:s}=a.data;e("LOAD_GROUPS",s),t(s),o()}else s(new Error("Error retrieving groups: no data")),o()}),(e=>{s(e)}))})),loadAgreementTemplate:({commit:e},t)=>new Promise(((s,a)=>{if(null===t.id){const t={id:"",agreementLevel:"",agreementType:"",validDate:"",defaultTemplate:!1,text:"",defaultGroups:[],defaultDuration:"",defaultDurationPeriod:{}};e("LOAD_AGREEMENT_TEMPLATE",t),s(t)}else sr({type:re["u"].GET_AGREEMENT_TEMPLATE_FILTER.method,url:re["u"].GET_AGREEMENT_TEMPLATE_FILTER.url,params:t},((t,a)=>{const o={...t.data.agreementTemplate,defaultDurationPeriod:ga(t.data.agreementTemplate.defaultDuration)};e("LOAD_AGREEMENT_TEMPLATE",o),s(t.data),a()}),(e=>{console.error(e),a(e)}))})),loadGroup:({commit:e},t=null)=>new Promise(((s,a)=>{if(null===t){const t={description:"",iconUrl:"",name:"",observables:[],optIn:!1,complimentary:!1,projectUrls:[],worldview:!1,defaultExpirationTime:{},defaultExpirationTimePeriod:{year:0,month:0,day:0}};e("LOAD_GROUP",t),s(t)}else sr({type:re["u"].GET_GROUP.method,url:re["u"].GET_GROUP.url.replace("{name}",t),needAuth:!0},((t,o)=>{if(t.data){const{group:a}=t.data;a.defaultExpirationTimePeriod=ga(a.defaultExpirationTime),e("LOAD_GROUP",a),s(a)}else a(new Error("Error retrieving groups: no data"));o()}),(e=>{a(e)}))})),resetAgreementTemplate({commit:e}){e("LOAD_AGREEMENT_TEMPLATE",null)},resetGroup({commit:e}){e("LOAD_GROUP",null)},createAgreementTemplate:({dispatch:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].CREATE_AGREEMENT_TEMPLATE.method,url:re["u"].CREATE_AGREEMENT_TEMPLATE.url,params:t,needAuth:!0},((t,a)=>{s(t),a(),e("loadAgreementTemplates")}),(e=>{a(e)}))})),createGroup:({dispatch:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].CREATE_GROUP.method,url:re["u"].CREATE_GROUP.url,params:t,needAuth:!0},((t,a)=>{s(t),a(),e("loadGroups")}),(e=>{a(e)}))})),updateAgreementTemplate:({dispatch:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].UPDATE_AGREEMENT_TEMPLATE.method,url:re["u"].UPDATE_AGREEMENT_TEMPLATE.url.replace("{id}",t.id),params:t,needAuth:!0},((t,a)=>{s(t),a(),e("loadAgreementTemplates",{})}),(e=>{a(e)}))})),updateGroup:({dispatch:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].UPDATE_GROUP.method,url:re["u"].UPDATE_GROUP.url.replace("{name}",t.name),params:t,needAuth:!0},((t,a)=>{s(t),a(),e("loadGroups")}),(e=>{a(e)}))})),deleteAgreementTemplate:({dispatch:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].DELETE_AGREEMENT_TEMPLATE.method,url:re["u"].DELETE_AGREEMENT_TEMPLATE.url.replace("{id}",t),needAuth:!0},((t,a)=>{s(t),a(),e("loadAgreementTemplates")}),(e=>{a(e)}))})),deleteAgreementTemplates:({dispatch:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].DELETE_AGREEMENT_TEMPLATES.method,url:re["u"].DELETE_AGREEMENT_TEMPLATES.url,params:t,needAuth:!0},((t,a)=>{s(t),a(),e("loadAgreementTemplates")}),(e=>{a(e)}))})),deleteGroup:({dispatch:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].DELETE_GROUP.method,url:re["u"].DELETE_GROUP.url.replace("{name}",t),needAuth:!0},((t,a)=>{s(t),a(),e("loadGroups")}),(e=>{a(e)}))})),loadNodes:({commit:e})=>new Promise(((t,s)=>{sr({type:re["u"].NODES.method,url:re["u"].NODES.url,needAuth:!0},((a,o)=>{if(a.data){const{nodes:s}=a.data;e("LOAD_NODES",s),t(s)}else s(new Error("Error retrieving groups: no data"));o()}),(e=>{s(e)}))})),loadNode:({commit:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].GET_NODE.method,url:re["u"].GET_NODE.url.replace("{name}",t),needAuth:!0},((t,o)=>{if(t.data){const{node:a}=t.data;e("LOAD_NODE",a),s(a)}else a(new Error("Error retrieving groups: no data"));o()}),(e=>{a(e)}))})),createNode:({dispatch:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].CREATE_NODE.method,url:re["u"].CREATE_NODE.url,params:t,needAuth:!0},((t,a)=>{s(t),a(),e("loadNodes")}),(e=>{a(e)}))})),updateNode:({dispatch:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].UPDATE_NODE.method,url:re["u"].UPDATE_NODE.url.replace("{name}",t.name),params:t,needAuth:!0},((t,a)=>{s(t),a(),e("loadNodes")}),(e=>{a(e)}))})),deleteNode:({dispatch:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].DELETE_NODE.method,url:re["u"].DELETE_NODE.url.replace("{name}",t),needAuth:!0},((t,a)=>{s(t),a(),e("loadNodes")}),(e=>{a(e)}))})),downloadNodeCertificate:({commit:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].GET_NODE_CERTIFICATE.method,url:re["u"].GET_NODE_CERTIFICATE.url.replace("{name}",t),params:{responseType:"blob"},needAuth:!0},((t,a)=>{const o=new Blob([t.data],{type:t.data.type}),r=window.URL.createObjectURL(o),i=document.createElement("a");i.href=r;const l=t.headers["content-disposition"];let n="unknown";if(l){const e=l.match(/filename=(.+)/);2===e.length&&([,n]=e)}i.setAttribute("download",n),document.body.appendChild(i),i.click(),i.remove(),window.URL.revokeObjectURL(r),e("CERT_REQUEST_SUCCESS"),s(t),a()}),(t=>{e("CERT_REQUEST_FAILURE"),a(t)}))})),loadNewNode:({commit:e})=>new Promise((t=>{const s={name:"",email:"",nodeUrl:"",groups:[]};e("LOAD_NEW_NODE",s),t(s)})),getStats:({commit:e,dispatch:t})=>(t("view/setSpinner",{...re["o"].SPINNER_LOADING,owner:"layout"},{root:!0}),new Promise(((s,a)=>{ie.get(`${__ENV__.BASE_URL}/ping`).then((a=>{t("view/setSpinner",{...re["o"].SPINNER_STOPPED,owner:"layout"},{root:!0}),e("stat_success",a.data),s(a)})).catch((s=>{t("view/setSpinner",{...re["o"].SPINNER_ERROR,owner:"layout"},{root:!0}),e("stat_failure"),a(s)}))}))),loadCustomProperties:(e,t)=>new Promise(((e,s)=>{sr({type:re["u"].GET_CUSTOM_PROPERTIES.method,url:re["u"].GET_CUSTOM_PROPERTIES.url.replace("{type}",t),needAuth:!0},((t,s)=>{e(t),s()}),(e=>{s(e)}))})),createNewCustomPropertyKey:(e,{type:t,name:s})=>new Promise(((e,a)=>{sr({type:re["u"].ADD_CUSTOM_PROPERTIES.method,url:re["u"].ADD_CUSTOM_PROPERTIES.url,params:{type:t,name:s},needAuth:!0},((t,s)=>{e(t),s()}),(e=>{a(e)}))})),loadAgreementTemplates:({commit:e},{filter:t={}})=>new Promise(((s,a)=>{sr({type:re["u"].AGREEMENT_TEMPLATES.method,url:re["u"].AGREEMENT_TEMPLATES.url,params:{filter:t},needAuth:!0},((t,a)=>{const{agreementTemplates:o}=t.data;e("LOAD_AGREEMENT_TEMPLATES",o),s(o),a()}),(e=>{a(e)}))}))},Cr={namespaced:!0,state:_r,getters:Tr,mutations:wr,actions:yr},Sr={keycloakProfile:{id:void 0,username:void 0,email:void 0},isAuthenticated:!1,sign_agreement:!1},Ar={profile:e=>e.keycloakProfile,isAuthenticated:e=>e.isAuthenticated,signing_agreement:e=>e.sign_agreement},qr={AUTH_SUCCESS_KEYCLOAK(e){e.isAuthenticated=!0},AUTH_KEYCLOAK(e,t){e.keycloakProfile={id:t.id,username:t.username,email:t.email}},SIGN_AGREEMENT(e){e.sign_agreement=!0},SIGN_AGREEMENT_FINISH(e){e.sign_agreement=!1}},Or={getAccount:({commit:e},{email:t})=>new Promise(((e,t)=>{sr({type:re["u"].KEYCLOAK_GET_ACCOUNT.method,url:re["u"].KEYCLOAK_GET_ACCOUNT.url,needAuth:!0,base_url:re["j"].KEYCLOAK},((s,a)=>{if(s){let t=s.data;e(t)}else t(new Error("Error retrieving users: no data"));a()}),(e=>{t(e)}))}))},Rr={namespaced:!0,state:Sr,getters:Ar,mutations:qr,actions:Or};a["a"].use(W["a"]);const $r=new W["a"].Store({modules:{auth:gr,view:kr,admin:Cr,keycloak:Rr}});var Pr=$r,Nr=async function(){const e="function"===typeof Pr?await Pr({Vue:a["a"]}):Pr,t="function"===typeof Yo?await Yo({Vue:a["a"],store:e}):Yo;e.$router=t;const s={router:t,store:e,render:e=>e(J),el:"#q-app"};return{app:s,store:e,router:t}};a["a"].config.productionTip=!1,a["a"].use(Ve),a["a"].$keycloak.init({onLoad:"login-required",checkLoginIframe:!1}).then((e=>{e?(localStorage.setItem(re["g"].TOKEN,a["a"].$keycloak.token),localStorage.setItem(re["g"].REFRESH_TOKEN,a["a"].$keycloak.refreshToken),a["a"].prototype.$http.defaults.headers.common.Authorization=re["g"].BEARER+a["a"].$keycloak.token,Pr.commit("keycloak/AUTH_SUCCESS_KEYCLOAK"),Pr.dispatch("auth/login").then((e=>{console.debug("Authenticated")})).catch((e=>{throw console.error(e),e}))):window.location.reload(),setInterval((()=>{a["a"].$keycloak.updateToken().then((e=>{if(0!=Pr.getters["auth/isLoggedIn"])e?(console.debug(`Token refreshed ${e}`),localStorage.setItem(re["g"].TOKEN,a["a"].$keycloak.token),localStorage.setItem(re["g"].REFRESH_TOKEN,a["a"].$keycloak.refreshToken),a["a"].prototype.$http.defaults.headers.common.Authorization=re["g"].BEARER+a["a"].$keycloak.token):console.debug(`Token not refreshed, valid for ${Math.round(a["a"].$keycloak.tokenParsed.exp+a["a"].$keycloak.timeSkew-(new Date).getTime()/1e3)} seconds`);else if(!Pr.getters["keycloak/signing_agreement"]){var t={redirectUri:__ENV__.APP_BASE_URL};a["a"].$keycloak.logout(t).catch((e=>{console.error(e)})),Pr.commit("LOGOUT")}})).catch((()=>{console.error("Failed to refresh token")}))}),6e4)})).catch((e=>{console.error(e),console.debug("Authenticated Failed")}));const xr="/hub/ui/",Ur=/\/\//,Ir=e=>(xr+e).replace(Ur,"/");async function Lr(){const{app:e,store:t,router:s}=await Nr();let o=!1;const r=e=>{o=!0;const t=Object(e)===e?Ir(s.resolve(e).route.fullPath):e;window.location.href=t},i=window.location.href.replace(window.location.origin,""),l=[ce["a"],le,void 0];for(let c=0;!1===o&&c{e.i18n=l}},"8de8":function(e,t,s){},"8f27":function(e,t,s){"use strict";s("b5be")},"923f":function(e,t,s){"use strict";(function(e){t["a"]={commons:{appName:"k.Hub"},menu:{home:"Home",downloads:"Downloads",profile:"Profile",certificate:"Download certificate",admin:"Admin",users:"Users",groups:"Groups",usersToGroups:"Assign groups",tasks:"Tasks",agreementTemplates:"Agreement Templates",nodes:"Nodes",stats:"Statistics",queries:"Queries",userStats:"User Statistics",observationMap:"Observation Map"},tables:{contextId:"Context ID",resolutionTime:"Resolution Time (in s)",successful:"Successful",assetName:"Asset Name",count:"Count",resolutionTimeTotal:"Total Resolution Time (in s)",outcome:"Outcome",resolutionTimeMin:"Minimum Resolution Time",resolutionTimeMax:"Maximum Resolution Time",queryId:"Query ID",contextName:"Context Name",observable:"Observable",assetType:"Asset Type",startTime:"Start Time",startDate:"Start Date",principal:"Username"},titles:{changeEmailAddress:"Change email address",downloadCertificateChangeEmail:"Important!",areYouSure:"Are you sure?"},labels:{agreementLevel:"Agreement Level",agreementType:"Agreement Type",agreementTemplates:"Agreement Templates",agreementTemplate:"agreement Template",warning:"Warning",username:"Username",password:"Password",newPassword:"New password",newPasswordConfirmation:"New password confirmation",btnLogin:"Login",textLogin:"Already signed up?",textReturnToLogin:"Return to login",linkLogin:"Login",textRegister:"New to k.LAB?",linkRegister:"Sign up",btnRegister:"Register",btnAccept:"Accept",btnCancel:"Cancel",btnClose:"Close",btnDeleteAgreementTemplates:"Delete agreement templates",deleteAgreementTemplate:"Delete agreement templates",btnGoogle:"Sign in with Google",btnNewAgreementTemplate:"Add New",btnSetPassword:"Set password",forgotPassword:"Forgot password?",btnResetPassword:"Reset password",btnUpdateAgreementTemplate:"Update agreement",defaultGroups:"Default groups",defaultDuration:"Default duration",defaultTemplate:"Default template",email:"Email",currentEmail:"Current email",accountHeader:"Account information",groupsHeader:"Groups",personalHeader:"Personal data",acceptEULA:"Accept",declineEULA:"Decline",changePasswordConfirmation:"Change",firstName:"First name",lastName:"Last name",middleName:"Middle initial",address:"Address",addressPlaceholder:"Address, city, state/region, postal code, country",phone:"Phone number",affiliation:"Affiliation",jobTitle:"Job title",updateProfileBtn:"Update profile",yes:"Yes",no:"No",notice:"Notice",registrationDate:"Registration date",lastLogin:"Last login",sendUpdates:"Send updates",groups:"Groups",roles:"Roles",queries:"Queries ",users:"users",editUser:"Edit user {username}",deleteUser:"Delete user {username}",tasks:"tasks",roleAdministrator:"Administrator",roleDataManager:"Data manager",roleUser:"User",roleSystem:"System",roleUnknown:"Unknown role",rolesAll:"All roles",groupsAll:"All groups",groupsAny:"Any group",noGroups:"Without groups assigned",accountStatus:"Status",statusActive:"Active",statusInactive:"Inactive",statusPendingActivation:"Pending",statusVerified:"Verified",filterBy:"Filter by:",filterInfo:"Showing {filtered} {element}: {number}",filterInfoQueries:"Showing {filtered} queries: {number}",filtered:"filtered",selectedInfo:"Applying action to {selected} of {total} {type}(s)",all:"all",pagination:"{firstRowIndex} - {endRowIndex} of {totalRowsNumber}",queriesFrom:"Queries made from",queriesTo:"Queries made to",lastConnectionFrom:"Engine connection from",lastConnectionTo:"Engine connection to",hasLastConnection:"Without engine connections",registrationDateFrom:"Register from",registrationDateTo:"Register to",hasRegistrationDate:"Without registration date",updateField:"Update field",lastLoginFrom:"Last login from",lastLoginTo:"Last login to",hasLastLogin:"Without last login",forProfit:"For profit",goToDashboard:"Go to dashboard",groupName:"Name",groupDescription:"Description",groupIcon:"Icon",groupProjectUrls:"Project urls",groupProjectUrl:"Project url",howToProjectUrls:"Add or delete project urls",groupObservables:"Observables",groupRoleRequirement:"Role Requirement",groupDependsOn:"Dependencies",groupNoValue:"No value",groupWorldView:"World view",groupComplimentary:"Complimentary",groupDefaultExpirationTime:"Default expiration time",groupMaxUpload:"Max upload (bytes)",groupSshKey:"Ssh key",groupCustomProperties:"Custom properties",groupSubscribed:"Subscribed",groupUnsubscribed:"Unsubscribed",groupOptIn:"Opt-in groups",groupOptionOptIn:"Opt-in",groupNoOptin:"Groups",newEmail:"New email",newEmailConfirmation:"New email confirmation",institution:"Institution",nonProfit:"Non Profit",selectGroupButtonDefault:"Select",availableGroups:"Available Groups",expireDate:"Until",sendVerificationEmail:"Update email",taskStatusPending:"Pending",taskStatusError:"Error",taskId:"Id",taskUser:"User",taskIssued:"Issued",taskClosed:"Closed",taskRoleRequirement:"Role requirement",taskAutoAccepted:"Auto accepted",taskAccepted:"Task accepted",taskStatusAccepted:"Accepted",taskStatusDenied:"Denied",taskDenied:"Task denied",taskNext:"Next tasks",taskNoNext:"No",taskType:"Type",taskTypeAll:"All types",taskDescription:"Description",taskStatusLog:"Status and log",taskStatus:"Status",taskStatusAll:"All statuses",taskIssuedFrom:"Issued from",taskIssuedTo:"Issued to",taskClosedFrom:"Closed from",taskClosedTo:"Closed to",taskOpen:"Only open tasks",taskGroupRequest:"Group request",taskCreateGroup:"Create group",taskRemoveGroupRequest:"Remove group",taskTypeUnknown:"Unknown type",text:"Text",toogleDefaultTemplate:"Default template?",refreshUsers:"Refresh users",refreshQueries:"Refresh queries",refreshTasks:"Refresh tasks",refreshGroups:"Refresh groups",refreshNodes:"Refresh nodes",refreshAgreementTemplates:"Refresh agreement templates",applyFilters:"Apply filters",clearSearch:"Clear search",noDataAvailable:"No data has been found",selectAll:"Select all",unselectAll:"Unselect all",lastConnection:"Last connection",actionsGroups:"Groups actions",assignGroups:"Assign groups",removeGroups:"Remove groups",actionsOthers:"Other actions",actionsNodes:"Nodes actions",sendEmail:"Send email",emailSenders:"From",emailRecipients:"To",emailSubject:"Subject",emailContent:"Content",emailType:"Type",sendingToUsers:"Send email to {users} users",forceSend:"{users} users doesn't want receiving news. Send to them too?",requestGroups:"Groups request",requestGroupsText:"This groups require administrator approval.",requestGroupsButton:"Request",createGroup:"Create new group",updateGroup:"Update group",editGroup:"Edit group",deleteGroup:"Delete group",submitForm:"Submit",cancelForm:"Cancel",addObservable:"New observable",acceptTask:"Accept selected tasks",denyTask:"Deny selected tasks",nodeName:"Node name",nodeEmail:"Contact",nodeUrl:"URL",nodeGroups:"Groups",cancelNodeForm:"Cancel",createNode:"Create node",updateNodeForm:"Update node",createNodeForm:"Create new node",editEmail:"Edit email address",chkOptIn:"Opt in",chkComplimentary:"Complimentary",chkWorldView:"World view",editObservable:"Edit observable",associatedObservables:"Associated observables",howToObservables:"Select an item to move, edit or delete it",observableToStart:"First observable",observableToEnd:"Last observable",observableLabel:"Label",observableIsSeparator:"Is separator",observableObservable:"Observable",observableSemantic:"Semantic",observableDescription:"Description",observableState:"State",observableExtendedDescription:"Extended description",observableAdd:"New observable",stateForthcoming:"Forthcoming",stateExperimental:"Experimental",stateNew:"New",stateStable:"Stable",stateBeta:"Beta",stateDemo:"Demo",observableInsertionPoint:"Insertion point",observableInsertFirst:"First",observableInsertLast:"Last",day:"day",month:"month",year:"year",key:"Key",value:"Value",visible:"Visible",ok:"OK",cancel:"CANCEL",delete:"DELETE",dismiss:"Dismiss",queryAssetNameGroupCount:"Asset Name Group Count",queryAsset:"Asset",queryOutcomeGroupCount:"Outcome Group Count",queryOutcomeAggregate:"Outcome Aggregate",queryContextNameCount:"Context Name Count",queryTimeRange:"Time Range",registrationRange:"Registrations",queryQueriesPer:"Queries per Time Interval",queryRequestsPerUser:"Requests per User",user:"User",updateEmailTitle:"Update email address",validDate:"Valid date",updateEmailAddress:"Update email address",yearMonth:"Registrations per Month",yearYear:"Registrations per Year",monthAccumulation:"Accumulated registrations per Month",yearAccumulation:"Accumulated registrations per Year",newProperty:"New property",editProperty:"Edit property"},messages:{agreementTemplateDefaultTemplate:"Only can be one default template by type and level. If you choose this agreement template as default, the others with the same type and level must be checked as false.",agreementTemplatesLoaded:"Agreement templates loaded",agreementTemplatesLoadedError:"Error loading agreement templates",agreementTemplateDeleted:"Agreemente template deleted",agreementTemplateDeletedError:"Error deleting agreement template",agreementTemplateCreated:"Agreement template created",agreementTemplateCreatedError:"Error creating agreement template",agreementTemplateUpdated:"Agreement template updated",agreementTemplateUpdatedError:"Error updating agreement template",dialogCancelAgreeemet:"If you do not accept the agreement and acknowledge this message, you will be logged out.",emailChangeVerification:'Please enter your new email address and click "update email". A verification email will be sent to the new address when you login again. Click the URL verification email to complete your new email update.',emailChangeVerificationInfo:"*Please note that you have to log out and verify the new email to see the changes.",emailConfirmationError:"Email addresses must be equals",emailChanged:"Email changed",emailChangedError:"There was an error, email is not changed",emailAlreadyChanged:"The email is already changed",genericError:"There was an error, please try later",networkError:"Network error",fieldRequired:"Field required",passwordValidationError:"Password must be between 8 and 32 characters",passwordUnableToDo:"Unable to change user password",passwordChanged:"Password changed",passwordChangedError:"There was an error, password is not changed",passwordMailError:"There wan an error sending confirmation email, password is changed",passwordDoesNotMatch:"Password does not match the password verification field",changingPassword:"Changing password",downloadingCertificate:"Downloading certificate",errorGeneratingCertificate:"Error generating certificate, please try later",refreshingUsers:"Refreshing users",usersLoaded:"Users loaded",usersLoadedError:"Error loading users",queriesLoaded:"Queries loaded",queriesLoadedError:"Error loading queries",queriesNull:"Query response is null",userStatsLoaded:"User statistics loaded",userStatsLoadedError:"Error loading user statistics",noPendingTasks:"There are no pending tasks",groupsLoaded:"Groups loaded",groupsLoadedError:"Error loading groups",groupDeleted:"Group {group} deleted",groupDeletedError:"Error deleting group {group}",groupCreated:"Group {group} created",groupCreatedError:"Error creating group {group}",groupUpdated:"Group {group} updated",groupUpdatedError:"Error updating group {group}",notDeletableGroup:"It's not possible to delete this group because {reason}",notDeletableGroupWorldview:"is a worldview",notDeletableGroupWaiting:"is loading",notDeletableGroupHasUsers:"has users",noAvailableGroups:"No more available groups",confirm:"Confirm",confirmRemoveGroupMsg:"Are you sure you want permanently delete the group {group}?",confirmRemoveElementMsg:"Are you sure you want permanently delete the {element} {elementName}?",confirmRemoveTitle:"Delete",confirmRemoveProjectUrlMsg:"Are you sure you want permanently delete this project url?",confirmRemoveObservableMsg:"Are you sure you want permanently delete this observable?",confirmRemoveGroup:"Are you sure you want to ask to be removed from the group {group}?",cautionRemoveUser:"Deleting {element} is irreversible. Please proceed with caution.",requestSent:"Request sent",requestSentError:"Error sending request",noTasks:"There are no tasks in database",emailValidationError:"Invalid email format",usernameFormatLengthError:"Username must be more than 6 characters",usernameFormatValidationError:"Username must contains only letter, numbers and . (period) - (hyphen or dash) _ (underscore)",phoneValidationError:"Phone seems not valid",userPswInvalid:"Bad Username or password",pswInvalid:"Bad password",userAlreadyInUse:"Username or Email already in use!",emailAlreadyInUse:"Email already in use",emailNotModified:"Email must be different than the current one",noGroupsAssigned:"No groups assigned",failed:"Action failed",success:"Action was successful",loadingData:"Loading data",acceptEULA:"I have read and accept the END USER LICENSE AGREEMENT (EULA) for individual non-profit use",mustAcceptEULA:"You must read and accept the EULA to download certificate",changePasswordTitle:"Change password",loggingOut:"Logging out",sendUpdates:"Should we send you important updates and announcements?",profileUpdated:"Profile updated",errorUpdatingProfile:"Error updating profile",errorRegistering:"Error when registering, please try later",errorRegisteringMailExists:"A user with this email address already exists",registeringOk:"Registration is succesful.",resetPasswordOk:"An email has been sent to your mailbox",errorResetPasswordNotFound:"Error resetting password, check the inserted email",errorResetPassword:"Error resetting password, please contact support",errorRegisteringUsersExists:"Username already exists",errorLoadingAvailableGroups:"Error loading available groups",verifiedSuccess:"User verified successfully",verifiedFailure:"Error verifying user",verifiedFailureEmail:"Error verifying user. If you change the password, do you need to change the email again.",updated:"Updated!",unknownDate:"n.a.",errorDateFromTo:"The {type} date from must precede {type} date to",tasksLoaded:"Tasks loaded",tasksLoadedError:"Error loading tasks",taskAccepted:"Accepted",taskDenied:"Denied",taskAcceptedError:"Error accepting task",taskDeniedError:"Error denying task",taskDeniedMessage:"Denied message",usersGroupsAssign:"Group(s) assigned successfully",usersGroupsRemoved:"Group(s) removed successfully",usersGroupsAssignError:"Error assigning groups to users",usersGroupsRemoveError:"Error removing groups to users",usersGroupsAssignConfirm:"Do you want to assign {groupsNumber} groups to {usersNumber} users?",usersGroupsRemoveConfirm:"Do you want to remove {groupsNumber} groups to {usersNumber} users?",userNoSendUpdates:"Note that lines highlighted in yellow indicate that the user does not accept sending updates.",emailSent:"Mail sent",emailWithNoReceipts:"No valid receipts, check if users didn't give permissions",doingThings:"Working...",iconNotValid:"Icon URL is not valid",waitForRenewalAcceptance:"Group renewal already requested, pending acceptance",renewalIsNotNecessary:"Group does not require renewal",askForRenewal:"Renewal required to access group, please request",confirmRemoveMsg:"Are you sure you want to delete?",clickToCopy:"{to-copy}\n(click to copy)",textCopied:"Text copied to clipboard",userDeleted:"User {username} deleted succesfully",adviseNeedCertificateDownload:"As you've updated your email address, we advise you to consider the possibility of needing to download a new certificate to align with this change.",acceptAgreement:"To use kLab, you need to accept the agreement."},contents:{loginPage:"Log into your k.LAB account",registerPage:"Get started with k.LAB",registerPageInfo:"\n
    \n
  • Choose a user name that follows the firstname.lastname pattern using 6 or more characters
  • \n
  • Insert a valid email address to receive a confirmation link
  • \n
\n ",registerContent:'\n

ARIES is an open system where all participants contribute and share knowledge for the common good. For this reason we ask that all accounts are traceable to real people and institutions. Please ensure that:

\n
    \n
  • Your username follows the firstname.lastname pattern, with your real first and last name. All the accounts created from this page are individual. If you need an institutional account (for example to install a public engine) please contact us as this use, while still free for non-profit institutions, is covered by a separate EULA.
  • \n
  • Your email address is traceable to an institution where you work or study and whose non-profit status is verifiable.
  • \n
\n

We actively monitor the registration database and we regularly delete or disable accounts that do not match the above conditions. In addition, attempts to make for-profit use of ARIES products with a non-profit licensing terms will result in permanent exclusion from the registration system and potential legal prosecution according to the\n EULA.

\n

By clicking the acceptance button you agree that the personal data you provide will be processed by ASOCIACIÓN BC3 BASQUE CENTRE FOR CLIMATE CHANGE-KLIMA ALDAKETA IKERGAI with the purpose of\n managing your registration request and your access to the tool. You may exercise your rights on data protection at ARCrights@BC3research.org.\n
Additional information in this respect is available in the EULA

\n ',forgetPasswordText:"

Insert your email address

",forgetPasswordInfo:"We'll send you a message to help you reset your password",forgetPasswordContent:'Please Contact Us if you require any assistance.',homeTitle:"Welcome",homeContent1:"\n

This site is the central authentication hub for all users of the k.LAB semantic web. We support both remote and local use of k.LAB\n through web-based clients and a modeler IDE.

\n

To access the remote clients you can choose one of the web applications available to your user by clicking the corresponding icon below.

\n ",homeContent2:'\n

All applications will use the concepts, data and models available in the k.LAB semantic web.

\n

For a more direct way of using k.LAB, including contributing new knowledge and exploring the knowledge base more in detail,\n you can install a local engine and the Integrated development environment (k.Modeler).

\n

These are available as a software download, managed through a small application named the k.LAB Control Center.\n Please download the Control Center software package from here.

\n

To run the engine you will require a certificate, which you can download (for non-profit use only)\n from the Profile menu (use the link Download certificate on the left menu).

\n\n ',downloadTitle:"",downloadContent:"",certificateTitle:"Certificate",certificateContentBeforeEULA:'\n

By downloading the certificate, you are accepting the END USER LICENSE AGREEMENT (EULA) for individual non-profit use.

\n

Individual non-profit EULA characteristics:

\n
    \n
  • This EULA gives you access to the data and models served via our semantic web for non-profit purposes
  • \n
  • For other purposes please get in touch with us at integratedmodelling.org
  • \n
  • Access is granted via individual and non-transferable certificates, which are valid for 1 year
  • \n
  • User maintains the ownership of newly created data and models, but has the option to grant the right to operate them via our semantic web
  • \n
\n

In addition and outside the EULA, the USER may obtain an open source license of the k.Lab SOFTWARE under the terms of the\n Affero General Public License 3.0\n or any higher version through the website integratedmodelling.org, which will allow you to exploit the k.Lab SOFTWARE under the terms of that license.

\n ',certificateContentAfterEULA:'\n

Clarification: the EULA regulates the access and use of the k.LAB system hosted in the BC3 INFRASTRUCTURE, including the semantic web of data, models powered by the SOFTWARE, and other data and resources made available to the USER through the BC3 INFRASTRUCTURE.\n See the complete terms of use here.

\n ',adminHomeTitle:"Administration",adminHomeContent:"\n

This page enables the management of k.LAB.

\n

Select an option from the left menu.

\n ",adminUsersTitle:"Users",adminGroupsTitle:"Groups",adminTasksTitle:"Tasks",adminAgreementTemplatesTitle:"Agreement Templates",adminNodesTitle:"Nodes",placeholderAgreementText:"Add agreement template's text",statsHomeTitle:"Statistics",statsHomeContent:"\n

This page is for extracting useful statistics from the k.labs server.

\n

Start making queries from the left menu.

\n ",downloadCertificateChangeEmail:`As you've updated your email address, we advise you to consider the possibility of needing to download a new certificate to align with this change. This certificate will authenticate your device and is necessary to continue using the local engine.`},text:{changeEmail:"If you want to update the email address, please, set your actual password.",changeEmailUpdate:"Voila! You have successfully update the email address."}}}).call(this,s("4362"))},"9b2f":function(e,t,s){"use strict";s("29cb")},"9e5b":function(e,t,s){},"9e60":function(e,t,s){"use strict";s("3b09")},a6aa:function(e,t,s){},a90d:function(e,t,s){},b0a0:function(e,t,s){},b5be:function(e,t,s){},b96f:function(e,t,s){},baf1:function(e,t,s){"use strict";s("b0a0")},bb03:function(e,t,s){"use strict";s("c1d6")},bd3a:function(e,t,s){"use strict";s("a6aa")},c14d:function(e,t,s){e.exports=s.p+"img/marker-icon-success.eb603235.png"},c1d6:function(e,t,s){},cd23:function(e,t,s){"use strict";var a=function(){var e=this,t=e._self._c;return t("main",{staticClass:"kdc-container"},[e.menuItems.length>0?t("div",{staticClass:"kdc-menu-container fixed full-height"},[t("div",{staticClass:"kdc-menu"},e._l(e.menuItems,(function(s,a){return t("div",{key:a,staticClass:"kdc-menu-item"},[t("router-link",{staticClass:"kh-link",attrs:{to:{name:s.route},"active-class":"disabled",custom:""}},[e._v(e._s(s.label))])],1)})),0)]):e._e(),t("div",{staticClass:"kdc-content",class:[0===e.menuItems.length&&"kdc-no-menu"]},[e._t("default")],2)])},o=[],r={name:"KhubDefaultContainer",props:{menuItems:{type:Array,default:()=>[]}},data(){return{}},methods:{}},i=r,l=(s("4dcc"),s("2877")),n=Object(l["a"])(i,a,o,!1,null,null,null);t["a"]=n.exports},d782:function(e,t,s){"use strict";s("9e5b")},d856:function(e,t,s){},e9fb:function(e,t,s){},f439:function(e,t,s){},f594:function(e,t,s){"use strict";s("58e0")}}); \ No newline at end of file +(function(e){function t(t){for(var a,o,l=t[0],n=t[1],c=t[2],u=0,d=[];ue.isAuthenticated,authStatus:e=>e.isAuthenticated,existProfile:e=>e.existProfile,profile:e=>e.profile,agreement:e=>e.agreement,username:e=>e.profile&&e.profile.name,profileIsLoad:e=>"undefined"!==typeof e.profile.name,needPassword:e=>e.needPassword,admin:e=>e.profile.roles.includes("ROLE_ADMINISTRATOR"),notifications:e=>e.notifications},ae={AUTH_SUCCESS(e,{token:t,profile:s}){e.isAuthenticated=!0,e.status="success",e.token=t,e.profile=s,e.agreement=s.agreements[0].agreement},AUTH_ERROR(e,t){e.status="error",e.statusError=t},LOGOUT(e){e.isAuthenticated=!1,e.status="",e.token="",e.profile={roles:[],groups:[]},e.clickback=""},AUTH_PROFILE_EXIST(e,t){e.existProfile=t},AUTH_PROFILE(e,t){e.profile=t,e.agreement=t.agreements[0].agreement,e.profileLoaded=!0},groups_request_success(e){e.status="success"},groups_request_failure(e){e.status="error"},CERT_REQUEST_SUCCESS(e){e.status="success"},CERT_REQUEST_FAILURE(e){e.status="error"},EMAIL_REQUEST_SUCCESS(e){e.status="success",e.clickback=clickback},EMAIL_REQUEST_FAILURE(e){e.status="failure",e.clickback=""},PASSWORD_REQUEST_SUCCESS(e,t){e.status="success",e.clickback=t},PASSWORD_REQUEST_FAILURE(e){e.status="success",e.clickback=""},PASSWORD_SET_SUCCESS(e){e.status="success",e.clickback=""},PASSWORD_SET_FAILURE(e){e.status="failure",e.clickback=""},REGISTER_SUCCESS(e){e.status="success"},REGISTER_FAILURE(e){e.status="failure"},ACTIVATE_SUCCESS(e,{profile:t,clickback:s}){e.status="success",e.profile=t,e.clickback=s},ACTIVATE_FAILURE(e){e.status="failure"},NOTIFICATIONS_LOADED(e,t){e.status="success",e.notifications=t}},oe=(s("88a7"),s("271a"),s("5494"),s("cee4")),re=s("7cca");const ie=oe["a"].create({baseUrl:__ENV__.BASE_URL,headers:{"Content-Type":"application/json"}});var le=({Vue:e})=>{e.prototype.$http=ie;const t=localStorage.getItem(re["g"].TOKEN);t&&(e.prototype.$http.defaults.headers.common.Authorization=re["g"].BEARER+t)},ne=(s("14d9"),s("bc78")),ce=s("8847"),ue=s("8c4f"),de=s("1dce"),pe=s.n(de),me=function(){var e=this,t=e._self._c;return t("div",[t("q-layout",{staticClass:"kh-layout-page",style:{opacity:e.loggingOut?0:1},attrs:{view:"lHr lpr lfr"}},[t("q-header",{staticClass:"bg-white text-black",attrs:{bordered:""}},[t("q-toolbar",{staticClass:"bg-white text-grey-8 kh-toolbar",attrs:{id:"kh-toolbar"}},[t("q-avatar",[t("klab-spinner",{attrs:{"store-controlled":!0,size:50,ball:4,wrapperId:"kh-toolbar",ballColor:e.COLORS.PRIMARY}})],1),t("klab-brand",{attrs:{customClasses:["kh-app-name "]}}),t("div",{staticClass:"kh-menu"},e._l(e.filteredMenu,(function(s,a){return t("div",{key:`kh-menu-${a}`,staticClass:"kh-menu-item"},[s.route&&null!==s.route?t("router-link",{attrs:{to:{name:s.route},custom:""},scopedSlots:e._u([{key:"default",fn:function({route:a,navigate:o}){return[t("q-btn",{class:[e.isRouteActive(a)?"disabled":""],attrs:{to:a,label:s.label,disable:s.route===e.$route.name,flat:""},on:{click:function(t){e.isRouteActive(a)}}})]}}],null,!0)}):t("q-btn",{attrs:{type:"a",target:s.target,href:s.href,flat:""}},[e._v(e._s(s.label)),"_blank"===s.target?t("q-icon",{staticClass:"q-ma-xs",attrs:{name:"mdi-open-in-new",size:"1em",color:"primary"}}):e._e()],1)],1)})),0),t("q-space"),e._l(e.links,(function(s,a){return t("div",{key:`kh-link-${a}`,staticClass:"kh-link-container"},[t("a",{staticClass:"kh-link",style:{"border-bottom-color":s.color?s.color:e.COLORS.MAIN_COLOR,color:s.color?s.color:e.COLORS.MAIN_COLOR},attrs:{href:s.url,title:s.title,target:"_blank"}},[s.icon?t("i",{class:s.icon}):e._e(),s.img?t("img",{style:{...s.imgWidth&&{width:s.imgWidth}},attrs:{src:s.img,alt:s.title||s.label}}):e._e(),t("span",{domProps:{innerHTML:e._s(s.label)}})])])})),t("q-btn",{staticClass:"small-round",attrs:{round:"",flat:"",icon:"mdi-logout"},on:{click:e.logout}})],2)],1),t("q-page-container",[t("transition",{attrs:{name:"fade",mode:"out-in"}},[t("router-view")],1)],1),t("klab-loading",{attrs:{loading:e.loading,message:""}})],1),t("SignAgreement",{attrs:{open:e.open,agreementText:e.agreementText,register:e.register},on:{"update:open":function(t){e.open=t}}})],1)},he=[],ge=function(){var e=this,t=e._self._c;return t("div",{staticClass:"ks-container"},[t("div",{staticClass:"ks-inner",style:{width:`${e.size}px`,height:`${e.size}px`}},[t("svg",{staticClass:"ks-spinner",attrs:{width:e.size,height:e.size,viewBox:"-120 -120 250 250",version:"1.1",xmlns:"http://www.w3.org/2000/svg"}},[t("g",[t("path",{style:{fill:e.computedLogoColor},attrs:{d:"m -16.409592,-90.96723 c -12.731141,3.59794 -48.295273,15.083119 -67.807071,61.025834 -14.253345,33.488415 -9.270515,65.732442 11.486766,85.52103 11.762457,11.070564 26.293601,22.141638 56.460848,18.543704 0,0 0.413685,11.899764 -28.646647,13.421956 -0.138604,0 -0.137607,-6.24e-4 -0.275681,0.13782 0.691951,0.415268 1.521665,0.830861 2.213562,1.24598 24.355214,8.579676 40.6831588,-6.365553 50.7850434,-21.44918 0,0 15.4987796,14.53115 2.7676326,32.935946 -0.1386,0.27668 0.0019,0.55137 0.278385,0.55137 4.289845,-0.1386 8.441295,-0.55133 12.454363,-1.24328 44.974093,-8.71801 79.015461,-48.29683 79.015461,-95.761805 -0.13859,-23.524924 -8.303479,-44.973534 -22.003241,-61.717741 -2.629265,3.459554 -14.666883,17.988557 -31.549442,15.497686 -50.9245092,-7.611015 -64.486968,15.914431 -64.763747,43.45242 -0.276678,22.971358 -12.178682,33.349477 -12.178682,33.349477 -15.775524,14.253336 -47.880078,1.384892 -41.514544,-45.94168 4.843361,-36.53279 27.953112,-63.239411 53.968907,-76.385668 l -1.659498,-1.108134 c 0,0 1.105979,-2.075735 0.967585,-2.075735 z M 9.7451084,5.900034 c 1.2454676,0 2.3541156,1.105994 2.3541156,2.351411 0,1.245462 -1.108648,2.354112 -2.3541156,2.354112 -1.2454064,0 -2.3514093,-1.10865 -2.3514093,-2.354112 0,-1.245417 1.1060029,-2.351411 2.3514093,-2.351411 z"}})])]),t("div",{staticClass:"ks-circle-container",class:{moving:e.moving},style:{width:`${e.size}px`,height:`${e.size}px`,padding:`${e.circleContainerPadding}px`}},[t("svg",{staticClass:"ks-circle-path",style:{"margin-top":-e.ball+"px"},attrs:{width:2*e.ball,height:2*e.ball,version:"1.1",xmlns:"http://www.w3.org/2000/svg"}},[t("circle",{staticClass:"ks-ball",style:{fill:e.computedBallColor},attrs:{cx:e.ball,cy:e.ball,r:e.ball}})])])])])},be=[],fe={props:{size:{type:Number,default:200},ball:{type:Number,default:12},color:{type:String,default:ne["a"].getBrand("k-main")},logoColor:{type:String,default:re["n"].SPINNER_ELEPHANT_DEFAULT_COLOR},ballColor:{type:String,default:ne["a"].getBrand("primary")},stroke:{type:String,default:"none"},animated:{type:Boolean,default:!0},storeControlled:{type:Boolean,default:!0},wrapperId:{type:String,required:!0}},computed:{...Object(W["c"])("view",["spinner"]),circleContainerPadding(){return this.size*re["o"].WHITE_SPACE_PERCENTAGE},computedLogoColor(){return this.storeControlled&&this.spinner.logoColor||this.logoColor},computedBallColor(){return this.storeControlled&&this.spinner.ballColor||this.ballColor},moving(){return this.storeControlled?this.spinner.animated:this.animated},errorMessage(){return this.spinner.errorMessage},isVisible(){let e;return null!==this.wrapperId&&(e=document.getElementById(this.wrapperId),!(!e||null==e||!e.style)&&!("none"===e.style.display))}},methods:{getBrand(e){return ne["a"].getBrand(e)}},watch:{errorMessage(e){if(this.spinner.showNotifications&&this.isVisible&&null!==e){let t;t=e instanceof Error?e.message:e,this.$q.notify({message:t,color:"negative",timeout:1e3})}}}},Ee=fe,ve=(s("85d2"),Object(X["a"])(Ee,ge,be,!1,null,"186b76c9",null)),ke=ve.exports,_e=function(){var e=this,t=e._self._c;return t("q-dialog",{attrs:{"no-esc-dismiss":"","no-backdrop-dismiss":""},model:{value:e.loading,callback:function(t){e.loading=t},expression:"loading"}},[t("div",{staticClass:"absolute-center kh-loading"},[t("q-spinner",{attrs:{size:"4em"}}),""!==e.computedMessage?t("div",[e._v(e._s(e.computedMessage))]):e._e()],1)])},Te=[],we={name:"KlabLoading",props:{message:{type:String,default:null},loading:{type:Boolean,required:!0}},data(){return{}},computed:{computedMessage(){return this.message||this.$t("messages.loadingData")}}},ye=we,Ce=(s("3c75"),s("eebe")),Se=s.n(Ce),Ae=Object(X["a"])(ye,_e,Te,!1,null,null,null),qe=Ae.exports;Se()(Ae,"components",{QDialog:x["a"],QSpinner:U["a"]});var Oe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"app-name",class:e.customClasses,domProps:{innerHTML:e._s(e.htmlAppName)}})},Re=[],$e={appName:"k.Hub",appDescription:"k.Hub",appColor:"#0088ff"},Pe={props:{customClasses:Array,default:()=>[]},data(){return{appName:$e.appName,appColor:$e.appColor}},computed:{htmlAppName(){return this.appName.replace(".",`.`)}}},Ne=Pe,xe=(s("60e3"),Object(X["a"])(Ne,Oe,Re,!1,null,null,null)),Ue=xe.exports,Ie=[{name:"aries",label:"ARIES",img:"https://integratedmodelling.org/statics/logos/aries-logo.svg",imgWidth:"16px",title:"ARIES",url:"https://aries.integratedmodelling.org",color:"rgb(70,161,74)"},{name:"integratedModelling",label:"Integrated Modelling",img:"https://integratedmodelling.org/statics/logos/klab-logo-2020.svg",imgWidth:"16px",title:"Integrated Modelling",url:"https://integratedmodelling.org",color:"#666"},{name:"confluence",img:"https://integratedmodelling.org/statics/logos/confluence-logo.svg",label:"Confluence",title:"Integrated modelling confluence",url:"https://integratedmodelling.org/confluence",color:"rgb(7,71,166)"},{name:"bitbucket",img:"https://integratedmodelling.org/statics/logos/bitbucket-logo.svg",label:"Bitbucket",title:"Bitbucket repositories",url:"https://bitbucket.org/integratedmodelling/workspace/projects/",color:"rgb(7,71,166)"}];const Le=[{name:"home",label:ce["b"].tc("menu.home"),route:"home"},{name:"profile",label:ce["b"].tc("menu.profile"),route:"profileView"},{name:"adminHome",label:ce["b"].tc("menu.admin"),route:"adminHome",admin:!0},{name:"stats",label:ce["b"].tc("menu.stats"),route:"stats",admin:!0}],De=[{name:"profile",label:ce["b"].tc("menu.profile"),route:"profileView"},{name:"groups",label:ce["b"].tc("menu.groups"),route:"groupView"},{name:"certificate",label:ce["b"].tc("menu.certificate"),route:"certificate"}],Ge=[{name:"users",label:ce["b"].tc("menu.users"),route:"adminUsers"},{name:"groups",label:ce["b"].tc("menu.groups"),route:"adminGroups",disabled:!0},{name:"tasks",label:ce["b"].tc("menu.tasks"),route:"adminTasks"},{name:"agreementTemplate",label:ce["b"].tc("menu.agreementTemplates"),route:"adminAgreementTemplates"}],Me=[{name:"queries",label:ce["b"].tc("menu.queries"),route:"statsQueries"},{name:"userStats",label:ce["b"].tc("menu.userStats"),route:"userStats"},{name:"observationMap",label:ce["b"].tc("menu.observationMap"),route:"observationMap"}];var Qe=s("15a2");const je={url:re["g"].URL,realm:re["g"].REALM,clientId:re["g"].CLIENT_ID,enableCors:!0},Fe=new Qe["a"](je),Be={install(e){e.$keycloak=Fe}};Be.install=e=>{e.$keycloak=Fe,Object.defineProperties(e.prototype,{$keycloak:{get(){return Fe}}})},a["a"].use(Be);var Ve=Be;const Ye=Object.freeze({SUCCESS:"SUCCESS",ERROR:"ERROR",WARNING:"WARNING",INFO:"INFO"});var Ke=Ye;const We=Object.freeze({USER:"USER",GROUP:"GROUP"});var He=We;const ze=Object.freeze({downloadCertificateChangeEmail:"downloadCertificateChangeEmail"});var Xe=ze,Ze=function(){var e=this,t=e._self._c;return t("q-dialog",{model:{value:e.open,callback:function(t){e.open=t},expression:"open"}},[t("q-card",[t("q-card-section",{staticClass:"row items-center"},[t("q-banner",{staticClass:"bg-yellow-1",staticStyle:{"margin-top":"1em","margin-bottom":"1.5em"},attrs:{rounded:"",dense:""}},[t("div",{staticClass:"justify-start q-gutter-xs",staticStyle:{"font-size":"12px"}},[t("i",{staticClass:"mdi mdi-24px mdi-alert text-k-yellow"}),t("span",[e._v(e._s(e.$t("messages.acceptAgreement")))])])]),t("div",{staticClass:"q-ml-sm",domProps:{innerHTML:e._s(this.agreementText)}})],1),t("q-card-actions",{attrs:{align:"right"}},[t("q-btn",{attrs:{flat:"",label:e.$t("labels.btnCancel"),color:"k-main"},on:{click:e.cancel}}),t("q-btn",{attrs:{label:e.$t("labels.btnAccept"),color:"k-main"},on:{click:e.submit}})],1)],1)],1)},Je=[],et={name:"SignAgreement",props:["open","agreementText","register"],computed:{},methods:{submit(){this.$store.dispatch("auth/register",this.register).then((()=>{this.$q.notify({message:this.$t("messages.registeringOk"),color:"positive"}),this.$store.dispatch("auth/getProfile")})).catch((e=>{409===e.status||400===e.status?this.$q.notify({message:e.message,color:"negative"}):this.$q.notify({message:this.$t("messages.errorRegistering"),color:"negative"})})),this.$store.commit("keycloak/SIGN_AGREEMENT"),this.close()},cancel(){this.$q.dialog({title:this.$t("labels.notice"),message:this.$t("messages.dialogCancelAgreeemet"),ok:{color:"k-controls",push:!0,flat:!0},cancel:{color:"k-controls",push:!0,flat:!0},persistent:!0}).onOk((()=>{this.$store.dispatch("auth/logout")}))},close(){this.$emit("update:open",!1)}}},tt=et,st=s("54e1"),at=Object(X["a"])(tt,Ze,Je,!1,null,null,null),ot=at.exports;Se()(at,"components",{QDialog:x["a"],QCard:q["a"],QCardSection:M["a"],QBanner:st["a"],QCardActions:Q["a"],QBtn:p["a"]}),a["a"].use(Ve);var rt={name:"Default",components:{KlabSpinner:ke,KlabBrand:Ue,KlabLoading:qe,SignAgreement:ot},data(){return{tab:"",menu:Le,links:Ie,COLORS:re["e"],loggingOut:!1,open:!1,register:{email:"",username:"",agreementType:"USER",agreementLevel:"NON_PROFIT"},agreementText:""}},computed:{...Object(W["c"])("view",["spinnerColor","isConnectionDown"]),loading:{get(){return this.loggingOut||!this.$store.getters["auth/profileIsLoad"]},set(){}},loadingMessage(){return this.loggingOut?this.$t("messages.loggingOut"):this.$t("messages.loadingData")},filteredMenu(){return this.menu.filter((e=>!e.admin||this.$store.getters["auth/admin"]))}},methods:{getStartPath(e){if(e&&""!==e){const t=e.lastIndexOf("/");return 0===t?e:e.substring(0,t)}return""},isRouteActive(e){return this.getStartPath(this.$router.currentRoute.path)===this.getStartPath(e.path)},logout(){this.loggingOut=!0,setTimeout((()=>{this.$store.dispatch("auth/logout")}),500)}},beforeMount(){setTimeout((()=>{this.$store.getters["keycloak/isAuthenticated"]&&this.$store.dispatch("auth/getAgreementTemplate",{agreementType:this.register.agreementType,agreementLevel:this.register.agreementLevel}).then((e=>{this.agreementText=e.agreementTemplate.text}))}),500)},mounted(){this.$store.dispatch("view/setSpinner",{...re["o"].SPINNER_STOPPED,owner:"layout"},{root:!0}),this.$store.getters["auth/profileIsLoad"]||setTimeout((()=>{a["a"].$keycloak.loadUserProfile().then((e=>{this.$store.commit("keycloak/AUTH_KEYCLOAK",e),this.$store.getters["auth/profileLoaded"]||this.$store.dispatch("auth/getProfile").then((t=>{if(console.log(t),204===t.status&&this.agreementText)console.debug("First login in kHub"),this.register.username=e.username,this.register.email=e.email,this.open=!0,this.$store.commit("keycloak/SIGN_AGREEMENT");else if(t.email&&t.email!==e.email){console.debug("Email has change");const s={type:Ke.WARNING,iTagElement:He.USER,iTagElementId:t.id,name:Xe.downloadCertificateChangeEmail,title:"",message:"",visible:!0};this.$store.dispatch("auth/createNotification",s),t.email=e.email,this.$store.dispatch("auth/updateProfile",t),this.$store.dispatch("auth/getNotifications",{username:t.name})}})).catch((()=>{this.$store.dispatch("auth/logout")}))}))}),700)},beforeRouteUpdate(e,t,s){t.path===e.path?s(!1):s()}},it=rt,lt=(s("6751"),Object(X["a"])(it,me,he,!1,null,null,null)),nt=lt.exports;Se()(lt,"components",{QLayout:r["a"],QHeader:i["a"],QToolbar:u["a"],QAvatar:A["a"],QBtn:p["a"],QIcon:m["a"],QSpace:$["a"],QPageContainer:n["a"]});var ct=function(){var e=this,t=e._self._c;return t("khub-default-container",{attrs:{"menu-items":e.menuItems}},[t("User",{attrs:{profile:e.profile,admin:!1}}),t("klab-loading",{attrs:{loading:e.waiting,message:e.$t("messages.doingThings")}})],1)},ut=[],dt=s("cd23"),pt={methods:{fieldRequired(e){return!!e||this.$t("messages.fieldRequired")},emailValidation(e){return er.email.test(e)||this.$t("messages.emailValidationError")},usernameValidation(e,t=re["d"].USERNAME_MIN_LENGTH){return er.username.test(e)?e.length>=t||this.$t("messages.usernameFormatLengthError"):this.$t("messages.usernameFormatValidationError")},passwordValidation(e,t=re["d"].PSW_MIN_LENGTH,s=re["d"].PSW_MAX_LENGTH){return e.length>=t&&e.length<=s||this.$t("messages.passwordValidationError")},phoneValidation(e,t=!1){return!(t||"undefined"!==typeof e&&null!==e&&""!==e)||(er.phone.test(e)||this.$t("messages.phoneValidationError"))}}},mt=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"full-width row"},[t("div",{staticClass:"col kp-col kh-headers"},[t("h3",{staticClass:"kh-h-first"},[e._v(e._s(e.$t("labels.accountHeader")))]),t("div",{staticClass:"kp-content col"},[t("div",{staticClass:"row kp-text-row"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.username")))]),t("div",{staticClass:"kd-field col"},[e._v(e._s(e.profile.name))])]),t("div",{staticClass:"row kp-text-row"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.roles")))]),t("div",{staticClass:"kd-field col"},e._l(e.profile.roles,(function(s,a){return t("div",{key:a},[t("div",{staticClass:"ka-roles-icon"},[t("q-icon",{attrs:{name:e.roles[s].icon}},[t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0]}},[e._v(e._s(e.roles[s].name))])],1)],1)])})),0)]),t("div",{staticClass:"row kp-text-row"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.email")))]),e.admin?t("div",{staticClass:"kd-field col"},[t("q-input",{ref:"email",attrs:{color:"k-main",dense:"",placeholder:e.$t("labels.email"),rules:[t=>!t||0===t.length||e.emailValidation(t)],"no-error-icon":"",autocomplete:"email"},model:{value:e.profile.email,callback:function(t){e.$set(e.profile,"email",t)},expression:"profile.email"}})],1):e._e(),e.admin?e._e():t("div",{staticClass:"kd-field col"},[e._v(e._s(e.profile.email))])]),t("div",{staticClass:"row kp-text-row"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.registrationDate")))]),t("div",{staticClass:"kd-field col",class:{"ka-not-available":!e.profile.registrationDate},domProps:{innerHTML:e._s(e.formatDate(e.profile.registrationDate))}})]),t("div",{staticClass:"row kp-text-row"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.lastConnection")))]),t("div",{staticClass:"kd-field col",class:{"ka-not-available":!e.profile.lastConnection},domProps:{innerHTML:e._s(e.formatDate(e.profile.lastConnection))}})])]),t("h3",{staticClass:"kp-header row"},[e._v(e._s(e.$t("labels.personalHeader")))]),t("div",{staticClass:"kp-content col"},[t("div",{staticClass:"row kp-input-row items-baseline justify-start"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.firstName")))]),t("div",{staticClass:"kd-field col"},[t("q-input",{ref:"first-name",attrs:{color:"k-main",dense:"",placeholder:e.$t("labels.firstName"),rules:[t=>!e.checking||e.fieldRequired(t)],"no-error-icon":"",autocomplete:"given-name",autofocus:"",disable:!e.admin},model:{value:e.profile.firstName,callback:function(t){e.$set(e.profile,"firstName",t)},expression:"profile.firstName"}})],1)]),t("div",{staticClass:"row kp-input-row items-baseline justify-start"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.lastName")))]),t("div",{staticClass:"kd-field col"},[t("q-input",{ref:"last-name",attrs:{color:"k-main",dense:"",placeholder:e.$t("labels.lastName"),rules:[t=>!e.checking||e.fieldRequired(t)],"no-error-icon":"",autocomplete:"family-name",disable:!e.admin},model:{value:e.profile.lastName,callback:function(t){e.$set(e.profile,"lastName",t)},expression:"profile.lastName"}})],1)]),t("div",{staticClass:"row kp-input-row items-baseline justify-start"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.middleName")))]),t("div",{staticClass:"kd-field col"},[t("q-input",{ref:"middle-name",staticClass:"q-field--with-bottom",attrs:{color:"k-main",dense:"",placeholder:e.$t("labels.middleName"),autocomplete:"middle-name",disable:!e.admin},model:{value:e.profile.initials,callback:function(t){e.$set(e.profile,"initials",t)},expression:"profile.initials"}})],1)]),t("div",{staticClass:"row kp-input-row items-baseline justify-start"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.address")))]),t("div",{staticClass:"kd-field col"},[t("q-input",{ref:"address",staticClass:"q-field--with-bottom",attrs:{color:"k-main",dense:"",placeholder:e.$t("labels.addressPlaceholder"),autocomplete:"street-address",disable:!e.admin},model:{value:e.profile.address,callback:function(t){e.$set(e.profile,"address",t)},expression:"profile.address"}})],1)]),t("div",{staticClass:"row kp-input-row items-baseline justify-start"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.phone")))]),t("div",{staticClass:"kd-field col"},[t("q-input",{ref:"phone",attrs:{color:"k-main",dense:"",placeholder:e.$t("labels.phone"),rules:[t=>!e.checking||!t||0===t.length||e.phoneValidation(t)],"no-error-icon":"",autocomplete:"tel",disable:!e.admin},model:{value:e.profile.phone,callback:function(t){e.$set(e.profile,"phone",t)},expression:"profile.phone"}})],1)]),t("div",{staticClass:"row kp-input-row items-baseline justify-start"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.affiliation")))]),t("div",{staticClass:"kd-field col"},[t("q-input",{ref:"affiliation",staticClass:"q-field--with-bottom",attrs:{color:"k-main",dense:"",placeholder:e.$t("labels.affiliation"),disable:!e.admin},model:{value:e.profile.affiliation,callback:function(t){e.$set(e.profile,"affiliation",t)},expression:"profile.affiliation"}})],1)]),t("div",{staticClass:"row kp-input-row items-baseline justify-start"},[t("div",{staticClass:"kd-label"},[e._v(e._s(e.$t("labels.jobTitle")))]),t("div",{staticClass:"kd-field col"},[t("q-input",{ref:"job-title",staticClass:"q-field--with-bottom",attrs:{color:"k-main",dense:"",placeholder:e.$t("labels.jobTitle"),autocomplete:"organization-title",disable:!e.admin},model:{value:e.profile.jobTitle,callback:function(t){e.$set(e.profile,"jobTitle",t)},expression:"profile.jobTitle"}})],1)])]),e.admin?e._e():t("div",{staticClass:"kp-send-updates row q-mt-xs"},[t("q-checkbox",{attrs:{color:"k-main",label:e.$t("messages.sendUpdates")},model:{value:e.profile.sendUpdates,callback:function(t){e.$set(e.profile,"sendUpdates",t)},expression:"profile.sendUpdates"}})],1)]),t("div",{staticClass:"col kp-col kh-headers"},[t("h3",{staticClass:"kp-header row",staticStyle:{"margin-top":"0px"}},[e._v(e._s(e.$t("labels.groupCustomProperties")))]),t("KhubCustomPropertiesEditableTable",{attrs:{customProperties:this.profile.customProperties,type:"USER",admin:e.admin}})],1)]),t("div",{staticClass:"row kp-update-btn justify-end q-mb-md q-mr-md"},[e.admin?t("q-btn",{attrs:{label:e.$t("labels.btnClose"),color:"k-red",tabindex:"55"},on:{click:e.closeDialog}}):e._e(),t("q-btn",{attrs:{color:"k-main",label:e.$t("labels.updateProfileBtn"),disabled:!e.modified&&!e.admin},on:{click:e.updateProfile}}),e.isExternalLink?t("a",e._b({attrs:{href:e.to,target:"_blank"}},"a",e.$attrs,!1),[e._t("default")],2):t("router-link",e._b({attrs:{custom:""},scopedSlots:e._u([{key:"default",fn:function({isActive:s,href:a,navigate:o}){return[t("a",e._b({class:s?e.activeClass:e.inactiveClass,attrs:{href:a},on:{click:o}},"a",e.$attrs,!1),[e._t("default")],2)]}}],null,!0)},"router-link",e.$props,!1))],1)])},ht=[],gt=s("c1df"),bt=s.n(gt),ft=function(){var e=this,t=e._self._c;return t("q-input",{ref:"dateInput",class:e.classes,attrs:{color:e.color,rules:[t=>e.validateDate(t)],dense:e.dense,clearable:"",label:e.label,disable:e.disable,tabindex:e.tabindex},on:{blur:function(t){return e.formatDate()},clear:function(t){return e.formatDate()}},scopedSlots:e._u([{key:"append",fn:function(){return[e.modelChange&&!e.$refs["dateInput"].hasError?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-check",title:e.$t("labels.updateField")},on:{click:function(t){return e.formatDate()}}}):e._e(),t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-calendar"}},[t("q-popup-proxy",{ref:"popupProxy",attrs:{"transition-show":"scale","transition-hide":"scale"}},[t("q-date",{attrs:{mask:"DD-MM-YYYY",minimal:""},on:{input:e.changeDate},model:{value:e.dateValue,callback:function(t){e.dateValue=t},expression:"dateValue"}})],1)],1)]},proxy:!0}]),model:{value:e.dateValue,callback:function(t){e.dateValue=t},expression:"dateValue"}})},Et=[],vt={name:"KInputDate",props:{value:String,classes:String,dense:String,label:{type:String,required:!0},color:String,disable:{type:Boolean,default:!1},tabindex:{type:[String,Number],default:-1},rule:{type:Function,default:()=>{}}},data(){return{dateValue:this.value,modelChange:!1}},methods:{reset(){this.dateValue=null,this.$emit("input",this.dateValue),this.$nextTick((()=>{this.modelChange=!1}))},changeDate(){this.$refs.popupProxy.hide(),this.formatDate(!0)},generateMomentDate(e=!1){if(""===this.dateValue)return this.dateValue=null,null;if(null===this.dateValue)return null;const t=bt()(this.dateValue,e?"DD-MM-YYYY":["L","MM/DD/YYYY","YYYY/MM/DD","DD/MM/YYYY"]);return t},validateDate(){const e=this.generateMomentDate();return null===e||e.isValid()},formatDate(e=!1){const t=this.generateMomentDate(e);null!==t&&t.isValid()&&(this.dateValue=t.format("L")),this.$emit("input",this.dateValue),this.$nextTick((()=>{this.modelChange=!1}))}},watch:{dateValue(){this.modelChange=!0}}},kt=vt,_t=Object(X["a"])(kt,ft,Et,!1,null,null,null),Tt=_t.exports;Se()(_t,"components",{QInput:E["a"],QIcon:m["a"],QPopupProxy:y["a"],QDate:w["a"]});var wt=function(){var e=this,t=e._self._c;return t("div",[t("q-btn",{attrs:{icon:"mdi-pencil",color:"k-controls",round:"",size:"sm",disabled:"active"!==e.profile.accountStatus},on:{click:function(t){return e.openDialog()}}},[t("q-tooltip",{attrs:{anchor:"bottom middle",self:"top middle",offset:[0,8],delay:600}},[e._v(e._s(e.$t("labels.editEmail")))])],1),t("q-dialog",{model:{value:e.show,callback:function(t){e.show=t},expression:"show"}},[t("q-card",{attrs:{bordered:""}},[t("form",{attrs:{autocomplete:"on"},on:{submit:function(t){return t.preventDefault(),e.doChange()}}},[t("q-card-section",[t("div",{staticClass:"row"},[t("h5",{staticClass:"q-px-md q-my-xs"},[e._v(e._s(e.$t("labels.updateEmailTitle")))]),t("q-space"),t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{icon:"close",flat:"",round:"",dense:""}})],1)]),t("q-separator"),t("q-card-section",[t("div",{staticClass:"q-px-md q-py-xs q-item-label q-item__label--caption"},[t("div",{staticClass:"text-caption",staticStyle:{"line-height":"1.2em"}},[e._v("\n "+e._s(e.$t("messages.emailChangeVerification"))+"\n ")])]),t("div",{staticClass:"q-px-md q-py-xs q-gutter-sm"},[t("q-banner",{staticClass:"bg-teal-1 q-item__label--caption",attrs:{rounded:"",dense:""}},[t("div",{staticClass:"text-caption"},[e._v("\n "+e._s(e.$t("messages.emailChangeVerificationInfo"))+"\n ")])])],1),t("div",{staticClass:"row justify-center"},[t("div",{staticClass:"col-9"},[t("input",{staticStyle:{display:"none"},attrs:{type:"text",name:"username",autocomplete:"username"},domProps:{value:e.username}}),t("q-input",{ref:"mail-input",staticClass:"kh-input",attrs:{color:"k-main",rules:[t=>0===t.length&&!e.checking||this.emailConfirmValidation("email",t)],"no-error-icon":"","min-length":"8","max-length":"32",type:e.isPwd?"email":"text",placeholder:e.$t("labels.newEmail"),autocomplete:"current-email",autofocus:""},scopedSlots:e._u([{key:"prepend",fn:function(){return[t("q-icon",{attrs:{name:"mdi-email"}})]},proxy:!0}]),model:{value:e.email,callback:function(t){e.email=t},expression:"email"}}),t("q-input",{ref:"conf-input",staticClass:"kh-input",attrs:{icon:"mdi-email",color:"k-main",rules:[t=>0===t.length&&!e.checking||this.emailConfirmValidation("confirm",t)],"no-error-icon":"","min-length":"8","max-length":"32",type:e.isPwdConfirm?"email":"text",placeholder:e.$t("labels.newEmailConfirmation"),autocomplete:"current-email"},scopedSlots:e._u([{key:"prepend",fn:function(){return[t("q-icon",{attrs:{name:"mdi-email"}})]},proxy:!0}]),model:{value:e.emailConfirmation,callback:function(t){e.emailConfirmation=t},expression:"emailConfirmation"}})],1)])]),t("q-card-actions",{staticClass:"q-mb-lg",attrs:{align:"center"}},[t("q-btn",{attrs:{label:e.$t("labels.sendVerificationEmail"),color:"k-controls",type:"submit",disabled:this.buttonDisable()}})],1)],1)])],1),t("klab-loading",{attrs:{loading:e.waiting,message:e.$t("messages.doingThings")}})],1)},yt=[],Ct={name:"ChangePassword",components:{KhubDefaultContainer:dt["a"],KlabLoading:qe},props:["profile"],mixins:[pt],data(){return{menuItems:De,isPwd:!0,isPwdConfirm:!0,changingPassword:!1,checking:!1,show:!1,emailData:"",emailConfirmation:"",waiting:!1}},computed:{email:{get(){return this.emailData},set(e){this.emailData=e}},username(){return this.$store.getters["auth/username"]},profileIsLoad(){return this.$store.getters["auth/profileIsLoad"]}},methods:{openDialog(){const e=this.$store.getters["keycloak/profile"];console.log(e),this.show=!0},resetValidation(e){e.target.resetValidation()},buttonDisable(){return this.email&&this.$refs["mail-input"].hasError||this.emailConfirmation&&this.$refs["conf-input"].hasError},emailConfirmValidation(e,t){return"email"==e?er.email.test(t)||this.$t("messages.emailValidationError"):er.email.test(t)?!this.email||0===this.email.length||(t===this.email||this.$t("messages.emailConfirmationError")):this.$t("messages.emailValidationError")},doChange(){this.$refs["mail-input"].validate(),this.$refs["conf-input"].validate(),this.$refs["mail-input"].hasError||this.$refs["conf-input"].hasError||(this.waiting=!0,this.email===this.emailConfirmation?this.$store.dispatch("keycloak/getAccount",{email:this.email}).then((()=>{this.waiting=!1,this.show=!1})).catch((e=>{this.waiting=!1,this.$q.notify({message:e.message})})):this.$q.notify({message:this.$t("messages.emailDoesNotMatch"),color:"negative"}))}},watch:{email(){this.$refs["conf-input"].validate()}}},St=Ct,At=(s("bb03"),Object(X["a"])(St,wt,yt,!1,null,null,null)),qt=At.exports;Se()(At,"components",{QBtn:p["a"],QTooltip:R["a"],QDialog:x["a"],QCard:q["a"],QCardSection:M["a"],QSpace:$["a"],QSeparator:O["a"],QItemLabel:f["a"],QItem:g["a"],QBanner:st["a"],QInput:E["a"],QIcon:m["a"],QCardActions:Q["a"]}),Se()(At,"directives",{ClosePopup:F["a"]});var Ot=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"q-app"}},[t("q-item",[t("q-item-section",["USER"!==e.type?t("q-item-label",[e._v(e._s(e.$t("labels.groupCustomProperties")))]):e._e()],1),t("q-item-section",{staticClass:"col-1",attrs:{side:""}},[e.admin?t("q-btn",{staticClass:"gfc-buttons",attrs:{icon:"mdi-plus",round:"",color:"k-controls",size:"xs"},on:{click:function(t){return e.newitem()}}}):e._e()],1),t("q-item-section",{staticClass:"col-1",attrs:{side:""}},[t("q-btn",{staticClass:"gfc-buttons",attrs:{disable:1!==e.selected.length,icon:"mdi-pencil",round:"",color:e.admin?"k-main":"k-controls",size:"xs"},on:{click:e.editItem}})],1),t("q-item-section",{attrs:{side:""}},[e.admin?t("q-btn",{staticClass:"gfc-buttons",attrs:{disable:0===e.selected.length,icon:"mdi-trash-can",round:"",color:"k-red",size:"xs"},on:{click:e.deleteItem}}):e._e()],1)],1),t("q-item",[t("q-item-section",[t("div",{staticClass:"q-pa-sm q-gutter-sm"},[t("q-table",{attrs:{flat:"",bordered:"",dense:"",data:this.customProperties,columns:this.columns,"row-key":"name",separator:"cell","hide-bottom":"","wrap-cells":"","auto-width":"","rows-per-page-options":[0],"visible-columns":e.visibleColumns},on:{"row-click":e.onRowClick},scopedSlots:e._u([{key:"body",fn:function(s){return[t("q-tr",{staticClass:"cursor-pointer",class:-1!=e.selected.indexOf(s.row)?"selected":"",attrs:{props:s},on:{click:function(t){return e.onRowClick(s.row)}}},[t("q-td",{key:"key",attrs:{props:s}},[e._v("\n "+e._s(s.row.key)+"\n ")]),t("q-td",{key:"value",attrs:{props:s}},[e._v(e._s(s.row.value))]),e.admin?t("q-td",{key:"onlyAdmin",attrs:{props:s}},[t("q-btn",{attrs:{size:"sm",round:"",dense:"",flat:"",icon:s.row.onlyAdmin?"check":"close"}})],1):e._e()],1)]}}])})],1)])],1),t("div",{staticClass:"q-pa-sm q-gutter-sm"},[t("q-dialog",{model:{value:e.show_dialog,callback:function(t){e.show_dialog=t},expression:"show_dialog"}},[t("q-card",{staticStyle:{width:"600px","max-width":"80vw"}},[t("q-card-section",[t("div",{staticClass:"kh-headers-dialog"},[t("h5",{staticClass:"q-my-xs"},[e._v(e._s(this.dialogTitle))])])]),t("q-card-section",[t("div",{staticClass:"row q-col-gutter-sm"},[t("div",[t("q-select",{staticStyle:{width:"13rem"},attrs:{outlined:"","use-input":"","hide-selected":"","fill-input":"","input-debounce":"0",options:e.options,label:e.$t("labels.key"),"new-value-mode":"add-unique","hide-dropdown-icon":"",color:"k-controls",disable:this.update,error:e.error.key.showError,"error-message":e.error.key.errorMessage},on:{filter:e.filterFn,"new-value":e.createValue,blur:e.handleBlur},model:{value:this.editedItem.key,callback:function(t){e.$set(this.editedItem,"key",t)},expression:"this.editedItem.key"}})],1),t("div",[t("q-input",{attrs:{outlined:"",label:e.$t("labels.value"),color:"k-controls",error:e.error.value.showError,"error-message":e.error.value.errorMessage},on:{blur:e.handleBlurValue},model:{value:e.editedItem.value,callback:function(t){e.$set(e.editedItem,"value",t)},expression:"editedItem.value"}})],1),t("div",[e.admin?t("q-checkbox",{ref:"customProperty-onlyAdmin",staticClass:"q-pa-sm",attrs:{color:"k-controls",label:e.$t("labels.visible")},model:{value:e.editedItem.onlyAdmin,callback:function(t){e.$set(e.editedItem,"onlyAdmin",t)},expression:"editedItem.onlyAdmin"}}):e._e()],1)])]),t("q-separator",{attrs:{spaced:""}}),t("q-card-actions",{attrs:{align:"right"}},[t("q-btn",{attrs:{flat:"",label:e.$t("labels.cancel"),color:"k-red"},on:{click:e.close}}),t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{label:e.$t("labels.ok"),color:"k-controls",disable:!e.error.key.valid||!e.error.value.valid},on:{click:e.addRow}})],1)],1)],1)],1)],1)},Rt=[],$t={name:"KhubCustomPropertiesEditableTable",props:["customProperties","type","admin"],data(){return{defaultItem:{key:"",value:"",onlyAdmin:!1},editedItem:{key:"",value:"",onlyAdmin:""},selected:[],open:!1,columns:[{name:"key",required:!0,label:this.$t("labels.key"),align:"left",field:e=>e.key,format:e=>`${e}`,sortable:!0,classes:"ellipsis",style:"max-width: 12rem",rules:e=>""===e||"Value can not be empty"},{name:"value",required:!0,align:"left",label:this.$t("labels.value"),field:e=>e.value,sortable:!0,classes:"ellipsis",style:"max-width: 12rem"},{name:"onlyAdmin",align:"center",label:this.$t("labels.visible"),field:e=>e.onlyAdmin,style:"width:6em",sortable:!0}],defaultOptions:this.getCustomProperties,options:this.defaultOptions,modelAddUnique:null,createNewValue:!1,update:!1,show_dialog:!1,error:{key:{valid:!1,showError:!1,errorMessage:""},value:{valid:!1,showError:!1,errorMessage:""},onlyAdmin:{valid:!1,showError:!1,errorMessage:""}},dialogTitle:""}},computed:{visibleColumns(){let e=["key","value"];return this.admin&&e.push("onlyAdmin"),e}},methods:{...Object(W["b"])("admin",["loadCustomProperties","createNewCustomPropertyKey"]),newitem(){this.update=!1,this.defaultOptions=this.getCustomProperties(this.type),this.dialogTitle=this.$t("labels.newProperty"),this.show_dialog=!0},addRow(){this.createNewValue&&this.createNewCustomPropertyKey({type:this.type,name:this.editedItem.key}),this.editedIndex>-1?Object.assign(this.customProperties[this.editedIndex],this.editedItem):this.customProperties?this.customProperties.push(this.editedItem):this.customProperties=[this.editedItem],this.close()},deleteItem(){this.$q.dialog({title:this.$t("messages.confirmRemoveTitle"),message:this.$t("messages.confirmRemoveMsg"),ok:{color:"k-controls"},cancel:{color:"k-red"},persistent:!0}).onOk((()=>{this.deleteConfirm()}))},deleteConfirm(){this.selected.map((e=>{const t=this.customProperties.findIndex((t=>t.key===e.key));return this.customProperties.splice(t,1),null})),this.selected=[]},editItem(){this.error.key.valid=!0,this.error.value.valid=!0,this.error.onlyAdmin.valid=!0,this.update=!0,this.editedIndex=this.selected[0].index,this.editedItem=Object.assign({},this.selected[0]),this.dialogTitle=this.$t("labels.editProperty"),this.show_dialog=!0},close(){this.show_dialog=!1,this.resetValidation(),setTimeout((()=>{this.editedItem=Object.assign({},this.defaultItem),this.editedIndex=-1}),300)},onRowClick(e){e.index=this.customProperties.indexOf(e),-1===this.selected.indexOf(e)?this.selected.push(e):this.selected.splice(this.selected.indexOf(e),1)},getCustomProperties(e){this.loadCustomProperties(e).then((e=>(this.customProperties?this.defaultOptions=e.data.filter((e=>!this.customProperties.map((e=>e.key)).includes(e.name))):this.defaultOptions=e.data,this.defaultOptions)))},filterFn(e,t,s){e.length<2?s():t((()=>{const t=e.toLowerCase();this.defaultOptions&&(this.options=this.defaultOptions.map((e=>e.name)).filter((e=>e.toLowerCase().indexOf(t)>-1)))}))},createValue(e,t){this.createNewValue=!0,t(e,"add-unique")},handleBlur(e){this.editedItem.key=e.target.value,this.keyValidation()},handleBlurValue(){""===this.editedItem.value?(this.error.value.valid=!1,this.error.value.showError=!0,this.error.value.errorMessage="This field must be required."):(this.error.value.valid=!0,this.error.value.showError=!1,this.error.value.errorMessage="")},updateCustomProperties(e){this.customProperties=e},keyValidation(){if(""===this.editedItem.key)this.error.key.valid=!1,this.error.key.showError=!0,this.error.key.errorMessage="This field must be required.";else{const e=/^[A-Z]+(?:_[A-Z]+)*$/,t=e.test(this.editedItem.key);t?(this.error.key.valid=!0,this.error.key.showError=!1,this.error.key.errorMessage=""):(this.error.key.valid=!1,this.error.key.showError=!0,this.error.key.errorMessage="Please enter a valid key. Only avoid mayus and underscore.")}},resetValidation(){this.error.key.showError=!1,this.error.key.valid=!1,this.error.value.showError=!1,this.error.value.valid=!1,this.error.onlyAdmin.valid=!1}}},Pt=$t,Nt=Object(X["a"])(Pt,Ot,Rt,!1,null,null,null),xt=Nt.exports;Se()(Nt,"components",{QItem:g["a"],QItemSection:b["a"],QItemLabel:f["a"],QBtn:p["a"],QTable:I["a"],QTr:D["a"],QTd:L["a"],QDialog:x["a"],QCard:q["a"],QCardSection:M["a"],QSelect:k["a"],QInput:E["a"],QCheckbox:T["a"],QSeparator:O["a"],QCardActions:Q["a"]}),Se()(Nt,"directives",{ClosePopup:F["a"]});var Ut={name:"UsersComponent",props:["profile","admin"],components:{KInputDate:Tt,KlabLoading:qe,ChangeEmail:qt,KhubCustomPropertiesEditableTable:xt},mixins:[pt],data(){return{roles:re["l"],refreshing:!1,waiting:!1,modified:!1,checking:!1,mail:{mail:"",confirmMail:""},errorConfirmMail:{show:!1,message:"message"}}},computed:{...Object(W["c"])("admin",["groups","groupsIcons"])},methods:{...Object(W["b"])("admin",["loadUser","loadUsers","resetUser"]),updateProfile(){if(this.admin){if(this.checking=!0,this.$refs["first-name"].validate(),this.$refs["last-name"].validate(),this.$refs.phone.validate(),this.checking=!1,this.$refs["first-name"].hasError||this.$refs["last-name"].hasError||this.$refs.phone.hasError)return;this.waiting=!0,this.$store.dispatch("auth/updateProfile",this.profile).then((()=>{this.closeDialog(),this.$q.notify({message:this.$t("messages.profileUpdated"),color:"positive"}),this.waiting=!1,this.loadUser()})).catch((e=>{console.error(`Problem updating profile: ${e.message}`),-1!==e.message.toLowerCase().indexOf("duplicated key")?this.$q.notify({message:this.$t("messages.emailAlreadyInUse"),color:"warning"}):this.$q.notify({message:this.$t("messages.errorUpdatingProfile"),color:"negative"}),this.waiting=!1}))}else window.open(re["g"].URL+"/"+re["t"].WS_KEYCLOAK,"_blank")},formatDate:ar,confirm(e,t,s,a){this.$q.dialog({title:e,message:t,ok:{color:"k-controls",push:!0,flat:!0},cancel:{color:"k-controls",push:!0,flat:!0},persistent:!0}).onOk((()=>{s()})).onCancel((()=>{a()}))},copyTextToClipboard(e,t){e.stopPropagation(),mr(t),this.$q.notify({message:this.$t("messages.textCopied"),type:"info",icon:"mdi-information",timeout:500})},closeDialog(){this.$emit("closeDialog",!1)}},watch:{profile:{handler(){this.modified=!0},deep:!0}},created(){bt.a.locale(this.$q.lang.getLocale())},mounted(){}},It=Ut,Lt=(s("baf1"),s("8572")),Dt=Object(X["a"])(It,mt,ht,!1,null,null,null),Gt=Dt.exports;Se()(Dt,"components",{QIcon:m["a"],QTooltip:R["a"],QInput:E["a"],QField:Lt["a"],QCheckbox:T["a"],QBtn:p["a"],QChip:_["a"],QAvatar:A["a"]});var Mt={name:"ProfileView",components:{KhubDefaultContainer:dt["a"],KlabLoading:qe,User:Gt},mixins:[pt],data(){return{menuItems:De,updated:[],waiting:!1,show_dialog:!1,ROLES:re["l"]}},computed:{profile(){return this.$store.getters["auth/profile"]}},methods:{openDialog(){this.show_dialog=!0}},created(){this.$store.dispatch("auth/getProfile")},watch:{}},Qt=Mt,jt=Object(X["a"])(Qt,ct,ut,!1,null,null,null),Ft=jt.exports,Bt=function(){var e=this,t=e._self._c;return t("khub-default-container",{attrs:{"menu-items":e.menuItems}},[t("h4",{staticClass:"kp-header row kh-h-first"},[e._v(e._s(e.$t("labels.groupOptIn")))]),e.profileGroupEntries.length>0?[t("div",{staticClass:"row justify-center"},[t("div",{staticClass:"col-md-5 col-xs-12"},[t("span",[e._v(e._s(e.$t("labels.groupUnsubscribed")))]),t("draggable",e._b({staticClass:"list-group",attrs:{id:"unsubscribe",tag:"ul"},on:{start:function(t){e.drag=!0},end:function(t){e.drag=!1},change:function(t){return e.onAdd(t,"unsubscribe")}},model:{value:e.availableOptInGroups,callback:function(t){e.availableOptInGroups=t},expression:"availableOptInGroups"}},"draggable",e.dragOptions,!1),[t("transition-group",{attrs:{type:"transition",name:"flip-list"}},e._l(e.availableOptInGroups,(function(s){return t("q-list",{key:`${s.order}-${s.name.group.name}-availableOptInGroupsList`,staticClass:"list-group-item",attrs:{padding:"",dense:""}},[t("KhubGroupList",{key:`${s.order}-${s.name.group.name}-availableOptInGroups`,attrs:{groups:s,emptyVisible:e.availableOptInGroupsEmpty,emptyMessage:e.$t("messages.noAvailableGroups")}})],1)})),1)],1)],1),t("div",{staticClass:"col-md-5 offset-md-1 col-xs-12"},[t("span",[e._v(e._s(e.$t("labels.groupSubscribed")))]),t("draggable",e._b({attrs:{id:"subscribe",entry:"span"},on:{start:function(t){e.drag=!0},end:function(t){e.drag=!1},change:function(t){return e.onAdd(t,"subscribe")}},model:{value:e.profileOptInGroups,callback:function(t){e.profileOptInGroups=t},expression:"profileOptInGroups"}},"draggable",e.dragOptions,!1),[t("transition-group",{staticClass:"list-group",attrs:{name:"no",tag:"ul"}},e._l(e.profileOptInGroups,(function(s){return t("q-list",{key:`${s.order}-${s.name.group.name}-profileOptInGroupsList`,staticClass:"list-group-item",attrs:{id:`${s.order}-profileOptInGroupsList`,padding:"",dense:""}},[t("KhubGroupList",{key:`${s.order}-${s.name.group.name}-profileOptInGroups`,attrs:{groups:s,updateVisible:"true",emptyVisible:e.profileOptInGroupsEmpty,emptyMessage:e.$t("messages.noGroupsAssigned")},on:{updatedGroup:e.updateGroup}})],1)})),1)],1)],1)])]:[t("div",{staticClass:"kp-no-group",domProps:{innerHTML:e._s(e.$t("messages.noGroupsAssigned"))}})],t("h3",{staticClass:"kp-header row"},[e._v(e._s(e.$t("labels.groupNoOptin")))]),[t("div",{staticClass:"row justify-start"},[t("div",{staticClass:"col-md-12"},[e._l(e.profileNotOptInGroups,(function(s){return t("q-list",{key:`${s.order}-profileNotOptInGroupsList`,staticClass:"list-group-item",attrs:{padding:"",dense:""}},[t("KhubGroupList",{key:`${s.order}-profileNotOptInGroups`,attrs:{groups:s,deleteVisible:"true",updateVisible:"true"},on:{removedGroup:e.removeGroup,updatedGroup:e.updateGroup}})],1)})),t("div",{staticClass:"kp-make-request q-ma-lg"},[t("q-btn",{staticClass:"float-right",attrs:{icon:"mdi-account-multiple-plus",color:"k-controls",label:e.$t("labels.requestGroups")},on:{click:e.loadAvailableGroups}}),t("q-dialog",{model:{value:e.request,callback:function(t){e.request=t},expression:"request"}},[t("q-card",{staticClass:"ka-dialog"},[t("q-card-section",{staticClass:"ka-dialog-title"},[e._v(e._s(e.$t("labels.requestGroups")))]),t("q-separator"),t("q-card-section",{staticClass:"q-pa-xs"},[t("q-list",[e.availableGroupsForRequest.length>0?[t("q-item",[t("q-item-section",[t("q-item-label",[e._v(e._s(e.$t("labels.requestGroupsText")))])],1)],1),t("q-item",[t("q-item-section",[t("q-item-label",[e._v(e._s(e.$t("labels.updateAvailableGroups")))])],1)],1),t("q-item",[t("q-item-section",e._l(e.availableGroupsForRequest,(function(s){return t("q-list",{key:s.order,staticClass:"list-group-item",attrs:{padding:"",dense:""}},[t("KhubGroupList",{key:"availableGroupsForRequest",attrs:{groups:s,checkBoxVisible:"true"},on:{checkClicked:e.handleCheck}})],1)})),1)],1)]:[t("q-item",[t("q-item-section",[t("strong",[e._v(e._s(e.$t("messages.noAvailableGroups")))])])],1)],t("q-item",[t("q-item-section",{staticClass:"absolute-bottom-right q-ma-sm"},[t("div",[0!==e.availableGroupsForRequest.length?[t("q-btn",{attrs:{color:"k-controls",label:e.$t("labels.requestGroupsButton")},on:{click:e.requestGroups}}),t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{color:"k-red",label:e.$t("labels.btnCancel")}})]:[t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{color:"k-controls",label:e.$t("labels.btnClose")}})]],2)])],1)],2)],1)],1)],1)],1)],2)])],t("klab-loading",{attrs:{loading:e.waiting,message:e.$t("messages.doingThings")}})],2)},Vt=[],Yt=function(){var e=this,t=e._self._c;return t("div",["Empty"===e.entry.name.group.name?t("div",{directives:[{name:"show",rawName:"v-show",value:!e.emptyVisible,expression:"!emptyVisible"}]},[t("q-item",[t("q-item-section",{attrs:{avatar:""}}),t("q-item-section",[t("q-item-label",{staticClass:"label-italic",attrs:{caption:""}},[e._v(e._s(e.emptyMessage))])],1)],1)],1):t("div",[t("q-item",{key:e.entry.name.group.name,staticClass:"app-custom-item",attrs:{"data-id":e.entry.name.group.name}},[e.checkBox?t("div",[t("q-item-section",{attrs:{side:"",top:""}},[t("q-checkbox",{staticClass:"q-pa-xs q-ma-none",attrs:{val:e.entry.name.group.name,color:"k-controls"},on:{input:function(t){return e.handleCheck(e.requesting,e.entry.name.group.name)}},model:{value:e.requesting,callback:function(t){e.requesting=t},expression:"requesting"}})],1)],1):e._e(),t("q-item-section",{attrs:{avatar:""}},[e.entry.name.group.iconUrl?t("img",{attrs:{valign:"middle",src:e.entry.name.group.iconUrl,title:e.entry.name.group.groupName,alt:e.entry.name.group.groupName,width:"30"}}):t("span",{staticClass:"ka-no-group-icon ka-medium",attrs:{title:e.entry.name.group.groupName}},[e._v(e._s(e.entry.name.group.name.charAt(0).toUpperCase()))])]),t("q-item-section",[t("q-item-label",[e._v(e._s(e.entry.name.group.name))]),t("q-item-label",{attrs:{caption:""}},[e._v(e._s(e.entry.name.group.description))])],1),e.entry.expiration?t("q-item-section",{attrs:{side:""}},[t("div",{staticClass:"gt-xs kp-group-expires",class:e.isExpiring(e.entry.expiration,0)?"kp-group-expired":e.isExpiring(e.entry.expiration)?"kp-group-expiring":""},[t("span",[e._v(e._s(e.$t("labels.expireDate"))+": "+e._s(e.formatDate(e.expiration,!0)))])])]):e._e(),t("q-item-section",{attrs:{side:""}},[t("div",{staticClass:"q-gutter-xs"},[e.entry.expiration&&e.updateVisible?t("q-btn",{staticClass:"gt-xs",attrs:{round:"",color:"k-controls",size:"sm",icon:"update",disable:!e.isExpiring(e.entry.expiration)||e.updated.includes(e.entry.name.group.name)},on:{click:function(t){return e.handleUpdate(e.entry.name.group.name)}}},[t("q-tooltip",{attrs:{anchor:"bottom middle",self:"top middle",offset:[0,8],delay:600}},[e.updated.includes(e.entry.name.group.name)?t("span",[e._v(e._s(e.$t("messages.waitForRenewalAcceptance")))]):e.isExpiring(e.entry.expiration)?t("span",[e._v(e._s(e.$t("messages.askForRenewal")))]):t("span",[e._v(e._s(e.$t("messages.renewalIsNotNecessary")))])])],1):e._e(),e.deleteVisible?t("q-btn",{attrs:{disable:(e.entry.name.group.complimentary||e.entry.name.group.worldview)&&!e.entry.name.group.optIn||e.updated.includes(e.entry.name.group.name),round:"",color:"k-red",size:"sm",icon:"delete"},on:{click:function(t){return e.handleRemove(e.entry.name.group.name)}}},[!e.entry.name.group.complimentary&&!e.entry.name.group.worldview||e.entry.name.group.optIn?e._e():t("q-tooltip",{staticClass:"bg-k-red",attrs:{anchor:"bottom middle",self:"top middle",offset:[0,8],delay:600}},[t("span",[e._v(e._s(e.$t("messages.notDeletableGroup",{reason:e.$t("messages.notDeletableGroupWorldview")})))])])],1):e._e()],1)])],1),t("q-separator",{staticClass:"separator-list",attrs:{spaced:"",inset:"item"}}),e.isExpiring(e.entry.expiration)?e._e():t("div")],1)])},Kt=[],Wt={name:"KhubGroupList",props:["groups","checkBoxVisible","deleteVisible","requestVisible","updateVisible","emptyVisible","emptyMessage"],data(){return{defaultItem:{key:"",value:"",onlyAdmin:!1},editedItem:{key:"",value:"",onlyAdmin:""},selected:[],open:!1,entry:this.groups,checkBox:this.checkBoxVisible,requesting:[],updated:[]}},methods:{formatDate:ar,isExpiring(e,t=30){return bt()().diff(e,"day")>-t},handleCheck(e,t){this.$emit("checkClicked",{selected:0!==e.length,name:t})},handleRemove(e){this.$emit("removedGroup",{value:e})},handleUpdate(e){this.$emit("updatedGroup",{value:e})}}},Ht=Wt,zt=(s("4a8e"),Object(X["a"])(Ht,Yt,Kt,!1,null,null,null)),Xt=zt.exports;Se()(zt,"components",{QItem:g["a"],QItemSection:b["a"],QItemLabel:f["a"],QCheckbox:T["a"],QBtn:p["a"],QTooltip:R["a"],QSeparator:O["a"]});var Zt=s("b76a"),Jt=s.n(Zt),es={name:"GroupView",components:{KhubDefaultContainer:dt["a"],KlabLoading:qe,draggable:Jt.a,KhubGroupList:Xt},mixins:[pt],data(){return{menuItems:De,edit:!1,groupAdd:!1,modified:!1,checking:!1,request:!1,requesting:[],updated:[],waiting:!1,editable:!0,drag:!1,availableGroups:[],availableOptInGroupsEmpty:!1,profileOptInGroupsEmpty:!1}},computed:{...Object(W["c"])("auth",["profile"]),profileGroupEntries(){return this.profile&&this.profile.agreements&&this.profile.agreements[0].agreement.groupEntries?this.profile.agreements[0].agreement.groupEntries:[]},availableGroupsForRequest(){return this.availableGroups.filter((e=>!e.group.optIn)).map(((e,t)=>({name:e,order:t+1,fixed:!1})))},availableOptInGroups:{get(){let e=this.availableGroups.filter((e=>e.group.optIn)).map(((e,t)=>({name:e,order:t+1,fixed:!1})));return 0===e.length&&(e=[{order:-1,fixed:!0,name:{group:{name:"Empty"}}}]),e},set(){let e=this.availableGroups.filter((e=>e.group.optIn)).map(((e,t)=>({name:e,order:t+1,fixed:!1})));return 0===e.length&&(e=[{order:-1,fixed:!0,name:{group:{name:"Empty"}}}]),e}},profileOptInGroups:{get(){let e=this.profileGroupEntries.filter((e=>e.group.optIn)).map(((e,t)=>({name:e,order:t+1,fixed:!1})));return 0===e.length&&(e=[{order:-1,fixed:!0,name:{group:{name:"Empty"}}}]),e},set(){let e=this.profileGroupEntries.filter((e=>e.group.optIn)).map(((e,t)=>({name:e,order:t+1,fixed:!1})));return 0===e.length&&(e=[{order:-1,fixed:!0,name:{group:{name:"Empty"}}}]),e}},profileNotOptInGroups(){return this.profileGroupEntries.filter((e=>!e.group.optIn)).map(((e,t)=>({name:e,order:t+1,fixed:!1})))},dragOptions(){return{animation:0,group:"description",disabled:!this.editable,ghostClass:"ghost"}}},methods:{...Object(W["b"])("auth",["getProfile","getGroupsSummary"]),updateAvailableGroups(){return new Promise((e=>{this.getProfile().then((async t=>{const s=t.data;let a=[];if(s.agreements[0].agreement.groupEntries){const e=await this.getGroupsSummary(),t=new Map(s.agreements[0].agreement.groupEntries.map((e=>[e.group.name,e])));a=e.filter((e=>!t.has(e.name))).map((e=>({group:e})))}e(a)}))}))},loadAvailableGroups(){this.waiting=!0,this.getGroupsSummary().then((()=>{this.$nextTick((()=>{this.request=!0,this.waiting=!1}))})).catch((e=>{console.error(`Error loading available groups: ${e.message}`),this.$q.notify({message:this.$t("messages.errorLoadingAvailableGroups"),color:"negative"}),this.waiting=!1}))},handleCheck(e){const t=this.requesting.indexOf(e.name);-1!==t?e.selected||this.requesting.splice(t,1):e.selected&&this.requesting.push(e.name)},requestGroups(){this.waiting=!0,this.$store.dispatch("auth/requestGroups",this.requesting).then((()=>{this.request=!1,this.requesting=[],this.getProfile().then((()=>{this.waiting=!1})),this.$q.notify({message:this.$t("messages.requestSent"),color:"positive"})})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.requestSentError"),color:"negative"}),this.waiting=!1}))},updateGroup(e){this.waiting=!0,this.$store.dispatch("auth/requestGroups",[e]).then((()=>{this.getProfile().then((()=>{this.waiting=!1})),this.$q.notify({message:this.$t("messages.requestSent"),color:"positive"}),this.updated.push(e)})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.requestSentError"),color:"negative"}),this.waiting=!1}))},removeGroup(e){e=e.value,this.$q.dialog({title:this.$t("messages.confirmRemoveTitle"),message:this.$t("messages.confirmRemoveGroup",{group:e}),ok:{color:"k-controls"},cancel:{color:"k-red"},persistent:!0}).onOk((()=>{this.waitin=!0,this.$store.dispatch("auth/removeGroup",[e]).then((()=>{this.getProfile().then((()=>{this.waiting=!1})),this.$q.notify({message:this.$t("messages.requestSent"),color:"positive"}),this.updated.push(e)})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.requestSentError"),color:"negative"})}))}))},formatDate:ar,onAdd(e,t){e.added&&("subscribe"===t?(this.profileOptInGroupsEmpty=!0,this.waiting=!0,this.$store.dispatch("auth/requestGroups",[e.added.element.name.group.name]).then((()=>{this.updateAvailableGroups().then((e=>{this.availableGroups=e,this.waiting=!1}))})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.requestSentError"),color:"negative"}),this.waiting=!1}))):"unsubscribe"===t&&(this.availableOptInGroupsEmpty=!0,this.waiting=!0,this.$store.dispatch("auth/removeGroup",[e.added.element.name.group.name]).then((()=>{this.updateAvailableGroups().then((e=>{this.availableGroups=e,this.waiting=!1}))})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.requestSentError"),color:"negative"}),this.waiting=!1}))))}},watch:{drag(e){e||this.$nextTick((()=>{this.availableOptInGroupsEmpty=!1,this.profileOptInGroupsEmpty=!1}))}},created(){const e=async()=>{this.availableGroups=await this.updateAvailableGroups()};e()}},ts=es,ss=(s("45ff"),Object(X["a"])(ts,Bt,Vt,!1,null,null,null)),as=ss.exports;Se()(ss,"components",{QList:h["a"],QBtn:p["a"],QDialog:x["a"],QCard:q["a"],QCardSection:M["a"],QSeparator:O["a"],QItem:g["a"],QItemSection:b["a"],QItemLabel:f["a"]}),Se()(ss,"directives",{ClosePopup:F["a"]});var os=function(){var e=this,t=e._self._c;return t("khub-default-container",{attrs:{"menu-items":e.menuItems}},[t("div",{staticClass:"kh-cp-container"},[t("h2",{staticClass:"kh-h-first"},[e._v(e._s(e.$t("messages.changePasswordTitle")))]),t("form",{on:{submit:function(t){return t.preventDefault(),e.doChange()}}},[t("input",{staticStyle:{display:"none"},attrs:{type:"text",name:"username",autocomplete:"username"},domProps:{value:e.username}}),t("q-input",{ref:"psw-input",staticClass:"kh-input",attrs:{color:"k-main",rules:[t=>0===t.length&&!e.checking||e.passwordValidation(t)],"no-error-icon":"","min-length":"8","max-length":"32",type:e.isPwd?"password":"text",placeholder:e.$t("labels.newPassword"),autocomplete:"current-password",autofocus:""},scopedSlots:e._u([{key:"prepend",fn:function(){return[t("q-icon",{attrs:{name:"mdi-key"}})]},proxy:!0},{key:"append",fn:function(){return[t("q-icon",{staticClass:"cursor-pointer",attrs:{name:e.isPwd?"mdi-eye-off-outline":"mdi-eye-outline"},on:{mousedown:function(t){e.isPwd=!1},mouseup:function(t){e.isPwd=!0}}})]},proxy:!0}]),model:{value:e.passwordRequest.password,callback:function(t){e.$set(e.passwordRequest,"password",t)},expression:"passwordRequest.password"}}),t("q-input",{ref:"conf-input",staticClass:"kh-input",attrs:{color:"k-main",rules:[t=>0===t.length&&!e.checking||e.passwordValidation(t)],"no-error-icon":"","min-length":"8","max-length":"32",type:e.isPwdConfirm?"password":"text",placeholder:e.$t("labels.newPasswordConfirmation"),autocomplete:"current-password"},scopedSlots:e._u([{key:"prepend",fn:function(){return[t("q-icon",{attrs:{name:"mdi-key"}})]},proxy:!0},{key:"append",fn:function(){return[t("q-icon",{staticClass:"cursor-pointer",attrs:{name:e.isPwdConfirm?"mdi-eye-off-outline":"mdi-eye-outline"},on:{mousedown:function(t){e.isPwdConfirm=!1},mouseup:function(t){e.isPwdConfirm=!0}}})]},proxy:!0}]),model:{value:e.passwordRequest.confirmation,callback:function(t){e.$set(e.passwordRequest,"confirmation",t)},expression:"passwordRequest.confirmation"}}),t("div",{staticClass:"cp-button-container col text-right"},[t("q-btn",{staticClass:"right",attrs:{type:"submit",color:"k-main",label:e.$t("labels.changePasswordConfirmation"),disabled:""===e.passwordRequest.password||""===e.passwordRequest.confirmation}})],1)],1)]),t("klab-loading",{attrs:{loading:e.changingPassword,message:e.$t("messages.changingPassword")}})],1)},rs=[],is={name:"ChangePassword",components:{KhubDefaultContainer:dt["a"],KlabLoading:qe},mixins:[pt],data(){return{menuItems:De,passwordRequest:{password:"",confirmation:""},isPwd:!0,isPwdConfirm:!0,changingPassword:!1,checking:!1}},computed:{username(){return this.$store.getters["auth/username"]},profileIsLoad(){return this.$store.getters["auth/profileIsLoad"]}},methods:{resetValidation(e){e.target.resetValidation()},doChange(){this.checking=!0,this.$refs["psw-input"].validate(),this.$refs["conf-input"].validate(),this.checking=!1,this.$refs["psw-input"].hasError||this.$refs["conf-input"].hasError||(this.passwordRequest.password===this.passwordRequest.confirmation?this.profileIsLoad&&this.username?(this.changingPassword=!0,this.$store.dispatch("auth/requestNewPassword",this.username).then((()=>{console.debug("Token loaded"),this.$store.dispatch("auth/setNewPassword",{passwordRequest:this.passwordRequest}).then((()=>{this.changingPassword=!1,this.$q.notify({message:this.$t("messages.passwordChanged"),color:"positive"})})).catch((e=>{this.changingPassword=!1,console.error(`Error ${e.status} changing password: ${e.message}`),e.message.startsWith("Error sending email")?this.$q.notify({message:this.$t("messages.passwordMailError"),color:"warning"}):this.$q.notify({message:this.$t("messages.passwordChangedError"),color:"negative"})}))})).catch((e=>{console.error(`Problem retrieving token: ${e.message}`),this.changingPassword=!1,this.$q.notify({message:this.$t("messages.passwordUnableToDo"),color:"negative"})}))):(console.error(`Problems loading token: profile is${this.profileIsLoad?"":"n't"} loaded and username is not set`),this.$q.notify({message:"Unable to change user password",color:"negative"})):this.$q.notify({message:this.$t("messages.passwordDoesNotMatch"),color:"negative"}))}},watch:{}},ls=is,ns=(s("d782"),Object(X["a"])(ls,os,rs,!1,null,null,null));ns.exports;Se()(ns,"components",{QInput:E["a"],QIcon:m["a"],QBtn:p["a"]});var cs=function(){var e=this,t=e._self._c;return t("khub-default-container",{attrs:{"menu-items":e.menuItems}},[t("h2",{staticClass:"kh-h-first"},[e._v(e._s(e.$t("contents.certificateTitle")))]),t("div",{domProps:{innerHTML:e._s(e.$t("contents.certificateContentBeforeEULA"))}}),t("h4",{staticClass:"kh-eula-title"},[e._v("k.LAB End user license agreement\n "),t("span",{staticClass:"kh-lang-selection"},[e._v("["),t("em",{staticClass:"kh-link",class:{disabled:"en"===e.eulaLang},on:{click:function(t){e.eulaLang="en"}}},[e._v("English")]),e._v("]\n / ["),t("em",{staticClass:"kh-link",class:{disabled:"es"===e.eulaLang},on:{click:function(t){e.eulaLang="es"}}},[e._v("Español")]),e._v("]")])]),t("div",{staticClass:"kh-eula-container"},[t("iframe",{attrs:{id:"kh-eula",width:"100%",height:"300px",frameBorder:"0",src:`https://integratedmodelling.org/statics/eula/BC3-EULA-Not-For-Profit-Individual_${e.eulaLang.toUpperCase()}.txt`}})]),t("div",{domProps:{innerHTML:e._s(e.$t("contents.certificateContentAfterEULA"))}}),t("div",{staticClass:"row"},[t("div",{staticClass:"col"},[t("q-checkbox",{attrs:{color:"k-main",label:e.$t("messages.acceptEULA")},model:{value:e.accept,callback:function(t){e.accept=t},expression:"accept"}})],1),t("div",{staticClass:"col text-right"},[t("q-btn",{attrs:{color:"k-main",label:e.$t("labels.acceptEULA"),disabled:!e.accept},on:{click:e.downloadCertificate}}),t("q-btn",{attrs:{color:"k-main",outline:"",label:e.$t("labels.declineEULA")},on:{click:e.mustAccept}})],1)]),t("klab-loading",{attrs:{loading:e.downloading,message:e.$t("messages.downloadingCertificate")}})],1)},us=[],ds={name:"Certificate",components:{KhubDefaultContainer:dt["a"],KlabLoading:qe},data(){return{menuItems:De,eulaLang:"en",accept:!1,downloading:!1}},computed:{profile(){return this.$store.getters["auth/profile"]},agreement(){return this.$store.getters["auth/agreement"]}},methods:{downloadCertificate(){if(this.accept){this.downloading=!0;const e={username:this.profile.name,agreementId:this.agreement.id};this.$store.dispatch("auth/getCertificate",e).then((()=>{this.downloading=!1})).catch((e=>{console.error(`Error ${e.status}: ${e.message}`),this.$q.notify({message:this.$t("messages.errorGeneratingCertificate"),color:"negative"}),this.downloading=!1}))}else this.mustAccept()},mustAccept(){this.$q.notify({message:this.$t("messages.mustAcceptEULA"),color:"negative"})}},mounted(){}},ps=ds,ms=(s("1fe1"),Object(X["a"])(ps,cs,us,!1,null,null,null)),hs=ms.exports;Se()(ms,"components",{QCheckbox:T["a"],QBtn:p["a"]});var gs=function(){var e=this,t=e._self._c;return t("khub-default-container",{attrs:{"menu-items":e.menuItems}},[t("transition",{attrs:{name:"fade",mode:"out-in"}},[t("router-view")],1)],1)},bs=[],fs={name:"AdminPage",components:{KhubDefaultContainer:dt["a"]},data(){return{menuItems:Ge}},methods:{...Object(W["b"])("admin",["loadSenders"])},created(){this.loadSenders().then((e=>{console.info(`Loaded ${e.length} senders`)})).catch((e=>{console.error(e.message)}))}},Es=fs,vs=(s("15da"),Object(X["a"])(Es,gs,bs,!1,null,null,null)),ks=vs.exports,_s=function(){var e=this,t=e._self._c;return t("khub-default-container",{attrs:{"menu-items":e.menuItems}},[t("transition",{attrs:{name:"fade",mode:"out-in"}},[t("router-view")],1)],1)},Ts=[],ws={name:"StatsPage",components:{KhubDefaultContainer:dt["a"]},data(){return{menuItems:Me}},methods:{...Object(W["b"])("admin",["loadSenders"])},created(){this.loadSenders().then((e=>{console.info(`Loaded ${e.length} senders`)})).catch((e=>{console.error(e.message)}))}},ys=ws,Cs=(s("f594"),Object(X["a"])(ys,_s,Ts,!1,null,null,null)),Ss=Cs.exports,As=function(){var e=this,t=e._self._c;return t("div",{staticClass:"ka-content"},[t("h2",{staticClass:"kh-h-first"},[e._v(e._s(e.$t("contents.adminHomeTitle")))]),t("div",{domProps:{innerHTML:e._s(e.$t("contents.adminHomeContent"))}})])},qs=[],Os={data(){return{}}},Rs=Os,$s=Object(X["a"])(Rs,As,qs,!1,null,null,null),Ps=$s.exports,Ns=function(){var e=this,t=e._self._c;return t("div",{staticClass:"ka-content"},[t("h2",{staticClass:"kh-h-first"},[e._v(e._s(e.$t("contents.adminUsersTitle"))+"\n "),t("q-icon",{staticClass:"cursor-pointer text-k-controls ka-refresh",class:{"ka-refreshing":e.refreshing},attrs:{name:"mdi-refresh"},on:{click:function(t){return e.refreshUsers(e.pagination,e.filter)}}},[t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0]}},[e._v(e._s(e.$t("labels.refreshUsers")))])],1)],1),t("div",{staticClass:"ka-no-updates",attrs:{id:"info-user-noupdates"}},[e._v(e._s(e.$t("messages.userNoSendUpdates")))]),t("div",[t("div",{staticClass:"row full-width ka-filters",class:[e.filtered?"ka-filtered":""]},[t("div",{staticClass:"row full-width"},[t("div",{staticClass:"col-6"},[t("div",{staticClass:"row full-width"},[t("q-input",{staticClass:"q-pa-sm col-4",attrs:{color:"k-controls",dense:"",clearable:"",label:e.$t("labels.username"),tabindex:"1"},model:{value:e.filter.username,callback:function(t){e.$set(e.filter,"username",t)},expression:"filter.username"}}),t("q-input",{staticClass:"q-pa-sm col-4",attrs:{color:"k-controls",dense:"",clearable:"",label:e.$t("labels.email"),tabindex:"2"},model:{value:e.filter.email,callback:function(t){e.$set(e.filter,"email",t)},expression:"filter.email"}}),t("q-select",{staticClass:"q-pa-sm col-4",attrs:{color:"k-controls","options-selected-class":"text-k-controls",options:e.accountStatusOptions,label:e.$t("labels.accountStatus"),dense:"","options-dense":"",clearable:"",multiple:"",tabindex:"3"},model:{value:e.filter.accountStatus,callback:function(t){e.$set(e.filter,"accountStatus",t)},expression:"filter.accountStatus"}})],1),t("div",{staticClass:"row full-width"},[t("q-select",{staticClass:"q-pa-sm col-6",attrs:{color:"k-controls",options:e.rolesOptions,label:e.$t("labels.roles"),dense:"","options-dense":"",multiple:"","use-chips":"",clearable:"",tabindex:"4"},scopedSlots:e._u([{key:"option",fn:function(s){return[t("q-item",e._g(e._b({},"q-item",s.itemProps,!1),s.itemEvents),[t("q-item-section",{attrs:{avatar:""}},[t("q-icon",{attrs:{name:s.opt.icon}})],1),t("q-item-section",[t("q-item-label",{domProps:{innerHTML:e._s(s.opt.name)}})],1)],1)]}},{key:"selected-item",fn:function(s){return[t("q-chip",{staticClass:"q-ma-none",attrs:{removable:"",dense:"",tabindex:s.tabindex,color:"white","text-color":"k-controls"},on:{remove:function(e){return s.removeAtIndex(s.index)}}},[t("q-icon",{attrs:{name:s.opt.icon}}),e._v(e._s(s.opt.name)+"\n ")],1)]}}]),model:{value:e.filter.roles,callback:function(t){e.$set(e.filter,"roles",t)},expression:"filter.roles"}}),t("div",{staticClass:"q-pa-sm col-6 row"},[t("q-toggle",{attrs:{color:"k-controls",label:e.$t("labels.rolesAll"),"true-value":"all","false-value":"any",tabindex:"5"},model:{value:e.filter.rolesAllAny,callback:function(t){e.$set(e.filter,"rolesAllAny",t)},expression:"filter.rolesAllAny"}})],1)],1),t("div",{staticClass:"row full-width"},[t("q-select",{staticClass:"q-pa-sm col-6",attrs:{color:"k-controls",options:e.groupsOptions,label:e.$t("labels.groups"),disable:e.filter.noGroups,dense:"","options-dense":"",multiple:"","use-chips":"",clearable:"",tabindex:"6"},scopedSlots:e._u([{key:"option",fn:function(s){return[t("q-item",e._g(e._b({},"q-item",s.itemProps,!1),s.itemEvents),[null!==s.opt.icon?t("q-item-section",{attrs:{avatar:""}},[t("img",{staticClass:"ka-group-icon",attrs:{src:s.opt.icon,width:"25",alt:s.opt.label}})]):t("q-item-section",{attrs:{avatar:""}},[t("div",{staticClass:"ka-no-group-icon ka-small"},[e._v(e._s(s.opt.label.charAt(0).toUpperCase()))])]),t("q-item-section",[t("q-item-label",{domProps:{innerHTML:e._s(s.opt.label)}}),t("q-item-label",{attrs:{caption:""}},[e._v(e._s(s.opt.description))])],1)],1)]}},{key:"selected-item",fn:function(s){return[t("q-chip",{staticClass:"q-ma-none",attrs:{removable:"",dense:"",tabindex:s.tabindex,color:"white","text-color":"k-controls"},on:{remove:function(e){return s.removeAtIndex(s.index)}}},[null!==s.opt.icon?t("img",{staticClass:"ka-group-icon",attrs:{src:s.opt.icon,width:"15",alt:s.opt.name}}):t("div",{staticClass:"ka-no-group-icon ka-small"},[e._v(e._s(s.opt.label.charAt(0).toUpperCase()))]),e._v("\n "+e._s(s.opt.name)+"\n ")])]}}]),model:{value:e.filter.groups,callback:function(t){e.$set(e.filter,"groups",t)},expression:"filter.groups"}}),t("div",{staticClass:"q-pa-sm col-6 row"},[t("q-toggle",{staticClass:"col-6",attrs:{color:"k-controls",label:e.$t("labels.groupsAll"),"true-value":"all","false-value":"any",disable:e.filter.noGroups,tabindex:"7"},model:{value:e.filter.groupsAllAny,callback:function(t){e.$set(e.filter,"groupsAllAny",t)},expression:"filter.groupsAllAny"}}),t("q-checkbox",{staticClass:"col-6",attrs:{color:"k-controls",dense:"",label:e.$t("labels.noGroups"),"left-label":"",tabindex:"8"},model:{value:e.filter.noGroups,callback:function(t){e.$set(e.filter,"noGroups",t)},expression:"filter.noGroups"}})],1)],1)]),t("div",{staticClass:"col-6"},[t("div",{staticClass:"row full-width"},[t("k-input-date",{ref:"lastConnectionFrom",attrs:{classes:"q-pa-sm col-4",dense:"",color:"k-controls",label:e.$t("labels.lastConnectionFrom"),disable:e.filter.noLastConnection,tabindex:"10"},on:{input:function(t){return e.checkDates("lastConnection","From")}},model:{value:e.filter.lastConnectionFrom,callback:function(t){e.$set(e.filter,"lastConnectionFrom",t)},expression:"filter.lastConnectionFrom"}}),t("k-input-date",{ref:"lastLoginFrom",attrs:{classes:"q-pa-sm col-4",color:"k-controls",dense:"",label:e.$t("labels.lastLoginFrom"),disable:e.filter.noLastLogin,tabindex:"20"},on:{input:function(t){return e.checkDates("login","From")}},model:{value:e.filter.lastLoginFrom,callback:function(t){e.$set(e.filter,"lastLoginFrom",t)},expression:"filter.lastLoginFrom"}}),t("k-input-date",{ref:"registrationDateFrom",attrs:{classes:"q-pa-sm col-4",color:"k-controls",dense:"",label:e.$t("labels.registrationDateFrom"),disable:e.filter.noRegistrationDate,tabindex:"30"},on:{input:function(t){return e.checkDates("registration","From")}},model:{value:e.filter.registrationDateFrom,callback:function(t){e.$set(e.filter,"registrationDateFrom",t)},expression:"filter.registrationDateFrom"}})],1),t("div",{staticClass:"row full-width"},[t("k-input-date",{ref:"lastConnectionTo",attrs:{classes:"q-pa-sm col-4",color:"k-controls",dense:"",label:e.$t("labels.lastConnectionTo"),disable:e.filter.noLastConnection,tabindex:"11"},on:{input:function(t){return e.checkDates("lastConnection","To")}},model:{value:e.filter.lastConnectionTo,callback:function(t){e.$set(e.filter,"lastConnectionTo",t)},expression:"filter.lastConnectionTo"}}),t("k-input-date",{ref:"lastLoginTo",attrs:{classes:"q-pa-sm col-4",color:"k-controls",dense:"",label:e.$t("labels.lastLoginTo"),disable:e.filter.noLastLogin,tabindex:"21"},on:{input:function(t){return e.checkDates("login","To")}},model:{value:e.filter.lastLoginTo,callback:function(t){e.$set(e.filter,"lastLoginTo",t)},expression:"filter.lastLoginTo"}}),t("k-input-date",{ref:"registrationDateTo",attrs:{classes:"q-pa-sm col-4",color:"k-controls",dense:"",label:e.$t("labels.registrationDateTo"),disable:e.filter.noRegistrationDate,tabindex:"31"},on:{input:function(t){return e.checkDates("registration","To")}},model:{value:e.filter.registrationDateTo,callback:function(t){e.$set(e.filter,"registrationDateTo",t)},expression:"filter.registrationDateTo"}})],1),t("div",{staticClass:"row full-width"},[t("q-checkbox",{staticClass:"q-pa-sm col-4",staticStyle:{height:"56px"},attrs:{color:"k-controls",dense:"",label:e.$t("labels.hasLastConnection"),"left-label":"",tabindex:"12"},model:{value:e.filter.noLastConnection,callback:function(t){e.$set(e.filter,"noLastConnection",t)},expression:"filter.noLastConnection"}}),t("q-checkbox",{staticClass:"q-pa-sm col-4",staticStyle:{height:"56px"},attrs:{color:"k-controls",dense:"",label:e.$t("labels.hasLastLogin"),"left-label":"",tabindex:"22"},model:{value:e.filter.noLastLogin,callback:function(t){e.$set(e.filter,"noLastLogin",t)},expression:"filter.noLastLogin"}}),t("q-checkbox",{staticClass:"q-pa-sm col-4",staticStyle:{height:"56px"},attrs:{color:"k-controls",dense:"",label:e.$t("labels.hasRegistrationDate"),"left-label":"",tabindex:"32"},model:{value:e.filter.noRegistrationDate,callback:function(t){e.$set(e.filter,"noRegistrationDate",t)},expression:"filter.noRegistrationDate"}})],1)])]),t("div",{staticClass:"row full-width ka-filter-info q-pa-sm"},[t("div",{staticClass:"col-10 self-end"},[e._v(e._s(e.$t("labels.filterInfo",{filtered:e.filtered?e.$t("labels.filtered"):e.$t("labels.all"),element:e.$t("menu.users"),number:e.rowsNumber})))]),t("div",{staticClass:"col text-right"},[t("q-btn",{staticClass:"ka-action-button",attrs:{label:e.$t("labels.clearSearch"),color:"k-main"},on:{click:e.initializeFilter}})],1),t("div",{staticClass:"col text-right"},[t("q-btn",{staticClass:"ka-action-button",attrs:{label:e.$t("labels.applyFilters"),disabled:!e.filtered,color:"k-controls"},on:{click:function(t){return e.refreshUsers(e.pagination,e.filter)}}})],1)])]),t("div",{staticClass:"row full-width ka-actions q-ma-md"},[t("div",{staticClass:"row full-width q-pa-xs ka-selected-info"},[t("div",{staticClass:"inline-block",domProps:{innerHTML:e._s(e.$t("labels.selectedInfo",{selected:e.selected.length,total:e.users.length,type:e.$t("labels.users")}))}}),e.selected.length>0?t("div",{staticClass:"inline-block q-pa-xs"},[t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-checkbox-multiple-blank-outline",size:"1.8em"},on:{click:function(t){return e.selected.splice(0,e.selected.length)}}},[t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0]}},[e._v(e._s(e.$t("labels.unselectAll")))])],1)],1):e._e(),e.selected.length0},on:{click:function(t){return e.deleteUserConfirm(s.row.name)}}},[t("q-tooltip",{attrs:{anchor:"bottom middle",self:"top middle",offset:[0,8],delay:600}},[e._v(e._s(e.$t("labels.deleteUser",{username:s.row.name})))])],1)],1)],1)]}}])})],1),t("group-selection-dialog",{attrs:{"dialog-action":e.modifyGroupsAction,action:e.modifyGroups,"select-label":e.modifyGroups===e.ACTIONS.ADD_GROUPS_ACTION?e.$t("labels.assignGroups"):e.$t("labels.removeGroups")}}),t("klab-delete-confirm-dialog",{attrs:{element:this.$t("labels.user").toLowerCase(),elementName:e.usernameToDelete,open:e.openDelete,confirmFunction:e.deleteConfirm},on:{"update:open":function(t){e.openDelete=t}}}),t("q-dialog",{staticClass:"ka-dialog",attrs:{persistent:""},model:{value:e.sendingEmails,callback:function(t){e.sendingEmails=t},expression:"sendingEmails"}},[t("q-card",{staticStyle:{"min-width":"600px"}},[t("q-card-section",[t("div",{staticClass:"text-h6 q-pa-sm ka-dialog-title",domProps:{innerHTML:e._s(e.$t("labels.sendingToUsers",{users:`${e.selected.length}`}))}}),0!==e.userWithNoSend?t("q-checkbox",{staticClass:"q-pa-xs",attrs:{color:"k-red","left-label":"",tabindex:"50"},model:{value:e.mail.forceSendingEmail,callback:function(t){e.$set(e.mail,"forceSendingEmail",t)},expression:"mail.forceSendingEmail"}},[t("span",{staticClass:"ka-nosend-advice",domProps:{innerHTML:e._s(e.$t("labels.forceSend",{users:e.userWithNoSend}))}})]):e._e()],1),t("q-card-section",[t("q-select",{staticClass:"q-pa-sm",attrs:{color:"k-controls",options:e.senders,label:e.$t("labels.emailSenders"),"options-sanitize":!0,dense:"","options-dense":"",clearable:"",tabindex:"51"},model:{value:e.mail.sender,callback:function(t){e.$set(e.mail,"sender",t)},expression:"mail.sender"}}),t("q-input",{staticClass:"q-pa-sm",attrs:{color:"k-controls",dense:"",label:e.$t("labels.emailSubject"),tabindex:"52"},model:{value:e.mail.subject,callback:function(t){e.$set(e.mail,"subject",t)},expression:"mail.subject"}}),t("div",{staticClass:"q-pa-sm ka-field-title"},[e._v(e._s(e.$t("labels.emailContent")))]),t("q-editor",{staticClass:"q-ma-sm",attrs:{"min-height":"10rem",dense:"",tabindex:"53"},model:{value:e.mail.content,callback:function(t){e.$set(e.mail,"content",t)},expression:"mail.content"}})],1),t("q-card-actions",{staticClass:"q-ma-md text-primary",attrs:{align:"right"}},[t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",label:e.$t("labels.btnCancel"),color:"k-controls",tabindex:"55"}}),t("q-btn",{attrs:{label:e.$t("labels.sendEmail"),disabled:null===e.mail.sender||null===e.mail.subject||""===e.mail.subject||null===e.mail.content||""===e.mail.content,color:"k-controls",tabindex:"54"},on:{click:e.sendEmailAction}})],1)],1)],1),t("user-form-card",{attrs:{open:e.open},on:{showDialog:e.showDialog}}),t("klab-loading",{attrs:{loading:e.waiting||e.refreshing,message:e.$t("messages.doingThings")}})],1)},xs=[];const Us=e=>new Promise(((t,s)=>{sr({type:re["u"].SEND_EMAIL.method,url:re["u"].SEND_EMAIL.url,needAuth:!0,params:e},((e,s)=>{t(e),s()}),(e=>{s(e)}))}));var Is=function(){var e=this,t=e._self._c;return t("q-dialog",{staticClass:"ka-dialog",attrs:{persistent:""},on:{"before-show":e.resetGroupDependencies},model:{value:e.dialogOpen,callback:function(t){e.dialogOpen=t},expression:"dialogOpen"}},[t("q-card",{staticStyle:{"min-width":"350px"}},[t("q-card-section",[t("div",{staticClass:"text-h6 q-pa-sm ka-dialog-title"},[e._v(e._s(e.action===e.ACTIONS.ADD_GROUPS_ACTION?e.$t("labels.assignGroups"):e.$t("labels.removeGroups")))])]),t("q-card-section",e._l(e.groupsOptions,(function(s,a){return t("div",{key:a},[t("q-checkbox",{staticClass:"q-pa-xs q-ma-none",attrs:{disable:e.groupDependencies.includes(s.label),val:s.label,color:"k-controls"},model:{value:e.selectedGroups,callback:function(t){e.selectedGroups=t},expression:"selectedGroups"}},[null!==s.icon?t("q-chip",{attrs:{color:"white"}},[t("q-avatar",{attrs:{color:"white"}},[t("img",{attrs:{src:s.icon,width:"30",alt:s.label}})]),e._v("\n "+e._s(s.label)+"\n ")],1):t("div",{staticClass:"ka-no-group-chip"},[t("span",{staticClass:"ka-no-group-icon ka-medium"},[e._v(e._s(s.label.charAt(0).toUpperCase()))]),e._v(e._s(s.label))])],1)],1)})),0),t("q-card-actions",{staticClass:"text-k-main",attrs:{align:"right"}},[t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",label:e.$t("labels.btnCancel"),color:"k-controls"},on:{click:function(t){return e.dialogAction(null)}}}),t("q-btn",{attrs:{label:null===e.selectLabel?this.$t("labels.selectGroupButtonDefault"):e.selectLabel,disabled:0===e.selectedGroups.length,color:"k-controls"},on:{click:function(t){return e.dialogAction(e.selectedGroups)}}})],1)],1)],1)},Ls=[],Ds={name:"GroupSelectionDialog",props:{dialogAction:{type:Function,required:!0},action:{type:String,default:null},selectLabel:{type:String,default:null}},data(){return{groupDependencies:[],selectedGroups:[],ACTIONS:re["a"]}},computed:{...Object(W["c"])("admin",["groups","groupsOptions"]),dialogOpen:{get(){return null!==this.action},set(){}}},methods:{...Object(W["b"])("admin",["loadGroups"]),resetGroupDependencies(){this.groupDependencies.splice(0,this.groupDependencies.length)}},watch:{selectedGroups(){if(this.selectedGroups.length>0){let e,t;e=this.action===re["a"].ADD_GROUPS_ACTION?this.groupsOptions.filter((e=>this.selectedGroups.includes(e.label))):this.groupsOptions.filter((e=>!this.selectedGroups.includes(e.label))),this.action===re["a"].ADD_GROUPS_ACTION&&(t=e.reduce(((e,t)=>(t.dependencies&&t.dependencies.length>0&&t.dependencies.forEach((t=>{e.includes(t)||e.push(t)})),e)),[])),this.action===re["a"].REMOVE_GROUPS_ACTION&&(t=[],e.forEach((e=>{e.dependencies&&e.dependencies.length>0&&e.dependencies.some((e=>this.selectedGroups.indexOf(e)>=0))&&t.push(e.value)}))),this.$nextTick((()=>{this.groupDependencies.splice(0,this.groupDependencies.length),this.groupDependencies.push(...t),this.groupDependencies.forEach((e=>{this.selectedGroups.includes(e)||this.selectedGroups.push(e)}))}))}},action(e){null!==e&&this.selectedGroups.splice(0,this.selectedGroups.length)}},created(){this.loadGroups()}},Gs=Ds,Ms=Object(X["a"])(Gs,Is,Ls,!1,null,null,null),Qs=Ms.exports;Se()(Ms,"components",{QDialog:x["a"],QCard:q["a"],QCardSection:M["a"],QCheckbox:T["a"],QChip:_["a"],QAvatar:A["a"],QCardActions:Q["a"],QBtn:p["a"]}),Se()(Ms,"directives",{ClosePopup:F["a"]});var js=function(){var e=this,t=e._self._c;return t("q-dialog",{attrs:{persistent:""},model:{value:e.open,callback:function(t){e.open=t},expression:"open"}},[t("q-card",{staticStyle:{width:"1600px","max-width":"80vw"}},[t("KhubDialogTitle",{attrs:{title:"Update user"},on:{closeDialog:function(t){return e.showDialog()}}}),t("div",{staticClass:"col"},[t("User",{attrs:{profile:e.user,type:"USER",admin:!0},on:{closeDialog:function(t){return e.showDialog()}}})],1),t("div",{staticClass:"col"})],1)],1)},Fs=[],Bs=function(){var e=this,t=e._self._c;return t("q-card-section",[t("div",{staticClass:"full-width row items-center q-pb-none"},[t("div",{staticClass:"text-h q-pa-sm ka-dialog-title"},[e._v(e._s(e.title))]),t("q-space"),e.close?t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],staticClass:"text-k-main",attrs:{icon:"close",flat:"",round:"",dense:""},on:{click:function(t){return e.closeDialog()}}}):e._e()],1),t("q-separator",{staticClass:"ka-dialog-title-separator"})],1)},Vs=[],Ys={props:["title","close"],data(){return{}},name:"DialogTitle",methods:{closeDialog(){this.$emit("closeDialog",!1)}}},Ks=Ys,Ws=Object(X["a"])(Ks,Bs,Vs,!1,null,null,null),Hs=Ws.exports;Se()(Ws,"components",{QCardSection:M["a"],QSpace:$["a"],QBtn:p["a"],QSeparator:O["a"]}),Se()(Ws,"directives",{ClosePopup:F["a"]});var zs={mixins:[pt],props:["open"],data(){return{ROLES:re["l"]}},name:"UserFormCard",components:{User:Gt,KhubDialogTitle:Hs,KhubCustomPropertiesEditableTable:xt},computed:{...Object(W["c"])("admin",["user"])},methods:{...Object(W["b"])("admin",[]),formatDate:ar,showDialog(){this.$emit("showDialog",!1)}},watch:{},mounted(){}},Xs=zs,Zs=Object(X["a"])(Xs,js,Fs,!1,null,null,null),Js=Zs.exports;Se()(Zs,"components",{QDialog:x["a"],QCard:q["a"]});var ea=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"q-app"}},[t("div",{staticClass:"q-pa-sm q-gutter-sm"},[t("q-dialog",{model:{value:e.open,callback:function(t){e.open=t},expression:"open"}},[t("q-card",[t("q-card-section",{staticClass:"q-pb-xs"},[t("div",{staticClass:"text-h6"},[e._v(" DELETE\n ")])]),t("q-separator",{attrs:{spaced:""}}),t("q-card-section",{attrs:{align:"center"}},[t("p",{staticStyle:{"font-size":"15px"},attrs:{size:"md"}},[e._v("Are you sure you want to delete "+e._s(e.element)+" "),t("b",[e._v(" "+e._s(e.elementName))]),e._v("?\n ")])]),"user"===e.element?t("q-card-section",{staticClass:"q-pt-xs"},[t("q-banner",{staticClass:"bg-red-1",attrs:{rounded:"",dense:""}},[t("div",{staticStyle:{"font-size":"12px"}},[e._v("\n "+e._s(e.$t("messages.cautionRemoveUser").replace("{element}",this.$t("labels.user").toLowerCase()))+"\n ")])])],1):e._e(),t("q-separator",{attrs:{spaced:""}}),t("q-card-actions",{attrs:{align:"right"}},[t("q-btn",{attrs:{label:e.$t("labels.cancel"),color:"k-main"},on:{click:e.close}}),t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],staticStyle:{"margin-right":"0.1rem"},attrs:{icon:"delete",label:e.$t("labels.delete"),color:"k-red"},on:{click:this.delete}})],1)],1)],1)],1)])},ta=[],sa={name:"KlabDeleteConfirmDialog",props:["confirmFunction","open","element","elementName"],computed:{modalOpen:{get(){return this.open},set(e){this.$emit("update:open",e)}}},methods:{delete(){this.confirmFunction(),this.close()},close(){this.$emit("update:open",!1)}}},aa=sa,oa=Object(X["a"])(aa,ea,ta,!1,null,null,null),ra=oa.exports;Se()(oa,"components",{QDialog:x["a"],QCard:q["a"],QCardSection:M["a"],QIcon:m["a"],QSeparator:O["a"],QBanner:st["a"],QCardActions:Q["a"],QBtn:p["a"]}),Se()(oa,"directives",{ClosePopup:F["a"]});const ia={username:"",email:"",registrationDateFrom:null,registrationDateTo:null,lastLoginFrom:null,lastLoginTo:null,lastConnectionFrom:null,lastConnectionTo:null,noRegistrationDate:!1,noLastLogin:!1,noLastConnection:!1,accountStatus:null,groups:null,groupsAllAny:"any",roles:null,rolesAllAny:"any",noGroups:!1};var la={name:"UsersComponent",components:{KInputDate:Tt,KlabLoading:qe,GroupSelectionDialog:Qs,UserFormCard:Js,KlabDeleteConfirmDialog:ra},data(){return{selected:[],pagination:{sortBy:"lastConnection",descending:!0,rowsPerPage:25,oldRowsPerPage:25,page:1,rowsNumber:0},accountStatusOptions:[{label:this.$t("labels.statusActive"),value:"active"},{label:this.$t("labels.statusPendingActivation"),value:"pendingActivation"},{label:this.$t("labels.statusInactive"),value:"inactive"}],rolesOptions:Object.keys(re["l"]).map((e=>re["l"][e])),groupDependencies:[],filter:{...ia},columns:[{name:"name",field:"name",required:!0,label:this.$t("labels.username"),align:"left",sortable:!0,headerStyle:"width: 10%"},{name:"email",field:"email",required:!0,label:this.$t("labels.email"),align:"left",sortable:!0,headerStyle:"width: 10%",classes:"ka-user-email"},{name:"roles",field:"roles",required:!0,label:this.$t("labels.roles"),align:"left",headerStyle:"width: 8%; text-align: center"},{name:"groups",field:"groups",required:!0,label:this.$t("labels.groups"),align:"left",headerStyle:"width: 10%; text-align: center"},{name:"lastConnection",field:"lastConnection",required:!0,label:this.$t("labels.lastConnection"),align:"center",sortable:!0,sort:(e,t)=>rr(e,t),headerStyle:"width: 13%"},{name:"lastLogin",field:"lastLogin",required:!0,label:this.$t("labels.lastLogin"),align:"center",sortable:!0,sort:(e,t)=>rr(e,t),headerStyle:"width: 13%"},{name:"registrationDate",field:"registrationDate",required:!0,label:this.$t("labels.registrationDate"),align:"center",sortable:!0,sort:(e,t)=>rr(e,t),headerStyle:"width: 13%"},{name:"status",field:"accountStatus",required:!0,label:this.$t("labels.accountStatus"),align:"center",headerStyle:"width: 6%"},{name:"edit",required:!0,align:"center",headerStyle:"width: 6%"}],roles:re["l"],ACTIONS:re["a"],rowsNumber:0,refreshing:!1,waiting:!1,modifyGroups:null,sendingEmails:!1,mail:{sender:null,subject:null,content:"",type:re["f"].HTML,forceSendingEmail:!1},open:!1,usernameToDelete:"",openDelete:!1}},computed:{...Object(W["c"])("admin",["users","groups","groupsIcons","groupsOptions","senders"]),filtered(){return!Jo(this.filter,ia)},userWithNoSend(){return null!==this.selected&&this.selected.length>0?this.selected.filter((e=>!e.sendUpdates)).length:0}},methods:{...Object(W["b"])("admin",["loadUsers","loadUser","resetUser","deleteUser","loadGroups","modifyUsersGroups"]),formatDate:ar,selectAll(){this.users.forEach((e=>{0!==this.selected.length&&-1!==this.selected.findIndex((t=>e.id===t.id))||this.selected.push(e)}))},formatStatus(e){switch(e){case"active":return this.$t("labels.statusActive");case"verified":return this.$t("labels.statusVerified");case"pendingActivation":return this.$t("labels.statusPendingActivation");case"inactive":return this.$t("labels.statusInactive");default:return e}},initializeFilter(){this.filter={...ia},this.$refs.lastConnectionFrom.reset(),this.$refs.lastConnectionTo.reset(),this.$refs.registrationDateFrom.reset(),this.$refs.registrationDateTo.reset(),this.$refs.lastLoginFrom.reset(),this.$refs.lastLoginTo.reset(),this.refreshUsers(this.pagination,this.filter)},filterArrays(e,t,s){const a=t.map((e=>e.value));return"all"===s?a.every((t=>e.includes(t))):e.some((e=>a.includes(e)))},sortDate(e,t){return e?t?new Date(e).getTime()-new Date(t).getTime():1:-1},checkDates(e,t){const s=`${e}From`,a=`${e}To`;null!==this.filter[s]&&null!==this.filter[a]&&bt()(this.filter[s],"L").isSameOrAfter(bt()(this.filter[a],"L"))&&(this.$refs[`${e}${t}`].reset(),this.$q.notify({message:this.$t("messages.errorDateFromTo",{type:e}),color:"negative"}))},getPaginationLabel(e,t,s){return this.rowsNumber=s,this.$t("labels.pagination",{firstRowIndex:e,endRowIndex:t,totalRowsNumber:s})},onRequest(e){this.refreshUsers(e.pagination?e.pagination:this.pagination,e.filter?e.filter:this.filter)},refreshUsers(e,t){this.refreshing=!0,this.loadUsers(pr(e,t)).then((t=>{this.pagination={...this.pagination,...e,...t},this.refreshing=!1,this.$q.notify({message:this.$t("messages.usersLoaded"),color:"positive",timeout:1e3})})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.usersLoadedError"),color:"negative",timeout:1500}),this.refreshing=!1}))},modifyGroupsAction(e){null!==e?e.length>0&&this.confirm(this.$t("labels.warning"),this.modifyGroups===re["a"].ADD_GROUPS_ACTION?this.$t("messages.usersGroupsAssignConfirm",{groupsNumber:e.length,usersNumber:this.selected.length}):this.$t("messages.usersGroupsRemoveConfirm",{groupsNumber:e.length,usersNumber:this.selected.length}),(()=>{this.waiting=!0,this.modifyUsersGroups({users:this.selected.map((e=>e.name)),groups:e,action:this.modifyGroups}).then((()=>{this.$q.notify({message:this.modifyGroups===re["a"].ADD_GROUPS_ACTION?this.$t("messages.usersGroupsAssign"):this.$t("messages.usersGroupsRemoved"),color:"positive",timeout:1e3}),this.waiting=!1,this.modifyGroups=null,this.refreshUsers(this.pagination,this.filter)})).catch((e=>{console.error(e),this.$q.notify({message:this.modifyGroups===re["a"].ADD_GROUPS_ACTION?this.$t("messages.usersGroupsAssignError"):this.$t("messages.usersGroupsRemoveError"),color:"negative",timeout:1e3}),this.waiting=!1,this.modifyGroups=null}))}),(()=>{this.modifyGroups=null})):this.modifyGroups=null},sendEmailAction(){if(null!==this.mail.sender&&this.selected.length>0){const e=this.selected.filter((e=>this.mail.forceSendingEmail||e.sendUpdates)).map((e=>e.email));if(0===e.length)return void this.$q.notify({message:this.$t("messages.emailWithNoReceipts"),color:"negative"});this.waiting=!0,Us({from:null,to:e,replayTo:[this.mail.sender],subject:this.mail.subject,content:this.mail.content,type:re["f"].HTML}).then((()=>{this.waiting=!1,this.sendingEmails=!1,this.$q.notify({message:this.$t("messages.emailSent"),color:"positive"})})).catch((e=>{this.waiting=!1,this.sendingEmails=!1,this.$q.notify({message:e.message,color:"negative"})}))}},confirm(e,t,s,a){this.$q.dialog({title:e,message:t,ok:{color:"k-controls",push:!0,flat:!0},cancel:{color:"k-controls",push:!0,flat:!0},persistent:!0}).onOk((()=>{s()})).onCancel((()=>{a()}))},deleteUserConfirm(e){this.usernameToDelete=e,this.openDelete=!0},deleteConfirm(){this.deleteUser(this.usernameToDelete).then((e=>{this.$q.notify({icon:"mdi-account-remove",message:this.$t("messages.userDeleted",{username:e.data.User}),type:"positive",timeout:5e3})})).catch((e=>console.error(e)))},copyTextToClipboard(e,t){e.stopPropagation(),mr(t),this.$q.notify({message:this.$t("messages.textCopied"),type:"info",icon:"mdi-information",timeout:500})},openDialog(e=null){this.loadUser(e).then((()=>{this.showDialog(!0)})).catch((e=>{console.error(e)}))},showDialog(e){this.open=e}},watch:{sendingEmails(e){e&&(this.mail={sender:null,subject:null,content:"",type:re["f"].HTML,forceSendingEmail:!1})}},created(){this.loadGroups().then((()=>{this.refreshUsers(this.pagination,this.filter)})),bt.a.locale(this.$q.lang.getLocale())},mounted(){}},na=la,ca=(s("9b2f"),Object(X["a"])(na,Ns,xs,!1,null,null,null)),ua=ca.exports;Se()(ca,"components",{QIcon:m["a"],QTooltip:R["a"],QInput:E["a"],QSelect:k["a"],QItem:g["a"],QItemSection:b["a"],QItemLabel:f["a"],QChip:_["a"],QToggle:C["a"],QCheckbox:T["a"],QBtn:p["a"],QTable:I["a"],QTr:D["a"],QTd:L["a"],QDialog:x["a"],QCard:q["a"],QCardSection:M["a"],QEditor:v["a"],QCardActions:Q["a"],QAvatar:A["a"]}),Se()(ca,"directives",{ClosePopup:F["a"]});var da=function(){var e=this,t=e._self._c;return t("div",{staticClass:"ka-content"},[t("h2",{staticClass:"kh-h-first"},[e._v(e._s(e.$t("contents.adminGroupsTitle"))+"\n "),t("q-icon",{staticClass:"cursor-pointer text-k-main ka-refresh",class:{"ka-refreshing":e.refreshing},attrs:{name:"mdi-refresh"},on:{click:e.refreshGroups}},[t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0],delay:600}},[e._v(e._s(e.$t("labels.refreshGroups")))])],1)],1),t("div",{staticClass:"row full-width ka-actions q-ma-md"},[t("div",{staticClass:"row full-width q-pa-sm ka-actions-row"},[t("div",{staticClass:"col-1 ka-action-desc"},[e._v(e._s(e.$t("labels.actionsGroups")))]),t("q-btn",{staticClass:"col-2 ka-action-button",attrs:{icon:"mdi-account-multiple-plus",label:e.$t("labels.createGroup"),color:"k-controls"},on:{click:function(t){return e.openDialog()}}})],1)]),e.groups.length>0?t("div",{},[t("q-table",{attrs:{grid:"",data:e.groups,columns:e.columns,"row-key":"icon","rows-per-page-options":[10,30,50,100,0]},scopedSlots:e._u([{key:"item",fn:function(s){return[t("div",{staticClass:"q-pa-xs col-sm-12 col-md-6 col-lg-4"},[t("q-card",{staticClass:"full-height"},[t("q-item",[t("q-item-section",{attrs:{avatar:""}},[s.row.iconUrl?t("img",{attrs:{width:"50",src:s.row.iconUrl}}):t("div",{staticClass:"ka-no-group-icon ka-large"},[e._v(e._s(s.row.name.charAt(0).toUpperCase()))])]),t("q-item-section",[t("div",{staticClass:"ka-group-name"},[e._v(e._s(s.row.name))])]),t("q-item-section",{staticClass:"q-pa-xs ka-group-buttons",attrs:{side:"","no-wrap":""}},[t("q-btn",{attrs:{icon:"mdi-pencil",round:"",color:"k-controls",size:"sm"},on:{click:function(t){return e.openDialog(s.row.name)}}},[t("q-tooltip",{attrs:{anchor:"bottom middle",self:"top middle",offset:[0,8],delay:600}},[e._v(e._s(e.$t("labels.editGroup")))])],1),t("div",{staticClass:"inline-block"},[t("q-btn",{attrs:{icon:"mdi-trash-can",round:"",color:"k-red",size:"sm",disable:e.usersCountCounter>0||s.row.usersCount>0},on:{click:function(t){return e.removeGroup(s.row.name)}}},[t("q-tooltip",{attrs:{anchor:"bottom middle",self:"top middle",offset:[0,8],delay:600}},[e._v(e._s(e.$t("labels.deleteGroup")))])],1),e.usersCountCounter>0||s.row.usersCount>0?t("q-tooltip",{staticClass:"bg-k-red",attrs:{anchor:"bottom middle",self:"top middle",offset:[0,8],delay:600}},[e.usersCountCounter>0?t("span",[e._v(e._s(e.$t("messages.notDeletableGroup",{reason:e.$t("messages.notDeletableGroupWaiting")})))]):s.row.usersCount>0?t("span",[e._v(e._s(e.$t("messages.notDeletableGroup",{reason:e.$t("messages.notDeletableGroupHasUsers")})))]):e._e()]):e._e()],1)],1)],1),t("q-item-label",{attrs:{caption:""}},[t("div",{staticClass:"ka-group-description q-pa-md"},[e._v(e._s(s.row.description))])]),t("q-separator"),t("q-list",{staticClass:"gc-items"},e._l(s.cols.filter((e=>"icon"!==e.name&&"name"!==e.name&&"description"!==e.name)),(function(s){return t("q-item",{key:s.name},[t("q-item-section",{staticClass:"gc-item-label"},[t("q-item-label",[e._v(e._s(s.label))])],1),s.value?Array.isArray(s.value)?t("q-item-section",{class:{"gc-multiple-item":s.value&&s.value.length>0&&!s.component}},[0===s.value.length?t("div",[t("q-item-label",{attrs:{caption:""},domProps:{innerHTML:e._s(e.$t("labels.groupNoValue"))}})],1):"table"===s.component?t("div",[t("q-table",{attrs:{flat:"",bordered:"",dense:"",data:s.value,columns:s.columns,"row-key":"key","hide-bottom":"","rows-per-page-options":[0],wrap:""}})],1):e._l(s.value,(function(a,o){return t("div",{key:o},["observables"===s.name?t("q-item-label",{class:{"gc-separator":a.separator},attrs:{caption:""}},[e._v(e._s(a.label)+"\n "),a.separator?e._e():t("q-tooltip",{attrs:{anchor:"center right",self:"center left","content-class":"bg-k-main","content-style":"font-size: 12px",delay:600,offset:[5,0]}},[e._v(e._s(a.description))])],1):t("q-item-label",{attrs:{caption:""}},[e._v(e._s(a)+"\n "),t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0]}},[e._v(e._s(a))])],1)],1)}))],2):t("q-item-section",{staticClass:"gc-item"},[t("q-item-label",{attrs:{caption:""}},[e._v(e._s(s.value))])],1):t("q-item-section",[t("q-item-label",{attrs:{caption:""},domProps:{innerHTML:e._s(e.$t("labels.groupNoValue"))}})],1)],1)})),1)],1)],1)]}}],null,!1,1971385468)}),t("group-form-card",{attrs:{"new-group":e.newGroup}})],1):e._e(),t("klab-loading",{attrs:{loading:e.waiting||e.refreshing,message:e.$t("messages.doingThings")}})],1)},pa=[];const ma=[{name:"milliseconds",scale:1e3},{name:"seconds",scale:60},{name:"minutes",scale:60},{name:"hours",scale:24}],ha=[{name:"year",scale:365},{name:"month",scale:30}];function ga(e){const t={};return ma.forEach((s=>{const a=Math.floor(e/s.scale),o=e-a*s.scale;t[s.name]=o,e=a})),ha.forEach((s=>{t[s.name]=0;while(e>=s.scale)t[s.name]+=1,e-=s.scale})),t.day=e,t}function ba(e){let t=0;return ha.forEach((s=>{e[s.name]&&(t+=e[s.name]*s.scale)})),e.day&&(t+=e.day),ma.forEach((e=>{t*=e.scale})),t}function fa(e){let t="";const s=["year","month","day"];return s.forEach((s=>{t&&(t+=" "),0!==e[s]&&(t+=`${e[s]} ${ce["b"].tc(`labels.${s}`)}`)})),""===t?ce["b"].tc("messages.unknownDate"):t}var Ea=function(){var e=this,t=e._self._c;return null!==e.group?t("q-dialog",{attrs:{persistent:""},model:{value:e.open,callback:function(t){e.open=t},expression:"open"}},[t("div",{staticClass:"ka-dialog"},[t("q-card",{staticClass:"full-height"},[t("q-list",[t("q-item",[t("q-item-section",[t("q-input",{ref:"group-name",attrs:{color:"k-controls",disable:!e.newGroup,label:e.$t("labels.groupName"),rules:[t=>e.fieldRequired(t)]},scopedSlots:e._u([{key:"append",fn:function(){return[e.group.name&&e.newGroup?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-close-circle",color:"k-main"},on:{click:function(t){t.stopPropagation(),e.group.name=null}}}):e._e()]},proxy:!0}],null,!1,3957828500),model:{value:e.group.name,callback:function(t){e.$set(e.group,"name",t)},expression:"group.name"}})],1)],1),t("q-item",[t("q-item-section",{staticClass:"col-10"},[t("q-input",{ref:"group-icon",attrs:{color:"k-controls",autogrow:"",label:e.$t("labels.groupIcon"),error:e.iconError,"error-message":e.$t("messages.iconNotValid")},on:{input:function(t){e.iconError=!1}},scopedSlots:e._u([{key:"append",fn:function(){return[e.group.iconUrl?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-close-circle",color:"k-main"},on:{click:function(t){t.stopPropagation(),e.group.iconUrl=null}}}):e._e()]},proxy:!0}],null,!1,734042839),model:{value:e.group.iconUrl,callback:function(t){e.$set(e.group,"iconUrl",t)},expression:"group.iconUrl"}})],1),t("q-item-section",{staticClass:"col-2"},[t("q-avatar",{attrs:{square:""}},[t("img",{attrs:{alt:e.group.label,src:e.iconSrc},on:{error:function(t){e.iconError=!0}}})])],1)],1),t("q-item",[t("q-item-section",[t("q-input",{ref:"group-description",attrs:{color:"k-controls",autogrow:"",label:e.$t("labels.groupDescription")},scopedSlots:e._u([{key:"append",fn:function(){return[e.group.description?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-close-circle",color:"k-main"},on:{click:function(t){t.stopPropagation(),e.group.description=null}}}):e._e()]},proxy:!0}],null,!1,4087788951),model:{value:e.group.description,callback:function(t){e.$set(e.group,"description",t)},expression:"group.description"}})],1)],1),t("q-item",[t("q-item-section",[t("q-select",{ref:"group-dependson",attrs:{color:"k-controls",label:e.$t("labels.groupDependsOn"),options:e.groupNames,multiple:""},on:{filter:e.filterGroups},scopedSlots:e._u([{key:"append",fn:function(){return[e.group.dependsOn?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-close-circle",color:"k-main"},on:{click:function(t){t.stopPropagation(),e.group.dependsOn=null}}}):e._e()]},proxy:!0}],null,!1,2249231703),model:{value:e.group.dependsOn,callback:function(t){e.$set(e.group,"dependsOn",t)},expression:"group.dependsOn"}})],1)],1),t("q-item",{staticStyle:{"padding-top":"1.5rem","padding-bottom":"1.5rem"}},[t("q-item-section",[t("q-item-label",[e._v(e._s(e.$t("labels.groupDefaultExpirationTime")))])],1),t("q-item-section",{attrs:{side:""}},[t("q-select",{ref:"group-desfaultExpirationTimeYear",attrs:{dense:"",standout:"bg-teal text-white",color:"k-controls",options:e.availableYears},model:{value:e.group.defaultExpirationTimePeriod.year,callback:function(t){e.$set(e.group.defaultExpirationTimePeriod,"year",t)},expression:"group.defaultExpirationTimePeriod.year"}})],1),t("q-item-section",{attrs:{side:""}},[t("q-item-label",[e._v(e._s(e.$t("labels.year")))])],1),t("q-item-section",{attrs:{side:""}},[t("q-select",{ref:"group-desfaultExpirationTimeMonth",attrs:{dense:"",standout:"bg-teal text-white",color:"k-controls",options:e.availableMonths},model:{value:e.group.defaultExpirationTimePeriod.month,callback:function(t){e.$set(e.group.defaultExpirationTimePeriod,"month",t)},expression:"group.defaultExpirationTimePeriod.month"}})],1),t("q-item-section",{attrs:{side:""}},[t("q-item-label",[e._v(e._s(e.$t("labels.month")))])],1),t("q-item-section",{attrs:{side:""}},[t("q-select",{ref:"group-desfaultExpirationTimeDay",attrs:{dense:"",standout:"bg-teal text-white",color:"k-controls",options:e.availableDays},model:{value:e.group.defaultExpirationTimePeriod.day,callback:function(t){e.$set(e.group.defaultExpirationTimePeriod,"day",t)},expression:"group.defaultExpirationTimePeriod.day"}})],1),t("q-item-section",{attrs:{side:""}},[t("q-item-label",[e._v(e._s(e.$t("labels.day")))])],1)],1),t("q-item",[t("q-item-section",[t("q-checkbox",{ref:"group-worldview",staticClass:"q-pa-sm",attrs:{color:"k-controls",label:e.$t("labels.chkWorldView")},model:{value:e.group.worldview,callback:function(t){e.$set(e.group,"worldview",t)},expression:"group.worldview"}})],1),t("q-item-section",[t("q-checkbox",{ref:"group-chkComplimentary",staticClass:"q-pa-sm",attrs:{color:"k-controls",label:e.$t("labels.chkComplimentary")},model:{value:e.group.complimentary,callback:function(t){e.$set(e.group,"complimentary",t)},expression:"group.complimentary"}})],1),t("q-item-section",[t("q-checkbox",{ref:"group-optin",staticClass:"q-pa-sm",attrs:{color:"k-controls","toggle-order":"ft",dense:"",label:e.$t("labels.chkOptIn")},model:{value:e.group.optIn,callback:function(t){e.$set(e.group,"optIn",t)},expression:"group.optIn"}})],1)],1),t("q-item",[t("q-item-section",[t("q-item-label",[e._v(e._s(e.$t("labels.groupProjectUrls")))])],1),t("q-item-section",{staticClass:"col-1",attrs:{side:""}},[t("q-btn",{staticClass:"gfc-buttons",attrs:{icon:"mdi-plus",round:"",color:"k-controls",size:"xs"},on:{click:e.newProjectUrl}})],1),t("q-item-section",{attrs:{side:""}},[t("q-btn",{staticClass:"gfc-buttons",attrs:{disable:-1===e.selectedProjectUrlIdx,icon:"mdi-trash-can",round:"",color:"k-red",size:"xs"},on:{click:e.deleteProjectUrl}})],1)],1),t("q-item",{staticClass:"gfc-list no-padding"},[t("q-list",{staticClass:"full-width",attrs:{dense:""}},e._l(e.group.projectUrls,(function(s,a){return t("q-item",{key:a,staticClass:"gfc-prjurl-item",attrs:{clickable:"",active:e.selectedProjectUrlIdx===a,"active-class":"gfc-active"},on:{click:function(t){e.selectedProjectUrlIdx===a?e.selectedProjectUrlIdx=-1:e.selectedProjectUrlIdx=a}}},[t("q-item-section",[t("q-item-label",{staticClass:"gfc-prjurl-label"},[e._v(e._s(s))])],1)],1)})),1)],1),t("q-item",[t("q-item-section",[t("q-input",{ref:"project-url",attrs:{color:"k-controls",label:e.$t("labels.groupProjectUrl"),dense:""},model:{value:e.projectUrl,callback:function(t){e.projectUrl=t},expression:"projectUrl"}})],1),t("q-item-section",{attrs:{side:""}},[t("q-btn",{staticClass:"gfc-buttons",attrs:{disable:null===e.projectUrl,icon:"mdi-check",round:"",color:"k-controls",size:"xs"},on:{click:e.applyProjectUrl}})],1)],1)],1),t("q-list",[t("q-item",[t("q-item-section",[t("q-item-label",[e._v(e._s(e.$t("labels.associatedObservables")))])],1),t("q-item-section",{staticClass:"col-1",attrs:{side:""}},[t("q-btn",{staticClass:"gfc-buttons",attrs:{icon:"mdi-plus",round:"",color:"k-controls",size:"xs"},on:{click:function(t){return e.openObservableDialog()}}})],1),t("q-item-section",{staticClass:"col-1",attrs:{side:""}},[t("q-btn",{staticClass:"gfc-buttons",attrs:{disable:!e.selectedObservable.obs,icon:"mdi-pencil",round:"",color:"k-main",size:"xs"},on:{click:function(t){return e.openObservableDialog(e.selectedObservable.index)}}})],1),t("q-item-section",{attrs:{side:""}},[t("q-btn",{staticClass:"gfc-buttons",attrs:{disable:!e.selectedObservable.obs,icon:"mdi-trash-can",round:"",color:"k-red",size:"xs"},on:{click:e.deleteObservable}})],1)],1),t("q-item",{staticClass:"gfc-list no-padding"},[t("q-list",{staticClass:"full-width",attrs:{dense:""}},e._l(e.filteredObservables,(function(s,a){return t("q-item",{key:a,staticClass:"gfc-observable",class:{"gfc-is-separator":s.separator},attrs:{clickable:"","data-observable":s.id,"active-class":"gfc-active",active:e.selectedObservable&&e.selectedObservable.index===a,id:`gfc-obs-${a}`},on:{click:function(t){return e.selectObservable(s,a)}}},[t("q-item-section",[t("q-item-label",[e._v(e._s(s.label))])],1)],1)})),1)],1),t("q-item",{staticClass:"no-margin"},[t("q-item-section",[t("q-input",{directives:[{name:"show",rawName:"v-show",value:0!==e.filteredObservables.length,expression:"filteredObservables.length !== 0"}],attrs:{color:"k-controls",dense:"","hide-bottom-space":""},scopedSlots:e._u([{key:"append",fn:function(){return[t("q-icon",{attrs:{name:"mdi-magnify",color:"k-main"}}),e.filter&&""!==e.filter?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-close-circle",color:"k-main"},on:{click:function(t){t.stopPropagation(),e.filter=null}}}):e._e()]},proxy:!0}],null,!1,1431778307),model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}})],1),t("q-item-section",{staticClass:"col-1",attrs:{side:""}},[t("q-btn",{staticClass:"gfc-buttons",attrs:{disable:!e.selectedObservable.obs,icon:"mdi-arrow-collapse-up",round:"",color:"k-main",size:"xs"},on:{click:function(t){return e.moveObservable("FIRST")}}})],1),t("q-item-section",{staticClass:"col-1",attrs:{side:""}},[t("q-btn",{staticClass:"gfc-buttons",attrs:{disable:!e.selectedObservable.obs,icon:"mdi-arrow-up",round:"",color:"k-main",size:"xs"},on:{click:function(t){return e.moveObservable("PREV")}}})],1),t("q-item-section",{staticClass:"col-1",attrs:{side:""}},[t("q-btn",{staticClass:"gfc-buttons",attrs:{disable:!e.selectedObservable.obs,icon:"mdi-arrow-down",round:"",color:"k-main",size:"xs"},on:{click:function(t){return e.moveObservable("NEXT")}}})],1),t("q-item-section",{attrs:{side:""}},[t("q-btn",{staticClass:"gfc-buttons",attrs:{disable:!e.selectedObservable.obs,icon:"mdi-arrow-collapse-down",round:"",color:"k-main",size:"xs"},on:{click:function(t){return e.moveObservable("LAST")}}})],1)],1),t("KhubCustomPropertiesEditableTable",{attrs:{customProperties:this.group.customProperties,type:"GROUP",admin:"true"}}),t("q-item",{staticClass:"q-pa-md"},[t("q-item-section",[t("q-btn",{attrs:{color:"k-controls",label:e.$t("labels.submitForm")},on:{click:e.submitGroup}})],1),t("q-item-section",[t("q-btn",{attrs:{color:"k-red",label:e.$t("labels.cancelForm")},on:{click:e.closeDialog}})],1)],1)],1)],1),e.selectedObservable.obs?t("q-dialog",{attrs:{"no-backdrop-dismiss":""},model:{value:e.observableDialog,callback:function(t){e.observableDialog=t},expression:"observableDialog"}},[t("q-card",{staticClass:"gfc-observable-card ka-dialog"},[t("q-card-section",{staticClass:"ka-dialog-title"},[e._v(e._s(e.selectedObservable.obs.label?e.selectedObservable.obs.label:e.$t("labels.observableAdd")))]),t("q-separator"),t("q-card-section",{staticClass:"q-pa-xs"},[t("q-list",[t("q-item",[t("q-item-section",[t("q-input",{ref:"obs-label",attrs:{color:"k-controls",dense:"",disable:-1!==e.selectedObservable.index,rules:[t=>e.fieldRequired(t)],label:e.$t("labels.observableLabel")},scopedSlots:e._u([{key:"append",fn:function(){return[e.selectedObservable.obs.label&&-1===e.selectedObservable.index?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-close-circle",color:"k-main"},on:{click:function(t){t.stopPropagation(),e.selectedObservable.obs.label=null}}}):e._e()]},proxy:!0}],null,!1,955453402),model:{value:e.selectedObservable.obs.label,callback:function(t){e.$set(e.selectedObservable.obs,"label",t)},expression:"selectedObservable.obs.label"}})],1)],1),t("q-item",[t("q-item-section",[t("q-checkbox",{ref:"obs-isseparator",attrs:{color:"k-controls",dense:"",label:e.$t("labels.observableIsSeparator")},model:{value:e.selectedObservable.obs.separator,callback:function(t){e.$set(e.selectedObservable.obs,"separator",t)},expression:"selectedObservable.obs.separator"}})],1)],1),t("q-item",[t("q-item-section",[t("q-input",{ref:"obs-observable",attrs:{color:"k-controls",dense:"",disable:e.selectedObservable.obs.separator,rules:[t=>e.selectedObservable.obs.separator||e.fieldRequired(t)],label:e.$t("labels.observableObservable")},model:{value:e.selectedObservable.obs.observable,callback:function(t){e.$set(e.selectedObservable.obs,"observable",t)},expression:"selectedObservable.obs.observable"}})],1)],1),t("q-item",[t("q-item-section",[t("q-select",{ref:"obs-semantic",attrs:{color:"k-controls",dense:"",disable:e.selectedObservable.obs.separator,rules:[t=>e.selectedObservable.obs.separator||e.fieldRequired(t)],label:e.$t("labels.observableSemantic"),options:e.semantics},scopedSlots:e._u([{key:"append",fn:function(){return[e.selectedObservable.obs.semantic?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-close-circle",color:"k-main"},on:{click:function(t){t.stopPropagation(),e.selectedObservable.obs.semantic=null}}}):e._e()]},proxy:!0}],null,!1,1821730903),model:{value:e.selectedObservable.obs.semantics,callback:function(t){e.$set(e.selectedObservable.obs,"semantics",t)},expression:"selectedObservable.obs.semantics"}})],1)],1),t("q-item",[t("q-item-section",[t("q-input",{ref:"obs-description",attrs:{color:"k-controls",dense:"",autogrow:"",label:e.$t("labels.observableDescription")},scopedSlots:e._u([{key:"append",fn:function(){return[e.selectedObservable.obs.description?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-close-circle",color:"k-main"},on:{click:function(t){t.stopPropagation(),e.selectedObservable.obs.description=null}}}):e._e()]},proxy:!0}],null,!1,2866138295),model:{value:e.selectedObservable.obs.description,callback:function(t){e.$set(e.selectedObservable.obs,"description",t)},expression:"selectedObservable.obs.description"}})],1)],1),t("q-item",[t("q-item-section",[t("q-select",{ref:"obs-state",attrs:{color:"k-controls",dense:"",disable:e.selectedObservable.obs.separator,rules:[t=>e.selectedObservable.obs.separator||e.fieldRequired(t)],label:e.$t("labels.observableState"),options:e.observableStates},model:{value:e.selectedObservable.obs.state,callback:function(t){e.$set(e.selectedObservable.obs,"state",t)},expression:"selectedObservable.obs.state"}})],1)],1),-1===e.selectedObservable.index?t("q-item",[t("q-item-section",[t("q-select",{ref:"obs-insertionPoint",attrs:{color:"k-controls",dense:"",label:e.$t("labels.observableInsertionPoint"),rules:[t=>e.fieldRequired(t)],options:e.insertionPoint},model:{value:e.selectedObservable.insertionPoint,callback:function(t){e.$set(e.selectedObservable,"insertionPoint",t)},expression:"selectedObservable.insertionPoint"}})],1)],1):e._e(),t("q-item",[t("q-item-section",[t("q-input",{ref:"obs-extdescription",attrs:{color:"k-controls",dense:"",disable:e.selectedObservable.obs.separator,autogrow:"",label:e.$t("labels.observableExtendedDescription")},scopedSlots:e._u([{key:"append",fn:function(){return[e.selectedObservable.obs.extendedDescription?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-close-circle",color:"k-main"},on:{click:function(t){t.stopPropagation(),e.selectedObservable.obs.extendedDescription=null}}}):e._e()]},proxy:!0}],null,!1,197310871),model:{value:e.selectedObservable.obs.extendedDescription,callback:function(t){e.$set(e.selectedObservable.obs,"extendedDescription",t)},expression:"selectedObservable.obs.extendedDescription"}})],1)],1)],1)],1),t("q-card-actions",{attrs:{align:"right"}},[t("q-btn",{attrs:{label:e.$t("labels.submitForm"),color:"k-controls"},on:{click:e.insertNewObservable}}),t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{label:e.$t("labels.cancelForm"),color:"k-red"},on:{click:e.resetNewObservable}})],1)],1)],1):e._e()],1)]):e._e()},va=[],ka={props:{newGroup:{type:Boolean,default:!1}},mixins:[pt],data(){return{availableYears:[...Array(100)].map(((e,t)=>t)),availableMonths:[...Array(13)].map(((e,t)=>t)),availableDays:[...Array(32)].map(((e,t)=>t)),availableRoles:Object.keys(re["l"]).map((e=>re["l"][e].value)),semantics:Object.keys(re["m"]).map((e=>e)),selectedObservable:{},selectedProjectUrlIdx:-1,projectUrl:null,observableDialog:!1,customPropertyDialog:!1,editedItem:{},filter:null,changed:!1,iconError:!1,observableStates:Object.keys(re["h"]).map((e=>e)),waiting:!1,columns:[{name:"key",required:!0,label:this.$t("labels.key"),align:"left",field:e=>e.key,format:e=>`${e}`,sortable:!0},{name:"value",required:!0,align:"left",label:this.$t("labels.value"),field:e=>e.value,sortable:!0}]}},name:"GroupEditCard",computed:{...Object(W["c"])("admin",["group","groups"]),open:{set(e){e||this.resetGroup()},get(){return null!==this.group}},iconSrc(){return!this.iconError&&this.group.iconUrl?this.group.iconUrl:re["d"].IMAGE_NOT_FOUND_SRC},availableGroups(){return this.groups.map((e=>e.name))},filteredObservables(){return this.group.observables?this.filter&&""!==this.filter?this.group.observables.filter((e=>-1!==e.label.toLowerCase().indexOf(this.filter))):this.group.observables:[]},insertionPoint(){const e=[this.FIRST_OBS,this.LAST_OBS,...this.group.observables.map(((e,t)=>({value:t+1,label:`After '${e.label}'`})))];return e},groupNames(){return this.groups.map((e=>e.name))}},methods:{...Object(W["b"])("admin",["resetGroup","updateGroup","deleteGroup","createGroup"]),submitGroup(){this.$refs["group-name"].validate(),this.group.defaultExpirationTime=ba(this.group.defaultExpirationTimePeriod),this.newGroup?this.createGroup(this.group).then((()=>{this.$q.notify({message:this.$t("messages.groupCreated",{group:this.group.name}),color:"positive",timeout:1e3}),this.resetGroup()})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.groupCreatedError"),color:"negative",timeout:1500}),this.resetGroup()})):this.updateGroup(this.group).then((()=>{this.$q.notify({message:this.$t("messages.groupUpdated",{group:this.group.name}),color:"positive",timeout:1e3}),this.resetGroup()})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.groupUpdatedError"),color:"negative",timeout:1500}),this.resetGroup()})),this.projectUrl="",this.selectedProjectUrlIdx=-1},closeDialog(){this.projectUrl="",this.selectedProjectUrlIdx=-1,this.open=!1},newProjectUrl(){this.projectUrl="",this.selectedProjectUrlIdx=-1,this.$refs["project-url"].focus()},applyProjectUrl(){this.projectUrl&&""!==this.projectUrl&&(-1===this.selectedProjectUrlIdx?(this.group.projectUrls.push(this.projectUrl),this.selectedProjectUrlIdx=this.group.projectUrls.length-1):this.group.projectUrls.splice(this.selectedProjectUrlIdx,1,this.projectUrl),this.projectUrl="",this.selectedProjectUrlIdx=-1)},deleteProjectUrl(){this.$q.dialog({title:this.$t("messages.confirmRemoveTitle"),message:this.$t("messages.confirmRemoveProjectUrlMsg"),ok:{color:"k-controls"},cancel:{color:"k-red"},persistent:!0}).onOk((()=>{-1!==this.selectedProjectUrlIdx&&(this.group.projectUrls.splice(this.selectedProjectUrlIdx,1),this.selectedProjectUrlIdx=-1)}))},openObservableDialog(e=-1){-1===e&&this.initNewObservable(),this.$nextTick((()=>{this.observableDialog=!0}))},selectObservable(e,t){if(this.selectedObservable.index===t)this.resetNewObservable();else{const s=0===t?this.insertionPoint[0]:t===this.group.observables.length-1?this.insertionPoint[1]:this.insertionPoint[t+2];this.selectedObservable={obs:e,index:t,insertionPoint:s}}},filterGroups(e,t){t(null!==e&&""!==e?()=>{const t=e.toLowerCase();this.groupNames=this.availableGroups.filter((e=>e.toLowerCase().indexOf(t)>-1))}:()=>{this.groupNames=this.availableGroups})},moveObservable(e){if(this.selectedObservable.obs){const t="NEXT"===e?this.selectedObservable.index+1:"PREV"===e?this.selectedObservable.index-1:"FIRST"===e?0:this.group.observables.length-1,s=or(this.group.observables,this.selectedObservable.index,t);this.selectedObservable.index=s,this.$nextTick((()=>{const e=document.getElementById(`gfc-obs-${s}`);e&&e.scrollIntoView({behavior:"smooth",block:"center"})}))}},insertNewObservable(){this.$refs["obs-label"].validate(),this.$refs["obs-observable"].validate(),this.$refs["obs-semantic"].validate(),this.$refs["obs-state"].validate(),this.$refs["obs-insertionPoint"]&&this.$refs["obs-insertionPoint"].validate(),this.$refs["obs-label"].hasError||this.$refs["obs-observable"].hasError||this.$refs["obs-semantic"].hasError||this.$refs["obs-state"].hasError||this.$refs["obs-insertionPoint"]&&this.$refs["obs-insertionPoint"].hasError||(this.group.observables?-1!==this.selectedObservable.index?this.group.observables.splice(this.selectedObservable.index,1,this.selectedObservable.obs):this.selectedObservable.insertionPoint.value===this.FIRST_OBS.value?this.group.observables.unshift(this.selectedObservable.obs):this.selectedObservable.insertionPoint.value===this.LAST_OBS.value?this.group.observables.push(this.selectedObservable.obs):this.group.observables.splice(this.selectedObservable.insertionPoint.value,0,this.selectedObservable.obs):(this.group.observables=[],this.group.observables.push(this.selectedObservable.obs)),this.observableDialog=!1)},initNewObservable(){this.selectedObservable={obs:{separator:!1},index:-1,insertionPoint:this.FIRST_OBS}},resetNewObservable(){this.selectedObservable={},this.observableDialog=!1},deleteObservable(){this.$q.dialog({title:this.$t("messages.confirmRemoveTitle"),message:this.$t("messages.confirmRemoveObservableMsg"),ok:{color:"k-controls"},cancel:{color:"k-red"},persistent:!0}).onOk((()=>{this.group.observables.splice(this.selectedObservable.index,1),this.resetNewObservable()}))},showCustomPropertyDialog(){this.customPropertyDialog=!0}},watch:{selectedProjectUrlIdx(e){this.projectUrl=-1===e?null:this.group.projectUrls[this.selectedProjectUrlIdx]}},mounted(){this.FIRST_OBS={value:"F",label:this.$t("labels.observableInsertFirst")},this.LAST_OBS={value:"L",label:this.$t("labels.observableInsertLast")}},components:{KhubCustomPropertiesEditableTable:xt}},_a=ka,Ta=(s("099e"),Object(X["a"])(_a,Ea,va,!1,null,null,null)),wa=Ta.exports;Se()(Ta,"components",{QDialog:x["a"],QCard:q["a"],QList:h["a"],QItem:g["a"],QItemSection:b["a"],QInput:E["a"],QIcon:m["a"],QAvatar:A["a"],QSelect:k["a"],QItemLabel:f["a"],QCheckbox:T["a"],QBtn:p["a"],QCardSection:M["a"],QSeparator:O["a"],QCardActions:Q["a"],QTable:I["a"]}),Se()(Ta,"directives",{ClosePopup:F["a"]});var ya={name:"GroupsComponent",components:{GroupFormCard:wa,KlabLoading:qe},data(){return{refreshing:!1,waiting:!1,newGroup:!1,columns:[{name:"icon",field:"iconUrl",required:!0,label:this.$t("labels.groupIcon"),align:"center",sortable:!0},{name:"name",field:"name",required:!0,label:this.$t("labels.groupName"),align:"center",sortable:!0},{name:"description",field:"description",required:!0,label:this.$t("labels.groupDescription"),align:"left",sortable:!0},{name:"dependsOn",field:"dependsOn",required:!1,label:this.$t("labels.groupDependsOn"),align:"left",sortable:!0},{name:"worldview",field:e=>e.worldview,format:e=>e?"🗹":"☐",required:!1,label:this.$t("labels.groupWorldView"),classes:"ka-dense"},{name:"complimentary",field:e=>e.complimentary,format:e=>e?"🗹":"☐",required:!1,label:this.$t("labels.groupComplimentary"),align:"left",classes:"ka-dense"},{name:"optIn",field:e=>e.optIn,format:e=>e?"🗹":"☐",required:!1,label:this.$t("labels.groupOptionOptIn"),style:"color: white"},{name:"defaultExpirationTime",field:e=>e.defaultExpirationTime,format:e=>fa(ga(e)),required:!1,label:this.$t("labels.groupDefaultExpirationTime"),align:"left"},{name:"projectUrls",field:"projectUrls",required:!1,label:this.$t("labels.groupProjectUrls"),align:"left",sortable:!0},{name:"observables",field:"observables",required:!1,label:this.$t("labels.groupObservables"),align:"left",sortable:!0},{name:"sshKey",field:"sshKey",required:!1,label:this.$t("labels.groupSshKey"),align:"left",sortable:!0},{name:"customProperties",component:"table",field:"customProperties",required:!1,label:this.$t("labels.groupCustomProperties"),align:"left",columns:[{name:"key",required:!0,label:this.$t("labels.key"),align:"left",field:e=>e.key,format:e=>`${e}`,style:"max-width: 5rem;",headerStyle:"max-width: 4rem",sortable:!0,classes:"ellipsis"},{name:"value",required:!0,align:"left",label:this.$t("labels.value"),field:e=>e.value,style:"max-width: 4rem",classes:"ellipsis",sortable:!0},{name:"onlyAdmin",required:!0,align:"center",label:this.$t("labels.visible"),field:e=>e.onlyAdmin,format:e=>e?"🗹":"☐",style:"max-width: 2rem;width: 2rem;",sortable:!0}]}],APP_CONSTANTS:re["d"],usersCountCounter:0}},computed:{...Object(W["c"])("admin",["groups","group"])},methods:{...Object(W["b"])("admin",["loadGroups","loadGroup","deleteGroup"]),refreshGroups(){this.refreshing=!0,this.loadGroups().then((()=>{this.refreshing=!1,this.$q.notify({message:this.$t("messages.groupsLoaded"),color:"positive",timeout:1e3}),this.usersCountCounter=this.groups.length,this.groups.forEach((e=>{sr({type:re["u"].USERS_WITH_GROUP.method,url:re["u"].USERS_WITH_GROUP.url.replace("{group}",e.name),needAuth:!0},((t,s)=>{t&&t.data&&(e.usersCount=t.data.length,this.usersCountCounter-=1),s()}))}))})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.groupsLoadedError"),color:"negative",timeout:1500}),this.refreshing=!1}))},removeGroup(e){this.$q.dialog({title:this.$t("messages.confirm"),message:this.$t("messages.confirmRemoveGroupMsg",{group:`${e}`}),html:!0,ok:{color:"k-controls"},cancel:{color:"k-red"},persistent:!0}).onOk((()=>{this.waiting=!0,this.deleteGroup(e).then((()=>{this.waiting=!1,this.$q.notify({message:this.$t("messages.groupDeleted",{group:e}),color:"positive",timeout:1e3}),this.loadGroups()})).catch((t=>{console.error(t),this.waiting=!1,this.$q.notify({message:this.$t("messages.groupDeletedError",{group:e}),color:"negative",timeout:1500})}))}))},openDialog(e=null){this.waiting=!0,this.loadGroup(e).then((()=>{this.waiting=!1,this.newGroup=null===e})).catch((e=>{console.error(e),this.waiting=!1,this.newGroup=!1}))}},mounted(){this.refreshGroups()}},Ca=ya,Sa=(s("8f27"),Object(X["a"])(Ca,da,pa,!1,null,null,null)),Aa=Sa.exports;Se()(Sa,"components",{QIcon:m["a"],QTooltip:R["a"],QBtn:p["a"],QTable:I["a"],QCard:q["a"],QItem:g["a"],QItemSection:b["a"],QItemLabel:f["a"],QSeparator:O["a"],QList:h["a"]});var qa=function(){var e=this,t=e._self._c;return t("div",{staticClass:"ka-content"},[t("h2",{staticClass:"kh-h-first"},[e._v(e._s(e.$t("contents.adminTasksTitle"))+"\n "),t("q-icon",{staticClass:"cursor-pointer text-k-main ka-refresh",class:{"ka-refreshing":e.refreshing},attrs:{name:"mdi-refresh"},on:{click:e.refreshTasks}},[t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0]}},[e._v(e._s(e.$t("labels.refreshTasks")))])],1)],1),e.tasks.length>0?t("div",[t("div",{staticClass:"row full-width ka-filters",class:[e.filtered?"ka-filtered":""]},[t("div",{staticClass:"row full-width"},[t("div",{staticClass:"col-6"},[t("div",{staticClass:"row full-width"},[t("q-input",{staticClass:"q-pa-sm col",attrs:{color:"k-controls",dense:"",clearable:"",label:e.$t("labels.taskUser"),tabindex:"1"},model:{value:e.filter.user,callback:function(t){e.$set(e.filter,"user",t)},expression:"filter.user"}})],1)]),t("div",{staticClass:"col-6"},[t("div",{staticClass:"row full-width"},[t("k-input-date",{ref:"issuedFrom",attrs:{classes:"q-pa-sm col-6",color:"k-controls",dense:"",label:e.$t("labels.taskIssuedFrom"),tabindex:"10"},on:{input:function(t){return e.checkDates("issued","From")}},model:{value:e.filter.issuedFrom,callback:function(t){e.$set(e.filter,"issuedFrom",t)},expression:"filter.issuedFrom"}}),t("k-input-date",{attrs:{classes:"q-pa-sm col-6",color:"k-controls",dense:"",label:e.$t("labels.taskClosedFrom"),disable:e.filter.open,tabindex:"12"},on:{input:function(t){return e.checkDates("closed","From")}},model:{value:e.filter.closedFrom,callback:function(t){e.$set(e.filter,"closedFrom",t)},expression:"filter.closedFrom"}})],1)])]),t("div",{staticClass:"row full-width"},[t("div",{staticClass:"col-6"},[t("div",{staticClass:"row full-width"},[t("q-select",{staticClass:"q-pa-sm col-6",attrs:{color:"k-controls","options-selected-class":"text-k-controls",options:e.taskStatusOptions,label:e.$t("labels.taskStatus"),dense:"","options-dense":"",clearable:"",multiple:"",tabindex:"1"},model:{value:e.filter.status,callback:function(t){e.$set(e.filter,"status",t)},expression:"filter.status"}}),t("q-select",{staticClass:"q-pa-sm col-6",attrs:{color:"k-controls","options-selected-class":"text-k-controls",options:e.types,label:e.$t("labels.taskType"),dense:"","options-dense":"",multiple:"",clearable:"",tabindex:"3"},model:{value:e.filter.type,callback:function(t){e.$set(e.filter,"type",t)},expression:"filter.type"}})],1)]),t("div",{staticClass:"col-6"},[t("div",{staticClass:"row full-width"},[t("k-input-date",{ref:"issuedTo",attrs:{classes:"q-pa-sm col-6",color:"k-controls",dense:"",label:e.$t("labels.taskIssuedTo"),tabindex:"11"},on:{input:function(t){return e.checkDates("issued","To")}},model:{value:e.filter.issuedTo,callback:function(t){e.$set(e.filter,"issuedTo",t)},expression:"filter.issuedTo"}}),t("k-input-date",{ref:"closedTo",attrs:{classes:"q-pa-sm col-6",color:"k-controls",dense:"",label:e.$t("labels.taskClosedTo"),disable:e.filter.open,tabindex:"13"},on:{input:function(t){return e.checkDates("closed","To")}},model:{value:e.filter.closedTo,callback:function(t){e.$set(e.filter,"closedTo",t)},expression:"filter.closedTo"}})],1),t("div",{staticClass:"row full-width"},[t("div",{staticClass:"q-pa-sm col-6"}),t("q-checkbox",{staticClass:"q-pa-sm col-6",staticStyle:{height:"56px"},attrs:{color:"k-main",dense:"",label:e.$t("labels.taskOpen"),"left-label":"",tabindex:"14"},model:{value:e.filter.open,callback:function(t){e.$set(e.filter,"open",t)},expression:"filter.open"}})],1)])]),t("div",{staticClass:"row full-width ka-filter-info q-pa-sm"},[t("div",{staticClass:"col-6 self-end"},[e._v(e._s(e.$t("labels.filterInfo",{filtered:e.filtered?e.$t("labels.filtered"):e.$t("labels.all"),element:e.$t("menu.tasks"),number:e.rowsNumber})))]),t("div",{staticClass:"col text-right"},[t("q-btn",{staticClass:"ka-action-button",attrs:{label:e.$t("labels.clearSearch"),disabled:!e.filtered,color:"k-main"},on:{click:e.initializeFilter}})],1)])]),t("div",{staticClass:"row full-width ka-actions q-ma-md"},[t("div",{staticClass:"row full-width q-pa-xs ka-selected-info"},[e.pendingTasks.length>0?t("div",{staticClass:"inline-block",domProps:{innerHTML:e._s(e.$t("labels.selectedInfo",{selected:e.selected.length,total:e.pendingTasks.length,type:e.$t("labels.tasks")}))}}):t("div",{staticClass:"inline-block"},[e._v(e._s(e.$t("messages.noPendingTasks")))]),e.selected.length>0?t("div",{staticClass:"inline-block q-pa-xs"},[t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-checkbox-multiple-blank-outline",size:"1.8em"},on:{click:function(t){return e.selected.splice(0,e.selected.length)}}},[t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0]}},[e._v(e._s(e.$t("labels.unselectAll")))])],1)],1):e._e(),e.selected.length0||s.row.requestGroups.length>0?t("q-icon",{attrs:{name:"mdi-information",color:"k-controls",size:"xs"}},[t("q-popup-proxy",{attrs:{"transition-show":"flip-up","transition-hide":"flip-down"}},[s.row.log.length>0?t("q-list",{staticClass:"ktc-log",attrs:{dense:"",color:"k-main"}},e._l(s.row.log,(function(a,o){return t("q-item",{key:o,staticClass:"ktc-log-item",class:{"ktc-error":s.row.status===e.status.TASK_ERROR.value,"ktc-accepted":s.row.status===e.status.TASK_ACCEPTED.value,"ktc-denied":s.row.status===e.status.TASK_DENIED.value}},[t("q-item-section",[e._v(e._s(a))])],1)})),1):t("q-list",{staticClass:"ktc-log",attrs:{dense:"",color:"k-main"}},e._l(s.row.requestGroups,(function(s,a){return t("q-item",{key:a,staticClass:"ktc-log-item"},[t("q-item-section",[e._v(e._s(s))])],1)})),1)],1)],1):e._e()],1),t("q-td",{key:"type",attrs:{props:s}},[e.types.find((e=>e.value===s.row.type))?t("span",[e._v(e._s(e.types.find((e=>e.value===s.row.type)).label))]):t("span",[e._v(e._s(e.$t("label.taskTypeUnknown",{type:s.row.type})))])])],1)]}}],null,!1,3137487919)})],1):t("div",[t("div",{staticClass:"tc-no-tasks"},[e._v(e._s(e.$t("messages.noTasks")))])]),t("q-dialog",{attrs:{persistent:""},on:{"before-show":function(t){e.deniedMessage=null}},model:{value:e.deniedMessageDialog,callback:function(t){e.deniedMessageDialog=t},expression:"deniedMessageDialog"}},[t("q-card",{staticStyle:{"min-width":"350px"}},[t("q-card-section",[t("div",{staticClass:"text-h6"},[e._v(e._s(e.$t("messages.taskDeniedMessage")))])]),t("q-card-section",[t("q-input",{attrs:{dense:"",color:"k-controls",autofocus:""},on:{keyup:function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;e.deniedMessageDialog=!1}},model:{value:e.deniedMessage,callback:function(t){e.deniedMessage=t},expression:"deniedMessage"}})],1),t("q-card-actions",{attrs:{align:"right"}},[t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{label:e.$t("labels.btnCancel")}}),t("q-btn",{attrs:{label:e.$t("labels.btnAccept")},on:{click:e.denyTask}})],1)],1)],1),t("klab-loading",{attrs:{loading:e.waiting||e.refreshing,message:e.$t("messages.doingThings")}})],1)},Oa=[];const Ra={user:null,type:null,status:null,issuedFrom:null,issuedTo:null,closedFrom:null,closedTo:null,open:!1};var $a={name:"TasksComponent",components:{KInputDate:Tt,KlabLoading:qe},data(){return{selected:[],pagination:{sortBy:"issued",descending:!0,rowsPerPage:25,oldRowsPerPage:25},taskStatusOptions:[{label:re["p"].TASK_PENDING.label,value:re["p"].TASK_PENDING.value},{label:re["p"].TASK_ACCEPTED.label,value:re["p"].TASK_ACCEPTED.value},{label:re["p"].TASK_DENIED.label,value:re["p"].TASK_DENIED.value},{label:re["p"].TASK_ERROR.label,value:re["p"].TASK_ERROR.value}],filter:{...Ra},columns:[{name:"user",field:"user",required:!0,sortable:!0,label:this.$t("labels.taskUser"),align:"center",headerStyle:"width: 16%"},{name:"issued",field:"issued",required:!0,label:this.$t("labels.taskIssued"),align:"center",sortable:!0,sort:(e,t)=>rr(e,t),headerStyle:"width: 12%"},{name:"closed",field:"closed",required:!0,label:this.$t("labels.taskClosed"),align:"center",sortable:!0,sort:(e,t)=>rr(e,t),headerStyle:"width: 12%"},{name:"roleRequirement",field:"roleRequirement",required:!0,label:this.$t("labels.taskRoleRequirement"),align:"center",headerStyle:"width: 8%;"},{name:"autoAccepted",field:"autoAccepted",required:!0,label:this.$t("labels.taskAutoAccepted"),align:"center",headerStyle:"width: 12%; text-align: center"},{name:"next",field:"next",required:!0,label:this.$t("labels.taskNext"),align:"center",headerStyle:"width: 10%; text-align: center"},{name:"status",field:"status",required:!0,label:this.$t("labels.taskStatusLog"),align:"center",headerStyle:"width: 12%"},{name:"type",field:"type",required:!0,label:this.$t("labels.taskType"),align:"center",headerStyle:"width: 14%"}],roles:re["l"],status:re["p"],types:re["q"],rowsNumber:0,refreshing:!1,waiting:!1,deniedMessageDialog:!1,deniedMessage:null,statusAllAny:"any",typeAllAny:"any"}},computed:{...Object(W["c"])("admin",["tasks"]),pendingTasks(){return this.tasks.filter((e=>e.status===re["p"].TASK_PENDING.value))},filtered(){return!Jo(this.filter,Ra)}},methods:{...Object(W["b"])("admin",["loadTasks","loadGroups"]),formatDate:ar,selectAll(){this.tasks.forEach((e=>{e.status===re["p"].TASK_PENDING.value&&-1===this.selected.findIndex((t=>e.id===t.id))&&this.selected.push(e)})),0===this.selected.length&&this.$q.notify({message:this.$t("messages.noPendingTasks"),color:"warning"})},acceptTask(){const e=this.selected;e.forEach((e=>{this.$store.dispatch("admin/acceptTask",e.id).then((()=>{this.$q.notify({message:this.$t("messages.taskAccepted"),color:"positive"}),this.refreshTasks()})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.taskAcceptedError"),color:"negative"})}))}))},denyTask(){this.deniedMessageDialog=!1;const e=this.selected;e.forEach((e=>{this.$store.dispatch("admin/denyTask",{id:e.id,deniedMessage:this.deniedMessage}).then((()=>{this.$q.notify({message:this.$t("messages.taskDenied"),color:"positive"}),this.refreshTasks()})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.taskDeniedError"),color:"negative"})}))}))},formatStatus(e){switch(e){case re["p"].TASK_PENDING.value:return re["p"].TASK_PENDING.label;case re["p"].TASK_ACCEPTED.value:return re["p"].TASK_ACCEPTED.label;case re["p"].TASK_DENIED.value:return re["p"].TASK_DENIED.label;case re["p"].TASK_ERROR.value:return re["p"].TASK_ERROR.label;default:return e}},initializeFilter(){this.filter={...Ra},this.$refs.issuedFrom.reset(),this.$refs.issuedTo.reset(),this.$refs.closeFrom.reset(),this.$refs.closeTo.reset(),this.statusAllAny=!1,this.typeAllAny=!1},filterMethod(){return this.filtered?this.tasks.filter((e=>(null===this.filter.user||""===this.filter.user||e.user&&e.user.toLowerCase().includes(this.filter.user.toLowerCase()))&&(null===this.filter.type||0===this.filter.type.length||-1!==this.filter.type.findIndex((t=>t.value===e.type)))&&(null===this.filter.status||0===this.filter.status.length||-1!==this.filter.status.findIndex((t=>t.value===e.status)))&&(!this.filter.open||!e.closed)&&(null===this.filter.issuedFrom||e.issued&&bt()(this.filter.issuedFrom,"L").isSameOrBefore(e.issued))&&(null===this.filter.issuedTo||e.issued&&bt()(this.filter.issuedTo,"L").isSameOrAfter(e.issued))&&(null===this.filter.closedFrom||e.closed&&bt()(this.filter.closedFrom,"L").isSameOrBefore(e.closed)))):this.tasks},checkDates(e,t){const s=`${e}From`,a=`${e}To`;null!==this.filter[s]&&null!==this.filter[a]&&bt()(this.filter[s],"L").isSameOrAfter(bt()(this.filter[a],"L"))&&(this.$refs[`${e}${t}`].reset(),this.$q.notify({message:this.$t("messages.errorDateFromTo",{type:e}),color:"negative"}))},getPaginationLabel(e,t,s){return this.rowsNumber=s,this.$t("labels.pagination",{firstRowIndex:e,endRowIndex:t,totalRowsNumber:s})},refreshTasks(){this.refreshing=!0,this.loadTasks().then((()=>{this.refreshing=!1,this.$q.notify({message:this.$t("messages.tasksLoaded"),color:"positive",timeout:1e3}),this.selected.splice(0,this.selected.length)})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.tasksLoadedError"),color:"negative",timeout:1500}),this.refreshing=!1,this.selected.splice(0,this.selected.length)}))},confirm(e,t,s,a){this.$q.dialog({title:e,message:t,ok:{color:"k-controls",push:!0,flat:!0},cancel:{color:"k-controls",push:!0,flat:!0},persistent:!0}).onOk((()=>{s()})).onCancel((()=>{a()}))}},watch:{filtered(e){e?(this.pagination.oldRowsPerPage=this.pagination.rowsPerPage,this.pagination.rowsPerPage=0):this.pagination.rowsPerPage=this.pagination.oldRowsPerPage}},created(){this.refreshTasks(),bt.a.locale(this.$q.lang.getLocale())}},Pa=$a,Na=(s("bd3a"),Object(X["a"])(Pa,qa,Oa,!1,null,null,null)),xa=Na.exports;Se()(Na,"components",{QIcon:m["a"],QTooltip:R["a"],QInput:E["a"],QSelect:k["a"],QCheckbox:T["a"],QBtn:p["a"],QTable:I["a"],QTr:D["a"],QTh:G["a"],QTd:L["a"],QPopupProxy:y["a"],QList:h["a"],QItem:g["a"],QItemSection:b["a"],QDialog:x["a"],QCard:q["a"],QCardSection:M["a"],QCardActions:Q["a"]}),Se()(Na,"directives",{ClosePopup:F["a"]});var Ua=function(){var e=this,t=e._self._c;return t("div",{staticClass:"ka-content"},[t("h2",{staticClass:"kh-h-first"},[e._v(e._s(e.$t("contents.adminAgreementTemplatesTitle"))+"\n "),t("q-icon",{staticClass:"cursor-pointer text-k-controls ka-refresh",class:{"ka-refreshing":e.waiting},attrs:{name:"mdi-refresh"},on:{click:e.refreshAgreementTemplates}},[t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0]}},[e._v(e._s(e.$t("labels.refreshAgreementTemplates")))])],1)],1),t("div",{},[t("div",{staticClass:"row full-width ka-filters",class:[e.filtered?"ka-filtered":""]},[t("div",{staticClass:"row full-width"},[t("q-select",{staticClass:"q-pa-sm col-3",attrs:{color:"k-controls","options-selected-class":"text-k-controls",options:e.agreementLevelOptions,label:e.$t("labels.agreementLevel"),dense:"","options-dense":"",clearable:"",multiple:"",tabindex:"3"},model:{value:e.filter.agreementLevel,callback:function(t){e.$set(e.filter,"agreementLevel",t)},expression:"filter.agreementLevel"}}),t("q-select",{staticClass:"q-pa-sm col-3",attrs:{color:"k-controls","options-selected-class":"text-k-controls",options:e.agreementTypeOptions,label:e.$t("labels.agreementType"),dense:"","options-dense":"",clearable:"",multiple:"",tabindex:"3"},model:{value:e.filter.agreementType,callback:function(t){e.$set(e.filter,"agreementType",t)},expression:"filter.agreementType"}}),t("div",{staticClass:"q-pa-sm col-3"},[t("k-input-date",{ref:"registrationTo",attrs:{color:"k-controls",label:e.$t("labels.validDate"),dense:"",disable:e.filter.validDate,tabindex:"31"},on:{input:function(t){return e.checkDates("registration","To")}},model:{value:e.filter.validDate,callback:function(t){e.$set(e.filter,"validDate",t)},expression:"filter.validDate"}})],1),t("div",{staticClass:"q-pa-sm col-3"},[t("q-toggle",{attrs:{"toggle-indeterminate":"",label:e.$t("labels.toogleDefaultTemplate"),color:"k-controls"},model:{value:e.filter.defaultTemplate,callback:function(t){e.$set(e.filter,"defaultTemplate",t)},expression:"filter.defaultTemplate"}})],1),t("div",{staticClass:"row full-width"},[t("q-input",{staticClass:"q-pa-sm col-3",attrs:{color:"k-controls",dense:"",clearable:"",label:e.$t("labels.text")},model:{value:e.filter.text,callback:function(t){e.$set(e.filter,"text",t)},expression:"filter.text"}}),t("q-select",{staticClass:"q-pa-sm col-3",attrs:{color:"k-controls","options-selected-class":"text-k-controls",options:e.groupsOptions,label:e.$t("labels.defaultGroups"),dense:"","options-dense":"",clearable:"",multiple:"",tabindex:"3"},model:{value:e.filter.defaultGroup,callback:function(t){e.$set(e.filter,"defaultGroup",t)},expression:"filter.defaultGroup"}})],1)],1),t("div",{staticClass:"row full-width ka-filter-info q-pa-sm"},[t("div",{staticClass:"col-6 self-end"},[e._v(e._s(e.$t("labels.filterInfo",{filtered:e.filtered?e.$t("labels.filtered"):e.$t("labels.all"),element:e.$t("menu.agreementTemplates"),number:e.rowsNumber})))]),t("div",{staticClass:"col text-right"},[t("q-btn",{staticClass:"ka-action-button",attrs:{label:e.$t("labels.clearSearch"),disabled:!e.filtered,color:"k-controls"},on:{click:e.initializeFilter}})],1)])]),t("div",{staticClass:"row full-width ka-actions q-ma-md"},[t("div",{staticClass:"row full-width q-pa-xs ka-selected-info"},[t("div",{staticClass:"inline-block",domProps:{innerHTML:e._s(e.$t("labels.selectedInfo",{selected:e.selected.length,total:e.agreementTemplates.length,type:e.$t("labels.agreementTemplates")}))}}),e.selected.length>0?t("div",{staticClass:"inline-block q-pa-xs"},[t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-checkbox-multiple-blank-outline",size:"1.8em"},on:{click:function(t){return e.selected.splice(0,e.selected.length)}}},[t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0]}},[e._v(e._s(e.$t("labels.unselectAll")))])],1)],1):e._e(),e.selected.length0},on:{click:function(t){return e.showAgreementTemplateDialog(s.row.id)}}},[t("q-tooltip",{attrs:{anchor:"bottom middle",self:"top middle",offset:[0,8],delay:600}},[e._v(e._s(e.$t("labels.btnUpdateAgreementTemplate")))])],1),t("q-btn",{attrs:{icon:"mdi-trash-can",round:"",color:"k-red",size:"sm",disable:e.selected.length>0},on:{click:function(t){return e.removeAgreementTemplate([s.row])}}},[t("q-tooltip",{attrs:{anchor:"bottom middle",self:"top middle",offset:[0,8],delay:600}},[e._v(e._s(e.$t("labels.deleteAgreementTemplate")))])],1)],1)],1)]}}])})],1),t("q-dialog",{staticClass:"ka-dialog",model:{value:e.showTextDialogModel,callback:function(t){e.showTextDialogModel=t},expression:"showTextDialogModel"}},[t("q-card",{staticStyle:{"min-width":"600px"}},[t("q-card-section",[t("div",{staticClass:"text-h6 q-pa-sm ka-dialog-title"},[e._v("Agreement template's text")])]),t("q-card-section",[t("div",{staticClass:"q-ml-sm",domProps:{innerHTML:e._s(e.selectedRow)}})]),t("q-card-actions",{staticClass:"q-ma-md text-primary",attrs:{align:"right"}},[t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{label:e.$t("labels.btnClose"),color:"k-controls",tabindex:"55"}})],1)],1)],1),t("AgreementTemplateComponentDialog",{attrs:{newAgreementTemplate:e.newAgreementTemplate},on:{refreshPage:e.refreshAgreementTemplates}}),t("klab-loading",{attrs:{loading:e.waiting,message:e.$t("messages.doingThings")}})],1)},Ia=[];function La(e,t){const s=`${e}From`,a=`${e}To`;null!==this.filter[s]&&null!==this.filter[a]&&bt()(this.filter[s],"L").isSameOrAfter(bt()(this.filter[a],"L"))&&(this.$refs[`${e}${t}`].reset(),this.$q.notify({message:this.$t("messages.errorDateFromTo",{type:e}),color:"negative"}))}var Da=function(){var e=this,t=e._self._c;return null!==e.agreementTemplate?t("q-dialog",{attrs:{persistent:""},model:{value:e.open,callback:function(t){e.open=t},expression:"open"}},[t("div",{staticClass:"ka-dialog",staticStyle:{"max-width":"fit-content"}},[t("q-card",{staticStyle:{"max-width":"100%",width:"1300px",overflow:"hidden"}},[t("q-card-section",[t("div",{staticClass:"text-h2 q-pa-sm ka-dialog-title"},[e._v("Agreement template")]),t("q-separator",{staticClass:"ka-dialog-title-separator k-controls"})],1),t("q-card-section",[t("div",{staticClass:"row q-col-gutter-lg q-pa-sm"},[t("q-select",{ref:"agreementLevel",staticClass:"col-lg-3 col-xs-12 col-sm-6",attrs:{color:"k-controls","options-selected-class":"text-k-controls",label:e.$t("labels.agreementLevel"),clearable:"",tabindex:"1",options:e.agreementLevelOptions,rules:[t=>e.fieldRequired(t)]},model:{value:e.agreementLevelModel,callback:function(t){e.agreementLevelModel=t},expression:"agreementLevelModel"}}),t("q-select",{ref:"agreementType",staticClass:"col-lg-3 col-xs-12 col-sm-6",attrs:{color:"k-controls","options-selected-class":"text-k-controls",options:e.agreementTypeOptions,label:e.$t("labels.agreementType"),clearable:"",tabindex:"2",rules:[t=>e.fieldRequired(t)]},model:{value:e.agreementTypeModel,callback:function(t){e.agreementTypeModel=t},expression:"agreementTypeModel"}}),t("q-select",{staticClass:"col-lg-3 col-xs-12 col-sm-6",attrs:{options:e.groupsOptions,label:e.$t("labels.defaultGroups"),color:"k-controls",clearable:"","options-selected-class":"text-k-controls",multiple:"","emit-value":"",rules:[t=>e.fieldRequired(t)]},scopedSlots:e._u([{key:"option",fn:function(s){return[t("q-item",e._g(e._b({},"q-item",s.itemProps,!1),s.itemEvents),[t("q-item-section",{attrs:{avatar:""}},[t("img",{attrs:{src:s.opt.icon,width:"20"}})]),t("q-item-section",[t("q-item-label",[e._v(e._s(s.opt.label))]),t("q-item-label",{attrs:{caption:""}},[e._v(e._s(s.opt.description))])],1)],1)]}}],null,!1,4053758931),model:{value:e.defaultGroupModel,callback:function(t){e.defaultGroupModel=t},expression:"defaultGroupModel"}}),t("div",{staticClass:"col-lg-3 col-xs-12 col-sm-6"},[t("KInputDate",{key:"validDate",attrs:{name:"validDate",color:"k-controls",label:e.$t("labels.validDate"),tabindex:"31"},model:{value:e.agreementTemplate.validDate,callback:function(t){e.$set(e.agreementTemplate,"validDate",t)},expression:"agreementTemplate.validDate"}})],1),t("div",{staticClass:"fit q-col-gutter-md row col-xs-12 col-sm-12 col-lg-3 items-center wrap"},[t("div",{staticClass:"col-xs-12 col-sm-1 col-lg-auto"},[e._v("\n "+e._s(e.$t("labels.defaultDuration"))+"\n ")]),t("q-select",{ref:"group-desfaultExpirationTimeYear",staticClass:"col-lg-1 col-xs-6 col-sm-1",attrs:{dense:"",standout:"bg-teal text-white",color:"k-controls",options:e.availableYears},model:{value:e.agreementTemplate.defaultDurationPeriod.year,callback:function(t){e.$set(e.agreementTemplate.defaultDurationPeriod,"year",t)},expression:"agreementTemplate.defaultDurationPeriod.year"}}),t("div",{staticClass:"col-lg-1 col-xs-6 col-sm-1"},[e._v(e._s(e.$t("labels.year")))]),t("q-select",{ref:"group-desfaultExpirationTimeMonth",staticClass:"col-lg-1 col-xs-6 col-sm-1",attrs:{dense:"",standout:"bg-teal text-white",color:"k-controls",options:e.availableMonths},model:{value:e.agreementTemplate.defaultDurationPeriod.month,callback:function(t){e.$set(e.agreementTemplate.defaultDurationPeriod,"month",t)},expression:"agreementTemplate.defaultDurationPeriod.month"}}),t("div",{staticClass:"col-lg-1 col-xs-6 col-sm-1"},[e._v(e._s(e.$t("labels.month")))]),t("q-select",{ref:"group-desfaultExpirationTimeDay",staticClass:"col-lg-1 col-xs-6 col-sm-1",attrs:{dense:"",standout:"bg-teal text-white",color:"k-controls",options:e.availableDays},model:{value:e.agreementTemplate.defaultDurationPeriod.day,callback:function(t){e.$set(e.agreementTemplate.defaultDurationPeriod,"day",t)},expression:"agreementTemplate.defaultDurationPeriod.day"}}),t("div",{staticClass:"col-lg-1 col-xs-6 col-sm-1"},[e._v(e._s(e.$t("labels.day")))]),t("q-item",[t("q-item-section",[t("q-toggle",{staticClass:"col-lg-2 col-xs-12 col-sm-4",attrs:{label:e.$t("labels.toogleDefaultTemplate"),color:"k-controls"},model:{value:e.agreementTemplate.defaultTemplate,callback:function(t){e.$set(e.agreementTemplate,"defaultTemplate",t)},expression:"agreementTemplate.defaultTemplate"}})],1),t("q-item-section",{attrs:{side:""}},[t("q-btn",{attrs:{flat:"",round:"",icon:"mdi-information-outline"}},[t("q-popup-proxy",[t("q-banner",{scopedSlots:e._u([{key:"avatar",fn:function(){return[t("q-icon",{attrs:{name:"mdi-information-outline",color:"k-controls"}})]},proxy:!0}],null,!1,800219440)},[e._v("\n "+e._s(e.$t("messages.agreementTemplateDefaultTemplate"))+"\n ")])],1)],1)],1)],1)],1),t("div",{staticClass:"col-xs-12 q-pa-lg"},[t("q-field",{ref:"fieldRef",attrs:{"label-slot":"",borderless:"",rules:[t=>e.fieldRequired(t)]},scopedSlots:e._u([{key:"control",fn:function(){return[t("q-editor",{style:e.fieldRef&&e.fieldRef.hasError?"border-color: #C10015":"",attrs:{placeholder:e.$t("contents.placeholderAgreementText"),toolbar:[["left","center","right","justify"],["bold","italic","strike","underline","subscript","superscript"],["token","hr","link","custom_btn"],["quote","unordered","ordered","outdent","indent"],["undo","redo"],["viewsource"]]},model:{value:e.agreementTemplate.text,callback:function(t){e.$set(e.agreementTemplate,"text",t)},expression:"agreementTemplate.text"}})]},proxy:!0}],null,!1,1768847785),model:{value:e.agreementTemplate.text,callback:function(t){e.$set(e.agreementTemplate,"text",t)},expression:"agreementTemplate.text"}})],1)],1)]),t("q-card-actions",{staticClass:"q-ma-md",attrs:{align:"right"}},[t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{label:e.$t("labels.btnClose"),color:"k-red",tabindex:"55"}}),t("q-btn",{attrs:{color:"k-controls",label:e.$t("labels.submitForm")},on:{click:e.submitAgreementTemplate}})],1)],1)],1)]):e._e()},Ga=[],Ma={props:{newAgreementTemplate:{type:Boolean,default:!1}},mixins:[pt],data(){return{agreementTypeOptions:Object.values(re["c"]).map((e=>e)),agreementLevelOptions:Object.values(re["b"]).map((e=>e)),availableYears:[...Array(100)].map(((e,t)=>t)),availableMonths:[...Array(13)].map(((e,t)=>t)),availableDays:[...Array(32)].map(((e,t)=>t)),fieldRef:{}}},name:"AgreementTemplateCard",components:{KInputDate:Tt},computed:{...Object(W["c"])("admin",["agreementTemplate","groups","groupsOptions"]),open:{set(e){e||this.resetAgreementTemplate()},get(){return null!==this.agreementTemplate}},agreementLevelModel:{get(){return this.agreementTemplate.agreementLevel?re["b"][this.agreementTemplate.agreementLevel].label:""},set(e){this.agreementTemplate.agreementLevel=null!==e?e.value:null}},agreementTypeModel:{get(){return this.agreementTemplate.agreementType?re["c"][this.agreementTemplate.agreementType].label:""},set(e){this.agreementTemplate.agreementType=null!==e?e.value:null}},defaultGroupModel:{get(){const e=this.agreementTemplate.defaultGroups.map((e=>e.group.name?e.group.name:""));return e},set(e){if(null==e)this.agreementTemplate.defaultGroups=[];else{const t=this.agreementTemplate.defaultGroups,s=e.filter((e=>!t.some((t=>e===t.group.name)))),a=this.groups.find((e=>e.name===s[0]));this.agreementTemplate.defaultGroups.push({group:a})}}}},methods:{...Object(W["b"])("admin",["resetAgreementTemplate","updateAgreementTemplate","deleteAgreementTemplate","createAgreementTemplate"]),checkDates:La,submitAgreementTemplate(){this.$refs.agreementLevel.validate(),this.$refs.agreementType.validate(),this.$refs.fieldRef.validate(),this.agreementTemplate.defaultDuration=ba(this.agreementTemplate.defaultDurationPeriod),this.agreementTemplate.validDate=this.agreementTemplate.validDate?new Date(this.agreementTemplate.validDate.replace(/\//g,"-")):null,this.newAgreementTemplate?this.createAgreementTemplate(this.agreementTemplate).then((()=>{this.$q.notify({message:this.$t("messages.agreementTemplateCreated"),color:"positive",timeout:1e3}),this.resetAgreementTemplate()})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.agreementTemplateCreatedError"),color:"negative",timeout:1500}),this.resetAgreementTemplate()})):this.updateAgreementTemplate(this.agreementTemplate).then((()=>{this.$q.notify({message:this.$t("messages.agreementTemplateUpdated"),color:"positive",timeout:1e3}),this.resetAgreementTemplate()})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.agreementTemplateUpdatedError"),color:"negative",timeout:1500}),this.resetAgreementTemplate()}))}}},Qa=Ma,ja=Object(X["a"])(Qa,Da,Ga,!1,null,null,null),Fa=ja.exports;Se()(ja,"components",{QDialog:x["a"],QCard:q["a"],QCardSection:M["a"],QSeparator:O["a"],QSelect:k["a"],QItem:g["a"],QItemSection:b["a"],QItemLabel:f["a"],QToggle:C["a"],QBtn:p["a"],QPopupProxy:y["a"],QBanner:st["a"],QIcon:m["a"],QField:Lt["a"],QEditor:v["a"],QCardActions:Q["a"]}),Se()(ja,"directives",{ClosePopup:F["a"]});const Ba={id:"",agreementLevel:null,agreementType:null,text:null,defaultTemplate:!1,validDate:null,defaultGroup:null,defaultDuration:null};var Va={name:"AgreementTemplatesComponent",components:{KInputDate:Tt,KlabLoading:qe,AgreementTemplateComponentDialog:Fa},data(){return{newAgreementTemplate:!1,selected:[],filter:{...Ba},waiting:!1,rowsNumber:0,pagination:{sortBy:"agreementLevel",descending:!0,rowsPerPage:25,oldRowsPerPage:25},agreementTypeOptions:Object.keys(re["c"]).map((e=>re["c"][e])),agreementLevelOptions:Object.keys(re["b"]).map((e=>re["b"][e])),agreementTypes:re["c"],agreementLevels:re["b"],showTextDialogModel:!1,selectedRow:{},columns:[{name:"agreementLevel",field:"agreementLevel",required:!0,label:this.$t("labels.agreementLevel"),align:"left",sortable:!0,headerStyle:"width: 13%"},{name:"agreementType",field:"agreementType",required:!0,label:this.$t("labels.agreementType"),align:"left",sortable:!0,headerStyle:"width: 13%"},{name:"validDate",field:"validDate",required:!0,label:this.$t("labels.validDate"),align:"center",sortable:!0,sort:(e,t)=>rr(e,t),headerStyle:"width: 13%"},{name:"defaultTemplate",field:"defaultTemplate",required:!0,label:this.$t("labels.defaultTemplate"),align:"center",headerStyle:"width: 10%"},{name:"text",field:"text",required:!0,label:this.$t("labels.text"),align:"center",headerStyle:"width: 10%"},{name:"defaultGroups",field:"defaultGroups",required:!0,label:this.$t("labels.defaultGroups"),align:"center",headerStyle:"width: 13%"},{name:"defaultDuration",field:"defaultDuration",required:!0,label:this.$t("labels.defaultDuration"),align:"center",sortable:!0,headerStyle:"width: 13%"},{name:"actions",field:"actions",align:"center",headerStyle:"width: 13%"}]}},computed:{...Object(W["c"])("admin",["users","groups","groupsIcons","groupsOptions","senders","agreementTemplates"])},methods:{...Object(W["b"])("admin",["loadGroups","loadAgreementTemplates","loadAgreementTemplate","deleteAgreementTemplates"]),refreshAgreementTemplates(){const e={};this.waiting=!0,this.selected=[],this.loadAgreementTemplates(e).then((()=>{this.waiting=!1,this.$q.notify({message:this.$t("messages.agreementTemplatesLoaded"),color:"positive",timeout:1e3})})).catch((e=>{console.error(e),this.waiting=!1,this.$q.notify({message:this.$t("messages.agreementTemplatesLoadedError"),color:"negative",timeout:1500})}))},showAgreementTemplateDialog(e=null){this.waiting=!0;const t={id:e};this.loadAgreementTemplate(t).then((()=>{this.waiting=!1,this.newAgreementTemplate=null===e})).catch((e=>{console.error(e),this.waiting=!1,this.newAgreementTemplate=!1}))},filtered(){return!Jo(this.filter,Ba)},initializeFilter(){this.filter={...Ba}},selectAll(){this.agreementTemplates.forEach((e=>{0!==this.selected.length&&-1!==this.selected.findIndex((t=>e.id===t.id))||this.selected.push(e)}))},formatDate:ar,longToPeriod:ga,printPeriod:fa,checkDates:La,showTextDialog(e){this.selectedRow=e,this.showTextDialogModel=!0},filterMethod(){return this.filtered?this.agreementTemplate.filter((()=>null===this.filter.agreementLevel||""===this.filter.agreementLevel)):this.agreementTemplates},filterArrays(e,t,s){const a=t.map((e=>e.value));return"all"===s?a.every((t=>e.includes(t))):e.some((e=>a.includes(e)))},getPaginationLabel(e,t,s){return this.rowsNumber=s,this.$t("labels.pagination",{firstRowIndex:e,endRowIndex:t,totalRowsNumber:s})},removeAgreementTemplate(e){this.$q.dialog({title:this.$t("messages.confirm"),message:this.$t("messages.confirmRemoveElementMsg",{element:this.$t("labels.agreementTemplate")}),html:!0,ok:{color:"k-controls"},cancel:{color:"k-red"},persistent:!0}).onOk((()=>{this.waiting=!0,this.deleteAgreementTemplates(e).then((()=>{this.waiting=!1,this.$q.notify({message:this.$t("messages.agreementTemplateDeleted"),color:"positive",timeout:1e3}),this.loadAgreementTemplates(this.filter)})).catch((e=>{console.error(e),this.waiting=!1,this.$q.notify({message:this.$t("messages.agreementTemplateDeletedError"),color:"negative",timeout:1500})}))}))}},created(){this.loadGroups().then((()=>{this.refreshAgreementTemplates()})),bt.a.locale(this.$q.lang.getLocale())},mounted(){},watch:{filtered(e){e?(this.pagination.oldRowsPerPage=this.pagination.rowsPerPage,this.pagination.rowsPerPage=0):this.pagination.rowsPerPage=this.pagination.oldRowsPerPage}}},Ya=Va,Ka=(s("9e60"),Object(X["a"])(Ya,Ua,Ia,!1,null,null,null)),Wa=Ka.exports;Se()(Ka,"components",{QIcon:m["a"],QTooltip:R["a"],QSelect:k["a"],QToggle:C["a"],QInput:E["a"],QBtn:p["a"],QTable:I["a"],QTr:D["a"],QTd:L["a"],QCheckbox:T["a"],QDialog:x["a"],QCard:q["a"],QCardSection:M["a"],QCardActions:Q["a"]}),Se()(Ka,"directives",{ClosePopup:F["a"]});var Ha=function(){var e=this,t=e._self._c;return t("div",{staticClass:"ka-content"},[t("h2",{staticClass:"kh-h-first"},[e._v(" "+e._s(e.$t("contents.adminNodesTitle"))+"\n "),t("q-icon",{staticClass:"cursor-pointer text-k-main ka-refresh",class:{"ka-refreshing":e.refreshing},attrs:{name:"mdi-refresh"},on:{click:e.refreshGroups}},[t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0],delay:600}},[e._v(e._s(e.$t("labels.refreshNodes")))])],1)],1),t("div",{staticClass:"row full-width ka-actions q-ma-md"},[t("div",{staticClass:"row full-width q-pa-sm ka-actions-row"},[t("div",{staticClass:"col-1 ka-action-desc"},[e._v(e._s(e.$t("labels.actionsNodes")))]),t("q-btn",{staticClass:"col-2 ka-action-button",attrs:{icon:"mdi-account-multiple-plus",color:"k-controls",label:e.$t("labels.createNode")},on:{click:e.createNode}})],1)]),e.nodes.length>0?t("div",{},[t("q-table",{attrs:{grid:"",data:e.nodes,columns:e.columns,"hide-bottom":""},scopedSlots:e._u([{key:"item",fn:function(s){return[t("div",{staticClass:"q-pa-xs col-sm-8 col-md-5 col-lg-2"},[t("q-card",{staticClass:"full-height"},[t("div",{staticClass:"row"},[t("q-item-section",[t("q-item",{staticClass:"items-center"},[t("q-input",{staticClass:"col",attrs:{filled:"",disable:"",label:e.$t("labels.nodeName")},model:{value:s.row.name,callback:function(t){e.$set(s.row,"name",t)},expression:"props.row.name"}}),t("q-btn",{staticStyle:{float:"right"},attrs:{round:"",color:"red",size:"sm",icon:"file_copy"},on:{click:function(t){return e.downloadCertificate(s.row.name)}}}),t("q-btn",{staticStyle:{float:"right"},attrs:{round:"",color:"primary",size:"sm",icon:"edit"},on:{click:function(t){return e.editNode(s.row.name)}}}),t("q-btn",{staticStyle:{float:"right"},attrs:{round:"",color:"secondary",size:"sm",icon:"delete"},on:{click:function(t){return e.removeNode(s.row.name)}}})],1)],1)],1),t("q-list",{staticClass:"gc-items"},e._l(s.cols.filter((e=>"icon"!==e.name&&"name"!==e.name&&"groups"!==e.name&&"description"!==e.name)),(function(s){return t("q-item",{key:s.name},[t("q-item-section",{staticClass:"gc-item-label"},[t("q-item-label",[e._v(e._s(s.label))])],1),s.value?Array.isArray(s.value)?t("q-item",{class:{"gc-multiple-item":s.value&&s.value.length>0}},[0===s.value.length?t("div",[t("q-item-label",{attrs:{caption:""},domProps:{innerHTML:e._s(e.$t("labels.groupNoValue"))}})],1):e._e()]):t("q-item-section",{staticClass:"gc-item"},[t("q-item-label",{attrs:{caption:""}},[e._v(e._s(s.value))])],1):t("q-item-section",[t("q-item-label",{attrs:{caption:""},domProps:{innerHTML:e._s(e.$t("labels.groupNoValue"))}})],1)],1)})),1),t("q-item-section",[t("q-item",{staticClass:"justify-center"},[t("q-item-label",{attrs:{caption:""},domProps:{innerHTML:e._s(e.$t("labels.nodeGroups"))}})],1),t("q-item",{staticClass:"row wrap justify-around"},e._l(s.row.groups,(function(s,a){return t("div",{key:a,staticClass:"row justify-between content-between"},[t("q-item",{staticClass:"justify"},[t("q-icon",{attrs:{name:"img:"+s.iconUrl}}),t("q-item-label",{attrs:{caption:""}},[e._v(" "+e._s(s.name)+" ")])],1)],1)})),0)],1)],1)],1)]}}],null,!1,3657553187)})],1):e._e(),t("q-dialog",{model:{value:e.edit,callback:function(t){e.edit=t},expression:"edit"}},[t("NodeFormCard",{attrs:{"new-node":!1}})],1),t("q-dialog",{model:{value:e.create,callback:function(t){e.create=t},expression:"create"}},[t("NodeFormCard",{attrs:{"new-node":!0}})],1),t("klab-loading",{attrs:{loading:e.waiting||e.refreshing,message:e.$t("messages.doingThings")}})],1)},za=[],Xa=function(){var e=this,t=e._self._c;return null!==e.group?t("q-dialog",{attrs:{persistent:""},model:{value:e.open,callback:function(t){e.open=t},expression:"open"}},[t("div",{staticClass:"ka-dialog"},[t("q-card",{staticClass:"full-height"},[t("q-list",[t("q-item",[t("q-item-section",[t("q-input",{ref:"group-name",attrs:{color:"k-controls",disable:!e.newNode,label:e.$t("labels.nodepName"),rules:[t=>e.fieldRequired(t)]},scopedSlots:e._u([{key:"append",fn:function(){return[e.group.name&&e.newGroup?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-close-circle",color:"k-main"},on:{click:function(t){t.stopPropagation(),e.group.name=null}}}):e._e()]},proxy:!0}],null,!1,3957828500),model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1)],1),t("q-item",[t("q-item-section",{staticClass:"col-10"},[t("q-input",{ref:"group-icon",attrs:{color:"k-controls",autogrow:"",label:e.$t("labels.groupIcon"),error:e.iconError,"error-message":e.$t("messages.iconNotValid")},on:{input:function(t){e.iconError=!1}},scopedSlots:e._u([{key:"append",fn:function(){return[e.group.iconUrl?t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"mdi-close-circle",color:"k-main"},on:{click:function(t){t.stopPropagation(),e.group.iconUrl=null}}}):e._e()]},proxy:!0}],null,!1,734042839),model:{value:e.group.iconUrl,callback:function(t){e.$set(e.group,"iconUrl",t)},expression:"group.iconUrl"}})],1)],1)],1)],1)],1)]):e._e()},Za=[],Ja={name:"NodeFormCard",props:{newNode:{type:Boolean,default:!1}},mixins:[pt],data(){return{form:{},groupNames:[],changed:!1,groupSelection:[]}},computed:{...Object(W["c"])("admin",["node","groups"]),availableGroups(){return this.groups.map((e=>e.name))}},methods:{...Object(W["b"])("admin",["updateNode","createNode","loadGroups"]),submit(){this.form.groups=this.getSelectedGroups(),this.newNode?this.createNode(this.form):this.updateNode(this.form)},cancel(){},getSelectedGroups(){const e=[];return this.availableGroups.forEach((t=>this.groupSelection.includes(t.name)?e.push(t):e)),e}},mounted(){this.form=this.node,this.loadGroups(),this.new||(this.groupNames=this.groups.map((e=>e.name))),this.groupSelection=this.form.groups.map((e=>e.name))}},eo=Ja,to=Object(X["a"])(eo,Xa,Za,!1,null,"4118013a",null),so=to.exports;Se()(to,"components",{QDialog:x["a"],QCard:q["a"],QList:h["a"],QItem:g["a"],QItemSection:b["a"],QInput:E["a"],QIcon:m["a"]});var ao={name:"NodeComponent",components:{NodeFormCard:so,KlabLoading:qe},data(){return{edit:!1,create:!1,columns:[{name:"name",field:"name",required:!0,label:this.$t("labels.nodeName"),align:"center",sortable:!0},{name:"email",field:"email",required:!0,label:this.$t("labels.nodeEmail"),align:"center",sortable:!0},{name:"url",field:"url",required:!0,label:this.$t("labels.nodeUrl"),align:"center",sortable:!0},{name:"groups",field:"groups",required:!0,label:this.$t("labels.groups"),align:"center",sortable:!0}],refreshing:!1}},computed:{...Object(W["c"])("admin",["nodes"])},methods:{...Object(W["b"])("admin",["loadNodes","loadNode","deleteNode","loadNewNode","downloadNodeCertificate"]),createNode(){this.loadNewNode().then((()=>{this.refreshing=!1,this.$q.notify({message:this.$t("messages.newGroupLoaded"),color:"positive",timeout:1e3}),this.create=!0})).catch((()=>{this.$q.notify({message:this.$t("messages.newGroupLoadedError"),color:"negative",timeout:1500}),this.refreshing=!1,this.create=!1}))},editNode(e){this.loadNode(e).then((()=>{this.refreshing=!1,this.$q.notify({message:this.$t("messages.nodeLoaded"),color:"positive",timeout:1e3}),this.edit=!0})).catch((()=>{this.$q.notify({message:this.$t("messages.nodeLoadedError"),color:"negative",timeout:1500}),this.refreshing=!1,this.edit=!1}))},removeNode(e){this.deleteNode(e).then((()=>{this.refreshing=!1,this.$q.notify({message:this.$t("messages.nodeDeleted"),color:"positive",timeout:1e3}),this.loadNodes()})).catch((()=>{this.$q.notify({message:this.$t("messages.nodeDeletedError"),color:"negative",timeout:1500}),this.refreshing=!1}))},downloadCertificate(e){this.downloadNodeCertificate(e).then((()=>{this.refreshing=!1,this.$q.notify({message:this.$t("messages.nodeCertificate"),color:"positive",timeout:1e3})})).catch((()=>{this.$q.notify({message:this.$t("messages.nodeCertificateError"),color:"negative",timeout:1500}),this.refreshing=!1}))}},created(){this.loadNodes()}},oo=ao,ro=(s("5428"),Object(X["a"])(oo,Ha,za,!1,null,null,null)),io=ro.exports;Se()(ro,"components",{QIcon:m["a"],QTooltip:R["a"],QBtn:p["a"],QTable:I["a"],QCard:q["a"],QItemSection:b["a"],QItem:g["a"],QInput:E["a"],QList:h["a"],QItemLabel:f["a"],QDialog:x["a"]});var lo=function(){var e=this,t=e._self._c;return t("div",{staticClass:"ka-content"},[t("h2",{staticClass:"kh-h-first"},[e._v(e._s(e.$t("contents.statsHomeTitle")))]),t("div",{domProps:{innerHTML:e._s(e.$t("contents.statsHomeContent"))}})])},no=[],co={data(){return{}}},uo=co,po=Object(X["a"])(uo,lo,no,!1,null,null,null),mo=po.exports,ho=function(){var e=this,t=e._self._c;return t("div",{staticClass:"ka-content row"},[t("h2",{staticClass:"kh-h-first"},[e._v(e._s(e.$t("contents.statsHomeTitle"))+"\n "),t("q-icon",{staticClass:"cursor-pointer text-k-controls ka-refresh",class:{"ka-refreshing":e.refreshing},attrs:{name:"mdi-refresh"},on:{click:e.refreshQueries}},[t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0]}},[e._v(e._s(e.$t("labels.refreshQueries")))])],1)],1),t("div",{staticClass:"row full-width ka-filters"},[t("div",{staticClass:"row full-width"},[t("div",{staticClass:"col-6"},[t("q-select",{staticClass:"q-pa-sm col",attrs:{value:"model",color:"k-controls",options:e.queriesOptions,label:e.$t("labels.queries"),"options-dense":"",clearable:"",tabindex:"4"},on:{input:function(t){return e.refreshQueryList(t)},change:function(t){return e.refreshQueryList(t)}},scopedSlots:e._u([{key:"option",fn:function(s){return[t("q-item",e._g(e._b({},"q-item",s.itemProps,!1),s.itemEvents),[t("q-item-section",[t("q-item-label",{domProps:{innerHTML:e._s(s.opt.name)}})],1)],1)]}},{key:"selected-item",fn:function(t){return[e._v(e._s(t.opt.name)+"\n ")]}}]),model:{value:e.single,callback:function(t){e.single=t},expression:"single"}})],1)]),t("div",{staticClass:"row full-width"},["QUERY_ASSET"===this.listOption?t("div",{staticClass:"q-pa-sm col-4"},[t("q-input",{staticStyle:{"max-width":"250px"},attrs:{type:"number",label:"Minimum Resolution Time",filled:"",clearable:""},on:{change:function(t){return e.refreshQueryList()},input:function(t){return e.refreshQueryList()}},model:{value:e.resolutionTimeMin,callback:function(t){e.resolutionTimeMin=e._n(t)},expression:"resolutionTimeMin"}})],1):e._e(),"QUERY_ASSET"===this.listOption?t("div",{staticClass:"q-pa-sm col-4"},[t("q-input",{staticStyle:{"max-width":"250px"},attrs:{type:"number",label:"Maximum Resolution Time",filled:"",clearable:""},on:{change:function(t){return e.refreshQueryList()},input:function(t){return e.refreshQueryList()}},model:{value:e.resolutionTimeMax,callback:function(t){e.resolutionTimeMax=e._n(t)},expression:"resolutionTimeMax"}})],1):e._e(),"QUERY_ASSET_NAME_GROUP_COUNT"===this.listOption||"QUERY_CONTEXT_NAME_COUNT"===this.listOption||"QUERY_REQUESTS_PER_USER"===this.listOption?t("div",{staticClass:"q-pa-sm col-4"},[t("q-input",{attrs:{type:"number",label:"Top",filled:"",clearable:""},on:{change:function(t){return e.refreshQueryList()}},model:{value:e.top,callback:function(t){e.top=e._n(t)},expression:"top"}})],1):e._e(),"QUERY_OUTCOME_AGGREGATE"===this.listOption||"QUERY_ASSET"===this.listOption?t("div",{staticClass:"q-pa-sm col-4"},[t("div",{staticClass:"q-gutter-md"},[t("q-select",{attrs:{outlined:"",options:e.aggregate_options,clearable:"",label:"Result"},on:{input:function(t){return e.refreshQueryList()},change:function(t){return e.refreshQueryList()}},model:{value:e.outcome,callback:function(t){e.outcome=t},expression:"outcome"}})],1)]):e._e(),"QUERY_QUERIES_PER"===this.listOption?t("div",{staticClass:"q-pa-sm col-4"},[t("q-select",{attrs:{outlined:"",options:e.groupBy_options,clearable:"",label:"Group By"},on:{input:function(t){return e.refreshQueryList()},change:function(t){return e.refreshQueryList()}},model:{value:e.groupBy,callback:function(t){e.groupBy=t},expression:"groupBy"}})],1):e._e(),"QUERY_TIME_RANGE"===this.listOption||"QUERY_REQUESTS_PER_USER"===this.listOption?t("div",{staticClass:"q-pa-sm col-4"},[t("q-input",{attrs:{filled:"",mask:"date",clearable:"",label:e.$t("labels.queriesFrom")},on:{change:function(t){return e.refreshQueryList()}},scopedSlots:e._u([{key:"append",fn:function(){return[t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"event"}},[t("q-popup-proxy",{ref:"qDateProxy",attrs:{"transition-show":"scale","transition-hide":"scale"}},[t("q-date",{attrs:{"Mask:":"","YYYY-MM-DD":""},on:{input:function(t){return e.refreshQueryList()}},model:{value:e.dateFrom,callback:function(t){e.dateFrom=t},expression:"dateFrom"}},[t("div",{staticClass:"row items-center justify-end"},[t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{label:"Close",color:"primary",flat:""}})],1)])],1)],1)]},proxy:!0}],null,!1,302866215),model:{value:e.dateFrom,callback:function(t){e.dateFrom=t},expression:"dateFrom"}})],1):e._e(),"QUERY_TIME_RANGE"===this.listOption||"QUERY_REQUESTS_PER_USER"===this.listOption?t("div",{staticClass:"q-pa-sm col-4"},[t("q-input",{attrs:{filled:"",clearable:"",mask:"date",label:e.$t("labels.queriesTo")},on:{change:function(t){return e.refreshQueryList()}},scopedSlots:e._u([{key:"append",fn:function(){return[t("q-icon",{staticClass:"cursor-pointer",attrs:{name:"event"}},[t("q-popup-proxy",{ref:"qDateProxy",attrs:{"transition-show":"scale","transition-hide":"scale"}},[t("q-date",{attrs:{"Mask:":"","YYYY-MM-DD":""},on:{input:function(t){return e.refreshQueryList()}},model:{value:e.dateTo,callback:function(t){e.dateTo=t},expression:"dateTo"}},[t("div",{staticClass:"row items-center justify-end"},[t("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{label:"Close",color:"primary",flat:""}})],1)])],1)],1)]},proxy:!0}],null,!1,1255382090),model:{value:e.dateTo,callback:function(t){e.dateTo=t},expression:"dateTo"}})],1):e._e()]),t("div",{staticClass:"row full-width ka-filter-info q-pa-sm"}),t("div",{staticClass:"row full-width ka-filter-info q-pa-sm text-bottom"},[t("div",{staticClass:"col-6"},[e._v(e._s(e.$t("labels.filterInfoQueries",{number:e.rowsNumber})))]),t("div",{staticClass:"col text-right"},[t("q-btn",{staticClass:"ka-action-button",attrs:{label:e.$t("labels.clearSearch"),color:"k-controls"},on:{click:e.initializeFields}}),t("q-btn",{staticClass:"ka-action-button",attrs:{label:"MAKE QUERY",color:"k-controls"},on:{click:function(t){return e.refreshQueries()}}})],1)])]),t("div",{staticClass:"row full-width ka-filter-info q-pa-sm"},[t("div",{staticClass:"col text-left"},[e.refreshBar&&"QUERY_ASSET"!=this.listOption&&"QUERY_OUTCOME_AGGREGATE"!=this.listOption&&"QUERY_TIME_RANGE"!=this.listOption?t("q-btn",{staticClass:"ka-action-button",attrs:{label:"Change View",color:"k-controls"},on:{click:e.changeViewTable}}):e._e()],1)]),t("div",{staticClass:"row full-width"},[e.refreshBar&&e.tableView&&this.queries.length>0?t("q-table",{ref:"ka-table",staticClass:"no-shadow ka-table full-width",attrs:{title:"Query Results",data:e.queries,filter:e.filter,"rows-per-page-options":[10,25,50,100,0],"pagination-label":e.getPaginationLabel,pagination:e.pagination,columns:e.columns,color:"k-controls"},on:{"update:pagination":function(t){e.pagination=t}},scopedSlots:e._u([{key:"top-right",fn:function(){return[t("q-input",{attrs:{borderless:"",dense:"",debounce:"300",placeholder:"Search"},scopedSlots:e._u([{key:"append",fn:function(){return[t("q-icon",{attrs:{name:"search"}})]},proxy:!0}],null,!1,4009527860),model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}})]},proxy:!0}],null,!1,2722981051)}):e._e()],1),[e.tableView?e._e():t("div",{staticClass:"full-width ka-filters"},[t("div",{staticClass:"q-pa-md",attrs:{id:"app"}},[e.refreshBar&&"QUERY_ASSET"!=this.listOption&&"QUERY_OUTCOME_AGGREGATE"!=this.listOption&&"QUERY_TIME_RANGE"!=this.listOption&&!e.tableView?t("bar-chart",{attrs:{"chart-data":e.chartData,options:e.chartOptions,height:1,width:4}}):e._e()],1)])],t("klab-loading",{attrs:{loading:e.waiting||e.refreshing,message:e.$t("messages.doingThings")}})],2)},go=[],bo=s("1fca");const{reactiveProp:fo}=bo["c"];var Eo={extends:bo["a"],mixins:[fo],props:["chartData","options"],mounted(){this.renderChart(this.chartData,this.options)}},vo={name:"StatsComponent",components:{KlabLoading:qe,BarChart:Eo},data(){return{data:[],selected:[],pagination:{descending:!0,rowsPerPage:25,oldRowsPerPage:25,sortBy:"count"},rowsNumber:0,refreshing:!1,filter:"",queriesOptions:Object.keys(re["i"]).map((e=>re["i"][e])),waiting:!1,statsUrl:null,top:10,resolutionTimeMin:null,resolutionTimeMax:null,aggregate_options:["Success","Error","Exception"],table_view_options:["Table View","Graph View"],groupBy_options:["Day","Month","Year"],outcome:null,listOption:null,single:null,dateFrom:null,dateTo:null,dateText:null,groupBy:null,refreshBar:!1,chartData:null,labels:null,tableView:!0,chartOptions:{label:"Asset count",backgroundColor:"#73cab4",height:10,width:100,hAxis:{title:"Users"},vAxis:{title:"Year"},maintainAspectRatio:!0,scales:{yAxes:[{ticks:{beginAtZero:!0}}]}},label:"Number of Instances",backgroundColor:"#73cab4"}},computed:{...Object(W["c"])("admin",["queries"]),columns(){return this.queries.length>0?Object.keys(this.queries[0]).map((e=>({name:e,label:this.$t(`tables.${e}`),align:"left",sortable:!0,field:e}))):null}},watch:{},methods:{...Object(W["b"])("admin",["loadQueries","senders"]),refreshQueries(){null!=this.listOption&&(this.refreshing=!0,this.refreshBar=!1,this.filter="",this.loadQueries(this.statsUrl).then((()=>{this.refreshing=!1,this.refreshBar=!0,"QUERY_TIME_RANGE"===this.listOption&&this.queries.length>0&&("undefined"===typeof this.queries[0].resolutionTime&&(this.queries[0].resolutionTime=0),"undefined"===typeof this.queries[0].observable&&(this.queries[0].observable="-")),this.queries.length>0?(this.$q.notify({message:this.$t("messages.queriesLoaded"),color:"positive",timeout:1e3}),this.fillData()):this.$q.notify({message:this.$t("messages.queriesNull"),color:"positive",timeout:1e3})})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.queriesLoadedError"),color:"negative",timeout:1500}),this.refreshing=!1})))},changeViewTable(){this.tableView=!this.tableView},getPaginationLabel(e,t,s){return this.rowsNumber=s,this.$t("labels.pagination",{firstRowIndex:e,endRowIndex:t,totalRowsNumber:s})},refreshQueryList(e){switch(e&&(this.listOption=e.value),this.listOption){case"QUERY_ASSET":this.statsUrl="?queryType=asset",this.labels=this.queries.map((e=>e.assetName)),null!==this.resolutionTimeMin&&(this.statsUrl+=`&resolutionTimeMin=${this.resolutionTimeMin}`),null!==this.resolutionTimeMax&&(this.statsUrl+=`&resolutionTimeMax=${this.resolutionTimeMax}`),this.outcome&&(this.statsUrl+=`&outcome=${this.outcome}`);break;case"QUERY_ASSET_NAME_GROUP_COUNT":this.statsUrl="?queryType=asset_name_group_count",10!==this.top&&(this.statsUrl+=`&top=${this.top}`);break;case"QUERY_OUTCOME_GROUP_COUNT":this.statsUrl="?queryType=outcome_group_count";break;case"QUERY_OUTCOME_AGGREGATE":this.statsUrl="?queryType=outcome_aggregate",this.outcome&&(this.statsUrl+=`&outcome=${this.outcome}`);break;case"QUERY_CONTEXT_NAME_COUNT":this.statsUrl="?queryType=context_name_count",10!==this.top&&(this.statsUrl+=`&top=${this.top}`);break;case"QUERY_TIME_RANGE":if(this.statsUrl="?queryType=time_range",this.dateFrom){this.dateText=this.dateFrom.toString().replace(/\//g,"-");const e=new Date(this.dateText),t=e.getTime();this.statsUrl+=`&from=${t}`}if(this.dateTo){this.dateText=this.dateTo.toString().replace(/\//g,"-");const e=new Date(this.dateText),t=e.getTime()+864e5;this.statsUrl+=`&to=${t}`}break;case"QUERY_QUERIES_PER":this.statsUrl="?queryType=queries_per",this.groupBy&&(this.statsUrl+=`&groupBy=${this.groupBy.toLowerCase()}`);break;case"QUERY_REQUESTS_PER_USER":if(this.statsUrl="?queryType=requests_per_user",10!==this.top&&(this.statsUrl+=`&top=${this.top}`),this.dateFrom){this.dateText=this.dateFrom.toString().replace(/\//g,"-");const e=new Date(this.dateText),t=e.getTime();this.statsUrl+=`&from=${t}`}if(this.dateTo){this.dateText=this.dateTo.toString().replace(/\//g,"-");const e=new Date(this.dateText),t=e.getTime()+864e5;this.statsUrl+=`&to=${t}`}break;default:this.statsUrl="";break}},initializeFields(){null!=this.listOption&&(this.top=10,this.outcome=null,this.resolutionTimeMin=null,this.resolutionTimeMax=null,this.statsUrl=null,this.dateFrom=null,this.dateTo=null,this.dateText=null,this.groupBy=null,this.filter="",this.refreshQueryList())},fillData(){if(this.queries.length>0){switch(this.listOption){case"QUERY_ASSET_NAME_GROUP_COUNT":this.labels=this.queries.map((e=>e.assetName));break;case"QUERY_OUTCOME_GROUP_COUNT":this.labels=this.queries.map((e=>e.outcome));break;case"QUERY_CONTEXT_NAME_COUNT":this.labels=this.queries.map((e=>e.contextName));break;case"QUERY_QUERIES_PER":this.labels=this.queries.map((e=>e.startDate));break;case"QUERY_REQUESTS_PER_USER":this.labels=this.queries.map((e=>e.principal));break;default:this.labels=null;break}this.chartData={labels:this.labels,datasets:[{barThickness:"flex",label:this.label,backgroundColor:this.backgroundColor,data:this.queries.map((e=>e.count)),height:1,width:4,hAxis:{title:"Users"},vAxis:{title:"Year"}}]},this.tableView=!0}}},created(){},mounted(){}},ko=vo,_o=Object(X["a"])(ko,ho,go,!1,null,null,null),To=_o.exports;Se()(_o,"components",{QIcon:m["a"],QTooltip:R["a"],QSelect:k["a"],QItem:g["a"],QItemSection:b["a"],QItemLabel:f["a"],QInput:E["a"],QPopupProxy:y["a"],QDate:w["a"],QBtn:p["a"],QTable:I["a"]}),Se()(_o,"directives",{ClosePopup:F["a"]});var wo=function(){var e=this,t=e._self._c;return t("div",{staticClass:"ka-content"},[t("h2",{staticClass:"kh-h-first"},[e._v(e._s(e.$t("contents.statsHomeTitle"))+"\n "),t("q-icon",{staticClass:"cursor-pointer text-k-controls ka-refresh",class:{"ka-refreshing":e.refreshing},attrs:{name:"mdi-refresh"},on:{click:e.refreshUserStatistics}},[t("q-tooltip",{attrs:{anchor:"center right",self:"center left",offset:[5,0]}},[e._v(e._s(e.$t("labels.refreshQueries")))])],1)],1),t("div",{staticClass:"row full-width ka-filters"},[t("div",{staticClass:"row full-width"},[t("div",{staticClass:"col-10"},[t("div",{staticClass:"row full-width"},[t("q-select",{staticClass:"q-pa-sm col-5",attrs:{value:"model",color:"k-controls",options:e.registrationRange,label:e.$t("labels.registrationRange")},on:{input:function(t){return e.refreshQueryList(t)},change:function(t){return e.refreshQueryList(t)}},scopedSlots:e._u([{key:"option",fn:function(s){return[t("q-item",e._g(e._b({},"q-item",s.itemProps,!1),s.itemEvents),[t("q-item-section",[t("q-item-label",{domProps:{innerHTML:e._s(s.opt.name)}})],1)],1)]}},{key:"selected-item",fn:function(s){return[t("q-icon",{attrs:{name:s.opt.icon}}),e._v(e._s(s.opt.name)+"\n ")]}}]),model:{value:e.single,callback:function(t){e.single=t},expression:"single"}}),t("div",{staticClass:"q-pa-md col-5"},[t("div",{staticClass:"q-gutter-md"},[t("q-select",{attrs:{outlined:"",options:e.chartListOptions,label:"Chart Type"},on:{input:function(t){return e.refreshChartType(t)},change:function(t){return e.refreshChartType(t)}},model:{value:e.chartType,callback:function(t){e.chartType=t},expression:"chartType"}})],1)])],1),[t("div",{staticClass:"q-pa-md",attrs:{id:"app"}},[e.refreshBar&&"Bar Chart"==this.chartType?t("bar-chart",{attrs:{"chart-data":e.chartData,options:e.chartOptions,height:1,width:4}}):e._e(),e.refreshBar&&"Line Chart"==this.chartType?t("line-chart",{attrs:{"chart-data":e.chartData,options:e.chartOptions,height:1,width:4}}):e._e()],1)]],2)])])])},yo=[];const{reactiveProp:Co}=bo["c"];var So={extends:bo["b"],mixins:[Co],props:["chartData","options"],mounted(){this.renderChart(this.chartData,this.options)}};const Ao={queries:null,userStats:null,registeredUsers:null,labels:null};var qo={name:"UserStatsComponent",components:{BarChart:Eo,LineChart:So},data(){return{data:[],selected:[],filter:{...Ao},statsUrl:null,chartData:[],rowsNumber:0,refreshing:!1,registrationRange:Object.keys(re["s"]).map((e=>re["s"][e])),waiting:!1,listOption:null,single:null,refreshBar:!1,chartType:"Bar Chart",chartListOptions:["Bar Chart","Line Chart"],chartOptions:{height:10,width:100,hAxis:{title:"Users"},vAxis:{title:"Year"},maintainAspectRatio:!0,scales:{yAxes:[{ticks:{beginAtZero:!0}}]}},label:"Registrations per month",backgroundColor:"#73cab4",groupBy:"Month",groupByOptions:["Day","Month","Year"]}},computed:{...Object(W["c"])("admin",["userStats","registeredUsers","labels"])},watch:{},methods:{...Object(W["b"])("admin",["loadUserStats","senders"]),refreshUserStatistics(){this.refreshing=!0,this.refreshBar=!1,this.loadUserStats(this.statsUrl).then((()=>{this.refreshing=!1,this.$q.notify({message:this.$t("messages.userStatsLoaded"),color:"positive",timeout:1e3}),this.refreshBar=!0,this.fillData()})).catch((e=>{console.error(e),this.$q.notify({message:this.$t("messages.userStatsLoadedError"),color:"negative",timeout:1500}),this.refreshing=!1}))},refreshQueryList(e){switch(e&&(this.listOption=e.value),this.listOption){case"YEAR":this.statsUrl="?groupBy=year",this.label="Registrations per year",this.backgroundColor="#73cab4";break;case"MONTH_ACCUMULATION":this.statsUrl="?groupBy=monthAccumulation",this.label="Accumulated registrations per month",this.backgroundColor="#26a69a";break;case"YEAR_ACCUMULATION":this.statsUrl="?groupBy=yearAccumulation",this.label="Accumulated registrations per year",this.backgroundColor="#26a69a";break;default:this.statsUrl="?groupBy=yearMonth",this.label="Registrations per month",this.backgroundColor="#73cab4";break}this.refreshUserStatistics(),this.refreshing=!1},refreshChartType(e){e&&(this.chartType=e),this.refreshUserStatistics(),this.refreshing=!1},fillData(){this.chartData={labels:this.labels,datasets:[{label:this.label,backgroundColor:this.backgroundColor,data:this.registeredUsers,height:50,width:100,hAxis:{title:"Users"},vAxis:{title:"Year"}}]}},getPaginationLabel(e,t,s){return this.rowsNumber=s,this.$t("labels.pagination",{firstRowIndex:e,endRowIndex:t,totalRowsNumber:s})},initializeFields(){this.top=10,this.outcome=null,this.resolutionTimeMin=null,this.resolutionTimeMax=null,this.statsUrl=null,this.dateFrom=null,this.dateTo=null,this.dateText=null,this.refreshUserStatistics()}},created(){},mounted(){this.refreshUserStatistics()}},Oo=qo,Ro=Object(X["a"])(Oo,wo,yo,!1,null,null,null),$o=Ro.exports;Se()(Ro,"components",{QIcon:m["a"],QTooltip:R["a"],QSelect:k["a"],QItem:g["a"],QItemSection:b["a"],QItemLabel:f["a"],QInput:E["a"],QPopupProxy:y["a"],QDate:w["a"],QBtn:p["a"]}),Se()(Ro,"directives",{ClosePopup:F["a"]});var Po=function(){var e=this,t=e._self._c;return t("div",{staticClass:"row full-width"},[t("div",{staticClass:"q-pa-sm col-4"},[t("div",{staticClass:"q-gutter-md"},[t("q-input",{attrs:{type:"number",label:"Time Range",filled:""},model:{value:e.time_range,callback:function(t){e.time_range=e._n(t)},expression:"time_range"}})],1)]),t("div",{staticClass:"q-pa-sm col-4"},[t("div",{staticClass:"q-gutter-md"},[t("q-select",{attrs:{outlined:"",options:e.time_unit_options,clearable:"",label:"Time Unit"},model:{value:e.time_unit,callback:function(t){e.time_unit=t},expression:"time_unit"}})],1)]),t("div",{staticClass:"q-pa-sm col-4"},[t("q-btn",{staticClass:"ka-action-button",attrs:{label:"SHOW DATA",color:"k-controls"},on:{click:function(t){return e.fillMap()}}})],1),t("div",{staticStyle:{height:"700px",width:"100%"},attrs:{id:"map-div"}})])},No=[],xo=(s("6cc5"),s("8243"),s("3ac1"),s("e11e")),Uo=(s("2573"),s("c14d")),Io=s.n(Uo),Lo=s("36a6"),Do=s.n(Lo),Go=(s("6005"),s("b048"),{name:"ObservationMap",data(){return{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:'Map data © OpenStreetMap contributors',minZoom:2,maxZoom:18,maxBounds:[[-90,-180],[90,180]],map:null,span:"&span=days,1",time_unit_options:["Hour(s)","Day(s)","Week(s)","Month(s)","Year(s)"],time_unit:"Day(s)",time_range:1,unit:null,layerControl:null,polygonLayer:null,markerCluster:null,tileLayer:null,baseLayers:null}},created(){},methods:{fillMap(){switch(this.layerControl&&(this.map.eachLayer((e=>{this.map.removeLayer(e)})),this.layersControl=null),this.markerCluster&&(this.markerCluster.clearLayers(),this.map.removeLayer(this.markerCluster)),this.map&&(this.map.remove(),this.map=xo["map"]("map-div",{fullscreenControl:!0,minZoom:2,maxZoom:18,maxBounds:[[-90,-180],[90,180]]}).setView([0,0],2)),this.tileLayer&&this.map.removeLayer(this.tileLayer),this.tileLayer=xo["tileLayer"]("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'Map data © OpenStreetMap contributors',maxZoom:18}).addTo(this.map),this.time_unit){case"Hour(s)":this.unit="hours";break;case"Day(s)":this.unit="days";break;case"Week(s)":this.unit="weeks";break;case"Month(s)":this.unit="months";break;case"Year(s)":this.unit="years";break;default:this.unit="hours";break}this.span=`&span=${this.unit},${this.time_range}`;const e=`https://knowledge.integratedmodelling.org/stats/public/stats/geojson/events?polygons=True${this.span}`;fetch(e).then((e=>e.json())).then((e=>{this.map.setView([0,0],2);const t=["#0099FF","#0077FF","#0055FF","#0033FF","#0011FF"],s=e.features.map((e=>e.properties.scale_size)),a=Math.min(...s),o=Math.max(...s),r=e.features.sort(((e,t)=>t.properties.scale_size-e.properties.scale_size)),i=new Set,l=new Set;this.polygonLayer&&(this.map.removeLayer(this.polygonLayer),this.polygonLayer=null),this.polygonLayer=xo["layerGroup"]().addTo(this.map);const n={},c=new Set;r.forEach((e=>{"Polygon"===e.geometry.type&&(c.has(e.properties.context_id)||(c.add(e.properties.context_id),n[e.properties.context_id]=new Set),n[e.properties.context_id].add(e.properties.observation))})),r.forEach((e=>{if("Polygon"===e.geometry.type&&!l.has(e.properties.context_id)){l.add(e.properties.context_id);const s=e.geometry.coordinates[0],r=s.map((e=>[e[1],e[0]])),c=e.properties.scale_size,u=Math.floor((c-a)/(o-a)*(t.length-1)),d=t[u],p=e.properties["name:en"]||"";if(!i.has(JSON.stringify(r))){const t=xo["polygon"](r,{fill:!0,fillColor:d,fillOpacity:.05,stroke:!0,color:"#00008B",weight:.2,tooltip:p}).addTo(this.polygonLayer);i.add(JSON.stringify(r));const s=`\n

${p}

\n

Context: ${e.properties.context_name}

\n

Applications: ${e.properties.application}

\n

Observations:

\n
    \n ${Array.from(n[e.properties.context_id]).map((e=>`
  • ${e}
  • `)).join("\n")}\n
\n `;t.bindPopup(s)}}})),this.markerCluster&&(this.map.removeLayer(this.markerCluster),this.markerCluster=null),this.markerCluster=xo["markerClusterGroup"]().addTo(this.map);const u=new Set;e.features.forEach((e=>{if("Polygon"===e.geometry.type&&!u.has(e.properties.context_id)){u.add(e.properties.context_id);const t=e.geometry.coordinates[0],s=[t.reduce(((e,t)=>e+t[1]),0)/t.length,t.reduce(((e,t)=>e+t[0]),0)/t.length];let a;"Success"===e.properties.outcome?a=Io.a:"Failure"===e.properties.outcome&&(a=Do.a);const o=e.properties["name:en"]||"",r=xo["marker"](s,{icon:xo["icon"]({iconUrl:a,iconSize:[40,40],iconAnchor:[12,41],popupAnchor:[8,-40]}),title:o,alt:o}),i=`\n

${o}

\n

Context: ${e.properties.context_name}

\n

Applications: ${e.properties.application}

\n

Observations:

\n
    \n ${Array.from(n[e.properties.context_id]).map((e=>`
  • ${e}
  • `)).join("\n")}\n
\n `;r.bindPopup(i),this.markerCluster.addLayer(r)}})),this.baseLayers={OpenStreetMap:xo["tileLayer"]("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'Map data © OpenStreetMap contributors',maxZoom:18})};const d={Markers:this.markerCluster,Polygons:this.polygonLayer};this.layerControl=xo["control"].layers(this.baseLayers,d).addTo(this.map)})).catch((e=>{console.error("An error occurred while retrieving the GeoJSON :",e)}))}},mounted(){this.map=xo["map"]("map-div",{minZoom:2,maxBounds:[[-90,-180],[90,180]],fullscreenControl:!0}).setView([0,0],2),this.tileLayer=xo["tileLayer"]("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'Map data © OpenStreetMap contributors',maxZoom:18}).addTo(this.map)}}),Mo=Go,Qo=Object(X["a"])(Mo,Po,No,!1,null,null,null),jo=Qo.exports;Se()(Qo,"components",{QInput:E["a"],QSelect:k["a"],QBtn:p["a"]});const Fo=[{path:"/",redirect:"/home",component:nt,children:[{path:"/home",name:"home",meta:{requiresAuth:!0,isAuthenticated:!0,default:!0},component:()=>Promise.all([s.e(0),s.e(2)]).then(s.bind(null,"bc13"))},{path:"/profile/view",name:"profileView",component:Ft,meta:{requiresAuth:!0}},{path:"/groups/view",name:"groupView",component:as,meta:{requiresAuth:!0}},{path:"/profile/certificate",name:"certificate",component:hs,meta:{requiresAuth:!0}},{path:"/admin",component:ks,meta:{requiresAuth:!0,requiresAdmin:!0},children:[{path:"",name:"adminHome",component:Ps},{path:"users",name:"adminUsers",component:ua},{path:"groups",name:"adminGroups",component:Aa},{path:"tasks",name:"adminTasks",component:xa},{path:"agreementTemplates",name:"adminAgreementTemplates",component:Wa},{path:"nodes",name:"adminNodes",component:io}]},{path:"/stats",component:Ss,meta:{requiresAuth:!0,requiresAdmin:!0},children:[{path:"",name:"stats",component:mo},{path:"queries",name:"statsQueries",component:To},{path:"userStats",name:"userStats",component:$o},{path:"observationMap",name:"observationMap",component:jo}]}]}];Fo.push({path:"*",component:()=>s.e(3).then(s.bind(null,"e51e"))});var Bo=Fo;a["a"].use(ue["a"]),a["a"].use(pe.a);const Vo=new ue["a"]({scrollBehavior:()=>({y:0}),routes:Bo,mode:"history",base:"/hub/ui/"});Vo.beforeEach(((e,t,s)=>{""===e.hash&&"/hub/"===e.path||(""!==e.hash&&"/hub/"===e.path?s("/home"):s())}));var Yo=Vo;const{hexToRgb:Ko,getBrand:Wo,rgbToHex:Ho}=ne["a"],zo=/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/;function Xo(e){if("string"!==typeof e)throw new TypeError("Expected a string");const t=zo.exec(e);if(t){const e={r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)};return t[4]&&(e.a=parseFloat(t[4])),e}return Ko(e)}function Zo(e){let t,s;return 0===e.indexOf("#")?(s=e,t=Ko(e)):-1!==e.indexOf(",")?(t=Xo(e),s=Ho(t)):(s=Wo(e),t=Ko(s)),{rgb:t,hex:s,color:e}}function Jo(e,t){const s=Object.getOwnPropertyNames(t);for(let a=0;a()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,username:/^[a-zA-Z0-9_.-]*$/,phone:/^[+]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/};async function tr(e){if(e.response){console.error(e.response),403===e.response.status&&(e.response.statusText="Forbidden page for user role");const t={status:e.response.data.status||e.response.status,message:e.response.data.message||e.response.data||(""!==e.response.statusText?e.response.statusText:"Unknown"),axiosError:e};if(t.message instanceof Blob&&"application/json"===t.message.type){const e=await new Promise((e=>{const s=new FileReader;s.onload=function(){e(JSON.parse(this.result))},s.readAsText(t.message)}));return e}return console.error(t),t}return e.request?(console.error(e.request),{status:e.request.status,message:e.message,axiosError:e}):(console.error(e),{status:"UNKNOWN",message:e.message,axiosError:e})}async function sr(e,t,s=null){const{type:a,url:o,params:r={},needAuth:i=!1,owner:l="layout",base_url:n=re["j"].HUB}=e;if("GET"!==a&&"POST"!==a&&"PUT"!==a&&"DELETE"!==a||null===o||""===o)throw new Error(`Bad axios call, check type and url: ${a} / ${o}`);Pr.dispatch("view/setSpinner",{...re["o"].SPINNER_LOADING,owner:"layout"},{root:!0}).then((async()=>{const e="GET"===a?ie.get:"POST"===a?ie.post:"DELETE"===a?ie.delete:ie.put;let c;try{let s=o;if("GET"===a&&0!==Object.keys(r).length){const e=new URLSearchParams(r).toString();s=`${o}?${e}`,console.debug(`${__ENV__.BASE_URL}/${s}`)}n===re["j"].HUB?s=`${__ENV__.BASE_URL}/${s}`:n===re["j"].KEYCLOAK&&(s=`${__ENV__.KEYCLOAK_URL}/${s}`),c=await e(s,r),c&&(t?t(c,(()=>{Pr.dispatch("view/setSpinner",{...re["o"].SPINNER_STOPPED,owner:l},{root:!0})})):(console.warn("Doing nothing after axios call"),Pr.dispatch("view/setSpinner",{...re["o"].SPINNER_STOPPED,owner:l},{root:!0})))}catch(u){const e=await tr(u);if(Pr.dispatch("view/setSpinner",{...re["o"].SPINNER_ERROR,owner:l,errorMessage:e.message,showNotifications:!1},{root:!0}),i&&401===e.status)return console.warn("We are logged out from backoffice"),void Pr.dispatch("auth/logout",!0,{root:!0});if(e.message&&-1!==e.message.toLowerCase().indexOf("network error")&&Pr.dispatch("view/setConnectionDown",!0),null===s)throw e;s(e)}}))}function ar(e,t=!1){if(e&&""!==e){const s=bt()(e);return t?s.format("L"):s.format("L - HH:mm")}return ce["b"].tc("messages.unknownDate")}function or(e,t,s){return s>=e.length?s=0:s<0&&(s=e.length-1),e.splice(s,0,e.splice(t,1)[0]),s}function rr(e,t){return e?t?new Date(e).getTime()-new Date(t).getTime():1:-1}const ir={USERS_NO_GROUPS:"$NO_GROUPS$"},lr={EQUAL:"eq",NOT_EQUAL:"neq",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL_TO:"gte",LESS_THAN:"lt",LESS_THAN_OR_EQUAL_TO:"lte",IN:"in",NOT_IN:"nin",BETWEEN:"btn",CONTAINS:"like",NOT_CONTAINS:"notLike",IS_NULL:"isnull",IS_NOT_NULL:"isnotnull",START_WITH:"startwith",END_WITH:"endwith",IS_EMPTY:"isempty",IS_NOT_EMPTY:"isnotempty",JOIN:"jn",IS:"is"};function nr(e,t,s){return`${e}|${t}|${s}`}function cr(e){return`$DATE$${bt()(e,"L").format("YYYY-MM-DD")}`}function ur(e){return e.charAt(0).toUpperCase()+e.slice(1)}function dr(e,t,s){t[`no${ur(e)}`]?s.push(nr(e,lr.IS_NULL,!0)):(t[`${e}From`]&&s.push(nr(e,lr.GREATER_THAN_OR_EQUAL_TO,cr(t[`${e}From`]))),t[`${e}To`]&&s.push(nr(e,lr.LESS_THAN_OR_EQUAL_TO,cr(t[`${e}To`]))))}function pr(e,t){const s=[],a=[];if(null!==t.username&&""!==t.username&&s.push(nr("name",lr.CONTAINS,t.username.toLowerCase())),null!==t.email&&""!==t.email&&s.push(nr("email",lr.CONTAINS,t.email.toLowerCase())),t.roles&&0!==t.roles.length){const e="any"===t.rolesAllAny?a:s;t.roles.forEach((t=>{e.push(nr("roles",lr.EQUAL,t.value))}))}if(t.noGroups)s.push(nr("groups",lr.EQUAL,ir.USERS_NO_GROUPS));else if(t.groups&&0!==t.groups.length){const e="any"===t.groupsAllAny?a:s;t.groups.forEach((t=>{e.push(nr("groups",lr.EQUAL,t.value))}))}t.accountStatus&&0!==t.accountStatus.length&&t.accountStatus.forEach((e=>{s.push(nr("accountStatus",lr.EQUAL,e.value))})),dr("lastConnection",t,s),dr("lastLogin",t,s),dr("registrationDate",t,s);const{page:o,rowsPerPage:r,sortBy:i,descending:l}=e,n={page:o,size:r,orders:`${i}|${l?"DESC":"ASC"}`,filterAnd:s.join("&"),filterOr:a.join("&")};return n}function mr(e){const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t);const s=document.getSelection().rangeCount>0&&document.getSelection().getRangeAt(0);t.select(),document.execCommand("copy"),document.body.removeChild(t),s&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(s))}var hr={login:({commit:e},t)=>new Promise(((t,s)=>{sr({type:re["u"].GET_PROFILE.method,url:re["u"].GET_PROFILE.url,needAuth:!0},(s=>{if(204!==s.status){const t=s.data,a=localStorage.getItem(re["g"].TOKEN);e("AUTH_SUCCESS",{token:a,profile:t})}t(s)}),(t=>{e("AUTH_ERROR",t),s(t)}))})),logout:({state:e,commit:t},s=!1)=>new Promise(((e,s)=>{localStorage.removeItem(re["g"].TOKEN),localStorage.removeItem(re["g"].REFRESH_TOKEN),t("LOGOUT");var o={redirectUri:__ENV__.APP_BASE_URL};a["a"].$keycloak.logout(o).catch((e=>{console.error(e)}))})),register:({commit:e},t)=>new Promise(((s,a)=>{console.log(t),sr({type:re["u"].REGISTER_USER.method,url:re["u"].REGISTER_USER.url,params:t},((t,a)=>{e("REGISTER_SUCCESS"),s(t),a()}),(t=>{e("REGISTER_FAILURE"),a(t)}))})),createProfile:({},e)=>new Promise(((t,s)=>{sr({type:re["u"].CREATE_PROFILE.method,url:re["u"].CREATE_PROFILE.url.replace("{username}",e.username),params:{username:e.username,email:e.email},needAuth:!0},((e,s)=>{t(e),s()}),(e=>{s(e)}))})),getProfileWithToken:({state:e,commit:t},{user:s,clickback:a})=>new Promise(((e,o)=>{sr({type:re["u"].GET_USER_NOAUTH.method,url:re["u"].GET_USER_NOAUTH.url.replace("{username}",s).replace("{clickback}",a)},((t,s)=>{const a=t.data;e(a),s()}),(e=>{t("EMAIL_REQUEST_FAILURE"),o(e)}))})),getProfile:({commit:e})=>new Promise(((t,s)=>{sr({type:re["u"].GET_PROFILE.method,url:re["u"].GET_PROFILE.url,needAuth:!0},((s,a)=>{if(204===s.status)t(s);else{const a=s.data;e("AUTH_PROFILE",a),t(a)}a()}),(t=>{e("AUTH_ERROR"),localStorage.removeItem("token"),s(t)}))})),updateProfile:(e,t)=>new Promise(((e,s)=>{sr({type:re["u"].UPDATE_PROFILE.method,url:re["u"].UPDATE_PROFILE.url.replace("{username}",t.name),params:{profile:t},needAuth:!0},((t,s)=>{e(),s()}),(e=>{s(e)}))})),getGroupsSummary:()=>new Promise(((e,t)=>{sr({type:re["u"].GROUP_SUMMARY.method,url:re["u"].GROUP_SUMMARY.url,needAuth:!0},((t,s)=>{const a=t.data.groups;e(a),s()}),(e=>{t(e)}))})),requestGroups:({state:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].TASK_GROUPS_REQUEST.method,url:re["u"].TASK_GROUPS_REQUEST.url.replace("{username}",e.profile.name),params:t,needAuth:!0},((e,t)=>{s(),t()}),(e=>{a(e)}))})),removeGroup:({state:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].TASK_GROUPS_REMOVE.method,url:re["u"].TASK_GROUPS_REMOVE.url.replace("{username}",e.profile.name),params:t,needAuth:!0},((e,t)=>{s(),t()}),(e=>{a(e)}))})),getCertificate:({commit:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].GET_CERTIFICATE.method,url:re["u"].GET_CERTIFICATE.url.replace("{username}",t.username).replace("{agreement}",t.agreementId),params:{responseType:"blob",certificate:!0},needAuth:!0},((t,a)=>{const o=new Blob([t.data],{type:t.data.type}),r=window.URL.createObjectURL(o),i=document.createElement("a");i.href=r;const l=t.headers["content-disposition"];let n="unknown";if(l){const e=l.match(/filename=(.+)/);2===e.length&&([,n]=e)}i.setAttribute("download",n),document.body.appendChild(i),i.click(),i.remove(),window.URL.revokeObjectURL(r),e("CERT_REQUEST_SUCCESS"),s(t),a()}),(t=>{e("CERT_REQUEST_FAILURE"),a(t)}))})),requestNewEmail:({commit:e},{id:t,email:s})=>new Promise(((e,a)=>{sr({type:re["u"].REQUEST_NEW_EMAIL.method,url:re["u"].REQUEST_NEW_EMAIL.url.replace("{username}",t).replace("{email}",s),needAuth:!0},((t,s)=>{t&&t.data?(e(t),s()):a({status:400,message:"no clickback received",error:null}),s()}),(e=>{a(e)}))})),requestNewPassword:({commit:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].REQUEST_NEW_PASSWORD.method,url:re["u"].REQUEST_NEW_PASSWORD.url.replace("{username}",t),needAuth:!0},((t,o)=>{t&&t.data?(e("PASSWORD_REQUEST_SUCCESS",t.data.clickback),s(t.data.clickback)):a({status:400,message:"no clickback received",error:null}),o()}),(e=>{a(e)}))})),setNewPassword:({commit:e,state:t},{passwordRequest:s,user:a=null,clickback:o=null})=>new Promise(((r,i)=>{sr({type:re["u"].SET_PASSWORD.method,url:re["u"].SET_PASSWORD.url.replace("{username}",null!==a?a:t.profile.name).replace("{clickback}",null!==o?o:t.clickback),params:{newPassword:s.password,confirm:s.confirmation},needAuth:!0},((t,s)=>{t&&t.data?(e("PASSWORD_SET_SUCCESS"),r(t)):i({status:400,message:"no clickback received",error:null}),s()}),(t=>{e("PASSWORD_SET_FAILURE"),i(t)}))})),activateUser:({commit:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].VERIFY.method,url:re["u"].VERIFY.url.replace("{username}",t.user).replace("{clickback}",t.token),needAuth:!0},((t,o)=>{if(t&&t.data){const{profile:a,clickback:o}=t.data;e("ACTIVATE_SUCCESS",{profile:a,clickback:o}),s(t)}else a({status:400,message:"error in activation, no data received",error:null});o()}),(t=>{e("ACTIVATE_FAILURE"),a(t)}))})),getGroup:({dispatch:e},t)=>new Promise(((s,a)=>{sr({dispatch:e,type:"GET",url:`api/groups/${t}`,needAuth:!0},((e,o)=>{e&&e.data?s(t):a({status:400,message:"No response",error:null}),o()}),(e=>{a(e)}))})),invitedNewUser:({commit:e,dispatch:t},s)=>(t("view/setSpinner",{...re["o"].SPINNER_LOADING,owner:"layout"},{root:!0}),new Promise(((a,o)=>{ie.post(`${__ENV__.BASE_URL}/signup?groups=${s.token}&addGroups=${s.groups.join(",")}`,{username:s.username,email:s.email}).then((s=>{e("register_success"),t("view/setSpinner",{...re["o"].SPINNER_STOPPED,owner:"layout"},{root:!0}),a(s)})).catch((s=>{e("register_failure"),t("view/setSpinner",{...re["o"].SPINNER_ERROR,owner:"layout"},{root:!0}),o(s)}))}))),invitedOAuthUserGroups:({commit:e,dispatch:t},s)=>(t("view/setSpinner",{...re["o"].SPINNER_LOADING,owner:"layout"},{root:!0}),new Promise(((a,o)=>{ie.put(`${__ENV__.BASE_URL}/signup?token=${s.authToken}&groups=${s.token}&addGroups=${s.addGroups}`).then((s=>{e("register_success"),t("view/setSpinner",{...re["o"].SPINNER_STOPPED,owner:"layout"},{root:!0}),a(s)})).catch((s=>{e("register_failure"),t("view/setSpinner",{...re["o"].SPINNER_ERROR,owner:"layout"},{root:!0}),o(s)}))}))),oAuthLogin:({commit:e,dispatch:t},s)=>new Promise(((a,o)=>{localStorage.setItem("token",s),ie.defaults.headers.common.Authentication=s,ie.get(`${__ENV__.BASE_URL}/api/users/me`).then((o=>{const r=o.data;e("auth_success",{token:s,profile:r}),t("view/setSpinner",{...re["o"].SPINNER_STOPPED,owner:"layout"},{root:!0}),a(o)})).catch((s=>{e("auth_error"),localStorage.removeItem("token"),t("view/setSpinner",{...re["o"].SPINNER_ERROR,owner:"layout"},{root:!0}),o(s)}))})),getAgreementTemplate:(e,{agreementType:t,agreementLevel:s})=>new Promise(((e,a)=>{sr({type:re["u"].GET_AGREEMENT_TEMPLATE.method,url:re["u"].GET_AGREEMENT_TEMPLATE.url.replace("{agreementType}",t).replace("{agreementLevel}",s)},((t,s)=>{e(t.data),s()}),(e=>{a(e)}))})),addGroupToUser:(e,{group:t,profile:s})=>new Promise(((e,a)=>{const o=[s.name],r=[t.name];sr({type:re["u"].USERS_GROUPS_ADD.method,url:re["u"].USERS_GROUPS_ADD.url.replace("{groupname}",t.name),params:{usernames:o,groupnames:r}},((t,s)=>{e(t.data),s()}),(e=>{a(e)}))})),deleteGroupFromUser:(e,{group:t,profile:s})=>new Promise(((e,a)=>{const o=[s.name],r=[t.name];sr({type:re["u"].USERS_GROUPS_DELETE.method,url:re["u"].USERS_GROUPS_DELETE.url.replace("{groupname}",t.name),params:{usernames:o,groupnames:r}},((t,s)=>{e(t.data),s()}),(e=>{a(e)}))})),validateEmail:(e,{username:t,email:s,password:a,clickback:o})=>new Promise(((e,r)=>{const i=o;sr({type:re["u"].USERS_VALIDATE_EMAIL.method,url:re["u"].USERS_VALIDATE_EMAIL.url.replace("{username}",t),params:{username:t,email:s,password:a,token:i}},((t,s)=>{e(t.data),s()}),(e=>{r(e)}))})),getNotifications:({commit:e},{username:t})=>new Promise(((s,a)=>{sr({type:re["u"].GET_NOTIFICATIONS_BY_USER.method,url:re["u"].GET_NOTIFICATIONS_BY_USER.url.replace("{username}",t)},((t,a)=>{let o=t.data;e("NOTIFICATIONS_LOADED",o),s(t.data),a()}),(e=>{a(e)}))})),createNotification:(e,t)=>new Promise(((e,s)=>{console.log(t),sr({type:re["u"].CREATE_NOTIFICATION.method,url:re["u"].CREATE_NOTIFICATION.url,params:t},((t,s)=>{e(t.data),s()}),(e=>{s(e)}))})),deleteNotification:(e,{id:t})=>new Promise(((e,s)=>{sr({type:re["u"].DELETE_NOTIFICATION.method,url:re["u"].DELETE_NOTIFICATION.url.replace("{id}",t)},((t,s)=>{e(t.data),s()}),(e=>{s(e)}))}))},gr={namespaced:!0,state:te,getters:se,mutations:ae,actions:hr},br={spinner:re["o"].SPINNER_STOPPED,spinnerOwners:[],connectionDown:!1},fr={spinnerIsAnimated:e=>e.spinner.animated,spinner:e=>e.spinner,spinnerOwners:e=>e.spinnerOwners,spinnerColor:e=>"undefined"!==e.spinner&&null!==e.spinner?Zo(e.spinner.color):null,spinnerErrorMessage:e=>"undefined"!==e.spinner&&null!==e.spinner?e.spinner.errorMessage:null,isConnectionDown:e=>e.connectionDown},Er={SET_SPINNER_ANIMATED:(e,t)=>{e.spinner.animated=t},SET_SPINNER_COLOR:(e,t)=>{e.spinner.color=t},SET_SPINNER:(e,{animated:t,color:s,errorMessage:a=null,showNotifications:o=!1})=>{e.spinner={animated:t,color:s,errorMessage:a,showNotifications:o}},ADD_TO_SPINNER_OWNERS:(e,t)=>{const s=e.spinnerOwners.indexOf(t);-1===s&&e.spinnerOwners.push(t)},REMOVE_FROM_SPINNER_OWNERS:(e,t)=>{const s=e.spinnerOwners.indexOf(t);-1!==s&&e.spinnerOwners.splice(s,1)},SET_CONNECTION_DOWN:(e,t)=>{e.connectionDown=t}},vr={setSpinner:({commit:e,getters:t,dispatch:s},{animated:a,color:o,time:r=null,then:i=null,errorMessage:l=null,showNotifications:n=!1,owner:c})=>new Promise(((u,d)=>{c&&null!==c?(a?e("ADD_TO_SPINNER_OWNERS",c):(e("REMOVE_FROM_SPINNER_OWNERS",c),0!==t.spinnerOwners.length&&(a=!0,o!==re["o"].SPINNER_ERROR.color&&({color:o}=re["o"].SPINNER_LOADING))),e("SET_SPINNER",{animated:a,color:o,errorMessage:l,showNotifications:n}),null!==r&&null!==i&&setTimeout((()=>{s("setSpinner",{...i,owner:c})}),1e3*r),u()):d(new Error("No spinner owner!"))})),setConnectionDown:({commit:e},t)=>{e("SET_CONNECTION_DOWN",t)}},kr={namespaced:!0,state:br,getters:fr,mutations:Er,actions:vr},_r={agreementTemplate:null,agreementTemplates:[],stats:{},users:[],queries:{},userStats:[],labels:[],registeredUsers:[],groups:[],groupsOptions:[],groupsIcons:[],group:null,user:null,nodes:[],node:[],tasks:[],senders:{}},Tr={agreementTemplate:e=>e.agreementTemplate,agreementTemplates:e=>e.agreementTemplates,stats:e=>e.stats,users:e=>e.users,groups:e=>e.groups,groupsIcons:e=>e.groupsIcons,groupsOptions:e=>e.groupsOptions,senders:e=>e.senders,tasks:e=>e.tasks,nodes:e=>e.nodes,user:e=>e.user,group:e=>e.group,node:e=>e.node,queries:e=>e.queries,userStats:e=>e.userStats,registeredUsers:e=>e.registeredUsers,labels:e=>e.labels},wr={stat_success(e,t){e.stats=t},LOAD_AGREEMENT_TEMPLATES(e,t){e.agreementTemplates=t},LOAD_USERS(e,t){e.users=t},LOAD_QUERIES(e,t){e.queries=t},LOAD_USER_STATS(e,{labels:t,registeredUsers:s}){e.labels=t,e.registeredUsers=s},LOAD_GROUPS(e,t){e.groups=t,e.groupsIcons.splice(0,e.groupsIcons.length),e.groupsOptions.splice(0,e.groupsOptions.length),t.forEach((t=>{const s=t.iconUrl?t.iconUrl:null;e.groupsIcons[t.name]=s,e.groupsOptions.push({label:t.name,value:t.name,description:t.description,icon:s,dependencies:t.dependsOn})}))},LOAD_AGREEMENT_TEMPLATE(e,t){e.agreementTemplate=t},LOAD_USER(e,t){e.user=t},LOAD_GROUP(e,t){e.group=t},LOAD_NODES(e,t){e.nodes=t},LOAD_NODE(e,t){e.node=t},LOAD_NEW_NODE(e,t){e.node=t},LOAD_TASKS(e,t){e.tasks=t},LOAD_SENDERS(e,t){e.senders=t}},yr={loadUsers:({commit:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].USERS.method,url:re["u"].USERS.url,params:t,needAuth:!0},((o,r)=>{if(o.data){const{items:a}=o.data,r={...t.pagination,page:o.data.currentPage,rowsNumber:o.data.totalItems};a.forEach((e=>{e.agreements.length>0?e.groups=e.agreements[0].agreement.groupEntries.map((e=>e.group.name)):console.warn(`User without agreement: name:'${e.name}'/email:'${e.email}'`)})),e("LOAD_USERS",a),s(r)}else a(new Error("Error retrieving users: no data"));r()}),(e=>{a(e)}))})),loadUser:({commit:e},t=null)=>new Promise(((s,a)=>{null===t?a(new Error("No username selected")):sr({type:re["u"].GET_USER.method,url:re["u"].GET_USER.url.replace("{username}",t),needAuth:!0},((t,o)=>{t.data?(e("LOAD_USER",t.data),s(t.data)):a(new Error("Error retrieving user: no data")),o()}),(e=>{a(e)}))})),resetUser({commit:e}){e("LOAD_USER",null)},deleteUser:(e,t=null)=>new Promise(((e,s)=>{null===t?s(new Error("No username selected")):sr({type:re["u"].DELETE_USER.method,url:re["u"].DELETE_USER.url.replace("{username}",t),needAuth:!0},((t,a)=>{t?e(t):s(new Error("Error deleting user: no data")),a()}),(e=>{s(e)}))})),loadQueries:({commit:e},t="")=>new Promise(((s,a)=>{t||(t="");const o=re["u"].QUERIES.url.concat(t);sr({type:re["u"].QUERIES.method,url:o,needAuth:!0},((t,o)=>{t.data?(e("LOAD_QUERIES",t.data),s(t.data)):a(new Error("Error retrieving queries: no data")),o()}),(e=>{a(e)}))})),loadUserStats:({commit:e},t="")=>new Promise(((s,a)=>{t||(t="?groupBy=month");const o=re["u"].USER_STATS.url.concat(t);sr({type:re["u"].USER_STATS.method,url:o,needAuth:!0},((t,o)=>{t.data?(e("LOAD_USER_STATS",{labels:t.data.map((e=>e.dateString)),registeredUsers:t.data.map((e=>e.count))}),s(t.data.map((e=>e.dateString)),t.data.map((e=>e.count)))):a(new Error("Error retrieving queries: no data")),o()}),(e=>{a(e)}))})),loadTasks:({commit:e})=>new Promise(((t,s)=>{sr({type:re["u"].TASKS.method,url:re["u"].TASKS.url,needAuth:!0},((a,o)=>{a.data?(e("LOAD_TASKS",a.data),t(a)):s(new Error("Error retrieving tasks: no data")),o()}),(e=>{s(e)}))})),acceptTask:(e,t)=>new Promise(((e,s)=>{sr({type:re["u"].TASKS_ACCEPT.method,url:re["u"].TASKS_ACCEPT.url.replace("{id}",t),needAuth:!0},((t,a)=>{t.data?e(t.data):s(new Error("Error accepting tasks: no data")),a()}),(e=>{s(e)}))})),denyTask:(e,{id:t,deniedMessage:s})=>new Promise(((e,a)=>{sr({type:re["u"].TASKS_DENY.method,url:re["u"].TASKS_DENY.url.replace("{id}",t),needAuth:!0,params:{deniedMessage:s}},((t,s)=>{t.data?e(t.data):a(new Error("Error denying tasks: no data")),s()}),(e=>{a(e)}))})),loadSenders:({commit:e})=>new Promise(((t,s)=>{sr({type:re["u"].EMAIL_SENDERS.method,url:re["u"].EMAIL_SENDERS.url,needAuth:!0},((a,o)=>{if(a.data){const s=a.data;e("LOAD_SENDERS",s),t(s)}else s(new Error("Error retrieving senders: no data"));o()}),(e=>{s(e)}))})),modifyUsersGroups:(e,{users:t,groups:s,action:a})=>new Promise(((e,o)=>{if(t&&t.length>0&&s&&s.length>0){const r=a===re["a"].ADD_GROUPS_ACTION?re["r"].REQUEST_GROUP:a===re["a"].REMOVE_GROUPS_ACTION?re["r"].REMOVE_GROUP:"";sr({type:re["u"].REQUEST_USERS_GROUPS.method,url:re["u"].REQUEST_USERS_GROUPS.url.replace("{actionParam}",r),needAuth:!0,params:{usernames:t,groupnames:s}},((t,s)=>{e(t),s()}),(e=>{o(e)}))}else o(new Error("Empty users or groups"))})),loadGroups:({commit:e})=>new Promise(((t,s)=>{sr({type:re["u"].GROUPS.method,url:re["u"].GROUPS.url,needAuth:!0},(async(a,o)=>{if(a.data){const{groups:s}=a.data;e("LOAD_GROUPS",s),t(s),o()}else s(new Error("Error retrieving groups: no data")),o()}),(e=>{s(e)}))})),loadAgreementTemplate:({commit:e},t)=>new Promise(((s,a)=>{if(null===t.id){const t={id:"",agreementLevel:"",agreementType:"",validDate:"",defaultTemplate:!1,text:"",defaultGroups:[],defaultDuration:"",defaultDurationPeriod:{}};e("LOAD_AGREEMENT_TEMPLATE",t),s(t)}else sr({type:re["u"].GET_AGREEMENT_TEMPLATE_FILTER.method,url:re["u"].GET_AGREEMENT_TEMPLATE_FILTER.url,params:t},((t,a)=>{const o={...t.data.agreementTemplate,defaultDurationPeriod:ga(t.data.agreementTemplate.defaultDuration)};e("LOAD_AGREEMENT_TEMPLATE",o),s(t.data),a()}),(e=>{console.error(e),a(e)}))})),loadGroup:({commit:e},t=null)=>new Promise(((s,a)=>{if(null===t){const t={description:"",iconUrl:"",name:"",observables:[],optIn:!1,complimentary:!1,projectUrls:[],worldview:!1,defaultExpirationTime:{},defaultExpirationTimePeriod:{year:0,month:0,day:0}};e("LOAD_GROUP",t),s(t)}else sr({type:re["u"].GET_GROUP.method,url:re["u"].GET_GROUP.url.replace("{name}",t),needAuth:!0},((t,o)=>{if(t.data){const{group:a}=t.data;a.defaultExpirationTimePeriod=ga(a.defaultExpirationTime),e("LOAD_GROUP",a),s(a)}else a(new Error("Error retrieving groups: no data"));o()}),(e=>{a(e)}))})),resetAgreementTemplate({commit:e}){e("LOAD_AGREEMENT_TEMPLATE",null)},resetGroup({commit:e}){e("LOAD_GROUP",null)},createAgreementTemplate:({dispatch:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].CREATE_AGREEMENT_TEMPLATE.method,url:re["u"].CREATE_AGREEMENT_TEMPLATE.url,params:t,needAuth:!0},((t,a)=>{s(t),a(),e("loadAgreementTemplates")}),(e=>{a(e)}))})),createGroup:({dispatch:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].CREATE_GROUP.method,url:re["u"].CREATE_GROUP.url,params:t,needAuth:!0},((t,a)=>{s(t),a(),e("loadGroups")}),(e=>{a(e)}))})),updateAgreementTemplate:({dispatch:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].UPDATE_AGREEMENT_TEMPLATE.method,url:re["u"].UPDATE_AGREEMENT_TEMPLATE.url.replace("{id}",t.id),params:t,needAuth:!0},((t,a)=>{s(t),a(),e("loadAgreementTemplates",{})}),(e=>{a(e)}))})),updateGroup:({dispatch:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].UPDATE_GROUP.method,url:re["u"].UPDATE_GROUP.url.replace("{name}",t.name),params:t,needAuth:!0},((t,a)=>{s(t),a(),e("loadGroups")}),(e=>{a(e)}))})),deleteAgreementTemplate:({dispatch:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].DELETE_AGREEMENT_TEMPLATE.method,url:re["u"].DELETE_AGREEMENT_TEMPLATE.url.replace("{id}",t),needAuth:!0},((t,a)=>{s(t),a(),e("loadAgreementTemplates")}),(e=>{a(e)}))})),deleteAgreementTemplates:({dispatch:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].DELETE_AGREEMENT_TEMPLATES.method,url:re["u"].DELETE_AGREEMENT_TEMPLATES.url,params:t,needAuth:!0},((t,a)=>{s(t),a(),e("loadAgreementTemplates")}),(e=>{a(e)}))})),deleteGroup:({dispatch:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].DELETE_GROUP.method,url:re["u"].DELETE_GROUP.url.replace("{name}",t),needAuth:!0},((t,a)=>{s(t),a(),e("loadGroups")}),(e=>{a(e)}))})),loadNodes:({commit:e})=>new Promise(((t,s)=>{sr({type:re["u"].NODES.method,url:re["u"].NODES.url,needAuth:!0},((a,o)=>{if(a.data){const{nodes:s}=a.data;e("LOAD_NODES",s),t(s)}else s(new Error("Error retrieving groups: no data"));o()}),(e=>{s(e)}))})),loadNode:({commit:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].GET_NODE.method,url:re["u"].GET_NODE.url.replace("{name}",t),needAuth:!0},((t,o)=>{if(t.data){const{node:a}=t.data;e("LOAD_NODE",a),s(a)}else a(new Error("Error retrieving groups: no data"));o()}),(e=>{a(e)}))})),createNode:({dispatch:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].CREATE_NODE.method,url:re["u"].CREATE_NODE.url,params:t,needAuth:!0},((t,a)=>{s(t),a(),e("loadNodes")}),(e=>{a(e)}))})),updateNode:({dispatch:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].UPDATE_NODE.method,url:re["u"].UPDATE_NODE.url.replace("{name}",t.name),params:t,needAuth:!0},((t,a)=>{s(t),a(),e("loadNodes")}),(e=>{a(e)}))})),deleteNode:({dispatch:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].DELETE_NODE.method,url:re["u"].DELETE_NODE.url.replace("{name}",t),needAuth:!0},((t,a)=>{s(t),a(),e("loadNodes")}),(e=>{a(e)}))})),downloadNodeCertificate:({commit:e},t)=>new Promise(((s,a)=>{sr({type:re["u"].GET_NODE_CERTIFICATE.method,url:re["u"].GET_NODE_CERTIFICATE.url.replace("{name}",t),params:{responseType:"blob"},needAuth:!0},((t,a)=>{const o=new Blob([t.data],{type:t.data.type}),r=window.URL.createObjectURL(o),i=document.createElement("a");i.href=r;const l=t.headers["content-disposition"];let n="unknown";if(l){const e=l.match(/filename=(.+)/);2===e.length&&([,n]=e)}i.setAttribute("download",n),document.body.appendChild(i),i.click(),i.remove(),window.URL.revokeObjectURL(r),e("CERT_REQUEST_SUCCESS"),s(t),a()}),(t=>{e("CERT_REQUEST_FAILURE"),a(t)}))})),loadNewNode:({commit:e})=>new Promise((t=>{const s={name:"",email:"",nodeUrl:"",groups:[]};e("LOAD_NEW_NODE",s),t(s)})),getStats:({commit:e,dispatch:t})=>(t("view/setSpinner",{...re["o"].SPINNER_LOADING,owner:"layout"},{root:!0}),new Promise(((s,a)=>{ie.get(`${__ENV__.BASE_URL}/ping`).then((a=>{t("view/setSpinner",{...re["o"].SPINNER_STOPPED,owner:"layout"},{root:!0}),e("stat_success",a.data),s(a)})).catch((s=>{t("view/setSpinner",{...re["o"].SPINNER_ERROR,owner:"layout"},{root:!0}),e("stat_failure"),a(s)}))}))),loadCustomProperties:(e,t)=>new Promise(((e,s)=>{sr({type:re["u"].GET_CUSTOM_PROPERTIES.method,url:re["u"].GET_CUSTOM_PROPERTIES.url.replace("{type}",t),needAuth:!0},((t,s)=>{e(t),s()}),(e=>{s(e)}))})),createNewCustomPropertyKey:(e,{type:t,name:s})=>new Promise(((e,a)=>{sr({type:re["u"].ADD_CUSTOM_PROPERTIES.method,url:re["u"].ADD_CUSTOM_PROPERTIES.url,params:{type:t,name:s},needAuth:!0},((t,s)=>{e(t),s()}),(e=>{a(e)}))})),loadAgreementTemplates:({commit:e},{filter:t={}})=>new Promise(((s,a)=>{sr({type:re["u"].AGREEMENT_TEMPLATES.method,url:re["u"].AGREEMENT_TEMPLATES.url,params:{filter:t},needAuth:!0},((t,a)=>{const{agreementTemplates:o}=t.data;e("LOAD_AGREEMENT_TEMPLATES",o),s(o),a()}),(e=>{a(e)}))}))},Cr={namespaced:!0,state:_r,getters:Tr,mutations:wr,actions:yr},Sr={keycloakProfile:{id:void 0,username:void 0,email:void 0},isAuthenticated:!1,sign_agreement:!1},Ar={profile:e=>e.keycloakProfile,isAuthenticated:e=>e.isAuthenticated,signing_agreement:e=>e.sign_agreement},qr={AUTH_SUCCESS_KEYCLOAK(e){e.isAuthenticated=!0},AUTH_KEYCLOAK(e,t){e.keycloakProfile={id:t.id,username:t.username,email:t.email}},SIGN_AGREEMENT(e){e.sign_agreement=!0},SIGN_AGREEMENT_FINISH(e){e.sign_agreement=!1}},Or={getAccount:({commit:e},{email:t})=>new Promise(((e,t)=>{sr({type:re["u"].KEYCLOAK_GET_ACCOUNT.method,url:re["u"].KEYCLOAK_GET_ACCOUNT.url,needAuth:!0,base_url:re["j"].KEYCLOAK},((s,a)=>{if(s){let t=s.data;e(t)}else t(new Error("Error retrieving users: no data"));a()}),(e=>{t(e)}))}))},Rr={namespaced:!0,state:Sr,getters:Ar,mutations:qr,actions:Or};a["a"].use(W["a"]);const $r=new W["a"].Store({modules:{auth:gr,view:kr,admin:Cr,keycloak:Rr}});var Pr=$r,Nr=async function(){const e="function"===typeof Pr?await Pr({Vue:a["a"]}):Pr,t="function"===typeof Yo?await Yo({Vue:a["a"],store:e}):Yo;e.$router=t;const s={router:t,store:e,render:e=>e(J),el:"#q-app"};return{app:s,store:e,router:t}};a["a"].config.productionTip=!1,a["a"].use(Ve),console.log(),a["a"].$keycloak.init({onLoad:"login-required",checkLoginIframe:!1}).then((e=>{e?(localStorage.setItem(re["g"].TOKEN,a["a"].$keycloak.token),localStorage.setItem(re["g"].REFRESH_TOKEN,a["a"].$keycloak.refreshToken),a["a"].prototype.$http.defaults.headers.common.Authorization=re["g"].BEARER+a["a"].$keycloak.token,Pr.commit("keycloak/AUTH_SUCCESS_KEYCLOAK"),Pr.dispatch("auth/login").then((e=>{console.debug("Authenticated")})).catch((e=>{throw console.error(e),e}))):window.location.reload(),setInterval((()=>{a["a"].$keycloak.updateToken().then((e=>{if(0!=Pr.getters["auth/isLoggedIn"])e?(console.debug(`Token refreshed ${e}`),localStorage.setItem(re["g"].TOKEN,a["a"].$keycloak.token),localStorage.setItem(re["g"].REFRESH_TOKEN,a["a"].$keycloak.refreshToken),a["a"].prototype.$http.defaults.headers.common.Authorization=re["g"].BEARER+a["a"].$keycloak.token):console.debug(`Token not refreshed, valid for ${Math.round(a["a"].$keycloak.tokenParsed.exp+a["a"].$keycloak.timeSkew-(new Date).getTime()/1e3)} seconds`);else if(!Pr.getters["keycloak/signing_agreement"]){var t={redirectUri:__ENV__.APP_BASE_URL};a["a"].$keycloak.logout(t).catch((e=>{console.error(e)})),Pr.commit("LOGOUT")}})).catch((()=>{console.error("Failed to refresh token")}))}),6e4)})).catch((e=>{console.error(e),console.debug("Authenticated Failed")}));const xr="/hub/ui/",Ur=/\/\//,Ir=e=>(xr+e).replace(Ur,"/");async function Lr(){const{app:e,store:t,router:s}=await Nr();let o=!1;const r=e=>{o=!0;const t=Object(e)===e?Ir(s.resolve(e).route.fullPath):e;window.location.href=t},i=window.location.href.replace(window.location.origin,""),l=[ce["a"],le,void 0];for(let c=0;!1===o&&c{e.i18n=l}},"8de8":function(e,t,s){},"8f27":function(e,t,s){"use strict";s("b5be")},"923f":function(e,t,s){"use strict";(function(e){t["a"]={commons:{appName:"k.Hub"},menu:{home:"Home",downloads:"Downloads",profile:"Profile",certificate:"Download certificate",admin:"Admin",users:"Users",groups:"Groups",usersToGroups:"Assign groups",tasks:"Tasks",agreementTemplates:"Agreement Templates",nodes:"Nodes",stats:"Statistics",queries:"Queries",userStats:"User Statistics",observationMap:"Observation Map"},tables:{contextId:"Context ID",resolutionTime:"Resolution Time (in s)",successful:"Successful",assetName:"Asset Name",count:"Count",resolutionTimeTotal:"Total Resolution Time (in s)",outcome:"Outcome",resolutionTimeMin:"Minimum Resolution Time",resolutionTimeMax:"Maximum Resolution Time",queryId:"Query ID",contextName:"Context Name",observable:"Observable",assetType:"Asset Type",startTime:"Start Time",startDate:"Start Date",principal:"Username"},titles:{changeEmailAddress:"Change email address",downloadCertificateChangeEmail:"Important!",areYouSure:"Are you sure?"},labels:{agreementLevel:"Agreement Level",agreementType:"Agreement Type",agreementTemplates:"Agreement Templates",agreementTemplate:"agreement Template",warning:"Warning",username:"Username",password:"Password",newPassword:"New password",newPasswordConfirmation:"New password confirmation",btnLogin:"Login",textLogin:"Already signed up?",textReturnToLogin:"Return to login",linkLogin:"Login",textRegister:"New to k.LAB?",linkRegister:"Sign up",btnRegister:"Register",btnAccept:"Accept",btnCancel:"Cancel",btnClose:"Close",btnDeleteAgreementTemplates:"Delete agreement templates",deleteAgreementTemplate:"Delete agreement templates",btnGoogle:"Sign in with Google",btnNewAgreementTemplate:"Add New",btnSetPassword:"Set password",forgotPassword:"Forgot password?",btnResetPassword:"Reset password",btnUpdateAgreementTemplate:"Update agreement",defaultGroups:"Default groups",defaultDuration:"Default duration",defaultTemplate:"Default template",email:"Email",currentEmail:"Current email",accountHeader:"Account information",groupsHeader:"Groups",personalHeader:"Personal data",acceptEULA:"Accept",declineEULA:"Decline",changePasswordConfirmation:"Change",firstName:"First name",lastName:"Last name",middleName:"Middle initial",address:"Address",addressPlaceholder:"Address, city, state/region, postal code, country",phone:"Phone number",affiliation:"Affiliation",jobTitle:"Job title",updateProfileBtn:"Update profile",yes:"Yes",no:"No",notice:"Notice",registrationDate:"Registration date",lastLogin:"Last login",sendUpdates:"Send updates",groups:"Groups",roles:"Roles",queries:"Queries ",users:"users",editUser:"Edit user {username}",deleteUser:"Delete user {username}",tasks:"tasks",roleAdministrator:"Administrator",roleDataManager:"Data manager",roleUser:"User",roleSystem:"System",roleUnknown:"Unknown role",rolesAll:"All roles",groupsAll:"All groups",groupsAny:"Any group",noGroups:"Without groups assigned",accountStatus:"Status",statusActive:"Active",statusInactive:"Inactive",statusPendingActivation:"Pending",statusVerified:"Verified",filterBy:"Filter by:",filterInfo:"Showing {filtered} {element}: {number}",filterInfoQueries:"Showing {filtered} queries: {number}",filtered:"filtered",selectedInfo:"Applying action to {selected} of {total} {type}(s)",all:"all",pagination:"{firstRowIndex} - {endRowIndex} of {totalRowsNumber}",queriesFrom:"Queries made from",queriesTo:"Queries made to",lastConnectionFrom:"Engine connection from",lastConnectionTo:"Engine connection to",hasLastConnection:"Without engine connections",registrationDateFrom:"Register from",registrationDateTo:"Register to",hasRegistrationDate:"Without registration date",updateField:"Update field",lastLoginFrom:"Last login from",lastLoginTo:"Last login to",hasLastLogin:"Without last login",forProfit:"For profit",goToDashboard:"Go to dashboard",groupName:"Name",groupDescription:"Description",groupIcon:"Icon",groupProjectUrls:"Project urls",groupProjectUrl:"Project url",howToProjectUrls:"Add or delete project urls",groupObservables:"Observables",groupRoleRequirement:"Role Requirement",groupDependsOn:"Dependencies",groupNoValue:"No value",groupWorldView:"World view",groupComplimentary:"Complimentary",groupDefaultExpirationTime:"Default expiration time",groupMaxUpload:"Max upload (bytes)",groupSshKey:"Ssh key",groupCustomProperties:"Custom properties",groupSubscribed:"Subscribed",groupUnsubscribed:"Unsubscribed",groupOptIn:"Opt-in groups",groupOptionOptIn:"Opt-in",groupNoOptin:"Groups",newEmail:"New email",newEmailConfirmation:"New email confirmation",institution:"Institution",nonProfit:"Non Profit",selectGroupButtonDefault:"Select",availableGroups:"Available Groups",expireDate:"Until",sendVerificationEmail:"Update email",taskStatusPending:"Pending",taskStatusError:"Error",taskId:"Id",taskUser:"User",taskIssued:"Issued",taskClosed:"Closed",taskRoleRequirement:"Role requirement",taskAutoAccepted:"Auto accepted",taskAccepted:"Task accepted",taskStatusAccepted:"Accepted",taskStatusDenied:"Denied",taskDenied:"Task denied",taskNext:"Next tasks",taskNoNext:"No",taskType:"Type",taskTypeAll:"All types",taskDescription:"Description",taskStatusLog:"Status and log",taskStatus:"Status",taskStatusAll:"All statuses",taskIssuedFrom:"Issued from",taskIssuedTo:"Issued to",taskClosedFrom:"Closed from",taskClosedTo:"Closed to",taskOpen:"Only open tasks",taskGroupRequest:"Group request",taskCreateGroup:"Create group",taskRemoveGroupRequest:"Remove group",taskTypeUnknown:"Unknown type",text:"Text",toogleDefaultTemplate:"Default template?",refreshUsers:"Refresh users",refreshQueries:"Refresh queries",refreshTasks:"Refresh tasks",refreshGroups:"Refresh groups",refreshNodes:"Refresh nodes",refreshAgreementTemplates:"Refresh agreement templates",applyFilters:"Apply filters",clearSearch:"Clear search",noDataAvailable:"No data has been found",selectAll:"Select all",unselectAll:"Unselect all",lastConnection:"Last connection",actionsGroups:"Groups actions",assignGroups:"Assign groups",removeGroups:"Remove groups",actionsOthers:"Other actions",actionsNodes:"Nodes actions",sendEmail:"Send email",emailSenders:"From",emailRecipients:"To",emailSubject:"Subject",emailContent:"Content",emailType:"Type",sendingToUsers:"Send email to {users} users",forceSend:"{users} users doesn't want receiving news. Send to them too?",requestGroups:"Groups request",requestGroupsText:"This groups require administrator approval.",requestGroupsButton:"Request",createGroup:"Create new group",updateGroup:"Update group",editGroup:"Edit group",deleteGroup:"Delete group",submitForm:"Submit",cancelForm:"Cancel",addObservable:"New observable",acceptTask:"Accept selected tasks",denyTask:"Deny selected tasks",nodeName:"Node name",nodeEmail:"Contact",nodeUrl:"URL",nodeGroups:"Groups",cancelNodeForm:"Cancel",createNode:"Create node",updateNodeForm:"Update node",createNodeForm:"Create new node",editEmail:"Edit email address",chkOptIn:"Opt in",chkComplimentary:"Complimentary",chkWorldView:"World view",editObservable:"Edit observable",associatedObservables:"Associated observables",howToObservables:"Select an item to move, edit or delete it",observableToStart:"First observable",observableToEnd:"Last observable",observableLabel:"Label",observableIsSeparator:"Is separator",observableObservable:"Observable",observableSemantic:"Semantic",observableDescription:"Description",observableState:"State",observableExtendedDescription:"Extended description",observableAdd:"New observable",stateForthcoming:"Forthcoming",stateExperimental:"Experimental",stateNew:"New",stateStable:"Stable",stateBeta:"Beta",stateDemo:"Demo",observableInsertionPoint:"Insertion point",observableInsertFirst:"First",observableInsertLast:"Last",day:"day",month:"month",year:"year",key:"Key",value:"Value",visible:"Visible",ok:"OK",cancel:"CANCEL",delete:"DELETE",dismiss:"Dismiss",queryAssetNameGroupCount:"Asset Name Group Count",queryAsset:"Asset",queryOutcomeGroupCount:"Outcome Group Count",queryOutcomeAggregate:"Outcome Aggregate",queryContextNameCount:"Context Name Count",queryTimeRange:"Time Range",registrationRange:"Registrations",queryQueriesPer:"Queries per Time Interval",queryRequestsPerUser:"Requests per User",user:"User",updateEmailTitle:"Update email address",validDate:"Valid date",updateEmailAddress:"Update email address",yearMonth:"Registrations per Month",yearYear:"Registrations per Year",monthAccumulation:"Accumulated registrations per Month",yearAccumulation:"Accumulated registrations per Year",newProperty:"New property",editProperty:"Edit property"},messages:{agreementTemplateDefaultTemplate:"Only can be one default template by type and level. If you choose this agreement template as default, the others with the same type and level must be checked as false.",agreementTemplatesLoaded:"Agreement templates loaded",agreementTemplatesLoadedError:"Error loading agreement templates",agreementTemplateDeleted:"Agreemente template deleted",agreementTemplateDeletedError:"Error deleting agreement template",agreementTemplateCreated:"Agreement template created",agreementTemplateCreatedError:"Error creating agreement template",agreementTemplateUpdated:"Agreement template updated",agreementTemplateUpdatedError:"Error updating agreement template",dialogCancelAgreeemet:"If you do not accept the agreement and acknowledge this message, you will be logged out.",emailChangeVerification:'Please enter your new email address and click "update email". A verification email will be sent to the new address when you login again. Click the URL verification email to complete your new email update.',emailChangeVerificationInfo:"*Please note that you have to log out and verify the new email to see the changes.",emailConfirmationError:"Email addresses must be equals",emailChanged:"Email changed",emailChangedError:"There was an error, email is not changed",emailAlreadyChanged:"The email is already changed",genericError:"There was an error, please try later",networkError:"Network error",fieldRequired:"Field required",passwordValidationError:"Password must be between 8 and 32 characters",passwordUnableToDo:"Unable to change user password",passwordChanged:"Password changed",passwordChangedError:"There was an error, password is not changed",passwordMailError:"There wan an error sending confirmation email, password is changed",passwordDoesNotMatch:"Password does not match the password verification field",changingPassword:"Changing password",downloadingCertificate:"Downloading certificate",errorGeneratingCertificate:"Error generating certificate, please try later",refreshingUsers:"Refreshing users",usersLoaded:"Users loaded",usersLoadedError:"Error loading users",queriesLoaded:"Queries loaded",queriesLoadedError:"Error loading queries",queriesNull:"Query response is null",userStatsLoaded:"User statistics loaded",userStatsLoadedError:"Error loading user statistics",noPendingTasks:"There are no pending tasks",groupsLoaded:"Groups loaded",groupsLoadedError:"Error loading groups",groupDeleted:"Group {group} deleted",groupDeletedError:"Error deleting group {group}",groupCreated:"Group {group} created",groupCreatedError:"Error creating group {group}",groupUpdated:"Group {group} updated",groupUpdatedError:"Error updating group {group}",notDeletableGroup:"It's not possible to delete this group because {reason}",notDeletableGroupWorldview:"is a worldview",notDeletableGroupWaiting:"is loading",notDeletableGroupHasUsers:"has users",noAvailableGroups:"No more available groups",confirm:"Confirm",confirmRemoveGroupMsg:"Are you sure you want permanently delete the group {group}?",confirmRemoveElementMsg:"Are you sure you want permanently delete the {element} {elementName}?",confirmRemoveTitle:"Delete",confirmRemoveProjectUrlMsg:"Are you sure you want permanently delete this project url?",confirmRemoveObservableMsg:"Are you sure you want permanently delete this observable?",confirmRemoveGroup:"Are you sure you want to ask to be removed from the group {group}?",cautionRemoveUser:"Deleting {element} is irreversible. Please proceed with caution.",requestSent:"Request sent",requestSentError:"Error sending request",noTasks:"There are no tasks in database",emailValidationError:"Invalid email format",usernameFormatLengthError:"Username must be more than 6 characters",usernameFormatValidationError:"Username must contains only letter, numbers and . (period) - (hyphen or dash) _ (underscore)",phoneValidationError:"Phone seems not valid",userPswInvalid:"Bad Username or password",pswInvalid:"Bad password",userAlreadyInUse:"Username or Email already in use!",emailAlreadyInUse:"Email already in use",emailNotModified:"Email must be different than the current one",noGroupsAssigned:"No groups assigned",failed:"Action failed",success:"Action was successful",loadingData:"Loading data",acceptEULA:"I have read and accept the END USER LICENSE AGREEMENT (EULA) for individual non-profit use",mustAcceptEULA:"You must read and accept the EULA to download certificate",changePasswordTitle:"Change password",loggingOut:"Logging out",sendUpdates:"Should we send you important updates and announcements?",profileUpdated:"Profile updated",errorUpdatingProfile:"Error updating profile",errorRegistering:"Error when registering, please try later",errorRegisteringMailExists:"A user with this email address already exists",registeringOk:"Registration is succesful.",resetPasswordOk:"An email has been sent to your mailbox",errorResetPasswordNotFound:"Error resetting password, check the inserted email",errorResetPassword:"Error resetting password, please contact support",errorRegisteringUsersExists:"Username already exists",errorLoadingAvailableGroups:"Error loading available groups",verifiedSuccess:"User verified successfully",verifiedFailure:"Error verifying user",verifiedFailureEmail:"Error verifying user. If you change the password, do you need to change the email again.",updated:"Updated!",unknownDate:"n.a.",errorDateFromTo:"The {type} date from must precede {type} date to",tasksLoaded:"Tasks loaded",tasksLoadedError:"Error loading tasks",taskAccepted:"Accepted",taskDenied:"Denied",taskAcceptedError:"Error accepting task",taskDeniedError:"Error denying task",taskDeniedMessage:"Denied message",usersGroupsAssign:"Group(s) assigned successfully",usersGroupsRemoved:"Group(s) removed successfully",usersGroupsAssignError:"Error assigning groups to users",usersGroupsRemoveError:"Error removing groups to users",usersGroupsAssignConfirm:"Do you want to assign {groupsNumber} groups to {usersNumber} users?",usersGroupsRemoveConfirm:"Do you want to remove {groupsNumber} groups to {usersNumber} users?",userNoSendUpdates:"Note that lines highlighted in yellow indicate that the user does not accept sending updates.",emailSent:"Mail sent",emailWithNoReceipts:"No valid receipts, check if users didn't give permissions",doingThings:"Working...",iconNotValid:"Icon URL is not valid",waitForRenewalAcceptance:"Group renewal already requested, pending acceptance",renewalIsNotNecessary:"Group does not require renewal",askForRenewal:"Renewal required to access group, please request",confirmRemoveMsg:"Are you sure you want to delete?",clickToCopy:"{to-copy}\n(click to copy)",textCopied:"Text copied to clipboard",userDeleted:"User {username} deleted succesfully",adviseNeedCertificateDownload:"As you've updated your email address, we advise you to consider the possibility of needing to download a new certificate to align with this change.",acceptAgreement:"To use kLab, you need to accept the agreement."},contents:{loginPage:"Log into your k.LAB account",registerPage:"Get started with k.LAB",registerPageInfo:"\n
    \n
  • Choose a user name that follows the firstname.lastname pattern using 6 or more characters
  • \n
  • Insert a valid email address to receive a confirmation link
  • \n
\n ",registerContent:'\n

ARIES is an open system where all participants contribute and share knowledge for the common good. For this reason we ask that all accounts are traceable to real people and institutions. Please ensure that:

\n
    \n
  • Your username follows the firstname.lastname pattern, with your real first and last name. All the accounts created from this page are individual. If you need an institutional account (for example to install a public engine) please contact us as this use, while still free for non-profit institutions, is covered by a separate EULA.
  • \n
  • Your email address is traceable to an institution where you work or study and whose non-profit status is verifiable.
  • \n
\n

We actively monitor the registration database and we regularly delete or disable accounts that do not match the above conditions. In addition, attempts to make for-profit use of ARIES products with a non-profit licensing terms will result in permanent exclusion from the registration system and potential legal prosecution according to the\n EULA.

\n

By clicking the acceptance button you agree that the personal data you provide will be processed by ASOCIACIÓN BC3 BASQUE CENTRE FOR CLIMATE CHANGE-KLIMA ALDAKETA IKERGAI with the purpose of\n managing your registration request and your access to the tool. You may exercise your rights on data protection at ARCrights@BC3research.org.\n
Additional information in this respect is available in the EULA

\n ',forgetPasswordText:"

Insert your email address

",forgetPasswordInfo:"We'll send you a message to help you reset your password",forgetPasswordContent:'Please Contact Us if you require any assistance.',homeTitle:"Welcome",homeContent1:"\n

This site is the central authentication hub for all users of the k.LAB semantic web. We support both remote and local use of k.LAB\n through web-based clients and a modeler IDE.

\n

To access the remote clients you can choose one of the web applications available to your user by clicking the corresponding icon below.

\n ",homeContent2:'\n

All applications will use the concepts, data and models available in the k.LAB semantic web.

\n

For a more direct way of using k.LAB, including contributing new knowledge and exploring the knowledge base more in detail,\n you can install a local engine and the Integrated development environment (k.Modeler).

\n

These are available as a software download, managed through a small application named the k.LAB Control Center.\n Please download the Control Center software package from here.

\n

To run the engine you will require a certificate, which you can download (for non-profit use only)\n from the Profile menu (use the link Download certificate on the left menu).

\n\n ',downloadTitle:"",downloadContent:"",certificateTitle:"Certificate",certificateContentBeforeEULA:'\n

By downloading the certificate, you are accepting the END USER LICENSE AGREEMENT (EULA) for individual non-profit use.

\n

Individual non-profit EULA characteristics:

\n
    \n
  • This EULA gives you access to the data and models served via our semantic web for non-profit purposes
  • \n
  • For other purposes please get in touch with us at integratedmodelling.org
  • \n
  • Access is granted via individual and non-transferable certificates, which are valid for 1 year
  • \n
  • User maintains the ownership of newly created data and models, but has the option to grant the right to operate them via our semantic web
  • \n
\n

In addition and outside the EULA, the USER may obtain an open source license of the k.Lab SOFTWARE under the terms of the\n Affero General Public License 3.0\n or any higher version through the website integratedmodelling.org, which will allow you to exploit the k.Lab SOFTWARE under the terms of that license.

\n ',certificateContentAfterEULA:'\n

Clarification: the EULA regulates the access and use of the k.LAB system hosted in the BC3 INFRASTRUCTURE, including the semantic web of data, models powered by the SOFTWARE, and other data and resources made available to the USER through the BC3 INFRASTRUCTURE.\n See the complete terms of use here.

\n ',adminHomeTitle:"Administration",adminHomeContent:"\n

This page enables the management of k.LAB.

\n

Select an option from the left menu.

\n ",adminUsersTitle:"Users",adminGroupsTitle:"Groups",adminTasksTitle:"Tasks",adminAgreementTemplatesTitle:"Agreement Templates",adminNodesTitle:"Nodes",placeholderAgreementText:"Add agreement template's text",statsHomeTitle:"Statistics",statsHomeContent:"\n

This page is for extracting useful statistics from the k.labs server.

\n

Start making queries from the left menu.

\n ",downloadCertificateChangeEmail:`As you've updated your email address, we advise you to consider the possibility of needing to download a new certificate to align with this change. This certificate will authenticate your device and is necessary to continue using the local engine.`},text:{changeEmail:"If you want to update the email address, please, set your actual password.",changeEmailUpdate:"Voila! You have successfully update the email address."}}}).call(this,s("4362"))},"9b2f":function(e,t,s){"use strict";s("29cb")},"9e5b":function(e,t,s){},"9e60":function(e,t,s){"use strict";s("3b09")},a6aa:function(e,t,s){},a90d:function(e,t,s){},b0a0:function(e,t,s){},b5be:function(e,t,s){},b96f:function(e,t,s){},baf1:function(e,t,s){"use strict";s("b0a0")},bb03:function(e,t,s){"use strict";s("c1d6")},bd3a:function(e,t,s){"use strict";s("a6aa")},c14d:function(e,t,s){e.exports=s.p+"img/marker-icon-success.eb603235.png"},c1d6:function(e,t,s){},cd23:function(e,t,s){"use strict";var a=function(){var e=this,t=e._self._c;return t("main",{staticClass:"kdc-container"},[e.menuItems.length>0?t("div",{staticClass:"kdc-menu-container fixed full-height"},[t("div",{staticClass:"kdc-menu"},e._l(e.menuItems,(function(s,a){return t("div",{key:a,staticClass:"kdc-menu-item"},[t("router-link",{staticClass:"kh-link",attrs:{to:{name:s.route},"active-class":"disabled",custom:""}},[e._v(e._s(s.label))])],1)})),0)]):e._e(),t("div",{staticClass:"kdc-content",class:[0===e.menuItems.length&&"kdc-no-menu"]},[e._t("default")],2)])},o=[],r={name:"KhubDefaultContainer",props:{menuItems:{type:Array,default:()=>[]}},data(){return{}},methods:{}},i=r,l=(s("4dcc"),s("2877")),n=Object(l["a"])(i,a,o,!1,null,null,null);t["a"]=n.exports},d782:function(e,t,s){"use strict";s("9e5b")},d856:function(e,t,s){},e9fb:function(e,t,s){},f439:function(e,t,s){},f594:function(e,t,s){"use strict";s("58e0")}}); \ No newline at end of file