@uvalib/web-components 1.8.0 → 1.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +4 -3
  3. package/dist/base.css +54 -1
  4. package/dist/components/site-main-nav/SiteMainNav.d.ts +1 -1
  5. package/dist/components/site-main-nav/SiteMainNav.js +9 -2
  6. package/dist/components/site-main-nav/SiteMainNav.js.map +1 -1
  7. package/dist/components/site-page/SitePage.d.ts +1 -1
  8. package/dist/components/site-page/SitePage.js +3 -2
  9. package/dist/components/site-page/SitePage.js.map +1 -1
  10. package/dist/components/site-style/SiteStyle.d.ts +1 -1
  11. package/dist/components/site-style/SiteStyle.js +3 -2
  12. package/dist/components/site-style/SiteStyle.js.map +1 -1
  13. package/dist/custom-elements.json +67 -45
  14. package/dist/pagefind.css +8 -1
  15. package/dist/styles/base.js +8 -1
  16. package/dist/styles/base.js.map +1 -1
  17. package/dist/styles/font-fallback.d.ts +17 -0
  18. package/dist/styles/font-fallback.js +64 -0
  19. package/dist/styles/font-fallback.js.map +1 -0
  20. package/dist/styles/pagefind.js +8 -1
  21. package/dist/styles/pagefind.js.map +1 -1
  22. package/dist/styles/tokens.js +1 -1
  23. package/dist/tokens.css +47 -1
  24. package/dist-cdn/base.css +54 -1
  25. package/dist-cdn/chunks/{base-BI8h0Gf3.js → base-CIX_-Rmo.js} +58 -6
  26. package/dist-cdn/chunks/base-CIX_-Rmo.js.map +1 -0
  27. package/dist-cdn/chunks/{site-header-DYRMpdBj.js → site-header-CEmNtmk5.js} +2 -2
  28. package/dist-cdn/chunks/{site-header-DYRMpdBj.js.map → site-header-CEmNtmk5.js.map} +1 -1
  29. package/dist-cdn/chunks/{site-main-nav-DURrQMal.js → site-main-nav-CAwKq_x5.js} +9 -2
  30. package/dist-cdn/chunks/site-main-nav-CAwKq_x5.js.map +1 -0
  31. package/dist-cdn/custom-elements.json +67 -45
  32. package/dist-cdn/manifest.json +1 -1
  33. package/dist-cdn/pagefind.css +8 -1
  34. package/dist-cdn/site-header.js +1 -1
  35. package/dist-cdn/site-main-nav.js +1 -1
  36. package/dist-cdn/site-page.js +50 -46
  37. package/dist-cdn/site-page.js.map +1 -1
  38. package/dist-cdn/site-style.js +6 -6
  39. package/dist-cdn/site-style.js.map +1 -1
  40. package/dist-cdn/skills/uvalib-web-components/SKILL.md +1 -1
  41. package/dist-cdn/skills/uvalib-web-components/reference/components.md +3 -3
  42. package/dist-cdn/tokens.css +47 -1
  43. package/package.json +1 -1
  44. package/skills/uvalib-web-components/SKILL.md +1 -1
  45. package/skills/uvalib-web-components/reference/components.md +3 -3
  46. package/dist-cdn/chunks/base-BI8h0Gf3.js.map +0 -1
  47. package/dist-cdn/chunks/site-main-nav-DURrQMal.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"site-page.js","names":["ifDefined","nothing","_decorate","property","state","n","i","r","b","define","__decorate","installLightDomStyles","UvalibElement","o","base","tokens","TYPEKIT_URL","accessible","ColorSchemeController","trackEvent","bufferAnalytics","loadAlerts","isAlertsEnv","alertsBase","ALERTS_PRODUCTION_SRC","ALERTS_UI","ALERTS_LIST_LABEL","slotOf","SitePage","_args","c","main","doc","name","value","link","count","changed","err","id","a","buffer","header","make","show","top","list","band","regional","content","records","el","ref","next","footer","nodes","slot","light","skip","alerts","alert","A"],"sources":["../src/components/site-page/SitePage.ts","../src/components/site-page/site-page.ts"],"sourcesContent":["import { html, css, nothing, type PropertyValues } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { property, state } from 'lit/decorators.js';\nimport { UvalibElement } from '../../base/UvalibElement.js';\nimport { installLightDomStyles } from '../../base/light-dom-styles.js';\nimport { tokens } from '../../styles/tokens.js';\nimport { base, TYPEKIT_URL } from '../../styles/base.js';\nimport { accessible } from '../../styles/accessible.js';\nimport { ColorSchemeController } from '../../base/color-scheme.js';\nimport { trackEvent } from '../../base/analytics.js';\nimport { bufferAnalytics } from '../../base/analytics-state.js';\nimport {\n ALERTS_PRODUCTION_SRC,\n alertsBase,\n isAlertsEnv,\n loadAlerts,\n} from '../site-alerts/alerts.js';\n\nexport { ALERTS_PRODUCTION_SRC, ALERTS_STAGING_SRC } from '../site-alerts/alerts.js';\nexport type { AlertsEnv } from '../site-alerts/alerts.js';\n\n/** The `<site-alerts>` elements' `show` values: header banner, alert list, regional alerts. */\ntype AlertShow = 'header' | 'list' | 'regional';\nconst ALERTS_UI = 'site-alerts';\n/** Accessible name of the list band region. */\nconst ALERTS_LIST_LABEL = 'Library alerts';\n\nconst slotOf = (n: Node): string | null => (n instanceof Element ? n.getAttribute('slot') : null);\n\n/**\n * Page wrapper: skip link (inside the header landmark in shadow mode), header, a single `<main>`, footer (unless `no-footer`), and global page styles.\n * Side-effect free: `site-page.ts` registers `<site-header>` (and its `<site-main-nav>`) and `<site-footer>`.\n *\n * The header shows the UVA Library main navigation by default (`no-main-nav` turns it off;\n * `header-variant=\"vendor\"` never shows it).\n *\n * Shows live UVA Library alerts by default with `<site-alerts>` (its code loads only then),\n * placed as Virgo places them: a full-bleed `<site-alerts show=\"header\">` banner at the top\n * of the header landmark (after the skip link), a full-bleed band between the header and\n * `<main>` holding `<site-alerts show=\"list\">` (a `<section aria-label=\"Library alerts\">`\n * region, hidden while the list has nothing to show), and `<site-alerts show=\"regional\">` as\n * the first child of `<main>`, inside its padding. Their data comes from one headless\n * `<uvalib-alerts>`, loaded once per document, with a module script, from the alerts CDN\n * (`alerts-env`, or `alerts-src`); if it fails to load, one console warning is logged and\n * the page works as before. `no-alerts` renders no alert elements and loads nothing.\n *\n * A `slot=\"breadcrumbs\"` child (a `<uvalib-breadcrumbs>`) is placed where library.virginia.edu\n * puts the trail: after the header and the alert list band, before `<main>` and outside it (so\n * the skip link lands past it), with the same gutters as `<main>`.\n *\n * Printing leaves out the chrome: the skip link, header (with the main navigation and the\n * header alert), alert list band, regional alerts, breadcrumbs, pre-footer and footer are not\n * printed, `<main>` loses its gutters, and the content prints black on white (a dark scheme\n * prints light), its links underlined. A short line above the content says where the page\n * came from (\"UVA Library — <site name or page title>\" and the page's URL). `print-chrome`\n * prints the page as it is shown instead. With `no-style` none of this applies.\n *\n * @tagname site-page\n * @slot - Main page content, rendered inside the single `<main>`.\n * @slot breadcrumbs - Optional breadcrumb trail (a `<uvalib-breadcrumbs>`), shown between the header (and alert list band) and `<main>`. In light mode it is moved there, never into `<main>`.\n * @slot pre-footer - Optional content shown in a band above the footer.\n * @slot site-links - Optional `<a href>` elements, forwarded to `<site-header>`, that replace the library utility links in the header (inline nav and Menu popover). Ignored with `header-variant=\"vendor\"`.\n * @slot main-nav - Optional `<nav>` forwarded to `<site-header>`, whose list replaces the UVA Library main navigation's links (see `<site-main-nav>`). Ignored with `no-main-nav` and `header-variant=\"vendor\"`.\n * @csspart main - The `<main>` landmark.\n * @csspart header - The `<header>` element inside `<site-header>` (shadow mode; exported through `exportparts`).\n * @csspart footer - The `<footer>` element inside `<site-footer>` (shadow mode; exported through `exportparts`).\n * @cssprop [--uva-brand-blue=#232d4b] - Skip link background.\n * @cssprop [--uva-brand-orange=#e57200] - Focus ring colour (focus-visible outline).\n * @cssprop [--uva-font-family=franklin-gothic-urw, Arial, Helvetica, sans-serif] - Page font family (global styles).\n * @cssprop [--uva-font-size-base=17px] - Page base font size (global styles).\n * @cssprop [--uva-grey-darkest=#2b2b2b] - Page text colour (global styles).\n * @cssprop --uva-color-surface - Dark-mode role token: page background (global styles; else none).\n * @cssprop --uva-color-text - Dark-mode role token: page text (global styles; else `--uva-grey-darkest`).\n * @cssprop --uva-color-accent-bg - Dark-mode role token: skip-link background (else `--uva-brand-blue`).\n * @cssprop --uva-color-on-accent - Dark-mode role token: skip-link text (else #fff).\n * @cssprop --uva-color-focus - Dark-mode role token: focus ring (else `--uva-brand-orange`).\n */\nexport class SitePage extends UvalibElement {\n /** The page's content keeps the page's own colour scheme. */\n protected static override hostColorScheme = false;\n @property({ type: String, attribute: 'root-link-domain' }) rootLinkDomain =\n 'https://www.library.virginia.edu';\n @property({ type: String, attribute: 'header-variant' }) headerVariant: 'full' | 'vendor' =\n 'full';\n @property({ type: Boolean, attribute: 'no-global-styles' }) noGlobalStyles = false;\n /**\n * Hide the footer (and any pre-footer band), for tools and app-like pages where the site\n * footer does not belong. The footer is kept hidden rather than removed, so toggling the\n * attribute keeps pre-footer content.\n */\n @property({ type: Boolean, attribute: 'no-footer', reflect: true }) noFooter = false;\n /**\n * Print the header, alerts, breadcrumbs and footer too. By default printing leaves them out\n * and prints only `<main>`, black on white.\n */\n @property({ type: Boolean, attribute: 'print-chrome', reflect: true }) printChrome = false;\n /** Accessible name of the header navigation when site links are given (default \"Site\"). */\n @property({ type: String, attribute: 'site-links-label' }) siteLinksLabel?: string;\n /** The sub-site's name, forwarded to `<site-header site-name>`: shown after the logo as a link to the site's home. */\n @property({ type: String, attribute: 'site-name' }) siteName?: string;\n /** Where the site name links, forwarded to `<site-header site-name-href>` (default `/`). */\n @property({ type: String, attribute: 'site-name-href' }) siteNameHref?: string;\n /** Hide the UVA Library main navigation in the header. */\n @property({ type: Boolean, attribute: 'no-main-nav' }) noMainNav = false;\n /** Accessible name of the header's main navigation (default \"Main\"). */\n @property({ type: String, attribute: 'main-nav-label' }) mainNavLabel?: string;\n /** URL of JSON main navigation items, forwarded to `<site-header main-nav-src>`. */\n @property({ type: String, attribute: 'main-nav-src' }) mainNavSrc?: string;\n /**\n * The URL whose main-navigation link is marked current, forwarded to `<site-header\n * main-nav-current>`. Default: the page location, followed through same-document\n * navigations; set it when a single-page app's route is not its URL.\n */\n @property({ type: String, attribute: 'main-nav-current' }) mainNavCurrent?: string;\n /**\n * Alerts environment: `production` (default) or `staging`. Any other value logs one\n * console warning and uses production. Ignored when `alerts-src` is set.\n */\n @property({ type: String, attribute: 'alerts-env' }) alertsEnv = 'production';\n /**\n * Alerts base URL (holding `config.json`, `alerts.json` and `v1/uvalib-alerts.js`); overrides\n * `alerts-env`. For a custom domain, local development and tests.\n */\n @property({ type: String, attribute: 'alerts-src' }) alertsSrc?: string;\n /** Render no alert elements and load no alerts script. */\n @property({ type: Boolean, attribute: 'no-alerts' }) noAlerts = false;\n /**\n * Opt in to dark mode, forwarded to `<site-header color-scheme-switch>`: the page follows\n * the OS preference, and a Light / Dark / System control in the header lets the visitor\n * override it (remembered per site). Off by default: the page is always light. The page's\n * own content must support it (see the README's \"Dark mode\").\n */\n @property({ type: Boolean, attribute: 'color-scheme-switch' }) colorSchemeSwitch = false;\n /**\n * Opt in to Matomo analytics: the site's Matomo id. The page then adds one\n * `<site-analytics>` for it (loading its code only then), which records the page view and\n * what the library's components report (see the README's \"Analytics\"). Off by default. With\n * an analytics element or a Matomo snippet already on the page nothing is counted twice.\n */\n @property({ type: Number, attribute: 'matomo-id' }) matomoId?: number;\n /** The Matomo server for `matomo-id`, ending in `/` (default: the library's). */\n @property({ type: String, attribute: 'matomo-url' }) matomoUrl?: string;\n /**\n * `event`: the `<site-analytics downloads=\"event\">` option for `matomo-id`, counting\n * downloads as `['download', '<extension>']` events without their URLs.\n */\n @property({ type: String, attribute: 'matomo-downloads' }) matomoDownloads?: string;\n\n /**\n * Sets the stored scheme on <html> as soon as the page connects, before the header renders,\n * so pages without the inline snippet flash as little as possible; without the switch it\n * removes a stray attribute. It renders nothing itself.\n */\n private readonly scheme = new ColorSchemeController(\n this,\n () => this.colorSchemeSwitch,\n () => this.noStyle,\n false,\n );\n\n static styles = [\n accessible,\n css`\n :host {\n display: block;\n }\n site-header,\n site-footer,\n main {\n display: block;\n width: 100%;\n }\n site-footer[hidden] {\n display: none;\n }\n /* Virgo's alert list: a full-bleed band flush under the header, above main's padding. */\n .alerts-list {\n display: block;\n width: 100%;\n margin: 0;\n padding: 0;\n }\n .alerts-list[hidden] {\n display: none;\n }\n .alerts-list > site-alerts {\n display: block;\n }\n /* The breadcrumb trail lines up with main's content (same max width and side padding). */\n ::slotted([slot='breadcrumbs']) {\n display: block;\n box-sizing: border-box;\n max-width: 1600px;\n margin: 0 auto;\n padding: 16px 40px 0;\n }\n /* An empty or hidden trail takes no space. */\n ::slotted([slot='breadcrumbs']:is([hidden], [data-empty])) {\n display: none;\n }\n /* Light mode (this stylesheet is rewritten to \\`site-page > …\\` there). */\n :host > [slot='breadcrumbs']:is([hidden], [data-empty]) {\n display: none;\n }\n :host > [slot='breadcrumbs'] {\n display: block;\n box-sizing: border-box;\n max-width: 1600px;\n margin: 0 auto;\n padding: 16px 40px 0;\n }\n /* Old layout: .main-container-inner (max 1600px, centred) > .w3-row-padding 8px\n > .w3-col 8px > .d8-fade 24px = 40px each side; 12px margin + 24px padding below. */\n main {\n box-sizing: border-box;\n max-width: 1600px;\n margin: 0 auto;\n padding: 36px 40px;\n }\n @media screen and (min-width: 993px) {\n main {\n padding-top: 24px; /* old: .breadcrumb-found dropped its 12px top margin */\n }\n }\n /* Print (issue #20): only <main>, black on white, unless print-chrome. In shadow mode\n the breadcrumbs slot is hidden, which hides what is assigned to it; in light mode\n (rewritten to site-page …) the trail is a direct child. The pre-footer is in the\n footer. The base styles underline the content's links and print a dark scheme light. */\n @media print {\n :host(:not([print-chrome])) {\n color: #000;\n background: #fff;\n }\n :host(:not([print-chrome])) :is(site-header, site-footer, .alerts-list, .skip-link),\n :host(:not([print-chrome])) main > site-alerts,\n :host(:not([print-chrome])) slot[name='breadcrumbs'],\n :host(:not([print-chrome])) > [slot='breadcrumbs'] {\n display: none;\n }\n :host(:not([print-chrome])) main {\n max-width: none;\n padding: 0;\n }\n /* Where the page came from: a line above the content, from --uvalib-print-source\n (set on <main>: \"UVA Library — <site name or title> <URL>\"). Print only, so never\n read out on screen. */\n :host(:not([print-chrome])) main::before {\n content: var(--uvalib-print-source, none);\n display: block;\n margin: 0 0 1rem;\n padding: 0 0 0.25rem;\n border-bottom: 1px solid #000;\n color: #000;\n font-size: 0.875rem;\n overflow-wrap: anywhere;\n }\n }\n `,\n ];\n\n /** Light mode: nodes this element rendered itself (incl. Lit markers), never routed. */\n private chrome = new WeakSet<Node>();\n private observer?: MutationObserver;\n private globalsInstalled = false;\n /** The alerts base URL in use, from `alerts-src` or `alerts-env`. */\n private alertsUrl = ALERTS_PRODUCTION_SRC;\n /** Light mode: the alert elements this element created, and the list band. */\n private lightAlerts?: {\n top: HTMLElement;\n band: HTMLElement;\n list: HTMLElement;\n regional: HTMLElement;\n };\n /** The `<site-analytics>` this element added for `matomo-id`. */\n private analytics?: HTMLElement;\n /** Whether this element asked for `<site-alerts>`' code. */\n private alertsUiRequested = false;\n /** Whether the list alerts have anything to show, from their last update event. */\n @state() private listShown = false;\n /**\n * Shadow mode: whether a `slot=\"breadcrumbs\"` child exists, so the slot is rendered only\n * then and the page without breadcrumbs renders exactly what it did before them.\n */\n @state() private hasBreadcrumbs = false;\n private breadcrumbsObserver?: MutationObserver;\n\n private syncHasBreadcrumbs = (): void => {\n this.hasBreadcrumbs = [...this.children].some((c) => slotOf(c) === 'breadcrumbs');\n };\n\n override connectedCallback(): void {\n super.connectedCallback();\n if (!this.lightDom) {\n this.syncHasBreadcrumbs();\n this.breadcrumbsObserver ??= new MutationObserver(this.syncHasBreadcrumbs);\n this.breadcrumbsObserver.observe(this, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['slot'],\n });\n }\n this.ownerDocument.defaultView?.addEventListener('beforeprint', this.syncPrintSource);\n if (!this.noGlobalStyles && !this.globalsInstalled) {\n this.globalsInstalled = true;\n this.installGlobalStyles(this.ownerDocument);\n }\n // Reconnect after a disconnect; the first connect starts routing in update().\n if (this.lightDom && this.hasUpdated) {\n this.route(this.childNodes);\n this.observe();\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.observer?.disconnect();\n this.breadcrumbsObserver?.disconnect();\n this.ownerDocument.defaultView?.removeEventListener('beforeprint', this.syncPrintSource);\n }\n\n /**\n * The printed \"where from\" line, as a CSS string on <main> (`--uvalib-print-source`), read\n * by the print styles. Set on each update and again just before printing, so a single-page\n * app prints its current title and URL.\n */\n private syncPrintSource = (): void => {\n const main = this.renderRoot.querySelector<HTMLElement>(\n this.lightDom ? ':scope > main' : 'main',\n );\n if (!main) return;\n const doc = this.ownerDocument;\n const name = (this.siteName || doc.title || '').trim();\n const text = `UVA Library${name ? ` — ${name}` : ''} ${doc.defaultView?.location.href ?? ''}`;\n const value = `\"${text\n .trim()\n .replace(/[\\\\\"]/g, '\\\\$&')\n .replace(/[\\n\\r\\f]/g, ' ')}\"`;\n if (main.style.getPropertyValue('--uvalib-print-source') !== value)\n main.style.setProperty('--uvalib-print-source', value);\n };\n\n private installGlobalStyles(doc: Document): void {\n // Tokens stay layered so a host's own `:root { --uva-*: … }` wins; base and accessibility\n // rules are unlayered so they beat host resets.\n installLightDomStyles('uvalib-tokens', [tokens], { root: doc, scope: false });\n installLightDomStyles('uvalib-global', [base, accessible], {\n root: doc,\n scope: false,\n layer: false,\n });\n if (!doc.head.querySelector(`link[href=\"${TYPEKIT_URL}\"]`)) {\n const link = doc.createElement('link');\n link.rel = 'stylesheet';\n link.href = TYPEKIT_URL;\n doc.head.append(link);\n }\n }\n\n /** The list element's `site-alerts-change`: show the band only while it lists alerts. */\n private onListChange(e: Event): void {\n if (e.target !== e.currentTarget) return;\n const count = (e as CustomEvent<{ count?: unknown }>).detail?.count;\n this.listShown = typeof count === 'number' && count > 0;\n }\n\n protected override willUpdate(changed: PropertyValues): void {\n if (changed.has('colorSchemeSwitch')) this.scheme.sync();\n if (changed.has('noAlerts') && this.noAlerts) this.listShown = false;\n if (changed.has('alertsEnv') && this.alertsEnv && !isAlertsEnv(this.alertsEnv)) {\n console.warn(\n `${this.localName}: unknown alerts-env \"${this.alertsEnv}\"; using production. Valid values: production, staging.`,\n );\n }\n try {\n this.alertsUrl = alertsBase(this.alertsEnv, this.alertsSrc, this.ownerDocument.baseURI);\n } catch {\n if (changed.has('alertsSrc')) {\n console.warn(\n `${this.localName}: alerts-src \"${this.alertsSrc}\" is not a URL; ignoring it.`,\n );\n }\n this.alertsUrl = alertsBase(this.alertsEnv, null, this.ownerDocument.baseURI);\n }\n }\n\n protected override updated(): void {\n if (this.lightDom) this.syncLightAlerts();\n this.syncPrintSource();\n if (!this.noAlerts) {\n // The alerts script starts loading at once, alongside <site-alerts>' own code.\n loadAlerts(this.ownerDocument, this.alertsUrl);\n this.defineAlerts();\n }\n this.syncAnalytics();\n }\n\n /** Loads `<site-alerts>` (and registers it) on first use of the alerts. */\n protected loadAlertsUi(): Promise<unknown> {\n return import('../site-alerts/site-alerts.js');\n }\n\n private defineAlerts(): void {\n if (this.alertsUiRequested || customElements.get(ALERTS_UI)) return;\n this.alertsUiRequested = true;\n this.loadAlertsUi().catch((err) =>\n console.error(`${this.localName}: failed to load site-alerts`, err),\n );\n }\n\n /** Loads `<site-analytics>` (and registers it) on first use of `matomo-id`. */\n protected loadAnalytics(): Promise<unknown> {\n return import('../site-analytics/site-analytics.js');\n }\n\n /**\n * `matomo-id`: one `<site-analytics>`, at the very start of the render root, before Lit's\n * markers, so no render ever clears it and (being chrome) light DOM routing never moves it.\n * The element's own one-tracker guard keeps a second element or snippet from double-counting.\n */\n private syncAnalytics(): void {\n const id = Number(this.matomoId);\n if (!(id > 0)) {\n this.analytics?.remove();\n this.analytics = undefined;\n return;\n }\n if (!this.analytics) {\n // An analytics element the page has already (say the old v0.0.12 <uvalib-analytics>,\n // which does not share the one-tracker guard) records the page: don't add a second.\n if (this.ownerDocument.querySelector('site-analytics, uvalib-analytics')) return;\n const a = (this.analytics = this.ownerDocument.createElement('site-analytics'));\n this.chrome.add(a);\n if (!customElements.get('site-analytics')) {\n // Until the code arrives nothing forwards: keep what the components report meanwhile\n // (a bento search can settle first) and hand it over once the element is running.\n const buffer = bufferAnalytics(this.ownerDocument);\n this.loadAnalytics()\n .then(() => customElements.whenDefined('site-analytics'))\n .then(() => (a as HTMLElement & { updateComplete?: Promise<unknown> }).updateComplete)\n .then(\n () => buffer.flush(),\n (err) => {\n buffer.drop();\n console.error(`${this.localName}: failed to load site-analytics`, err);\n },\n );\n }\n }\n const a = this.analytics;\n if (a.getAttribute('matomoid') !== String(id)) a.setAttribute('matomoid', String(id));\n if (this.matomoUrl) a.setAttribute('matomourl', this.matomoUrl);\n else a.removeAttribute('matomourl');\n if (this.matomoDownloads) a.setAttribute('downloads', this.matomoDownloads);\n else a.removeAttribute('downloads');\n if (a.parentNode !== this.renderRoot) this.renderRoot.prepend(a);\n }\n\n /**\n * Light mode keeps <main> free of Lit parts, so the alert elements are managed here: the\n * header one is handed to <site-header> as a `slot=\"alerts\"` child (it moves it into its\n * <header>), the list band goes right after <site-header>, and regional stays the first\n * child of <main>. The band and the elements are chrome, so route() never moves them.\n */\n private syncLightAlerts(): void {\n const main = this.querySelector(':scope > main');\n const header = this.querySelector(':scope > site-header');\n if (!main || !header) return;\n if (this.noAlerts) {\n const a = this.lightAlerts;\n for (const n of a ? [a.top, a.band, a.regional] : []) n.remove();\n this.lightAlerts = undefined;\n return;\n }\n if (!this.lightAlerts) {\n const doc = this.ownerDocument;\n const make = (show: AlertShow) => {\n const a = doc.createElement(ALERTS_UI);\n a.setAttribute('show', show);\n a.setAttribute('no-shadow-dom', '');\n this.chrome.add(a);\n return a;\n };\n const top = make('header');\n top.slot = 'alerts';\n const list = make('list');\n list.addEventListener('site-alerts-change', (e) => this.onListChange(e));\n const band = doc.createElement('section');\n band.className = 'alerts-list';\n band.setAttribute('aria-label', ALERTS_LIST_LABEL);\n band.append(list);\n this.chrome.add(band);\n this.lightAlerts = { top, band, list, regional: make('regional') };\n }\n const { top, band, list, regional } = this.lightAlerts;\n for (const a of [top, list, regional]) {\n if (a.getAttribute('alerts-src') !== this.alertsUrl)\n a.setAttribute('alerts-src', this.alertsUrl);\n a.toggleAttribute('no-style', this.noStyle);\n }\n band.hidden = !this.listShown;\n if (!header.contains(top)) header.append(top);\n // Directly after <site-header>, before any Lit marker, so no part ever clears it.\n if (header.nextSibling !== band) header.after(band);\n if (main.firstChild !== regional) main.prepend(regional);\n }\n\n protected override update(changed: PropertyValues): void {\n if (this.hasUpdated || !this.lightDom) {\n super.update(changed);\n return;\n }\n const content = [...this.childNodes];\n super.update(changed); // first render appends the chrome after the content\n for (const n of this.childNodes) if (!content.includes(n)) this.chrome.add(n);\n this.route(content);\n this.observe();\n }\n\n private observe(): void {\n this.observer ??= new MutationObserver((records) => {\n for (const r of records) {\n if (r.type === 'attributes') this.reslot(r.target as Element);\n else if (r.target === this) this.route(r.addedNodes);\n }\n });\n // One call: observing the same node again would replace these options. Children added to\n // the page are routed; a content node given slot=\"breadcrumbs\" later (or losing it) moves\n // out of (or back into) <main>.\n this.observer.observe(this, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['slot'],\n });\n }\n\n /** Light mode: a top-level content node's `slot` changed to or from `breadcrumbs`. */\n private reslot(el: Element): void {\n const main = this.querySelector(':scope > main');\n const header = this.querySelector(':scope > site-header');\n if (!main || !header || this.chrome.has(el)) return;\n if (el.parentNode === main && slotOf(el) === 'breadcrumbs') this.placeBreadcrumbs(el, header);\n else if (\n el.parentNode === this &&\n slotOf(el) !== 'breadcrumbs' &&\n main.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_PRECEDING\n )\n main.append(el);\n }\n\n /**\n * Light mode: a `slot=\"breadcrumbs\"` node goes after the header, the alert list band and any\n * breadcrumbs already there, before Lit's markers (so no render clears it) and `<main>`.\n */\n private placeBreadcrumbs(n: Node, header: Element): void {\n let ref: Node = header;\n for (let next = ref.nextSibling; next; next = ref.nextSibling) {\n if (next !== this.lightAlerts?.band && slotOf(next) !== 'breadcrumbs') break;\n if (next === n) return; // already in place\n ref = next;\n }\n (ref as ChildNode).after(n);\n }\n\n /**\n * Light mode has no slots: move content into `<main>`, pre-footer nodes to the footer,\n * site links and main-nav markup to the header and breadcrumbs before `<main>`.\n */\n private route(nodes: Iterable<Node>): void {\n const main = this.querySelector(':scope > main');\n const header = this.querySelector(':scope > site-header');\n const footer = this.querySelector(':scope > site-footer');\n if (!main || !header || !footer) return;\n for (const n of [...nodes]) {\n if (n.parentNode !== this || this.chrome.has(n)) continue;\n if (n.nodeType === Node.TEXT_NODE && !n.textContent?.trim()) continue;\n // The header and footer adopt their own slotted children, even before they upgrade.\n const slot = slotOf(n);\n if (slot === 'breadcrumbs') {\n this.placeBreadcrumbs(n, header);\n continue;\n }\n const to =\n slot === 'pre-footer'\n ? footer\n : slot === 'site-links' || slot === 'main-nav'\n ? header\n : main;\n to.append(n);\n }\n }\n\n private onSkip(e: Event): void {\n e.preventDefault();\n // Shadow mode: the link is in <site-header>'s skip-link slot, and the header reports it.\n if (this.lightDom) trackEvent(this, ['site-header', 'skip-link']);\n this.renderRoot.querySelector<HTMLElement>('main')?.focus();\n }\n\n protected override render() {\n const light = this.lightDom;\n // Light mode keeps <main> and <site-footer> free of Lit parts so moved content is never cleared.\n const skip = html`<a\n class=\"skip-link\"\n href=\"#main-content\"\n slot=${ifDefined(light ? undefined : 'skip-link')}\n @click=${this.onSkip}\n >Skip to main content</a\n >`;\n // Shadow mode: the link is slotted into <site-header>'s <header> landmark, because axe\n // looks the #main-content target up on the document and cannot see it in this shadow root,\n // so it would flag a skip link that sits outside every landmark (\"region\").\n // Light mode: the link stays the first child, where the target resolves.\n const alerts = !this.noAlerts && !light;\n const alert = (show: AlertShow) =>\n html`<site-alerts\n slot=${ifDefined(show === 'header' ? 'alerts' : undefined)}\n show=${show}\n alerts-src=${this.alertsUrl}\n ?no-style=${this.noStyle}\n ></site-alerts>`;\n // Shadow mode's list band; light mode builds the same in syncLightAlerts().\n const band = html`<section\n class=\"alerts-list\"\n aria-label=${ALERTS_LIST_LABEL}\n ?hidden=${!this.listShown}\n >\n <site-alerts\n show=\"list\"\n alerts-src=${this.alertsUrl}\n ?no-style=${this.noStyle}\n @site-alerts-change=${this.onListChange}\n ></site-alerts>\n </section>`;\n return html`\n ${light ? skip : nothing}\n <site-header\n exportparts=\"header\"\n ?no-shadow-dom=${light}\n ?no-style=${this.noStyle}\n variant=${this.headerVariant}\n root-link-domain=${this.rootLinkDomain}\n site-links-label=${ifDefined(this.siteLinksLabel)}\n site-name=${ifDefined(this.siteName)}\n site-name-href=${ifDefined(this.siteNameHref)}\n ?no-main-nav=${this.noMainNav}\n main-nav-label=${ifDefined(this.mainNavLabel)}\n main-nav-src=${ifDefined(this.mainNavSrc)}\n main-nav-current=${ifDefined(this.mainNavCurrent)}\n ?color-scheme-switch=${this.colorSchemeSwitch}\n >${\n light\n ? nothing\n : html`${skip}${alerts ? alert('header') : nothing}<slot\n name=\"site-links\"\n slot=\"site-links\"\n ></slot\n ><slot name=\"main-nav\" slot=\"main-nav\"></slot>`\n }</site-header\n >\n ${alerts ? band : nothing}\n ${!light && this.hasBreadcrumbs ? html`<slot name=\"breadcrumbs\"></slot>` : nothing}\n ${\n light\n ? html`<main id=\"main-content\" tabindex=\"-1\" part=\"main\"></main>`\n : html`<main id=\"main-content\" tabindex=\"-1\" part=\"main\">\n ${alerts ? alert('regional') : nothing}<slot></slot>\n </main>`\n }\n ${\n light\n ? html`<site-footer\n no-shadow-dom\n ?hidden=${this.noFooter}\n ?no-style=${this.noStyle}\n root-link-domain=${this.rootLinkDomain}\n ></site-footer>`\n : html`<site-footer\n exportparts=\"footer\"\n ?hidden=${this.noFooter}\n ?no-style=${this.noStyle}\n root-link-domain=${this.rootLinkDomain}\n ><slot name=\"pre-footer\" slot=\"pre-footer\"></slot\n ></site-footer>`\n }\n `;\n }\n}\n","import { define } from '../../base/define.js';\nimport { SitePage } from './SitePage.js';\nimport '../site-header/site-header.js';\n// The footer sits at the bottom of the page, so it loads asynchronously.\nimport('../site-footer/site-footer.js').catch((err) =>\n console.error('site-page: failed to load site-footer', err),\n);\n\ndefine('site-page', SitePage);\n"],"mappings":";;;;;;;;;AAuBA,IAAMyB,IAAY,eAEZC,IAAoB,kBAEpBC,KAAU,MAA4BtB,aAAa,UAAUA,EAAE,aAAa,MAAM,IAAI,MAkD/EuB,IAAb,cAA8BhB,EAAc;;EAyPJ,A,aArPpC,KAAA,iBAAA,oCAEA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","nothing","_decorate","property","state","n","i","r","b","define","__decorate","installLightDomStyles","UvalibElement","o","fontFallback","base","tokens","TYPEKIT_URL","accessible","ColorSchemeController","trackEvent","bufferAnalytics","loadAlerts","isAlertsEnv","alertsBase","ALERTS_PRODUCTION_SRC","ALERTS_UI","ALERTS_LIST_LABEL","slotOf","SitePage","_args","c","main","doc","name","value","link","count","changed","err","id","a","buffer","header","make","show","top","list","band","regional","content","records","el","ref","next","footer","nodes","slot","light","skip","alerts","alert","A"],"sources":["../src/components/site-page/SitePage.ts","../src/components/site-page/site-page.ts"],"sourcesContent":["import { html, css, nothing, type PropertyValues } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { property, state } from 'lit/decorators.js';\nimport { UvalibElement } from '../../base/UvalibElement.js';\nimport { installLightDomStyles } from '../../base/light-dom-styles.js';\nimport { fontFallback } from '../../styles/font-fallback.js';\nimport { tokens } from '../../styles/tokens.js';\nimport { base, TYPEKIT_URL } from '../../styles/base.js';\nimport { accessible } from '../../styles/accessible.js';\nimport { ColorSchemeController } from '../../base/color-scheme.js';\nimport { trackEvent } from '../../base/analytics.js';\nimport { bufferAnalytics } from '../../base/analytics-state.js';\nimport {\n ALERTS_PRODUCTION_SRC,\n alertsBase,\n isAlertsEnv,\n loadAlerts,\n} from '../site-alerts/alerts.js';\n\nexport { ALERTS_PRODUCTION_SRC, ALERTS_STAGING_SRC } from '../site-alerts/alerts.js';\nexport type { AlertsEnv } from '../site-alerts/alerts.js';\n\n/** The `<site-alerts>` elements' `show` values: header banner, alert list, regional alerts. */\ntype AlertShow = 'header' | 'list' | 'regional';\nconst ALERTS_UI = 'site-alerts';\n/** Accessible name of the list band region. */\nconst ALERTS_LIST_LABEL = 'Library alerts';\n\nconst slotOf = (n: Node): string | null => (n instanceof Element ? n.getAttribute('slot') : null);\n\n/**\n * Page wrapper: skip link (inside the header landmark in shadow mode), header, a single `<main>`, footer (unless `no-footer`), and global page styles.\n * Side-effect free: `site-page.ts` registers `<site-header>` (and its `<site-main-nav>`) and `<site-footer>`.\n *\n * The header shows the UVA Library main navigation by default (`no-main-nav` turns it off;\n * `header-variant=\"vendor\"` never shows it).\n *\n * Shows live UVA Library alerts by default with `<site-alerts>` (its code loads only then),\n * placed as Virgo places them: a full-bleed `<site-alerts show=\"header\">` banner at the top\n * of the header landmark (after the skip link), a full-bleed band between the header and\n * `<main>` holding `<site-alerts show=\"list\">` (a `<section aria-label=\"Library alerts\">`\n * region, hidden while the list has nothing to show), and `<site-alerts show=\"regional\">` as\n * the first child of `<main>`, inside its padding. Their data comes from one headless\n * `<uvalib-alerts>`, loaded once per document, with a module script, from the alerts CDN\n * (`alerts-env`, or `alerts-src`); if it fails to load, one console warning is logged and\n * the page works as before. `no-alerts` renders no alert elements and loads nothing.\n *\n * A `slot=\"breadcrumbs\"` child (a `<uvalib-breadcrumbs>`) is placed where library.virginia.edu\n * puts the trail: after the header and the alert list band, before `<main>` and outside it (so\n * the skip link lands past it), with the same gutters as `<main>`.\n *\n * Printing leaves out the chrome: the skip link, header (with the main navigation and the\n * header alert), alert list band, regional alerts, breadcrumbs, pre-footer and footer are not\n * printed, `<main>` loses its gutters, and the content prints black on white (a dark scheme\n * prints light), its links underlined. A short line above the content says where the page\n * came from (\"UVA Library — <site name or page title>\" and the page's URL). `print-chrome`\n * prints the page as it is shown instead. With `no-style` none of this applies.\n *\n * @tagname site-page\n * @slot - Main page content, rendered inside the single `<main>`.\n * @slot breadcrumbs - Optional breadcrumb trail (a `<uvalib-breadcrumbs>`), shown between the header (and alert list band) and `<main>`. In light mode it is moved there, never into `<main>`.\n * @slot pre-footer - Optional content shown in a band above the footer.\n * @slot site-links - Optional `<a href>` elements, forwarded to `<site-header>`, that replace the library utility links in the header (inline nav and Menu popover). Ignored with `header-variant=\"vendor\"`.\n * @slot main-nav - Optional `<nav>` forwarded to `<site-header>`, whose list replaces the UVA Library main navigation's links (see `<site-main-nav>`). Ignored with `no-main-nav` and `header-variant=\"vendor\"`.\n * @csspart main - The `<main>` landmark.\n * @csspart header - The `<header>` element inside `<site-header>` (shadow mode; exported through `exportparts`).\n * @csspart footer - The `<footer>` element inside `<site-footer>` (shadow mode; exported through `exportparts`).\n * @cssprop [--uva-brand-blue=#232d4b] - Skip link background.\n * @cssprop [--uva-brand-orange=#e57200] - Focus ring colour (focus-visible outline).\n * @cssprop [--uva-font-family=franklin-gothic-urw, \"UVA Franklin Fallback\", Arial, Helvetica, sans-serif] - Page font family (global styles).\n * @cssprop [--uva-font-size-base=17px] - Page base font size (global styles).\n * @cssprop [--uva-grey-darkest=#2b2b2b] - Page text colour (global styles).\n * @cssprop --uva-color-surface - Dark-mode role token: page background (global styles; else none).\n * @cssprop --uva-color-text - Dark-mode role token: page text (global styles; else `--uva-grey-darkest`).\n * @cssprop --uva-color-accent-bg - Dark-mode role token: skip-link background (else `--uva-brand-blue`).\n * @cssprop --uva-color-on-accent - Dark-mode role token: skip-link text (else #fff).\n * @cssprop --uva-color-focus - Dark-mode role token: focus ring (else `--uva-brand-orange`).\n */\nexport class SitePage extends UvalibElement {\n /** The page's content keeps the page's own colour scheme. */\n protected static override hostColorScheme = false;\n @property({ type: String, attribute: 'root-link-domain' }) rootLinkDomain =\n 'https://www.library.virginia.edu';\n @property({ type: String, attribute: 'header-variant' }) headerVariant: 'full' | 'vendor' =\n 'full';\n @property({ type: Boolean, attribute: 'no-global-styles' }) noGlobalStyles = false;\n /**\n * Hide the footer (and any pre-footer band), for tools and app-like pages where the site\n * footer does not belong. The footer is kept hidden rather than removed, so toggling the\n * attribute keeps pre-footer content.\n */\n @property({ type: Boolean, attribute: 'no-footer', reflect: true }) noFooter = false;\n /**\n * Print the header, alerts, breadcrumbs and footer too. By default printing leaves them out\n * and prints only `<main>`, black on white.\n */\n @property({ type: Boolean, attribute: 'print-chrome', reflect: true }) printChrome = false;\n /** Accessible name of the header navigation when site links are given (default \"Site\"). */\n @property({ type: String, attribute: 'site-links-label' }) siteLinksLabel?: string;\n /** The sub-site's name, forwarded to `<site-header site-name>`: shown after the logo as a link to the site's home. */\n @property({ type: String, attribute: 'site-name' }) siteName?: string;\n /** Where the site name links, forwarded to `<site-header site-name-href>` (default `/`). */\n @property({ type: String, attribute: 'site-name-href' }) siteNameHref?: string;\n /** Hide the UVA Library main navigation in the header. */\n @property({ type: Boolean, attribute: 'no-main-nav' }) noMainNav = false;\n /** Accessible name of the header's main navigation (default \"Main\"). */\n @property({ type: String, attribute: 'main-nav-label' }) mainNavLabel?: string;\n /** URL of JSON main navigation items, forwarded to `<site-header main-nav-src>`. */\n @property({ type: String, attribute: 'main-nav-src' }) mainNavSrc?: string;\n /**\n * The URL whose main-navigation link is marked current, forwarded to `<site-header\n * main-nav-current>`. Default: the page location, followed through same-document\n * navigations; set it when a single-page app's route is not its URL.\n */\n @property({ type: String, attribute: 'main-nav-current' }) mainNavCurrent?: string;\n /**\n * Alerts environment: `production` (default) or `staging`. Any other value logs one\n * console warning and uses production. Ignored when `alerts-src` is set.\n */\n @property({ type: String, attribute: 'alerts-env' }) alertsEnv = 'production';\n /**\n * Alerts base URL (holding `config.json`, `alerts.json` and `v1/uvalib-alerts.js`); overrides\n * `alerts-env`. For a custom domain, local development and tests.\n */\n @property({ type: String, attribute: 'alerts-src' }) alertsSrc?: string;\n /** Render no alert elements and load no alerts script. */\n @property({ type: Boolean, attribute: 'no-alerts' }) noAlerts = false;\n /**\n * Opt in to dark mode, forwarded to `<site-header color-scheme-switch>`: the page follows\n * the OS preference, and a Light / Dark / System control in the header lets the visitor\n * override it (remembered per site). Off by default: the page is always light. The page's\n * own content must support it (see the README's \"Dark mode\").\n */\n @property({ type: Boolean, attribute: 'color-scheme-switch' }) colorSchemeSwitch = false;\n /**\n * Opt in to Matomo analytics: the site's Matomo id. The page then adds one\n * `<site-analytics>` for it (loading its code only then), which records the page view and\n * what the library's components report (see the README's \"Analytics\"). Off by default. With\n * an analytics element or a Matomo snippet already on the page nothing is counted twice.\n */\n @property({ type: Number, attribute: 'matomo-id' }) matomoId?: number;\n /** The Matomo server for `matomo-id`, ending in `/` (default: the library's). */\n @property({ type: String, attribute: 'matomo-url' }) matomoUrl?: string;\n /**\n * `event`: the `<site-analytics downloads=\"event\">` option for `matomo-id`, counting\n * downloads as `['download', '<extension>']` events without their URLs.\n */\n @property({ type: String, attribute: 'matomo-downloads' }) matomoDownloads?: string;\n\n /**\n * Sets the stored scheme on <html> as soon as the page connects, before the header renders,\n * so pages without the inline snippet flash as little as possible; without the switch it\n * removes a stray attribute. It renders nothing itself.\n */\n private readonly scheme = new ColorSchemeController(\n this,\n () => this.colorSchemeSwitch,\n () => this.noStyle,\n false,\n );\n\n static styles = [\n accessible,\n css`\n :host {\n display: block;\n }\n site-header,\n site-footer,\n main {\n display: block;\n width: 100%;\n }\n site-footer[hidden] {\n display: none;\n }\n /* Virgo's alert list: a full-bleed band flush under the header, above main's padding. */\n .alerts-list {\n display: block;\n width: 100%;\n margin: 0;\n padding: 0;\n }\n .alerts-list[hidden] {\n display: none;\n }\n .alerts-list > site-alerts {\n display: block;\n }\n /* The breadcrumb trail lines up with main's content (same max width and side padding). */\n ::slotted([slot='breadcrumbs']) {\n display: block;\n box-sizing: border-box;\n max-width: 1600px;\n margin: 0 auto;\n padding: 16px 40px 0;\n }\n /* An empty or hidden trail takes no space. */\n ::slotted([slot='breadcrumbs']:is([hidden], [data-empty])) {\n display: none;\n }\n /* Light mode (this stylesheet is rewritten to \\`site-page > …\\` there). */\n :host > [slot='breadcrumbs']:is([hidden], [data-empty]) {\n display: none;\n }\n :host > [slot='breadcrumbs'] {\n display: block;\n box-sizing: border-box;\n max-width: 1600px;\n margin: 0 auto;\n padding: 16px 40px 0;\n }\n /* Old layout: .main-container-inner (max 1600px, centred) > .w3-row-padding 8px\n > .w3-col 8px > .d8-fade 24px = 40px each side; 12px margin + 24px padding below. */\n main {\n box-sizing: border-box;\n max-width: 1600px;\n margin: 0 auto;\n padding: 36px 40px;\n }\n @media screen and (min-width: 993px) {\n main {\n padding-top: 24px; /* old: .breadcrumb-found dropped its 12px top margin */\n }\n }\n /* Print (issue #20): only <main>, black on white, unless print-chrome. In shadow mode\n the breadcrumbs slot is hidden, which hides what is assigned to it; in light mode\n (rewritten to site-page …) the trail is a direct child. The pre-footer is in the\n footer. The base styles underline the content's links and print a dark scheme light. */\n @media print {\n :host(:not([print-chrome])) {\n color: #000;\n background: #fff;\n }\n :host(:not([print-chrome])) :is(site-header, site-footer, .alerts-list, .skip-link),\n :host(:not([print-chrome])) main > site-alerts,\n :host(:not([print-chrome])) slot[name='breadcrumbs'],\n :host(:not([print-chrome])) > [slot='breadcrumbs'] {\n display: none;\n }\n :host(:not([print-chrome])) main {\n max-width: none;\n padding: 0;\n }\n /* Where the page came from: a line above the content, from --uvalib-print-source\n (set on <main>: \"UVA Library — <site name or title> <URL>\"). Print only, so never\n read out on screen. */\n :host(:not([print-chrome])) main::before {\n content: var(--uvalib-print-source, none);\n display: block;\n margin: 0 0 1rem;\n padding: 0 0 0.25rem;\n border-bottom: 1px solid #000;\n color: #000;\n font-size: 0.875rem;\n overflow-wrap: anywhere;\n }\n }\n `,\n ];\n\n /** Light mode: nodes this element rendered itself (incl. Lit markers), never routed. */\n private chrome = new WeakSet<Node>();\n private observer?: MutationObserver;\n private globalsInstalled = false;\n /** The alerts base URL in use, from `alerts-src` or `alerts-env`. */\n private alertsUrl = ALERTS_PRODUCTION_SRC;\n /** Light mode: the alert elements this element created, and the list band. */\n private lightAlerts?: {\n top: HTMLElement;\n band: HTMLElement;\n list: HTMLElement;\n regional: HTMLElement;\n };\n /** The `<site-analytics>` this element added for `matomo-id`. */\n private analytics?: HTMLElement;\n /** Whether this element asked for `<site-alerts>`' code. */\n private alertsUiRequested = false;\n /** Whether the list alerts have anything to show, from their last update event. */\n @state() private listShown = false;\n /**\n * Shadow mode: whether a `slot=\"breadcrumbs\"` child exists, so the slot is rendered only\n * then and the page without breadcrumbs renders exactly what it did before them.\n */\n @state() private hasBreadcrumbs = false;\n private breadcrumbsObserver?: MutationObserver;\n\n private syncHasBreadcrumbs = (): void => {\n this.hasBreadcrumbs = [...this.children].some((c) => slotOf(c) === 'breadcrumbs');\n };\n\n override connectedCallback(): void {\n super.connectedCallback();\n if (!this.lightDom) {\n this.syncHasBreadcrumbs();\n this.breadcrumbsObserver ??= new MutationObserver(this.syncHasBreadcrumbs);\n this.breadcrumbsObserver.observe(this, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['slot'],\n });\n }\n this.ownerDocument.defaultView?.addEventListener('beforeprint', this.syncPrintSource);\n if (!this.noGlobalStyles && !this.globalsInstalled) {\n this.globalsInstalled = true;\n this.installGlobalStyles(this.ownerDocument);\n }\n // Reconnect after a disconnect; the first connect starts routing in update().\n if (this.lightDom && this.hasUpdated) {\n this.route(this.childNodes);\n this.observe();\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.observer?.disconnect();\n this.breadcrumbsObserver?.disconnect();\n this.ownerDocument.defaultView?.removeEventListener('beforeprint', this.syncPrintSource);\n }\n\n /**\n * The printed \"where from\" line, as a CSS string on <main> (`--uvalib-print-source`), read\n * by the print styles. Set on each update and again just before printing, so a single-page\n * app prints its current title and URL.\n */\n private syncPrintSource = (): void => {\n const main = this.renderRoot.querySelector<HTMLElement>(\n this.lightDom ? ':scope > main' : 'main',\n );\n if (!main) return;\n const doc = this.ownerDocument;\n const name = (this.siteName || doc.title || '').trim();\n const text = `UVA Library${name ? ` — ${name}` : ''} ${doc.defaultView?.location.href ?? ''}`;\n const value = `\"${text\n .trim()\n .replace(/[\\\\\"]/g, '\\\\$&')\n .replace(/[\\n\\r\\f]/g, ' ')}\"`;\n if (main.style.getPropertyValue('--uvalib-print-source') !== value)\n main.style.setProperty('--uvalib-print-source', value);\n };\n\n private installGlobalStyles(doc: Document): void {\n // Tokens stay layered so a host's own `:root { --uva-*: … }` wins; base and accessibility\n // rules are unlayered so they beat host resets.\n installLightDomStyles('uvalib-tokens', [tokens], { root: doc, scope: false });\n installLightDomStyles('uvalib-global', [fontFallback, base, accessible], {\n root: doc,\n scope: false,\n layer: false,\n });\n if (!doc.head.querySelector(`link[href=\"${TYPEKIT_URL}\"]`)) {\n const link = doc.createElement('link');\n link.rel = 'stylesheet';\n link.href = TYPEKIT_URL;\n doc.head.append(link);\n }\n }\n\n /** The list element's `site-alerts-change`: show the band only while it lists alerts. */\n private onListChange(e: Event): void {\n if (e.target !== e.currentTarget) return;\n const count = (e as CustomEvent<{ count?: unknown }>).detail?.count;\n this.listShown = typeof count === 'number' && count > 0;\n }\n\n protected override willUpdate(changed: PropertyValues): void {\n if (changed.has('colorSchemeSwitch')) this.scheme.sync();\n if (changed.has('noAlerts') && this.noAlerts) this.listShown = false;\n if (changed.has('alertsEnv') && this.alertsEnv && !isAlertsEnv(this.alertsEnv)) {\n console.warn(\n `${this.localName}: unknown alerts-env \"${this.alertsEnv}\"; using production. Valid values: production, staging.`,\n );\n }\n try {\n this.alertsUrl = alertsBase(this.alertsEnv, this.alertsSrc, this.ownerDocument.baseURI);\n } catch {\n if (changed.has('alertsSrc')) {\n console.warn(\n `${this.localName}: alerts-src \"${this.alertsSrc}\" is not a URL; ignoring it.`,\n );\n }\n this.alertsUrl = alertsBase(this.alertsEnv, null, this.ownerDocument.baseURI);\n }\n }\n\n protected override updated(): void {\n if (this.lightDom) this.syncLightAlerts();\n this.syncPrintSource();\n if (!this.noAlerts) {\n // The alerts script starts loading at once, alongside <site-alerts>' own code.\n loadAlerts(this.ownerDocument, this.alertsUrl);\n this.defineAlerts();\n }\n this.syncAnalytics();\n }\n\n /** Loads `<site-alerts>` (and registers it) on first use of the alerts. */\n protected loadAlertsUi(): Promise<unknown> {\n return import('../site-alerts/site-alerts.js');\n }\n\n private defineAlerts(): void {\n if (this.alertsUiRequested || customElements.get(ALERTS_UI)) return;\n this.alertsUiRequested = true;\n this.loadAlertsUi().catch((err) =>\n console.error(`${this.localName}: failed to load site-alerts`, err),\n );\n }\n\n /** Loads `<site-analytics>` (and registers it) on first use of `matomo-id`. */\n protected loadAnalytics(): Promise<unknown> {\n return import('../site-analytics/site-analytics.js');\n }\n\n /**\n * `matomo-id`: one `<site-analytics>`, at the very start of the render root, before Lit's\n * markers, so no render ever clears it and (being chrome) light DOM routing never moves it.\n * The element's own one-tracker guard keeps a second element or snippet from double-counting.\n */\n private syncAnalytics(): void {\n const id = Number(this.matomoId);\n if (!(id > 0)) {\n this.analytics?.remove();\n this.analytics = undefined;\n return;\n }\n if (!this.analytics) {\n // An analytics element the page has already (say the old v0.0.12 <uvalib-analytics>,\n // which does not share the one-tracker guard) records the page: don't add a second.\n if (this.ownerDocument.querySelector('site-analytics, uvalib-analytics')) return;\n const a = (this.analytics = this.ownerDocument.createElement('site-analytics'));\n this.chrome.add(a);\n if (!customElements.get('site-analytics')) {\n // Until the code arrives nothing forwards: keep what the components report meanwhile\n // (a bento search can settle first) and hand it over once the element is running.\n const buffer = bufferAnalytics(this.ownerDocument);\n this.loadAnalytics()\n .then(() => customElements.whenDefined('site-analytics'))\n .then(() => (a as HTMLElement & { updateComplete?: Promise<unknown> }).updateComplete)\n .then(\n () => buffer.flush(),\n (err) => {\n buffer.drop();\n console.error(`${this.localName}: failed to load site-analytics`, err);\n },\n );\n }\n }\n const a = this.analytics;\n if (a.getAttribute('matomoid') !== String(id)) a.setAttribute('matomoid', String(id));\n if (this.matomoUrl) a.setAttribute('matomourl', this.matomoUrl);\n else a.removeAttribute('matomourl');\n if (this.matomoDownloads) a.setAttribute('downloads', this.matomoDownloads);\n else a.removeAttribute('downloads');\n if (a.parentNode !== this.renderRoot) this.renderRoot.prepend(a);\n }\n\n /**\n * Light mode keeps <main> free of Lit parts, so the alert elements are managed here: the\n * header one is handed to <site-header> as a `slot=\"alerts\"` child (it moves it into its\n * <header>), the list band goes right after <site-header>, and regional stays the first\n * child of <main>. The band and the elements are chrome, so route() never moves them.\n */\n private syncLightAlerts(): void {\n const main = this.querySelector(':scope > main');\n const header = this.querySelector(':scope > site-header');\n if (!main || !header) return;\n if (this.noAlerts) {\n const a = this.lightAlerts;\n for (const n of a ? [a.top, a.band, a.regional] : []) n.remove();\n this.lightAlerts = undefined;\n return;\n }\n if (!this.lightAlerts) {\n const doc = this.ownerDocument;\n const make = (show: AlertShow) => {\n const a = doc.createElement(ALERTS_UI);\n a.setAttribute('show', show);\n a.setAttribute('no-shadow-dom', '');\n this.chrome.add(a);\n return a;\n };\n const top = make('header');\n top.slot = 'alerts';\n const list = make('list');\n list.addEventListener('site-alerts-change', (e) => this.onListChange(e));\n const band = doc.createElement('section');\n band.className = 'alerts-list';\n band.setAttribute('aria-label', ALERTS_LIST_LABEL);\n band.append(list);\n this.chrome.add(band);\n this.lightAlerts = { top, band, list, regional: make('regional') };\n }\n const { top, band, list, regional } = this.lightAlerts;\n for (const a of [top, list, regional]) {\n if (a.getAttribute('alerts-src') !== this.alertsUrl)\n a.setAttribute('alerts-src', this.alertsUrl);\n a.toggleAttribute('no-style', this.noStyle);\n }\n band.hidden = !this.listShown;\n if (!header.contains(top)) header.append(top);\n // Directly after <site-header>, before any Lit marker, so no part ever clears it.\n if (header.nextSibling !== band) header.after(band);\n if (main.firstChild !== regional) main.prepend(regional);\n }\n\n protected override update(changed: PropertyValues): void {\n if (this.hasUpdated || !this.lightDom) {\n super.update(changed);\n return;\n }\n const content = [...this.childNodes];\n super.update(changed); // first render appends the chrome after the content\n for (const n of this.childNodes) if (!content.includes(n)) this.chrome.add(n);\n this.route(content);\n this.observe();\n }\n\n private observe(): void {\n this.observer ??= new MutationObserver((records) => {\n for (const r of records) {\n if (r.type === 'attributes') this.reslot(r.target as Element);\n else if (r.target === this) this.route(r.addedNodes);\n }\n });\n // One call: observing the same node again would replace these options. Children added to\n // the page are routed; a content node given slot=\"breadcrumbs\" later (or losing it) moves\n // out of (or back into) <main>.\n this.observer.observe(this, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['slot'],\n });\n }\n\n /** Light mode: a top-level content node's `slot` changed to or from `breadcrumbs`. */\n private reslot(el: Element): void {\n const main = this.querySelector(':scope > main');\n const header = this.querySelector(':scope > site-header');\n if (!main || !header || this.chrome.has(el)) return;\n if (el.parentNode === main && slotOf(el) === 'breadcrumbs') this.placeBreadcrumbs(el, header);\n else if (\n el.parentNode === this &&\n slotOf(el) !== 'breadcrumbs' &&\n main.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_PRECEDING\n )\n main.append(el);\n }\n\n /**\n * Light mode: a `slot=\"breadcrumbs\"` node goes after the header, the alert list band and any\n * breadcrumbs already there, before Lit's markers (so no render clears it) and `<main>`.\n */\n private placeBreadcrumbs(n: Node, header: Element): void {\n let ref: Node = header;\n for (let next = ref.nextSibling; next; next = ref.nextSibling) {\n if (next !== this.lightAlerts?.band && slotOf(next) !== 'breadcrumbs') break;\n if (next === n) return; // already in place\n ref = next;\n }\n (ref as ChildNode).after(n);\n }\n\n /**\n * Light mode has no slots: move content into `<main>`, pre-footer nodes to the footer,\n * site links and main-nav markup to the header and breadcrumbs before `<main>`.\n */\n private route(nodes: Iterable<Node>): void {\n const main = this.querySelector(':scope > main');\n const header = this.querySelector(':scope > site-header');\n const footer = this.querySelector(':scope > site-footer');\n if (!main || !header || !footer) return;\n for (const n of [...nodes]) {\n if (n.parentNode !== this || this.chrome.has(n)) continue;\n if (n.nodeType === Node.TEXT_NODE && !n.textContent?.trim()) continue;\n // The header and footer adopt their own slotted children, even before they upgrade.\n const slot = slotOf(n);\n if (slot === 'breadcrumbs') {\n this.placeBreadcrumbs(n, header);\n continue;\n }\n const to =\n slot === 'pre-footer'\n ? footer\n : slot === 'site-links' || slot === 'main-nav'\n ? header\n : main;\n to.append(n);\n }\n }\n\n private onSkip(e: Event): void {\n e.preventDefault();\n // Shadow mode: the link is in <site-header>'s skip-link slot, and the header reports it.\n if (this.lightDom) trackEvent(this, ['site-header', 'skip-link']);\n this.renderRoot.querySelector<HTMLElement>('main')?.focus();\n }\n\n protected override render() {\n const light = this.lightDom;\n // Light mode keeps <main> and <site-footer> free of Lit parts so moved content is never cleared.\n const skip = html`<a\n class=\"skip-link\"\n href=\"#main-content\"\n slot=${ifDefined(light ? undefined : 'skip-link')}\n @click=${this.onSkip}\n >Skip to main content</a\n >`;\n // Shadow mode: the link is slotted into <site-header>'s <header> landmark, because axe\n // looks the #main-content target up on the document and cannot see it in this shadow root,\n // so it would flag a skip link that sits outside every landmark (\"region\").\n // Light mode: the link stays the first child, where the target resolves.\n const alerts = !this.noAlerts && !light;\n const alert = (show: AlertShow) =>\n html`<site-alerts\n slot=${ifDefined(show === 'header' ? 'alerts' : undefined)}\n show=${show}\n alerts-src=${this.alertsUrl}\n ?no-style=${this.noStyle}\n ></site-alerts>`;\n // Shadow mode's list band; light mode builds the same in syncLightAlerts().\n const band = html`<section\n class=\"alerts-list\"\n aria-label=${ALERTS_LIST_LABEL}\n ?hidden=${!this.listShown}\n >\n <site-alerts\n show=\"list\"\n alerts-src=${this.alertsUrl}\n ?no-style=${this.noStyle}\n @site-alerts-change=${this.onListChange}\n ></site-alerts>\n </section>`;\n return html`\n ${light ? skip : nothing}\n <site-header\n exportparts=\"header\"\n ?no-shadow-dom=${light}\n ?no-style=${this.noStyle}\n variant=${this.headerVariant}\n root-link-domain=${this.rootLinkDomain}\n site-links-label=${ifDefined(this.siteLinksLabel)}\n site-name=${ifDefined(this.siteName)}\n site-name-href=${ifDefined(this.siteNameHref)}\n ?no-main-nav=${this.noMainNav}\n main-nav-label=${ifDefined(this.mainNavLabel)}\n main-nav-src=${ifDefined(this.mainNavSrc)}\n main-nav-current=${ifDefined(this.mainNavCurrent)}\n ?color-scheme-switch=${this.colorSchemeSwitch}\n >${\n light\n ? nothing\n : html`${skip}${alerts ? alert('header') : nothing}<slot\n name=\"site-links\"\n slot=\"site-links\"\n ></slot\n ><slot name=\"main-nav\" slot=\"main-nav\"></slot>`\n }</site-header\n >\n ${alerts ? band : nothing}\n ${!light && this.hasBreadcrumbs ? html`<slot name=\"breadcrumbs\"></slot>` : nothing}\n ${\n light\n ? html`<main id=\"main-content\" tabindex=\"-1\" part=\"main\"></main>`\n : html`<main id=\"main-content\" tabindex=\"-1\" part=\"main\">\n ${alerts ? alert('regional') : nothing}<slot></slot>\n </main>`\n }\n ${\n light\n ? html`<site-footer\n no-shadow-dom\n ?hidden=${this.noFooter}\n ?no-style=${this.noStyle}\n root-link-domain=${this.rootLinkDomain}\n ></site-footer>`\n : html`<site-footer\n exportparts=\"footer\"\n ?hidden=${this.noFooter}\n ?no-style=${this.noStyle}\n root-link-domain=${this.rootLinkDomain}\n ><slot name=\"pre-footer\" slot=\"pre-footer\"></slot\n ></site-footer>`\n }\n `;\n }\n}\n","import { define } from '../../base/define.js';\nimport { SitePage } from './SitePage.js';\nimport '../site-header/site-header.js';\n// The footer sits at the bottom of the page, so it loads asynchronously.\nimport('../site-footer/site-footer.js').catch((err) =>\n console.error('site-page: failed to load site-footer', err),\n);\n\ndefine('site-page', SitePage);\n"],"mappings":";;;;;;;;;AAwBA,IAAM0B,IAAY,eAEZC,IAAoB,kBAEpBC,KAAU,MAA4BvB,aAAa,UAAUA,EAAE,aAAa,MAAM,IAAI,MAkD/EwB,IAAb,cAA8BjB,EAAc;;EAyPJ,A,aArPpC,KAAA,iBAAA,oCAEA,KAAA,gBAAA,QAC2E,KAAA,iBAAA,IAME,KAAA,WAAA,IAKM,KAAA,cAAA,IAQlB,KAAA,YAAA,IAeF,KAAA,YAAA,cAOD,KAAA,WAAA,IAOmB,KAAA,oBAAA,IAqBzD,KAAA,SAAA,IAAIO,EAC5B,YACM,KAAK,yBACL,KAAK,SACX,EACF,GAuGiB,KAAA,yBAAA,IAAI,QAAc,GAER,KAAA,mBAAA,IAEP,KAAA,YAAAM,GAWQ,KAAA,oBAAA,IAEC,KAAA,YAAA,IAKK,KAAA,iBAAA,IAGO,KAAA,2BAAA;GACvC,KAAK,iBAAiB,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC,MAAM,MAAMG,EAAOG,CAAC,MAAM,aAAa;EAClF,GAsCsC,KAAA,wBAAA;GACpC,IAAMC,IA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A,GAOlD3B,EAAA,CAAAC,EAAS;CAAE,MAAM;CAAS,WAAW;AAAsB,CAAC,CAAA,GAAA0B,EAAA,WAAA,qBAAA,KAAA,CAAA,GAO5D3B,EAAA,CAAAC,EAAS;CAAE,MAAM;CAAQ,WAAW;AAAY,CAAC,CAAA,GAAA0B,EAAA,WAAA,YAAA,KAAA,CAAA,GAEjD3B,EAAA,CAAAC,EAAS;CAAE,MAAM;CAAQ,WAAW;AAAa,CAAC,CAAA,GAAA0B,EAAA,WAAA,aAAA,KAAA,CAAA,GAKlD3B,EAAA,CAAAC,EAAS;CAAE,MAAM;CAAQ,WAAW;AAAmB,CAAC,CAAA,GAAA0B,EAAA,WAAA,mBAAA,KAAA,CAAA,GAoIxD3B,EAAA,CAAAE,EAAM,CAAA,GAAAyB,EAAA,WAAA,aAAA,KAAA,CAAA,GAKN3B,EAAA,CAAAE,EAAM,CAAA,GAAAyB,EAAA,WAAA,kBAAA,KAAA,CAAA,GCxRT,OAAO,mBAAgC,CAAC,OAAO,MAC7C,QAAQ,MAAM,yCAAyCU,CAAG,CAC5D,GAEA9B,EAAO,aAAaoB,CAAQ"}
@@ -1,7 +1,7 @@
1
1
  import { a as e, l as t, m as n, n as r, o as i, r as a, t as o } from "./chunks/UvalibElement-pGONDAwB.js";
2
- import { n as s, r as c } from "./chunks/base-BI8h0Gf3.js";
2
+ import { i as s, n as c, r as l } from "./chunks/base-CIX_-Rmo.js";
3
3
  // src/components/site-style/SiteStyle.ts
4
- var l = class extends o {
4
+ var u = class extends o {
5
5
  constructor(...e) {
6
6
  super(...e), this.imports = {}, this.importedStyles = "";
7
7
  }
@@ -9,13 +9,13 @@ var l = class extends o {
9
9
  this.hostColorScheme = !1;
10
10
  }
11
11
  static {
12
- this.styles = [c, s];
12
+ this.styles = [l, c];
13
13
  }
14
14
  installLightStyles() {
15
- a("uvalib-tokens", [c], {
15
+ a("uvalib-tokens", [l], {
16
16
  root: this.ownerDocument,
17
17
  scope: !1
18
- }), a("uvalib-site-style", [s], {
18
+ }), a("uvalib-site-style", [s, c], {
19
19
  root: this.ownerDocument,
20
20
  scope: !1,
21
21
  layer: !1
@@ -37,6 +37,6 @@ var l = class extends o {
37
37
  }
38
38
  };
39
39
  // src/components/site-style/site-style.ts
40
- r([e({ type: Object })], l.prototype, "imports", void 0), r([e({ type: String })], l.prototype, "importedStyles", void 0), n("site-style", l);
40
+ r([e({ type: Object })], u.prototype, "imports", void 0), r([e({ type: String })], u.prototype, "importedStyles", void 0), n("site-style", u);
41
41
 
42
42
  //# sourceMappingURL=site-style.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"site-style.js","names":["nothing","_decorate","property","n","b","define","__decorate","A","installLightDomStyles","UvalibElement","base","tokens","SiteStyle","_args","imp","key","css"],"sources":["../src/components/site-style/SiteStyle.ts","../src/components/site-style/site-style.ts"],"sourcesContent":["import { html, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { UvalibElement } from '../../base/UvalibElement.js';\nimport { installLightDomStyles } from '../../base/light-dom-styles.js';\nimport { tokens } from '../../styles/tokens.js';\nimport { base } from '../../styles/base.js';\n\n/**\n * Compatibility element. Light mode (`no-shadow-dom`) installs the tokens and base page\n * styles on the document. Shadow mode only styles inside its own shadow root, so the\n * `:root` and `html, body` rules of those sheets match nothing there and the slotted content\n * is not restyled; it inherits whatever inherited tokens and fonts the page already provides.\n *\n * @tagname site-style\n * @slot - Content rendered in shadow mode; it is not restyled by this element. In light mode there is no shadow root and the children stay in place.\n * @cssprop [--uva-font-family=franklin-gothic-urw, Arial, Helvetica, sans-serif] - Font family.\n * @cssprop [--uva-font-size-base=17px] - Base font size.\n * @cssprop [--uva-grey-darkest=#2b2b2b] - Text colour.\n * @cssprop --uva-color-text - Dark-mode role token: text colour (else `--uva-grey-darkest`).\n * @cssprop --uva-color-surface - Dark-mode role token: page background (else none).\n */\nexport class SiteStyle extends UvalibElement {\n /** The wrapped content keeps the page's own colour scheme. */\n protected static override hostColorScheme = false;\n static styles = [tokens, base];\n\n /** Map of tag name to a module URL whose default export is a stylesheet; ported as is. */\n @property({ type: Object }) imports: { [key: string]: string } = {};\n\n /**\n * Accumulated text of the stylesheets loaded through `imports`. Carried over from the old\n * component for compatibility; it is not rendered anywhere.\n */\n @property({ type: String }) importedStyles = '';\n\n /**\n * Page-level styles: unscoped; the base rules are unlayered (so they beat host resets), the tokens layered, under their own dedupe key, always on the owner\n * document (not the root node) because `:root` tokens inherit into shadow roots.\n */\n protected override installLightStyles(): void {\n // Tokens layered (host `:root` overrides win), base unlayered (beats host resets).\n installLightDomStyles('uvalib-tokens', [tokens], { root: this.ownerDocument, scope: false });\n installLightDomStyles('uvalib-site-style', [base], {\n root: this.ownerDocument,\n scope: false,\n layer: false,\n });\n }\n\n protected override firstUpdated(): void {\n if (this.imports && !this.noStyle) {\n Object.keys(this.imports).forEach((key) => {\n const imp = this.imports[key];\n if (imp) {\n import(/* @vite-ignore */ imp).then((css: { default: { toString(): string } }) => {\n this.importedStyles += css.default.toString().replace(/:host/, key.toLowerCase());\n });\n }\n });\n }\n }\n\n protected override render() {\n return this.lightDom ? nothing : html`<slot></slot>`;\n }\n}\n","import { define } from '../../base/define.js';\nimport { SiteStyle } from './SiteStyle.js';\n\ndefine('site-style', SiteStyle);\n"],"mappings":";;;AAqBA,IAAaY,IAAb,cAA+BH,EAAc;;EAYE,A,aANoB,KAAA,UAAA,CAAC,GAMrB,KAAA,iBAAA;;;EAVD,KAAA,kBAAA;;;EAC5B,KAAA,SAAA,CAACE,GAAQD,CAAI;;CAe7B,qBAA8C;EAG5C,AADAF,EAAsB,iBAAiB,CAACG,CAAM,GAAG;GAAE,MAAM,KAAK;GAAe,OAAO;EAAM,CAAC,GAC3FH,EAAsB,qBAAqB,CAACE,CAAI,GAAG;GACjD,MAAM,KAAK;GACX,OAAO;GACP,OAAO;EACT,CAAC;CACH;CAEA,eAAwC;EACtC,AAAI,KAAK,WAAW,CAAC,KAAK,WACxB,OAAO,KAAK,KAAK,OAAO,CAAC,CAAC,SAAS,MAAQ;GACzC,IAAMI,IAAM,KAAK,QAAQC;GACzB,AAAID,KACF;;IAA0BA;CAAI,CAAC,MAAM,MAA6C;IAChF,KAAK,kBAAkBE,EAAI,QAAQ,SAAS,CAAC,CAAC,QAAQ,SAASD,EAAI,YAAY,CAAC;GAClF,CAAC;EAEL,CAAC;CAEL;CAEA,SAA4B;EAC1B,OAAO,KAAK,WAAWf,IAAU,CAAI;CACvC;AACF;;AAtCGC,EAAA,CAAAC,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAAU,EAAA,WAAA,WAAA,KAAA,CAAA,GAMzBX,EAAA,CAAAC,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAAU,EAAA,WAAA,kBAAA,KAAA,CAAA,GC9B5BP,EAAO,cAAcO,CAAS"}
1
+ {"version":3,"file":"site-style.js","names":["nothing","_decorate","property","n","b","define","__decorate","A","installLightDomStyles","UvalibElement","fontFallback","base","tokens","SiteStyle","_args","imp","key","css"],"sources":["../src/components/site-style/SiteStyle.ts","../src/components/site-style/site-style.ts"],"sourcesContent":["import { html, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { UvalibElement } from '../../base/UvalibElement.js';\nimport { installLightDomStyles } from '../../base/light-dom-styles.js';\nimport { fontFallback } from '../../styles/font-fallback.js';\nimport { tokens } from '../../styles/tokens.js';\nimport { base } from '../../styles/base.js';\n\n/**\n * Compatibility element. Light mode (`no-shadow-dom`) installs the tokens and base page\n * styles on the document. Shadow mode only styles inside its own shadow root, so the\n * `:root` and `html, body` rules of those sheets match nothing there and the slotted content\n * is not restyled; it inherits whatever inherited tokens and fonts the page already provides.\n *\n * @tagname site-style\n * @slot - Content rendered in shadow mode; it is not restyled by this element. In light mode there is no shadow root and the children stay in place.\n * @cssprop [--uva-font-family=franklin-gothic-urw, \"UVA Franklin Fallback\", Arial, Helvetica, sans-serif] - Font family.\n * @cssprop [--uva-font-size-base=17px] - Base font size.\n * @cssprop [--uva-grey-darkest=#2b2b2b] - Text colour.\n * @cssprop --uva-color-text - Dark-mode role token: text colour (else `--uva-grey-darkest`).\n * @cssprop --uva-color-surface - Dark-mode role token: page background (else none).\n */\nexport class SiteStyle extends UvalibElement {\n /** The wrapped content keeps the page's own colour scheme. */\n protected static override hostColorScheme = false;\n static styles = [tokens, base];\n\n /** Map of tag name to a module URL whose default export is a stylesheet; ported as is. */\n @property({ type: Object }) imports: { [key: string]: string } = {};\n\n /**\n * Accumulated text of the stylesheets loaded through `imports`. Carried over from the old\n * component for compatibility; it is not rendered anywhere.\n */\n @property({ type: String }) importedStyles = '';\n\n /**\n * Page-level styles: unscoped; the base rules are unlayered (so they beat host resets), the tokens layered, under their own dedupe key, always on the owner\n * document (not the root node) because `:root` tokens inherit into shadow roots.\n */\n protected override installLightStyles(): void {\n // Tokens layered (host `:root` overrides win), base unlayered (beats host resets).\n installLightDomStyles('uvalib-tokens', [tokens], { root: this.ownerDocument, scope: false });\n installLightDomStyles('uvalib-site-style', [fontFallback, base], {\n root: this.ownerDocument,\n scope: false,\n layer: false,\n });\n }\n\n protected override firstUpdated(): void {\n if (this.imports && !this.noStyle) {\n Object.keys(this.imports).forEach((key) => {\n const imp = this.imports[key];\n if (imp) {\n import(/* @vite-ignore */ imp).then((css: { default: { toString(): string } }) => {\n this.importedStyles += css.default.toString().replace(/:host/, key.toLowerCase());\n });\n }\n });\n }\n }\n\n protected override render() {\n return this.lightDom ? nothing : html`<slot></slot>`;\n }\n}\n","import { define } from '../../base/define.js';\nimport { SiteStyle } from './SiteStyle.js';\n\ndefine('site-style', SiteStyle);\n"],"mappings":";;;AAsBA,IAAaa,IAAb,cAA+BJ,EAAc;;EAYE,A,aANoB,KAAA,UAAA,CAAC,GAMrB,KAAA,iBAAA;;;EAVD,KAAA,kBAAA;;;EAC5B,KAAA,SAAA,CAACG,GAAQD,CAAI;;CAe7B,qBAA8C;EAG5C,AADAH,EAAsB,iBAAiB,CAACI,CAAM,GAAG;GAAE,MAAM,KAAK;GAAe,OAAO;EAAM,CAAC,GAC3FJ,EAAsB,qBAAqB,CAACE,GAAcC,CAAI,GAAG;GAC/D,MAAM,KAAK;GACX,OAAO;GACP,OAAO;EACT,CAAC;CACH;CAEA,eAAwC;EACtC,AAAI,KAAK,WAAW,CAAC,KAAK,WACxB,OAAO,KAAK,KAAK,OAAO,CAAC,CAAC,SAAS,MAAQ;GACzC,IAAMI,IAAM,KAAK,QAAQC;GACzB,AAAID,KACF;;IAA0BA;CAAI,CAAC,MAAM,MAA6C;IAChF,KAAK,kBAAkBE,EAAI,QAAQ,SAAS,CAAC,CAAC,QAAQ,SAASD,EAAI,YAAY,CAAC;GAClF,CAAC;EAEL,CAAC;CAEL;CAEA,SAA4B;EAC1B,OAAO,KAAK,WAAWhB,IAAU,CAAI;CACvC;AACF;;AAtCGC,EAAA,CAAAC,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAAW,EAAA,WAAA,WAAA,KAAA,CAAA,GAMzBZ,EAAA,CAAAC,EAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAAW,EAAA,WAAA,kBAAA,KAAA,CAAA,GC/B5BR,EAAO,cAAcQ,CAAS"}
@@ -74,7 +74,7 @@ Loading rules:
74
74
 
75
75
  Theme only through the documented surface, never by reaching into internals:
76
76
 
77
- - Inherited `--uva-*` custom properties (colors such as `--uva-brand-blue`, `--uva-brand-orange`; `--uva-font-family`, `--uva-font-size-base`). Set them on `:root` or an ancestor of `<site-page>`. The full set is in `tokens.css`; per-component ones are in reference/components.md. Prefer the library's values; override only with a stated reason.
77
+ - Inherited `--uva-*` custom properties (colors such as `--uva-brand-blue`, `--uva-brand-orange`; `--uva-font-family`, `--uva-font-size-base`). Set them on `:root` or an ancestor of `<site-page>`. The full set is in `tokens.css`; per-component ones are in reference/components.md. Prefer the library's values; override only with a stated reason. If you override `--uva-font-family`, keep `"UVA Franklin Fallback"` right after `franklin-gothic-urw`: it is Arial matched to Franklin Gothic's metrics, so text does not rewrap and shift the page when the Adobe Fonts kit arrives.
78
78
  - `::part()` in shadow mode. On a page, use `site-page::part(header)`, `site-page::part(footer)` and `site-page::part(main)` (`<site-page>` re-exports the header and footer parts; `site-header::part(header)` cannot reach through its shadow root). For a standalone `<site-header>` or `<site-footer>` use `site-header::part(header)` / `site-footer::part(footer)`. In light mode there are no shadow parts; style the elements with ordinary selectors.
79
79
  - Custom states for runtime state, in shadow and light mode: `uvalib-combobox:state(open)`, `:state(invalid)`, `:state(loading)`; `uvalib-filter-drawer:state(modal)` (phone layout), `:state(open)`; `uvalib-lightbox:state(open)`; `uvalib-tag-list:state(expanded)`. Style them; never add or watch attributes for that state (there are none) or set it yourself (a page cannot). Browsers without custom states just never match.
80
80
  - Never pierce shadow roots with JS, depend on internal class names, or use `!important` to fight the chrome.
@@ -453,7 +453,7 @@ The UVA Library main navigation (About, Using the Library, Research & teaching s
453
453
  | `--uva-brand-blue` | `#232d4b` | Bar bottom border, chevrons, panel links, and the hover and expanded button text. |
454
454
  | `--uva-grey-100` | `#dadada` | Hover and expanded button background, and panel link hover background. |
455
455
  | `--uva-brand-orange` | `#e57200` | Focus ring colour, and the underline of the current page's link and group (also bold, with a 3px underline). |
456
- | `--uva-font-family` | `franklin-gothic-urw, Arial, Helvetica, sans-serif` | Font family. |
456
+ | `--uva-font-family` | `franklin-gothic-urw, "UVA Franklin Fallback", Arial, Helvetica, sans-serif` | Font family. |
457
457
  | `--uva-color-text` | | Dark-mode role token: top-level button text (else `--uva-grey-darkest`). |
458
458
  | `--uva-color-link` | | Dark-mode role token: chevrons, panel links, hover text and the focus ring over hover (else `--uva-brand-blue`). |
459
459
  | `--uva-color-surface-hover` | | Dark-mode role token: hover and open-group background (else `--uva-grey-100`). |
@@ -517,7 +517,7 @@ Page wrapper: skip link (inside the header landmark in shadow mode), header, a s
517
517
  |---|---|---|
518
518
  | `--uva-brand-blue` | `#232d4b` | Skip link background. |
519
519
  | `--uva-brand-orange` | `#e57200` | Focus ring colour (focus-visible outline). |
520
- | `--uva-font-family` | `franklin-gothic-urw, Arial, Helvetica, sans-serif` | Page font family (global styles). |
520
+ | `--uva-font-family` | `franklin-gothic-urw, "UVA Franklin Fallback", Arial, Helvetica, sans-serif` | Page font family (global styles). |
521
521
  | `--uva-font-size-base` | `17px` | Page base font size (global styles). |
522
522
  | `--uva-grey-darkest` | `#2b2b2b` | Page text colour (global styles). |
523
523
  | `--uva-color-surface` | | Dark-mode role token: page background (global styles; else none). |
@@ -549,7 +549,7 @@ Compatibility element. Light mode (`no-shadow-dom`) installs the tokens and base
549
549
 
550
550
  | Property | Default | Description |
551
551
  |---|---|---|
552
- | `--uva-font-family` | `franklin-gothic-urw, Arial, Helvetica, sans-serif` | Font family. |
552
+ | `--uva-font-family` | `franklin-gothic-urw, "UVA Franklin Fallback", Arial, Helvetica, sans-serif` | Font family. |
553
553
  | `--uva-font-size-base` | `17px` | Base font size. |
554
554
  | `--uva-grey-darkest` | `#2b2b2b` | Text colour. |
555
555
  | `--uva-color-text` | | Dark-mode role token: text colour (else `--uva-grey-darkest`). |
@@ -1,4 +1,50 @@
1
1
 
2
+ @font-face {
3
+ font-family: 'UVA Franklin Fallback';
4
+ src: local('Arial'), local('ArialMT'), local('Liberation Sans'), local('LiberationSans');
5
+ font-weight: 100 450;
6
+ font-style: normal;
7
+ size-adjust: 94.52%;
8
+ ascent-override: 100.93%;
9
+ descent-override: 26.56%;
10
+ line-gap-override: 0%;
11
+ }
12
+ @font-face {
13
+ font-family: 'UVA Franklin Fallback';
14
+ src: local('Arial'), local('ArialMT'), local('Liberation Sans'), local('LiberationSans');
15
+ font-weight: 451 599;
16
+ font-style: normal;
17
+ size-adjust: 95.99%;
18
+ ascent-override: 99.18%;
19
+ descent-override: 26.04%;
20
+ line-gap-override: 0%;
21
+ }
22
+ @font-face {
23
+ font-family: 'UVA Franklin Fallback';
24
+ src:
25
+ local('Arial Bold'), local('Arial-BoldMT'), local('Liberation Sans Bold'),
26
+ local('LiberationSans-Bold');
27
+ font-weight: 600 1000;
28
+ font-style: normal;
29
+ size-adjust: 91.32%;
30
+ ascent-override: 104.03%;
31
+ descent-override: 27.38%;
32
+ line-gap-override: 0%;
33
+ }
34
+ @font-face {
35
+ font-family: 'UVA Franklin Fallback';
36
+ src:
37
+ local('Arial Italic'), local('Arial-ItalicMT'), local('Liberation Sans Italic'),
38
+ local('LiberationSans-Italic');
39
+ font-weight: 100 599;
40
+ font-style: italic;
41
+ size-adjust: 95.06%;
42
+ ascent-override: 101.09%;
43
+ descent-override: 26.4%;
44
+ line-gap-override: 0%;
45
+ }
46
+
47
+
2
48
  :root {
3
49
  --uva-brand-blue-lightest: #87B9D9;
4
50
  --uva-brand-blue-lighter: #3395D4;
@@ -76,7 +122,7 @@
76
122
  --uva-grey: #808080;
77
123
  --uva-grey-A: #4F4F4F;
78
124
  --uva-grey-B: #2B2B2B;
79
- --uva-font-family: franklin-gothic-urw, Arial, Helvetica, sans-serif;
125
+ --uva-font-family: franklin-gothic-urw, "UVA Franklin Fallback", Arial, Helvetica, sans-serif;
80
126
  --uva-font-size-base: 17px;
81
127
  }
82
128
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uvalib/web-components",
3
- "version": "1.8.0",
3
+ "version": "1.8.3",
4
4
  "description": "UVA Library reusable web components",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -74,7 +74,7 @@ Loading rules:
74
74
 
75
75
  Theme only through the documented surface, never by reaching into internals:
76
76
 
77
- - Inherited `--uva-*` custom properties (colors such as `--uva-brand-blue`, `--uva-brand-orange`; `--uva-font-family`, `--uva-font-size-base`). Set them on `:root` or an ancestor of `<site-page>`. The full set is in `tokens.css`; per-component ones are in reference/components.md. Prefer the library's values; override only with a stated reason.
77
+ - Inherited `--uva-*` custom properties (colors such as `--uva-brand-blue`, `--uva-brand-orange`; `--uva-font-family`, `--uva-font-size-base`). Set them on `:root` or an ancestor of `<site-page>`. The full set is in `tokens.css`; per-component ones are in reference/components.md. Prefer the library's values; override only with a stated reason. If you override `--uva-font-family`, keep `"UVA Franklin Fallback"` right after `franklin-gothic-urw`: it is Arial matched to Franklin Gothic's metrics, so text does not rewrap and shift the page when the Adobe Fonts kit arrives.
78
78
  - `::part()` in shadow mode. On a page, use `site-page::part(header)`, `site-page::part(footer)` and `site-page::part(main)` (`<site-page>` re-exports the header and footer parts; `site-header::part(header)` cannot reach through its shadow root). For a standalone `<site-header>` or `<site-footer>` use `site-header::part(header)` / `site-footer::part(footer)`. In light mode there are no shadow parts; style the elements with ordinary selectors.
79
79
  - Custom states for runtime state, in shadow and light mode: `uvalib-combobox:state(open)`, `:state(invalid)`, `:state(loading)`; `uvalib-filter-drawer:state(modal)` (phone layout), `:state(open)`; `uvalib-lightbox:state(open)`; `uvalib-tag-list:state(expanded)`. Style them; never add or watch attributes for that state (there are none) or set it yourself (a page cannot). Browsers without custom states just never match.
80
80
  - Never pierce shadow roots with JS, depend on internal class names, or use `!important` to fight the chrome.
@@ -453,7 +453,7 @@ The UVA Library main navigation (About, Using the Library, Research & teaching s
453
453
  | `--uva-brand-blue` | `#232d4b` | Bar bottom border, chevrons, panel links, and the hover and expanded button text. |
454
454
  | `--uva-grey-100` | `#dadada` | Hover and expanded button background, and panel link hover background. |
455
455
  | `--uva-brand-orange` | `#e57200` | Focus ring colour, and the underline of the current page's link and group (also bold, with a 3px underline). |
456
- | `--uva-font-family` | `franklin-gothic-urw, Arial, Helvetica, sans-serif` | Font family. |
456
+ | `--uva-font-family` | `franklin-gothic-urw, "UVA Franklin Fallback", Arial, Helvetica, sans-serif` | Font family. |
457
457
  | `--uva-color-text` | | Dark-mode role token: top-level button text (else `--uva-grey-darkest`). |
458
458
  | `--uva-color-link` | | Dark-mode role token: chevrons, panel links, hover text and the focus ring over hover (else `--uva-brand-blue`). |
459
459
  | `--uva-color-surface-hover` | | Dark-mode role token: hover and open-group background (else `--uva-grey-100`). |
@@ -517,7 +517,7 @@ Page wrapper: skip link (inside the header landmark in shadow mode), header, a s
517
517
  |---|---|---|
518
518
  | `--uva-brand-blue` | `#232d4b` | Skip link background. |
519
519
  | `--uva-brand-orange` | `#e57200` | Focus ring colour (focus-visible outline). |
520
- | `--uva-font-family` | `franklin-gothic-urw, Arial, Helvetica, sans-serif` | Page font family (global styles). |
520
+ | `--uva-font-family` | `franklin-gothic-urw, "UVA Franklin Fallback", Arial, Helvetica, sans-serif` | Page font family (global styles). |
521
521
  | `--uva-font-size-base` | `17px` | Page base font size (global styles). |
522
522
  | `--uva-grey-darkest` | `#2b2b2b` | Page text colour (global styles). |
523
523
  | `--uva-color-surface` | | Dark-mode role token: page background (global styles; else none). |
@@ -549,7 +549,7 @@ Compatibility element. Light mode (`no-shadow-dom`) installs the tokens and base
549
549
 
550
550
  | Property | Default | Description |
551
551
  |---|---|---|
552
- | `--uva-font-family` | `franklin-gothic-urw, Arial, Helvetica, sans-serif` | Font family. |
552
+ | `--uva-font-family` | `franklin-gothic-urw, "UVA Franklin Fallback", Arial, Helvetica, sans-serif` | Font family. |
553
553
  | `--uva-font-size-base` | `17px` | Base font size. |
554
554
  | `--uva-grey-darkest` | `#2b2b2b` | Text colour. |
555
555
  | `--uva-color-text` | | Dark-mode role token: text colour (else `--uva-grey-darkest`). |
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-BI8h0Gf3.js","names":["i","tokens","TYPEKIT_URL","base"],"sources":["../../src/styles/tokens.ts","../../src/styles/base.ts"],"sourcesContent":["// GENERATED by scripts/sync-tokens.mjs from ../monorepo/packages/drupal_library_theme/src/scss/base — do not edit\nimport { css } from 'lit';\n\nexport const tokens = css`\n :root {\n --uva-brand-blue-lightest: #87B9D9;\n --uva-brand-blue-lighter: #3395D4;\n --uva-brand-blue-light: #0370B7;\n --uva-brand-blue-base: #232D4B;\n --uva-brand-blue-300: #87B9D9;\n --uva-brand-blue-200: #3395D4;\n --uva-brand-blue-100: #0370B7;\n --uva-brand-blue: #232D4B;\n --uva-brand-orange-lightest: #FFEAD6;\n --uva-brand-orange-lighter: #FFC999;\n --uva-brand-orange-light: #FFB370;\n --uva-brand-orange-base: #E57200;\n --uva-brand-orange-dark: #B35900;\n --uva-brand-orange-darker: #854200;\n --uva-brand-orange-300: #FFEAD6;\n --uva-brand-orange-200: #FFC999;\n --uva-brand-orange-100: #FFB370;\n --uva-brand-orange: #E57200;\n --uva-brand-orange-A: #B35900;\n --uva-brand-orange-B: #854200;\n --uva-blue-alt-lightest: #BFE7F7;\n --uva-blue-alt-lighter: #91D8F2;\n --uva-blue-alt-light: #55C4EC;\n --uva-blue-alt-base: #007BAC;\n --uva-blue-alt-dark: #005679;\n --uva-blue-alt-darkest: #141E3C;\n --uva-blue-alt-400: #e6f2f7;\n --uva-blue-alt-300: #BFE7F7;\n --uva-blue-alt-200: #91D8F2;\n --uva-blue-alt-100: #55C4EC;\n --uva-blue-alt: #007BAC;\n --uva-blue-alt-A: #005679;\n --uva-blue-alt-B: #141E3C;\n --uva-teal-lightest: #C8F2F4;\n --uva-teal-light: #5BD7DE;\n --uva-teal-base: #25CAD3;\n --uva-teal-dark: #1DA1A8;\n --uva-teal-darker: #16777C;\n --uva-teal-200: #C8F2F4;\n --uva-teal-100: #5BD7DE;\n --uva-teal: #25CAD3;\n --uva-teal-A: #1DA1A8;\n --uva-teal-B: #16777C;\n --uva-green-lightest: #DDEFDC;\n --uva-green-lighter: #89CC74;\n --uva-green-base: #62BB46;\n --uva-green-dark: #4E9737;\n --uva-green-200: #DDEFDC;\n --uva-green-100: #89CC74;\n --uva-green: #62BB46;\n --uva-green-A: #4E9737;\n --uva-red-lightest: #FBCFDA;\n --uva-red-base: #EF3F6B;\n --uva-red-dark: #DF1E43;\n --uva-red-darker: #B30000;\n --uva-red-100: #FBCFDA;\n --uva-red: #EF3F6B;\n --uva-red-A: #DF1E43;\n --uva-red-B: #B30000;\n --uva-yellow-lightest: #FEF6C8;\n --uva-yellow-base: #ECC602;\n --uva-yellow-dark: #B99C02;\n --uva-yellow-100: #FEF6C8;\n --uva-yellow: #ECC602;\n --uva-yellow-A: #B99C02;\n --uva-grey-lightest: #F1F1F1;\n --uva-grey-light: #DADADA;\n --uva-grey-base: #808080;\n --uva-grey-dark: #4F4F4F;\n --uva-grey-darkest: #2B2B2B;\n --uva-grey-200: #F1F1F1;\n --uva-grey-100: #DADADA;\n --uva-grey-50: #ADADAD;\n --uva-grey: #808080;\n --uva-grey-A: #4F4F4F;\n --uva-grey-B: #2B2B2B;\n --uva-font-family: franklin-gothic-urw, Arial, Helvetica, sans-serif;\n --uva-font-size-base: 17px;\n }\n`;\n","import { css } from 'lit';\n\nexport const TYPEKIT_URL = 'https://use.typekit.net/oym8nvz.css';\n\n// The body background has no fallback: without dark mode it stays transparent, as before.\n//\n// site-page:not(:defined) applies when base.css is linked in <head>, before the element\n// upgrades: its own formatting context (flow-root), so a heading's top margin cannot collapse\n// through to <body> and shift the page once the element upgrades, and invisible, so its\n// content does not paint above where the header will go. If the script never loads, the\n// content appears anyway after two seconds.\nexport const base = css`\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n html,\n body {\n font-family: var(--uva-font-family, franklin-gothic-urw, Arial, Helvetica, sans-serif);\n }\n html {\n font-size: var(--uva-font-size-base, 17px);\n }\n body {\n margin: 0;\n line-height: 1.5;\n min-height: 100vh;\n color: var(--uva-color-text, var(--uva-grey-darkest, #2b2b2b));\n background-color: var(--uva-color-surface);\n }\n site-page:not(:defined) {\n display: flow-root;\n visibility: hidden;\n animation: uvalib-site-page-reveal 0s 2s forwards;\n }\n uvalib-breadcrumbs:not(:defined),\n uvalib-card:not(:defined),\n uvalib-card-grid:not(:defined),\n uvalib-pager:not(:defined),\n uvalib-contents:not(:defined),\n uvalib-metadata:not(:defined),\n uvalib-tag-list:not(:defined) {\n display: block;\n line-height: 1.5;\n visibility: hidden;\n animation: uvalib-site-page-reveal 0s 2s forwards;\n }\n /* A chip row: hidden, one 44px row tall (with the scrolling row's padding), the raw\n children kept on one line so they cannot make it taller. */\n uvalib-chip-group:not(:defined) {\n display: block;\n min-height: 44px;\n max-width: 100%;\n overflow: hidden;\n white-space: nowrap;\n visibility: hidden;\n animation: uvalib-site-page-reveal 0s 2s forwards;\n }\n uvalib-chip-group[scroll]:not(:defined) {\n min-height: calc(44px + 0.75rem);\n }\n /* A description: one line of it (0.875rem at 1.5, 0.25rem below the row). */\n uvalib-chip-group[description]:not(:defined) {\n padding-block-end: 1.5625rem;\n }\n /* Its text is drawn from attributes: hold one line until it upgrades. */\n uvalib-results-count:not(:defined) {\n display: block;\n min-block-size: 1.5em;\n }\n uvalib-tag-list:not(:defined)[hidden],\n uvalib-results-count:not(:defined)[hidden] {\n display: none;\n }\n /* The pre-upgrade rules here set display, which beats the hidden attribute's (issue #7).\n More specific than each of them (two pseudo-classes or attributes), so it needs no importance flag. */\n :where(\n site-page,\n uvalib-breadcrumbs,\n uvalib-card,\n uvalib-card-grid,\n uvalib-pager,\n uvalib-contents,\n uvalib-metadata,\n uvalib-chip-group,\n uvalib-tabs,\n uvalib-combobox,\n uvalib-image-regions,\n uvalib-map,\n uvalib-filter-drawer\n ):not(:defined)[hidden],\n :where(uvalib-combobox, uvalib-image-regions):not(:defined) > [hidden] {\n display: none;\n }\n /* Tabs stay readable before the script runs: a block, one panel, and a gap the\n size of the tab row (44px) plus its 1rem margin, so the first panel does not\n jump when the element upgrades. Later data-tab panels stay hidden. */\n uvalib-tabs:not(:defined) {\n display: block;\n padding-block-start: calc(44px + 1rem);\n }\n uvalib-tabs:not(:defined) > [data-tab] ~ [data-tab] {\n display: none;\n }\n /* A combobox: its label (from the attribute) and one 44px field (plus a one-line\n description) held, so nothing moves when it upgrades. A fallback <input list> child\n works meanwhile; the other children (options, a datalist) stay out of sight. */\n uvalib-combobox:not(:defined) {\n display: block;\n min-block-size: calc(1.5em + 0.25rem + 44px);\n line-height: 1.5;\n }\n uvalib-combobox[description]:not(:defined) {\n min-block-size: calc(3em + 0.5rem + 44px);\n }\n uvalib-combobox:not(:defined)::before {\n content: attr(label);\n display: block;\n margin-block-end: 0.25rem;\n font-weight: 600;\n }\n uvalib-combobox:not(:defined) > :not(input) {\n display: none;\n }\n uvalib-combobox:not(:defined) > input {\n display: block;\n box-sizing: border-box;\n inline-size: 100%;\n min-block-size: 44px;\n font: inherit;\n line-height: 1.2;\n }\n /* Image regions: the image at its own width and the list beside it (or under it), the\n layout the element keeps once it upgrades, so the image does not move. */\n uvalib-image-regions:not(:defined) {\n display: flex;\n flex-wrap: wrap;\n gap: 1rem;\n align-items: flex-start;\n }\n uvalib-image-regions:not(:defined) > :is(img, picture) {\n display: block;\n flex: 0 1 auto;\n min-width: 0;\n max-width: 100%;\n height: auto;\n }\n uvalib-image-regions:not(:defined) > :is(ol, ul) {\n flex: 1 1 14rem;\n min-width: 0;\n }\n /* A map: its key instructions (the same text it shows) and the map's height held above\n the child list, so the list does not move when the map is drawn over the page's\n Leaflet. Padding, not margin, so it cannot collapse with the list's own top margin. */\n uvalib-map:not(:defined) {\n display: block;\n }\n uvalib-map:not(:defined)::before {\n content: 'Tab or arrow keys move between places; Enter opens one. With the map focused, arrow keys pan and + and − zoom.';\n display: block;\n padding-block-end: calc(0.5rem + max(12rem, var(--uvalib-map-height, min(24rem, 75vw))));\n font-size: 0.875rem;\n line-height: 1.5;\n color: var(--uva-color-text-muted, #4b5563);\n }\n /* A filter drawer on a phone (the default 48rem breakpoint): once it upgrades only its 44px\n \"Search and filters\" button shows, so hold that height and keep the form and filters out\n of sight meanwhile; nothing moves when it upgrades. A page with its own breakpoint adds the\n same two rules in a media query of that width (see the README). Low specificity, so the\n [hidden] rule above still wins. */\n @media (max-width: 48rem) {\n :where(uvalib-filter-drawer:not([breakpoint])):not(:defined) {\n display: block;\n min-block-size: 44px;\n }\n :where(uvalib-filter-drawer:not([breakpoint])):not(:defined) > * {\n display: none;\n }\n }\n /* Printing a <site-page> (issue #20; its own styles leave out the chrome): a dark scheme\n prints light (the role tokens resolve to their light values), and the content's links\n are black and underlined, so they are told apart without colour. Content is <main> in\n light DOM and the unslotted children in shadow DOM. print-chrome keeps the page as it is\n shown, apart from the light scheme. */\n @media print {\n :root[data-uva-color-scheme]:has(site-page) {\n color-scheme: light;\n --uva-color-scheme: light;\n }\n /* Light DOM's trail, here too, as the pre-upgrade rule above (unlayered) would win. */\n site-page:not([print-chrome]) > [slot='breadcrumbs'] {\n display: none;\n }\n site-page:not([print-chrome]) > :not([slot], site-header, site-footer, .alerts-list) :any-link,\n site-page:not([print-chrome]) > :any-link:not([slot], .skip-link) {\n color: #000;\n text-decoration: underline;\n }\n }\n @keyframes uvalib-site-page-reveal {\n to {\n visibility: visible;\n }\n }\n`;\n"],"mappings":";;AAGA,IAAaC,IAAS,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GCDZC,IAAc,uCASdC,IAAO,CAAG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"site-main-nav-DURrQMal.js","names":["t","unsafeCSS","ifDefined","_decorate","property","state","n","i","r$1","b","define","__decorate","r","installLightDomStyles","UvalibElement","trackEvent","accessible","siteLink","o","A","str","v","normalizeItems","out","raw","collect","nodes","label","href","kids","into","depth","links","text","el","readItemsMarkup","list","source","readLi","li","sub","k","head","mainNavTiming","fetchJson","error","attempts","response","url","cache","loadMainNavItems","p","promise","result","json","MAIN_NAV_SNAPSHOT","\"label\"","\"items\"","\"href\"","navCounter","MAIN_NAV","isSourceChild","SOURCE_ATTRS","FOCUS_RULES","focusRules","lightFocusRules","tag","pageKey","u","base","hashOf","SiteMainNav","_args","nav","root","win","on","target","type","kind","what","moved","sources","next","s","content","changed","src","key","index","opening","doc","to","tops","top","open","openButton","panel","button","here","matches","hrefs","h","hash","a","group","items","item","l","all","current","mark","marked","cur","id","expanded","has","linkMarked"],"sources":["../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directives/if-defined.js","../../src/components/site-main-nav/main-nav-items.ts","../../src/components/site-main-nav/main-nav-data.ts","../../src/components/site-main-nav/SiteMainNav.ts","../../src/components/site-main-nav/site-main-nav.ts"],"sourcesContent":["import{nothing as t}from\"../lit-html.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o=o=>o??t;export{o as ifDefined};\n//# sourceMappingURL=if-defined.js.map\n","// Data helpers for <site-main-nav>: the item types, normalising items from any source\n// (property, JSON, markup) to the two levels the nav shows, and the `items-src` loader.\n// Internal apart from the types. No side effects on import.\n\n/** A link inside a main-navigation group. */\nexport interface MainNavLink {\n label: string;\n href: string;\n}\n\n/**\n * One top-level main-navigation entry: a group (a button that discloses `items`) or, with\n * no `items`, a direct link to `href`. A group's own `href` is not shown.\n */\nexport interface MainNavItem {\n label: string;\n href?: string;\n items?: MainNavLink[];\n}\n\n/** What normalising found besides the items: skipped entries, flattened deeper levels. */\nexport interface NormalizeResult {\n items: MainNavItem[];\n invalid: boolean;\n flattened: boolean;\n}\n\nconst str = (v: unknown): string => (typeof v === 'string' ? v.replace(/\\s+/g, ' ').trim() : '');\n\n/**\n * Reduce untrusted items (a property, JSON or parsed markup) to the two levels the nav\n * shows. Entries without a label, links without an href, and groups with no valid links\n * are skipped (`invalid`); links nested deeper than a group are lifted into it\n * (`flattened`), and a deeper level's own label is dropped unless it has an href.\n */\nexport function normalizeItems(raw: unknown): NormalizeResult {\n const out: NormalizeResult = { items: [], invalid: false, flattened: false };\n if (!Array.isArray(raw)) {\n out.invalid = raw != null;\n return out;\n }\n const collect = (nodes: unknown[], into: MainNavLink[], depth: number): void => {\n for (const n of nodes) {\n const o = (n ?? {}) as Record<string, unknown>;\n const label = str(o.label);\n const href = str(o.href);\n const kids = Array.isArray(o.items) && o.items.length ? o.items : null;\n if (kids) {\n out.flattened = true;\n if (label && href) into.push({ label, href });\n collect(kids, into, depth + 1);\n } else if (label && href) {\n into.push({ label, href });\n } else {\n out.invalid = true;\n }\n }\n };\n for (const n of raw) {\n const o = (n ?? {}) as Record<string, unknown>;\n const label = str(o.label);\n const href = str(o.href);\n const kids = Array.isArray(o.items) && o.items.length ? o.items : null;\n if (!label) {\n out.invalid = true;\n } else if (kids) {\n const links: MainNavLink[] = [];\n collect(kids, links, 2);\n if (links.length) out.items.push({ label, items: links });\n else if (href) out.items.push({ label, href });\n else out.invalid = true;\n } else if (href) {\n out.items.push({ label, href });\n } else {\n out.invalid = true;\n }\n }\n return out;\n}\n\nconst text = (el: Element): string => (el.textContent ?? '').replace(/\\s+/g, ' ').trim();\n\n/**\n * Read `<nav><ul><li>…</li></ul></nav>` (or a bare `<ul>`) markup into raw items: an\n * `<li>` holding an `<a href>` (and no list) is a direct link; an `<li>` whose first child\n * element is a label (`<span>`, or any element but a list) followed by a `<ul>` is a group.\n * Anything else is reported as invalid by normalizeItems().\n */\nexport function readItemsMarkup(source: Element): unknown[] {\n const list =\n source.localName === 'ul' ? source : (source.querySelector(':scope > ul') ?? undefined);\n if (!list) return [{}];\n const readLi = (li: Element): unknown => {\n if (li.localName !== 'li') return {};\n const kids = [...li.children];\n const sub = kids.find((k) => k.localName === 'ul');\n const head = kids.find((k) => k.localName !== 'ul');\n if (!head) return {};\n const label = text(head);\n const href = head.localName === 'a' ? head.getAttribute('href') : null;\n if (!sub) return head.localName === 'a' ? { label, href } : { label };\n return { label, href, items: [...sub.children].map(readLi) };\n };\n return [...list.children].map(readLi);\n}\n\n/**\n * `items-src` fetch: how many attempts, the delay between them (ms) and each attempt's\n * timeout (ms). With the defaults a hung server is given up on after about 21 s.\n */\nexport const mainNavTiming = { attempts: 2, retryDelay: 1000, timeout: 10_000 };\n\nasync function fetchJson(url: string): Promise<unknown> {\n let error: unknown;\n const attempts = Math.max(1, mainNavTiming.attempts);\n for (let i = 0; i < attempts; i++) {\n if (i > 0) await new Promise((r) => setTimeout(r, mainNavTiming.retryDelay));\n try {\n // A hung attempt times out and counts as a failed attempt.\n const response = await fetch(url, { signal: AbortSignal.timeout(mainNavTiming.timeout) });\n if (!response.ok) throw new Error(`${response.status} ${response.statusText} for ${url}`);\n return await response.json();\n } catch (e) {\n error = e;\n }\n }\n throw error instanceof Error ? error : new Error(String(error));\n}\n\nconst cache = new Map<string, Promise<NormalizeResult>>();\n\n/**\n * The items at `url` (JSON in the `MainNavItem[]` shape), fetched once per URL and shared by\n * every nav on the page. A response with no valid entries is an error. Failures are not\n * cached, so a later load tries again.\n */\nexport function loadMainNavItems(url: string): Promise<NormalizeResult> {\n let p = cache.get(url);\n if (!p) {\n const promise = fetchJson(url).then((json) => {\n const result = normalizeItems(json);\n if (!result.items.length) throw new Error(`no valid main navigation entries in ${url}`);\n return result;\n });\n cache.set(url, (p = promise));\n promise.catch(() => {\n if (cache.get(url) === promise) cache.delete(url);\n });\n }\n return p;\n}\n","// GENERATED by scripts/sync-main-nav.mjs from a saved page on 2026-11-14 — do not edit.\n// The desktop \"Main navigation\" of library.virginia.edu. Regenerate with `pnpm sync:main-nav`.\nimport type { MainNavItem } from './main-nav-items.js';\n\n/** The day the snapshot was taken (YYYY-MM-DD). */\nexport const MAIN_NAV_SNAPSHOT_DATE = '2026-11-14';\n\n/** The library main navigation, as on library.virginia.edu when the snapshot was taken. */\nexport const MAIN_NAV_SNAPSHOT: readonly MainNavItem[] = [\n {\n \"label\": \"About\",\n \"items\": [\n {\n \"label\": \"About UVA Library\",\n \"href\": \"/about-uva-library\"\n },\n {\n \"label\": \"News & announcements\",\n \"href\": \"https://library.virginia.edu/news/all?mtm_campaign=main-nav\"\n },\n {\n \"label\": \"Plan a visit\",\n \"href\": \"/about-uva-library#visit\"\n },\n {\n \"label\": \"Library Assessment\",\n \"href\": \"/assessment\"\n },\n {\n \"label\": \"Staff directory\",\n \"href\": \"/staff\"\n }\n ]\n },\n {\n \"label\": \"Using the Library\",\n \"items\": [\n {\n \"label\": \"Search, borrow, request\",\n \"href\": \"/services\"\n },\n {\n \"label\": \"Library spaces\",\n \"href\": \"/spaces\"\n },\n {\n \"label\": \"Equipment & technology\",\n \"href\": \"/equipment-and-tech\"\n }\n ]\n },\n {\n \"label\": \"Research & teaching support\",\n \"items\": [\n {\n \"label\": \"Research & teaching support\",\n \"href\": \"/research-and-teaching\"\n },\n {\n \"label\": \"Research support\",\n \"href\": \"/research-and-teaching/research\"\n },\n {\n \"label\": \"Instruction assistance\",\n \"href\": \"/research-and-teaching/teach\"\n },\n {\n \"label\": \"Writing & publication\",\n \"href\": \"/research-and-teaching/write\"\n }\n ]\n },\n {\n \"label\": \"Get help\",\n \"items\": [\n {\n \"label\": \"Get help\",\n \"href\": \"/help\"\n },\n {\n \"label\": \"Ask a Librarian\",\n \"href\": \"/askalibrarian\"\n },\n {\n \"label\": \"Accessibility services\",\n \"href\": \"/accessibility\"\n },\n {\n \"label\": \"Subject specialists\",\n \"href\": \"https://guides.lib.virginia.edu/subjectlibrarians\"\n }\n ]\n }\n];\n","import { html, css, unsafeCSS, type PropertyValues } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { trackEvent } from '../../base/analytics.js';\nimport { UvalibElement } from '../../base/UvalibElement.js';\nimport { installLightDomStyles } from '../../base/light-dom-styles.js';\nimport { accessible } from '../../styles/accessible.js';\nimport { siteLink } from '../link.js';\nimport { MAIN_NAV_SNAPSHOT } from './main-nav-data.js';\nimport {\n loadMainNavItems,\n normalizeItems,\n readItemsMarkup,\n type MainNavItem,\n type NormalizeResult,\n} from './main-nav-items.js';\n\nexport type { MainNavItem, MainNavLink } from './main-nav-items.js';\n\n/** Light-DOM instances share the document id space, so every instance numbers its own ids. */\nlet navCounter = 0;\n\nconst MAIN_NAV = 'main-nav';\nconst isSourceChild = (n: Node): n is Element =>\n n instanceof Element && n.getAttribute('slot') === MAIN_NAV;\n/** Attributes of the source markup that change what the nav renders. */\nconst SOURCE_ATTRS = ['href', 'slot'];\n\n/**\n * Focus rings: inset (as on the live site) so an open panel or a neighbour never covers\n * them; orange on white, brand blue where the background is grey (hover, the open group),\n * so the ring keeps 3:1 contrast.\n */\nconst FOCUS_RULES = `\n .toggle:focus-visible,\n .top-link:focus-visible,\n .panel a:focus-visible {\n outline: 3px solid var(--uva-color-focus, var(--uva-brand-orange, #e57200));\n outline-offset: -4px;\n }\n .toggle[aria-expanded='true']:focus-visible,\n .toggle:hover:focus-visible,\n .top-link:hover:focus-visible,\n .panel a:hover:focus-visible {\n outline-color: var(--uva-color-link, var(--uva-brand-blue, #232d4b));\n }\n`;\nconst focusRules = unsafeCSS(FOCUS_RULES);\n/** The focus rules scoped to `tag`, for the unlayered light-mode sheet. */\nconst lightFocusRules = (tag: string) =>\n unsafeCSS(FOCUS_RULES.replace(/(^|,)\\s*\\./gm, `$1 ${tag} .`));\n\n/** A URL reduced to what \"the same page\" means here: host (without `www.`) and path. */\nfunction pageKey(href: string, base: string): string | null {\n try {\n const u = new URL(href, base);\n return `${u.host.replace(/^www\\./, '')}${u.pathname.replace(/\\/+$/, '')}`;\n } catch {\n return null;\n }\n}\nconst hashOf = (href: string, base: string): string => {\n try {\n return new URL(href, base).hash;\n } catch {\n return '';\n }\n};\n\n/**\n * The UVA Library main navigation (About, Using the Library, Research & teaching support,\n * Get help), as on library.virginia.edu, following the WAI-ARIA disclosure navigation\n * pattern: one `<nav>` landmark; each group is a `<button aria-expanded aria-controls>`\n * followed by its list of links, and an entry with no group is a plain link. Click, Enter or\n * Space toggles a group and only one is open at a time; Escape closes it and returns focus to\n * its button; arrow keys, Home and End move between the buttons and between a panel's links,\n * and ArrowDown on an open button moves into its panel. In the `bar` layout a panel also closes\n * when focus leaves the nav or on a pointer press outside it. There is no hover-to-open.\n *\n * The items come from, in order of precedence: a `<nav slot=\"main-nav\">` child holding\n * `<ul><li><a href>…</a></li></ul>` (a direct link) or `<li><span>Group</span><ul><li><a href>…`\n * (a group), kept hidden and watched for changes; the `items` property; JSON at `items-src`;\n * and the snapshot of the live menu bundled with the component (see `pnpm sync:main-nav`).\n * Invalid entries are skipped and levels deeper than two are flattened, each with one console\n * warning. Relative hrefs are joined to `root-link-domain`; absolute ones are kept, and\n * fragment-only ones (`#…`, a hash route) stay on this page. A plain click on a link closes\n * the open group.\n *\n * The link for the current page (`current`, default the page location, followed through\n * same-document navigations; host and path, ignoring the query, the hash, a trailing slash\n * and a leading `www.`) gets `aria-current=\"page\"`, and its group button\n * `aria-current=\"true\"`, shown bold with a thick underline. Of links that differ only by\n * hash, the one with the page's hash is marked, else the one without a hash; if every one\n * has a hash, the first is marked while the page has none, and none for a hash none has.\n *\n * `<site-header>` renders it: as a row under the logo on wide screens and as an accordion in\n * the Menu popover on narrow ones.\n *\n * @tagname site-main-nav\n * @slot main-nav - Optional `<nav>` (or `<ul>`) whose list replaces the menu: `<li><a href>` for a direct link, `<li><span>Group</span><ul><li><a href>…</a></li></ul></li>` for a group. It is never shown itself; in light mode it is moved into a hidden holder.\n * @fires site-main-nav-error - `items-src` could not be loaded: both attempts failed (network error, a 10 s timeout per attempt, or no valid entries), after about 21 s at worst; the nav shows the bundled snapshot. `detail` is `{ src, message }`. Bubbles and is composed.\n * @fires uvalib-analytics-event - For `<site-analytics>`: a group was opened, `['site-main-nav', 'menu-open', <the group's label>]` (not on close), and a link was clicked, `['site-main-nav', 'link-click', '<Group> > <Link>']` (a top-level link: its label alone; never the URL). Bubbles and is composed.\n * @cssprop [--uva-grey-darkest=#2b2b2b] - Top-level button colour.\n * @cssprop [--uva-brand-blue=#232d4b] - Bar bottom border, chevrons, panel links, and the hover and expanded button text.\n * @cssprop [--uva-grey-100=#dadada] - Hover and expanded button background, and panel link hover background.\n * @cssprop [--uva-brand-orange=#e57200] - Focus ring colour, and the underline of the current page's link and group (also bold, with a 3px underline).\n * @cssprop [--uva-font-family=franklin-gothic-urw, Arial, Helvetica, sans-serif] - Font family.\n * @cssprop --uva-color-text - Dark-mode role token: top-level button text (else `--uva-grey-darkest`).\n * @cssprop --uva-color-link - Dark-mode role token: chevrons, panel links, hover text and the focus ring over hover (else `--uva-brand-blue`).\n * @cssprop --uva-color-surface-hover - Dark-mode role token: hover and open-group background (else `--uva-grey-100`).\n * @cssprop --uva-color-surface-raised - Dark-mode role token: bar and panel background (else #ffffff).\n * @cssprop --uva-color-accent-bg - Dark-mode role token: bar bottom rule (else `--uva-brand-blue`).\n * @cssprop --uva-color-shadow - Dark-mode role token: panel shadow colour (else rgba(0, 0, 0, 0.2)).\n * @cssprop --uva-color-focus - Dark-mode role token: focus ring (else `--uva-brand-orange`).\n * @cssprop --uva-color-current - Dark-mode role token: current-page underline (else `--uva-brand-orange`).\n */\nexport class SiteMainNav extends UvalibElement {\n static styles = [\n accessible,\n css`\n :host {\n display: block;\n font-family: var(--uva-font-family, franklin-gothic-urw, Arial, Helvetica, sans-serif);\n font-size: 17px;\n line-height: 1.5;\n }\n :host([hidden]) {\n display: none;\n }\n ul {\n list-style: none;\n margin: 0;\n padding: 0;\n }\n .panel[hidden] {\n display: none;\n }\n .toggle,\n .top-link {\n display: flex;\n align-items: center;\n box-sizing: border-box;\n margin: 0;\n border: 0;\n border-radius: 0;\n background: transparent;\n color: var(--uva-color-text, var(--uva-grey-darkest, #2b2b2b));\n font: inherit;\n font-weight: 500;\n line-height: 1.5;\n text-align: start;\n text-decoration: none;\n cursor: pointer;\n }\n /* Chevron: a rotated border box, turned over when expanded. */\n .toggle::after {\n content: '';\n flex: none;\n inline-size: 0.5em;\n block-size: 0.5em;\n margin-inline-start: 0.75em;\n border-style: solid;\n border-color: var(--uva-color-link, var(--uva-brand-blue, #232d4b));\n border-width: 0 1px 1px 0;\n transform: translateY(-0.15em) rotate(45deg);\n }\n .toggle[aria-expanded='true']::after {\n transform: translateY(0.15em) rotate(-135deg);\n }\n /* Grey for hover and the open group only, never for focus: the orange focus ring\n would fall below 3:1 against it. */\n .toggle:hover,\n .toggle[aria-expanded='true'],\n .top-link:hover {\n background-color: var(--uva-color-surface-hover, var(--uva-grey-100, #dadada));\n color: var(--uva-color-link, var(--uva-brand-blue, #232d4b));\n }\n .panel a {\n display: block;\n color: var(--uva-color-link, var(--uva-brand-blue, #232d4b));\n font-weight: 400;\n text-decoration: underline;\n }\n .panel a:hover {\n background-color: var(--uva-color-surface-hover, var(--uva-grey-100, #dadada));\n text-decoration: none;\n }\n ${focusRules}\n /* Current page, and the group holding it: bold with a thick underline, not colour alone. */\n [aria-current]:not([aria-current='false']),\n .panel a[aria-current]:not([aria-current='false']):hover {\n font-weight: 700;\n text-decoration-line: underline;\n text-decoration-thickness: 3px;\n text-decoration-color: var(--uva-color-current, var(--uva-brand-orange, #e57200));\n text-underline-offset: 0.3em;\n }\n\n /* Bar: a full-width row with the brand-blue rule, content capped at 1600px. */\n .bar {\n border-bottom: 5px solid var(--uva-color-accent-bg, var(--uva-brand-blue, #232d4b));\n background: var(--uva-color-surface-raised, #ffffff);\n }\n .bar > ul {\n display: flex;\n flex-wrap: wrap;\n box-sizing: border-box;\n max-inline-size: 1600px;\n margin-inline: auto;\n padding-inline: 16px;\n }\n .bar > ul > li {\n position: relative;\n display: flex;\n }\n .bar .toggle,\n .bar .top-link {\n padding: 11.5px 17px;\n }\n .bar .panel {\n position: absolute;\n top: 100%;\n inset-inline-start: 0;\n z-index: 1000;\n box-sizing: border-box;\n inline-size: max-content;\n min-inline-size: 100%;\n max-inline-size: 20rem;\n background: var(--uva-color-surface-raised, #ffffff);\n border-radius: 0 0 4px 4px;\n box-shadow: 0 8px 16px var(--uva-color-shadow, rgba(0, 0, 0, 0.2));\n /* Invisible normally; forced colors paint it, so the panel keeps an edge. */\n outline: 1px solid transparent;\n }\n .bar .panel a {\n padding: 8.5px 17px;\n }\n\n /* Accordion (the header's narrow-screen Menu popover): full-width rows, panels in flow. */\n .accordion .toggle,\n .accordion .top-link {\n inline-size: 100%;\n justify-content: space-between;\n padding: 0.375rem 0.5rem;\n }\n .accordion .toggle::after {\n margin-inline-end: 0.25em;\n }\n .accordion .panel {\n position: static;\n padding-inline-start: 1rem;\n }\n .accordion .panel a {\n padding: 0.375rem 0.5rem;\n }\n\n /* Forced colors drop backgrounds and shadows: outline the open group and hovered\n controls instead. */\n @media (forced-colors: active) {\n .toggle[aria-expanded='true']:not(:focus-visible),\n .toggle:hover:not(:focus-visible),\n .top-link:hover:not(:focus-visible),\n .panel a:hover:not(:focus-visible) {\n outline: 1px solid CanvasText;\n outline-offset: -1px;\n }\n }\n `,\n ];\n\n /**\n * Light mode: the focus rules again, unlayered. A page's own accessibility sheet (which\n * `<site-page>` installs unlayered) would otherwise beat the layered component rules.\n */\n protected override installLightStyles(root?: Document | ShadowRoot): void {\n super.installLightStyles(root);\n installLightDomStyles(`${this.localName}-focus`, [lightFocusRules(this.localName)], {\n root,\n scope: false,\n layer: false,\n });\n }\n\n /** Accessible name of the navigation landmark. */\n @property({ type: String }) label = 'Main';\n @property({ type: String, attribute: 'root-link-domain' }) rootLinkDomain =\n 'https://www.library.virginia.edu';\n /** URL of JSON in the `MainNavItem[]` shape (needs CORS); the snapshot is shown until it loads, and if it fails. */\n @property({ type: String, attribute: 'items-src' }) itemsSrc?: string;\n /** `bar` (a row of buttons with floating panels) or `accordion` (stacked, panels in flow). */\n @property({ type: String }) layout: 'bar' | 'accordion' = 'bar';\n /**\n * The URL whose link is marked current. Default: the page location, followed through\n * same-document navigations (`popstate`, `hashchange`, and the Navigation API's\n * `currententrychange` where supported).\n */\n @property({ type: String }) current?: string;\n /**\n * The menu, replacing the bundled snapshot (but not `slot=\"main-nav\"` markup):\n * `{ label, href }` for a direct link, `{ label, items: [{ label, href }] }` for a group.\n * Unset or empty uses `items-src` or the snapshot.\n */\n @property({ attribute: false }) items?: MainNavItem[];\n\n /** Items from slotted markup, or null when there is none. */\n @state() private slotItems: MainNavItem[] | null = null;\n /** Items loaded from `items-src`. */\n @state() private fetched: MainNavItem[] | null = null;\n /** Index of the open group. */\n @state() private open: number | null = null;\n\n private propItems: MainNavItem[] | null = null;\n private fetchedFor?: string;\n /** The shown items last rendered, to close the open group when they change. */\n private shownKey?: string;\n private warned = new Set<string>();\n private observer?: MutationObserver;\n private holder?: HTMLDivElement;\n private readonly idBase = `main-nav-${++navCounter}`;\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Read the markup before the first render where it is already there (no second update);\n // the observer catches markup parsed or added later.\n this.syncSource();\n this.listenLocation(true);\n // Reconnected while a group was open: watch for outside presses again.\n this.listenOutside(this.open !== null && this.layout === 'bar');\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.observer?.disconnect();\n this.listenOutside(false);\n this.listenLocation(false);\n }\n\n /** Same-document navigation: re-mark the current page when `current` is not set. */\n private onLocationChange = (): void => {\n if (!this.current) this.requestUpdate();\n };\n\n private locationTargets(): { target: EventTarget; type: string }[] {\n const win = this.ownerDocument.defaultView;\n if (!win) return [];\n const nav = (win as Window & { navigation?: EventTarget }).navigation;\n return [\n { target: win, type: 'popstate' },\n { target: win, type: 'hashchange' },\n ...(nav ? [{ target: nav, type: 'currententrychange' }] : []),\n ];\n }\n\n private listeningLocation = false;\n private listenLocation(on: boolean): void {\n if (on === this.listeningLocation) return;\n this.listeningLocation = on;\n for (const { target, type } of this.locationTargets()) {\n if (on) target.addEventListener(type, this.onLocationChange);\n else target.removeEventListener(type, this.onLocationChange);\n }\n }\n\n private warnOnce(kind: 'invalid' | 'flattened', what: string): void {\n if (this.warned.has(kind)) return;\n this.warned.add(kind);\n console.warn(\n kind === 'invalid'\n ? `${this.localName}: ignoring invalid ${what} entries (each needs a label, and an href or links).`\n : `${this.localName}: ${what} nests deeper than two levels; the deeper links are shown in their group.`,\n );\n }\n\n private use(result: NormalizeResult, what: string): MainNavItem[] | null {\n if (result.invalid) this.warnOnce('invalid', what);\n if (result.flattened) this.warnOnce('flattened', what);\n return result.items.length ? result.items : null;\n }\n\n /** Light mode: move `slot=\"main-nav\"` children into a hidden holder this element owns. */\n private adoptSource(): Element[] {\n const moved = [...this.children].filter(isSourceChild);\n if (moved.length && !this.holder) {\n this.holder = document.createElement('div');\n this.holder.hidden = true;\n this.holder.className = 'main-nav-source';\n }\n if (this.holder) {\n this.holder.append(...moved);\n if (this.holder.parentNode !== this) this.append(this.holder);\n }\n return this.holder ? [...this.holder.children] : [];\n }\n\n /** Read the `slot=\"main-nav\"` markup, render it, and watch it for changes. */\n private syncSource(): void {\n const sources = this.lightDom ? this.adoptSource() : [...this.children].filter(isSourceChild);\n let next: MainNavItem[] | null = null;\n if (sources.length) {\n const raw = sources.flatMap((s, i) => (i === 0 ? readItemsMarkup(s) : [{}]));\n next = this.use(normalizeItems(raw), 'slot=\"main-nav\"');\n }\n // Only a real change re-renders.\n if (JSON.stringify(next) !== JSON.stringify(this.slotItems)) this.slotItems = next;\n this.observer ??= new MutationObserver(() => this.syncSource());\n this.observer.disconnect();\n const content = {\n attributes: true,\n attributeFilter: SOURCE_ATTRS,\n characterData: true,\n childList: true,\n subtree: true,\n };\n if (this.lightDom) {\n this.observer.observe(this, { childList: true });\n if (this.holder) this.observer.observe(this.holder, content);\n } else {\n // Shadow mode: the host's children are only the source markup.\n this.observer.observe(this, content);\n }\n }\n\n protected override willUpdate(changed: PropertyValues): void {\n if (changed.has('items')) {\n this.propItems = this.items == null ? null : this.use(normalizeItems(this.items), 'items');\n }\n if (changed.has('itemsSrc') && this.fetchedFor !== this.itemsSrc) {\n this.fetched = null;\n this.fetchedFor = undefined;\n }\n const src = this.itemsSrc;\n // Fetch only when items-src is what would be shown. The result arrives asynchronously.\n if (src && !this.slotItems && !this.propItems && this.fetchedFor !== src) {\n this.fetchedFor = src;\n loadMainNavItems(src).then(\n (result) => {\n if (this.itemsSrc !== src) return;\n this.fetched = this.use(result, 'items-src');\n },\n (error: unknown) => {\n if (this.itemsSrc !== src) return;\n this.dispatchEvent(\n new CustomEvent('site-main-nav-error', {\n detail: { src, message: error instanceof Error ? error.message : String(error) },\n bubbles: true,\n composed: true,\n }),\n );\n },\n );\n }\n // A different menu: the open index would point at another group, so close it.\n const key = JSON.stringify(this.shown);\n if (this.shownKey !== undefined && key !== this.shownKey) this.open = null;\n this.shownKey = key;\n }\n\n protected override updated(changed: PropertyValues): void {\n if (changed.has('open') || changed.has('layout')) {\n this.listenOutside(this.isConnected && this.open !== null && this.layout === 'bar');\n }\n }\n\n /** The items shown, by precedence. */\n private get shown(): readonly MainNavItem[] {\n return this.slotItems ?? this.propItems ?? this.fetched ?? MAIN_NAV_SNAPSHOT;\n }\n\n // --- behaviour ----------------------------------------------------------------------\n\n private get navEl(): HTMLElement | null {\n return this.renderRoot.querySelector<HTMLElement>('nav.main-nav');\n }\n\n /** The top-level buttons and direct links, in order. */\n private get tops(): HTMLElement[] {\n const nav = this.navEl;\n return nav\n ? [...nav.querySelectorAll<HTMLElement>(':scope > ul > li > :is(.toggle, .top-link)')]\n : [];\n }\n\n private setOpen(index: number | null): void {\n this.open = index;\n }\n\n private onToggle(index: number): void {\n const opening = this.open !== index;\n this.setOpen(opening ? index : null);\n const label = this.shown[index]?.label;\n if (opening && label) trackEvent(this, ['site-main-nav', 'menu-open', label]);\n }\n\n private onOutsidePointer = (e: Event): void => {\n const nav = this.navEl;\n if (nav && !e.composedPath().includes(nav)) this.setOpen(null);\n };\n\n private listening = false;\n private listenOutside(on: boolean): void {\n if (on === this.listening) return;\n this.listening = on;\n const doc = this.ownerDocument;\n if (on) doc.addEventListener('pointerdown', this.onOutsidePointer, true);\n else doc.removeEventListener('pointerdown', this.onOutsidePointer, true);\n }\n\n private onFocusOut(e: FocusEvent): void {\n if (this.layout !== 'bar' || this.open === null) return;\n const to = e.relatedTarget as Node | null;\n // A null relatedTarget (a click on nothing focusable) is left to the pointerdown check.\n if (to && !this.navEl?.contains(to)) this.setOpen(null);\n }\n\n /** Arrow keys, Home and End over `nodes`, from `index` (as the live site's script does). */\n private move(e: KeyboardEvent, nodes: HTMLElement[], index: number): void {\n let to: number;\n switch (e.key) {\n case 'ArrowUp':\n case 'ArrowLeft':\n to = Math.max(0, index - 1);\n break;\n case 'ArrowDown':\n case 'ArrowRight':\n to = Math.min(nodes.length - 1, index + 1);\n break;\n case 'Home':\n to = 0;\n break;\n case 'End':\n to = nodes.length - 1;\n break;\n default:\n return;\n }\n e.preventDefault();\n nodes[to]?.focus();\n }\n\n private onKeyDown(e: KeyboardEvent): void {\n if (e.altKey || e.ctrlKey || e.metaKey) return;\n const target = e.target as HTMLElement;\n const tops = this.tops;\n const top = tops.indexOf(target);\n const open = this.open;\n const openButton = open === null ? null : this.toggleAt(open);\n if (top >= 0) {\n if (e.key === 'Escape') {\n if (open === null) return; // nothing to close: let a surrounding popover handle it\n e.preventDefault();\n this.setOpen(null);\n } else if (e.key === 'ArrowDown' && openButton === target) {\n e.preventDefault();\n this.panelOf(openButton)?.querySelector<HTMLElement>('a')?.focus();\n } else {\n this.move(e, tops, top);\n }\n return;\n }\n const panel = target.closest('.panel');\n if (!panel || !openButton || this.panelOf(openButton) !== panel) return;\n if (e.key === 'Escape') {\n e.preventDefault();\n this.setOpen(null);\n openButton.focus();\n return;\n }\n const links = [...panel.querySelectorAll<HTMLElement>('a')];\n this.move(e, links, links.indexOf(target));\n }\n\n private toggleAt(index: number): HTMLElement | null {\n return (\n this.navEl?.querySelector<HTMLElement>(`[aria-controls=\"${this.panelId(index)}\"]`) ?? null\n );\n }\n\n /** A group button's panel: the list right after it, whose id it controls. */\n private panelOf(button: HTMLElement): HTMLElement | null {\n const next = button.nextElementSibling as HTMLElement | null;\n return next && next.id === button.getAttribute('aria-controls') ? next : null;\n }\n\n private panelId(index: number): string {\n return `${this.idBase}-${index}`;\n }\n\n // --- rendering ----------------------------------------------------------------------\n\n /** The one link to mark current: same host and path; then the same hash; then no hash. */\n private currentHref(hrefs: string[]): string | null {\n const here = this.current || this.ownerDocument.defaultView?.location.href || '';\n const base = this.ownerDocument.baseURI;\n const key = pageKey(here, base);\n if (!key) return null;\n const matches = hrefs.filter((h) => pageKey(h, base) === key);\n const hash = hashOf(here, base);\n return (\n matches.find((h) => hash && hashOf(h, base) === hash) ??\n matches.find((h) => !hashOf(h, base)) ??\n // Every match has a hash: with no hash of its own the page is theirs, so the first is\n // marked; a hash none of them has (a hash route the menu does not list) marks none.\n (hash ? null : matches[0]) ??\n null\n );\n }\n\n /** A link's href: fragment-only (`#…`) stays on this page; others go through siteLink. */\n private resolve(href: string): string {\n return href.startsWith('#') ? href : siteLink(this.rootLinkDomain, href);\n }\n\n /**\n * A plain click on a link closes the open group, so a single-page app that handles the\n * navigation in place does not leave the panel open. Modified clicks (a new tab or\n * window) keep it open.\n */\n private onClick(e: MouseEvent): void {\n const a = e.composedPath().find((n) => n instanceof HTMLAnchorElement);\n // Only the menu's own links (rendered here), never anything else on the click's path.\n if (a && this.renderRoot.contains(a)) {\n const text = (n: Node | null | undefined) =>\n (n?.textContent ?? '').replace(/\\s+/g, ' ').trim();\n // `Group > Link` for a link in a group, the link alone for a top-level one.\n const group = text(a.closest('.panel')?.previousElementSibling);\n const label = text(a);\n if (label)\n trackEvent(this, ['site-main-nav', 'link-click', group ? `${group} > ${label}` : label]);\n }\n if (this.open === null || e.button !== 0) return;\n if (e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) return;\n if (e.composedPath().some((n) => n instanceof Element && n.localName === 'a')) {\n this.setOpen(null);\n }\n }\n\n render() {\n const items = this.shown.map((item) => ({\n label: item.label,\n href: item.items ? undefined : this.resolve(item.href!),\n items: item.items?.map((l) => ({ label: l.label, href: this.resolve(l.href) })),\n }));\n const all = items.flatMap((i) => (i.items ? i.items.map((l) => l.href) : [i.href!]));\n const current = this.currentHref(all);\n const mark = (href: string) => (href === current ? 'page' : undefined);\n let marked = false;\n return html`<nav\n class=\"main-nav ${this.layout === 'accordion' ? 'accordion' : 'bar'}\"\n aria-label=${this.label}\n @keydown=${this.onKeyDown}\n @focusout=${this.onFocusOut}\n @click=${this.onClick}\n >\n <ul>\n ${items.map((item, i) => {\n if (!item.items) {\n const cur = !marked && mark(item.href!);\n if (cur) marked = true;\n return html`<li>\n <a class=\"top-link\" href=${item.href!} aria-current=${ifDefined(cur || undefined)}\n >${item.label}</a\n >\n </li>`;\n }\n const id = this.panelId(i);\n const expanded = this.open === i;\n const has = !marked && item.items.some((l) => l.href === current);\n let linkMarked = false;\n if (has) marked = true;\n return html`<li>\n <button\n type=\"button\"\n class=\"toggle\"\n aria-expanded=${expanded ? 'true' : 'false'}\n aria-controls=${id}\n aria-current=${ifDefined(has ? 'true' : undefined)}\n @click=${() => this.onToggle(i)}\n >\n ${item.label}\n </button>\n <ul class=\"panel\" id=${id} ?hidden=${!expanded}>\n ${item.items.map((l) => {\n const cur = has && !linkMarked && l.href === current;\n if (cur) linkMarked = true;\n return html`<li>\n <a href=${l.href} aria-current=${ifDefined(cur ? 'page' : undefined)}\n >${l.label}</a\n >\n </li>`;\n })}\n </ul>\n </li>`;\n })}\n </ul>\n </nav>`;\n }\n}\n","import { define } from '../../base/define.js';\nimport { SiteMainNav } from './SiteMainNav.js';\n\ndefine('site-main-nav', SiteMainNav);\n"],"ignoreList":[0],"mappings":";;;;;AAKG,IAAMkB,KAAE,MAAGA,KAAGlB,GCsBXoB,KAAO,MAAwB,OAAOC,KAAM,WAAWA,EAAE,QAAQ,QAAQ,GAAG,CAAC,CAAC,KAAK,IAAI;AAQ7F,SAAgBC,EAAe,GAA+B;CAC5D,IAAMC,IAAuB;EAAE,OAAO,CAAC;EAAG,SAAS;EAAO,WAAW;CAAM;CAC3E,IAAI,CAAC,MAAM,QAAQC,CAAG,GAEpB,OADA,EAAI,UAAUA,KAAO,MACdD;CAET,IAAME,KAAW,GAAkB,GAAqB,MAAwB;EAC9E,KAAK,IAAMnB,KAAKoB,GAAO;GACrB,IAAMR,IAAKZ,KAAK,CAAC,GACXqB,IAAQP,EAAIF,EAAE,KAAK,GACnBU,IAAOR,EAAIF,EAAE,IAAI,GACjBW,IAAO,MAAM,QAAQX,EAAE,KAAK,KAAKA,EAAE,MAAM,SAASA,EAAE,QAAQ;GAClE,AAAIW,KACF,EAAI,YAAY,IACZF,KAASC,KAAME,EAAK,KAAK;IAAE;IAAO;GAAK,CAAC,GAC5CL,EAAQI,GAAMC,GAAMC,IAAQ,CAAC,KACpBJ,KAASC,IAClBE,EAAK,KAAK;IAAE;IAAO;GAAK,CAAC,IAE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