aboutsummaryrefslogtreecommitdiff
path: root/static/js/main.52fa82f3.chunk.js.map
blob: 4f936a64ae0306273c19823ed8dc5cdcde0a9f37 (plain)
1
{"version":3,"sources":["assets/icon.svg","lib/Window/WindowSurface.tsx","lib/Window/Window.tsx","lib/Header/Header.tsx","lib/ContentSection/ContentSection.tsx","lib/Benzin/Benzin.tsx","lib/Markdown/CodeBlock.tsx","lib/Markdown/SyntacticSpan.tsx","lib/Markdown/Text.tsx","lib/Markdown/Content.tsx","lib/Markdown/Section.tsx","lib/Markdown/Markdown.tsx","index.tsx"],"names":["module","exports","useStyles","makeStyles","theme","surface","position","display","flexDirection","overflowY","scrollbarColor","palette","secondary","dark","light","color","primary","WindowSurface","size","children","classes","Paper","variant","style","className","header","padding","spacing","background","elevation2","Window","type","name","height","bottom","width","left","right","Typography","Divider","root","text","paddingLeft","logo","margin","tab","fontSize","marginRight","marginBottom","Header","contents","page","setPage","AppBar","Toolbar","icon","title","Tabs","onChange","event","newPage","value","Object","keys","map","item","Tab","label","key","content","ContentSection","sectionName","level","component","benzinTheme","createMuiTheme","main","orange","purple","default","paper","elevation1","elevation3","Benzin","ThemeProvider","CssBaseline","overflowX","fontFamily","CodeBlock","rawLines","line","enclosureRegex","e","local","RegExp","global","regex","conceal","rawLink","emoji","bold","italic","code","strikeThrough","splitter","values","pair","source","join","emojiList","emojiLib","forEach","push","char","console","log","borderRadius","image","maxWidth","maxHeight","SyntacticSpan","span","matchConceal","exec","src","alt","Link","href","matchEmoji","match","find","matchCode","matchBold","matchItalic","matchStrikeThrough","textDecoration","Text","split","denotesCodeBlock","denotesDottedList","Content","length","buffer","splice","closeIndex","findIndex","codeBlockLines","slice","dottedListLines","unshift","li","denotesOpenHtml","tag","denotesClosingHtml","htmlLines","dangerouslySetInnerHTML","__html","denotesSelfClosingHtml","before","after","getHeaderLevel","ChildrenSections","reduce","sections","sectionLines","Section","deeperLevelIndex","rawContent","trim","deeperLevel","Markdown","data","url","useState","markdown","setMarkdown","useEffect","axios","get","then","response","window","Icon","headerContents","home","space","pageMap","ReactDOM","render","fileName","lastIndexOf","metadata","document","getElementById"],"mappings":"sGAAAA,EAAOC,QAAU,IAA0B,kC,iKCarCC,EAAYC,aAAW,SAAAC,GAAK,MAAK,CACrCC,QAAS,CACPC,SAAU,WACVC,QAAS,OACTC,cAAe,SACfC,UAAW,OACXC,eAAe,GAAD,OAAKN,EAAMO,QAAQC,UAAUC,KAA7B,YAAqCT,EAAMO,QAAQC,UAAUE,OAE3E,yBAA0B,CACxBC,MAAOX,EAAMO,QAAQK,QAAQF,YAqBpBG,EAf4B,SAAC,GAAkC,IAAhCC,EAA+B,EAA/BA,KAAMZ,EAAyB,EAAzBA,SAAUa,EAAe,EAAfA,SACtDC,EAAUlB,IAEhB,OACE,kBAACmB,EAAA,EAAD,CACEC,QAAQ,WACRC,MAAK,eAAML,EAAN,GAAeZ,GACpBkB,UAAWJ,EAAQf,SAElBc,ICvBDjB,EAAYC,aAAW,SAAAC,GAAK,MAAK,CACrCqB,OAAQ,CACNC,QAAStB,EAAMuB,QAAQ,EAAG,EAAG,EAAG,GAChCC,WAAYxB,EAAMO,QAAQiB,WAAWC,gBA2C1BC,EAtCqB,SAAC,GAA8B,IAA5BC,EAA2B,EAA3BA,KAAMC,EAAqB,EAArBA,KAAMb,EAAe,EAAfA,SAC3CC,EAAUlB,IAEVgB,EAAoB,CACxBe,OAAQ,QAGJ3B,EAA4B,CAChC4B,OAAQ,OAcV,MAXa,YAATH,GACFb,EAAKiB,MAAQ,OACb7B,EAAS8B,KAAO,OACE,cAATL,GACTb,EAAKiB,MAAQ,OACb7B,EAAS+B,MAAQ,OACC,SAATN,IACTzB,EAAS8B,KAAO,MAChB9B,EAAS+B,MAAQ,OAIjB,kBAAC,EAAD,CACEnB,KAAMA,EACNZ,SAAUA,GAET0B,GACD,6BACE,kBAACM,EAAA,EAAD,CAAYhB,QAAQ,KAAKE,UAAWJ,EAAQK,QAASO,GACrD,kBAACO,EAAA,EAAD,OAGD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,GAAKK,IAAMC,IAAIN,GAAKO,MAAK,SAAAC,GAAQ,OAAIL,EAAYK,EAAST,SACvD,kBAAC,EAAD,CAASlF,SAAUqF,EAASrC,MAAM,S,oBCErCvI,GAAYC,aAAW,SAAAC,GAAK,MAAK,CACrCiL,OAAQ,CACN3J,QAAStB,EAAMuB,QAAQ,QAKrB2J,GAAO,yBAAK1D,IAAKrE,KAAMpB,MAAM,OAAOF,OAAO,OAAO4F,IAAI,SAEtD0D,GAAiB,CACrBC,KAAM,KACNC,MAAO,KACP,SAAY,KACZ,MAAS,KACT,cAAe,MAGXC,GAAkC,CACtCF,KAAM,0EACNC,MAAO,4EACP,SAAY,uEACZtF,MAAO,kEACP,cAAe,0EAiDjBwF,IAASC,OAAO,mBA7CM,WACpB,IAAMxK,EAAUlB,KADU,EAEF2K,mBAAS,QAFP,mBAEnB1H,EAFmB,KAEbC,EAFa,KAIpBwH,EAAMc,GAAQvI,GACd0I,EAAWjB,EAAIzB,MAAMyB,EAAIkB,YAAY,KAAO,GAC5CC,EAAW,CAAC,iCAAD,OACkBnB,EADlB,kBAC+BiB,EAD/B,oFAEf,oFACA,yDACA,oIACA,gCACA,MACA,uCACA,6CACA,6EACA,OACAjF,KAAK,MAEP,OACE,kBAAC,EAAD,KACE,kBAAC,EAAD,CACEjE,KAAM,CACJY,KAAM+H,GACN9H,MAAO,UAETN,SAAUqI,GACVpI,KAAMA,EACNC,QAASA,IAEX,kBAAC,EAAD,CAAQrB,KAAK,WACX,yBAAKP,UAAWJ,EAAQiK,QACtB,kBAAC,GAAD,CAAUT,IAAKA,MAGnB,kBAAC,EAAD,CAAQ7I,KAAK,YAAYC,KAAK,mBAC5B,yBAAKR,UAAWJ,EAAQiK,QACtB,kBAAC,GAAD,CAAUV,KAAMoB,SAQV,MAASC,SAASC,eAAe,W","file":"static/js/main.52fa82f3.chunk.js","sourcesContent":["module.exports = __webpack_public_path__ + \"static/media/icon.8908a388.svg\";","import React from 'react';\n\nimport { Paper, makeStyles } from '@material-ui/core';\n\nimport { SurfaceSize, SurfacePosition } from './types';\n\n\ninterface PropTypes {\n  size: SurfaceSize;\n  position: SurfacePosition;\n}\n\n\nconst useStyles = makeStyles(theme => ({\n  surface: {\n    position: 'absolute',\n    display: 'flex',\n    flexDirection: 'column',\n    overflowY: 'auto',\n    scrollbarColor: `${theme.palette.secondary.dark} ${theme.palette.secondary.light}`,\n\n    '& a.MuiTypography-root': {\n      color: theme.palette.primary.light,\n    },\n  }\n}));\n\n\nconst WindowSurface: React.FC<PropTypes> = ({ size, position, children }) => {\n  const classes = useStyles();\n\n  return (\n    <Paper\n      variant=\"outlined\"\n      style={{...size, ...position}}\n      className={classes.surface}\n    >\n      {children}\n    </Paper>\n  )\n};\n\n\nexport default WindowSurface;\n","import React from 'react';\n\nimport { Typography, Divider, makeStyles } from '@material-ui/core';\n\nimport WindowSurface from './WindowSurface';\nimport { SurfaceSize, SurfacePosition } from './types';\n\n\ninterface PropTypes {\n  type: 'primary' | 'secondary' | 'mono';\n  name?: string;\n}\n\n\nconst useStyles = makeStyles(theme => ({\n  header: {\n    padding: theme.spacing(1, 0, 1, 2),\n    background: theme.palette.background.elevation2,\n  },\n}));\n\n\nconst Window: React.FC<PropTypes> = ({ type, name, children }) => {\n  const classes = useStyles();\n\n  const size: SurfaceSize = {\n    height: '85vh',\n  };\n\n  const position: SurfacePosition = {\n    bottom: '3vh',\n  };\n\n  if (type === 'primary') {\n    size.width = '63vw';\n    position.left = '2vw';\n  } else if (type === 'secondary') {\n    size.width = '31vw';\n    position.right = '2vw';\n  } else if (type === 'mono') {\n    position.left = '2vw';\n    position.right = '2vw';\n  }\n\n  return (\n    <WindowSurface\n      size={size}\n      position={position}\n    >\n      {name &&\n      <div>\n        <Typography variant=\"h5\" className={classes.header}>{name}</Typography>\n        <Divider />\n      </div>\n      }\n      {children}\n    </WindowSurface>\n  );\n};\n\nexport default Window;\n","import React from 'react';\n\nimport {\n  AppBar,\n  Tabs,\n  Tab,\n  Typography,\n  Toolbar,\n} from '@material-ui/core';\n\nimport { makeStyles } from '@material-ui/core/styles';\n\n\ninterface PropTypes {\n  logo: {\n    icon: React.ReactNode;\n    title: string;\n  };\n  contents: {\n    [key: string]: React.ReactNode | null;\n  };\n  page: string;\n  setPage: (newPage: string) => void;\n}\n\nconst useStyles = makeStyles(theme => ({\n  root: {\n    background: theme.palette.background.elevation2,\n    color: theme.palette.text.primary,\n    paddingLeft: theme.spacing(3),\n  },\n  logo: {\n    margin: theme.spacing(0, 3, 0, 1),\n  },\n  tab: {\n    '& .MuiTab-wrapper': {\n      padding: theme.spacing(2),\n      flexDirection: 'row',\n      fontSize: '0.8125rem',\n      '& svg': {\n        marginRight: theme.spacing(1),\n        marginBottom: '0 !important',\n      }\n    }\n  }\n}));\n\n\nconst Header: React.FC<PropTypes> = ({ logo, contents, page, setPage }) => {\n  const classes = useStyles();\n\n  const handleChange = (event: React.ChangeEvent<{}>, newPage: string): void => {\n    setPage(newPage);\n  };\n\n  return (\n  <AppBar position=\"sticky\" className={classes.root}>\n    <Toolbar>\n      {logo.icon}\n      <Typography variant=\"h5\" className={classes.logo} color=\"primary\">\n        {logo.title}\n      </Typography>\n      <Tabs onChange={handleChange} value={page}>\n        {contents && Object.keys(contents).map((item: string) => (\n          <Tab\n            label={item}\n            icon={contents[item] as JSX.Element}\n            value={item}\n            className={classes.tab}\n            key={item}\n          />\n        ))}\n      </Tabs>\n    </Toolbar>\n  </AppBar>\n  );\n};\n\nexport default Header;\n","import React from 'react';\n\nimport {\n  Typography,\n  Divider,\n  makeStyles\n} from '@material-ui/core';\n\n\ninterface PropTypes {\n  sectionName: string;\n  level?: number;\n}\n\nconst useStyles = makeStyles(theme => ({\n  content: {\n    padding: theme.spacing(2, 2, 1, 3),\n    marginBottom: theme.spacing(1),\n\n    '& .MuiButton-root': {\n      margin: theme.spacing(1, 2, 2, 0),\n    },\n  },\n}));\n\nconst ContentSection: React.FC<PropTypes> = ({ sectionName, children, level = 0 }) => {\n  const classes = useStyles();\n\n  level += 2; // Make everything smaller\n  if (level > 6) level = 6;\n\n  type Variant = 'h3' | 'h4' | 'h5' | 'h6';\n  const variant: Variant = 'h' + level as Variant;\n\n  return (\n    <>\n      <Typography variant={variant}>{sectionName}</Typography>\n      <Divider variant=\"middle\"/>\n      <Typography component=\"div\" className={classes.content}>\n        {children}\n      </Typography>\n    </>\n  );\n\n};\n\n\nexport default ContentSection;\n","import React from 'react';\nimport orange from '@material-ui/core/colors/orange';\nimport purple from '@material-ui/core/colors/purple';\nimport { createMuiTheme, ThemeProvider } from '@material-ui/core/styles';\nimport { CssBaseline } from '@material-ui/core';\nimport 'typeface-roboto';\n\n\ndeclare module '@material-ui/core/styles/createPalette' {\n  interface TypeBackground {\n      elevation1: string;\n      elevation2: string;\n      elevation3: string;\n  }\n}\n\n\nconst benzinTheme = createMuiTheme({\n  palette: {\n    type: 'dark',\n    primary: {\n      main: orange[400],\n    },\n    secondary: {\n      main: purple[500],\n    },\n    background: {\n      default: '#121212',\n      paper: '#1e1e1e',\n      elevation1: '#1e1e1e',\n      elevation2: '#232323',\n      elevation3: '#252525',\n    },\n    text: {\n      primary: '#f4f4f4',\n      secondary: 'rgba(255, 255, 255, 0.6)',\n    }\n  },\n});\n\n\nconst Benzin: React.FC = ({ children }) => (\n  <ThemeProvider theme={benzinTheme}>\n    <CssBaseline />\n    {children}\n  </ThemeProvider>\n);\n\n\nexport default Benzin;\n\n","import React from 'react';\nimport { ParserPropTypes } from './types';\nimport { Paper } from '@material-ui/core';\n\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles(theme => ({\n  root: {\n    background: theme.palette.background.default,\n    padding: theme.spacing(1),\n    overflowX: 'auto',\n    fontFamily: 'Monospace',\n    scrollbarColor: 'auto'\n  },\n}));\n\nconst CodeBlock: React.FC<ParserPropTypes> = ({ rawLines }) => {\n  const classes = useStyles();\n  return (\n    <Paper variant=\"outlined\" className={classes.root}>\n      {rawLines.map(line => <pre>{line}</pre>)}\n    </Paper>\n  );\n}\n\nexport default CodeBlock;\n\n","import React from 'react';\nimport { Link, makeStyles } from '@material-ui/core';\n\nimport { lib as emojiLib } from 'emojilib';\n\ninterface PropTypes {\n  span: string;\n}\n\ninterface RegexPair {\n  global: RegExp;\n  local: RegExp;\n}\n\ninterface Emoji {\n  name: string;\n  char: string;\n}\n\nconst enclosureRegex = (e: string): RegexPair => ({\n  local: new RegExp(`${e}([^${e}]+)${e}`),\n  global: new RegExp(`(${e}[^${e}]+${e})`)\n});\n\nconst regex: Record<string, RegexPair> = {\n  conceal: {\n    global: /(!?\\[.+?\\]\\(.+?\\))/g,\n    local: /!?\\[(.+?)\\]\\((.+?)\\)/\n  },\n  rawLink: {\n    global: /((?:(?:[A-Za-z]{3,9}:(?:\\/\\/)?)(?:[-;:&=+$,\\w]+@)?[A-Za-z0-9.-]+|(?:www\\.|[-;:&=+$,\\w]+@)[A-Za-z0-9.-]+)(?:(?:\\/[+~%/.\\w-_]*)?\\??(?:[-+=&;%@.\\w_]*)#?(?:[.!/\\\\\\w]*))?)/,\n    local: /&^/\n  },\n  emoji: enclosureRegex(':'),\n  bold: enclosureRegex('\\\\*\\\\*'),\n  italic: enclosureRegex('\\\\*'),\n  code: enclosureRegex('`'),\n  strikeThrough: enclosureRegex('~~'),\n}\n\nconst splitter = new RegExp(Object.values(regex).map(pair => pair.global.source).join('|'));\n\nconst emojiList: Emoji[] = [];\nObject.keys(emojiLib).forEach(name => emojiList.push({ name, char: emojiLib[name].char }));\nconsole.log({emojiList})\n\nconst useStyles = makeStyles(theme => ({\n  code: {\n    background: theme.palette.background.default,\n    borderRadius: theme.spacing(.5),\n    padding: theme.spacing(.5),\n    fontFamily: 'Monospace',\n  },\n  image: {\n    maxWidth: '100%',\n    maxHeight: '100%'\n  },\n}));\n\nconst SyntacticSpan: React.FC<PropTypes> = ({ span }) => {\n  const classes = useStyles();\n  if (!span) return null;\n\n  const matchConceal = regex.conceal.local.exec(span);\n  if (matchConceal) {\n    if (span[0] === '!') return <img src={matchConceal[2]} alt={matchConceal[1]} className={classes.image} />;\n    return <Link href={matchConceal[2]}>{matchConceal[1]}</Link>;\n  }\n\n  const matchEmoji = span.match(regex.emoji.local);\n  if (matchEmoji) {\n    const emoji = emojiList.find(emoji => emoji.name === matchEmoji[1]);\n    return <span>{emoji ? emoji.char : span}</span>;\n  }\n\n  const matchCode = span.match(regex.code.local);\n  if (matchCode) return <span className={classes.code}>{matchCode[1]}</span>;\n\n  const matchBold = span.match(regex.bold.local);\n  if (matchBold) return <b>{matchBold[1]}</b>;\n\n  const matchItalic = span.match(regex.italic.local);\n  if (matchItalic) return <i>{matchItalic[1]}</i>;\n\n  const matchStrikeThrough = span.match(regex.strikeThrough.local);\n  if (matchStrikeThrough) return <span style={{textDecoration: 'line-through' }}>{matchStrikeThrough[1]}</span>;\n\n  if (span.match(regex.rawLink.global)) return <Link href={span}>{span}</Link>;\n\n  return <>{span}</>;\n}\n\n\nexport { splitter };\nexport default SyntacticSpan;\n\n","import React from 'react';\nimport SyntacticSpan, { splitter } from './SyntacticSpan';\n\ninterface PropTypes {\n  line: string;\n}\n\nconst Text: React.FC<PropTypes> = ({ line }) => {\n  return <>{line.split(splitter).map(span => <SyntacticSpan span={span} />)}</>;\n}\n\nexport default Text;\n\n","import React from 'react';\n\nimport CodeBlock from './CodeBlock';\nimport Text from './Text';\nimport { ParserPropTypes } from './types';\n\n\nconst denotesCodeBlock = (line: string): boolean => {\n  return line.match(/^```.*$/) !== null;\n}\n\nconst denotesDottedList = (line: string): boolean => {\n  return line.match(/^ ?- .*$/) !== null;\n}\n\nconst denotesOpenHtml= (line: string): string => {\n  const regex = /<([^/\\s]*)[^<]*[^/]>/g;\n  const match = regex.exec(line);\n  return match ? match[1] : '';\n}\n\nconst denotesClosingHtml= (line: string, tag: string): boolean => {\n  const regex = new RegExp(`</${tag}[^<]*>`);\n  return line.match(regex) !== null;\n}\n\nconst denotesSelfClosingHtml = (line: string): string[] | null => {\n  const regex = /(<[^/\\s]*[^<]*\\/>)/g;\n  return line.match(regex);\n}\n\nconst Content: React.FC<ParserPropTypes> = ({ rawLines }) => {\n  if (!rawLines.length) return null;\n\n  const line = rawLines.splice(0, 1)[0];\n\n  let buffer;\n  if (denotesCodeBlock(line)) {\n    const closeIndex = rawLines.findIndex(line => denotesCodeBlock(line));\n    const codeBlockLines = rawLines.splice(0, closeIndex + 1).slice(0, closeIndex);\n    buffer = <CodeBlock rawLines={codeBlockLines} />\n  } else if (denotesDottedList(line)) {\n    const closeIndex = rawLines.findIndex(line => !denotesDottedList(line));\n    const dottedListLines = rawLines.splice(0, closeIndex).slice(0, closeIndex);\n    dottedListLines.unshift(line);\n    buffer = <ul>{dottedListLines.map(li => <li><Text line={li.slice(2)} /></li>)}</ul>;\n  } else if ((buffer = denotesOpenHtml(line))) {\n    const tag = buffer;\n    const closeIndex = rawLines.findIndex(line => denotesClosingHtml(line, tag));\n    const htmlLines = rawLines.splice(0, closeIndex + 1).slice(0, closeIndex);\n    htmlLines.unshift(line);\n    buffer = <div dangerouslySetInnerHTML={{ __html: htmlLines.join('\\n') }}></div>;\n  } else if ((buffer = denotesSelfClosingHtml(line)) !== null) {\n    const match = buffer[0];\n    const [before, after] = line.split(match);\n    console.log({ line, match, before, after});\n    buffer = (\n      <>\n        <Text line={before} />\n        <div dangerouslySetInnerHTML={{ __html: match }}></div>\n        <Text line={after} />\n      </>\n    );\n  } else {\n    buffer = <p><Text line={line} /></p>\n  }\n\n  return (\n    <>\n      { buffer }\n      <Content rawLines={rawLines} />\n    </>\n  );\n}\n\nexport default Content;\n\n","import React from 'react';\nimport ContentSection from '../ContentSection/ContentSection';\nimport Content from './Content';\nimport { ParserPropTypes } from './types';\n\ninterface PropTypes extends ParserPropTypes {\n  level?: number;\n}\n\nconst getHeaderLevel = (header: string): number => {\n  if (!header) return 0;\n  let level = 0;\n  while(header[level] === '#') level++;\n  return level;\n}\n\nconst ChildrenSections: React.FC<PropTypes> = ({ rawLines, level = 0 }) => {\n  const childrenSectionLines = rawLines.reduce((sections: string[][], line: string) => {\n    if (line) {\n      if (getHeaderLevel(line) === level) sections.push([]);\n      if (sections.length) sections[sections.length - 1].push(line);\n    }\n    return sections;\n  }, []);\n  const children = childrenSectionLines.map(sectionLines => <Section rawLines={sectionLines} level={level}/>);\n  return <> {children} </>;\n}\n\nconst Section: React.FC<PropTypes> = ({ rawLines, level = 0 }) => {\n  const deeperLevelIndex = rawLines.findIndex(line => line.match(`^#{${level + 1},} .*$`));\n  const rawContent = rawLines.splice(0, (deeperLevelIndex < 0) ? rawLines.length : deeperLevelIndex);\n\n  if (!level) return <ChildrenSections rawLines={rawLines} level={getHeaderLevel(rawLines[0])}/>;\n\n  const sectionName = rawContent.splice(0, 1)[0].slice(level).trim();\n  const deeperLevel = getHeaderLevel(rawLines[0]);\n  return (\n    <ContentSection sectionName={sectionName} level={level}>\n      <Content rawLines={rawContent} />\n      <ChildrenSections rawLines={rawLines} level={deeperLevel} />\n    </ContentSection>\n  );\n}\n\nexport default Section;\n\n","import React, { useState, useEffect } from 'react';\nimport axios from 'axios';\n\nimport Section from './Section';\n\ninterface PropTypes {\n  data?: string;\n  url?: string;\n}\n\nconst Markdown: React.FC<PropTypes> = ({ data, url }) => {\n  const [markdown, setMarkdown] = useState<string>(data || '');\n\n  useEffect(() => {\n    if (!url) setMarkdown(data || '');\n  }, [data, url]);\n\n  if (url) axios.get(url).then(response => setMarkdown(response.data));\n  return <Section rawLines={markdown.split('\\n')} />\n};\n\n\nexport default Markdown;\n\n","import React, { useState } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { makeStyles } from '@material-ui/core';\n\nimport {\n  Benzin,\n  Header,\n  Window,\n  Markdown,\n} from './lib';\n\nimport icon from './assets/icon.svg';\n\ninterface RenderPropTypes {\n  index: number;\n  style: React.CSSProperties;\n}\n\n\nconst useStyles = makeStyles(theme => ({\n  window: {\n    padding: theme.spacing(4),\n  }\n}));\n\n\nconst Icon = <img src={icon} width=\"32px\" height=\"37px\" alt=\"logo\"/>\n\nconst headerContents = {\n  home: null,\n  space: null,\n  'spacevim': null,\n  'emoji': null,\n  'material-ui': null,\n};\n\nconst pageMap: Record<string, string> = {\n  home: 'https://raw.githubusercontent.com/eug-vs/react-benzin/develop/README.md',\n  space: 'https://raw.githubusercontent.com/eug-vs/space/master/docs/environment.md',\n  'spacevim': 'https://raw.githubusercontent.com/spacevim/spacevim/master/README.md',\n  emoji: 'https://raw.githubusercontent.com/muan/emoji/gh-pages/README.md',\n  'material-ui': 'https://raw.githubusercontent.com/mui-org/material-ui/master/README.md',\n};\n\n\nconst App: React.FC = () => {\n  const classes = useStyles();\n  const [page, setPage] = useState('home');\n\n  const url = pageMap[page];\n  const fileName = url.slice(url.lastIndexOf('/') + 1);\n  const metadata = [\n    `## Markdown\\n [Markdown file](${url}) *(...${fileName})* that you can see on the left was parsed and processed by **BENZIN**! :rocket:`,\n    'Switch between tabs on the header to explore other markdown templates. :recycle: ',\n    'Currently **only core features** of markdown function.',\n    'Templates on the left are being loaded from the [GitHub](https://github.com), though this pane is generated from plaintext. :pen:',\n    '## How do I use this feature?',\n    '```',\n    'import Markdown from \\'react-benzin\\';',\n    'const data = \\'# Header\\\\nHello, *world!*\\';',\n    'ReactDOM.render(<Markdown data={data}/>, document.getElementById(\\'root\\'));',\n    '```',\n  ].join('\\n');\n\n  return (\n    <Benzin>\n      <Header\n        logo={{\n          icon: Icon,\n          title: 'BENZIN',\n        }}\n        contents={headerContents}\n        page={page}\n        setPage={setPage}\n      />\n      <Window type=\"primary\">\n        <div className={classes.window}>\n          <Markdown url={url} />\n        </div>\n      </Window>\n      <Window type=\"secondary\" name=\"Feature preview\">\n        <div className={classes.window}>\n          <Markdown data={metadata} />\n        </div>\n      </Window>\n    </Benzin>\n  );\n};\n\n\nReactDOM.render(<App />, document.getElementById('root'));\n\n"],"sourceRoot":""}