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AAI,QAAQ,IAAI,CAAA;AACvC,IAAA,IAAA,CAAK,SAAA,CAAU,EAAA,GAAK,EAAA,EAAI,MAAA,EAAQ,IAAI,CAAA;AACpC,IAAA,GAAA,CAAI,GAAA,CAAI,KAAK,MAAM,CAAA;AACnB,IAAA,MAAA,IAAU,GAAA,CAAI,MAAA;AAAA,EAClB,CAAC,CAAA;AACD,EAAA,OAAO,GAAA;AACX","file":"assets.mjs","sourcesContent":["/**\n * The orangecheck mark: an isometric check on a 16×10 grid, three faces,\n * drawn smooth or in pixels (the ochk.app design's pixel mark: the same\n * faces, two cells per unit).\n *\n * Framework-free and dependency-free: SVG strings for any page, a data URI\n * for CSS and images, and the geometry for a renderer that draws its own.\n * The React component is in `@orangecheck/mark/react`.\n */\n\n/** The three faces as SVG points in the 16×10 box: the check on top, its sides 4 deep. */\nexport const MARK_POINTS = {\n    top: '0,3 2,2 6,4 14,0 16,1 6,6',\n    left: '0,3 6,6 6,10 0,7',\n    right: '6,6 16,1 16,5 6,10',\n} as const;\n\nexport const MARK_VIEWBOX = '0 0 16 10';\n\n/** The faces as drawn. For dark grounds only: the top face is about 1.1:1 on white. */\nexport const MARK_FACES = { top: '#F5F2EF', left: '#FB933C', right: '#EA580B' } as const;\n\n/**\n * One colour, three weights: the check at full strength, the sides as depth.\n * Chosen for the widest smallest step between neighbouring faces and the\n * ground across light, dark and mid-tone (amber, brown) buttons.\n */\nexport const MARK_MONO_OPACITY = { top: 1, left: 0.6, right: 0.3 } as const;\n\n/** The tile: the faces on an ink square with rounded corners, 24×24. Reads on any ground. */\nexport const MARK_TILE = {\n    viewBox: '0 0 24 24',\n    radius: 6.25,\n    fill: '#0A0A0A',\n    transform: 'translate(4.25 7.15) scale(0.97)',\n} as const;\n\n/** The pixel mark: two cells per unit, 32×20 cells. Crisp where one cell is a whole number of device pixels. */\nexport const MARK_PIXEL = { viewBox: '0 0 32 20', perUnit: 2 } as const;\n\n/** The pixel tile: 48×48 cells, the mark centred on it; crisp at 48, 96, 144, 192 px. */\nexport const MARK_PIXEL_TILE = { viewBox: '0 0 48 48', radius: 12.5, fill: '#0A0A0A', transform: 'translate(8 14)' } as const;\n\n/** Smallest width the bare mark may be drawn at, in CSS pixels (the tile: the same, square). */\nexport const MARK_MIN_PX = 16;\n\n/** `mono`: the host's text colour. `brand`: as drawn, on dark grounds. `tile`: the faces on their own ink tile. */\nexport type MarkVariant = 'mono' | 'brand' | 'tile';\n\ntype Face = 'top' | 'left' | 'right';\nconst ORDER: readonly Face[] = ['left', 'right', 'top'];\n\nfunction inside(x: number, y: number, poly: ReadonlyArray<readonly [number, number]>): boolean {\n    let hit = false;\n    for (let i = 0, j = poly.length - 1; i < poly.length; j = i++) {\n        const [xi, yi] = poly[i]!;\n        const [xj, yj] = poly[j]!;\n        if (yi > y !== yj > y && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi) hit = !hit;\n    }\n    return hit;\n}\n\n/** A face as runs of cells, [x, y, length]: every cell whose centre is inside the face. */\nfunction runs(face: Face, perUnit: number): ReadonlyArray<readonly [number, number, number]> {\n    const poly = MARK_POINTS[face].split(' ').map((p) => p.split(',').map(Number) as [number, number]);\n    const [w, h] = [16 * perUnit, 10 * perUnit];\n    const out: Array<readonly [number, number, number]> = [];\n    const at = (i: number, j: number) => inside((i + 0.5) / perUnit, (j + 0.5) / perUnit, poly);\n    for (let j = 0; j < h; j++) {\n        for (let i = 0; i < w; i++) {\n            if (!at(i, j)) continue;\n            let k = i;\n            while (k < w && at(k, j)) k++;\n            out.push([i, j, k - i]);\n            i = k;\n        }\n    }\n    return out;\n}\n\nexport type MarkPixelRuns = Readonly<Record<Face, ReadonlyArray<readonly [number, number, number]>>>;\n\n/**\n * The mark in square cells at `perUnit` cells a unit, per face, as runs [x, y, length]:\n * 1 is 16×10 cells (a lockup beside small type), 1.5 is 24×15, 2 is 32×20 (the design's drawing).\n * The grid must come out whole: 16 and 10 times `perUnit` both integers.\n */\nexport function markPixelRuns(perUnit: number): MarkPixelRuns {\n    if (!(perUnit > 0 && perUnit <= 8 && Number.isInteger(16 * perUnit) && Number.isInteger(10 * perUnit))) {\n        throw new RangeError(`@orangecheck/mark: ${perUnit} cells a unit is not a whole grid (16 and 10 times it must be integers)`);\n    }\n    return { top: runs('top', perUnit), left: runs('left', perUnit), right: runs('right', perUnit) };\n}\n\n/** The pixel mark's cells, per face, as runs [x, y, length] on the 32×20 grid. */\nexport const MARK_PIXEL_RUNS: MarkPixelRuns = markPixelRuns(MARK_PIXEL.perUnit);\n\nexport interface MarkSvgOptions {\n    variant?: MarkVariant;\n    /** An accessible name. Without one the mark is decoration, hidden from assistive technology. */\n    title?: string;\n    /** Width as a CSS length, `1.6em` by default (the tile `1.5em`); the height follows. Overridable from CSS. */\n    width?: string;\n    /** Draw it in pixels: crisp at 32 px wide and its multiples (the tile at 48 px and its multiples). */\n    pixel?: boolean;\n    /** Mono only: every face at full strength, one flat shape. For forced colours and anything that cannot shade. */\n    flat?: boolean;\n    /** The mono colour. Default `currentColor`; a data URI needs a real colour, since an image inherits none. */\n    color?: string;\n    /** Added to the `<svg>` element. */\n    className?: string;\n}\n\nfunction escape(s: string): string {\n    return s.replace(/[&<>\"']/g, (c) => `&#${c.charCodeAt(0)};`);\n}\n\n/** A face's opacity in mono: stepped, or full for a flat mark. */\nfunction opacity(face: Face, flat: boolean): number {\n    return flat ? 1 : MARK_MONO_OPACITY[face];\n}\n\n/** A face's fill attributes: the host's colour at its weight in mono, else the face's own colour. */\nfunction paint(face: Face, variant: MarkVariant, color: string, flat: boolean): string {\n    if (variant !== 'mono') return `fill=\"${MARK_FACES[face]}\"`;\n    return `fill=\"${escape(color)}\"${opacity(face, flat) === 1 ? '' : ` fill-opacity=\"${opacity(face, flat)}\"`}`;\n}\n\nfunction faces(variant: MarkVariant, color: string, flat = false, pixel = false): string {\n    return ORDER.map((face) =>\n        pixel\n            ? `<g ${paint(face, variant, color, flat)}>${MARK_PIXEL_RUNS[face].map(([x, y, w]) => `<rect x=\"${x}\" y=\"${y}\" width=\"${w}\" height=\"1\"/>`).join('')}</g>`\n            : `<polygon points=\"${MARK_POINTS[face]}\" ${paint(face, variant, color, flat)}/>`\n    ).join('');\n}\n\n/** The height that keeps a CSS length's aspect for the variant: 5/8 for the mark, equal for the tile. */\nfunction heightFor(variant: MarkVariant, width: string): string {\n    if (variant === 'tile') return width;\n    const m = /^(-?[\\d.]+)([a-z%]*)$/i.exec(width.trim());\n    return m ? `${(Number(m[1]) * 5) / 8}${m[2]}` : 'auto';\n}\n\n/** The default width: the mark one line tall beside its words, the tile a little taller. */\nfunction defaultWidth(variant: MarkVariant): string {\n    return variant === 'tile' ? '1.5em' : '1.6em';\n}\n\n/**\n * The mark as an SVG string. Sized in em by default, so it follows the\n * font size of the text beside it; a stylesheet can still set its size,\n * since width and height are attributes, not inline styles (no CSP needed).\n */\nexport function markSvg(options: MarkSvgOptions = {}): string {\n    const variant = options.variant ?? 'mono';\n    if (variant !== 'mono' && variant !== 'brand' && variant !== 'tile') throw new TypeError(`markSvg: unknown variant ${String(variant)}`);\n    const width = options.width ?? defaultWidth(variant);\n    const color = options.color ?? 'currentColor';\n    const pixel = !!options.pixel;\n    const crisp = pixel ? ' shape-rendering=\"crispEdges\"' : '';\n    const label = options.title ? `<title>${escape(options.title)}</title>` : '';\n    const a11y = options.title ? 'role=\"img\"' : 'aria-hidden=\"true\" focusable=\"false\"';\n    const cls = options.className ? ` class=\"${escape(options.className)}\"` : '';\n    const size = `width=\"${escape(width)}\" height=\"${escape(heightFor(variant, width))}\"`;\n    const tag = pixel ? ' data-oc-pixel=\"\"' : '';\n    if (variant === 'tile') {\n        const t = pixel ? MARK_PIXEL_TILE : MARK_TILE;\n        const side = t.viewBox.split(' ')[2];\n        return (\n            `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"${t.viewBox}\" ${size} ${a11y} data-oc-mark=\"tile\"${tag}${cls}${crisp}>${label}` +\n            `<rect width=\"${side}\" height=\"${side}\" rx=\"${t.radius}\" fill=\"${t.fill}\"/>` +\n            `<g transform=\"${t.transform}\">${faces('brand', color, false, pixel)}</g></svg>`\n        );\n    }\n    const viewBox = pixel ? MARK_PIXEL.viewBox : MARK_VIEWBOX;\n    return `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"${viewBox}\" ${size} ${a11y} data-oc-mark=\"${variant}\"${tag}${cls}${crisp}>${label}${faces(variant, color, options.flat, pixel)}</svg>`;\n}\n\n/** The mark as a `data:image/svg+xml` URI, for CSS backgrounds and `<img>`. Mono needs an explicit `color`. */\nexport function markDataUri(options: MarkSvgOptions = {}): string {\n    if ((options.variant ?? 'mono') === 'mono' && (!options.color || options.color === 'currentColor')) {\n        throw new TypeError('markDataUri: a mono mark in an image needs a colour; an image inherits none');\n    }\n    return `data:image/svg+xml,${encodeURIComponent(markSvg({ ...options, width: options.width ?? (options.pixel ? '32' : '16') }))}`;\n}\n\nconst SVG_NS = 'http://www.w3.org/2000/svg';\n\n/**\n * The mark as an `<svg>` element, built node by node: no HTML parsing, so\n * it works under Trusted Types and any Content-Security-Policy. Same\n * drawing and attributes as markSvg.\n */\nexport function markElement(doc: Document, options: Omit<MarkSvgOptions, 'className'> & { className?: string } = {}): SVGSVGElement {\n    const variant = options.variant ?? 'mono';\n    if (variant !== 'mono' && variant !== 'brand' && variant !== 'tile') throw new TypeError(`markElement: unknown variant ${String(variant)}`);\n    const width = options.width ?? defaultWidth(variant);\n    const color = options.color ?? 'currentColor';\n    const pixel = !!options.pixel;\n    const tile = pixel ? MARK_PIXEL_TILE : MARK_TILE;\n    const el = <K extends keyof SVGElementTagNameMap>(tag: K, attrs: Record<string, string>) => {\n        const node = doc.createElementNS(SVG_NS, tag);\n        for (const [k, v] of Object.entries(attrs)) node.setAttribute(k, v);\n        return node;\n    };\n    const svg = el('svg', {\n        viewBox: variant === 'tile' ? tile.viewBox : pixel ? MARK_PIXEL.viewBox : MARK_VIEWBOX,\n        width,\n        height: heightFor(variant, width),\n        'data-oc-mark': variant,\n    });\n    if (pixel) {\n        svg.setAttribute('data-oc-pixel', '');\n        svg.setAttribute('shape-rendering', 'crispEdges');\n    }\n    if (options.className) svg.setAttribute('class', options.className);\n    if (options.title) {\n        svg.setAttribute('role', 'img');\n        const title = el('title', {});\n        title.textContent = options.title;\n        svg.append(title);\n    } else {\n        svg.setAttribute('aria-hidden', 'true');\n        svg.setAttribute('focusable', 'false');\n    }\n    const parent = variant === 'tile' ? el('g', { transform: tile.transform }) : svg;\n    if (variant === 'tile') {\n        const side = tile.viewBox.split(' ')[2]!;\n        svg.append(el('rect', { width: side, height: side, rx: String(tile.radius), fill: tile.fill }), parent);\n    }\n    for (const face of ORDER) {\n        const fill: Record<string, string> = {};\n        if (variant === 'mono') {\n            fill.fill = color;\n            if (opacity(face, !!options.flat) !== 1) fill['fill-opacity'] = String(opacity(face, !!options.flat));\n        } else fill.fill = MARK_FACES[face];\n        if (pixel) {\n            const g = el('g', fill);\n            for (const [x, y, w] of MARK_PIXEL_RUNS[face]) g.append(el('rect', { x: String(x), y: String(y), width: String(w), height: '1' }));\n            parent.append(g);\n        } else parent.append(el('polygon', { points: MARK_POINTS[face], ...fill }));\n    }\n    return svg;\n}\n","import { MARK_FACES, MARK_POINTS, MARK_TILE, markSvg, type MarkVariant } from './index';\n\n/** PNG widths written to assets/png, in px. The bare mark is 5/8 as tall; the tile is square. */\nexport const PNG_WIDTHS = [16, 24, 32, 40, 48, 64, 80, 96, 128, 256] as const;\n\n/** The pixel mark's widths: whole pixels per cell (32 cells across; the tile 48). */\nexport const PIXEL_PNG_WIDTHS = [32, 64, 96, 128, 256, 512] as const;\nexport const PIXEL_TILE_PNG_WIDTHS = [48, 96, 144, 192, 384, 480] as const;\n\nconst FILES: Array<{ name: string; variant: MarkVariant; color?: string; pixel?: true; widths: readonly number[] }> = [\n    { name: 'orangecheck-mark-brand', variant: 'brand', widths: PNG_WIDTHS },\n    { name: 'orangecheck-mark-tile', variant: 'tile', widths: PNG_WIDTHS },\n    { name: 'orangecheck-mark-mono', variant: 'mono', widths: [] },\n    { name: 'orangecheck-mark-mono-black', variant: 'mono', color: '#0A0A0A', widths: PNG_WIDTHS },\n    { name: 'orangecheck-mark-mono-white', variant: 'mono', color: '#FFFFFF', widths: PNG_WIDTHS },\n    { name: 'orangecheck-mark-pixel-brand', variant: 'brand', pixel: true, widths: PIXEL_PNG_WIDTHS },\n    { name: 'orangecheck-mark-pixel-tile', variant: 'tile', pixel: true, widths: PIXEL_TILE_PNG_WIDTHS },\n];\n\n/** The height of a file at width w: square for the tile, 5/8 for the mark. */\nexport function heightAt(square: boolean, w: number): number {\n    return square ? w : (w * 5) / 8;\n}\n\n/** The standalone SVG files: px-sized, named, one per variant and colour, with the PNG widths each is written at. */\nexport function assetSvgs() {\n    return FILES.map(({ name, variant, color, pixel, widths }) => {\n        const square = variant === 'tile';\n        const svgAt = (w: number, h: number) =>\n            markSvg({ variant, color, pixel, title: 'orangecheck', width: String(w) }).replace(/height=\"[^\"]*\"/, `height=\"${h}\"`);\n        const base = pixel ? (square ? 96 : 64) : 64;\n        return { name, square, widths, svg: `${svgAt(base, heightAt(square, base))}\\n`, svgAt };\n    });\n}\n\n/** The tile with square corners: an app icon the platform rounds itself (iOS home screen). */\nexport function squareTileSvg(size: number): string {\n    const face = (f: keyof typeof MARK_POINTS) => `<polygon points=\"${MARK_POINTS[f]}\" fill=\"${MARK_FACES[f]}\"/>`;\n    return (\n        `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"${MARK_TILE.viewBox}\" width=\"${size}\" height=\"${size}\">` +\n        `<rect width=\"24\" height=\"24\" fill=\"${MARK_TILE.fill}\"/>` +\n        `<g transform=\"${MARK_TILE.transform}\">${face('left')}${face('right')}${face('top')}</g></svg>`\n    );\n}\n\n/**\n * assets/favicon: a site's icon set, drawn from the tile, under the names\n * family sites already link. favicon.ico holds the 16, 32 and 48 px PNGs.\n */\nexport const FAVICON_PNGS: ReadonlyArray<{ file: string; size: number; square?: true }> = [\n    { file: 'favicon-16x16.png', size: 16 },\n    { file: 'favicon-32x32.png', size: 32 },\n    { file: 'favicon-48x48.png', size: 48 },\n    { file: 'apple-touch-icon.png', size: 180, square: true },\n    { file: 'android-chrome-192x192.png', size: 192 },\n    { file: 'android-chrome-512x512.png', size: 512 },\n];\nexport const FAVICON_ICO_SIZES = [16, 32, 48] as const;\n\n/** favicon.svg: the tile, sized for a tab. */\nexport function faviconSvg(): string {\n    return `${markSvg({ variant: 'tile', width: '32' }).replace(/height=\"[^\"]*\"/, 'height=\"32\"')}\\n`;\n}\n\n/** An .ico holding PNG images (every browser and Windows since Vista read these). */\nexport function icoFromPngs(images: ReadonlyArray<{ size: number; png: Uint8Array }>): Uint8Array {\n    const header = 6 + 16 * images.length;\n    const total = header + images.reduce((n, i) => n + i.png.length, 0);\n    const out = new Uint8Array(total);\n    const view = new DataView(out.buffer);\n    view.setUint16(2, 1, true); // type: icon\n    view.setUint16(4, images.length, true);\n    let offset = header;\n    images.forEach(({ size, png }, i) => {\n        const at = 6 + 16 * i;\n        view.setUint8(at, size >= 256 ? 0 : size);\n        view.setUint8(at + 1, size >= 256 ? 0 : size);\n        view.setUint16(at + 4, 1, true); // colour planes\n        view.setUint16(at + 6, 32, true); // bits per pixel\n        view.setUint32(at + 8, png.length, true);\n        view.setUint32(at + 12, offset, true);\n        out.set(png, offset);\n        offset += png.length;\n    });\n    return out;\n}\n"]}