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AU,CAAC,SAAU,UACrBA,UAAU,CAAC,UAAW,UAG3B,uECvBO,SAASnD,EAAiBJ,CAAyB,SACxD,EAEOyD,SAWAA,EACPC,CAAwB,MACxBC,EAAAA,UAAAA,MAAAA,CAAAA,GAAAA,KAAAA,IAAAA,SAAAA,CAAAA,EAAAA,CAAAA,SAAAA,CAAAA,EAAAA,CAAe,UAEf,CAAKD,MAAAA,EAAAA,KAAAA,EAAAA,EAAUpF,OAAO,EAyEfoF,EAAoBpF,OAAO,CAACsF,MAAM,CACvC,CAACC,EAAaC,EAAYC,KACxB,IAAIC,EAAgB,GAEpB,GAAIC,EAAAA,OAAOA,CAACC,MAAM,CAACJ,GACjBE,EAAgBF,EAAKnF,KAAK,MACrB,GAAIsF,CAAAA,EAAAA,OAAOA,CAACE,OAAO,CAACL,IAASG,EAAAA,OAAOA,CAACG,QAAQ,CAACN,EAAAA,GAE/C,CAACE,CADLA,EAAgBP,EAA0BK,EAAMH,EAAAA,EAC7BnC,MAAM,CACvB,OAAOqC,EAIX,IAAMQ,EAAWX,EAASpF,OAAO,CAACyF,EAAI,EAAE,CAGxC,OAAOF,EAAMG,EADGM,CAAAA,GADoBL,EAAAA,OAAOA,CAACE,OAAO,CAACE,GAClBV,EAAe,GAEnD,EACA,IAnFO,EAqFX,EA5GmC3D,GAFX,EAGxB","sources":["webpack://_N_E/../design-system/src/components/primitives/head/head.tsx","webpack://_N_E/./src/contentful/components/primitives/head-title-description.ts","webpack://_N_E/./src/contentful/components/primitives/head.contentful.tsx","webpack://_N_E/./src/contentful/components/utils/strip-html.ts","webpack://_N_E/./src/contentful/lib/document-to-string.ts","webpack://_N_E/"],"sourcesContent":["import { ReactNode } from \"react\";\nimport { MediaAssetImageProps } from \"../media-asset/media-asset-image\";\nimport { cloudinary } from \"design-system/utils/cloudinary\";\nimport { useStoreSelector } from \"design-system/store/store\";\nimport { DataLayerEventData } from \"frontend/hooks/use-data-layer\";\n\nexport type ArticleStructuredData = Partial<{\n name: string;\n author: string;\n datePublished: string;\n image: string;\n articleSection: string;\n articleBody: string;\n url: string;\n}>;\n\nexport type EventStructuredData = Partial<{\n name: string;\n startDate: string;\n endDate?: string;\n eventAttendanceMode?: string;\n eventStatus?: string;\n location: Array;\n image?: string;\n description?: string;\n offers?: object;\n performer?: object;\n organizer?: object;\n}>;\n\nexport interface HeadProps {\n gtagId?: string;\n title?: string;\n description?: string;\n canonicalUrl?: string;\n type?: string;\n siteName?: string;\n image?: MediaAssetImageProps;\n twitterCard?: \"summary\" | \"summary_large_image\" | \"app\" | \"player\";\n twitterCreator?: string;\n twitterSite?: string;\n metaOverride?: Record;\n children?: ReactNode;\n openGraphDescription?: string;\n noIndex?: boolean;\n noFollow?: boolean;\n convertId?: string;\n pageLoadEventData?: DataLayerEventData;\n articleStructuredData?: ArticleStructuredData;\n eventStructuredData?: EventStructuredData;\n}\n\nexport function Head({\n gtagId,\n title = \"Harvard Business School\",\n description = \"Harvard Business School\",\n siteName = \"Harvard Business School\",\n canonicalUrl,\n type = \"website\",\n image,\n twitterCard = \"summary\",\n twitterCreator = \"@HarvardHBS\",\n twitterSite = \"@HarvardHBS\",\n metaOverride,\n children,\n openGraphDescription,\n noFollow,\n noIndex,\n convertId,\n pageLoadEventData,\n articleStructuredData,\n eventStructuredData,\n}: HeadProps) {\n const Container = useStoreSelector((store) => store.framework.Head);\n const imageSrc = cloudinary(image?.src);\n\n const meta = {\n \"og:title\": title,\n \"og:description\": openGraphDescription ?? description,\n \"og:url\": canonicalUrl,\n \"og:type\": type,\n \"og:site_name\": siteName,\n \"og:image\": imageSrc,\n \"og:image:width\": image?.width,\n \"og:image:height\": image?.height,\n \"og:image:alt\": image?.alt,\n \"twitter:title\": title,\n \"twitter:description\": description,\n \"twitter:card\": twitterCard,\n \"twitter:creator\": twitterCreator,\n \"twitter:site\": twitterSite,\n \"twitter:image\": imageSrc,\n \"twitter:image:alt\": image?.alt,\n ...metaOverride,\n };\n\n return (\n \n \n {noIndex && }\n {noFollow && (\n \n )}\n {title}\n {description ? : null}\n {Object.entries(meta).map(\n ([property, value]) =>\n value && ,\n )}\n {canonicalUrl && }\n {convertId && (\n \n )}\n {/* https://developers.google.com/search/docs/appearance/structured-data/article */}\n {articleStructuredData && (\n \n )}\n {/* https://developers.google.com/search/docs/appearance/structured-data/event */}\n {eventStructuredData && (\n \n )}\n\n {/* https://github.com/harvard-hbs/analytics-contentful-cms-data-layers/blob/2a2c659dd844557f1d42dc7ad162dc06ac49bca9/global/Page%20Load.md */}\n {pageLoadEventData && (\n \n )}\n\n {/* https://developers.google.com/tag-platform/tag-manager/datalayer#installation */}\n {gtagId && (\n \n )}\n {children}\n \n );\n}\n","import { documentToString } from \"frontend/contentful/lib/document-to-string\";\nimport { isContentType } from \"frontend/contentful/lib/is-content-type\";\nimport {\n CtaBannerEntry,\n RichTextEntry,\n SectionIntroTextEntry,\n} from \"frontend/contentful/schema/blocks\";\nimport {\n ParticipantStoryEntry,\n ProfilePageEntry,\n} from \"frontend/contentful/schema/pages\";\nimport { TimelineEventEntry } from \"frontend/contentful/schema/primitives\";\nimport {\n PersonEntry,\n SchoolLeadershipPersonDetailsEntry,\n} from \"frontend/contentful/schema/semantics\";\nimport {\n ContentfulEntry,\n ContentfulRichText,\n EntryRef,\n} from \"frontend/contentful/schema/sys\";\nimport { useContentful } from \"frontend/hooks/use-contentful\";\nimport { usePageProps } from \"frontend/hooks/use-page-props\";\nimport { stripHtml } from \"../utils/strip-html\";\n\nconst DESCRIPTION_MAX_LENGTH = 160;\n\nfunction documentToDescription(document?: ContentfulRichText) {\n if (\n document &&\n typeof document === \"object\" &&\n Array.isArray(document.content)\n ) {\n return stripHtml(documentToString(document).replace(/\\s\\s+/g, \" \"));\n }\n return \"\";\n}\n\ninterface UseHeadFallbackValuesProps {\n title: string;\n description: string;\n}\n\nexport function useHeadTitleDescription({\n title,\n description,\n}: UseHeadFallbackValuesProps) {\n const { entry: pageEntryRef } = usePageProps();\n const { getEntry, site } = useContentful();\n\n const pageEntry = getEntry(pageEntryRef);\n\n if (!title || !description) {\n // extract a default title from the topper title\n if (pageEntry?.fields) {\n if (\"topper\" in pageEntry.fields) {\n if (\n pageEntry.fields.topper &&\n typeof pageEntry.fields.topper === \"object\"\n ) {\n const topper = getEntry(\n pageEntry.fields.topper as EntryRef,\n );\n\n if (topper) {\n if (!title) {\n if (\n \"title\" in topper.fields &&\n typeof topper.fields.title === \"string\"\n ) {\n title = topper.fields.title;\n }\n }\n\n if (!description) {\n if (\"subtitle\" in topper.fields && topper.fields.subtitle) {\n if (typeof topper.fields.subtitle === \"string\") {\n description = topper.fields.subtitle;\n } else if (typeof topper.fields.subtitle === \"object\") {\n description = documentToDescription(\n topper.fields.subtitle as ContentfulRichText,\n );\n }\n }\n }\n }\n }\n }\n // if no topper title, use page title\n if (!title && pageEntry.fields.title) {\n title = pageEntry.fields.title;\n }\n if (\n !title &&\n isContentType(\"participantStory\", pageEntry)\n ) {\n if (pageEntry.fields.subTitle) title = pageEntry.fields.subTitle;\n }\n // if no topper description, pull out of body content - require a description longer than 30 characters\n if (!description || description.length < 30) {\n // account for profile pages separately\n if (isContentType(\"profilePage\", pageEntry)) {\n if (pageEntry.fields.profile) {\n const entry = getEntry(pageEntry.fields.profile);\n\n if (\n isContentType(\"person\", entry) &&\n entry.fields.bio\n ) {\n description = documentToDescription(entry.fields.bio);\n }\n if (\n isContentType(\n \"schoolLeadershipPersonDetails\",\n entry,\n )\n ) {\n const person = getEntry(entry.fields.person);\n if (person?.fields.bio) {\n description = documentToDescription(person.fields.bio);\n }\n }\n }\n } else {\n let content: Array = [];\n // body is used for article page\n if (\n \"body\" in pageEntry.fields &&\n Array.isArray(pageEntry.fields.body)\n ) {\n content = pageEntry.fields.body as Array;\n }\n // blocks is used for every other page type\n if (\n \"blocks\" in pageEntry.fields &&\n Array.isArray(pageEntry.fields.blocks)\n ) {\n content = pageEntry.fields.blocks as Array;\n }\n\n // break after first find\n for (const block of content) {\n const entry = getEntry(block);\n // set description to first DESCRIPTION_MAX_LENGTH characters of specific blocks\n if (\n isContentType(\"richText\", entry) &&\n entry.fields.text\n ) {\n description = documentToDescription(entry.fields.text);\n break;\n }\n if (\n isContentType(\"ctaBanner\", entry) &&\n entry.fields.subtitle\n ) {\n description = documentToDescription(entry.fields.subtitle);\n break;\n }\n if (\n isContentType(\"sectionIntroText\", entry)\n ) {\n if (entry.fields.intro) {\n description = documentToDescription(entry.fields.intro);\n break;\n } else if (entry.fields.bodyText) {\n description = documentToDescription(entry.fields.bodyText);\n break;\n }\n }\n if (isContentType(\"timelineEvent\", entry)) {\n if (entry.fields.title) {\n description = documentToDescription(entry.fields.title);\n break;\n }\n if (entry.fields.description) {\n description = documentToDescription(entry.fields.description);\n break;\n }\n }\n }\n }\n }\n }\n\n if (site?.fields.title) {\n if (title && site.fields.title !== title) {\n // append the site to the end of the title\n title = title + \" | \" + site.fields.title;\n } else {\n // default to the site name for a page title\n title = site.fields.title + \" | \" + \"Harvard Business School\";\n }\n }\n }\n\n if (!title) title = \"Harvard Business School\";\n if (!description) description = title;\n\n description = description.substring(0, DESCRIPTION_MAX_LENGTH);\n\n return { title, description };\n}\n","import type { SeoEntry } from \"frontend/contentful/schema/semantics\";\nimport { Head, HeadProps } from \"design-system/components/primitives/head/head\";\nimport { createMediaAssetProps } from \"./media-asset.props\";\nimport { useContentful } from \"frontend/hooks/use-contentful\";\nimport { EntryRef } from \"frontend/contentful/schema/sys\";\nimport { usePageProps } from \"frontend/hooks/use-page-props\";\nimport { GOOGLE_TAG_IDS } from \"frontend/lib/constants\";\nimport { useHeadTitleDescription } from \"./head-title-description\";\nimport { DataLayerEventData } from \"frontend/hooks/use-data-layer\";\n\ninterface ContentfulHeadProps extends HeadProps {\n entry?: EntryRef;\n}\n\nexport function ContentfulHead({ entry, ...props }: ContentfulHeadProps) {\n const { request } = usePageProps();\n const { getEntry, site, isEditorMode, isPageLoaded } = useContentful();\n\n entry = getEntry(entry);\n\n const { title, description } = useHeadTitleDescription({\n title: props.title ?? entry?.fields.title ?? \"\",\n description: props.description ?? entry?.fields.description ?? \"\",\n });\n\n const openGraphMedia = getEntry(entry?.fields?.openGraphMedia);\n const mediaProps = createMediaAssetProps(openGraphMedia);\n\n let canonicalUrl = entry?.fields.canonicalUrl;\n if (!canonicalUrl) canonicalUrl = `https://${request.host}${request.path}`;\n\n let gtagId: string | undefined = GOOGLE_TAG_IDS.DEFAULT;\n if (site?.fields.domain === \"exed\") gtagId = GOOGLE_TAG_IDS.EXED;\n if (site?.fields.domain === \"online\") gtagId = GOOGLE_TAG_IDS.ONLINE;\n if (site?.fields.domain === \"my\") {\n gtagId = GOOGLE_TAG_IDS.MY;\n }\n\n const pageLoadEventData: DataLayerEventData = { ...props.pageLoadEventData };\n\n if (site?.fields.slug) {\n pageLoadEventData.profile_code =\n site.fields.slug === \"/\" ? site.fields.domain : site.fields.slug;\n }\n\n if (request.query.gtag) {\n if (request.query.gtag === \"false\") gtagId = undefined;\n else gtagId = request.query.gtag;\n }\n // ?gtag=false should remove gtag script - also disable in editor mode\n if (!isPageLoaded || isEditorMode) gtagId = undefined;\n\n return (\n \n );\n}\n","const remove = [/<[^>]*>?/gm, /\\u00AD/g, \"<\", \">\"] as const;\n\nconst replace = [[\""\", '\"', \"'\", \"'\", \"&\", \"&\"]] as const;\n\nexport function stripHtml(html: string): string {\n let result = html;\n\n // Protect the mark tags returned from highlighted search results\n result = result\n .replaceAll(\"\", \"[mark]\")\n .replaceAll(\"\", \"[/mark]\");\n\n for (const rm of remove) {\n result = result.replaceAll(rm, \"\");\n }\n for (const [key, value] of replace) {\n result = result.replaceAll(key, value);\n }\n\n // Return the mark tags to original state\n result = result\n .replaceAll(\"[mark]\", \"\")\n .replaceAll(\"[/mark]\", \"\");\n\n return result;\n}\n","import { Block, Node, Inline, helpers } from \"@contentful/rich-text-types\";\n\nexport function documentToString(document?: Block | Inline): string {\n if (!document) return \"\";\n\n return documentToPlainTextString(document);\n}\n\n// taken from https://github.com/contentful/rich-text/blob/master/packages/rich-text-plain-text-renderer/src/index.ts\n\n/**\n * Returns the text value of a rich text document.\n *\n * NB: This can be applied to non text node of a structured text document,\n * hence the flexible typing.\n */\nfunction documentToPlainTextString(\n rootNode: Block | Inline,\n blockDivisor = \" \",\n): string {\n if (!rootNode?.content) {\n /**\n * Handles edge cases, such as when the value is not set in the CMA or the\n * field has not been properly validated, e.g. because of a user extension.\n * Note that we are nevertheless strictly type-casting `rootNode` as\n * Block | Inline. Valid rich text documents (and their branch block nodes)\n * should never lack a Node[] `content` property.\n */\n return \"\";\n }\n /**\n * Algorithm notes: We only want to apply spacing when a node is part of a\n * sequence. This is tricky because nodes can often be deeply nested within\n * non-semantic content arrays. For example, to get the text value of an\n * unordered list, we have to traverse like so:\n *\n * {\n * nodeType: BLOCKS.UL_LIST,\n * data: {},\n * content: [\n * {\n * nodeType: BLOCKS.LIST_ITEM,\n * data: {},\n * content: [{\n * nodeType: BLOCKS.PARAGRAPH,\n * data: {},\n * content: [\n * { nodeType: 'text', data: {}, value: 'List ', marks: [] },\n * { nodeType: 'text', data: {}, value: 'item', marks: [{ type: 'bold' }] }\n * ]\n * }]\n * },\n * {\n * nodeType: BLOCKS.LIST_ITEM,\n * data: {},\n * content: [{\n * nodeType: BLOCKS.PARAGRAPH,\n * data: {},\n * content: [\n * { nodeType: 'text', data: {}, value: 'Another list item', marks: [] }\n * ]\n * }]\n * },\n * {\n * nodeType: BLOCKS.LIST_ITEM,\n * data: {},\n * content: [{\n * nodeType: BLOCKS.HR,\n * data: {},\n * content: [],\n * }]\n * },\n * {\n * nodeType: BLOCKS.LIST_ITEM,\n * data: {},\n * content: [{\n * nodeType: BLOCKS.PARAGRAPH,\n * data:\n * content: [\n * { nodeType: 'text', data: {}, value: 'Yet another list item', marks: [] }\n * ]\n * }]\n * },\n * }]\n * }\n *\n * We want there to be a space between 'List item' and 'Another list item' (to\n * denote a visual line break, which conventionally appears between non-text\n * node sequences) but not a redundant space between 'List ' and 'item'.\n * Moreover, we want just a _singular_ space between 'Another list item' and\n * 'Yet another list item' - the non-semantic HR between the two nodes should\n * not denote an additional space.\n */\n return (rootNode as Block).content.reduce(\n (acc: string, node: Node, i: number): string => {\n let nodeTextValue = \"\";\n\n if (helpers.isText(node)) {\n nodeTextValue = node.value;\n } else if (helpers.isBlock(node) || helpers.isInline(node)) {\n nodeTextValue = documentToPlainTextString(node, blockDivisor);\n if (!nodeTextValue.length) {\n return acc;\n }\n }\n\n const nextNode = rootNode.content[i + 1];\n const isNextNodeBlock = nextNode && helpers.isBlock(nextNode);\n const divisor = isNextNodeBlock ? blockDivisor : \"\";\n return acc + nodeTextValue + divisor;\n },\n \"\",\n );\n}\n"],"names":["Head","param","gtagId","title","description","siteName","canonicalUrl","type","image","twitterCard","twitterCreator","twitterSite","metaOverride","children","openGraphDescription","noFollow","noIndex","convertId","pageLoadEventData","articleStructuredData","eventStructuredData","Container","useStoreSelector","store","framework","imageSrc","cloudinary","src","meta","width","height","alt","jsx_runtime","jsxs","jsx","link","rel","href","name","content","Object","entries","map","property","value","script","concat","dangerouslySetInnerHTML","__html","JSON","stringify","publisher","url","articleBody","datePublished","articleSection","author","startDate","endDate","eventAttendanceMode","eventStatus","location","offers","organizer","documentToDescription","document","Array","isArray","stripHtml","documentToString","replace","ContentfulHead","entry","props","request","usePageProps","getEntry","site","isEditorMode","isPageLoaded","useContentful","useHeadTitleDescription","pageEntryRef","pageEntry","fields","topper","subtitle","isContentType","subTitle","length","profile","bio","person","block","body","blocks","text","intro","bodyText","substring","openGraphMedia","mediaProps","createMediaAssetProps","host","path","GOOGLE_TAG_IDS","DEFAULT","domain","EXED","ONLINE","MY","slug","profile_code","query","gtag","undefined","remove","html","result","rm","replaceAll","key","documentToPlainTextString","rootNode","blockDivisor","reduce","acc","node","i","nodeTextValue","helpers","isText","isBlock","isInline","nextNode","isNextNodeBlock"],"sourceRoot":""}