{"version":3,"file":"Detail.e017a94e.js","sources":["../../src/components/catalog/DetailTable.vue","../../src/views/Detail.vue"],"sourcesContent":["<template>\n  <div>\n    <div\n      v-if=\"\n        getConcernedLegislativeEntry() &&\n        getConcernedLegislativeEntry().startDate\n      \"\n      class=\"items-center flex pb-6\"\n    >\n      <h3 v-if=\"!getConcernedLegislativeEntry().endDate\" class=\"container\">\n        {{ $t(\"detailView\") }}\n        {{ getConcernedLegislativeEntry().identifier }}\n        {{ $t(\"fromDate\") }}\n        {{ formatDateToDDMMYYYY(getConcernedLegislativeEntry().startDate) }}\n      </h3>\n      <h3 v-else class=\"container\">\n        {{ $t(\"detailView\") }}\n        {{ getConcernedLegislativeEntry().identifier }}\n        {{ $t(\"fromDateExpired\") }}\n        {{ formatDateToDDMMYYYY(getConcernedLegislativeEntry().startDate) }}\n        {{ $t(\"toDate\") }}\n        {{ formatDateToDDMMYYYY(getConcernedLegislativeEntry().endDate) }}\n      </h3>\n    </div>\n    <el-table\n      ref=\"tableData\"\n      :key=\"'table' + language\"\n      :empty-text=\"$t('empty')\"\n      :data=\"computedTableData\"\n      row-key=\"id\"\n      :row-class-name=\"rowClass\"\n      class=\"is-clickable is-orange\"\n      @row-click=\"handleExpandClick\"\n      @expand-change=\"handleExpand\"\n    >\n      <template #empty>\n        <svg-loader v-if=\"loading\" />\n      </template>\n\n      <!-- edit col -->\n      <el-table-column type=\"expand\" width=\"45\">\n        <template #default=\"props\">\n          <div v-if=\"isExpanded(props.row.id)\">\n            <transition name=\"reveal\">\n              <catalog-legal-entry-edit\n                v-if=\"props.row.isEditing\"\n                :base-row=\"props.row\"\n                class=\"form-edit-offset\"\n                @leave-editmode=\"leaveEditMode(props.row)\"\n                @published=\"handlePublish(props.row)\"\n                @saved=\"handleSave(props.row)\"\n              />\n            </transition>\n            <div>\n              <div v-if=\"!props.row.isEditing\" class=\"catalog-grid offset-l\">\n                <div>\n                  <div class=\"mt-0 seperator-x\">\n                    <catalog-attribute :title=\"$t('legalBasis')\">\n                      <dl v-if=\"props.row.legalBases.length\">\n                        <div\n                          v-for=\"(item, i) in props.row.legalBases\"\n                          :key=\"i + props.row.id\"\n                          class=\"flex flex-col mt-2 md:flex-row\"\n                        >\n                          <dt class=\"md:w-32 legalBaseLink\">\n                            <a :href=\"item.url\" :title=\"item.name\">{{\n                              item.code\n                            }}</a>\n                          </dt>\n                          <dd>\n                            {{\n                              item[\"example\" + languageUppercase] ||\n                              item.example\n                            }}\n                          </dd>\n                        </div>\n                      </dl>\n                      <p v-else class=\"text-gray-750\">{{ $t(\"empty\") }}</p>\n                    </catalog-attribute>\n                  </div>\n                </div>\n\n                <div>\n                  <catalog-attribute\n                    :title=\"$t('access')\"\n                    class=\"mt-0 seperator-x\"\n                  >\n                    {{ props.row.access === \"public\" ? $t(\"accessLabel.public\") : \"\" }}\n                    {{\n                      props.row.access === \"public_restricted\"\n                        ? $t(\"accessLabel.public_restricted\")\n                        : \"\"\n                    }}\n                    {{\n                      props.row.access === \"private\" ? $t(\"accessLabel.private\") : \"\"\n                    }}\n                  </catalog-attribute>\n\n                  <catalog-attribute\n                    :title=\"$t('downloadService')\"\n                    class=\"mt-4\"\n                    >{{\n                      props.row.downloadService ? $t(\"yes\") : $t(\"no\")\n                    }}</catalog-attribute\n                  >\n                </div>\n\n                <div>\n                  <catalog-attribute\n                    :title=\"$t('oereb')\"\n                    class=\"mt-0 seperator-x\"\n                    >{{\n                      props.row.oereb ? $t(\"yes\") : $t(\"no\")\n                    }}</catalog-attribute\n                  >\n                  <catalog-attribute :title=\"$t('geoReference')\" class=\"mt-4\">{{\n                    props.row.geoReference ? $t(\"yes\") : $t(\"no\")\n                  }}</catalog-attribute>\n                </div>\n\n                <div class>\n                  <catalog-attribute\n                    :title=\"$t('pubDate')\"\n                    class=\"mt-0 mr-6 seperator-x\"\n                  >\n                    <div v-if=\"props.row.startDate\" class=\"flex\">\n                      <SvgIcon name=\"calendar\"></SvgIcon>\n                      <span class=\"inline-block ml-2\">{{\n                        formatDateToDDMMYYYY(props.row.startDate)\n                      }}</span>\n                    </div>\n                    <span v-else>&mdash;</span>\n                  </catalog-attribute>\n                  <catalog-attribute\n                    v-if=\"props.row.isHistorised\"\n                    :title=\"$t('endDate')\"\n                    class=\"mt-0\"\n                  >\n                    <div v-if=\"props.row.endDate\" class=\"flex\">\n                      <SvgIcon name=\"calendar\"></SvgIcon>\n                      <span class=\"inline-block ml-2\">{{\n                        formatDateToDDMMYYYY(props.row.endDate)\n                      }}</span>\n                    </div>\n                    <span v-else>&mdash;</span>\n                  </catalog-attribute>\n                </div>\n\n                <div></div>\n                <div\n                  v-for=\"(field, customFieldIndex) in props.row.customFields\"\n                  :key=\"'customField' + customFieldIndex\"\n                >\n                  <div class=\"mt-0 seperator-x\">\n                    <catalog-attribute :title=\"field.label\" class=\"mt-0\">\n                      <div v-if=\"field.type === 'date'\" class=\"flex\">\n                        <span class=\"inline-block\">{{\n                          formatDateToDDMMYYYY(field.values.value)\n                        }}</span>\n                      </div>\n                      <div v-else-if=\"field.type !== 'bool'\" class=\"flex\">\n                        <span class=\"inline-block\">{{\n                          field.values[\"value\" + languageUppercase] ||\n                          field.values.value\n                        }}</span>\n                      </div>\n                      <div v-else class=\"flex\">\n                        <span\n                          v-if=\"field.values.value === 'False'\"\n                          class=\"inline-block\"\n                          >{{ $t(\"no\") }}</span\n                        >\n                        <span\n                          v-else-if=\"field.values.value === 'True'\"\n                          class=\"inline-block\"\n                          >{{ $t(\"yes\") }}</span\n                        >\n                        <span v-else class=\"inline-block\">-</span>\n                      </div>\n                    </catalog-attribute>\n                  </div>\n                </div>\n              </div>\n\n              <div v-if=\"!props.row.isEditing\" class=\"pr-8 mt-2 offset-l\">\n                <div class=\"flex justify-end py-3 border-t\">\n                  <div class=\"pr-8\">\n                    <el-button\n                      v-if=\"\n                        editModeIsEnabled(props.row) &&\n                        (props.row.differsFromParent ||\n                          props.row.softDiffersFromParent)\n                      \"\n                      size=\"small\"\n                      :class=\"getDiffersFromParentButtonClasses(props.row)\"\n                      @click.prevent.stop=\"\n                        actionRetrievePublishedParentToCompare(props.row)\n                      \"\n                    >\n                      <span class=\"flex items-center\">\n                        <SvgIcon name=\"wand-magic-sparkles\" class=\"mr-2\" />\n                        <span>{{ $t(\"fixFromParent\") }}</span>\n                      </span>\n                    </el-button>\n                  </div>\n                  <div class=\"pr-8\">\n                    <el-dropdown\n                      v-if=\"editModeIsEnabled(props.row)\"\n                      split-button\n                      size=\"small\"\n                      trigger=\"click\"\n                      class=\"align-middle\"\n                      @command=\"handleEditClick\"\n                      @click=\"\n                        handleEditClick({ lang: language, row: props.row })\n                      \"\n                    >\n                      <span class=\"flex items-center\">\n                        <SvgIcon name=\"edit\" class=\"mr-2 w-auto h-auto\" />\n                        <span>{{ $t(\"edit\") }}</span>\n                      </span>\n                      <template #dropdown>\n                        <el-dropdown-menu>\n                          <el-dropdown-item\n                            :command=\"{ lang: 'de', row: props.row }\"\n                            >{{ $t(\"editGerman\") }}</el-dropdown-item\n                          >\n                          <el-dropdown-item\n                            :command=\"{ lang: 'fr', row: props.row }\"\n                            >{{ $t(\"editFrench\") }}</el-dropdown-item\n                          >\n                          <el-dropdown-item\n                            :command=\"{ lang: 'it', row: props.row }\"\n                            >{{ $t(\"editItalian\") }}</el-dropdown-item\n                          >\n                        </el-dropdown-menu>\n                      </template>\n                    </el-dropdown>\n                  </div>\n                </div>\n              </div>\n\n              <!--\n            TECHNICAL ENTRIES\n          -->\n              <div class=\"py-2 bg-gray-300\" v-if=\"isLoggedIn || props.row.technicalEntries.length > 0\">\n                <div class=\"pr-8 offset-l\">\n                  <div class=\"flex items-center justify-between pr-8 ml-2\">\n                    <h2 class=\"text-base font-medium text-black\">\n                      {{ $t(\"technicalRecords\") }}\n                      <el-tag\n                        v-if=\"\n                          hasWritePermission(props.row) &&\n                          props.row.decoupledFromParent\n                        \"\n                        size=\"small\"\n                        class=\"decoupled-from-parent mr-2\"\n                        :disable-transitions=\"true\"\n                        >{{ $t(getCorpParentLevelDisplay()) }}&nbsp;{{\n                          $t(\"decoupledFromParent\")\n                        }}\n                      </el-tag>\n                    </h2>\n                    <el-button\n                      v-if=\"checkIsToday() && editModeIsEnabled(props.row)\"\n                      size=\"small\"\n                      class=\"my-3 ml-2 has-icon\"\n                      @click.prevent.stop=\"createTechnicalEntry(props.row)\"\n                    >\n                      <SvgIcon name=\"add-circle\" />\n                      {{ $t(\"addTechnicalRecord\") }}\n                    </el-button>\n                  </div>\n                </div>\n\n                <el-collapse\n                  v-if=\"props.row.technicalEntries\"\n                  v-model=\"collapseTechnical\"\n                  class=\"border-0\"\n                >\n                  <el-collapse-item\n                    v-for=\"(child, i) in props.row.technicalEntries\"\n                    :key=\"props.row + child.id\"\n                    :name=\"i\"\n                    class=\"pl-2 mr-8 offset-l\"\n                  >\n                    <template #title>\n                      <div class=\"w-full catalog-grid catalog-grid--collapse\">\n                        <div class=\"flex items-center\">\n                          <span class=\"px-2 whitespace-no-wrap\">\n                            <span>{{ child.partialLabel }}</span>\n                            <span class=\"text-orange-400\">{{\n                              child.labelDelegationAndNumber\n                            }}</span>\n                          </span>\n                          <el-tag\n                            v-if=\"\n                              child.status !== 'Published' && !child.hideLabel\n                            \"\n                            :type=\"getTagType(child.status)\"\n                            :class=\"child.status\"\n                            size=\"small\"\n                            :disable-transitions=\"true\"\n                            >{{ $t(child.status) }}\n                          </el-tag>\n                          <div\n                            class=\"flex items-center justify-between w-full px-2\"\n                          >\n                            <div class=\"mr-8\">\n                              <span>{{\n                                child[\"description\" + languageUppercase] ||\n                                child.description\n                              }}</span>\n                            </div>\n                          </div>\n                        </div>\n                        <div\n                          class=\"flex items-center justify-center w-full py-1\"\n                        >\n                          <el-popover\n                            v-if=\"child.contactPerson && !child.isHistorised\"\n                            placement=\"left\"\n                            class=\"flex justify-end mx-2\"\n                          >\n                            <ul class=\"leading-relaxed\">\n                              <li>\n                                {{ child.contactPerson.firstName }}\n                                {{ child.contactPerson.lastName }}\n                              </li>\n                              <li>\n                                <a\n                                  :href=\"`mailto:${child.contactPerson.email}`\"\n                                  >{{ child.contactPerson.email }}</a\n                                >\n                              </li>\n                              <li>\n                                <a :href=\"`tel:${child.contactPerson.phone}`\">{{\n                                  child.contactPerson.phone\n                                }}</a>\n                              </li>\n                              <li>{{ child.contactPerson.authority || \"\" }}</li>\n                            </ul>\n                            <template #reference>\n                              <button @click.prevent=\"stopPropagation()\">\n                                <SvgIcon name=\"assignment-ind\" />\n                              </button>\n                            </template>\n                          </el-popover>\n                        </div>\n                      </div>\n                    </template>\n\n                    <transition name=\"reveal\">\n                      <catalog-technical-entry-edit\n                        v-if=\"editingTechRows.indexOf(child.id) !== -1\"\n                        :item=\"child\"\n                        :base-row=\"child\"\n                        :parent-row=\"props.row\"\n                        :position=\"i\"\n                        @cancel-editing=\"cancelTechEdit(child)\"\n                      />\n                    </transition>\n\n                    <catalog-technical-entry\n                      v-if=\"editingTechRows.indexOf(child.id)\"\n                      :item=\"child\"\n                    >\n                      <div class=\"flex justify-end mr-8\">\n                        <el-dropdown\n                          v-if=\"\n                            editModeIsEnabled(props.row) &&\n                            techEditModeIsEnabled(\n                              props.row.technicalEntries,\n                              child\n                            ) &&\n                            !child.isHistorised\n                          \"\n                          split-button\n                          size=\"small\"\n                          trigger=\"click\"\n                          @command=\"handleTechEditClick\"\n                          @click.prevent.stop=\"\n                            handleTechEditClick({ lang: language, row: child })\n                          \"\n                        >\n                          <span class=\"flex items-center\">\n                            <SvgIcon name=\"edit\" class=\"mr-2 w-auto h-auto\" />\n                            <span>{{ $t(\"edit\") }}</span>\n                          </span>\n                          <template #dropdown>\n                            <el-dropdown-menu>\n                              <el-dropdown-item\n                                :command=\"{ lang: 'de', row: child }\"\n                                >{{ $t(\"editGerman\") }}\n                              </el-dropdown-item>\n                              <el-dropdown-item\n                                :command=\"{ lang: 'fr', row: child }\"\n                                >{{ $t(\"editFrench\") }}\n                              </el-dropdown-item>\n                              <el-dropdown-item\n                                :command=\"{ lang: 'it', row: child }\"\n                                >{{ $t(\"editItalian\") }}\n                              </el-dropdown-item>\n                            </el-dropdown-menu>\n                          </template>\n                        </el-dropdown>\n                      </div>\n                    </catalog-technical-entry>\n                  </el-collapse-item>\n                </el-collapse>\n              </div>\n            </div>\n          </div>\n        </template>\n      </el-table-column>\n\n      <!-- ID col -->\n      <el-table-column width=\"100\">\n        <template #header>\n          <span class=\"flex items-center w-full\">{{ $t(\"id\") }}</span>\n        </template>\n        <template #default=\"scope\">\n          <span class=\"inline-block mr-2\">\n            <span>{{ removeCH(scope.row.partialIdentifier) }}</span>\n            <span class=\"text-orange-400\">{{\n              scope.row.identifierDelegation\n            }}</span>\n          </span>\n        </template>\n      </el-table-column>\n\n      <!-- Bezeichnung col -->\n      <el-table-column min-width=\"220\">\n        <template #header>\n          <span class=\"flex items-center w-full\">{{ $t(\"title\") }}</span>\n        </template>\n        <template #default=\"scope\">\n          <span class=\"inline-block mr-2\">{{\n            scope.row[\"title\" + languageUppercase] || scope.row.title\n          }}</span>\n          <el-tag\n            v-if=\"scope.row.isParent\"\n            size=\"small\"\n            class=\"parent mr-2\"\n            :disable-transitions=\"true\"\n            >{{ $t(scope.row.legislativeCorp.level) }}\n          </el-tag>\n          <el-tag\n            v-if=\"scope.row.status !== 'Published' && !scope.row.hideLabel\"\n            size=\"small\"\n            class=\"mr-2\"\n            :type=\"getTagType(scope.row.status)\"\n            :disable-transitions=\"true\"\n            >{{ $t(scope.row.status) }}\n          </el-tag>\n          <el-tag\n            v-if=\"scope.row.isGrandParent\"\n            size=\"small\"\n            class=\"mr-2\"\n            :disable-transitions=\"true\"\n            >{{ $t(\"grandparent\") }}\n          </el-tag>\n          <el-tag\n            v-if=\"hasWritePermission(scope.row) && scope.row.differsFromParent\"\n            size=\"small\"\n            class=\"differs mr-2\"\n            :disable-transitions=\"true\"\n            >{{ $t(\"differsFromParent\") }}\n          </el-tag>\n        </template>\n      </el-table-column>\n\n      <!-- Fachstelle col -->\n      <el-table-column width=\"220\">\n        <template #header>\n          <span\n            class=\"flex items-center w-full\"\n            :title=\"$t('unitDescription')\"\n            >{{ $t(\"unit\") }}</span\n          >\n        </template>\n        <template #default=\"scope\">\n          {{ buildLegislativeCorp(scope.row.legislativeCorp) }} /\n          <a\n            v-for=\"(item, i) in scope.row.legislativeAuthorities\"\n            :key=\"'legislativeurl' + i\"\n            :href=\"item['url' + languageUppercase] || item.url\"\n            target=\"_blank\"\n            class=\"mr-2\"\n          >\n            {{ item[\"name\" + languageUppercase] || item.name }}\n            {{ item[\"abbr\" + languageUppercase] || item.abbr }}\n            <span\n              v-if=\"\n                scope.row.legislativeAuthorities.length > 1 &&\n                scope.row.legislativeAuthorities.length != i + 1\n              \"\n              >,\n            </span>\n          </a>\n          <span v-if=\"!scope.row.legislativeAuthorities.length\">\n            <!-- instead of showing the minus we show the rexecutive authorities, if they dont exist we show the minus  -->\n            <a\n              v-for=\"(item, i) in scope.row.executiveAuthorities\"\n              :key=\"'executiveurl' + i\"\n              :href=\"item['url' + languageUppercase] || item.url\"\n              target=\"_blank\"\n              class=\"mr-2\"\n            >\n              {{ item[\"name\" + languageUppercase] || item.name }}\n              {{ item[\"abbr\" + languageUppercase] || item.abbr }}\n              <span\n                v-if=\"\n                  scope.row.executiveAuthorities.length > 1 &&\n                  scope.row.executiveAuthorities.length != i + 1\n                \"\n                >,\n              </span>\n            </a>\n            <span v-if=\"!scope.row.executiveAuthorities.length\">—</span>\n            <!--  -->\n          </span>\n        </template>\n      </el-table-column>\n\n      <!-- Delegation col -->\n      <el-table-column width=\"220\">\n        <template #header>\n          <span\n            class=\"flex items-center w-full\"\n            :title=\"$t('delegationDescription')\"\n            >{{ $t(\"delegation\") }}</span\n          >\n        </template>\n        <template #default=\"scope\">\n          <span\n            :title=\"\n              scope.row.delegation === 'none' ? $t('delegationEmpty') : ''\n            \"\n            >{{ translateDelegation(scope.row.delegation) }}</span\n          >\n        </template>\n      </el-table-column>\n\n      <!-- Zuständige stelle col -->\n      <el-table-column width=\"220\">\n        <template #header>\n          <span\n            class=\"flex items-center w-full\"\n            :title=\"$t('responsibilityDescription')\"\n          >\n            {{ $t(\"responsibility\") }}\n          </span>\n        </template>\n        <template #default=\"scope\">\n          <a\n            v-for=\"(item, i) in scope.row.executiveAuthorities\"\n            :key=\"'executiveurl' + i\"\n            :href=\"item['url' + languageUppercase] || item.url\"\n            target=\"_blank\"\n            class=\"mr-2\"\n          >\n            {{ item[\"name\" + languageUppercase] || item.name }}\n            {{ item[\"abbr\" + languageUppercase] || item.abbr }}\n            <span\n              v-if=\"\n                scope.row.executiveAuthorities.length > 1 &&\n                scope.row.executiveAuthorities.length != i + 1\n              \"\n              >,\n            </span>\n          </a>\n          <span v-if=\"!scope.row.executiveAuthorities.length\">—</span>\n        </template>\n      </el-table-column>\n    </el-table>\n  </div>\n</template>\n\n<script setup>\nimport { ref, computed, onMounted, watch, nextTick } from \"vue\";\nimport SvgLoader from \"@/components/SvgLoader.vue\";\nimport CatalogAttribute from \"@/components/catalog/CatalogAttribute.vue\";\nimport CatalogTechnicalEntry from \"@/components/catalog/CatalogTechnicalEntry.vue\";\nimport CatalogTechnicalEntryEdit from \"@/components/catalog/CatalogTechnicalEntryEdit.vue\";\nimport CatalogLegalEntryEdit from \"@/components/catalog/CatalogLegalEntryEdit.vue\";\n\nimport { getLegislativeDetail } from \"@/services/legislative-entry\";\nimport { isToday } from \"date-fns\";\nimport { formatDateToDDMMYYYY } from \"@/composables/customFormatDate.js\";\n\nimport { useRoute } from \"vue-router\";\nimport { useI18n } from \"vue-i18n\";\n\nimport { useUserStore } from \"@/store/User\";\nimport { useFiltersFacade, useCorpFilter } from \"@/store/Filters\";\nimport { useLegislativeCatalogStore } from \"@/store/LegislativeCatalog\";\nimport { useCorpStore } from \"@/store/Corp\";\nimport { useLoadingStore } from \"@/store/Loading\";\nimport { useLanguageStore } from \"@/store/Language\";\nimport { useDateFilter } from \"@/store/Filters\";\n\nconst userStore = useUserStore();\nconst filtersFacadeStore = useFiltersFacade();\nconst legislativeCatalogStore = useLegislativeCatalogStore();\nconst corpStore = useCorpStore();\nconst loadingStore = useLoadingStore();\nconst corpFilterStore = useCorpFilter();\nconst languageStore = useLanguageStore();\nconst dateFilterStore = useDateFilter();\nconst route = useRoute();\nconst { t } = useI18n();\n\nconst expanded = ref([]);\nconst collapseTechnical = ref([]);\nconst editingTechRows = ref([]);\nconst tableData = ref(null);\n\nconst isLoggedIn = computed(() => {\n  return userStore.isLoggedIn;\n});\n\nconst unpackedListWithParents = computed(() => {\n  return legislativeCatalogStore.unpackedListWithParents;\n});\n\nconst loading = computed(() => loadingStore.loading);\n\nconst legislativeList = computed(() => {\n  return legislativeCatalogStore.legislativeList;\n});\n\nconst mustExpand = computed(() => {\n  return legislativeCatalogStore.mustExpand;\n});\n\nconst mustCollapse = computed(() => {\n  return legislativeCatalogStore.mustCollapse;\n});\n\nconst userCorp = computed(() => {\n  return userStore.corp;\n});\n\nconst crudCorpsIds = computed(() => {\n  return userStore.crudCorpsIds;\n});\n\nconst language = computed(() => {\n  return languageStore.language;\n});\n\nconst corps = computed(() => {\n  return corpStore.corps;\n});\n\nconst mappedUserCorp = computed(() => {\n  if (!corps.value) {\n    return;\n  }\n  const matchedUserCorp = corps.value.filter(\n    (corp) => userCorp.value.toString() === corp.id.toString()\n  );\n  return matchedUserCorp[0].id;\n});\n\nconst languageUppercase = computed(() => {\n  return language.value.charAt(0).toUpperCase() + language.value.slice(1);\n});\n\nconst computedTableData = computed(() => {\n  if (route.query.corp_bfs && !route.query.identifier) {\n    return [];\n  }\n  return unpackedListWithParents.value;\n});\n\n// Methods\nconst getTagType = (status) => {\n  if (status === \"Draft\") {\n    return \"warning\";\n  } else if (status === \"Archived\") {\n    return \"primary\";\n  } else if (status === \"Feedback\") {\n    return \"success\";\n  } else {\n    return \"\";\n  }\n};\n\nconst rowClass = (row) => {\n  return expanded.value.includes(row.row.id) ? \"expanded\" : \"\";\n};\n\nconst removeCH = (value) => {\n  if (!value) return \"\";\n  return value.replace(\"-CH\", \"\");\n};\n\nconst expand = (row) => {\n  expanded.value = [...expanded.value, row.id];\n};\n\nconst collapse = (row) => {\n  const index = expanded.value.findIndex((id) => id === row.id);\n  expanded.value.splice(index, 1);\n};\n\nconst isExpanded = (rowId) => {\n  return expanded.value.includes(rowId);\n};\n\nconst actionClearMustExpand = () => {\n  legislativeCatalogStore.clearMustExpand();\n};\n\nconst actionClearMustCollapse = () => {\n  legislativeCatalogStore.clearMustCollapse();\n};\n\nconst buildLegislativeCorp = (i) => {\n  // example: Kanton(level) Argau(the name in the right language)\n  let levelPrefix = t(`level.${i.level}`) || \"\";\n  if (i.level === \"federal\") levelPrefix = \"\";\n  let legCorp = i[\"name\" + languageUppercase.value] || i.name;\n  return `${levelPrefix} ${legCorp}`;\n};\n\nconst checkIsToday = () => {\n  return isToday(dateFilterStore.dateUntil);\n};\n\n/** Check if the user has enough permissions to edit the row */\nconst hasWritePermission = (currentRow) => {\n  // if we arent logged in we cant edit\n  if (!isLoggedIn.value) return false;\n  // if we are in reviewmode we cant edit\n  if (route.params.reviewid) return false;\n  // if user can't write in this corporation (read only), we can't edit\n  if (!crudCorpsIds.value.includes(currentRow.executiveCorp.id)) {\n    return false;\n  }\n  // Finally, returns true if the user has rights on this row.\n  return mappedUserCorp.value === currentRow.legislativeCorp.id;\n};\n\n/** Check if the row can be edited. */\nconst entryIsEditable = (currentRow) => {\n  // if we are historised we cant edit\n  if (currentRow.isHistorised) return false;\n  // if the user corp is not same as the rowcorp we cant edit\n\n  // if current row is not published we always edit\n  const rowIsPublished = currentRow.status === \"Published\";\n  if (!rowIsPublished) return true;\n\n  const currentIdentifier = currentRow.identifier;\n  // Check if there is a another element with same identifier but in draft status.\n  const identifierAlreadyExistsInDraft = unpackedListWithParents.value.some(\n    (row) => {\n      return (\n        row.identifier === currentIdentifier &&\n        row.status !== \"Published\" &&\n        row.status !== \"Archived\"\n      );\n    }\n  );\n  // If there are not equivalent draft entry, allows the edition if the dateUntil is \"today\".\n  return !identifierAlreadyExistsInDraft && checkIsToday();\n};\n\nconst editModeIsEnabled = (currentRow) => {\n  return hasWritePermission(currentRow) && entryIsEditable(currentRow);\n};\n\nconst techEditModeIsEnabled = (entries, current) => {\n  // if current entry is not published it can be edited anyways\n  if (current.status !== \"Published\") return true;\n\n  // use some to return true or false if there is a another element with same label and it is not published\n  const identifierAlreadyExistsInDraft = entries.some((row) => {\n    return (\n      row.labelNumber === current.labelNumber &&\n      row.status !== \"Published\" &&\n      row.status !== \"Archived\"\n    );\n  });\n  return !identifierAlreadyExistsInDraft;\n};\n\nconst leaveEditMode = (row) => {\n  row.isEditing = false;\n};\n\nconst handleSave = async (row) => {\n  tableData.value.toggleRowExpansion(row, false);\n  collapse(row);\n};\n\nconst handlePublish = async (row) => {\n  tableData.value.toggleRowExpansion(row, false);\n  collapse(row);\n};\n\nconst loadRowDetails = async (row) => {\n  // Get data, use \"newest\" as for the row entry request.\n  const legalEntryDetail = await getLegislativeDetail(row.id, {\n    ...(filtersFacadeStore.filtersValues || {}),\n    newest: false,\n  });\n  // If it's parent keep a copy to don't break the workflow\n  // On pushing new entry in the legislativeList (and\n  // recompute the unpackedListWithParents list).\n  const isParent = legislativeList.value.some((entry) => {\n    if (!entry.parent) return false;\n    return entry.parent.id === legalEntryDetail.id;\n  });\n  if (isParent) {\n    legislativeCatalogStore.addDetailedParentEntry(legalEntryDetail);\n  } else {\n    // Replace row data in not-parent elements\n    const index = legislativeList.value.findIndex((item) => item.id === row.id);\n    legislativeList.value.splice(index, 1, legalEntryDetail);\n  }\n  legislativeCatalogStore.updateUnpackedListWithParents();\n  // return row\n  return legalEntryDetail;\n};\n\nconst handleExpandClick = async (row) => {\n  tableData.value.toggleRowExpansion(row);\n};\n\nconst handleExpand = async (row) => {\n  if (isExpanded(row.id)) {\n    // elem is expanded and will be closed.\n    tableData.value.toggleRowExpansion(row, false);\n    collapse(row);\n    return;\n  }\n  // elem is collapsed and will be expanded.\n  await loadRowDetails(row);\n  const detailedRow = unpackedListWithParents.value.find(\n    (entry) => entry.id === row.id\n  );\n  // as the api does not get the information from which table\n  // an entry was opened, the api will always set isParent\n  // to undefined for the detail view of an entry. This is fine\n  // but to show the correct labels in the table we have to\n  // inherit it here from the overview to the detail entry\n  detailedRow.isParent = row.isParent;\n  detailedRow.isGrandParent = row.isGrandParent;\n  tableData.value.toggleRowExpansion(detailedRow, true);\n  expand(row);\n};\n\nconst handleEditClick = (payload) => {\n  payload.row.language = payload.lang;\n  payload.row.isEditing = !payload.row.isEditing;\n};\n\nconst handleTechEditClick = (payload) => {\n  let row = payload.row;\n  payload.row.language = payload.lang;\n  const index = editingTechRows.value.indexOf(row.id);\n  index > -1\n    ? editingTechRows.value.splice(index, 1)\n    : editingTechRows.value.push(row.id);\n};\n\nconst cancelTechEdit = (row) => {\n  const index = editingTechRows.value.indexOf(row.id);\n  index > -1\n    ? editingTechRows.value.splice(index, 1)\n    : editingTechRows.value.push(row.id);\n};\n\nconst stopPropagation = () => {\n  event.stopPropagation();\n};\n\nconst createTechnicalEntry = (row) => {\n  legislativeCatalogStore.addTechnicalEntry(row.id);\n};\n\nconst translateDelegation = (delegation) => {\n  if (delegation === \"plant_operator\") {\n    return t(\"delegationOptions.plantOperator\");\n  } else if (delegation) {\n    return t(`delegationOptions.${delegation}`);\n  } else {\n    return \"\";\n  }\n};\n\nconst actionRetrievePublishedParentToCompare = (legislativeEntry) => {\n  legislativeCatalogStore.setPublishedParentToCompare(legislativeEntry);\n};\n\nconst getCorpParentLevelDisplay = () => {\n  return corpStore.getCorpParentLevel(corpFilterStore.corpFilter);\n};\n\nconst getConcernedLegislativeEntry = () => {\n  const legislativeEntryId = parseInt(route.params.legislativeEntryId);\n  return unpackedListWithParents.value.find(\n    (entry) => entry.id === legislativeEntryId\n  );\n};\n\nconst getDiffersFromParentButtonClasses = (row) => {\n  const classes = \"align-middle border-2\";\n  if (row.differsFromParent) {\n    return `${classes} border-rose-200 hover:border-rose-200`;\n  }\n  return classes;\n};\n\n// Mounted\nonMounted(() => {\n  legislativeCatalogStore.clearReviewId();\n  legislativeCatalogStore.clearLegislativeEntryId();\n  legislativeCatalogStore.clearCorpBfs();\n  legislativeCatalogStore.clearDetailId();\n  legislativeCatalogStore.clearNewest();\n\n  let corpBfs = route.query.corp || \"CH\";\n  let detailId = route.query.identifier;\n  let newest = route.query.newest;\n  let legislativeEntryId = route.params.legislativeEntryId;\n\n  if (legislativeEntryId) {\n    legislativeCatalogStore.setLegislativeEntryId(legislativeEntryId);\n    legislativeCatalogStore.setNewest(newest);\n    legislativeCatalogStore.retrieveLegislativeList();\n  } else if (detailId) {\n    legislativeCatalogStore.setCorpBfs(corpBfs);\n    legislativeCatalogStore.setDetailId(detailId);\n    legislativeCatalogStore.retrieveLegislativeList();\n  }\n});\n\n// Watcher\nwatch(\n  mustExpand,\n  (ids) => {\n    if (!ids.length) {\n      return;\n    }\n    // let vue settle and render the DOM\n    nextTick(() => {\n      ids.forEach((id) => {\n        const row = unpackedListWithParents.value.find((row) => row.id === id);\n        tableData.value.toggleRowExpansion(row, true);\n        expand(row);\n      });\n      actionClearMustExpand();\n    });\n  },\n  { immediate: true }\n);\n\nwatch(\n  mustCollapse,\n  (ids) => {\n    if (!ids.length) {\n      return;\n    }\n    // let vue settle and render the DOM\n    nextTick(() => {\n      ids.forEach((id) => {\n        const row = unpackedListWithParents.value.find((row) => row.id === id);\n        tableData.value.toggleRowExpansion(row, false);\n        collapse(row);\n      });\n      actionClearMustCollapse();\n    });\n  },\n  { immediate: true }\n);\n\nwatch(\n  unpackedListWithParents,\n  () => {\n    // if we received data we can open the table rows previously opened\n    // not necessarily needed but won't hurt to refrain from spamming our foreach\n    if (unpackedListWithParents.value && unpackedListWithParents.value.length) {\n      // let vue settle and render the DOM\n      nextTick(() => {\n        // expand all rows that got \"expanded\" (new rows for example)\n        tableData.value.data\n          .filter((row) => {\n            return row.expanded === true;\n          })\n          .forEach((row) => {\n            tableData.value.toggleRowExpansion(row, true);\n          });\n        // expand all technical entries if the identifier has a dot\n        const identifier = route.query.identifier;\n        if (identifier && identifier.includes(\".\")) {\n          let currentLegalEntry = tableData.value.data.filter((row) => {\n            return row.expanded === true || row.identifier === identifier.split(\".\")[0];\n          })[0];\n          let currentId = currentLegalEntry.technicalEntries\n            .map(function (x) {\n              return x.label;\n            })\n            .indexOf(identifier);\n          collapseTechnical.value.push(currentId);\n        } else {\n          collapseTechnical.value.push(0);\n        }\n      });\n    }\n  },\n  { immediate: true }\n);\n</script>\n\n<style lang=\"postcss\" scoped>\n.legalBaseLink {\n  min-width: 8rem;\n}\n/*this solution is very hacky, thanks element-ui: i overlap the icon with another element to steal the native click*/\n.el-table__expand-column:after {\n  content: \"\";\n  display: block;\n  width: 50px;\n  height: 100%;\n  position: absolute;\n  top: 0;\n}\n</style>","<template>\n  <Default class=\"view-home\">\n    <div class=\"container\">\n      <detail-table\n        :key=\"\n          route.params.reviewid\n            ? `${route.params.reviewid}-table-key`\n            : 'default-table-key'\n        \"\n        class=\"mt-6\"\n      />\n      <div class=\"flex items-center pt-8\">\n        <router-link class=\"container\" to=\"/\">\n          {{ $t(\"goToCatalog\") }}\n        </router-link>\n      </div>\n    </div>\n    <modal\n      v-show=\"modalShown !== null\"\n      :must-focus=\"modalShown !== null\"\n      @close-modal=\"closeModal\"\n    >\n      <template #main>\n        <differences-from-parent\n          v-if=\"modalShown === modalComponents.DifferencesFromParent\"\n        ></differences-from-parent>\n      </template>\n    </modal>\n  </Default>\n</template>\n<script setup>\nimport { ref, computed, onMounted } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport { ElMessageBox } from \"element-plus\";\nimport { notifyError } from \"@/composables/notification.js\";\nimport DetailTable from \"@/components/catalog/DetailTable.vue\";\nimport Modal from \"@/components/Modal.vue\";\nimport Default from \"@/layouts/Default.vue\";\nimport DifferencesFromParent from \"@/components/catalog/DifferencesFromParent.vue\";\nimport { useCorpFilter } from \"@/store/Filters\";\nimport { useCorpStore } from \"@/store/Corp\";\nimport { useUserStore } from \"@/store/User\";\nimport { useSearchFilter } from \"@/store/Filters\";\nimport { useLegislativeCatalogStore } from \"@/store/LegislativeCatalog\";\nimport { useCatalogListStore } from \"@/store/CatalogList\";\nimport { onBeforeRouteLeave, useRoute, useRouter } from \"vue-router\";\n\nconst MODAL_COMPONENTS = {\n  DifferencesFromParent: \"DifferencesFromParent\",\n};\n\nconst { t } = useI18n();\nconst route = useRoute();\nconst router = useRouter();\n\nconst legislativeCatalogStore = useLegislativeCatalogStore();\nconst searchFilterStore = useSearchFilter();\nconst catalogListStore = useCatalogListStore();\nconst userStore = useUserStore();\nconst corpStore = useCorpStore();\nconst corpFilter = useCorpFilter();\n\nconst modalComponents = ref(MODAL_COMPONENTS);\n\nconst modalShown = computed(() => {\n  if (legislativeCatalogStore.entryAndPublishedParentComparison !== null) {\n    return modalComponents.value.DifferencesFromParent;\n  }\n  return null;\n});\n\nconst closeModal = () => {\n  if (modalShown.value === modalComponents.value.DifferencesFromParent) {\n    return legislativeCatalogStore.setPublishedParentToCompare(null);\n  }\n};\n\nonMounted(async () => {\n  if (!userStore.loggingIn && !userStore.isLoggedIn) {\n    try {\n      // Remove corpList initialization from CatalogTable component and\n      // from CatalogFilters to prevent double fetching as they are only\n      // used in this component.\n      // Await the end of this call because there is relevant corp data in\n      // it for the following requests\n      await corpStore.retrieveCorpList();\n      // Set main corp if the user is not authenticated. This is\n      // crucial to ensure that the following requests fetch the\n      // correct data\n      await corpFilter.changeCorpFilter(router, corpStore.mainCorp.id, false);\n    } catch (error) {\n      notifyError(error);\n    }\n  }\n});\n\nonBeforeRouteLeave((to, from, next) => {\n  if (searchFilterStore.searchFilter !== \"\") {\n    searchFilterStore.changeSearchFilter(\"\");\n  }\n  if (catalogListStore.unsavedChanges.length > 0) {\n    ElMessageBox.confirm(t(\"warningEdit\"), t(\"warning\"), {\n      confirmButtonText: t(\"ok\"),\n      cancelButtonText: t(\"cancel\"),\n      type: \"warning\",\n    })\n      .then(() => {\n        catalogListStore.clearUnsavedChanges();\n        next();\n      })\n      .catch(() => {\n        next(false);\n      });\n  } else {\n    next();\n  }\n});\n</script>\n"],"names":["userStore","useUserStore","filtersFacadeStore","useFiltersFacade","legislativeCatalogStore","useLegislativeCatalogStore","corpStore","useCorpStore","loadingStore","useLoadingStore","corpFilterStore","useCorpFilter","languageStore","useLanguageStore","dateFilterStore","useDateFilter","route","useRoute","t","useI18n","expanded","ref","collapseTechnical","editingTechRows","tableData","isLoggedIn","computed","unpackedListWithParents","loading","legislativeList","mustExpand","mustCollapse","userCorp","crudCorpsIds","language","corps","mappedUserCorp","corp","languageUppercase","computedTableData","getTagType","status","rowClass","row","removeCH","value","expand","collapse","index","id","isExpanded","rowId","actionClearMustExpand","actionClearMustCollapse","buildLegislativeCorp","i","levelPrefix","legCorp","checkIsToday","isToday","hasWritePermission","currentRow","entryIsEditable","currentIdentifier","editModeIsEnabled","techEditModeIsEnabled","entries","current","leaveEditMode","handleSave","handlePublish","loadRowDetails","legalEntryDetail","getLegislativeDetail","entry","item","handleExpandClick","handleExpand","detailedRow","handleEditClick","payload","handleTechEditClick","cancelTechEdit","stopPropagation","createTechnicalEntry","translateDelegation","delegation","actionRetrievePublishedParentToCompare","legislativeEntry","getCorpParentLevelDisplay","getConcernedLegislativeEntry","legislativeEntryId","getDiffersFromParentButtonClasses","classes","onMounted","corpBfs","detailId","newest","watch","ids","nextTick","identifier","currentId","x","MODAL_COMPONENTS","router","useRouter","searchFilterStore","useSearchFilter","catalogListStore","useCatalogListStore","corpFilter","modalComponents","modalShown","closeModal","error","notifyError","onBeforeRouteLeave","to","from","next","ElMessageBox"],"mappings":"gwEA0lBA,MAAMA,EAAYC,GAAY,EACxBC,EAAqBC,GAAgB,EACrCC,EAA0BC,GAA0B,EACpDC,EAAYC,GAAY,EACxBC,EAAeC,GAAe,EAC9BC,EAAkBC,GAAa,EAC/BC,EAAgBC,GAAgB,EAChCC,EAAkBC,GAAa,EAC/BC,EAAQC,GAAQ,EAChB,CAAE,EAAAC,CAAC,EAAKC,KAERC,EAAWC,EAAI,CAAA,CA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