defineSetup | SetupDefinition | Declares a setup with params typed from its ParamSpec tuple. Use as const on the params array. |
TemplateInputError | { prototype: TemplateInputError; captureStackTrace: (targetObject: object, constructorOpt?: Function | undefined) => void; prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any; stackTraceLimit: number; } | Thrown for out-of-range input that cannot be clamped (unknown setup, limits). |
TEMPLATE_LIMITS | { readonly maxSeats: 25000; readonly maxObjects: 40000; readonly previewSeatLimit: 10000; readonly largeLayoutWarn: 10000; readonly maxMetaBytes: 48000; } | |
isCategoryVocabId | id is CategoryVocabId | |
vocabEntry | CategoryVocabEntry | undefined | The vocab entry for an id, or undefined for ids outside the vocab. |
colourToLab | { L: number; a: number; b: number; } | null | CIELAB (D65) of a #rrggbb colour, or null when it is not one. |
colourDeltaE | number | CIE76 colour difference; Infinity when either colour is malformed. |
colourChroma | number | CIELAB chroma; 0 for a malformed colour. |
sellableColourProblems | string[] | Problems with a set of sellable category colours: missing, malformed, near-grey, or too close to another sellable colour. Empty when fine. |
CATEGORY_VOCAB | { readonly "fan-pit": { readonly name: "Fan pit"; readonly colour: "#e11d48"; readonly sellable: true; readonly suggestedPriceINR: 999; }; readonly vip: { readonly name: "VIP"; readonly colour: "#7e22ce"; readonly sellable: true; readonly suggestedPriceINR: 1499; }; readonly gold: { readonly name: "Gold"; readonly colour: "#f59e0b"; readonly sellable: true; readonly suggestedPriceINR: 799; }; readonly silver: { reado …(shortened) | The category vocabulary: the ONLY category ids template builders may use. The registry and the build matrix enforce it. Every sellable entry has a colour that is clearly distinct from every other sellable colour (CIE76 ΔE >= SELLABLE_MIN_DELTA_E) and is never near-grey (chroma >= SELLABLE_MIN_CHROMA), so ticket types read apart on the map. Not-for-sale entries use greys on purpose. suggestedPriceINR values are indicative placeholders only: the editor shows them as input placeholders and never writes them as host prices. |
CATEGORY_VOCAB_IDS | CategoryVocabId[] | Vocab ids in declaration order. |
SELLABLE_MIN_DELTA_E | 20 | Minimum CIE76 ΔE between two sellable colours. |
SELLABLE_MIN_CHROMA | 30 | Minimum CIELAB chroma of a sellable colour (below it reads as grey). |
TEMPLATE_CATEGORIES | readonly TemplateCategory[] | The ten template categories (the owner's list B main categories), in gallery order. |
EVENT_FACETS | readonly EventFacet[] | Event facet chips, in display order. |
OWNER_LIST_A | readonly OwnerListAEntry[] | The owner's list A (college event venues), verbatim and in the owner's order. Each entry has exactly one PRIMARY venue (search 120) and optional BOOST venues (search 90). The gallery's "College events" tab lists these. |
OWNER_LIST_B | readonly OwnerListBEntry[] | The owner's list B (main category -> venue subtypes), verbatim. 41 subtypes, each mapped to a DISTINCT venue; tests derive the count from this list. Stadium, indoor arena, waterfront and multipurpose hall come from list A only. |
VENUE_MANIFEST | readonly VenueManifest[] | |
MANIFEST_SETUPS | readonly (ManifestSetup & { readonly venueId: string; })[] | Every manifest setup with its venue id, in registry order. |
snapParam | number | Snaps to the spec's step grid, THEN clamps to [min, max]; ints are rounded. |
defaultParams | Record<string, ParamValue> | |
resolveParams | ResolvedParams | Resolves the params of a build: defaults, then the size preset, then input. Numbers are snapped to their step, then clamped; a bad type or enum value falls back to the default with an issue; unknown keys are dropped. Never throws. |
fnv1a | number | 32-bit FNV-1a hash of a string. |
mulberry32 | () => number | mulberry32 PRNG: deterministic floats in [0, 1). |
isHeavySetup | boolean | True for setups that get the reduced matrix: flagged heavy, or estimated above 8k seats by default. |
paramCombos | ParamCombo[] | Named param combinations for the build matrix. Every combo is fully resolved and in range; identical combos are dropped (the first name wins). Light setups: default, small, large, all-min, all-max, maxCapacity, minCapacity, each numeric param alone at min and at max, each enum option, each boolean flipped, and 6 seeded randoms. Heavy setups: default, small, large, maxCapacity, each param extreme with the rest at default, each enum option, and 4 seeded randoms. Randoms use mulberry32 seeded with FNV-1a of the setup id. |
paramSweep | number[] | n evenly spaced on-grid values of an int/number param, min and max included.
|
findParam | ParamSpec | undefined | A param spec by key, or undefined. |
isCompleteParams | boolean | True when values has an entry for every param of the setup. |
HEAVY_SEAT_THRESHOLD | 8000 | Setups with more default seats than this get the reduced (heavy) build matrix. |
LIGHT_RANDOM_COMBOS | 6 | Seeded random combos per light setup. |
HEAVY_RANDOM_COMBOS | 4 | Seeded random combos per heavy setup. |
mergedAliases | string[] | A venue's aliases with the owner's names merged in centrally: the list-A names it is PRIMARY for and its list-B subtype names. Boost venues do not get the list-A name (search scores them separately). |
joinVenueTemplates | VenueTemplate[] | Joins the manifest with the implemented setup definitions. Every venue is returned; setups holds its implemented setups only, in manifest order. |
getVenue | VenueTemplate | undefined | |
getSetup | VenueSetupTemplate | undefined | An implemented setup by its full id. |
getVenueManifest | VenueManifest | undefined | |
getManifestSetup | (ManifestSetup & { readonly venueId: string; }) | undefined | A manifest setup (implemented or not) by its full id. |
listSetups | VenueSetupTemplate[] | Implemented setups in registry order, optionally of one category. |
listVenues | VenueTemplate[] | Venues in registry order. By default venues with no implemented setup are hidden. |
checkParamSpec | string[] | Problems with one param spec (and its relation to the others). |
valueFits | boolean | True when value is a valid, in-range, on-grid value of spec. |
checkSetupDefinition | string[] | Problems with one setup definition on its own. |
checkTemplateRegistry | string[] | Every registry rule. Returns human-readable problems; empty when clean. |
SETUP_ID_PATTERN | RegExp | Full setup (template) id: <cat>.<venue>.<setup>. |
VENUE_ID_PATTERN | RegExp | |
ID_PREFIX_PATTERN | RegExp | Object-id prefix of a setup. |
VENUE_TEMPLATES | readonly VenueTemplate[] | Every venue (implemented or not), in registry order, with merged aliases. |
stemToken | string | Light plural stemming: ies -> y, (s|x|z|ch|sh)es -> drop es, s -> drop s. |
normaliseTokens | string[] | Normalised, stemmed tokens of a text, stop words dropped. |
damerauDistance | number | Optimal-string-alignment (restricted Damerau-Levenshtein) distance, capped at max + 1. |
searchTemplates | TemplateSearchHit[] | Searches venue templates. Pure and deterministic. An empty query lists every venue in registry order (score 0). facet keeps venues with at least one setup of that facet and scores only those setups. |
SEARCH_SCORES | { readonly listAPrimary: 120; readonly exact: 100; readonly listABoost: 90; readonly prefix: 70; readonly allTokensBase: 50; readonly allTokensPerToken: 5; readonly eventTagToken: 15; readonly category: 10; readonly fuzzy: 20; } | Template search over the manifest (works before any setup is built). Normalisation: NFKD, diacritics stripped, lowercase, '&' -> 'and', punctuation and hyphens -> spaces, plural stemming (ies -> y, es, s), stop words dropped. Every phrase is also indexed in joined form (each adjacent token pair concatenated, and the whole phrase compacted), so 'e sports', 'e-sports' and 'esports' all meet, as do 'open mic' and 'openmic'. Tiered scores (each venue keeps its best; ties go by registry order): list-A phrase on its PRIMARY venue 120; exact name or alias 100; list-A phrase on a BOOST venue 90; name or alias prefix 70; all query tokens in the name, aliases or events 50 + 5 per token; event or tag tokens 15 each; category name 10; fuzzy (Damerau <= 1, tokens of 5+ chars) 20. |
summaryMeasure | number | Reads measure from a build summary. |
clearCapacityMemo | void | Clears the build memo (tests). |
fitCapacity | FitCapacityResult | Finds the driver value whose capacity best matches target, by binary search over the driver's step grid (capacity must be non-decreasing in it). Uses capacity.estimate when present, buildTemplate summaries otherwise (about 8 builds at most, memoised). A target above the max returns the max with a note; below the min returns the min with a note. |
ACADEMIC_SETUPS | readonly SetupDefinition<Readonly<Record<string, ParamValue>>>[] | |
CULTURAL_SETUPS | readonly SetupDefinition<Readonly<Record<string, ParamValue>>>[] | |
EXHIBITION_SETUPS | readonly SetupDefinition<Readonly<Record<string, ParamValue>>>[] | |
HOSPITALITY_SETUPS | readonly SetupDefinition<Readonly<Record<string, ParamValue>>>[] | |
OUTDOOR_SETUPS | readonly SetupDefinition<Readonly<Record<string, ParamValue>>>[] | |
PERFORMANCE_SETUPS | readonly SetupDefinition<Readonly<Record<string, ParamValue>>>[] | |
SOCIAL_SETUPS | readonly SetupDefinition<Readonly<Record<string, ParamValue>>>[] | |
SPECIALISED_SETUPS | readonly SetupDefinition<Readonly<Record<string, ParamValue>>>[] | |
SPORTS_SETUPS | readonly SetupDefinition<Readonly<Record<string, ParamValue>>>[] | |
UNCONVENTIONAL_SETUPS | readonly SetupDefinition<Readonly<Record<string, ParamValue>>>[] | |
GROUP_SETUPS | Readonly<Record<TemplateCategoryId, readonly SetupDefinition[]>> | Implemented setup definitions per category group. |
SETUP_DEFINITIONS | readonly SetupDefinition[] | Every implemented setup definition, group by group. Joined with the manifest by registry.ts. |
round3 | number | Rounds to 3 decimals, without -0. |
m | number | Metres to layout units, rounded to 1e-3. |
toMetres | number | Layout units to metres, rounded to 1e-3. |
ptU | Point | A metre point in layout units. |
tidyPoint | Point | |
TEMPLATE_UNITS_PER_METRE | 50 | Layout units per metre in every template layout. |
densityCaution | string | The density caution text. Summaries compute the same text from GA capacities, so the two merge. |
SEATS | { readonly chair: { readonly shape: { readonly kind: "circle"; readonly radius: 10; }; readonly seatSpacingM: 0.52; readonly rowSpacingM: 0.9; }; readonly stand: { readonly shape: { readonly kind: "circle"; readonly radius: 9; }; readonly seatSpacingM: 0.5; readonly rowSpacingM: 0.86; }; readonly bleacher: { readonly shape: { readonly kind: "circle"; readonly radius: 9; }; readonly seatSpacingM: 0.5; readonly rowSpac …(shortened) | |
DENSITY | { readonly pit: 1.6; readonly standing: 1.4; readonly cocktail: 1; readonly mixer: 1; readonly grass: 1; readonly picnic: 1; readonly vipLounge: 1; readonly participants: 0.5; readonly accessible: 0.5; readonly expoVisitors: 0.5; } | Planning densities in persons per m², aligned to the National Building Code of India Part 4. They are planning estimates, never approvals. |
NBC_STANDING_MAX | 1.67 | Highest standing density a template allows (persons/m²). |
HIGH_DENSITY_MAX | 2 | Highest density with the advanced allowHighDensity override; always cautioned. |
DENSITY_CAUTION_ABOVE | 1.5 | Densities above this add a summary caution. |
rectPts | Point[] | Corners of a w x h rectangle centred on the origin, clockwise from the top-left. |
rectFromM | { center: Point; width: number; height: number; points: Point[]; } | A rectangle's centre, width, height and corners (clockwise from the top-left). Corners may come in any order. |
arcPts | Point[] | seg + 1 points on a circular arc from a0 to a1 degrees.
|
ellipseSectorPts | Point[] | The band between two concentric ellipses from a0 to a1 degrees: the outer arc forwards, then the inner arc back. An inner radius of 0 closes the sector at the centre. A full 360-degree sweep is not supported (it would not be a simple polygon); use two halves. |
uPolygon | Point[] | A rectangle with a rectangular notch cut into one of its edges (a U shape), e.g. a standing area wrapped around a front-of-house desk. The notch is clipped to the outer rectangle and cut from the edge it is nearest to. A notch that does not overlap the outer rectangle, or that would split it, leaves the plain rectangle. |
areaM2 | number | Area of a polygon given in metres, in m². |
gaCapacityForArea | number | Planning capacity of a standing area: floor((area − deduct) × density), at least 1. boundaryUnits is in layout units (unitsPerMetre per metre). |
catmullRom | Point[] | An open Catmull-Rom spline through pointsM (centripetal-free, uniform), with samples segments between each pair of points. The first and last points are kept. |
rdpSimplify | Point[] | Ramer-Douglas-Peucker simplification of an open polyline; keeps both ends. Iterative. |
TemplateKit | { prototype: TemplateKit; } | |
buildTemplate | BuiltTemplate | Builds a template layout: - resolves the params (defaults, size preset, input; snapped and clamped) and, with
targetCapacity, fits the capacity driver; - runs the setup's builder on a fresh
TemplateKit; - creates the layout with the kit's referenced categories;
- moves everything (objects, venue, focal point and block frames) by whole grid cells so the content starts 40 units from the canvas origin, with a plain map over positions (locked surfaces move too and sections keep their seating), sizes the canvas to the venue and objects plus 40 and calls fitCanvasToContent;
- writes
metadata.openseat (OpenSeatMeta): units, the template stamp, block stamps, not-for-sale categories and IDs and the indicative INR prices of the categories present. Block stamps are dropped, with a note, when the metadata would exceed 48 KB; - with
zonesOnly, turns every section into a zone (zoneTemplateLayout); - enforces TEMPLATE_LIMITS (TemplateInputError) and summarises.
Identical input gives a byte-identical serializeLayout; no timestamps are written. setup is a registered setup id or, for tests and fixtures, a definition. |
summarizeLayout | TemplateSummary | Counts for the template gallery and the build summary, derived from the objects alone, so they also work on a layout the user has edited: - seats: every seat object, table seats included; tableSeats: seats owned by a table.
- Not for sale: seats, GA places and whole tables in a category listed in
metadata.openseat.unsellableCategories (the vocabulary's not-for-sale categories when the layout lists none), or covered by metadata.openseat.notForSale (unsellableInventory). unsellableSeats counts those seats; totalCapacity is the sellable seats plus the sellable GA capacity (booths are not people). - Zone sections (
showSeats: false) sell their capacity instead of their seats: totalCapacity counts the capacity of each one that is for sale, and unsellableSeats the seats beyond it (all of them when the zone is held back). Seats, tables, accessible places and the per-category seat counts still count the seats kept in the document, so a setup's seat and zone variants report the same figures. zones counts zone sections plus GA areas. - accessible: wheelchair seats plus the capacity of GA areas in the "accessible" category.
- cautions: GA areas planned above 1.5 persons/m² and layouts above
TEMPLATE_LIMITS.largeLayoutWarn seats. notes is empty here; buildTemplate adds the kit's clamp notes.
|
zoneTemplateLayout | LayoutDocument | The zone variant of a built template layout: - core
toZoneOnlyLayout: loose rows, tables and seats are wrapped into sections, and every section with seats becomes a zone section; - each zone section sells what its seats sold: its capacity defaults to its seat count, and becomes the number of its sellable seats when some were not for sale; a section with no sellable seat is listed in
metadata.openseat.notForSale (unless its category already holds it back), and a section held back only by its category while some of its seats sold takes their most common sellable category instead; - zone sections get rounded corners (
ZONE_CORNER_RADIUS_M); the sections core added are rounded to 1e-3 like every template coordinate; - when every zone is seated (no standing GA), the footnote
ZONES_SEATED_FOOTNOTE is centred under the content (core createFootnote, sized to the content width), and the canvas grows to fit it; - the template stamp records
zonesOnly: true.
Seats themselves are never changed, so the sellable capacity equals the seat variant's. A layout that is already a zone layout is returned as is. |
ZONE_CORNER_RADIUS_M | 0.4 | Corner rounding of a template's zone sections, in metres. |
athleticsTrack | (kit: TemplateKitApi, opts?: AthleticsTrackOptions | undefined) => AthleticsTrackResult | |
badmintonCourt | (kit: TemplateKitApi, opts?: CourtOptions | undefined) => FieldResult | |
basketballCourt | (kit: TemplateKitApi, opts?: CourtOptions | undefined) => FieldResult | |
cricketGround | (kit: TemplateKitApi, opts?: CricketGroundOptions | undefined) => CricketGroundResult | |
hockeyPitch | (kit: TemplateKitApi, opts?: CourtOptions | undefined) => FieldResult | |
kabaddiCourt | (kit: TemplateKitApi, opts?: KabaddiCourtOptions | undefined) => FieldResult | |
poolLanes | (kit: TemplateKitApi, opts?: PoolLanesOptions | undefined) => PoolLanesResult | |
tennisCourt | (kit: TemplateKitApi, opts?: CourtOptions | undefined) => FieldResult | |
volleyballCourt | (kit: TemplateKitApi, opts?: CourtOptions | undefined) => FieldResult | |
arcWedges | (kit: TemplateKitApi, opts: ArcWedgesOptions) => SeatingResult | |
fanHouse | (kit: TemplateKitApi, opts: FanHouseOptions) => FanHouseResult | |
standAlong | (kit: TemplateKitApi, opts: StandAlongOptions) => SeatingResult | |
theatreBlocks | (kit: TemplateKitApi, opts: TheatreBlocksOptions) => TheatreBlocksResult | |
banquetRounds | (kit: TemplateKitApi, opts: BanquetRoundsOptions) => TableGridResult | |
cabaretTables | (kit: TemplateKitApi, opts: CabaretTablesOptions) => TableGridResult | |
deskRuns | (kit: TemplateKitApi, opts: DeskRunsOptions) => TableGridResult | |
loungeRow | (kit: TemplateKitApi, opts: LoungeRowOptions) => TableGridResult | |
tableGrid | (kit: TemplateKitApi, opts: TableGridOptions) => TableGridResult | |
teamTables | (kit: TemplateKitApi, opts: TeamTablesOptions) => TableGridResult | |
danceFloor | (kit: TemplateKitApi, opts: DanceFloorOptions) => DanceFloorResult | |
endStageShow | (kit: TemplateKitApi, opts: EndStageShowOptions) => EndStageShowResult | |
boothBand | (kit: TemplateKitApi, opts: BoothBandOptions) => BoothBlockResult | |
boothGrid | (kit: TemplateKitApi, opts: BoothGridOptions) => BoothBlockResult | |
boothRing | (kit: TemplateKitApi, opts: BoothRingOptions) => BoothBlockResult | |
islandGrid | (kit: TemplateKitApi, opts: IslandGridOptions) => BoothBlockResult | |
accessibleZone | (kit: TemplateKitApi, opts: AccessibleZoneOptions) => BuilderResult | |
amenity | (kit: TemplateKitApi, opts: AmenityOptions) => BuilderResult | |
columnGrid | (kit: TemplateKitApi, opts: ColumnGridOptions) => ColumnGridResult | |
gates | (kit: TemplateKitApi, opts: GatesOptions) => BuilderResult | |
battleRing | (kit: TemplateKitApi, opts?: BattleRingOptions | undefined) => BattleRingResult | |
runway | (kit: TemplateKitApi, opts?: RunwayOptions | undefined) => RunwayResult | |
accessibleCount | (seats: number) => number | |
inflateRect | (r: RectM, d: number) => RectM | |
nextRowStart | (start: number, rows: number) => number | |
rectM | (cx: number, cy: number, w: number, h: number) => RectM | |
rectUnion | (rects: readonly RectM[]) => RectM | |
regenerateBlock | RegenerateBlockResult | Rebuilds block blockId with params (merged over the stamp's params). The block is rebuilt in a sub-kit with the stamp's prefix and frame, translated by the drift of the surviving members' centroid (so a block the user moved regenerates where it now is). Per slot: - an existing member keeps its object id (the inventory key of a whole-booked table), its booth inventoryId, its seats' object and seat ids (by seat number), their accessibility flags and its label (labels only follow the new numbering when a label param changed and the user had not renamed the member); its category and bookAsWhole follow the new params unless the user had changed them;
- a member the user deleted is recreated (under its old id when free);
- a slot that no longer exists is removed with its seats and reported in
removedInventoryIds (also when a kept table loses seats). New members get labels that do not clash with kept ones. The stamp (params, frame and slots) and metadata.openseat.notForSale are updated, and vocab categories the new members use are added. An unknown block id returns the layout unchanged.
|
BLOCK_KINDS | Readonly<Record<BlockKind, BlockKindSpec>> | |
placeTemplate | PlaceTemplateResult | Places built into target. replace: the template's layout under the target's id and revision, with metadata = the target's other metadata plus the template's openseat block; the canvas follows the template FRAME rule (venue and objects plus 40, then fitCanvasToContent). removedInventoryIds lists every target inventory key the template does not have, for the editor's destructive-change guard. insert (built on core's copyInto): - object ids become
${ns}:${id}, ns the first free of t1, t2…; - a section label that clashes (case-insensitively) with an existing one gets
(2), (3)…, and its seats' public ids are re-derived from it (${label}-${row}-${seat}, the rule seats added later follow); - other inventory keys are kept unless they clash, then become
${ns}-${key}; - categories merge by id (existing ones win); not-for-sale categories, suggested prices, not-for-sale ids and block stamps are merged with their ids remapped; the template stamp is appended to
inserts (the last 20 are kept); - the content is centred on
at, or else placed right of the existing content (the arena preset rule); the target's venue and focal point stay; - the canvas grows with fitCanvasToContent.
zonesOnly places the template's zone variant in either mode.
|
MAX_TEMPLATE_INSERTS | 20 | Most template stamps remembered in metadata.openseat.inserts. |
templateSchematic | TemplateSchematic | The schematic of layout in a width x height viewBox (default 320 x 200), fitted with a 4-unit margin. roles (BuiltTemplate.roles) tells surfaces, markings, zones and obstacles apart; without it polygon zIndex decides. At most SCHEMATIC_MAX_BYTES serialised. |
schematicToSvg | string | The schematic as a standalone SVG string. Presentation attributes only (fill, stroke, stroke-width, fill-opacity): no style attributes or elements, so it renders under a strict Content-Security-Policy. |
SCHEMATIC_MAX_BYTES | 3072 | Largest serialised schematic (JSON, bytes). |