{"version":3,"file":"Document-MmyQa1U9.mjs","names":[],"sources":["../src/components/Error.vue","../src/components/Loading.vue","../src/js/nodemap.js","../src/composables/computed.js","../src/components/templates/Document.vue"],"sourcesContent":["<template>\n  <div>\n    <h3>Missing: '{{ componentName }}' from Sphinx XML output</h3>\n    <span>It seems the component was not found.</span>\n  </div>\n</template>\n\n<script setup>\nconst props = defineProps({\n  node: {\n    type: undefined,\n  },\n  componentName: {\n    type: String,\n  },\n})\n</script>\n","<template>\n  <div class=\"loading-container\">\n    <span>Loading page component</span>\n    <span class=\"lds-roller\">\n      <div></div>\n      <div></div>\n      <div></div>\n      <div></div>\n      <div></div>\n      <div></div>\n      <div></div>\n      <div></div>\n    </span>\n  </div>\n</template>\n\n<script setup>\nconst props = defineProps({\n  node: {\n    type: undefined,\n  },\n  componentName: {\n    type: String,\n  },\n})\n</script>\n\n<style scoped>\n.loading-container {\n  display: flex;\n  align-items: center;\n}\n\n.lds-roller {\n  transform: scale(0.5);\n  display: inline-block;\n  position: relative;\n  width: 80px;\n  height: 80px;\n}\n.lds-roller div {\n  animation: lds-roller 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;\n  transform-origin: 40px 40px;\n}\n.lds-roller div:after {\n  content: ' ';\n  display: block;\n  position: absolute;\n  width: 7px;\n  height: 7px;\n  border-radius: 50%;\n  background: rgb(116, 116, 116);\n  margin: -4px 0 0 -4px;\n}\n.lds-roller div:nth-child(1) {\n  animation-delay: -0.036s;\n}\n.lds-roller div:nth-child(1):after {\n  top: 63px;\n  left: 63px;\n}\n.lds-roller div:nth-child(2) {\n  animation-delay: -0.072s;\n}\n.lds-roller div:nth-child(2):after {\n  top: 68px;\n  left: 56px;\n}\n.lds-roller div:nth-child(3) {\n  animation-delay: -0.108s;\n}\n.lds-roller div:nth-child(3):after {\n  top: 71px;\n  left: 48px;\n}\n.lds-roller div:nth-child(4) {\n  animation-delay: -0.144s;\n}\n.lds-roller div:nth-child(4):after {\n  top: 72px;\n  left: 40px;\n}\n.lds-roller div:nth-child(5) {\n  animation-delay: -0.18s;\n}\n.lds-roller div:nth-child(5):after {\n  top: 71px;\n  left: 32px;\n}\n.lds-roller div:nth-child(6) {\n  animation-delay: -0.216s;\n}\n.lds-roller div:nth-child(6):after {\n  top: 68px;\n  left: 24px;\n}\n.lds-roller div:nth-child(7) {\n  animation-delay: -0.252s;\n}\n.lds-roller div:nth-child(7):after {\n  top: 63px;\n  left: 17px;\n}\n.lds-roller div:nth-child(8) {\n  animation-delay: -0.288s;\n}\n.lds-roller div:nth-child(8):after {\n  top: 56px;\n  left: 12px;\n}\n@keyframes lds-roller {\n  0% {\n    transform: rotate(0deg);\n  }\n  100% {\n    transform: rotate(360deg);\n  }\n}\n</style>\n","export const nodeNameTagNameMap = new Map([\n  ['bullet_list', 'ul'],\n  ['button', 'button'],\n  ['citation', 'cite'],\n  ['definition', 'dd'],\n  ['definition_list', 'dl'],\n  ['definition_list_item', 'dt'],\n  ['div', 'div'],\n  ['emphasis', 'em'],\n  ['enumerated_list', 'ol'],\n  ['glossary', 'div'],\n  ['inline', 'span'],\n  ['label', 'span'],\n  ['list_item', 'li'],\n  ['line', 'p'],\n  ['paragraph', 'p'],\n  ['rubric', 'h3'],\n  ['strong', 'strong'],\n  ['subscript', 'sub'],\n  ['superscript', 'sup'],\n  ['table', 'table'],\n  ['tbody', 'tbody'],\n  ['entry', 'td'],\n  ['row', 'tr'],\n  ['thead', 'thead'],\n  ['term', 'dt'],\n  ['title_reference', 'cite'],\n])\n\nexport const nodeNameTemplateNameMap = new Map([\n  ['#text', 'Text'],\n  ['block_quote', 'BlockQuote'],\n  ['caption', 'FigureCaption'],\n  ['caption_number', 'CaptionNumber'],\n  ['download_reference', 'DownloadReference'],\n  ['footnote_reference', 'FootnoteReference'],\n  ['index', 'Skip'],\n  ['line_block', 'LineBlock'],\n  ['literal_block', 'LiteralBlock'],\n  ['math_block', 'MathBlock'],\n  ['number_reference', 'NumberReference'],\n])\n","import { computed, defineAsyncComponent } from 'vue'\n\nimport ErrorComponent from '../components/Error.vue'\nimport LoadingComponent from '../components/Loading.vue'\nimport { nodeNameTagNameMap, nodeNameTemplateNameMap } from '../js/nodemap'\n\nfunction defineChildComponent(name, node) {\n  let properties = undefined\n  if (node.nodeName === '#text') {\n    if (!node.nodeValue.trim()) {\n      return null\n    }\n    properties = {\n      text: node.nodeValue,\n    }\n  } else if (node.nodeName === 'warning') {\n    let parentNode = node.parentNode\n    let depth = 0\n    while (parentNode) {\n      if (parentNode.nodeName === 'section') {\n        depth += 1\n      }\n      parentNode = parentNode.parentNode\n    }\n    properties = {\n      depth\n    }\n  } else if (node.nodeName === 'title') {\n    let parentNode = node.parentNode\n    let depth = 0\n    let isTopic = false\n    if (parentNode.nodeName === 'topic') {\n      isTopic = true\n    } else {\n      while (parentNode) {\n        // && parentNode.nodeName !== ('SphinxPage' should now be 'document' but maybe this is no longer requied).\n        if (parentNode.nodeName === 'section') {\n          depth += 1\n        }\n        parentNode = parentNode.parentNode\n      }\n    }\n    properties = {\n      depth,\n      isTopic,\n    }\n  }\n  const component = defineAsyncComponent({\n    loader: () => {\n      return import(`../components/templates/${name}.vue`)\n    },\n    // A component to use while the async component is loading\n    loadingComponent: LoadingComponent,\n    // A component to use if the load fails\n    errorComponent: ErrorComponent,\n  })\n\n  return {\n    component,\n    name,\n    node,\n    properties,\n  }\n}\n\nfunction defineColgroupComponent(node, colspecs) {\n  const name = 'ColumnGroup'\n  const component = defineAsyncComponent({\n    loader: () => {\n      return import(`../components/templates/${name}.vue`)\n    },\n    // A component to use while the async component is loading\n    loadingComponent: LoadingComponent,\n    // A component to use if the load fails\n    errorComponent: ErrorComponent,\n  })\n  \n  const properties = {\n    colspecs\n  }\n\n  return {\n    component,\n    name,\n    node,\n    properties,\n  }\n}\n\nfunction mapToComponentName(name) {\n  let componentName =\n  name.charAt(0).toUpperCase() + name.slice(1)\n  if (nodeNameTemplateNameMap.has(name)) {\n    componentName = nodeNameTemplateNameMap.get(name)\n  } else if (nodeNameTagNameMap.has(name)) {\n    componentName = 'StandardElement'\n  }\nreturn componentName\n}\n\nfunction addTGroup(components, node, columns) {\n  if (node === null) {\n    return components\n  }\n\n  let colspecs = []\n  for (const colspec of node.querySelectorAll('colspec')) {\n    colspecs.push(colspec.getAttribute('colwidth'))\n  }\n\n  if (colspecs.length !== columns) {\n    console.log('***** Something is not right. *****', colspecs.length, columns)\n  }\n  components.push(defineColgroupComponent(node, colspecs))\n\n  return components\n}\n\nfunction addComponents(components, node) {\n  if (node === null) {\n    return components\n  }\n\n  let childTarget = null\n  for (const child of node.childNodes) {\n    const childName = child.nodeName\n    if (childName === 'compact_paragraph') {\n      // Skip over this wrapper and directly add its children to this component.\n      components = addComponents(components, child)\n    } else if (childName === 'tgroup') {\n      // Skip over these wrappers and directly add their children to this component.\n      const columnCount = Number(child.getAttribute('cols'))\n      components = addTGroup(components, child, columnCount)\n      components = addComponents(components, child)\n    } else if (childName === 'colspec') {\n      // Ignore this element completely, this element is dealt with by 'tgroup'.\n    } else {\n      if (childName === 'target') {\n        childTarget = child.getAttribute('refid')\n      } else {\n        if (childName !== '#text' && childTarget) {\n          child.setAttribute('id', childTarget)\n          childTarget = ''\n        }\n        const componentName = mapToComponentName(childName)\n        const item = defineChildComponent(componentName, child)\n        if (item) {\n          components.push(item)\n        }\n      }\n    }\n  }\n\n  return components\n}\n\nexport function useChildren(element) {\n  const children = computed(() => {\n    return addComponents([], element.value)\n  })\n\n  return {\n    children,\n  }\n}\n\nexport function useClasses(element) {\n  const classes = computed(() => {\n    let classesString = element.value.getAttribute('classes')\n    let classes = []\n    if (classesString) {\n      classes = classesString.split(' ')\n    }\n    return [element.value.nodeName.toLowerCase(), ...classes]\n  })\n\n  return {\n    classes\n  }\n}\n","<template>\n  <div :id=\"id\">\n    <component\n      v-for=\"(c, index) in children\"\n      :key=\"'document_component_' + index\"\n      :is=\"c.component\"\n      :node=\"c.node\"\n      :componentName=\"c.name\"\n      :properties=\"c.properties\"\n    />\n  </div>\n</template>\n\n<script setup>\nimport { defineProps, toRefs } from 'vue'\n\nimport { useChildren } from '../../composables/computed'\n\nconst props = defineProps({\n  element: {\n    type: undefined,\n    default: { empty: true },\n  },\n  id: {\n    type: String,\n    default: '',\n  },\n})\n\nconst { element } = toRefs(props)\nconst { children } = useChildren(element)\n\n</script>\n"],"mappings":";;;;;;;;;;;;;;;oBACE,EAAA,GAAA,EAGM,OAAA,MAAA,CAFJ,EAA8D,MAAA,MAA1D,eAAU,EAAG,EAAA,aAAa,IAAG,4BAAwB,CAAA,GACzD,AAAA,EAAA,OAAA,EAAkD,QAAA,MAA5C,yCAAqC,EAAA,CAAA,CAAA;;;;;;;;;;;;;oBCF7C,EAAA,GAAA,EAYM,OAZN,GAYM,CAAA,GAAA,AAAA,EAAA,OAAA,CAXJ,EAAmC,QAAA,MAA7B,0BAAsB,EAAA,GAC5B,EASO,QAAA,EATD,OAAM,aAAY,GAAA;GACtB,EAAW,KAAA;GACX,EAAW,KAAA;GACX,EAAW,KAAA;GACX,EAAW,KAAA;GACX,EAAW,KAAA;GACX,EAAW,KAAA;GACX,EAAW,KAAA;GACX,EAAW,KAAA;;;wCCXJ,oBAAqB,IAAI,IAAI;CACxC,CAAC,eAAe,IAAI;CACpB,CAAC,UAAU,QAAQ;CACnB,CAAC,YAAY,MAAM;CACnB,CAAC,cAAc,IAAI;CACnB,CAAC,mBAAmB,IAAI;CACxB,CAAC,wBAAwB,IAAI;CAC7B,CAAC,OAAO,KAAK;CACb,CAAC,YAAY,IAAI;CACjB,CAAC,mBAAmB,IAAI;CACxB,CAAC,YAAY,KAAK;CAClB,CAAC,UAAU,MAAM;CACjB,CAAC,SAAS,MAAM;CAChB,CAAC,aAAa,IAAI;CAClB,CAAC,QAAQ,GAAG;CACZ,CAAC,aAAa,GAAG;CACjB,CAAC,UAAU,IAAI;CACf,CAAC,UAAU,QAAQ;CACnB,CAAC,aAAa,KAAK;CACnB,CAAC,eAAe,KAAK;CACrB,CAAC,SAAS,OAAO;CACjB,C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