{"version":3,"file":"UserButtonContent-DLMTtWki.mjs","names":[],"sources":["../src/components/misc/UserButtonContent.vue","../src/components/misc/UserButtonContent.vue"],"sourcesContent":["<template>\n  <nav :aria-label=\"navLabel\">\n    <ul class=\"p-0 m-0\">\n      <template v-if=\"specificRoutes.length\">\n        <li v-for=\"routerBack in specificRoutes\" :key=\"routerBack.path\" class=\"li-style-none\">\n          <router-link\n            v-if=\"!state.generalParameters.podcastmaker && routerBack.condition\"\n            :class=\"routerBack.class\"\n            :to=\"routerBack.path\"\n          >\n            {{ routerBack.title }}\n          </router-link>\n        </li>\n        <hr v-if=\"displayUserContent\"/>\n      </template>\n      <template v-if=\"displayUserContent\">\n        <template v-if=\"!isAuthenticated\">\n          <li class=\"li-style-none\">\n            <a class=\"octopus-dropdown-item realLink\" :href=\"pathLogin\">\n              {{ t(\"Login\") }}\n            </a>\n          </li>\n          <li class=\"li-style-none\">\n            <router-link\n              v-if=\"!state.generalParameters.podcastmaker\"\n              class=\"octopus-dropdown-item\"\n              to=\"/main/pub/create\"\n            >\n              {{ t(\"Create an account\") }}\n            </router-link>\n          </li>\n        </template>\n        <template v-else>\n          <li v-for=\"routeBackoffice in routerBackoffice\" :key=\"routeBackoffice.path\" class=\"li-style-none\">\n            <router-link\n              v-if=\"!state.generalParameters.podcastmaker && routeBackoffice.condition\"\n              :class=\"routeBackoffice.class\"\n              :to=\"routeBackoffice.path\"\n            >\n              {{ routeBackoffice.title }}\n            </router-link>\n          </li>\n          <hr />\n          <template v-if=\"helpLinks.length\">\n            <li v-for=\"helpLink in helpLinks\" :key=\"helpLink.title\" class=\"li-style-none\">\n              <a\n                :href=\"helpLink.href\"\n                class=\"octopus-dropdown-item realLink\"\n                rel=\"noreferrer noopener\"\n                target=\"_blank\"\n                :title=\"t('New window', {text: helpLink.title})\"\n              >\n                {{ helpLink.title }}\n                <OpenInNewIcon class=\"ms-1\" :size=\"15\"/>\n              </a>\n            </li>\n            <hr />\n          </template>\n          <li class=\"li-style-none\">\n            <a class=\"octopus-dropdown-item c-hand\" href=\"/logout\">\n              {{ t(\"Logout\") }}\n            </a>\n          </li>\n        </template>\n        <li class=\"li-style-none\">\n          <router-link\n            v-if=\"!authStore.isGarRole\"\n            class=\"octopus-dropdown-item\"\n            to=\"/main/pub/contact\"\n          >\n            {{ t(\"Contact\") }}\n          </router-link>\n        </li>\n      </template>\n    </ul>\n  </nav>\n</template>\n\n<script setup lang=\"ts\">\nimport OpenInNewIcon from \"vue-material-design-icons/OpenInNew.vue\";\nimport { state } from \"../../stores/ParamSdkStore\";\nimport { useAuthStore } from \"../../stores/AuthStore\";\nimport { computed } from \"vue\";\nimport { useApiStore } from \"../../stores/ApiStore\";\nimport { useI18n } from \"vue-i18n\";\nimport { RouteLocationAsPathGeneric, RouteLocationAsRelativeGeneric, useRoute } from \"vue-router\";\n\n//Interface\ninterface RouteInfo{\n  title: string;\n  class: string;\n  path: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric;\n  condition: boolean\n}\n\n//Props \nconst props = defineProps({\n  isEducation: { default: false, type: Boolean },\n  navLabel: { default: \"\", type: String },\n  specificRoutes: { default: ()=>[], type: Array as ()=> Array<RouteInfo> },\n  displayUserContent: { default: true, type: Boolean },\n})\n\n//Composables\nconst { t } = useI18n();\nconst authStore = useAuthStore();\nconst apiStore = useApiStore();\nconst route = useRoute();\n\n//Computed\nconst isAuthenticated = computed(() => undefined !== authStore.authProfile?.userId);\nconst pathLogin = computed(() => \"/sso/login?redirect_url=\"+encodeURI(apiStore.frontendUrl + route.fullPath));\nconst isAuthenticatedWithOrga = computed(() => undefined !== authStore.authOrgaId);\nconst organisationsAvailable = computed(() =>  authStore.authProfile?.organisations ?? []);\n\nconst helpLinks = computed(() => {\n  if (authStore.isGarRole || props.isEducation) {\n    return [];\n  }\n  return [\n    { title:t(\"Help\"), href: \"https://help.octopus.saooti.com/Aide/\"},\n    { title: t(\"TutoMag\"), href: \"https://help.octopus.saooti.com/\" },\n  ];\n});\nconst routerBackoffice = computed(() => {\n  if(!isAuthenticated.value){\n    return [];\n  }\n  return [\n    {\n      title: t(\"My space\"),\n      class: \"octopus-dropdown-item show-small-screen\",\n      path: \"/main/priv/backoffice\",\n      condition: isAuthenticatedWithOrga.value,\n    },\n    {\n      title: t(\"Upload\"),\n      class: \"octopus-dropdown-item show-small-screen\",\n      path: \"/main/priv/upload\",\n      condition: isAuthenticatedWithOrga.value && authStore.isRoleContribution,\n    },\n    {\n      title: t(\"Edit my profile\"),\n      class: \"octopus-dropdown-item\",\n      path: \"/main/priv/edit/profile\",\n      condition: true,\n    },\n    {\n      title: t(\"Edit my organisation\"),\n      class: \"octopus-dropdown-item\",\n      path: \"/main/priv/edit/organisation\",\n      condition:\n      isAuthenticatedWithOrga.value &&\n        (authStore.isRoleOrganisation || 1 < organisationsAvailable.value.length),\n    },\n  ];\n});\n\n</script>\n","<template>\n  <nav :aria-label=\"navLabel\">\n    <ul class=\"p-0 m-0\">\n      <template v-if=\"specificRoutes.length\">\n        <li v-for=\"routerBack in specificRoutes\" :key=\"routerBack.path\" class=\"li-style-none\">\n          <router-link\n            v-if=\"!state.generalParameters.podcastmaker && routerBack.condition\"\n            :class=\"routerBack.class\"\n            :to=\"routerBack.path\"\n          >\n            {{ routerBack.title }}\n          </router-link>\n        </li>\n        <hr v-if=\"displayUserContent\"/>\n      </template>\n      <template v-if=\"displayUserContent\">\n        <template v-if=\"!isAuthenticated\">\n          <li class=\"li-style-none\">\n            <a class=\"octopus-dropdown-item realLink\" :href=\"pathLogin\">\n              {{ t(\"Login\") }}\n            </a>\n          </li>\n          <li class=\"li-style-none\">\n            <router-link\n              v-if=\"!state.generalParameters.podcastmaker\"\n              class=\"octopus-dropdown-item\"\n              to=\"/main/pub/create\"\n            >\n              {{ t(\"Create an account\") }}\n            </router-link>\n          </li>\n        </template>\n        <template v-else>\n          <li v-for=\"routeBackoffice in routerBackoffice\" :key=\"routeBackoffice.path\" class=\"li-style-none\">\n            <router-link\n              v-if=\"!state.generalParameters.podcastmaker && routeBackoffice.condition\"\n              :class=\"routeBackoffice.class\"\n              :to=\"routeBackoffice.path\"\n            >\n              {{ routeBackoffice.title }}\n            </router-link>\n          </li>\n          <hr />\n          <template v-if=\"helpLinks.length\">\n            <li v-for=\"helpLink in helpLinks\" :key=\"helpLink.title\" class=\"li-style-none\">\n              <a\n                :href=\"helpLink.href\"\n                class=\"octopus-dropdown-item realLink\"\n                rel=\"noreferrer noopener\"\n                target=\"_blank\"\n                :title=\"t('New window', {text: helpLink.title})\"\n              >\n                {{ helpLink.title }}\n                <OpenInNewIcon class=\"ms-1\" :size=\"15\"/>\n              </a>\n            </li>\n            <hr />\n          </template>\n          <li class=\"li-style-none\">\n            <a class=\"octopus-dropdown-item c-hand\" href=\"/logout\">\n              {{ t(\"Logout\") }}\n            </a>\n          </li>\n        </template>\n        <li class=\"li-style-none\">\n          <router-link\n            v-if=\"!authStore.isGarRole\"\n            class=\"octopus-dropdown-item\"\n            to=\"/main/pub/contact\"\n          >\n            {{ t(\"Contact\") }}\n          </router-link>\n        </li>\n      </template>\n    </ul>\n  </nav>\n</template>\n\n<script setup lang=\"ts\">\nimport OpenInNewIcon from \"vue-material-design-icons/OpenInNew.vue\";\nimport { state } from \"../../stores/ParamSdkStore\";\nimport { useAuthStore } from \"../../stores/AuthStore\";\nimport { computed } from \"vue\";\nimport { useApiStore } from \"../../stores/ApiStore\";\nimport { useI18n } from \"vue-i18n\";\nimport { RouteLocationAsPathGeneric, RouteLocationAsRelativeGeneric, useRoute } from \"vue-router\";\n\n//Interface\ninterface RouteInfo{\n  title: string;\n  class: string;\n  path: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric;\n  condition: boolean\n}\n\n//Props \nconst props = defineProps({\n  isEducation: { default: false, type: Boolean },\n  navLabel: { default: \"\", type: String },\n  specificRoutes: { default: ()=>[], type: Array as ()=> Array<RouteInfo> },\n  displayUserContent: { default: true, type: Boolean },\n})\n\n//Composables\nconst { t } = useI18n();\nconst authStore = useAuthStore();\nconst apiStore = useApiStore();\nconst route = useRoute();\n\n//Computed\nconst isAuthenticated = computed(() => undefined !== authStore.authProfile?.userId);\nconst pathLogin = computed(() => \"/sso/login?redirect_url=\"+encodeURI(apiStore.frontendUrl + route.fullPath));\nconst isAuthenticatedWithOrga = computed(() => undefined !== authStore.authOrgaId);\nconst organisationsAvailable = computed(() =>  authStore.authProfile?.organisations ?? []);\n\nconst helpLinks = computed(() => {\n  if (authStore.isGarRole || props.isEducation) {\n    return [];\n  }\n  return [\n    { title:t(\"Help\"), href: \"https://help.octopus.saooti.com/Aide/\"},\n    { title: t(\"TutoMag\"), href: \"https://help.octopus.saooti.com/\" },\n  ];\n});\nconst routerBackoffice = computed(() => {\n  if(!isAuthenticated.value){\n    return [];\n  }\n  return [\n    {\n      title: t(\"My space\"),\n      class: \"octopus-dropdown-item show-small-screen\",\n      path: \"/main/priv/backoffice\",\n      condition: isAuthenticatedWithOrga.value,\n    },\n    {\n      title: t(\"Upload\"),\n      class: \"octopus-dropdown-item show-small-screen\",\n      path: \"/main/priv/upload\",\n      condition: isAuthenticatedWithOrga.value && authStore.isRoleContribution,\n    },\n    {\n      title: t(\"Edit my profile\"),\n      class: \"octopus-dropdown-item\",\n      path: \"/main/priv/edit/profile\",\n      condition: true,\n    },\n    {\n      title: t(\"Edit my organisation\"),\n      class: \"octopus-dropdown-item\",\n      path: \"/main/priv/edit/organisation\",\n      condition:\n      isAuthenticatedWithOrga.value &&\n        (authStore.isRoleOrganisation || 1 < organisationsAvailable.value.length),\n    },\n  ];\n});\n\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgGA,MAAM,QAAQ;EAQd,MAAM,EAAE,MAAM,QAAQ;EACtB,MAAM,YAAY,aAAa;EAC/B,MAAM,WAAW,YAAY;EAC7B,MAAM,QAAQ,SAAS;EAGvB,MAAM,kBAAkB,eAAe,KAAA,MAAc,UAAU,aAAa,MAAM;EAClF,MAAM,YAAY,eAAe,6BAA2B,UAAU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