// THE INTRO (module `intro`, a segment): the brand sting a cut opens with -- // the wordmark built on the first sound, "media" under it, a mark drawn or // chimed, and on the chime a site's name swapped in (`render.intro`; // common lib/report/intro.mjs holds its rules, report-to-video intro.mjs // renders it, chrome-intro.mjs writes its page). // // The BRAND is configurable: `brand` names the kit it draws (brands/.json, // default archilyzer-media), `suffix` the letters a site's name keeps of the // brand's ("lyzer": Jeralyzer swaps "Archi" for "Jera"), `projectUrl` the URL // the swap writes beside the site's (default archilyzer.pages.dev; false // none). Unset, the intro is the bytes it always was. import { INTRO_BRAND_DEFAULT, INTRO_GROUNDS, INTRO_MARKS, INTRO_PROJECT_URL, INTRO_SECONDS, INTRO_SECONDS_MAX, INTRO_SECONDS_MIN, INTRO_LINE_MAX, INTRO_LINES_MAX, INTRO_STYLES, INTRO_SUFFIX, INTRO_SWAPS, INTRO_TITLE_MAX, INTRO_URL_PLACES, INTRO_URLS, introErrors, introOf, } from "yt-dlp-transcript-common/lib/report/intro.mjs"; import { BRAND_IDS } from "../brand-ids.mjs"; import { defineModule } from "./contract.mjs"; /** Every reason `render.intro` cannot be drawn: the common rules, and a brand kit this renderer has. */ export function validateIntroSettings(value) { const errors = introErrors(value); const brand = value && typeof value === "object" ? value.brand : undefined; if (typeof brand === "string" && !errors.some((e) => e.startsWith("render.intro.brand")) && !BRAND_IDS.includes(brand)) { errors.push(`render.intro.brand "${brand}" is not a brand kit — one of ${BRAND_IDS.join(", ")}`); } return errors; } export default defineModule({ id: "intro", version: 1, z: 1, kind: "segment", slot: "full", // Its form in the stacked vertical deck (vertical-deck.mjs). vertical: { slot: "segment" }, title: "Intro", summary: "The brand sting the cut opens with, a site's name swapped in on the chime.", configKey: "render.intro", defaults: { style: null, brand: INTRO_BRAND_DEFAULT, suffix: INTRO_SUFFIX, projectUrl: INTRO_PROJECT_URL, seconds: INTRO_SECONDS }, validate: (value) => validateIntroSettings(value), resolve: introOf, async render(ctx) { const { renderIntro } = await import("../intro.mjs"); return renderIntro(ctx); }, ui: [ { key: "style", type: "enum", options: INTRO_STYLES, label: "Style" }, { key: "ground", type: "enum", options: INTRO_GROUNDS, label: "Ground" }, { key: "mark", type: "enum", options: INTRO_MARKS, label: "Mark" }, { key: "seconds", type: "number", min: INTRO_SECONDS_MIN, max: INTRO_SECONDS_MAX, step: 0.05, label: "Seconds", default: INTRO_SECONDS }, { key: "site", type: "text", label: "Site (auto, an id, none)" }, { key: "swap", type: "enum", options: INTRO_SWAPS, label: "Swap" }, { key: "url", type: "enum", options: [...INTRO_URLS, false], label: "URLs" }, { key: "urlPlace", type: "enum", options: INTRO_URL_PLACES, label: "URLs go" }, { key: "brand", type: "enum", options: BRAND_IDS, label: "Brand kit", default: INTRO_BRAND_DEFAULT }, { key: "suffix", type: "text", label: "Shared suffix", default: INTRO_SUFFIX }, { key: "projectUrl", type: "text", label: "Project URL", default: INTRO_PROJECT_URL }, { key: "title", type: "text", label: "Title (title-card: the project's)" }, ], docs: { heading: "Intro", intro: "The brand sting (`render.intro`); the style, mark and site knobs are in [The cut](#the-cut), the words and the editor in [The intro](#the-intro-played-and-edited). The brand it draws is configurable; unset, it is the Archilyzer intro, byte for byte.", rows: [ ["`render.intro.brand`", `a brand kit id (${BRAND_IDS.join(", ")}) · default \`${INTRO_BRAND_DEFAULT}\``, "`umtool look

intro='{\"style\":\"boot\",\"brand\":\"archilyzer-media\"}'`"], ["`render.intro.suffix`", `the letters a site's name keeps of the brand's, 1–16 · default \`${INTRO_SUFFIX}\` (Jeralyzer swaps "Archi" for "Jera")`, "a take: `--set render.intro.suffix=lyzer`"], ["`render.intro.projectUrl`", `the project URL the swap writes beside the site's · \`false\` none · default \`${INTRO_PROJECT_URL}\``, "a take: `--set render.intro.projectUrl=false`"], ["`render.intro.title`", `one line, 1–${INTRO_TITLE_MAX} · \`title-card\`: default the project's title; a boot style: drawn under the wordmark only when written`, "`umtool intro

title='In her own words'` (`title=` clears)"], ["`render.intro.lines`", `≤ ${INTRO_LINES_MAX} lines of 1–${INTRO_LINE_MAX} · \`title-card\`: default the project's date in words (\`generatedOn\`)`, "`umtool intro

lines='29 October 2026|Part one'`"], ], }, });