{"version":3,"sources":["webpack:///./src/components/modules/Resident.js","webpack:///./src/components/modules/TechnicalReport.js","webpack:///./src/pages/projects.js","webpack:///./src/components/modules/BlockImageText.js"],"names":["Resident","data","className","onClick","e","currentTarget","parentElement","classList","toggle","title","date","formatDate","Date","imageTextBlock","map","block","index","key","__typename","classnames","twoColumn","richText","description","json","textLeft","textRight","text","image","Image","TechnicalReport","author","published","abstract","displayImage","fluid","href","linkUrl","pdf","file","url","target","rel","mt3","Projects","projectsPage","allContentfulProjects","nodes","slice","introDescription","residents","technicalReports","useState","residentsSorted","setResidentsSorted","residentsIndex","setResidentsIndex","reportsIndex","setReportsIndex","useEffect","sort","a","b","Layout","pageTitle","BlockRichText","BlockTextText","BlockImageText","resident","length","report","BlockLinksList","isNavList","setTextToLeft"],"mappings":"uLAmGeA,EA9FE,SAAC,GAAc,IAAZC,EAAW,EAAXA,KAOlB,OACE,wBAAIC,UAAU,iDACZ,4BACEA,UAAU,6FACVC,QATkB,SAAAC,GACNA,EAAEC,cAAcC,cACtBC,UAAUC,OAAO,yBASvB,yBAAKN,UAAU,kBAAkBD,EAAKQ,OACtC,yBAAKP,UAAU,QACZD,EAAKS,MACJ,yBAAKR,UAAU,sBACZS,YAAW,IAAIC,KAAKX,EAAKS,QAG9B,yBAAKR,UAAU,sDACb,0BAAMA,UAAU,OAChB,0BAAMA,UAAU,UAItB,yBAAKA,UAAU,6CACZD,EAAKY,eAAeC,KAAI,SAACC,EAAOC,GAC/B,OACE,yBAAKC,IAAKD,GACc,4BAArBD,EAAMG,YACL,yBACEhB,UAAWiB,IAAW,wBAAyB,CAC7C,aAAwB,IAAVH,KAGhB,uBAAGd,UAAU,OAAOa,EAAMN,OAC1B,yBAAKP,UAAU,8CACb,yBACEA,UAAWiB,IAAW,kBAAmB,CACvC,wBAAyBJ,EAAMK,UAC/B,iCAAkCL,EAAMK,aAGzCC,YAASN,EAAMO,YAAYC,SAKd,4BAArBR,EAAMG,YACL,yBACEhB,UAAWiB,IAAW,w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,EAAGS,GAAc1C,KAAI,SAACuD,EAAQrD,GACpD,OACE,kBAAC,EAAD,CACEC,IAAKD,EACLf,KAAMoE,EACNnE,UAAWiB,IAAW,CACpB,SAAoB,IAAVH,UAMnBkC,EAAiBkB,OAASZ,GACzB,6BAAStD,UAAU,MACjB,4BACEA,UAAU,4BACVC,QAAS,WACPsD,EAAgBD,EApEA,KAiEpB,0BAYN,kBAACc,EAAA,EAAD,CAAgBC,WAAW,EAAMrE,UAAU,W,kCCtGnD,sEAuCegE,IAlCQ,SAAC,GAA8B,IAA5BjE,EAA2B,EAA3BA,KAA2B,IAArBC,iBAAqB,MAAT,GAAS,EACnD,OACE,6BAASA,UAAS,4BAA8BA,GAC9C,wBAAIA,UAAU,gDACXD,EAAKQ,OAER,yBACEP,UAAWiB,IAAW,+BAAgC,CACpD,0CAA2ClB,EAAKuE,iBAGlD,yBACEtE,UAAWiB,IAAW,6CAA8C,CAClE,aAAclB,EAAKuE,iBAGpBvE,EAAK0B,OACJ,gCACE,kBAAC,IAAD,CAAOA,MAAO1B,EAAK0B,UAIzB,yBACEzB,UAAWiB,IAAW,6CAA8C,CAClE,cAAelB,EAAKuE,iBAGrBnD,YAASpB,EAAKyB,KAAKH","file":"component---src-pages-projects-js-98b82fc1aa54be32b79e.js","sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport { formatDate, richText } from 'components/utils/helpers';\nimport Image from 'components/base/Image';\n\nconst Resident = ({ data }) => {\n // Accordion toggler\n const toggleAccordion = e => {\n let accordion = e.currentTarget.parentElement;\n accordion.classList.toggle('Accordion--collapse');\n };\n\n return (\n
  • \n \n
    {data.title}
    \n
    \n {data.date && (\n
    \n {formatDate(new Date(data.date))}\n
    \n )}\n
    \n \n \n
    \n
    \n \n
    \n {data.imageTextBlock.map((block, index) => {\n return (\n
    \n {block.__typename === 'ContentfulBlockRichText' && (\n \n

    {block.title}

    \n
    \n \n {richText(block.description.json)}\n
    \n
    \n
    \n )}\n {block.__typename === 'ContentfulBlockTextText' && (\n \n

    {block.title}

    \n
    \n
    \n {richText(block.textLeft.json)}\n
    \n
    \n {richText(block.textRight.json)}\n
    \n
    \n \n )}\n {block.__typename === 'ContentfulBlockImageText' && (\n \n
    \n

    {block.title}

    \n {richText(block.text.json)}\n
    \n {block.image && (\n
    \n \n
    \n )}\n \n )}\n \n );\n })}\n \n
  • \n );\n};\n\nexport default Resident;\n","import React from 'react';\nimport { formatDate } from 'components/utils/helpers';\nimport classnames from 'classnames';\nimport Image from 'components/base/Image';\n\nconst TechnicalReport = ({ data, className = '' }) => {\n return (\n
  • \n
    \n
    \n
    \n
    Author:
    \n
    {data.author}
    \n
    \n
    \n
    Title:
    \n
    {data.title}
    \n
    \n
    \n
    Published:
    \n
    \n {formatDate(new Date(data.published))}\n
    \n
    \n
    \n
    Abstract:
    \n
    \n

    {data.abstract.abstract}

    \n
    \n
    \n
    \n
    \n
    \n {data.displayImage && data.displayImage.fluid && (\n
    \n \n
    \n )}\n \n Download\n \n
    \n
    \n
    \n
  • \n );\n};\n\nexport default TechnicalReport;\n","import React, { useState, useEffect } from 'react';\nimport { graphql } from 'gatsby';\nimport Layout from 'components/Layout';\nimport classnames from 'classnames';\nimport Resident from 'components/modules/Resident';\nimport TechnicalReport from 'components/modules/TechnicalReport';\nimport BlockRichText from 'components/modules/BlockRichText';\nimport BlockTextText from 'components/modules/BlockTextText';\nimport BlockImageText from 'components/modules/BlockImageText';\nimport BlockLinksList from 'components/modules/BlockLinksList';\n\nconst Projects = ({ data }) => {\n //get the last item in the nodes - this is in case they have a draft version\n //of a new projects page\n const projectsPage = data.allContentfulProjects.nodes.slice(-1)[0];\n const { introDescription, residents, technicalReports } = projectsPage;\n\n // State for residents, sorted by date\n const [residentsSorted, setResidentsSorted] = useState([]);\n\n // State for number of residents to show\n const [residentsIndex, setResidentsIndex] = useState(5);\n const residentsIndexIncrementer = 5;\n // State for number of reports to show\n const [reportsIndex, setReportsIndex] = useState(5);\n const reportsIndexIncrementer = 5;\n\n // Set the residents in order by date\n useEffect(() => {\n setResidentsSorted(\n residents.sort((a, b) => new Date(b.date) - new Date(a.date))\n );\n }, [residents, setResidentsSorted]);\n\n return (\n \n
    \n {/* an intro description block */}\n {introDescription && (\n <>\n {introDescription.__typename === 'ContentfulBlockRichText' && (\n \n )}\n {introDescription.__typename === 'ContentfulBlockTextText' && (\n \n )}\n {introDescription.__typename === 'ContentfulBlockImageText' && (\n \n )}\n \n )}\n {/* Residents list block */}\n
    \n

    Residents

    \n
      \n {residentsSorted.slice(0, residentsIndex).map((resident, index) => {\n return ;\n })}\n
    \n {residentsSorted.length > residentsIndex && (\n
    \n {\n setResidentsIndex(residentsIndex + residentsIndexIncrementer);\n }}\n >\n Show more residents...\n \n
    \n )}\n
    \n {/* Technical reports block */}\n
    \n

    MAL Technical Reports

    \n
      \n {technicalReports.slice(0, reportsIndex).map((report, index) => {\n return (\n \n );\n })}\n
    \n {technicalReports.length > reportsIndex && (\n
    \n {\n setReportsIndex(reportsIndex + reportsIndexIncrementer);\n }}\n >\n Show more reports...\n \n
    \n )}\n
    \n {/* Links list block */}\n \n
    \n
    \n );\n};\n\nexport default Projects;\n\nexport const query = graphql`\n query projectsPage {\n allContentfulProjects {\n nodes {\n title\n introDescription {\n __typename\n title\n ... on Node {\n ... on ContentfulBlockRichText {\n description {\n json\n }\n twoColumn\n }\n ... on ContentfulBlockTextText {\n textLeft {\n json\n }\n textRight {\n json\n }\n }\n ... on ContentfulBlockImageText {\n image {\n description\n fluid(maxWidth: 600) {\n ...GatsbyContentfulFluid_withWebp\n }\n }\n text {\n json\n }\n setTextToLeft\n }\n }\n }\n residents {\n ... on Node {\n ... on ContentfulBlockResident {\n title\n date\n imageTextBlock {\n __typename\n ... on Node {\n ... on ContentfulBlockImageText {\n title\n image {\n description\n fluid(maxWidth: 600) {\n ...GatsbyContentfulFluid_withWebp\n }\n }\n setTextToLeft\n text {\n json\n }\n }\n ... on ContentfulBlockTextText {\n title\n textLeft {\n json\n }\n textRight {\n json\n }\n }\n ... on ContentfulBlockRichText {\n title\n description {\n json\n }\n twoColumn\n }\n }\n }\n }\n }\n }\n technicalReports {\n ... on Node {\n ... on ContentfulBlockTechnicalReport {\n author\n title\n published\n abstract {\n abstract\n }\n displayImage {\n description\n fluid(maxWidth: 600) {\n ...GatsbyContentfulFluid_withWebp\n }\n }\n pdf {\n file {\n url\n fileName\n }\n }\n linkUrl\n }\n }\n }\n }\n }\n }\n`;\n","import React from 'react';\nimport { richText } from 'components/utils/helpers';\nimport classnames from 'classnames';\nimport Image from 'components/base/Image';\n\nconst BlockImageText = ({ data, className = '' }) => {\n return (\n
    \n

    \n {data.title}\n

    \n \n \n {data.image && (\n
    \n \n
    \n )}\n \n \n {richText(data.text.json)}\n \n \n
    \n );\n};\n\nexport default BlockImageText;\n"],"sourceRoot":""}