<commit_before><template>
  <v-container
    class="pa-4 pa-sm-6 pa-md-8"
    tag="section"
  >
    <v-responsive
      class="mx-auto overflow-visible"
      max-width="868"
    >
      <skeleton-loader
        v-if="!component"
        key="loader"
      />

      <keep-alive
        v-else
        max="3"
      >
        <component :is="component" />
      </keep-alive>
    </v-responsive>
  </v-container>
</template>

<script>
  // Utilities
  import { genMetaData } from '@/util/metadata'
  import { get, sync } from 'vuex-pathify'
  import { localeLookup } from '@/i18n/util'

  async function load (route) {
    const { category, page } = route.params
    const isApi = category === 'api'
    const locale = localeLookup(route.params.locale)

    const context = isApi
      ? await import(
        /* webpackChunkName: "api-[request]" */
        `@/api/${locale}.js`
      )
      : await import(
        /* webpackChunkName: "documentation-[request]" */
        `@/pages/${locale}.js`
      )

    const path = ['.']
    if (!isApi) path.push(category)
    path.push(page)

    return context.default(`${path.join('/')}.md`)
  }

  export default {
    name: 'DocumentationView',

    async asyncData ({ route, store }) {
      const md = await load(route)
      store.state.pages.md = md
    },

    metaInfo () {
      if (!this.frontmatter) return {}

      const { meta } = this.frontmatter

      if (!meta) return

      const {
        description = '',
        keywords = '',
        title = '',
      } = meta

      return genMetaData(
        title,
        description,
        keywords,
      )
    },

    data: () => ({
      component: undefined,
    }),

    computed: {
      ...sync('pages', [
        'frontmatter',
        'toc',
        'md',
      ]),
      ...get('route', [
        'hash',
        'params@page',
      ]),
    },

    created () {
      this.init(this.md)
    },

    async beforeRouteUpdate (to, from, next) {
      if (to.path === from.path) return next()

      await this.$options.asyncData({
        route: to,
        store: this.$store,
      })
      next()
    },

    methods: {
      init (md) {
        const {<commit_msg>docs: reload page data on HMR<commit_after><template>
  <v-container
    class="pa-4 pa-sm-6 pa-md-8"
    tag="section"
  >
    <v-responsive
      class="mx-auto overflow-visible"
      max-width="868"
    >
      <keep-alive max="3">
        <component :is="component" />
      </keep-alive>
    </v-responsive>
  </v-container>
</template>

<script>
  // Utilities
  import { IN_BROWSER } from '@/util/globals'
  import { genMetaData } from '@/util/metadata'
  import { get, sync } from 'vuex-pathify'
  import { localeLookup } from '@/i18n/util'

  async function load (route) {
    const { category, page } = route.params
    const isApi = category === 'api'
    const locale = localeLookup(route.params.locale)

    const context = isApi
      ? await import(
        /* webpackChunkName: "api-[request]" */
        `@/api/${locale}.js`
      )
      : await import(
        /* webpackChunkName: "documentation-[request]" */
        `@/pages/${locale}.js`
      )

    const path = ['.']
    if (!isApi) path.push(category)
    path.push(page)

    return context.default(`${path.join('/')}.md`)
  }

  export default {
    name: 'DocumentationView',

    async asyncData ({ route, store }) {
      const md = await load(route)
      store.state.pages.md = md
    },

    metaInfo () {
      if (!this.frontmatter) return {}

      const { meta } = this.frontmatter

      if (!meta) return

      const {
        description = '',
        keywords = '',
        title = '',
      } = meta

      return genMetaData(
        title,
        description,
        keywords,
      )
    },

    data: () => ({
      component: undefined,
    }),

    computed: {
      ...sync('pages', [
        'frontmatter',
        'toc',
        'md',
      ]),
      ...get('route', [
        'hash',
        'params@page',
      ]),
    },

    async created () {
      if (IN_BROWSER && !this.$vuetify.isHydrating) {
        await this.$options.asyncData({
          route: this.$route,
          store: this.$store,
        })
      }
      this.init(this.md)
    },

    methods: {
      init (md) {
        const {
{'fraction_non_alphanumeric': 0.159804605722261, 'fraction_numerical': 0.00418702023726448, 'mean_word_length': 1.7724049000644746, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5204746', 'n_tokens_mistral': 1415, 'n_tokens_neox': 1361, 'n_words': 280}