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qCAAqCA,UAE/CE,MAAAA,CAAOC,GACL,OAAgC,IAAzBA,EAAQC,MAAMtG,MACvB,GANFmG,CAOGI,EAAAA,E,wDCVE,MAAMlB,EAAyB,uwB,gDCEtC,MAAM,uBAAEmB,EAAsB,uBAAEC,GAA2BtE,OAAOuE,MAAMC,KAAO,CAAC,EAEhF,IAAIlD,EAAe,KAEnB,IACEA,EAAemD,IAAcJ,EAAwBC,EACvD,CAAE,MAAOI,GACPC,QAAQC,MAAMF,EAChB,CAEA,K,wDCRO,MAAMb,GAAmBgB,E,SAAAA,IAAkB,SAASC,GACzD,MAAM,kBAAEC,EAAiB,QAAEC,EAAO,YAAEC,EAAW,WAAEC,EAAU,OAAEC,EAAM,UAAEC,EAAS,aAAEC,GAC9EP,EAEI1C,EAAYiD,EAAajD,UAG/BA,EAAUvC,UAAUyF,OAAO,kBAA+B,IAAZN,GAE9C,MAAMO,EAAcR,EAAoB,EAClCS,EAAyB,IAAZR,EAAgB,EAAIA,EAGvC5C,EAAUqD,UAAY,8DACmCF,QAAkBC,sBACnED,OAAiBC,iEAGnBR,GAAW,EAAI,uCAAyC,gGAIpDC,EAAc,sCAAwC,wBAEhDG,EAAUL,EAAoB,8BACxBA,EAAoB,+SAShCG,EAAa,sCAAwC,wBAE/CE,EAAUL,EAAoB,8BACxBA,EAAoB,uOAW1C,IAAI3C,EAAUV,iBAAiB,MAAMC,SAAQ+D,IAC3CA,EAAQrG,iBAAiB,SAASC,IAChCA,EAAMqG,iBACNR,EAAO7F,EAAMsG,cAAcvE,QAAQwE,MAAM,GACzC,GAEN,G","sources":["webpack://pratt-main/../pratt/static/js/components/algolia/hit-helpers.js","webpack://pratt-main/../pratt/static/js/components/accordion.js","webpack://pratt-main/./static/js/components/algolia/course-search.js","webpack://pratt-main/../pratt/static/js/components/algolia/panel.js","webpack://pratt-main/../pratt/static/js/components/algolia/templates/refinement-list.js","webpack://pratt-main/../pratt/static/js/components/algolia/search-client.js","webpack://pratt-main/../pratt/static/js/components/algolia/pagination.js"],"sourcesContent":["export const MONTHS = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n];\n\nexport const TIME_ZONE = 'America/New_York';\n\nexport class HitHelpers {\n static getTypeDisplay(type) {\n switch (type) {\n case 'post':\n return 'News';\n case 'prattfolio-story':\n return 'Prattfolio Story';\n default:\n return type[0].toLocaleUpperCase() + type.slice(1);\n }\n }\n\n static Courses = {\n /* eslint-disable */\n sectionsAsHtml(hit) {\n // prettier-ignore\n return `\n \n `;\n },\n /* eslint-enable */\n };\n\n static Events = {\n /* eslint-disable */\n dateAsHTML(hit) {\n const start = new Date(\n new Date(hit.occurrences[0].start).toLocaleString('en-US', { timeZone: TIME_ZONE }),\n );\n // prettier-ignore\n return `\n \n `;\n },\n /* eslint-enable */\n\n time(hit, opts = {}) {\n if (!hit.occurrences.length) {\n return '';\n }\n\n const start = new Date(\n new Date(hit.occurrences[0].start).toLocaleString('en-US', { timeZone: TIME_ZONE }),\n );\n const end = new Date(\n new Date(hit.occurrences[0].end).toLocaleString('en-US', { timeZone: TIME_ZONE }),\n );\n\n const timeFormat = new Intl.DateTimeFormat('en-US', { timeStyle: 'short' });\n const dateFormat = new Intl.DateTimeFormat('en-US', {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n });\n const dateFormatNoYear = new Intl.DateTimeFormat('en-US', { month: 'long', day: 'numeric' });\n\n const isSameDay =\n start.getFullYear() === end.getFullYear() &&\n start.getMonth() === end.getMonth() &&\n start.getDate() === end.getDate();\n\n const isSameYear = start.getFullYear() === end.getFullYear();\n\n let time;\n if (hit.is_all_day) {\n if (isSameDay) {\n time = 'All Day';\n if (opts.includeDay) {\n time = dateFormat.format(start);\n }\n } else {\n if (isSameYear) {\n time = `${dateFormatNoYear.format(start)} – ${dateFormat.format(\n end,\n )} All Day`;\n } else {\n time = `${dateFormat.format(start)} – ${dateFormat.format(\n end,\n )} All Day`;\n }\n }\n } else {\n if (isSameDay) {\n time = `${timeFormat.format(start)} – ${timeFormat.format(end)}`;\n if (opts.includeDay) {\n time = `${dateFormat.format(start)} ${time}`;\n }\n } else {\n let startDateDay = `${dateFormat.format(start)}`;\n if (isSameYear) {\n startDateDay = `${dateFormatNoYear.format(start)}`;\n }\n const endDateDay = `${dateFormat.format(end)}`;\n const startDateTime = `${timeFormat.format(start)}`;\n const endDateTime = `${timeFormat.format(end)}`;\n time = `${startDateDay} – ${endDateDay} ${startDateTime} – ${endDateTime}`;\n }\n }\n\n return time;\n },\n\n location(hit) {\n if (hit.event_type === 'hybrid') {\n return `Online and ${hit.location}`;\n } else if (hit.event_type === 'physical') {\n return hit.location;\n } else {\n return 'Online Event';\n }\n },\n };\n}\n","class Accordion {\n constructor(trigger) {\n this.triggerEl = trigger;\n this.initialize();\n }\n\n initialize() {\n this.triggerEl.addEventListener('click', event => {\n if (event.target.nodeName !== 'A') {\n const status = this.checkStatus(this.triggerEl);\n if (status === 'false') {\n this.openAccordion(this.triggerEl);\n } else if (status === 'true') {\n this.closeAccordion(this.triggerEl);\n }\n }\n });\n\n this.triggerEl.addEventListener('mouseover', event => {\n if (event.target.nodeName === 'A') {\n this.triggerEl.classList.add('reset-chevron');\n } else {\n this.triggerEl.classList.remove('reset-chevron');\n }\n });\n\n // Accordions with the false aria attribute should be closed on first paint\n if (this.checkStatus(this.triggerEl) === 'false') {\n this.closeAccordion(this.triggerEl);\n }\n\n // Check if there's a hash in the URL\n if (window.location.hash) {\n // Compare URL hash if present to current trigger.\n let hash = window.location.hash.replace('#', '');\n hash = `${hash}-content`;\n const contentId = this.triggerEl.getAttribute('data-collapsible');\n if (hash === contentId) {\n this.triggerEl.click();\n const offset = this.triggerEl.offsetTop;\n window.scrollTo({\n top: offset,\n behavior: 'smooth',\n });\n return false; // disable defuault browser anchor jump\n }\n }\n }\n\n checkStatus(triggerEl) {\n const status = triggerEl.getAttribute('aria-expanded');\n return status;\n }\n\n openAccordion(triggerEl) {\n const contentId = triggerEl.getAttribute('data-collapsible');\n const contentEl = document.getElementById(contentId);\n triggerEl.setAttribute('aria-expanded', 'true');\n contentEl.setAttribute('aria-hidden', 'false');\n }\n\n closeAccordion(triggerEl) {\n const contentId = triggerEl.getAttribute('data-collapsible');\n const contentEl = document.getElementById(contentId);\n triggerEl.setAttribute('aria-expanded', 'false');\n contentEl.setAttribute('aria-hidden', 'true');\n }\n}\n\nexport default Accordion;\n","import instantsearch from 'instantsearch.js';\nimport { configure, searchBox, clearRefinements, hits } from 'instantsearch.js/es/widgets';\nimport searchClient from '@pratt/js/components/algolia/search-client';\nimport { HitHelpers } from '@pratt/js/components/algolia/hit-helpers';\nimport { customPagination } from '@pratt/js/components/algolia/pagination';\nimport { refinementListWithPanel } from '@pratt/js/components/algolia/panel';\nimport Accordion from '@pratt/js/components/accordion';\nimport { refinementListTemplate } from '@pratt/js/components/algolia/templates/refinement-list';\n\nclass CourseSearch {\n constructor(rootEl) {\n this.rootEl = rootEl;\n if (!this.rootEl) {\n throw new Error('Root course search element not found.');\n }\n\n this.hitsPerPage = 24;\n\n this.search = instantsearch({\n indexName: this.rootEl.dataset['algoliaIndex'],\n searchClient: searchClient,\n routing: true,\n insights: true,\n });\n\n this.search.on('render', function() {\n document.querySelectorAll('.js-accordion-trigger').forEach(trigger => new Accordion(trigger));\n });\n this.init();\n this.search.start();\n }\n\n init() {\n this.search.addWidgets([\n // https://www.algolia.com/doc/api-reference/widgets/configure/js/\n // Parameter options: https://www.algolia.com/doc/api-reference/search-api-parameters/\n configure({\n hitsPerPage: this.hitsPerPage,\n distinct: true,\n // Force faceting to be applied after de-duplication (via the Distinct setting)\n facetingAfterDistinct: true,\n // Filter results by 'type' facet\n // https://www.algolia.com/doc/api-reference/api-parameters/filters/#facet-filters\n filters: `type:\"course\"`,\n }),\n\n searchBox({\n container: '.js-course-search-input',\n placeholder: 'Search Courses',\n showSubmit: false,\n }),\n\n clearRefinements({\n container: '.js-course-search-clear',\n templates: {\n resetLabel: 'Reset',\n },\n }),\n\n refinementListWithPanel('School')({\n container: '.js-course-search-schools-input',\n attribute: 'schools',\n operator: 'and',\n limit: 10,\n showMore: true,\n showMoreLimit: 100,\n sortBy: ['name:asc'],\n templates: {\n item: refinementListTemplate,\n },\n }),\n\n refinementListWithPanel('Department')({\n container: '.js-course-search-departments-input',\n attribute: 'departments',\n operator: 'and',\n limit: 10,\n showMore: true,\n showMoreLimit: 100,\n sortBy: ['name:asc'],\n templates: {\n item: refinementListTemplate,\n },\n }),\n\n // https://www.algolia.com/doc/api-reference/widgets/hits/js/\n hits({\n container: '.js-course-search-hits',\n templates: {\n /* eslint-disable */\n item(hit) {\n // prettier-ignore\n return `\n
\n

\n \n

\n\n
\n ${hit.description ? `\n
${hit.description}
\n ` : ''}\n ${HitHelpers.Courses.sectionsAsHtml(hit)}\n \n
\n
\n `;\n },\n /* eslint-enable */\n },\n }),\n\n customPagination({\n container: document.querySelector('.js-course-search-pagination'),\n }),\n ]);\n }\n}\n\nexport default CourseSearch;\n","import { refinementList, panel } from 'instantsearch.js/es/widgets';\n\nexport const refinementListWithPanel = header =>\n panel({\n templates: {\n header: `

${header}

`,\n },\n hidden(options) {\n return options.items.length === 0;\n },\n })(refinementList);\n","export const refinementListTemplate = `\n \n`;\n","import algoliasearch from 'algoliasearch/lite';\n\nconst { ALGOLIA_APPLICATION_ID, ALGOLIA_SEARCH_API_KEY } = window.pratt.env || {};\n\nlet searchClient = null;\n\ntry {\n searchClient = algoliasearch(ALGOLIA_APPLICATION_ID, ALGOLIA_SEARCH_API_KEY);\n} catch (e) {\n console.error(e);\n}\n\nexport default searchClient;\n","import { connectPagination } from 'instantsearch.js/es/connectors';\n\n// Render custom pagination widget\n// https://www.algolia.com/doc/api-reference/widgets/pagination/js/#connector\nexport const customPagination = connectPagination(function(renderOptions) {\n const { currentRefinement, nbPages, isFirstPage, isLastPage, refine, createURL, widgetParams } =\n renderOptions;\n\n const container = widgetParams.container;\n\n // Hide pagination if no results\n container.classList.toggle('visually-hidden', nbPages === 0);\n\n const currentPage = currentRefinement + 1;\n const totalPages = nbPages === 0 ? 1 : nbPages;\n\n /* eslint-disable */\n container.innerHTML = `\n
\n ${currentPage} / ${totalPages}\n
\n
\n \n Previous page\n \n \n \n \n \n Next page\n \n \n \n \n
\n `;\n /* eslint-enable */\n\n [...container.querySelectorAll('a')].forEach(element => {\n element.addEventListener('click', event => {\n event.preventDefault();\n refine(event.currentTarget.dataset.value);\n });\n });\n});\n"],"names":["MONTHS","TIME_ZONE","HitHelpers","getTypeDisplay","type","toLocaleUpperCase","slice","static","sectionsAsHtml","hit","sections","map","section","days","join","start_time","end_time","location","loc","name","dateAsHTML","start","Date","occurrences","toLocaleString","timeZone","getMonth","getDate","time","opts","length","end","timeFormat","Intl","DateTimeFormat","timeStyle","dateFormat","year","month","day","dateFormatNoYear","isSameDay","getFullYear","isSameYear","is_all_day","includeDay","format","startDateDay","event_type","constructor","trigger","this","triggerEl","initialize","addEventListener","event","target","nodeName","status","checkStatus","openAccordion","closeAccordion","classList","add","remove","window","hash","replace","getAttribute","click","offset","offsetTop","scrollTo","top","behavior","contentId","contentEl","document","getElementById","setAttribute","rootEl","Error","hitsPerPage","search","instantsearch","indexName","dataset","searchClient","routing","insights","on","querySelectorAll","forEach","Accordion","init","addWidgets","configure","distinct","facetingAfterDistinct","filters","searchBox","container","placeholder","showSubmit","clearRefinements","templates","resetLabel","refinementListWithPanel","attribute","operator","limit","showMore","showMoreLimit","sortBy","item","refinementListTemplate","hits","objectID","__queryID","__position","code","title","credits","description","Courses","url","customPagination","querySelector","header","panel","hidden","options","items","refinementList","ALGOLIA_APPLICATION_ID","ALGOLIA_SEARCH_API_KEY","pratt","env","algoliasearch","e","console","error","connectPagination","renderOptions","currentRefinement","nbPages","isFirstPage","isLastPage","refine","createURL","widgetParams","toggle","currentPage","totalPages","innerHTML","element","preventDefault","currentTarget","value"],"sourceRoot":""}