// Single source of truth for product catalogue, pricing, and frame // geometry. Imported by: // - Builder (display + preview mount geometry) // - /api/orders (Stripe charge amount via priceCents) // - Stripe webhook (Prodigi SKU + attribute payload) // // Sizes here are the real Prodigi catalogue sizes for the two SKU // families we ship: // - matted → FRA-BOX-EMA-MOUNT1-ACRY-{SIZE} (Box frame, 1.4mm mounted // EMA print, perspex glaze). Sizes // are METRIC (cm) in this SKU family // — `prodigiSize` carries the cm code // (e.g. 40X50) while `label` keeps the // nominal inch size the same physical // piece has always been sold under // (40×50cm === 16×20"). This product // fulfils a customer-chosen mountColor // (Snow white / Off-white / Black). // - canvas → GLOBAL-FRA-CAN-{SIZE}(Float-framed canvas on 38 mm // premium stretcher bars) // Frame finish is a Prodigi *variant attribute* (not part of the SKU), // passed in the order item as `attributes.color`. Canvas additionally // takes `attributes.wrap` — we default to ImageWrap. // // AT COST (Nov 2026): every product is sold at cost with no markup, and // the portrait artwork itself is made free. Each row's `price` is the // landed Prodigi cost (item + Budget shipping to the US) plus the Stripe // card fee (2.9% + 30¢), rounded up to the whole dollar. That is what the // customer pays and what Stripe charges. Rows with a no-mat variant carry // `nomatPrice` for that SKU. There is no list price, sale, or discount. // Sizes Prodigi doesn't fulfil to the US (e.g. FRA-BOX 8×10 / 20×25cm, // FRA-CAN 14×14) are intentionally omitted. export const PRODUCTS = { matted: { label: 'Box Frame Matted Print', sub: 'Archival giclée, matted, in a real wood box frame.', // Concrete materials spec — surfaced in the product card so // customers see exactly what they're getting before they pay. // Matches the Prodigi FRA-BOX-EMA-MOUNT1-ACRY (box frame, mounted) // line, which fulfils a choice of mount colour. specs: [ '200gsm Enhanced Matte Art (EMA) paper', '1.4mm acid-free mount, in your choice of colour', 'Acrylic / Perspex glaze (shatter-resistant, UV-protective)', 'Real wood moulding, 20mm face', ], // Product photography. `hero` is the small image shown in the // picker card; `photos` is the full set used by the lightbox so // the customer can inspect frame depth, corner finish, and the // available wood finishes before committing. hero: '/products/boxframe-hero.jpg', photos: [ { src: '/products/boxframe-hero.jpg', label: 'Portrait in box frame' }, { src: '/products/boxframe-depth.jpg', label: 'Frame depth' }, { src: '/products/boxframe-chevrons.jpg', label: 'Available wood finishes' }, ], // Box frames ship in four finishes — matte black, soft white, // walnut (rich brown), and honey oak. Gold and brushed silver // aren't part of the box frame product line (they're canvas-only). // availableFrames is enforced in Builder so the picker hides // unavailable options and auto-snaps the current selection when // switching products. availableFrames: ['black', 'walnut', 'oak', 'white'] as const, // Mount choices shown in the Builder for this product. Snow white / // Off-white / Black fulfil on FRA-BOX-EMA-MOUNT1-ACRY; 'nomat' fulfils // on the No-Mount sibling FRA-BOX-EMA-NM-ACRY (see prodigi-skus.ts). availableMattes: ['snowwhite', 'offwhite', 'black', 'nomat'] as const, // Box-frame moulding face = 20 mm, visibly thicker than the canvas // float frame. The mat board sits inside the rebate; matteW is the // face-width of the cream mat when mat is toggled on (customer can // turn the mat off). frameW: 18, matteW: 60, prodigiSkuPrefix: 'FRA-BOX-EMA-MOUNT1-ACRY', // FRA-BOX is a METRIC catalogue: `prodigiSize` is the cm code Prodigi // expects in the SKU suffix; `label` keeps the nominal inch size the // same physical piece has always carried (40×50cm === 16×20", etc.). // `price` = mounted (mat-board) at cost; `nomatPrice` = the No-Mount // sibling FRA-BOX-EMA-NM-ACRY-, also at cost. sizes: { '8x8': { label: '8 × 8 in', aspect: '1 / 1', prodigiSize: '20X20', price: 115, nomatPrice: 115 }, '11x14': { label: '11 × 14 in', aspect: '11 / 14', prodigiSize: '28X35', price: 140, nomatPrice: 140 }, '12x12': { label: '12 × 12 in', aspect: '1 / 1', prodigiSize: '30X30', price: 132, nomatPrice: 132 }, '12x16': { label: '12 × 16 in', aspect: '3 / 4', prodigiSize: '30X40', price: 148, nomatPrice: 140 }, '16x16': { label: '16 × 16 in', aspect: '1 / 1', prodigiSize: '40X40', price: 173, nomatPrice: 165 }, '16x20': { label: '16 × 20 in', aspect: '4 / 5', prodigiSize: '40X50', price: 198, nomatPrice: 189 }, '18x24': { label: '18 × 24 in', aspect: '3 / 4', prodigiSize: '45X60', price: 222, nomatPrice: 214 }, '20x20': { label: '20 × 20 in', aspect: '1 / 1', prodigiSize: '50X50', price: 214, nomatPrice: 206 }, '20x28': { label: '20 × 28 in', aspect: '5 / 7', prodigiSize: '50X70', price: 255, nomatPrice: 247 }, '24x24': { label: '24 × 24 in', aspect: '1 / 1', prodigiSize: '60X60', price: 239, nomatPrice: 231 }, }, defaultSize: '12x16', }, classic: { label: 'Classic Framed Print', sub: 'Our bestselling framed giclée print — with or without a mount.', // Prodigi's Classic Frame line (GLOBAL-CFP / -CFPM): solid // satin-laminated wood, 20 mm face, Perspex glaze, EMA 200gsm fine // art paper, orderable mounted (Snow white mat) or no-mat. specs: [ '200gsm Enhanced Matte Art (EMA) fine art paper', 'Satin-laminated solid wood frame, 20mm face', 'Acrylic / Perspex glaze, delivered ready to hang', 'Optional 2.4mm acid-free mount, or no mat', ], hero: '/products/classic-hero-pet.png', photos: [ { src: '/products/classic-hero-pet.png', label: 'Classic frame, mounted' }, { src: '/products/classic-flat-pet.png', label: 'Front view' }, { src: '/products/classic-corner-nomount-pet.png', label: 'Corner, no mount' }, { src: '/products/classic-far-corner-tan.png', label: 'Frame profile' }, { src: '/products/classic-back.jpg', label: 'Ready-to-hang back' }, ], // Classic ships in all eight catalogue finishes. availableFrames: ['black', 'white', 'walnut', 'oak', 'gold', 'silver', 'darkgrey', 'lightgrey'] as const, // Mount choices: Snow white (the only mat colour Prodigi fulfils on // the Classic Frame — CFPM is Snow-white-only) or 'nomat'. Mounted → // GLOBAL-CFPM, no-mat → GLOBAL-CFP (see prodigi-skus.ts). availableMattes: ['snowwhite', 'nomat'] as const, // Slimmer than the box frame: 20 mm face, 22 mm depth from wall. frameW: 13, matteW: 50, prodigiSkuPrefix: 'GLOBAL-CFPM', // Classic Frame is INCH-coded (e.g. 16X20); our sizeIds match those // inch codes, so `prodigiSize` carries the inch code verbatim. // `price` = mounted (CFPM, Snow white) at cost; `nomatPrice` = no-mat // (CFP) at cost. Only sizes present on BOTH CFP and CFPM are offered // (14×14 and 24×30 are CFP-only, so omitted). sizes: { '8x8': { label: '8 × 8 in', aspect: '1 / 1', prodigiSize: '8X8', price: 58, nomatPrice: 58 }, '8x10': { label: '8 × 10 in', aspect: '4 / 5', prodigiSize: '8X10', price: 74, nomatPrice: 66 }, '11x14': { label: '11 × 14 in', aspect: '11 / 14', prodigiSize: '11X14', price: 74, nomatPrice: 66 }, '12x12': { label: '12 × 12 in', aspect: '1 / 1', prodigiSize: '12X12', price: 74, nomatPrice: 66 }, '12x16': { label: '12 × 16 in', aspect: '3 / 4', prodigiSize: '12X16', price: 82, nomatPrice: 74 }, '12x18': { label: '12 × 18 in', aspect: '2 / 3', prodigiSize: '12X18', price: 82, nomatPrice: 74 }, '16x16': { label: '16 × 16 in', aspect: '1 / 1', prodigiSize: '16X16', price: 82, nomatPrice: 74 }, '16x20': { label: '16 × 20 in', aspect: '4 / 5', prodigiSize: '16X20', price: 91, nomatPrice: 82 }, '18x24': { label: '18 × 24 in', aspect: '3 / 4', prodigiSize: '18X24', price: 91, nomatPrice: 91 }, '20x20': { label: '20 × 20 in', aspect: '1 / 1', prodigiSize: '20X20', price: 91, nomatPrice: 82 }, '20x28': { label: '20 × 28 in', aspect: '5 / 7', prodigiSize: '20X28', price: 107, nomatPrice: 99 }, '24x24': { label: '24 × 24 in', aspect: '1 / 1', prodigiSize: '24X24', price: 107, nomatPrice: 99 }, '30x30': { label: '30 × 30 in', aspect: '1 / 1', prodigiSize: '30X30', price: 140, nomatPrice: 124 }, '30x40': { label: '30 × 40 in', aspect: '3 / 4', prodigiSize: '30X40', price: 173, nomatPrice: 148 }, '40x40': { label: '40 × 40 in', aspect: '1 / 1', prodigiSize: '40X40', price: 198, nomatPrice: 198 }, }, defaultSize: '16x20', }, canvas: { label: 'Framed Canvas', sub: 'Gallery-wrapped canvas in a thin wood float frame.', specs: [ '400gsm Standard Canvas (SC), gallery-wrapped', '12-colour archival inkjet print, ImageWrap edges', '38mm premium pine stretcher bars', 'Thin wood float moulding, 12mm face, 5mm recess', ], hero: '/products/canvas-hero-golden.jpg', photos: [ { src: '/products/canvas-hero-golden.jpg', label: 'Portrait in float frame' }, { src: '/products/canvas-depth.jpg', label: 'Side profile' }, { src: '/products/canvas-rear.jpg', label: 'Stretcher back' }, { src: '/products/canvas-chevrons.webp', label: 'Available wood finishes' }, ], // Canvas float frames ship in the full six finishes. Prodigi's // chevron photography currently only covers three (black / white / // brown=walnut) — those three appear as detail photos in the // product lightbox. The remaining three (oak, gold, silver) still // ship; just not pictured yet. availableFrames: ['black', 'white', 'walnut', 'oak', 'gold', 'silver'] as const, // Float-frame moulding face = 12 mm and the canvas is recessed // 5 mm inside the moulding. The mount renders the gap by reusing // --matte-w with a dark --matte-bg so the recess reads as a shadow // inset on all four sides — the visual signature of a float frame. frameW: 10, matteW: 4, prodigiSkuPrefix: 'GLOBAL-FRA-CAN', sizes: { '8x10': { label: '8 × 10 in', aspect: '4 / 5', prodigiSize: '8X10', price: 74 }, '8x12': { label: '8 × 12 in', aspect: '2 / 3', prodigiSize: '8X12', price: 79 }, '10x10': { label: '10 × 10 in', aspect: '1 / 1', prodigiSize: '10X10', price: 79 }, '11x14': { label: '11 × 14 in', aspect: '11 / 14', prodigiSize: '11X14', price: 82 }, '12x12': { label: '12 × 12 in', aspect: '1 / 1', prodigiSize: '12X12', price: 82 }, '12x16': { label: '12 × 16 in', aspect: '3 / 4', prodigiSize: '12X16', price: 91 }, '12x18': { label: '12 × 18 in', aspect: '2 / 3', prodigiSize: '12X18', price: 96 }, '16x16': { label: '16 × 16 in', aspect: '1 / 1', prodigiSize: '16X16', price: 96 }, '16x20': { label: '16 × 20 in', aspect: '4 / 5', prodigiSize: '16X20', price: 112 }, '18x24': { label: '18 × 24 in', aspect: '3 / 4', prodigiSize: '18X24', price: 124 }, '20x20': { label: '20 × 20 in', aspect: '1 / 1', prodigiSize: '20X20', price: 120 }, '20x24': { label: '20 × 24 in', aspect: '5 / 6', prodigiSize: '20X24', price: 132 }, '20x28': { label: '20 × 28 in', aspect: '5 / 7', prodigiSize: '20X28', price: 145 }, '20x30': { label: '20 × 30 in', aspect: '2 / 3', prodigiSize: '20X30', price: 148 }, '24x24': { label: '24 × 24 in', aspect: '1 / 1', prodigiSize: '24X24', price: 140 }, '24x30': { label: '24 × 30 in', aspect: '4 / 5', prodigiSize: '24X30', price: 161 }, '24x36': { label: '24 × 36 in', aspect: '2 / 3', prodigiSize: '24X36', price: 173 }, '30x40': { label: '30 × 40 in', aspect: '3 / 4', prodigiSize: '30X40', price: 222 }, }, defaultSize: '12x18', }, stretched: { label: 'Stretched Canvas', sub: 'A frameless gallery-wrapped canvas on a 38mm pine stretcher.', specs: [ '400gsm artist-grade cotton canvas', '38mm kiln-dried knotless pine stretcher', 'Hand-stretched & gallery-wrapped', 'Choice of edge wrap finish', 'Latex / UVgel print, 200-year permanence', ], hero: '/products/stretched-hero-pet.png', photos: [ { src: '/products/stretched-hero-pet.png', label: 'Frameless stretched canvas' }, { src: '/products/stretched-corner-pet-v2.png', label: '38mm corner fold' }, { src: '/products/stretched-imagewrap-pet-v3.png', label: 'Image-wrapped edge' }, { src: '/products/stretched-texture.jpg', label: 'Canvas texture' }, ], // Frameless — no frame finish or mat. Edge finish is the `wrap` // attribute instead (see availableWraps + prodigi-skus.ts). availableFrames: [] as const, availableWraps: ['imagewrap', 'mirror', 'white', 'black'] as const, // No frame moulding, no mat: the preview renders the bare canvas. frameW: 0, matteW: 0, prodigiSkuPrefix: 'GLOBAL-CAN', // GLOBAL-CAN is INCH-coded; sizeIds carry the inch code verbatim. All // wraps cost the same, so there's a single at-cost price per size. sizes: { '8x10': { label: '8 × 10 in', aspect: '4 / 5', prodigiSize: '8X10', price: 49 }, '8x12': { label: '8 × 12 in', aspect: '2 / 3', prodigiSize: '8X12', price: 49 }, '10x10': { label: '10 × 10 in', aspect: '1 / 1', prodigiSize: '10X10', price: 49 }, '11x14': { label: '11 × 14 in', aspect: '11 / 14', prodigiSize: '11X14', price: 58 }, '12x12': { label: '12 × 12 in', aspect: '1 / 1', prodigiSize: '12X12', price: 58 }, '12x16': { label: '12 × 16 in', aspect: '3 / 4', prodigiSize: '12X16', price: 58 }, '12x18': { label: '12 × 18 in', aspect: '2 / 3', prodigiSize: '12X18', price: 58 }, '16x16': { label: '16 × 16 in', aspect: '1 / 1', prodigiSize: '16X16', price: 66 }, '16x20': { label: '16 × 20 in', aspect: '4 / 5', prodigiSize: '16X20', price: 66 }, '18x24': { label: '18 × 24 in', aspect: '3 / 4', prodigiSize: '18X24', price: 74 }, '20x20': { label: '20 × 20 in', aspect: '1 / 1', prodigiSize: '20X20', price: 74 }, '20x24': { label: '20 × 24 in', aspect: '5 / 6', prodigiSize: '20X24', price: 82 }, '20x28': { label: '20 × 28 in', aspect: '5 / 7', prodigiSize: '20X28', price: 91 }, '20x30': { label: '20 × 30 in', aspect: '2 / 3', prodigiSize: '20X30', price: 91 }, '24x24': { label: '24 × 24 in', aspect: '1 / 1', prodigiSize: '24X24', price: 82 }, '24x30': { label: '24 × 30 in', aspect: '4 / 5', prodigiSize: '24X30', price: 91 }, '24x36': { label: '24 × 36 in', aspect: '2 / 3', prodigiSize: '24X36', price: 99 }, '30x40': { label: '30 × 40 in', aspect: '3 / 4', prodigiSize: '30X40', price: 132 }, }, defaultSize: '16x20', }, } as const; export type ProductId = keyof typeof PRODUCTS; export type SizeId = string; // Orientation the customer hangs the print in. Every size in the catalog // above is authored portrait-or-square; landscape is expressed by // transposing that size's aspect (and display label) at read time — // Prodigi has no separate landscape SKU and auto-orients the framed // product to match the asset we send, so the *same* prodigiSize + price // covers both orientations. Square sizes have no landscape variant. export type Orientation = 'portrait' | 'landscape'; /** Parse a 'W / H' aspect string into [w, h], or null if unparseable. */ function parseAspect(aspectStr: string): [number, number] | null { const m = aspectStr.match(/^\s*(\d+(?:\.\d+)?)\s*\/\s*(\d+(?:\.\d+)?)\s*$/); if (!m) return null; const w = parseFloat(m[1]); const h = parseFloat(m[2]); if (!(w > 0) || !(h > 0)) return null; return [w, h]; } /** True for a 1:1 (square) aspect string — squares have no orientation. */ export function isSquareAspect(aspectStr: string): boolean { const wh = parseAspect(aspectStr); return !!wh && Math.abs(wh[0] - wh[1]) < 0.001; } /** Swap 'W / H' → 'H / W'. No-op for square or unparseable input. */ export function transposeAspect(aspectStr: string): string { const wh = parseAspect(aspectStr); if (!wh || Math.abs(wh[0] - wh[1]) < 0.001) return aspectStr; return `${wh[1]} / ${wh[0]}`; } /** Frame aspect string ('W / H', e.g. '3 / 4') for a product+size, * oriented portrait (catalog default) or landscape (transposed), or * null if either is missing/unknown. Used to generate + crop the * artwork in the customer's chosen frame shape. */ export function frameAspect( productId: ProductId | undefined, sizeId: string | undefined, orientation: Orientation = 'portrait', ): string | null { if (!productId || !sizeId) return null; const sizes = PRODUCTS[productId]?.sizes as Record | undefined; const aspect = sizes?.[sizeId]?.aspect ?? null; if (!aspect) return null; return orientation === 'landscape' ? transposeAspect(aspect) : aspect; } /** Display label for a product+size in the chosen orientation, e.g. * '8 × 10 in' portrait → '10 × 8 in' landscape. Square sizes and * unknown sizes are returned unchanged. Falls back to the size id when * the size is missing. */ export function sizeLabel( productId: ProductId | undefined, sizeId: string | undefined, orientation: Orientation = 'portrait', ): string { if (!productId || !sizeId) return sizeId ?? ''; const sizes = PRODUCTS[productId]?.sizes as Record | undefined; const row = sizes?.[sizeId]; if (!row) return sizeId; if (orientation !== 'landscape' || isSquareAspect(row.aspect)) return row.label; // Swap the two dimensions in '8 × 10 in' → '10 × 8 in'. return row.label.replace(/^(\d+)(\s*×\s*)(\d+)/, '$3$2$1'); } /** Size ids available for an orientation. Portrait exposes every size * (including squares); landscape drops the squares, since a square has * no distinct landscape form. */ export function sizesForOrientation(productId: ProductId, orientation: Orientation): string[] { const sizes = PRODUCTS[productId].sizes as Record; const ids = Object.keys(sizes); if (orientation !== 'landscape') return ids; return ids.filter((id) => !isSquareAspect(sizes[id].aspect)); } function sizeRow(productId: ProductId, sizeId: string) { const sizes = PRODUCTS[productId].sizes as Record< string, { label: string; aspect: string; prodigiSize: string; price: number; nomatPrice?: number } >; const row = sizes[sizeId]; if (!row) throw new Error(`Unknown size ${sizeId} for product ${productId}`); return row; } /** "No matte" carries its own price on products that offer a no-mat * variant (box frame → FRA-BOX-NM, classic → GLOBAL-CFP). */ function usesNoMatPrice(row: { nomatPrice?: number }, matteId: string | null | undefined): boolean { return matteId === 'nomat' && typeof row.nomatPrice === 'number'; } /** At-cost price in dollars: what the customer pays and Stripe charges. * The portrait artwork is free, so custom style references and extra * pets add nothing. */ export function salePrice( productId: ProductId, sizeId: string, matteId?: string | null, ): number { const row = sizeRow(productId, sizeId); return usesNoMatPrice(row, matteId) ? row.nomatPrice! : row.price; } /** At-cost price in cents — what Stripe Checkout actually charges. */ export function priceCents( productId: ProductId, sizeId: string, matteId?: string | null, ): number { return salePrice(productId, sizeId, matteId) * 100; } /** Lowest price across all sizes for a product. */ export function startingSalePrice(productId: ProductId): number { const sizes = PRODUCTS[productId].sizes as Record; return Math.min(...Object.values(sizes).map((s) => s.price)); } /** Lowest price across the ENTIRE catalogue, used for the gallery's * "From $X" label. */ export function catalogStartingSalePrice(): number { return Math.min(...(Object.keys(PRODUCTS) as ProductId[]).map(startingSalePrice)); }