@brandlab-digital/site-next 3.16.0 → 3.17.0

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 (33) hide show
  1. package/dist/ui-kit/repeated-slots.d.ts +3 -3
  2. package/dist/ui-kit/repeated-slots.d.ts.map +1 -1
  3. package/dist/ui-kit/repeated-slots.js +6 -3
  4. package/dist/ui-kit/repeated-slots.js.map +1 -1
  5. package/dist/ui-kit/sections/area-map.d.ts.map +1 -1
  6. package/dist/ui-kit/sections/area-map.js +8 -4
  7. package/dist/ui-kit/sections/area-map.js.map +1 -1
  8. package/dist/ui-kit/sections/contact-block.d.ts +24 -2
  9. package/dist/ui-kit/sections/contact-block.d.ts.map +1 -1
  10. package/dist/ui-kit/sections/contact-block.js +9 -3
  11. package/dist/ui-kit/sections/contact-block.js.map +1 -1
  12. package/dist/ui-kit/sections/hero.d.ts +7 -3
  13. package/dist/ui-kit/sections/hero.d.ts.map +1 -1
  14. package/dist/ui-kit/sections/hero.js +10 -4
  15. package/dist/ui-kit/sections/hero.js.map +1 -1
  16. package/dist/ui-kit/sections/local-facts.d.ts +33 -4
  17. package/dist/ui-kit/sections/local-facts.d.ts.map +1 -1
  18. package/dist/ui-kit/sections/local-facts.js +18 -6
  19. package/dist/ui-kit/sections/local-facts.js.map +1 -1
  20. package/dist/ui-kit/sections/nearby-jobs.d.ts +20 -2
  21. package/dist/ui-kit/sections/nearby-jobs.d.ts.map +1 -1
  22. package/dist/ui-kit/sections/nearby-jobs.js +23 -6
  23. package/dist/ui-kit/sections/nearby-jobs.js.map +1 -1
  24. package/dist/ui-kit/sections/proof-strip.d.ts +3 -1
  25. package/dist/ui-kit/sections/proof-strip.d.ts.map +1 -1
  26. package/dist/ui-kit/sections/proof-strip.js +5 -2
  27. package/dist/ui-kit/sections/proof-strip.js.map +1 -1
  28. package/dist/ui-kit/sections/site-footer.d.ts +6 -2
  29. package/dist/ui-kit/sections/site-footer.d.ts.map +1 -1
  30. package/dist/ui-kit/sections/site-footer.js +7 -2
  31. package/dist/ui-kit/sections/site-footer.js.map +1 -1
  32. package/dist/ui-kit/structure.css +170 -25
  33. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"hero.js","sourceRoot":"","sources":["../../../src/ui-kit/sections/hero.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AAChD,OAAO,EAAE,cAAc,EAAoB,MAAM,sCAAsC,CAAA;AACvF,OAAO,EAAE,OAAO,EAAoB,MAAM,yBAAyB,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAiB,MAAM,wBAAwB,CAAA;AAChE,OAAO,EAAE,UAAU,EAAgB,MAAM,8BAA8B,CAAA;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,IAAI,EAAkB,MAAM,YAAY,CAAA;AAEjD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAuB,MAAM,kBAAkB,CAAA;AAEnF,mGAAmG;AACnG,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAA;AAGnH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAU,CAAA;AAG9D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,YAAY,CAAU,CAAA;AAG7D;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,CAAU,CAAA;AAGrE;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAA;AAmD5C,6FAA6F;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,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,YAAG,IAAI,CAAC,KAAK,GAAQ,IACjH,CACL,CAAC,CAAC,CAAC,IAAI,IACJ,EACL,IAAI,CAAC,CAAC,CAAC,CACN,kBAAS,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,aAC3B,WAAW,CAAC,CAAC,CAAC,CACb,kBAAS,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,aAC/B,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,eAAO,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,YAAG,WAAW,CAAC,OAAO,GAAK,CAAC,CAAC,CAAC,IAAI,EAC5F,aAAI,EAAE,EAAE,oBAAoB,KAAM,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,YACzD,WAAW,CAAC,KAAK,GACf,EACJ,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,eAAO,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,YAAG,WAAW,CAAC,IAAI,GAAK,CAAC,CAAC,CAAC,IAAI,IAC/E,CACP,CAAC,CAAC,CAAC,IAAI,EACP,IAAI,IACD,CACP,CAAC,CAAC,CAAC,IAAI,IACA,CACX,CAAA;AACH,CAAC","sourcesContent":["/**\n * `Hero` (S1, `hero`, 3.14.0): the first screen of the home, service and service-in-suburb pages. Server component;\n * it wins the click and starts the enquiry. Light by default: every colour comes from the site's tokens and skin.\n *\n * In source order, which is the phone order: breadcrumbs (service and location pages), an optional eyebrow, the H1\n * (once, as plain text; on a location page the built \"{Service} {Suburb}\" string), one offer line of 25 words or fewer,\n * the two actions, the trust checklist (up to six verified facts, two columns), Google's feed rating, partner badges,\n * the photo and then the site's quote form. On desktop the form sits beside the text (`split`, the photo on the other side) or over the photo\n * as a card (`full-bleed`, under a text-side scrim the skin colours).\n *\n * Locked:\n * - the actions are the phone link (`data-phone-location=\"hero\"`, icon on the left) then the quote button\n * (`lead_cta_click` placement `hero`, id `quote-hero`): the same phone-first order as the header, the call bar and the\n * CTA band (K6). Job mode only moves the primary styling (`data-primary`), never the order;\n * - the actions are the page's call path (`data-bl-call-path`), so the phone call bar stays hidden while they are on\n * screen and shows once they scroll out (F6);\n * - with a form, the quote button links to it (`#quote-hero`, the form's own id) and the form is in the hero, so C1 sees\n * the H1, a call and a quote action in the first phone screen and the form in the first desktop screen;\n * - the photo is the page's largest image: preloaded, high priority, never lazy. It must be real work or licensed stock\n * (an AI illustration is supporting only, F13), and a job caption needs a genuine photo;\n * - no review quote, and no visible words the site doesn't pass.\n *\n * `family` is the page family (`data-family`): `home` takes no breadcrumbs and is `tall` by default; `service` and\n * `location` take breadcrumbs. A skin styles families apart through `[data-family]`; the variant is the site's one\n * hero structure.\n *\n * The site's own hero (3.16.0), inside the same skeleton:\n * - `layout.contentOrder` arranges the text column's parts (AA: H1, rating, summary, checklist, actions). The\n * breadcrumbs stay first, an eyebrow sits straight before the H1, and the H1 comes before the summary and actions;\n * parts left out follow in the default order;\n * - `layout.rating: 'figure'` shows Google's rating as a large figure with the stars and count, and `ratingMoreLabel`\n * adds the site's link to all the reviews;\n * - `formHeading` puts an eyebrow, an H2 and a line above the quote form (the hero's one H2);\n * - `seal` stamps one verified fact on the photo (`{ value: '15+', label: 'years of tree work' }`);\n * - `layout.scrim` chooses the overlay: `full` over the whole photo, `column` behind the text side only, or `none`\n * (the default on `split`; `full-bleed` defaults to `full`), coloured by the skin's `--bl-hero-scrim`;\n * - the photo's corners, shadow and filter come from `--bl-hero-photo-radius`, `--bl-hero-photo-shadow` and\n * `--bl-hero-photo-filter`, and the `decoration` slot holds the site's motif.\n */\nimport { Fragment, type ReactNode } from 'react'\nimport { SITE_JOB_MODES, type SiteJobMode } from '@brandlab-digital/site-core/strategy'\nimport { Section, type SectionTone } from '../primitives/layout.js'\nimport { PhoneLink } from '../primitives/links.js'\nimport { TickList, type TickItem } from '../primitives/lists.js'\nimport { MediaFrame, type UiMedia } from '../primitives/media-frame.js'\nimport { QuoteButton } from '../primitives/quote-button.js'\nimport { slot, type SkinEntry } from '../skin.js'\nimport type { UiPhone } from '../types.js'\nimport { RatingChip, hasGoogleRating, type RatingChipData } from './rating-chip.js'\n\n/** The text column's parts, in their default order (3.16.0). The breadcrumbs always come first. */\nexport const HERO_CONTENT_PARTS = ['eyebrow', 'h1', 'summary', 'actions', 'checklist', 'rating', 'badges'] as const\nexport type HeroContentPart = (typeof HERO_CONTENT_PARTS)[number]\n\nexport const HERO_SCRIMS = ['none', 'full', 'column'] as const\nexport type HeroScrim = (typeof HERO_SCRIMS)[number]\n\nexport const HERO_VARIANTS = ['split', 'full-bleed'] as const\nexport type HeroVariant = (typeof HERO_VARIANTS)[number]\n\n/**\n * The hero's family (`data-family`). Site-core's page families are finer (`service-in-suburb`, `region`, `suburb` all\n * take the `location` hero), so this stays a hero-level grouping.\n */\nexport const HERO_FAMILIES = ['home', 'service', 'location'] as const\nexport type HeroFamily = (typeof HERO_FAMILIES)[number]\n\n/**\n * A service's job mode (v2 §2.2), as the site's strategy decision card records it (`SiteJobMode` in\n * `site-core/strategy`): which action is styled primary. Never the order.\n */\nexport const HERO_JOB_MODES = SITE_JOB_MODES\nexport type HeroJobMode = SiteJobMode\n\nexport type HeroSlot =\n | 'root'\n | 'inner'\n | 'content'\n | 'crumbs'\n | 'eyebrow'\n | 'h1'\n | 'summary'\n | 'actions'\n | 'phone'\n | 'quote'\n | 'checklist'\n | 'rating'\n | 'badges'\n | 'media'\n | 'caption'\n | 'scrim'\n | 'form'\n | 'formHead'\n | 'formEyebrow'\n | 'formTitle'\n | 'formText'\n | 'seal'\n | 'sealValue'\n | 'sealLabel'\n\nexport interface HeroLayout {\n /** `split`: the photo's side on desktop (default `end`). */\n readonly mediaSide?: 'start' | 'end'\n /** Default `tall` on the home page, `standard` elsewhere. */\n readonly height?: 'standard' | 'tall'\n /** The trust checklist's columns (default 2). */\n readonly checklistColumns?: 1 | 2\n /**\n * The checklist's ticks (3.15.0): `icon` (the default) is the sprite's check; `rule` ships no svg, only a mark the\n * stylesheet draws as a short rule (`TickList`'s `layout.tick`), about 100 bytes less a fact.\n */\n readonly checklistTick?: 'icon' | 'rule'\n /** The text column's order (3.16.0); parts left out follow in the default order. */\n readonly contentOrder?: readonly HeroContentPart[]\n /** Google's rating as one line (`chip`, the default) or a large figure with the stars and count (3.16.0). */\n readonly rating?: 'chip' | 'figure'\n /** The photo's overlay (3.16.0): `full`, `column` (behind the text side only) or `none`. */\n readonly scrim?: HeroScrim\n}\n\nexport type HeroSkin = SkinEntry<HeroSlot, HeroVariant, HeroLayout>\n\n/** The form's id and lead diagnostics `form_id` in the hero; the quote button links here. */\nexport const HERO_FORM_ID = 'quote-hero'\n/** The most facts the trust checklist holds (v2 S1: three to six). */\nexport const HERO_CHECKLIST_MAX = 6\n/** The offer line's word limit (v2 §9.2). */\nexport const HERO_SUMMARY_MAX_WORDS = 25\n\nexport interface HeroProps extends HeroSkin {\n readonly family: HeroFamily\n /** The H1 text: the recorded H1 on live pages, the title builder's on new ones (\"Tree Removal Castle Hill\"). */\n readonly title: string\n /** The one offer line under the H1, 25 words or fewer. */\n readonly summary: string\n /** A short label above the H1. */\n readonly eyebrow?: string\n /** The page's breadcrumbs (the shared `Breadcrumbs`, with its own `nav`). Service and location pages only. */\n readonly breadcrumbs?: ReactNode\n /** The trust checklist: verified facts only (licence, insurance, rating source, years), at most six. */\n readonly checklist: readonly TickItem[]\n /**\n * Google's average and total from the reviews feed (`prepareBusinessProfileReviews`), shown as the shared\n * `RatingChip` (`data-bl=\"rating-chip\"`, the `rating` class on its root, like `phone` and `quote`) after the\n * checklist, linked to the Business Profile. Never typed by hand: without a feed average and a total of 1 or more,\n * nothing renders.\n */\n readonly rating?: RatingChipData | null\n /** Partner badges or logos held and verified (a `LogoStrip`). */\n readonly badges?: ReactNode\n /** The best genuine photo of this page's service; on a location page the nearest job's. From `media.ts`. */\n readonly media: UiMedia\n /** \"{what}, {suburb}, {month year}\" for a genuine job photo, for example on a location page. */\n readonly caption?: string\n readonly phone: UiPhone\n /** Optional words before the number, for example \"Call\". */\n readonly phoneLabel?: string\n /**\n * The site's recorded quote label (C5). `href` defaults to the hero's own form (`#quote-hero`); without a form it\n * is required (for example `/contact#quote`).\n */\n readonly quote: { readonly label: string; readonly href?: string }\n /** The site's bound quote form: `<QuoteForm formId=\"quote-hero\" />`. Required on money pages (C1). */\n readonly form?: ReactNode\n /** The page's service job mode (default `planned`): `urgent` styles the phone link primary. */\n readonly jobMode?: HeroJobMode\n /** The H1's id (default `hero-title`). */\n readonly headingId?: string\n /** Set by `SectionSequence`. */\n readonly tone?: SectionTone\n /** Signature art, rendered `aria-hidden` (Superior's waterline, Absolute's grass edge). */\n readonly decoration?: ReactNode\n /** The site's words for a link to all the reviews on Google, after the rating (3.16.0). */\n readonly ratingMoreLabel?: string\n /** A heading block above the quote form (3.16.0): an optional eyebrow, the H2 and an optional line. */\n readonly formHeading?: { readonly eyebrow?: string; readonly title: string; readonly text?: string }\n /** One verified fact stamped on the photo (3.16.0), for example `{ value: '15+', label: 'years of tree work' }`. */\n readonly seal?: { readonly value: string; readonly label: string }\n}\n\n/** The form heading's id (3.16.0). */\nexport const HERO_FORM_HEADING_ID = `${HERO_FORM_ID}-title`\n\n/** The text column's order: the site's order, then the parts it left out in the default order. */\nexport function heroContentOrder(order: readonly HeroContentPart[] = []): HeroContentPart[] {\n const problems: string[] = []\n const seen = new Set<string>()\n for (const part of order) {\n if (!(HERO_CONTENT_PARTS as readonly string[]).includes(part)) problems.push(`\"${part}\" is not a hero part (${HERO_CONTENT_PARTS.join(', ')})`)\n else if (seen.has(part)) problems.push(`\"${part}\" appears twice`)\n seen.add(part)\n }\n const full = [...order, ...HERO_CONTENT_PARTS.filter((part) => !seen.has(part))]\n const at = (part: HeroContentPart) => full.indexOf(part)\n if (at('eyebrow') !== at('h1') - 1) problems.push('the eyebrow sits straight before the H1')\n if (at('summary') < at('h1') || at('actions') < at('h1')) problems.push('the H1 comes before the summary and the actions')\n if (problems.length > 0) throw new Error(`Hero content order: ${problems.join('; ')}.`)\n return full\n}\n\nconst words = (text: string) => text.trim().split(/\\s+/).filter(Boolean).length\n\nfunction assertHero({ title, summary, checklist, media, caption, quote, form, formHeading, seal }: HeroProps): void {\n const problems: string[] = []\n if (title.trim() === '') problems.push('the H1 is empty')\n if (words(summary) > HERO_SUMMARY_MAX_WORDS) problems.push(`the offer line has ${words(summary)} words (${HERO_SUMMARY_MAX_WORDS} at most)`)\n if (checklist.length > HERO_CHECKLIST_MAX) problems.push(`the checklist has ${checklist.length} facts (${HERO_CHECKLIST_MAX} at most)`)\n if (media.provenance === 'illustrative-ai') problems.push(`${media.src} is an AI illustration; the hero shows real work or licensed stock`)\n if (caption && media.provenance !== 'genuine') problems.push(`a job caption needs a genuine photo (${media.src} is ${media.provenance})`)\n if (!form && !quote.href) problems.push('without a form, quote.href must name the quote form, for example /contact#quote')\n if (formHeading && !form) problems.push('a form heading needs the form')\n if (formHeading && formHeading.title.trim() === '') problems.push('the form heading is empty')\n if (seal && (seal.value.trim() === '' || seal.label.trim() === '')) problems.push('the seal needs a value and a label')\n if (problems.length > 0) throw new Error(`Hero \"${title}\": ${problems.join('; ')}.`)\n}\n\nexport function Hero(props: HeroProps) {\n assertHero(props)\n const {\n family,\n title,\n summary,\n eyebrow,\n breadcrumbs,\n checklist,\n rating,\n badges,\n media,\n caption,\n phone,\n phoneLabel,\n quote,\n form,\n jobMode = 'planned',\n headingId = 'hero-title',\n tone,\n decoration,\n ratingMoreLabel,\n formHeading,\n seal,\n variant = 'split',\n layout,\n classes,\n } = props\n const primary = jobMode === 'urgent' ? 'phone' : 'quote'\n const crumbs = family === 'home' ? null : breadcrumbs\n const scrim = layout?.scrim ?? (variant === 'full-bleed' ? 'full' : 'none')\n const parts: Record<HeroContentPart, ReactNode> = {\n eyebrow: eyebrow ? <p {...slot(classes, 'eyebrow')}>{eyebrow}</p> : null,\n h1: (\n <h1 id={headingId} {...slot(classes, 'h1')}>\n {title}\n </h1>\n ),\n summary: <p {...slot(classes, 'summary')}>{summary}</p>,\n actions: (\n <div {...slot(classes, 'actions')} data-bl-call-path=\"\" data-primary={primary}>\n <PhoneLink phone={phone} placement=\"hero\" label={phoneLabel} showIcon variant=\"button\" classes={{ root: classes?.phone }} />\n <QuoteButton\n label={quote.label}\n href={quote.href ?? `#${HERO_FORM_ID}`}\n placement=\"hero\"\n ctaId=\"quote-hero\"\n variant={primary === 'quote' ? 'primary' : 'secondary'}\n classes={{ root: classes?.quote }}\n />\n </div>\n ),\n checklist:\n checklist.length > 0 ? (\n <div {...slot(classes, 'checklist')}>\n <TickList items={checklist} layout={{ columns: layout?.checklistColumns ?? 2, ...(layout?.checklistTick ? { tick: layout.checklistTick } : {}) }} />\n </div>\n ) : null,\n rating: hasGoogleRating(rating) ? (\n <RatingChip\n reviews={rating}\n moreLabel={ratingMoreLabel}\n layout={layout?.rating === 'figure' ? { display: 'figure' } : undefined}\n classes={{ root: classes?.rating }}\n />\n ) : null,\n badges: badges ? <div {...slot(classes, 'badges')}>{badges}</div> : null,\n }\n return (\n <Section\n id=\"hero\"\n labelledBy={headingId}\n tone={tone}\n variant={variant}\n classes={classes}\n decoration={decoration}\n phonePlacement=\"hero\"\n hooks={{\n 'data-family': family,\n 'data-job-mode': jobMode,\n 'data-height': layout?.height ?? (family === 'home' ? 'tall' : 'standard'),\n 'data-media-side': variant === 'split' ? (layout?.mediaSide ?? 'end') : undefined,\n 'data-form': form ? '' : undefined,\n 'data-scrim': scrim === 'none' ? undefined : scrim,\n }}\n >\n <div {...slot(classes, 'content')}>\n {crumbs ? <div {...slot(classes, 'crumbs')}>{crumbs}</div> : null}\n {heroContentOrder(layout?.contentOrder).map((part) => (\n <Fragment key={part}>{parts[part]}</Fragment>\n ))}\n </div>\n <div {...slot(classes, 'media')}>\n <MediaFrame\n media={media}\n ratio=\"4:3\"\n sizes={variant === 'full-bleed' ? '100vw' : '(min-width: 1024px) 50vw, 100vw'}\n caption={caption}\n priority\n classes={{ caption: classes?.caption }}\n />\n {scrim === 'none' ? null : <div {...slot(classes, 'scrim')} aria-hidden=\"true\" />}\n {seal ? (\n <p {...slot(classes, 'seal')}>\n <span {...slot(classes, 'sealValue')}>{seal.value}</span> <span {...slot(classes, 'sealLabel')}>{seal.label}</span>\n </p>\n ) : null}\n </div>\n {form ? (\n <div {...slot(classes, 'form')}>\n {formHeading ? (\n <div {...slot(classes, 'formHead')}>\n {formHeading.eyebrow ? <p {...slot(classes, 'formEyebrow')}>{formHeading.eyebrow}</p> : null}\n <h2 id={HERO_FORM_HEADING_ID} {...slot(classes, 'formTitle')}>\n {formHeading.title}\n </h2>\n {formHeading.text ? <p {...slot(classes, 'formText')}>{formHeading.text}</p> : null}\n </div>\n ) : null}\n {form}\n </div>\n ) : null}\n </Section>\n )\n}\n"]}
1
+ {"version":3,"file":"hero.js","sourceRoot":"","sources":["../../../src/ui-kit/sections/hero.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AAChD,OAAO,EAAE,cAAc,EAAoB,MAAM,sCAAsC,CAAA;AACvF,OAAO,EAAE,OAAO,EAAoB,MAAM,yBAAyB,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAiB,MAAM,wBAAwB,CAAA;AAChE,OAAO,EAAE,UAAU,EAAgB,MAAM,8BAA8B,CAAA;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,IAAI,EAAkB,MAAM,YAAY,CAAA;AAEjD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAuB,MAAM,kBAAkB,CAAA;AAEnF,mGAAmG;AACnG,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,CAAU,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C,CAAC,CAAC,IAAI,IACA,CACX,CAAA;AACH,CAAC","sourcesContent":["/**\n * `Hero` (S1, `hero`, 3.14.0): the first screen of the home, service and service-in-suburb pages. Server component;\n * it wins the click and starts the enquiry. Light by default: every colour comes from the site's tokens and skin.\n *\n * In source order, which is the phone order: breadcrumbs (service and location pages), an optional eyebrow, the H1\n * (once, as plain text; on a location page the built \"{Service} {Suburb}\" string), one offer line of 25 words or fewer,\n * the two actions, the trust checklist (up to six verified facts, two columns), Google's feed rating, partner badges,\n * the photo and then the site's quote form. On desktop the form sits beside the text (`split`, the photo on the other side) or over the photo\n * as a card (`full-bleed`, under a text-side scrim the skin colours).\n *\n * Locked:\n * - the actions are the phone link (`data-phone-location=\"hero\"`, icon on the left) then the quote button\n * (`lead_cta_click` placement `hero`, id `quote-hero`): the same phone-first order as the header, the call bar and the\n * CTA band (K6). Job mode only moves the primary styling (`data-primary`), never the order;\n * - the actions are the page's call path (`data-bl-call-path`), so the phone call bar stays hidden while they are on\n * screen and shows once they scroll out (F6);\n * - with a form, the quote button links to it (`#quote-hero`, the form's own id) and the form is in the hero, so C1 sees\n * the H1, a call and a quote action in the first phone screen and the form in the first desktop screen;\n * - the photo is the page's largest image: preloaded, high priority, never lazy. It must be real work or licensed stock\n * (an AI illustration is supporting only, F13), and a job caption needs a genuine photo;\n * - no review quote, and no visible words the site doesn't pass.\n *\n * `family` is the page family (`data-family`): `home` takes no breadcrumbs and is `tall` by default; `service` and\n * `location` take breadcrumbs. A skin styles families apart through `[data-family]`; the variant is the site's one\n * hero structure.\n *\n * The site's own hero (3.16.0), inside the same skeleton:\n * - `layout.contentOrder` arranges the text column's parts (AA: H1, rating, summary, checklist, actions). The\n * breadcrumbs stay first, an eyebrow sits straight before the H1, and the H1 comes before the summary and actions;\n * parts left out follow in the default order;\n * - `layout.rating: 'figure'` shows Google's rating as a large figure with the stars and count, and `ratingMoreLabel`\n * adds the site's link to all the reviews;\n * - `formHeading` puts an eyebrow, an H2 and a line above the quote form (the hero's one H2);\n * - `seal` stamps one verified fact on the photo (`{ value: '15+', label: 'years of tree work' }`);\n * - `layout.scrim` chooses the overlay: `full` over the whole photo, `column` behind the text side only (as wide as\n * `--bl-hero-scrim-column-width`, 60% by default), or `none` (the default on `split`; `full-bleed` defaults to\n * `full`), coloured by the skin's `--bl-hero-scrim`;\n * - the photo's corners, shadow and filter come from `--bl-hero-photo-radius`, `--bl-hero-photo-shadow` and\n * `--bl-hero-photo-filter`, and the `decoration` slot holds the site's motif.\n */\nimport { Fragment, type ReactNode } from 'react'\nimport { SITE_JOB_MODES, type SiteJobMode } from '@brandlab-digital/site-core/strategy'\nimport { Section, type SectionTone } from '../primitives/layout.js'\nimport { PhoneLink } from '../primitives/links.js'\nimport { TickList, type TickItem } from '../primitives/lists.js'\nimport { MediaFrame, type UiMedia } from '../primitives/media-frame.js'\nimport { QuoteButton } from '../primitives/quote-button.js'\nimport { slot, type SkinEntry } from '../skin.js'\nimport type { UiPhone } from '../types.js'\nimport { RatingChip, hasGoogleRating, type RatingChipData } from './rating-chip.js'\n\n/** The text column's parts, in their default order (3.16.0). The breadcrumbs always come first. */\nexport const HERO_CONTENT_PARTS = ['eyebrow', 'h1', 'summary', 'actions', 'checklist', 'rating', 'badges'] as const\nexport type HeroContentPart = (typeof HERO_CONTENT_PARTS)[number]\n\nexport const HERO_SCRIMS = ['none', 'full', 'column'] as const\nexport type HeroScrim = (typeof HERO_SCRIMS)[number]\n\nexport const HERO_VARIANTS = ['split', 'full-bleed'] as const\nexport type HeroVariant = (typeof HERO_VARIANTS)[number]\n\n/**\n * The hero's family (`data-family`). Site-core's page families are finer (`service-in-suburb`, `region`, `suburb` all\n * take the `location` hero), so this stays a hero-level grouping.\n */\nexport const HERO_FAMILIES = ['home', 'service', 'location'] as const\nexport type HeroFamily = (typeof HERO_FAMILIES)[number]\n\n/**\n * A service's job mode (v2 §2.2), as the site's strategy decision card records it (`SiteJobMode` in\n * `site-core/strategy`): which action is styled primary. Never the order.\n */\nexport const HERO_JOB_MODES = SITE_JOB_MODES\nexport type HeroJobMode = SiteJobMode\n\nexport type HeroSlot =\n | 'root'\n | 'inner'\n | 'content'\n | 'crumbs'\n | 'eyebrow'\n | 'h1'\n | 'summary'\n | 'actions'\n | 'phone'\n | 'quote'\n | 'checklist'\n | 'rating'\n | 'badges'\n | 'media'\n | 'caption'\n | 'scrim'\n | 'form'\n | 'formHead'\n | 'formEyebrow'\n | 'formTitle'\n | 'formText'\n | 'seal'\n | 'sealValue'\n | 'sealLabel'\n\nexport interface HeroLayout {\n /** `split`: the photo's side on desktop (default `end`). */\n readonly mediaSide?: 'start' | 'end'\n /** Default `tall` on the home page, `standard` elsewhere. */\n readonly height?: 'standard' | 'tall'\n /** The trust checklist's columns (default 2). */\n readonly checklistColumns?: 1 | 2\n /**\n * The checklist's ticks (3.15.0): `icon` (the default) is the sprite's check; `rule` ships no svg, only a mark the\n * stylesheet draws as a short rule (`TickList`'s `layout.tick`), about 100 bytes less a fact.\n */\n readonly checklistTick?: 'icon' | 'rule'\n /** The text column's order (3.16.0); parts left out follow in the default order. */\n readonly contentOrder?: readonly HeroContentPart[]\n /** Google's rating as one line (`chip`, the default) or a large figure with the stars and count (3.16.0). */\n readonly rating?: 'chip' | 'figure'\n /** The photo's overlay (3.16.0): `full`, `column` (behind the text side only) or `none`. */\n readonly scrim?: HeroScrim\n}\n\nexport type HeroSkin = SkinEntry<HeroSlot, HeroVariant, HeroLayout>\n\n/** The form's id and lead diagnostics `form_id` in the hero; the quote button links here. */\nexport const HERO_FORM_ID = 'quote-hero'\n/** The most facts the trust checklist holds (v2 S1: three to six). */\nexport const HERO_CHECKLIST_MAX = 6\n/** The offer line's word limit (v2 §9.2). */\nexport const HERO_SUMMARY_MAX_WORDS = 25\n\nexport interface HeroProps extends HeroSkin {\n readonly family: HeroFamily\n /** The H1 text: the recorded H1 on live pages, the title builder's on new ones (\"Tree Removal Castle Hill\"). */\n readonly title: string\n /** The one offer line under the H1, 25 words or fewer. */\n readonly summary: string\n /** A short label above the H1. */\n readonly eyebrow?: string\n /** The page's breadcrumbs (the shared `Breadcrumbs`, with its own `nav`). Service and location pages only. */\n readonly breadcrumbs?: ReactNode\n /** The trust checklist: verified facts only (licence, insurance, rating source, years), at most six. */\n readonly checklist: readonly TickItem[]\n /**\n * Google's average and total from the reviews feed (`prepareBusinessProfileReviews`), shown as the shared\n * `RatingChip` (`data-bl=\"rating-chip\"`, the `rating` class on its root, like `phone` and `quote`) after the\n * checklist, linked to the Business Profile. Never typed by hand: without a feed average and a total of 1 or more,\n * nothing renders.\n */\n readonly rating?: RatingChipData | null\n /** Partner badges or logos held and verified (a `LogoStrip`). */\n readonly badges?: ReactNode\n /** The best genuine photo of this page's service; on a location page the nearest job's. From `media.ts`. */\n readonly media: UiMedia\n /** \"{what}, {suburb}, {month year}\" for a genuine job photo, for example on a location page. */\n readonly caption?: string\n readonly phone: UiPhone\n /** Optional words before the number, for example \"Call\". */\n readonly phoneLabel?: string\n /**\n * The site's recorded quote label (C5). `href` defaults to the hero's own form (`#quote-hero`); without a form it\n * is required (for example `/contact#quote`).\n */\n readonly quote: { readonly label: string; readonly href?: string }\n /** The site's bound quote form: `<QuoteForm formId=\"quote-hero\" />`. Required on money pages (C1). */\n readonly form?: ReactNode\n /** The page's service job mode (default `planned`): `urgent` styles the phone link primary. */\n readonly jobMode?: HeroJobMode\n /** The H1's id (default `hero-title`). */\n readonly headingId?: string\n /** Set by `SectionSequence`. */\n readonly tone?: SectionTone\n /** Signature art, rendered `aria-hidden` (Superior's waterline, Absolute's grass edge). */\n readonly decoration?: ReactNode\n /** The site's words for a link to all the reviews on Google, after the rating (3.16.0). */\n readonly ratingMoreLabel?: string\n /** A heading block above the quote form (3.16.0): an optional eyebrow, the H2 and an optional line. */\n readonly formHeading?: { readonly eyebrow?: string; readonly title: string; readonly text?: string }\n /** One verified fact stamped on the photo (3.16.0), for example `{ value: '15+', label: 'years of tree work' }`. */\n readonly seal?: { readonly value: string; readonly label: string }\n}\n\n/** The form heading's id (3.16.0). */\nexport const HERO_FORM_HEADING_ID = `${HERO_FORM_ID}-title`\n\n/**\n * The text column's order: the site's order, then the parts it left out in the default order. A left-out eyebrow goes\n * straight before the H1, where it always sits (3.16.1).\n */\nexport function heroContentOrder(order: readonly HeroContentPart[] = []): HeroContentPart[] {\n const problems: string[] = []\n const seen = new Set<string>()\n for (const part of order) {\n if (!(HERO_CONTENT_PARTS as readonly string[]).includes(part)) problems.push(`\"${part}\" is not a hero part (${HERO_CONTENT_PARTS.join(', ')})`)\n else if (seen.has(part)) problems.push(`\"${part}\" appears twice`)\n seen.add(part)\n }\n const full = [...order, ...HERO_CONTENT_PARTS.filter((part) => !seen.has(part) && part !== 'eyebrow')]\n if (!seen.has('eyebrow')) full.splice(full.indexOf('h1'), 0, 'eyebrow')\n const at = (part: HeroContentPart) => full.indexOf(part)\n if (at('eyebrow') !== at('h1') - 1) problems.push('the eyebrow sits straight before the H1')\n if (at('summary') < at('h1') || at('actions') < at('h1')) problems.push('the H1 comes before the summary and the actions')\n if (problems.length > 0) throw new Error(`Hero content order: ${problems.join('; ')}.`)\n return full\n}\n\nconst words = (text: string) => text.trim().split(/\\s+/).filter(Boolean).length\n\nfunction assertHero({ title, summary, checklist, media, caption, quote, form, formHeading, seal }: HeroProps): void {\n const problems: string[] = []\n if (title.trim() === '') problems.push('the H1 is empty')\n if (words(summary) > HERO_SUMMARY_MAX_WORDS) problems.push(`the offer line has ${words(summary)} words (${HERO_SUMMARY_MAX_WORDS} at most)`)\n if (checklist.length > HERO_CHECKLIST_MAX) problems.push(`the checklist has ${checklist.length} facts (${HERO_CHECKLIST_MAX} at most)`)\n if (media.provenance === 'illustrative-ai') problems.push(`${media.src} is an AI illustration; the hero shows real work or licensed stock`)\n if (caption && media.provenance !== 'genuine') problems.push(`a job caption needs a genuine photo (${media.src} is ${media.provenance})`)\n if (!form && !quote.href) problems.push('without a form, quote.href must name the quote form, for example /contact#quote')\n if (formHeading && !form) problems.push('a form heading needs the form')\n if (formHeading && formHeading.title.trim() === '') problems.push('the form heading is empty')\n if (seal && (seal.value.trim() === '' || seal.label.trim() === '')) problems.push('the seal needs a value and a label')\n if (problems.length > 0) throw new Error(`Hero \"${title}\": ${problems.join('; ')}.`)\n}\n\nexport function Hero(props: HeroProps) {\n assertHero(props)\n const {\n family,\n title,\n summary,\n eyebrow,\n breadcrumbs,\n checklist,\n rating,\n badges,\n media,\n caption,\n phone,\n phoneLabel,\n quote,\n form,\n jobMode = 'planned',\n headingId = 'hero-title',\n tone,\n decoration,\n ratingMoreLabel,\n formHeading,\n seal,\n variant = 'split',\n layout,\n classes,\n } = props\n const primary = jobMode === 'urgent' ? 'phone' : 'quote'\n const crumbs = family === 'home' ? null : breadcrumbs\n const scrim = layout?.scrim ?? (variant === 'full-bleed' ? 'full' : 'none')\n const parts: Record<HeroContentPart, ReactNode> = {\n eyebrow: eyebrow ? <p {...slot(classes, 'eyebrow')}>{eyebrow}</p> : null,\n h1: (\n <h1 id={headingId} {...slot(classes, 'h1')}>\n {title}\n </h1>\n ),\n summary: <p {...slot(classes, 'summary')}>{summary}</p>,\n actions: (\n <div {...slot(classes, 'actions')} data-bl-call-path=\"\" data-primary={primary}>\n <PhoneLink phone={phone} placement=\"hero\" label={phoneLabel} showIcon variant=\"button\" classes={{ root: classes?.phone }} />\n <QuoteButton\n label={quote.label}\n href={quote.href ?? `#${HERO_FORM_ID}`}\n placement=\"hero\"\n ctaId=\"quote-hero\"\n variant={primary === 'quote' ? 'primary' : 'secondary'}\n classes={{ root: classes?.quote }}\n />\n </div>\n ),\n checklist:\n checklist.length > 0 ? (\n <div {...slot(classes, 'checklist')}>\n <TickList items={checklist} layout={{ columns: layout?.checklistColumns ?? 2, ...(layout?.checklistTick ? { tick: layout.checklistTick } : {}) }} />\n </div>\n ) : null,\n rating: hasGoogleRating(rating) ? (\n <RatingChip\n reviews={rating}\n moreLabel={ratingMoreLabel}\n layout={layout?.rating === 'figure' ? { display: 'figure' } : undefined}\n classes={{ root: classes?.rating }}\n />\n ) : null,\n badges: badges ? <div {...slot(classes, 'badges')}>{badges}</div> : null,\n }\n return (\n <Section\n id=\"hero\"\n labelledBy={headingId}\n tone={tone}\n variant={variant}\n classes={classes}\n decoration={decoration}\n phonePlacement=\"hero\"\n hooks={{\n 'data-family': family,\n 'data-job-mode': jobMode,\n 'data-height': layout?.height ?? (family === 'home' ? 'tall' : 'standard'),\n 'data-media-side': variant === 'split' ? (layout?.mediaSide ?? 'end') : undefined,\n 'data-form': form ? '' : undefined,\n 'data-scrim': scrim === 'none' ? undefined : scrim,\n }}\n >\n <div {...slot(classes, 'content')}>\n {crumbs ? <div {...slot(classes, 'crumbs')}>{crumbs}</div> : null}\n {heroContentOrder(layout?.contentOrder).map((part) => (\n <Fragment key={part}>{parts[part]}</Fragment>\n ))}\n </div>\n <div {...slot(classes, 'media')}>\n <MediaFrame\n media={media}\n ratio=\"4:3\"\n sizes={variant === 'full-bleed' ? '100vw' : '(min-width: 1024px) 50vw, 100vw'}\n caption={caption}\n priority\n classes={{ caption: classes?.caption }}\n />\n {scrim === 'none' ? null : <div {...slot(classes, 'scrim')} aria-hidden=\"true\" />}\n {seal ? (\n <p {...slot(classes, 'seal')}>\n <span {...slot(classes, 'sealValue')}>{seal.value}</span> <span {...slot(classes, 'sealLabel')}>{seal.label}</span>\n </p>\n ) : null}\n </div>\n {form ? (\n <div {...slot(classes, 'form')}>\n {formHeading ? (\n <div {...slot(classes, 'formHead')}>\n {formHeading.eyebrow ? <p {...slot(classes, 'formEyebrow')}>{formHeading.eyebrow}</p> : null}\n <h2 id={HERO_FORM_HEADING_ID} {...slot(classes, 'formTitle')}>\n {formHeading.title}\n </h2>\n {formHeading.text ? <p {...slot(classes, 'formText')}>{formHeading.text}</p> : null}\n </div>\n ) : null}\n {form}\n </div>\n ) : null}\n </Section>\n )\n}\n"]}
@@ -14,10 +14,19 @@
14
14
  * or past its fees' financial year), the line renders nothing and the section lists
15
15
  * `data-bl-slot-skip="permit:no-current-council-record"`, which K12-slots reports as a warning until the record is
16
16
  * checked again. A page in a trade without a permit note passes no `permit`.
17
+ *
18
+ * 3.17.0: an optional photo, checklist and action. `photos` are the candidate photos in order (for example
19
+ * `jobPhotos(job, media)` for the suburb's best job); the first one the page doesn't already show (`pagePhotos`, the
20
+ * same no-repeat rule as `NearbyJobs`) renders, and only a genuine photo of the client's work. It comes first on phones
21
+ * and sits beside the copy from 768 px. `checklist` is a `TickList` of the site's own points; `action` one button link,
22
+ * for example the council guidance page.
17
23
  */
18
24
  import type { ReactNode } from 'react';
25
+ import type { BrandlabMediaEntry } from '@brandlab-digital/site-core/media';
19
26
  import { type BrandlabCouncilPermitRecord } from '@brandlab-digital/site-core/council-register';
20
27
  import { type BrandlabSectionReadiness } from '@brandlab-digital/site-core/section-order';
28
+ import { type TickItem } from '../primitives/lists.js';
29
+ import { type MediaLayout } from '../primitives/media.js';
21
30
  import { type SectionHeadingSlot, type SectionSlot, type SectionTone } from '../primitives/layout.js';
22
31
  import type { RepeatedSlotOf } from '../repeated-slots.js';
23
32
  import { type SkinEntry } from '../skin.js';
@@ -25,10 +34,20 @@ import type { UiLink } from '../types.js';
25
34
  import { type CouncilRecordSlot, type CouncilRuleWording } from './council-rules.js';
26
35
  export declare const LOCAL_FACTS_VARIANTS: readonly ["intro", "detailed"];
27
36
  export type LocalFactsVariant = (typeof LOCAL_FACTS_VARIANTS)[number];
28
- export type LocalFactsSlot = SectionSlot | SectionHeadingSlot | 'intro' | 'body' | 'facts' | 'fact' | 'factSource' | 'job' | 'permit' | CouncilRecordSlot | 'fee';
37
+ export type LocalFactsSlot = SectionSlot | SectionHeadingSlot | 'media' | 'intro' | 'body' | 'facts' | 'fact' | 'factSource' | 'checklist' | 'action' | 'job' | 'permit' | CouncilRecordSlot | 'fee';
29
38
  /** Rendered once per fact or fee: styled from the skin stylesheet, never by class. */
30
39
  export type LocalFactsRepeatedSlot = RepeatedSlotOf<'localFacts'>;
31
- export type LocalFactsSkin = SkinEntry<LocalFactsSlot, LocalFactsVariant, Record<never, never>, LocalFactsRepeatedSlot>;
40
+ export interface LocalFactsLayout {
41
+ /** The photo's crop. Defaults to 4:3. */
42
+ readonly ratio?: NonNullable<MediaLayout['ratio']>;
43
+ /** The photo's side from 768 px. Defaults to `end`; it always comes first on phones. */
44
+ readonly mediaSide?: 'start' | 'end';
45
+ }
46
+ export type LocalFactsSkin = SkinEntry<LocalFactsSlot, LocalFactsVariant, LocalFactsLayout, LocalFactsRepeatedSlot>;
47
+ /** A candidate photo: a media-manifest entry with its id, as `jobPhotos()` returns them. */
48
+ export type LocalFactsPhoto = BrandlabMediaEntry & {
49
+ readonly id: string;
50
+ };
32
51
  /** One sourced fact that changes the job here (a job or owner source; never a templated terrain line). */
33
52
  export interface LocalFact {
34
53
  /** A stable id, rendered as `data-item`. */
@@ -63,6 +82,16 @@ export interface LocalFactsProps extends LocalFactsSkin {
63
82
  /** The site's own copy about real work here: sentences on `intro`, the head page's copy (with H3s) on `detailed`. */
64
83
  readonly body?: ReactNode;
65
84
  readonly facts?: readonly LocalFact[];
85
+ /** Candidate photos in order (3.17.0); the first the page doesn't already show renders. Genuine photos only. */
86
+ readonly photos?: readonly LocalFactsPhoto[];
87
+ /** Photos the page already shows, such as the hero's: media ids or `src` paths. The section never repeats one. */
88
+ readonly pagePhotos?: readonly string[];
89
+ /** The photo `sizes`. Defaults to half the width from 768 px. */
90
+ readonly imageSizes?: string;
91
+ /** The site's own points, as a tick list (3.17.0). */
92
+ readonly checklist?: readonly TickItem[];
93
+ /** One button link after the copy (3.17.0), for example the site's council guidance page. */
94
+ readonly action?: UiLink;
66
95
  /** One line about the job here, or the nearest one labelled as nearby. */
67
96
  readonly job?: ReactNode;
68
97
  /** Permit trades only. */
@@ -73,6 +102,6 @@ export interface LocalFactsProps extends LocalFactsSkin {
73
102
  readonly tone?: SectionTone;
74
103
  }
75
104
  /** The guard for `SectionSequence`: renders when it has at least one true item to show. */
76
- export declare function localFactsReady({ intro, body, facts, job, permit }: Pick<LocalFactsProps, 'intro' | 'body' | 'facts' | 'job' | 'permit'>): BrandlabSectionReadiness;
77
- export declare function LocalFacts({ title, eyebrow, lead, intro, body, facts, job, permit, headingId, tone, variant, classes, }: LocalFactsProps): import("react/jsx-runtime").JSX.Element | null;
105
+ export declare function localFactsReady({ intro, body, facts, checklist, job, permit, }: Pick<LocalFactsProps, 'intro' | 'body' | 'facts' | 'checklist' | 'job' | 'permit'>): BrandlabSectionReadiness;
106
+ export declare function LocalFacts({ title, eyebrow, lead, intro, body, facts, photos, pagePhotos, imageSizes, checklist, action, job, permit, headingId, tone, variant, layout, classes, }: LocalFactsProps): import("react/jsx-runtime").JSX.Element | null;
78
107
  //# sourceMappingURL=local-facts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"local-facts.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/sections/local-facts.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAoD,KAAK,2BAA2B,EAAE,MAAM,8CAA8C,CAAA;AACjJ,OAAO,EAKL,KAAK,wBAAwB,EAC9B,MAAM,2CAA2C,CAAA;AAElD,OAAO,EAA2B,KAAK,kBAAkB,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC9H,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAC/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAsB,KAAK,iBAAiB,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAExG,eAAO,MAAM,oBAAoB,gCAAiC,CAAA;AAClE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AAC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,SAAS,QAAQ,EAAE,CAAA;IACxC,6FAA6F;IAC7F,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,0EAA0E;IAC1E,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,CAAA;IACxB,0BAA0B;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,gBAAgB,CAAA;IAClC,yCAAyC;IACzC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,gCAAgC;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAA;CAC5B;AAED,2FAA2F;AAC3F,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,IAAI,EACJ,KAAK,EACL,SAAS,EACT,GAAG,EACH,MAAM,GACP,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,WAAW,GAAG,KAAK,GAAG,QAAQ,CAAC,GAAG,wBAAwB,CAI/G;AAmBD,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,OAAO,EACP,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,KAAU,EACV,MAAW,EACX,UAAU,EACV,UAA6C,EAC7C,SAAc,EACd,MAAM,EACN,GAAG,EACH,MAAM,EACN,SAAiC,EACjC,IAAI,EACJ,OAAiB,EACjB,MAAM,EACN,OAAO,GACR,EAAE,eAAe,kDAsDjB"}
@@ -1,15 +1,17 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { COUNCIL_PERMIT_SKIP_REASON, visibleCouncilRecord } from '@brandlab-digital/site-core/council-register';
3
3
  import { SECTION_READY, SECTION_SLOT_ATTRIBUTE, SECTION_SLOT_SKIP_ATTRIBUTE, formatSectionSlotSkips, } from '@brandlab-digital/site-core/section-order';
4
- import { Anchor } from '../primitives/links.js';
4
+ import { Anchor, ButtonLink } from '../primitives/links.js';
5
+ import { TickList } from '../primitives/lists.js';
6
+ import { Media } from '../primitives/media.js';
5
7
  import { Section, SectionHeading } from '../primitives/layout.js';
6
8
  import { repeatedSlot, slot } from '../skin.js';
7
9
  import { CouncilRecordLines } from './council-rules.js';
8
10
  export const LOCAL_FACTS_VARIANTS = ['intro', 'detailed'];
9
11
  /** The guard for `SectionSequence`: renders when it has at least one true item to show. */
10
- export function localFactsReady({ intro, body, facts, job, permit }) {
12
+ export function localFactsReady({ intro, body, facts, checklist, job, permit, }) {
11
13
  const permitShown = permit ? visibleCouncilRecord(permit.record, permit.asOf) !== undefined : false;
12
- if (intro || body || (facts && facts.length > 0) || job || permitShown)
14
+ if (intro || body || (facts && facts.length > 0) || (checklist && checklist.length > 0) || job || permitShown)
13
15
  return SECTION_READY;
14
16
  return { render: false, reason: 'no-local-facts' };
15
17
  }
@@ -21,12 +23,22 @@ function assertFacts(facts) {
21
23
  ids.add(fact.id);
22
24
  }
23
25
  }
24
- export function LocalFacts({ title, eyebrow, lead, intro, body, facts = [], job, permit, headingId = 'local-facts-heading', tone, variant = 'intro', classes, }) {
25
- if (!localFactsReady({ intro, body, facts, job, permit }).render)
26
+ function pickPhoto(photos, pagePhotos) {
27
+ const shown = new Set(pagePhotos);
28
+ const photo = photos.find((entry) => !shown.has(entry.id) && !shown.has(entry.src));
29
+ if (photo && photo.provenance !== 'genuine') {
30
+ throw new Error(`LocalFacts: "${photo.id}" is ${photo.provenance}; only a genuine photo of the client's work shows here.`);
31
+ }
32
+ return photo;
33
+ }
34
+ export function LocalFacts({ title, eyebrow, lead, intro, body, facts = [], photos = [], pagePhotos, imageSizes = '(min-width: 768px) 45vw, 100vw', checklist = [], action, job, permit, headingId = 'local-facts-heading', tone, variant = 'intro', layout, classes, }) {
35
+ if (!localFactsReady({ intro, body, facts, checklist, job, permit }).render)
26
36
  return null;
27
37
  assertFacts(facts);
38
+ const photo = pickPhoto(photos, pagePhotos);
28
39
  const record = permit ? visibleCouncilRecord(permit.record, permit.asOf) : undefined;
29
40
  const skip = permit && !record ? { [SECTION_SLOT_SKIP_ATTRIBUTE]: formatSectionSlotSkips([{ slot: 'permit', reason: COUNCIL_PERMIT_SKIP_REASON }]) } : undefined;
30
- return (_jsxs(Section, { id: "local-facts", labelledBy: headingId, tone: tone, variant: variant, classes: classes, phonePlacement: "location", hooks: skip, children: [intro ? _jsx("div", { ...slot(classes, 'intro'), children: intro }) : null, _jsx(SectionHeading, { id: headingId, title: title, eyebrow: eyebrow, lead: lead, classes: classes }), body ? _jsx("div", { ...slot(classes, 'body'), children: body }) : null, facts.length > 0 ? (_jsx("ul", { role: "list", ...slot(classes, 'facts'), children: facts.map((fact) => (_jsxs("li", { ...repeatedSlot('fact'), "data-item": fact.id, children: [fact.text, fact.source ? (_jsxs(_Fragment, { children: [' ', _jsx(Anchor, { href: fact.source.href, prefetch: false, hooks: repeatedSlot('factSource'), children: fact.source.label })] })) : null] }, fact.id))) })) : null, job ? _jsx("p", { ...slot(classes, 'job'), children: job }) : null, permit && record ? (_jsx("div", { ...slot(classes, 'permit'), [SECTION_SLOT_ATTRIBUTE]: 'permit', "data-council": record.council, children: _jsx(CouncilRecordLines, { record: record, rule: permit.rule, sourceLabel: permit.sourceLabel, councilPage: permit.councilPage, classes: classes }) })) : null] }));
41
+ const hooks = photo ? { ...skip, 'data-media-side': layout?.mediaSide ?? 'end' } : skip;
42
+ return (_jsxs(Section, { id: "local-facts", labelledBy: headingId, tone: tone, variant: variant, classes: classes, phonePlacement: "location", hooks: hooks, children: [photo ? (_jsx("div", { ...slot(classes, 'media'), children: _jsx(Media, { media: photo, sizes: imageSizes, layout: { ratio: layout?.ratio ?? '4:3' } }) })) : null, intro ? _jsx("div", { ...slot(classes, 'intro'), children: intro }) : null, _jsx(SectionHeading, { id: headingId, title: title, eyebrow: eyebrow, lead: lead, classes: classes }), body ? _jsx("div", { ...slot(classes, 'body'), children: body }) : null, facts.length > 0 ? (_jsx("ul", { role: "list", ...slot(classes, 'facts'), children: facts.map((fact) => (_jsxs("li", { ...repeatedSlot('fact'), "data-item": fact.id, children: [fact.text, fact.source ? (_jsxs(_Fragment, { children: [' ', _jsx(Anchor, { href: fact.source.href, prefetch: false, hooks: repeatedSlot('factSource'), children: fact.source.label })] })) : null] }, fact.id))) })) : null, checklist.length > 0 ? (_jsx("div", { ...slot(classes, 'checklist'), children: _jsx(TickList, { items: checklist }) })) : null, job ? _jsx("p", { ...slot(classes, 'job'), children: job }) : null, permit && record ? (_jsx("div", { ...slot(classes, 'permit'), [SECTION_SLOT_ATTRIBUTE]: 'permit', "data-council": record.council, children: _jsx(CouncilRecordLines, { record: record, rule: permit.rule, sourceLabel: permit.sourceLabel, councilPage: permit.councilPage, classes: classes }) })) : null, action ? (_jsx("div", { ...slot(classes, 'action'), children: _jsx(ButtonLink, { href: action.href, prefetch: false, variant: "secondary", children: action.label }) })) : null] }));
31
43
  }
32
44
  //# sourceMappingURL=local-facts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"local-facts.js","sourceRoot":"","sources":["../../../src/ui-kit/sections/local-facts.tsx"],"names":[],"mappings":";AAkBA,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAoC,MAAM,8CAA8C,CAAA;AACjJ,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,GAEvB,MAAM,2CAA2C,CAAA;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,cAAc,EAA+D,MAAM,yBAAyB,CAAA;AAE9H,OAAO,EAAE,YAAY,EAAE,IAAI,EAAkB,MAAM,YAAY,CAAA;AAE/D,OAAO,EAAE,kBAAkB,EAAmD,MAAM,oBAAoB,CAAA;AAExG,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,OAAO,EAAE,UAAU,CAAU,CAAA;AAqDlE,2FAA2F;AAC3F,MAAM,UAAU,eAAe,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAwE;IACvI,MAAM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C,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC,YAAY,CAAC,YAC/E,IAAI,CAAC,MAAM,CAAC,KAAK,GACX,IACR,CACJ,CAAC,CAAC,CAAC,IAAI,KATD,IAAI,CAAC,EAAE,CAUX,CACN,CAAC,GACC,CACN,CAAC,CAAC,CAAC,IAAI,EACP,GAAG,CAAC,CAAC,CAAC,eAAO,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,YAAG,GAAG,GAAK,CAAC,CAAC,CAAC,IAAI,EACnD,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC,CAClB,iBAAS,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAQ,CAAC,sBAAsB,CAAC,EAAE,QAAQ,kBAAkB,MAAM,CAAC,OAAO,YACxG,KAAC,kBAAkB,IAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,GAAI,GACzI,CACP,CAAC,CAAC,CAAC,IAAI,IACA,CACX,CAAA;AACH,CAAC","sourcesContent":["/**\n * `LocalFacts` (S16, `local-facts`, 3.15.0): what makes a suburb or service-in-suburb page true for this place, the\n * block that keeps location pages from being doorways. Server component.\n *\n * Only true items render, all from the site's data: an optional `intro` first (the page's own local overview, before\n * the heading, 3.15.0), the site's own sentences about real work here (`body`; 2 to 4\n * sentences on standard pages, the head page's owner-confirmed copy on `detailed`), sourced facts, one line about the\n * job here or nearby, and, in permit trades, the permit note from the council register. Locked (Romie, v1 §4.4): no\n * suburb trivia, no council facts beyond the permit note, no kilometre figures or \"based in\" (L10), no copy rotated from\n * a pool (L4). A phone link inside reports the `location` placement.\n *\n * The permit note is the `permit` slot (K12-slots): its line carries `data-bl-slot=\"permit\"`. When the page passes a\n * `permit` but the register has no current record for the council (none, more than six months since it was checked,\n * or past its fees' financial year), the line renders nothing and the section lists\n * `data-bl-slot-skip=\"permit:no-current-council-record\"`, which K12-slots reports as a warning until the record is\n * checked again. A page in a trade without a permit note passes no `permit`.\n */\nimport type { ReactNode } from 'react'\nimport { COUNCIL_PERMIT_SKIP_REASON, visibleCouncilRecord, type BrandlabCouncilPermitRecord } from '@brandlab-digital/site-core/council-register'\nimport {\n SECTION_READY,\n SECTION_SLOT_ATTRIBUTE,\n SECTION_SLOT_SKIP_ATTRIBUTE,\n formatSectionSlotSkips,\n type BrandlabSectionReadiness,\n} from '@brandlab-digital/site-core/section-order'\nimport { Anchor } from '../primitives/links.js'\nimport { Section, SectionHeading, type SectionHeadingSlot, type SectionSlot, type SectionTone } from '../primitives/layout.js'\nimport type { RepeatedSlotOf } from '../repeated-slots.js'\nimport { repeatedSlot, slot, type SkinEntry } from '../skin.js'\nimport type { UiLink } from '../types.js'\nimport { CouncilRecordLines, type CouncilRecordSlot, type CouncilRuleWording } from './council-rules.js'\n\nexport const LOCAL_FACTS_VARIANTS = ['intro', 'detailed'] as const\nexport type LocalFactsVariant = (typeof LOCAL_FACTS_VARIANTS)[number]\nexport type LocalFactsSlot = SectionSlot | SectionHeadingSlot | 'intro' | 'body' | 'facts' | 'fact' | 'factSource' | 'job' | 'permit' | CouncilRecordSlot | 'fee'\n/** Rendered once per fact or fee: styled from the skin stylesheet, never by class. */\nexport type LocalFactsRepeatedSlot = RepeatedSlotOf<'localFacts'>\nexport type LocalFactsSkin = SkinEntry<LocalFactsSlot, LocalFactsVariant, Record<never, never>, LocalFactsRepeatedSlot>\n\n/** One sourced fact that changes the job here (a job or owner source; never a templated terrain line). */\nexport interface LocalFact {\n /** A stable id, rendered as `data-item`. */\n readonly id: string\n readonly text: ReactNode\n /** Where the fact can be checked. */\n readonly source?: UiLink\n}\n\n/** The permit note's data: the council's register record and how this site words it. */\nexport interface LocalFactsPermit {\n /** The register record for the suburb's council; `undefined` when the register has none. */\n readonly record: BrandlabCouncilPermitRecord | undefined\n /** The site's own wording of the rule in one or two lines. Defaults to the record's rule. */\n readonly rule?: CouncilRuleWording\n /** The source link's text. Defaults to the council's name. */\n readonly sourceLabel?: string\n /** The site's own council page, for example its \"Tree removal and Hornsby Council\" guide. */\n readonly councilPage?: UiLink\n /** The day the page is built or refreshed (Sydney). Defaults to now. */\n readonly asOf?: Date\n}\n\nexport interface LocalFactsProps extends LocalFactsSkin {\n /** The H2, for example \"Tree work in Castle Hill\". */\n readonly title: ReactNode\n readonly eyebrow?: ReactNode\n readonly lead?: ReactNode\n /**\n * The page's own introduction to the place (3.15.0), for example a suburb page's local overview paragraph. Site copy,\n * rendered first inside the section, before its heading, so the suburb page's intro lives in the `local-facts` place.\n */\n readonly intro?: ReactNode\n /** The site's own copy about real work here: sentences on `intro`, the head page's copy (with H3s) on `detailed`. */\n readonly body?: ReactNode\n readonly facts?: readonly LocalFact[]\n /** One line about the job here, or the nearest one labelled as nearby. */\n readonly job?: ReactNode\n /** Permit trades only. */\n readonly permit?: LocalFactsPermit\n /** Defaults to `local-facts-heading`. */\n readonly headingId?: string\n /** Set by `SectionSequence`. */\n readonly tone?: SectionTone\n}\n\n/** The guard for `SectionSequence`: renders when it has at least one true item to show. */\nexport function localFactsReady({ intro, body, facts, job, permit }: Pick<LocalFactsProps, 'intro' | 'body' | 'facts' | 'job' | 'permit'>): BrandlabSectionReadiness {\n const permitShown = permit ? visibleCouncilRecord(permit.record, permit.asOf) !== undefined : false\n if (intro || body || (facts && facts.length > 0) || job || permitShown) return SECTION_READY\n return { render: false, reason: 'no-local-facts' }\n}\n\nfunction assertFacts(facts: readonly LocalFact[]) {\n const ids = new Set<string>()\n for (const fact of facts) {\n if (!fact.id || ids.has(fact.id)) throw new Error(`LocalFacts: every fact needs its own id (\"${fact.id}\" is empty or repeated).`)\n ids.add(fact.id)\n }\n}\n\nexport function LocalFacts({\n title,\n eyebrow,\n lead,\n intro,\n body,\n facts = [],\n job,\n permit,\n headingId = 'local-facts-heading',\n tone,\n variant = 'intro',\n classes,\n}: LocalFactsProps) {\n if (!localFactsReady({ intro, body, facts, job, permit }).render) return null\n assertFacts(facts)\n const record = permit ? visibleCouncilRecord(permit.record, permit.asOf) : undefined\n const skip = permit && !record ? { [SECTION_SLOT_SKIP_ATTRIBUTE]: formatSectionSlotSkips([{ slot: 'permit', reason: COUNCIL_PERMIT_SKIP_REASON }]) } : undefined\n return (\n <Section id=\"local-facts\" labelledBy={headingId} tone={tone} variant={variant} classes={classes} phonePlacement=\"location\" hooks={skip}>\n {intro ? <div {...slot(classes, 'intro')}>{intro}</div> : null}\n <SectionHeading id={headingId} title={title} eyebrow={eyebrow} lead={lead} classes={classes} />\n {body ? <div {...slot(classes, 'body')}>{body}</div> : null}\n {facts.length > 0 ? (\n <ul role=\"list\" {...slot(classes, 'facts')}>\n {facts.map((fact) => (\n <li key={fact.id} {...repeatedSlot('fact')} data-item={fact.id}>\n {fact.text}\n {fact.source ? (\n <>\n {' '}\n <Anchor href={fact.source.href} prefetch={false} hooks={repeatedSlot('factSource')}>\n {fact.source.label}\n </Anchor>\n </>\n ) : null}\n </li>\n ))}\n </ul>\n ) : null}\n {job ? <p {...slot(classes, 'job')}>{job}</p> : null}\n {permit && record ? (\n <div {...slot(classes, 'permit')} {...{ [SECTION_SLOT_ATTRIBUTE]: 'permit' }} data-council={record.council}>\n <CouncilRecordLines record={record} rule={permit.rule} sourceLabel={permit.sourceLabel} councilPage={permit.councilPage} classes={classes} />\n </div>\n ) : null}\n </Section>\n )\n}\n"]}
1
+ {"version":3,"file":"local-facts.js","sourceRoot":"","sources":["../../../src/ui-kit/sections/local-facts.tsx"],"names":[],"mappings":";AAyBA,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAoC,MAAM,8CAA8C,CAAA;AACjJ,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,GAEvB,MAAM,2CAA2C,CAAA;AAClD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;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AM,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,GAAI,GACzI,CACP,CAAC,CAAC,CAAC,IAAI,EACP,MAAM,CAAC,CAAC,CAAC,CACR,iBAAS,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,YAC9B,KAAC,UAAU,IAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAC,WAAW,YAChE,MAAM,CAAC,KAAK,GACF,GACT,CACP,CAAC,CAAC,CAAC,IAAI,IACA,CACX,CAAA;AACH,CAAC","sourcesContent":["/**\n * `LocalFacts` (S16, `local-facts`, 3.15.0): what makes a suburb or service-in-suburb page true for this place, the\n * block that keeps location pages from being doorways. Server component.\n *\n * Only true items render, all from the site's data: an optional `intro` first (the page's own local overview, before\n * the heading, 3.15.0), the site's own sentences about real work here (`body`; 2 to 4\n * sentences on standard pages, the head page's owner-confirmed copy on `detailed`), sourced facts, one line about the\n * job here or nearby, and, in permit trades, the permit note from the council register. Locked (Romie, v1 §4.4): no\n * suburb trivia, no council facts beyond the permit note, no kilometre figures or \"based in\" (L10), no copy rotated from\n * a pool (L4). A phone link inside reports the `location` placement.\n *\n * The permit note is the `permit` slot (K12-slots): its line carries `data-bl-slot=\"permit\"`. When the page passes a\n * `permit` but the register has no current record for the council (none, more than six months since it was checked,\n * or past its fees' financial year), the line renders nothing and the section lists\n * `data-bl-slot-skip=\"permit:no-current-council-record\"`, which K12-slots reports as a warning until the record is\n * checked again. A page in a trade without a permit note passes no `permit`.\n *\n * 3.17.0: an optional photo, checklist and action. `photos` are the candidate photos in order (for example\n * `jobPhotos(job, media)` for the suburb's best job); the first one the page doesn't already show (`pagePhotos`, the\n * same no-repeat rule as `NearbyJobs`) renders, and only a genuine photo of the client's work. It comes first on phones\n * and sits beside the copy from 768 px. `checklist` is a `TickList` of the site's own points; `action` one button link,\n * for example the council guidance page.\n */\nimport type { ReactNode } from 'react'\nimport type { BrandlabMediaEntry } from '@brandlab-digital/site-core/media'\nimport { COUNCIL_PERMIT_SKIP_REASON, visibleCouncilRecord, type BrandlabCouncilPermitRecord } from '@brandlab-digital/site-core/council-register'\nimport {\n SECTION_READY,\n SECTION_SLOT_ATTRIBUTE,\n SECTION_SLOT_SKIP_ATTRIBUTE,\n formatSectionSlotSkips,\n type BrandlabSectionReadiness,\n} from '@brandlab-digital/site-core/section-order'\nimport { Anchor, ButtonLink } from '../primitives/links.js'\nimport { TickList, type TickItem } from '../primitives/lists.js'\nimport { Media, type MediaLayout } from '../primitives/media.js'\nimport { Section, SectionHeading, type SectionHeadingSlot, type SectionSlot, type SectionTone } from '../primitives/layout.js'\nimport type { RepeatedSlotOf } from '../repeated-slots.js'\nimport { repeatedSlot, slot, type SkinEntry } from '../skin.js'\nimport type { UiLink } from '../types.js'\nimport { CouncilRecordLines, type CouncilRecordSlot, type CouncilRuleWording } from './council-rules.js'\n\nexport const LOCAL_FACTS_VARIANTS = ['intro', 'detailed'] as const\nexport type LocalFactsVariant = (typeof LOCAL_FACTS_VARIANTS)[number]\nexport type LocalFactsSlot =\n | SectionSlot\n | SectionHeadingSlot\n | 'media'\n | 'intro'\n | 'body'\n | 'facts'\n | 'fact'\n | 'factSource'\n | 'checklist'\n | 'action'\n | 'job'\n | 'permit'\n | CouncilRecordSlot\n | 'fee'\n/** Rendered once per fact or fee: styled from the skin stylesheet, never by class. */\nexport type LocalFactsRepeatedSlot = RepeatedSlotOf<'localFacts'>\nexport interface LocalFactsLayout {\n /** The photo's crop. Defaults to 4:3. */\n readonly ratio?: NonNullable<MediaLayout['ratio']>\n /** The photo's side from 768 px. Defaults to `end`; it always comes first on phones. */\n readonly mediaSide?: 'start' | 'end'\n}\nexport type LocalFactsSkin = SkinEntry<LocalFactsSlot, LocalFactsVariant, LocalFactsLayout, LocalFactsRepeatedSlot>\n\n/** A candidate photo: a media-manifest entry with its id, as `jobPhotos()` returns them. */\nexport type LocalFactsPhoto = BrandlabMediaEntry & { readonly id: string }\n\n/** One sourced fact that changes the job here (a job or owner source; never a templated terrain line). */\nexport interface LocalFact {\n /** A stable id, rendered as `data-item`. */\n readonly id: string\n readonly text: ReactNode\n /** Where the fact can be checked. */\n readonly source?: UiLink\n}\n\n/** The permit note's data: the council's register record and how this site words it. */\nexport interface LocalFactsPermit {\n /** The register record for the suburb's council; `undefined` when the register has none. */\n readonly record: BrandlabCouncilPermitRecord | undefined\n /** The site's own wording of the rule in one or two lines. Defaults to the record's rule. */\n readonly rule?: CouncilRuleWording\n /** The source link's text. Defaults to the council's name. */\n readonly sourceLabel?: string\n /** The site's own council page, for example its \"Tree removal and Hornsby Council\" guide. */\n readonly councilPage?: UiLink\n /** The day the page is built or refreshed (Sydney). Defaults to now. */\n readonly asOf?: Date\n}\n\nexport interface LocalFactsProps extends LocalFactsSkin {\n /** The H2, for example \"Tree work in Castle Hill\". */\n readonly title: ReactNode\n readonly eyebrow?: ReactNode\n readonly lead?: ReactNode\n /**\n * The page's own introduction to the place (3.15.0), for example a suburb page's local overview paragraph. Site copy,\n * rendered first inside the section, before its heading, so the suburb page's intro lives in the `local-facts` place.\n */\n readonly intro?: ReactNode\n /** The site's own copy about real work here: sentences on `intro`, the head page's copy (with H3s) on `detailed`. */\n readonly body?: ReactNode\n readonly facts?: readonly LocalFact[]\n /** Candidate photos in order (3.17.0); the first the page doesn't already show renders. Genuine photos only. */\n readonly photos?: readonly LocalFactsPhoto[]\n /** Photos the page already shows, such as the hero's: media ids or `src` paths. The section never repeats one. */\n readonly pagePhotos?: readonly string[]\n /** The photo `sizes`. Defaults to half the width from 768 px. */\n readonly imageSizes?: string\n /** The site's own points, as a tick list (3.17.0). */\n readonly checklist?: readonly TickItem[]\n /** One button link after the copy (3.17.0), for example the site's council guidance page. */\n readonly action?: UiLink\n /** One line about the job here, or the nearest one labelled as nearby. */\n readonly job?: ReactNode\n /** Permit trades only. */\n readonly permit?: LocalFactsPermit\n /** Defaults to `local-facts-heading`. */\n readonly headingId?: string\n /** Set by `SectionSequence`. */\n readonly tone?: SectionTone\n}\n\n/** The guard for `SectionSequence`: renders when it has at least one true item to show. */\nexport function localFactsReady({\n intro,\n body,\n facts,\n checklist,\n job,\n permit,\n}: Pick<LocalFactsProps, 'intro' | 'body' | 'facts' | 'checklist' | 'job' | 'permit'>): BrandlabSectionReadiness {\n const permitShown = permit ? visibleCouncilRecord(permit.record, permit.asOf) !== undefined : false\n if (intro || body || (facts && facts.length > 0) || (checklist && checklist.length > 0) || job || permitShown) return SECTION_READY\n return { render: false, reason: 'no-local-facts' }\n}\n\nfunction assertFacts(facts: readonly LocalFact[]) {\n const ids = new Set<string>()\n for (const fact of facts) {\n if (!fact.id || ids.has(fact.id)) throw new Error(`LocalFacts: every fact needs its own id (\"${fact.id}\" is empty or repeated).`)\n ids.add(fact.id)\n }\n}\n\nfunction pickPhoto(photos: readonly LocalFactsPhoto[], pagePhotos: readonly string[] | undefined) {\n const shown = new Set(pagePhotos)\n const photo = photos.find((entry) => !shown.has(entry.id) && !shown.has(entry.src))\n if (photo && photo.provenance !== 'genuine') {\n throw new Error(`LocalFacts: \"${photo.id}\" is ${photo.provenance}; only a genuine photo of the client's work shows here.`)\n }\n return photo\n}\n\nexport function LocalFacts({\n title,\n eyebrow,\n lead,\n intro,\n body,\n facts = [],\n photos = [],\n pagePhotos,\n imageSizes = '(min-width: 768px) 45vw, 100vw',\n checklist = [],\n action,\n job,\n permit,\n headingId = 'local-facts-heading',\n tone,\n variant = 'intro',\n layout,\n classes,\n}: LocalFactsProps) {\n if (!localFactsReady({ intro, body, facts, checklist, job, permit }).render) return null\n assertFacts(facts)\n const photo = pickPhoto(photos, pagePhotos)\n const record = permit ? visibleCouncilRecord(permit.record, permit.asOf) : undefined\n const skip = permit && !record ? { [SECTION_SLOT_SKIP_ATTRIBUTE]: formatSectionSlotSkips([{ slot: 'permit', reason: COUNCIL_PERMIT_SKIP_REASON }]) } : undefined\n const hooks = photo ? { ...skip, 'data-media-side': layout?.mediaSide ?? 'end' } : skip\n return (\n <Section id=\"local-facts\" labelledBy={headingId} tone={tone} variant={variant} classes={classes} phonePlacement=\"location\" hooks={hooks}>\n {photo ? (\n <div {...slot(classes, 'media')}>\n <Media media={photo} sizes={imageSizes} layout={{ ratio: layout?.ratio ?? '4:3' }} />\n </div>\n ) : null}\n {intro ? <div {...slot(classes, 'intro')}>{intro}</div> : null}\n <SectionHeading id={headingId} title={title} eyebrow={eyebrow} lead={lead} classes={classes} />\n {body ? <div {...slot(classes, 'body')}>{body}</div> : null}\n {facts.length > 0 ? (\n <ul role=\"list\" {...slot(classes, 'facts')}>\n {facts.map((fact) => (\n <li key={fact.id} {...repeatedSlot('fact')} data-item={fact.id}>\n {fact.text}\n {fact.source ? (\n <>\n {' '}\n <Anchor href={fact.source.href} prefetch={false} hooks={repeatedSlot('factSource')}>\n {fact.source.label}\n </Anchor>\n </>\n ) : null}\n </li>\n ))}\n </ul>\n ) : null}\n {checklist.length > 0 ? (\n <div {...slot(classes, 'checklist')}>\n <TickList items={checklist} />\n </div>\n ) : null}\n {job ? <p {...slot(classes, 'job')}>{job}</p> : null}\n {permit && record ? (\n <div {...slot(classes, 'permit')} {...{ [SECTION_SLOT_ATTRIBUTE]: 'permit' }} data-council={record.council}>\n <CouncilRecordLines record={record} rule={permit.rule} sourceLabel={permit.sourceLabel} councilPage={permit.councilPage} classes={classes} />\n </div>\n ) : null}\n {action ? (\n <div {...slot(classes, 'action')}>\n <ButtonLink href={action.href} prefetch={false} variant=\"secondary\">\n {action.label}\n </ButtonLink>\n </div>\n ) : null}\n </Section>\n )\n}\n"]}
@@ -11,6 +11,13 @@
11
11
  * Card photos are always lazy. `pagePhotos` names the photos the page already shows (the hero's): a card then takes the
12
12
  * job's next genuine photo, or none, so the hero's priority photo is never repeated below as a lazy copy (3.15.0; on
13
13
  * AA's suburb pages the repeat made Next report the hero, the LCP image, as lazy and downloaded it twice).
14
+ *
15
+ * 3.17.0: two cards never share a heading. Where a card's label repeats an earlier one ("Tree removal in Eastwood"
16
+ * twice) it takes the job's own `title`, and a job without one fails the build; `layout.cardTitle: 'job'` uses the
17
+ * title on every card that has one. `linkCue` ("View job") shows on a linked card, and the whole card then follows
18
+ * the heading's link (the cue is `aria-hidden`, so the link's name stays the heading). `layout.arrangement: 'feature'`
19
+ * sets one tall card beside two stacked from 1024 px. `footer` (a count line) and `link` ("See all our projects")
20
+ * follow the list.
14
21
  */
15
22
  import type { ReactNode } from 'react';
16
23
  import { type BrandlabJob, type BrandlabNearbyJob } from '@brandlab-digital/site-core/jobs';
@@ -20,9 +27,10 @@ import { type MediaLayout } from '../primitives/media.js';
20
27
  import { type SectionHeadingSlot, type SectionSlot, type SectionTone } from '../primitives/layout.js';
21
28
  import type { RepeatedSlotOf } from '../repeated-slots.js';
22
29
  import { type SkinEntry } from '../skin.js';
30
+ import type { UiLink } from '../types.js';
23
31
  export declare const NEARBY_JOBS_VARIANTS: readonly ["grid", "rail"];
24
32
  export type NearbyJobsVariant = (typeof NEARBY_JOBS_VARIANTS)[number];
25
- export type NearbyJobsSlot = SectionSlot | SectionHeadingSlot | 'list' | RepeatedSlotOf<'nearbyJobs'>;
33
+ export type NearbyJobsSlot = SectionSlot | SectionHeadingSlot | 'list' | 'footer' | 'more' | RepeatedSlotOf<'nearbyJobs'>;
26
34
  /** Rendered once per job: styled from the skin stylesheet, never by class. */
27
35
  export type NearbyJobsRepeatedSlot = RepeatedSlotOf<'nearbyJobs'>;
28
36
  export interface NearbyJobsLayout {
@@ -30,6 +38,10 @@ export interface NearbyJobsLayout {
30
38
  readonly columns?: 2 | 3;
31
39
  /** The photo's crop. Defaults to 4:3. */
32
40
  readonly ratio?: NonNullable<MediaLayout['ratio']>;
41
+ /** `grid`: `even` (the default) or `feature`, one tall card beside two stacked from 1024 px (3.17.0). */
42
+ readonly arrangement?: 'even' | 'feature';
43
+ /** `label` (the default): the `jobCardLabel` heading; `job`: the job's own `title` where it has one (3.17.0). */
44
+ readonly cardTitle?: 'label' | 'job';
33
45
  }
34
46
  export type NearbyJobsSkin = SkinEntry<NearbyJobsSlot, NearbyJobsVariant, NearbyJobsLayout, NearbyJobsRepeatedSlot>;
35
47
  export interface NearbyJobsProps extends NearbyJobsSkin {
@@ -53,6 +65,12 @@ export interface NearbyJobsProps extends NearbyJobsSkin {
53
65
  readonly pagePhotos?: readonly string[];
54
66
  /** The job's project page, when the site has one. */
55
67
  readonly jobHref?: (job: BrandlabJob) => string | undefined;
68
+ /** A visible cue on a linked card (3.17.0), for example "View job". Decorative: the link's name is the heading. */
69
+ readonly linkCue?: ReactNode;
70
+ /** A line after the list (3.17.0), for example "42 jobs logged across the Hills District". */
71
+ readonly footer?: ReactNode;
72
+ /** A link after the list (3.17.0), for example `{ label: 'See all our projects', href: '/projects' }`. */
73
+ readonly link?: UiLink;
56
74
  /** The photo `sizes`. Defaults to one column of the grid. */
57
75
  readonly imageSizes?: string;
58
76
  /** Defaults to `nearby-jobs-heading`. */
@@ -62,5 +80,5 @@ export interface NearbyJobsProps extends NearbyJobsSkin {
62
80
  }
63
81
  /** The guard for `SectionSequence`: no card means no section (D2). */
64
82
  export declare function nearbyJobsReady({ jobs }: Pick<NearbyJobsProps, 'jobs'>): BrandlabSectionReadiness;
65
- export declare function NearbyJobs({ title, eyebrow, lead, jobs, pageSuburb, serviceName, suburbName, labelPrefix, media, pagePhotos, jobHref, imageSizes, headingId, tone, variant, layout, classes, }: NearbyJobsProps): import("react/jsx-runtime").JSX.Element | null;
83
+ export declare function NearbyJobs({ title, eyebrow, lead, jobs, pageSuburb, serviceName, suburbName, labelPrefix, media, pagePhotos, jobHref, linkCue, footer, link, imageSizes, headingId, tone, variant, layout, classes, }: NearbyJobsProps): import("react/jsx-runtime").JSX.Element | null;
66
84
  //# sourceMappingURL=nearby-jobs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nearby-jobs.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/sections/nearby-jobs.tsx"],"names":[],"mappings":"AAAA;;;;;;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,CAAA;IAC5B,8FAA8F;IAC9F,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAA;IAC3B,0GAA0G;IAC1G,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,6DAA6D;IAC7D,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,yCAAyC;IACzC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,gCAAgC;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAA;CAC5B;AAED,sEAAsE;AACtE,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,EAAE,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,GAAG,wBAAwB,CAEjG;AAaD,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,KAAK,EACL,UAAU,EACV,OAAO,EACP,OAAO,EACP,MAAM,EACN,IAAI,EACJ,UAAU,EACV,SAAiC,EACjC,IAAI,EACJ,OAAgB,EAChB,MAAM,EACN,OAAO,GACR,EAAE,eAAe,kDAqEjB"}
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { JOB_CARD_LIMIT, jobCardLabel, jobPhotos } from '@brandlab-digital/site-core/jobs';
3
3
  import { SECTION_READY } from '@brandlab-digital/site-core/section-order';
4
4
  import { LINK_PREFETCH_POLICY } from '../prefetch.js';
5
- import { Anchor } from '../primitives/links.js';
5
+ import { Anchor, TextLink } from '../primitives/links.js';
6
6
  import { Media } from '../primitives/media.js';
7
7
  import { Section, SectionHeading } from '../primitives/layout.js';
8
8
  import { repeatedSlot, slot } from '../skin.js';
@@ -24,7 +24,7 @@ function photoOf(job, media, shown) {
24
24
  throw new Error(`NearbyJobs: "${photo.id}" is a photo of ${photo.job}, not ${job.id}.`);
25
25
  return photo;
26
26
  }
27
- export function NearbyJobs({ title, eyebrow, lead, jobs, pageSuburb, serviceName, suburbName, labelPrefix, media, pagePhotos, jobHref, imageSizes, headingId = 'nearby-jobs-heading', tone, variant = 'grid', layout, classes, }) {
27
+ export function NearbyJobs({ title, eyebrow, lead, jobs, pageSuburb, serviceName, suburbName, labelPrefix, media, pagePhotos, jobHref, linkCue, footer, link, imageSizes, headingId = 'nearby-jobs-heading', tone, variant = 'grid', layout, classes, }) {
28
28
  if (jobs.length === 0)
29
29
  return null;
30
30
  if (jobs.length > JOB_CARD_LIMIT)
@@ -38,12 +38,29 @@ export function NearbyJobs({ title, eyebrow, lead, jobs, pageSuburb, serviceName
38
38
  const shown = new Set(pagePhotos);
39
39
  const columns = layout?.columns ?? 3;
40
40
  const ratio = layout?.ratio ?? '4:3';
41
+ const feature = variant === 'grid' && layout?.arrangement === 'feature' && jobs.length === 3;
41
42
  const sizes = imageSizes ?? `(min-width: 1024px) ${Math.round(100 / columns)}vw, (min-width: 640px) 50vw, 100vw`;
42
- return (_jsxs(Section, { id: "nearby-jobs", labelledBy: headingId, tone: tone, variant: variant, classes: classes, hooks: { 'data-columns': String(columns), 'data-ratio': ratio }, children: [_jsx(SectionHeading, { id: headingId, title: title, eyebrow: eyebrow, lead: lead, classes: classes }), _jsx("ul", { role: "list", ...slot(classes, 'list'), children: jobs.map(({ job }) => {
43
- const label = jobCardLabel(job, { service: serviceName(job.service), suburbName: suburbName(job.suburb), pageSuburb, ...(labelPrefix === undefined ? {} : { prefix: labelPrefix }) });
43
+ const headings = cardHeadings(jobs, layout?.cardTitle ?? 'label', (job) => jobCardLabel(job, { service: serviceName(job.service), suburbName: suburbName(job.suburb), pageSuburb, ...(labelPrefix === undefined ? {} : { prefix: labelPrefix }) }));
44
+ return (_jsxs(Section, { id: "nearby-jobs", labelledBy: headingId, tone: tone, variant: variant, classes: classes, hooks: { 'data-columns': String(columns), 'data-ratio': ratio, 'data-arrangement': feature ? 'feature' : undefined }, children: [_jsx(SectionHeading, { id: headingId, title: title, eyebrow: eyebrow, lead: lead, classes: classes }), _jsx("ul", { role: "list", ...slot(classes, 'list'), children: jobs.map(({ job }, index) => {
45
+ const label = headings[index];
44
46
  const href = jobHref?.(job);
45
47
  const photo = photoOf(job, media, shown);
46
- return (_jsxs("li", { ...repeatedSlot('item'), "data-item": job.id, "data-suburb": job.suburb, children: [_jsxs("div", { ...repeatedSlot('body'), children: [_jsx("h3", { ...repeatedSlot('title'), children: href ? (_jsx(Anchor, { href: href, prefetch: LINK_PREFETCH_POLICY.contentCard, hooks: repeatedSlot('link'), children: label })) : (label) }), _jsx("p", { ...repeatedSlot('outcome'), children: job.outcome })] }), photo ? (_jsx("div", { ...repeatedSlot('media'), children: _jsx(Media, { media: photo, sizes: sizes, layout: { ratio } }) })) : null] }, job.id));
47
- }) })] }));
48
+ return (_jsxs("li", { ...repeatedSlot('item'), "data-item": job.id, "data-suburb": job.suburb, "data-linked": href ? '' : undefined, children: [_jsxs("div", { ...repeatedSlot('body'), children: [_jsx("h3", { ...repeatedSlot('title'), children: href ? (_jsx(Anchor, { href: href, prefetch: LINK_PREFETCH_POLICY.contentCard, hooks: repeatedSlot('link'), children: label })) : (label) }), _jsx("p", { ...repeatedSlot('outcome'), children: job.outcome }), href && linkCue ? (_jsx("span", { ...repeatedSlot('cue'), "aria-hidden": "true", children: linkCue })) : null] }), photo ? (_jsx("div", { ...repeatedSlot('media'), children: _jsx(Media, { media: photo, sizes: sizes, layout: { ratio } }) })) : null] }, job.id));
49
+ }) }), footer ? _jsx("p", { ...slot(classes, 'footer'), children: footer }) : null, link ? (_jsx("p", { ...slot(classes, 'more'), children: _jsx(TextLink, { href: link.href, prefetch: LINK_PREFETCH_POLICY.contentCard, children: link.label }) })) : null] }));
50
+ }
51
+ /** Each card's heading: its label, or the job's title where the label repeats an earlier card's or `cardTitle` is `job`. */
52
+ function cardHeadings(jobs, cardTitle, labelOf) {
53
+ const used = new Set();
54
+ return jobs.map(({ job }) => {
55
+ let heading = cardTitle === 'job' && job.title ? job.title : labelOf(job);
56
+ if (used.has(heading)) {
57
+ if (!job.title || used.has(job.title)) {
58
+ throw new Error(`NearbyJobs: two cards would both read "${heading}"; give job "${job.id}" its own title in the job log.`);
59
+ }
60
+ heading = job.title;
61
+ }
62
+ used.add(heading);
63
+ return heading;
64
+ });
48
65
  }
49
66
  //# sourceMappingURL=nearby-jobs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nearby-jobs.js","sourceRoot":"","sources":["../../../src/ui-kit/sections/nearby-jobs.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAA4C,MAAM,kCAAkC,CAAA;AAEpI,OAAO,EAAE,aAAa,EAAiC,MAAM,2CAA2C,CAAA;AACxG,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAoB,MAAM,wBAAwB,CAAA;AAChE,OAAO,EAAE,OAAO,EAAE,cAAc,EAA+D,MAAM,yBAAyB,CAAA;AAE9H,OAAO,EAAE,YAAY,EAAE,IAAI,EAAkB,MAAM,YAAY,CAAA;AAE/D,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAA;AA0C7D,sEAAsE;AACtE,MAAM,UAAU,eAAe,CAAC,EAAE,IAAI,EAAiC;IACrE,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAA;AACtF,CAAC;AAED,SAAS,OAAO,CAAC,GAAgB,EAAE,KAAwC,EAAE,KAA0B;IACrG,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAA;IAC5B,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,IAAI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AAM,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAA;oBACrL,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC,GAAG,CAAC,CAAA;oBAC3B,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;oBACxC,OAAO,CACL,iBAAqB,YAAY,CAAC,MAAM,CAAC,eAAa,GAAG,CAAC,EAAE,iBAAe,GAAG,CAAC,MAAM,aACnF,kBAAS,YAAY,CAAC,MAAM,CAAC,aAC3B,gBAAQ,YAAY,CAAC,OAAO,CAAC,YAC1B,IAAI,CAAC,CAAC,CAAC,CACN,KAAC,MAAM,IAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,CAAC,WAAW,EAAE,KAAK,EAAE,YAAY,CAAC,MAAM,CAAC,YACxF,KAAK,GACC,CACV,CAAC,CAAC,CAAC,CACF,KAAK,CACN,GACE,EACL,eAAO,YAAY,CAAC,SAAS,CAAC,YAAG,GAAG,CAAC,OAAO,GAAK,IAC7C,EACL,KAAK,CAAC,CAAC,CAAC,CACP,iBAAS,YAAY,CAAC,OAAO,CAAC,YAC5B,KAAC,KAAK,IAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,GAAI,GACpD,CACP,CAAC,CAAC,CAAC,IAAI,KAjBD,GAAG,CAAC,EAAE,CAkBV,CACN,CAAA;gBACH,CAAC,CAAC,GACC,IACG,CACX,CAAA;AACH,CAAC","sourcesContent":["/**\n * `NearbyJobs` (S17, `nearby-jobs`, 3.15.0): proof of real work near this place. Server component.\n *\n * The cards come from the job log (site-core `./jobs`): `nearbyJobs(origin, jobs, { centreOf, service })` ranks the\n * page suburb's own jobs first, then others by real distance within 10 km, at most three. Each card's heading is\n * `jobCardLabel`: \"Tree removal in Castle Hill\" for the page's own suburb, \"Tree removal nearby: Ryde\" for any other\n * (L4); only a job whose month is known says \"Recent\" (or `labelPrefix`) and ends \", {Month Year}\". Distances rank the cards and are never\n * printed (L10). A card shows the job's first photo through `Media`, and only a genuine photo of that job: a stock or AI\n * image never stands for the client's work. With no job close enough the section renders nothing and its guard says\n * so (`no-jobs-nearby`, D2). A card links to the job's project page when the site has one (prefetch on intent).\n * Card photos are always lazy. `pagePhotos` names the photos the page already shows (the hero's): a card then takes the\n * job's next genuine photo, or none, so the hero's priority photo is never repeated below as a lazy copy (3.15.0; on\n * AA's suburb pages the repeat made Next report the hero, the LCP image, as lazy and downloaded it twice).\n */\nimport type { ReactNode } from 'react'\nimport { JOB_CARD_LIMIT, jobCardLabel, jobPhotos, type BrandlabJob, type BrandlabNearbyJob } from '@brandlab-digital/site-core/jobs'\nimport type { BrandlabMediaManifest } from '@brandlab-digital/site-core/media'\nimport { SECTION_READY, type BrandlabSectionReadiness } from '@brandlab-digital/site-core/section-order'\nimport { LINK_PREFETCH_POLICY } from '../prefetch.js'\nimport { Anchor } from '../primitives/links.js'\nimport { Media, type MediaLayout } from '../primitives/media.js'\nimport { Section, SectionHeading, type SectionHeadingSlot, type SectionSlot, type SectionTone } from '../primitives/layout.js'\nimport type { RepeatedSlotOf } from '../repeated-slots.js'\nimport { repeatedSlot, slot, type SkinEntry } from '../skin.js'\n\nexport const NEARBY_JOBS_VARIANTS = ['grid', 'rail'] as const\nexport type NearbyJobsVariant = (typeof NEARBY_JOBS_VARIANTS)[number]\nexport type NearbyJobsSlot = SectionSlot | SectionHeadingSlot | 'list' | RepeatedSlotOf<'nearbyJobs'>\n/** Rendered once per job: styled from the skin stylesheet, never by class. */\nexport type NearbyJobsRepeatedSlot = RepeatedSlotOf<'nearbyJobs'>\nexport interface NearbyJobsLayout {\n /** `grid`: columns on wide screens. Defaults to 3. */\n readonly columns?: 2 | 3\n /** The photo's crop. Defaults to 4:3. */\n readonly ratio?: NonNullable<MediaLayout['ratio']>\n}\nexport type NearbyJobsSkin = SkinEntry<NearbyJobsSlot, NearbyJobsVariant, NearbyJobsLayout, NearbyJobsRepeatedSlot>\n\nexport interface NearbyJobsProps extends NearbyJobsSkin {\n /** The H2, for example \"Recent tree work near Castle Hill\". */\n readonly title: ReactNode\n readonly eyebrow?: ReactNode\n readonly lead?: ReactNode\n /** The ranked cards from `nearbyJobs()`, nearest first; at most three. */\n readonly jobs: readonly BrandlabNearbyJob[]\n /** The page's suburb slug: its own jobs read \"in {Suburb}\", every other \"nearby: {Suburb}\". */\n readonly pageSuburb: string\n /** The service's name from the site's catalogue, for example `(slug) => services[slug].name`. */\n readonly serviceName: (service: string) => string\n /** The suburb's name from the registry. */\n readonly suburbName: (suburb: string) => string\n /** Replaces \"Recent\" on a dated card (\"Completed tree removal …\"); `''` for none. An undated card never has one. */\n readonly labelPrefix?: string\n /** The media manifest, for the jobs' photos. Left out, the cards show no photo. */\n readonly media?: BrandlabMediaManifest\n /** Photos the page already shows, such as the hero's: media ids or `src` paths. A card never repeats one. */\n readonly pagePhotos?: readonly string[]\n /** The job's project page, when the site has one. */\n readonly jobHref?: (job: BrandlabJob) => string | undefined\n /** The photo `sizes`. Defaults to one column of the grid. */\n readonly imageSizes?: string\n /** Defaults to `nearby-jobs-heading`. */\n readonly headingId?: string\n /** Set by `SectionSequence`. */\n readonly tone?: SectionTone\n}\n\n/** The guard for `SectionSequence`: no card means no section (D2). */\nexport function nearbyJobsReady({ jobs }: Pick<NearbyJobsProps, 'jobs'>): BrandlabSectionReadiness {\n return jobs.length > 0 ? SECTION_READY : { render: false, reason: 'no-jobs-nearby' }\n}\n\nfunction photoOf(job: BrandlabJob, media: BrandlabMediaManifest | undefined, shown: ReadonlySet<string>) {\n if (!media) return undefined\n const photo = jobPhotos(job, media).find((entry) => !shown.has(entry.id) && !shown.has(entry.src))\n if (!photo) return undefined\n if (photo.provenance !== 'genuine') {\n throw new Error(`NearbyJobs: \"${photo.id}\" is ${photo.provenance}; only a genuine photo of the job shows on its card.`)\n }\n if (photo.job !== undefined && photo.job !== job.id) throw new Error(`NearbyJobs: \"${photo.id}\" is a photo of ${photo.job}, not ${job.id}.`)\n return photo\n}\n\nexport function NearbyJobs({\n title,\n eyebrow,\n lead,\n jobs,\n pageSuburb,\n serviceName,\n suburbName,\n labelPrefix,\n media,\n pagePhotos,\n jobHref,\n imageSizes,\n headingId = 'nearby-jobs-heading',\n tone,\n variant = 'grid',\n layout,\n classes,\n}: NearbyJobsProps) {\n if (jobs.length === 0) return null\n if (jobs.length > JOB_CARD_LIMIT) throw new Error(`NearbyJobs: ${jobs.length} jobs; a page shows at most ${JOB_CARD_LIMIT} job cards.`)\n const ids = new Set<string>()\n for (const { job } of jobs) {\n if (ids.has(job.id)) throw new Error(`NearbyJobs: \"${job.id}\" is listed twice.`)\n ids.add(job.id)\n }\n const shown = new Set(pagePhotos)\n const columns = layout?.columns ?? 3\n const ratio = layout?.ratio ?? '4:3'\n const sizes = imageSizes ?? `(min-width: 1024px) ${Math.round(100 / columns)}vw, (min-width: 640px) 50vw, 100vw`\n return (\n <Section id=\"nearby-jobs\" labelledBy={headingId} tone={tone} variant={variant} classes={classes} hooks={{ 'data-columns': String(columns), 'data-ratio': ratio }}>\n <SectionHeading id={headingId} title={title} eyebrow={eyebrow} lead={lead} classes={classes} />\n <ul role=\"list\" {...slot(classes, 'list')}>\n {jobs.map(({ job }) => {\n const label = jobCardLabel(job, { service: serviceName(job.service), suburbName: suburbName(job.suburb), pageSuburb, ...(labelPrefix === undefined ? {} : { prefix: labelPrefix }) })\n const href = jobHref?.(job)\n const photo = photoOf(job, media, shown)\n return (\n <li key={job.id} {...repeatedSlot('item')} data-item={job.id} data-suburb={job.suburb}>\n <div {...repeatedSlot('body')}>\n <h3 {...repeatedSlot('title')}>\n {href ? (\n <Anchor href={href} prefetch={LINK_PREFETCH_POLICY.contentCard} hooks={repeatedSlot('link')}>\n {label}\n </Anchor>\n ) : (\n label\n )}\n </h3>\n <p {...repeatedSlot('outcome')}>{job.outcome}</p>\n </div>\n {photo ? (\n <div {...repeatedSlot('media')}>\n <Media media={photo} sizes={sizes} layout={{ ratio }} />\n </div>\n ) : null}\n </li>\n )\n })}\n </ul>\n </Section>\n )\n}\n"]}
1
+ {"version":3,"file":"nearby-jobs.js","sourceRoot":"","sources":["../../../src/ui-kit/sections/nearby-jobs.tsx"],"names":[],"mappings":";AAsBA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAA4C,MAAM,kCAAkC,CAAA;AAEpI,OAAO,EAAE,aAAa,EAAiC,MAAM,2CAA2C,CAAA;AACxG,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,KAAK,EAAoB,MAAM,wBAAwB,CAAA;AAChE,OAAO,EAAE,OAAO,EAAE,cAAc,EAA+D,MAAM,yBAAyB,CAAA;AAE9H,OAAO,EAAE,YAAY,EAAE,IAAI,EAAkB,MAAM,YAAY,CAAA;AAG/D,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAA;AAoD7D,sEAAsE;AACtE,MAAM,UAAU,eAAe,CAAC,EAAE,IAAI,EAAiC;IACrE,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAA;AACtF,CAAC;AAED,SAAS,OAAO,CAAC,GAAgB,EAAE,KAAwC,EAAE,KAA0B;IACrG,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAA;IAC5B,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA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AAO,CAAA;IAChB,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["/**\n * `NearbyJobs` (S17, `nearby-jobs`, 3.15.0): proof of real work near this place. Server component.\n *\n * The cards come from the job log (site-core `./jobs`): `nearbyJobs(origin, jobs, { centreOf, service })` ranks the\n * page suburb's own jobs first, then others by real distance within 10 km, at most three. Each card's heading is\n * `jobCardLabel`: \"Tree removal in Castle Hill\" for the page's own suburb, \"Tree removal nearby: Ryde\" for any other\n * (L4); only a job whose month is known says \"Recent\" (or `labelPrefix`) and ends \", {Month Year}\". Distances rank the cards and are never\n * printed (L10). A card shows the job's first photo through `Media`, and only a genuine photo of that job: a stock or AI\n * image never stands for the client's work. With no job close enough the section renders nothing and its guard says\n * so (`no-jobs-nearby`, D2). A card links to the job's project page when the site has one (prefetch on intent).\n * Card photos are always lazy. `pagePhotos` names the photos the page already shows (the hero's): a card then takes the\n * job's next genuine photo, or none, so the hero's priority photo is never repeated below as a lazy copy (3.15.0; on\n * AA's suburb pages the repeat made Next report the hero, the LCP image, as lazy and downloaded it twice).\n *\n * 3.17.0: two cards never share a heading. Where a card's label repeats an earlier one (\"Tree removal in Eastwood\"\n * twice) it takes the job's own `title`, and a job without one fails the build; `layout.cardTitle: 'job'` uses the\n * title on every card that has one. `linkCue` (\"View job\") shows on a linked card, and the whole card then follows\n * the heading's link (the cue is `aria-hidden`, so the link's name stays the heading). `layout.arrangement: 'feature'`\n * sets one tall card beside two stacked from 1024 px. `footer` (a count line) and `link` (\"See all our projects\")\n * follow the list.\n */\nimport type { ReactNode } from 'react'\nimport { JOB_CARD_LIMIT, jobCardLabel, jobPhotos, type BrandlabJob, type BrandlabNearbyJob } from '@brandlab-digital/site-core/jobs'\nimport type { BrandlabMediaManifest } from '@brandlab-digital/site-core/media'\nimport { SECTION_READY, type BrandlabSectionReadiness } from '@brandlab-digital/site-core/section-order'\nimport { LINK_PREFETCH_POLICY } from '../prefetch.js'\nimport { Anchor, TextLink } from '../primitives/links.js'\nimport { Media, type MediaLayout } from '../primitives/media.js'\nimport { Section, SectionHeading, type SectionHeadingSlot, type SectionSlot, type SectionTone } from '../primitives/layout.js'\nimport type { RepeatedSlotOf } from '../repeated-slots.js'\nimport { repeatedSlot, slot, type SkinEntry } from '../skin.js'\nimport type { UiLink } from '../types.js'\n\nexport const NEARBY_JOBS_VARIANTS = ['grid', 'rail'] as const\nexport type NearbyJobsVariant = (typeof NEARBY_JOBS_VARIANTS)[number]\nexport type NearbyJobsSlot = SectionSlot | SectionHeadingSlot | 'list' | 'footer' | 'more' | RepeatedSlotOf<'nearbyJobs'>\n/** Rendered once per job: styled from the skin stylesheet, never by class. */\nexport type NearbyJobsRepeatedSlot = RepeatedSlotOf<'nearbyJobs'>\nexport interface NearbyJobsLayout {\n /** `grid`: columns on wide screens. Defaults to 3. */\n readonly columns?: 2 | 3\n /** The photo's crop. Defaults to 4:3. */\n readonly ratio?: NonNullable<MediaLayout['ratio']>\n /** `grid`: `even` (the default) or `feature`, one tall card beside two stacked from 1024 px (3.17.0). */\n readonly arrangement?: 'even' | 'feature'\n /** `label` (the default): the `jobCardLabel` heading; `job`: the job's own `title` where it has one (3.17.0). */\n readonly cardTitle?: 'label' | 'job'\n}\nexport type NearbyJobsSkin = SkinEntry<NearbyJobsSlot, NearbyJobsVariant, NearbyJobsLayout, NearbyJobsRepeatedSlot>\n\nexport interface NearbyJobsProps extends NearbyJobsSkin {\n /** The H2, for example \"Recent tree work near Castle Hill\". */\n readonly title: ReactNode\n readonly eyebrow?: ReactNode\n readonly lead?: ReactNode\n /** The ranked cards from `nearbyJobs()`, nearest first; at most three. */\n readonly jobs: readonly BrandlabNearbyJob[]\n /** The page's suburb slug: its own jobs read \"in {Suburb}\", every other \"nearby: {Suburb}\". */\n readonly pageSuburb: string\n /** The service's name from the site's catalogue, for example `(slug) => services[slug].name`. */\n readonly serviceName: (service: string) => string\n /** The suburb's name from the registry. */\n readonly suburbName: (suburb: string) => string\n /** Replaces \"Recent\" on a dated card (\"Completed tree removal …\"); `''` for none. An undated card never has one. */\n readonly labelPrefix?: string\n /** The media manifest, for the jobs' photos. Left out, the cards show no photo. */\n readonly media?: BrandlabMediaManifest\n /** Photos the page already shows, such as the hero's: media ids or `src` paths. A card never repeats one. */\n readonly pagePhotos?: readonly string[]\n /** The job's project page, when the site has one. */\n readonly jobHref?: (job: BrandlabJob) => string | undefined\n /** A visible cue on a linked card (3.17.0), for example \"View job\". Decorative: the link's name is the heading. */\n readonly linkCue?: ReactNode\n /** A line after the list (3.17.0), for example \"42 jobs logged across the Hills District\". */\n readonly footer?: ReactNode\n /** A link after the list (3.17.0), for example `{ label: 'See all our projects', href: '/projects' }`. */\n readonly link?: UiLink\n /** The photo `sizes`. Defaults to one column of the grid. */\n readonly imageSizes?: string\n /** Defaults to `nearby-jobs-heading`. */\n readonly headingId?: string\n /** Set by `SectionSequence`. */\n readonly tone?: SectionTone\n}\n\n/** The guard for `SectionSequence`: no card means no section (D2). */\nexport function nearbyJobsReady({ jobs }: Pick<NearbyJobsProps, 'jobs'>): BrandlabSectionReadiness {\n return jobs.length > 0 ? SECTION_READY : { render: false, reason: 'no-jobs-nearby' }\n}\n\nfunction photoOf(job: BrandlabJob, media: BrandlabMediaManifest | undefined, shown: ReadonlySet<string>) {\n if (!media) return undefined\n const photo = jobPhotos(job, media).find((entry) => !shown.has(entry.id) && !shown.has(entry.src))\n if (!photo) return undefined\n if (photo.provenance !== 'genuine') {\n throw new Error(`NearbyJobs: \"${photo.id}\" is ${photo.provenance}; only a genuine photo of the job shows on its card.`)\n }\n if (photo.job !== undefined && photo.job !== job.id) throw new Error(`NearbyJobs: \"${photo.id}\" is a photo of ${photo.job}, not ${job.id}.`)\n return photo\n}\n\nexport function NearbyJobs({\n title,\n eyebrow,\n lead,\n jobs,\n pageSuburb,\n serviceName,\n suburbName,\n labelPrefix,\n media,\n pagePhotos,\n jobHref,\n linkCue,\n footer,\n link,\n imageSizes,\n headingId = 'nearby-jobs-heading',\n tone,\n variant = 'grid',\n layout,\n classes,\n}: NearbyJobsProps) {\n if (jobs.length === 0) return null\n if (jobs.length > JOB_CARD_LIMIT) throw new Error(`NearbyJobs: ${jobs.length} jobs; a page shows at most ${JOB_CARD_LIMIT} job cards.`)\n const ids = new Set<string>()\n for (const { job } of jobs) {\n if (ids.has(job.id)) throw new Error(`NearbyJobs: \"${job.id}\" is listed twice.`)\n ids.add(job.id)\n }\n const shown = new Set(pagePhotos)\n const columns = layout?.columns ?? 3\n const ratio = layout?.ratio ?? '4:3'\n const feature = variant === 'grid' && layout?.arrangement === 'feature' && jobs.length === 3\n const sizes = imageSizes ?? `(min-width: 1024px) ${Math.round(100 / columns)}vw, (min-width: 640px) 50vw, 100vw`\n const headings = cardHeadings(jobs, layout?.cardTitle ?? 'label', (job) =>\n jobCardLabel(job, { service: serviceName(job.service), suburbName: suburbName(job.suburb), pageSuburb, ...(labelPrefix === undefined ? {} : { prefix: labelPrefix }) }),\n )\n return (\n <Section\n id=\"nearby-jobs\"\n labelledBy={headingId}\n tone={tone}\n variant={variant}\n classes={classes}\n hooks={{ 'data-columns': String(columns), 'data-ratio': ratio, 'data-arrangement': feature ? 'feature' : undefined }}\n >\n <SectionHeading id={headingId} title={title} eyebrow={eyebrow} lead={lead} classes={classes} />\n <ul role=\"list\" {...slot(classes, 'list')}>\n {jobs.map(({ job }, index) => {\n const label = headings[index]\n const href = jobHref?.(job)\n const photo = photoOf(job, media, shown)\n return (\n <li key={job.id} {...repeatedSlot('item')} data-item={job.id} data-suburb={job.suburb} data-linked={href ? '' : undefined}>\n <div {...repeatedSlot('body')}>\n <h3 {...repeatedSlot('title')}>\n {href ? (\n <Anchor href={href} prefetch={LINK_PREFETCH_POLICY.contentCard} hooks={repeatedSlot('link')}>\n {label}\n </Anchor>\n ) : (\n label\n )}\n </h3>\n <p {...repeatedSlot('outcome')}>{job.outcome}</p>\n {href && linkCue ? (\n <span {...repeatedSlot('cue')} aria-hidden=\"true\">\n {linkCue}\n </span>\n ) : null}\n </div>\n {photo ? (\n <div {...repeatedSlot('media')}>\n <Media media={photo} sizes={sizes} layout={{ ratio }} />\n </div>\n ) : null}\n </li>\n )\n })}\n </ul>\n {footer ? <p {...slot(classes, 'footer')}>{footer}</p> : null}\n {link ? (\n <p {...slot(classes, 'more')}>\n <TextLink href={link.href} prefetch={LINK_PREFETCH_POLICY.contentCard}>\n {link.label}\n </TextLink>\n </p>\n ) : null}\n </Section>\n )\n}\n\n/** Each card's heading: its label, or the job's title where the label repeats an earlier card's or `cardTitle` is `job`. */\nfunction cardHeadings(jobs: readonly BrandlabNearbyJob[], cardTitle: 'label' | 'job', labelOf: (job: BrandlabJob) => string): string[] {\n const used = new Set<string>()\n return jobs.map(({ job }) => {\n let heading = cardTitle === 'job' && job.title ? job.title : labelOf(job)\n if (used.has(heading)) {\n if (!job.title || used.has(job.title)) {\n throw new Error(`NearbyJobs: two cards would both read \"${heading}\"; give job \"${job.id}\" its own title in the job log.`)\n }\n heading = job.title\n }\n used.add(heading)\n return heading\n })\n}\n"]}
@@ -17,7 +17,7 @@ import type { RepeatedSlotOf } from '../repeated-slots.js';
17
17
  import { type SkinEntry } from '../skin.js';
18
18
  export declare const PROOF_STRIP_VARIANTS: readonly ["inline", "tiles"];
19
19
  export type ProofStripVariant = (typeof PROOF_STRIP_VARIANTS)[number];
20
- export type ProofStripSlot = SectionSlot | 'heading' | 'list' | 'item' | 'link' | 'icon' | 'stars' | 'value' | 'label' | 'logos';
20
+ export type ProofStripSlot = SectionSlot | 'heading' | 'list' | 'item' | 'link' | 'icon' | 'stars' | 'value' | 'label' | 'linkLabel' | 'logos';
21
21
  /** `heading`: the section's H2 is visually hidden by default; a skin may show it. */
22
22
  /** Rendered once per proof item: styled from the skin stylesheet, never by class (3.14.0). */
23
23
  export type ProofStripRepeatedSlot = RepeatedSlotOf<'proofStrip'>;
@@ -33,6 +33,8 @@ interface ProofItemBase {
33
33
  readonly icon?: UiIconName;
34
34
  /** Where the fact can be checked (3.16.0), for example `/reviews` or the licence register. */
35
35
  readonly href?: string;
36
+ /** A visible cue under the label when `href` is set (3.17.0), for example "Read reviews". An arrow follows it. */
37
+ readonly linkLabel?: string;
36
38
  }
37
39
  /** One verified fact, for example `{ id: 'licence', value: '276621C', label: 'NSW contractor licence' }`. */
38
40
  export interface ProofFactItem extends ProofItemBase {
@@ -1 +1 @@
1
- {"version":3,"file":"proof-strip.d.ts","sourceRoot":"","sources":["../../../src/ui-kit/sections/proof-strip.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAiB,KAAK,wBAAwB,EAAE,MAAM,2CAA2C,CAAA;AACxG,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,aAAa,CAAA;AAEnD,OAAO,EAAwB,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAClG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAE/D,eAAO,MAAM,oBAAoB,8BAA+B,CAAA;AAChE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AACrE,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAA;AAChI,qFAAqF;AACrF,8FAA8F;AAC9F,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC,YAAY,CAAC,CAAA;AACjE,MAAM,MAAM,cAAc,GAAG,SAAS,CAAC,cAAc,EAAE,iBAAiB,EAAE;IAAE,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;CAAE,EAAE,sBAAsB,CAAC,CAAA;AAErI,0FAA0F;AAC1F,eAAO,MAAM,m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