{"version":3,"file":"FindingAidsFile-BxHvGnR1.js","sources":["../../src/queries/GetFindingAidsFile.js","../../src/components/findingAids/FindingAidsFile.vue"],"sourcesContent":["import gql from 'graphql-tag';\n\nexport const findingAidsFileQuery = gql`\n  query getFindingAidsFile($slug: ID!) {\n    findingAidsFile(id: $slug, idType: SLUG) {\n      collection {\n        title\n        slug\n        callNumber\n      }\n      content\n      excerpt\n      series {\n        title\n        slug\n      }\n      title\n    }\n  }\n`;\n","<template>\n  <article v-if=\"file && Object.keys(file).length\" class=\"space-0-above\">\n    <FindingAidsHeader\n      :obj=\"{ breadcrumb: file.collection.callNumber.toLowerCase()}\"\n    ></FindingAidsHeader>\n    <div :class=\"$style.content\">\n      <h1 class=\"no-border-above\">{{ file.title }}</h1>\n      <nav :class=\"$style.breadcrumbs\">\n        Contained in:\n        <router-link :to=\"{ path: '/library-archives/archives-collections' }\">\n          Finding Aids\n        </router-link>\n        <IconChevronRight></IconChevronRight>\n        <router-link\n          :to=\"{ name: 'FindingAidsCollection', params: { slug: file.collection.slug } }\"\n          v-html=\"`${file.collection.title} (${file.collection.callNumber})`\"\n        ></router-link>\n        <IconChevronRight v-if=\"file.series\"></IconChevronRight>\n        <router-link\n          v-if=\"file.series\"\n          :to=\"{ name: 'FindingAidsSeries', params: { slug: file.series.slug } }\"\n          v-html=\"file.series.title\"\n        ></router-link>\n      </nav>\n      <ProcessContent\n        :content=\"file.content\"\n        :wrapper=\"'section'\"\n        class=\"finding-aids-file\"\n      ></ProcessContent>\n    </div>\n  </article>\n</template>\n\n<script setup lang=\"ts\">\nimport { dataLoaded, useHandleError, useMetaData } from '@/composables/Common.js';\nimport { findingAidsFileQuery } from '@/queries/GetFindingAidsFile';\nimport FindingAidsHeader from '@/components/findingAids/FindingAidsHeader.vue';\nimport IconChevronRight from '@/assets/svgs/IconChevronRight.svg?component';\nimport ProcessContent from '@/components/common/ProcessContent.vue';\nimport { ref } from 'vue';\nimport { useQuery } from 'villus';\n\nconst props = defineProps<{\n  slug: string;\n}>();\n\nconst { handleError } = useHandleError();\nconst { setMetaDescription, setMetaTitle } = useMetaData();\n\nconst file = ref<{\n  collection: {\n    callNumber: string;\n    title: string;\n  };\n  content: string;\n  series: {\n    slug: string;\n    title: string;\n  };\n  title: string;\n}>();\n\nconst { data } = useQuery({\n  onData: data => {\n    if (data.findingAidsFile && Object.keys(data.findingAidsFile).length) {\n      file.value = data.findingAidsFile;\n      setMetaTitle(data.findingAidsFile.title);\n      setMetaDescription(data.findingAidsFile.excerpt);\n      dataLoaded();\n    }\n\n    if (!data.findingAidsFile || Object.keys(data.findingAidsFile).length === 0) {\n      handleError('FindingAidsFile', props.slug);\n    }\n  },\n  query: findingAidsFileQuery,\n  variables: { slug: props.slug },\n});\n</script>\n\n<script lang=\"ts\">\nexport default {\n  beforeRoute(params, villusClient) {\n    return new Promise<void>((resolve, reject) => {\n      villusClient\n        .executeQuery({\n          query: findingAidsFileQuery,\n          variables: { slug: params.slug },\n        })\n        .then(() => resolve())\n        .catch((err) => reject(err));\n    });\n  },\n};\n</script>\n\n<style lang=\"scss\" module>\n.breadcrumbs {\n  @include body-2;\n\n  & {\n    display: inline-block;\n    padding: 0.75rem 0;\n  }\n\n  svg {\n    height: 0.625em;\n    padding: 0 0.125rem;\n    vertical-align: initial;\n    width: 0.625em;\n  }\n}\n\n.content {\n  :global(.aspect-container) {\n    iframe {\n      bottom: 0;\n      height: 100%;\n      left: 0;\n      position: absolute;\n      right: 0;\n      top: 0;\n      width: 100%;\n    }\n  }\n  :global(.pdf-wrapper) {\n    margin-top: 2rem;\n  }\n}\n\n@media (min-width: $break-point) {\n  .content {\n    @include grid-content;\n  }\n}\n</style>\n"],"names":["findingAidsFileQuery","gql","__default__","params","villusClient","resolve","reject","err","props","__props","handleError","useHandleError","setMetaDescription","setMetaTitle","useMetaData","file","ref","useQuery","data","dataLoaded"],"mappings":"gfAEO,MAAMA,EAAuBC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8DC+ErBC,EAAA,CACb,YAAYC,EAAQC,EAAc,CAChC,OAAO,IAAI,QAAc,CAACC,EAASC,IAAW,CAC5CF,EACG,aAAa,CACZ,MAAOJ,EACP,UAAW,CAAE,KAAMG,EAAO,IAAK,CAAA,CAChC,EACA,KAAK,IAAME,GAAS,EACpB,MAAOE,GAAQD,EAAOC,CAAG,CAAC,CAAA,CAC9B,CAAA,CAEL,8DAnDA,MAAMC,EAAQC,EAIR,CAAE,YAAAC,CAAY,EAAIC,EAAe,EACjC,CAAE,mBAAAC,EAAoB,aAAAC,CAAa,EAAIC,EAAY,EAEnDC,EAAOC,EAWV,EAEc,OAAAC,EAAS,CACxB,OAAQC,GAAQ,CACVA,EAAK,iBAAmB,OAAO,KAAKA,EAAK,eAAe,EAAE,SAC5DH,EAAK,MAAQG,EAAK,gBACLA,EAAAA,EAAK,gBAAgB,KAAK,EACpBA,EAAAA,EAAK,gBAAgB,OAAO,EACpCC,EAAA,IAGT,CAACD,EAAK,iBAAmB,OAAO,KAAKA,EAAK,eAAe,EAAE,SAAW,IAC5DR,EAAA,kBAAmBF,EAAM,IAAI,CAE7C,EACA,MAAOR,EACP,UAAW,CAAE,KAAMQ,EAAM,IAAK,CAC/B,CAAA"}