@seatlayer/core 0.52.0 → 0.54.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.
- package/LICENSE +16 -17
- package/README.md +8 -18
- package/dist/categoryInventory-B4xo7hE2.d.ts +109 -0
- package/dist/categoryInventory-lRtu3VjD.d.cts +109 -0
- package/dist/chunk-3QLFGEQY.js +1 -0
- package/dist/chunk-55NOSZK5.js +1 -0
- package/dist/chunk-6LIPQU4G.js +1 -0
- package/dist/chunk-6VTTBC5F.js +1 -0
- package/dist/chunk-7PT7OQUO.js +1 -0
- package/dist/chunk-AQKYUJBX.js +1 -0
- package/dist/chunk-CXF32VPG.js +1 -0
- package/dist/chunk-DDE7IOFT.js +1 -0
- package/dist/chunk-EQM4FFN5.js +1 -0
- package/dist/chunk-EYROIZGQ.js +1 -0
- package/dist/chunk-IJI4WU57.js +1 -0
- package/dist/chunk-QUKWJQLR.js +1 -0
- package/dist/chunk-VDZ24QVV.js +1 -0
- package/dist/chunk-XPPT3OGQ.js +1 -0
- package/dist/core/chart-ops/index.cjs +1 -0
- package/dist/core/chart-ops/index.d.cts +1235 -0
- package/dist/core/chart-ops/index.d.ts +1235 -0
- package/dist/core/chart-ops/index.js +1 -0
- package/dist/core/color.cjs +1 -0
- package/dist/core/color.d.cts +192 -0
- package/dist/core/color.d.ts +192 -0
- package/dist/core/color.js +1 -0
- package/dist/core/inventory/index.cjs +1 -0
- package/dist/core/inventory/index.d.cts +209 -0
- package/dist/core/inventory/index.d.ts +209 -0
- package/dist/core/inventory/index.js +1 -0
- package/dist/core/layout/index.cjs +1 -0
- package/dist/core/layout/index.d.cts +376 -0
- package/dist/core/layout/index.d.ts +376 -0
- package/dist/core/layout/index.js +1 -0
- package/dist/core/quality/index.cjs +1 -0
- package/dist/core/quality/index.d.cts +132 -0
- package/dist/core/quality/index.d.ts +132 -0
- package/dist/core/quality/index.js +1 -0
- package/dist/core/render-assets/index.cjs +1 -0
- package/dist/core/render-assets/index.d.cts +99 -0
- package/dist/core/render-assets/index.d.ts +99 -0
- package/dist/core/render-assets/index.js +1 -0
- package/dist/core/seatConfidence.cjs +1 -76
- package/dist/core/seatConfidence.d.cts +1 -1
- package/dist/core/seatConfidence.d.ts +1 -1
- package/dist/core/seatConfidence.js +1 -51
- package/dist/core/sections/index.cjs +1 -0
- package/dist/core/sections/index.d.cts +346 -0
- package/dist/core/sections/index.d.ts +346 -0
- package/dist/core/sections/index.js +1 -0
- package/dist/de-75NWRKC5.js +1 -0
- package/dist/es-BM7EJ7PW.js +1 -0
- package/dist/fr-HPXQHIB4.js +1 -0
- package/dist/index.cjs +1 -12717
- package/dist/index.d.cts +71 -580
- package/dist/index.d.ts +71 -580
- package/dist/index.js +1 -10235
- package/dist/labeling-CsPt1mC_.d.cts +90 -0
- package/dist/labeling-w8bl86cb.d.ts +90 -0
- package/dist/layout-B5UYbwnv.d.ts +181 -0
- package/dist/layout-YFmuxw_M.d.cts +181 -0
- package/dist/picker/minimapGeometry.cjs +1 -80
- package/dist/picker/minimapGeometry.js +1 -52
- package/dist/renderedQuality-CugJarFp.d.cts +113 -0
- package/dist/renderedQuality-DbZM034G.d.ts +113 -0
- package/dist/renderer-DhUHFtsI.d.cts +531 -0
- package/dist/renderer-IBi9YKWR.d.ts +531 -0
- package/dist/sections-B7cDF0Nq.d.cts +123 -0
- package/dist/sections-mLOZrGrI.d.ts +123 -0
- package/dist/segmentedRowModel-BPTnJ7Tz.d.ts +75 -0
- package/dist/segmentedRowModel-CGoH684F.d.cts +75 -0
- package/dist/ticketRestrictions-BwAebpSK.d.cts +72 -0
- package/dist/ticketRestrictions-ChHJwvTq.d.ts +72 -0
- package/dist/{types-tLOunI-B.d.cts → types-COfJorq_.d.cts} +233 -757
- package/dist/{types-tLOunI-B.d.ts → types-COfJorq_.d.ts} +233 -757
- package/dist/view/panoramaDelivery.cjs +1 -126
- package/dist/view/panoramaDelivery.js +1 -17
- package/dist/view3d/crossfade/panorama.cjs +1 -459
- package/dist/view3d/crossfade/panorama.d.cts +2 -4
- package/dist/view3d/crossfade/panorama.d.ts +2 -4
- package/dist/view3d/crossfade/panorama.js +1 -30
- package/dist/view3d/index.cjs +27 -7929
- package/dist/view3d/index.d.cts +64 -22
- package/dist/view3d/index.d.ts +64 -22
- package/dist/view3d/index.js +27 -7062
- package/package.json +95 -11
- package/dist/chunk-AZODENEL.js +0 -97
- package/dist/chunk-AZODENEL.js.map +0 -1
- package/dist/chunk-BE3F7CT3.js +0 -341
- package/dist/chunk-BE3F7CT3.js.map +0 -1
- package/dist/chunk-UID7KN44.js +0 -1569
- package/dist/chunk-UID7KN44.js.map +0 -1
- package/dist/core/seatConfidence.cjs.map +0 -1
- package/dist/core/seatConfidence.js.map +0 -1
- package/dist/de-YGODYJ3E.js +0 -292
- package/dist/de-YGODYJ3E.js.map +0 -1
- package/dist/es-VMBTGVFQ.js +0 -292
- package/dist/es-VMBTGVFQ.js.map +0 -1
- package/dist/fr-SLBE2ULB.js +0 -292
- package/dist/fr-SLBE2ULB.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/picker/minimapGeometry.cjs.map +0 -1
- package/dist/picker/minimapGeometry.js.map +0 -1
- package/dist/view/panoramaDelivery.cjs.map +0 -1
- package/dist/view/panoramaDelivery.js.map +0 -1
- package/dist/view3d/crossfade/panorama.cjs.map +0 -1
- package/dist/view3d/crossfade/panorama.js.map +0 -1
- package/dist/view3d/index.cjs.map +0 -1
- package/dist/view3d/index.js.map +0 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { i as SectionOutlinePath, P as Point, j as SectionPathSegment } from './types-COfJorq_.cjs';
|
|
2
|
+
|
|
3
|
+
declare function sectionPathSegmentEnd(segment: SectionPathSegment): Point;
|
|
4
|
+
/** Validate finite, continuous closed-path geometry without trusting renderer
|
|
5
|
+
* behaviour. Arc endpoints must lie on their declared circle. */
|
|
6
|
+
declare function validSectionOutlinePath(path: SectionOutlinePath): boolean;
|
|
7
|
+
/** Deterministic polygon sample used by validation, hit testing, diff, and old
|
|
8
|
+
* clients. The returned loop omits the duplicate closing point. */
|
|
9
|
+
declare function sampleSectionOutlinePath(path: SectionOutlinePath, maxStep?: number): Point[];
|
|
10
|
+
declare function translateSectionOutlinePath(path: SectionOutlinePath, dx: number, dy: number): SectionOutlinePath;
|
|
11
|
+
/** Apply a similarity transform. Callers provide the point transform and the
|
|
12
|
+
* absolute radius scale; reflections toggle arc direction. */
|
|
13
|
+
declare function transformSectionOutlinePath(path: SectionOutlinePath, transform: (point: Point) => Point, radiusScale?: number, reflected?: boolean): SectionOutlinePath;
|
|
14
|
+
/** Default corner-smoothing strength applied automatically when a hand-clicked
|
|
15
|
+
* polygon section is closed. Wide, gently-angled corners round; sharp structural
|
|
16
|
+
* corners stay crisp, so a rectangle drawn as a polygon is left untouched. */
|
|
17
|
+
declare const DEFAULT_SECTION_CORNER_SMOOTHING = 45;
|
|
18
|
+
/**
|
|
19
|
+
* Build a smooth closed {@link SectionOutlinePath} by rounding the wide corners
|
|
20
|
+
* of a hand-clicked polygon. The polygon stays authoritative — this is a purely
|
|
21
|
+
* additive rendered curve. Returns `null` when nothing qualifies (strength 0, a
|
|
22
|
+
* degenerate polygon, or no corner wide enough), letting the caller keep the raw
|
|
23
|
+
* straight polygon. Deterministic: same input always yields the same path.
|
|
24
|
+
*/
|
|
25
|
+
declare function sectionCornerSmoothingPath(polygon: Point[], strength: number, options?: {
|
|
26
|
+
wideAngleThresholdDeg?: number;
|
|
27
|
+
}): SectionOutlinePath | null;
|
|
28
|
+
/**
|
|
29
|
+
* Largest bow, as a fraction of the edge's own length, at curvature ±100. Half
|
|
30
|
+
* the chord reads as a strong arc while staying well short of a shape that folds
|
|
31
|
+
* back on itself.
|
|
32
|
+
*/
|
|
33
|
+
declare const MAX_EDGE_SAGITTA_RATIO = 0.5;
|
|
34
|
+
interface SectionOutlineDerivation {
|
|
35
|
+
/** 0–100. Rounds corners wider than the threshold. */
|
|
36
|
+
cornerSmoothing?: number;
|
|
37
|
+
/**
|
|
38
|
+
* One entry per edge of the clicked polygon, -100..100, 0 = straight. Edge `i`
|
|
39
|
+
* runs from vertex `i` to vertex `i+1`. Positive bows to the LEFT of that
|
|
40
|
+
* direction; the sign is relative to edge direction, never to world axes, so
|
|
41
|
+
* curvature survives rotate / flip / mirror untouched.
|
|
42
|
+
*/
|
|
43
|
+
edgeCurvature?: readonly number[];
|
|
44
|
+
wideAngleThresholdDeg?: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Derive the rendered outline from the clicked polygon plus its coordinate-free
|
|
48
|
+
* shaping (corner smoothing and per-edge curvature).
|
|
49
|
+
*
|
|
50
|
+
* The polygon stays authoritative — this is purely a rendered curve, so zeroing
|
|
51
|
+
* the shaping restores the exact clicked shape. Deterministic: same input always
|
|
52
|
+
* yields the same path. Returns `null` when there is nothing to draw beyond the
|
|
53
|
+
* raw polygon, letting the caller keep the straight outline.
|
|
54
|
+
*/
|
|
55
|
+
declare function sectionOutlinePathFrom(polygon: Point[], derivation: SectionOutlineDerivation): SectionOutlinePath | null;
|
|
56
|
+
/** Reverse a closed path without changing its painted boundary. */
|
|
57
|
+
declare function reverseSectionOutlinePath(path: SectionOutlinePath): SectionOutlinePath;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Pure row/seat labeling helpers used by the designer's "relabel" tools
|
|
61
|
+
* (e.g. bulk-renumber rows A, B, C… or 1, 2, 3…). No dependencies.
|
|
62
|
+
*/
|
|
63
|
+
interface RelabelOptions {
|
|
64
|
+
scheme: 'letters' | 'numbers';
|
|
65
|
+
/** 1-based start: letters 1=A; numbers 1=1. */
|
|
66
|
+
startAt: number;
|
|
67
|
+
/** Letters only: skip I and O (common theatre convention). */
|
|
68
|
+
skipAmbiguous?: boolean;
|
|
69
|
+
/** Apply labels in reverse order over the given array. */
|
|
70
|
+
reverse?: boolean;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Bijective base-N conversion: 0 -> first letter, N -> second letter's
|
|
74
|
+
* first repeat cycle (e.g. base26: 25 -> 'Z', 26 -> 'AA').
|
|
75
|
+
*/
|
|
76
|
+
declare function toBijectiveBase(index: number, alphabet: string): string;
|
|
77
|
+
declare function indexLabel(i: number, opts: RelabelOptions): string;
|
|
78
|
+
/**
|
|
79
|
+
* Alphabetic label for a 1-based value (1 -> 'A', 26 -> 'Z', 27 -> 'AA').
|
|
80
|
+
* Uppercase by default; `lower` gives the a,b,c… variant. Values ≤ 0 clamp to 'A'.
|
|
81
|
+
*/
|
|
82
|
+
declare function toLetters(value: number, lower?: boolean): string;
|
|
83
|
+
/** Uppercase Roman numeral for a positive integer (1 -> 'I', 4 -> 'IV', 9 -> 'IX').
|
|
84
|
+
* Non-positive / non-finite inputs fall back to their decimal string. */
|
|
85
|
+
declare function toRoman(value: number): string;
|
|
86
|
+
declare function relabelRows<T extends {
|
|
87
|
+
label: string;
|
|
88
|
+
}>(rows: T[], opts: RelabelOptions): T[];
|
|
89
|
+
|
|
90
|
+
export { DEFAULT_SECTION_CORNER_SMOOTHING as D, MAX_EDGE_SAGITTA_RATIO as M, type RelabelOptions as R, type SectionOutlineDerivation as S, reverseSectionOutlinePath as a, sectionCornerSmoothingPath as b, sectionOutlinePathFrom as c, sectionPathSegmentEnd as d, toLetters as e, toRoman as f, transformSectionOutlinePath as g, translateSectionOutlinePath as h, indexLabel as i, relabelRows as r, sampleSectionOutlinePath as s, toBijectiveBase as t, validSectionOutlinePath as v };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { i as SectionOutlinePath, P as Point, j as SectionPathSegment } from './types-COfJorq_.js';
|
|
2
|
+
|
|
3
|
+
declare function sectionPathSegmentEnd(segment: SectionPathSegment): Point;
|
|
4
|
+
/** Validate finite, continuous closed-path geometry without trusting renderer
|
|
5
|
+
* behaviour. Arc endpoints must lie on their declared circle. */
|
|
6
|
+
declare function validSectionOutlinePath(path: SectionOutlinePath): boolean;
|
|
7
|
+
/** Deterministic polygon sample used by validation, hit testing, diff, and old
|
|
8
|
+
* clients. The returned loop omits the duplicate closing point. */
|
|
9
|
+
declare function sampleSectionOutlinePath(path: SectionOutlinePath, maxStep?: number): Point[];
|
|
10
|
+
declare function translateSectionOutlinePath(path: SectionOutlinePath, dx: number, dy: number): SectionOutlinePath;
|
|
11
|
+
/** Apply a similarity transform. Callers provide the point transform and the
|
|
12
|
+
* absolute radius scale; reflections toggle arc direction. */
|
|
13
|
+
declare function transformSectionOutlinePath(path: SectionOutlinePath, transform: (point: Point) => Point, radiusScale?: number, reflected?: boolean): SectionOutlinePath;
|
|
14
|
+
/** Default corner-smoothing strength applied automatically when a hand-clicked
|
|
15
|
+
* polygon section is closed. Wide, gently-angled corners round; sharp structural
|
|
16
|
+
* corners stay crisp, so a rectangle drawn as a polygon is left untouched. */
|
|
17
|
+
declare const DEFAULT_SECTION_CORNER_SMOOTHING = 45;
|
|
18
|
+
/**
|
|
19
|
+
* Build a smooth closed {@link SectionOutlinePath} by rounding the wide corners
|
|
20
|
+
* of a hand-clicked polygon. The polygon stays authoritative — this is a purely
|
|
21
|
+
* additive rendered curve. Returns `null` when nothing qualifies (strength 0, a
|
|
22
|
+
* degenerate polygon, or no corner wide enough), letting the caller keep the raw
|
|
23
|
+
* straight polygon. Deterministic: same input always yields the same path.
|
|
24
|
+
*/
|
|
25
|
+
declare function sectionCornerSmoothingPath(polygon: Point[], strength: number, options?: {
|
|
26
|
+
wideAngleThresholdDeg?: number;
|
|
27
|
+
}): SectionOutlinePath | null;
|
|
28
|
+
/**
|
|
29
|
+
* Largest bow, as a fraction of the edge's own length, at curvature ±100. Half
|
|
30
|
+
* the chord reads as a strong arc while staying well short of a shape that folds
|
|
31
|
+
* back on itself.
|
|
32
|
+
*/
|
|
33
|
+
declare const MAX_EDGE_SAGITTA_RATIO = 0.5;
|
|
34
|
+
interface SectionOutlineDerivation {
|
|
35
|
+
/** 0–100. Rounds corners wider than the threshold. */
|
|
36
|
+
cornerSmoothing?: number;
|
|
37
|
+
/**
|
|
38
|
+
* One entry per edge of the clicked polygon, -100..100, 0 = straight. Edge `i`
|
|
39
|
+
* runs from vertex `i` to vertex `i+1`. Positive bows to the LEFT of that
|
|
40
|
+
* direction; the sign is relative to edge direction, never to world axes, so
|
|
41
|
+
* curvature survives rotate / flip / mirror untouched.
|
|
42
|
+
*/
|
|
43
|
+
edgeCurvature?: readonly number[];
|
|
44
|
+
wideAngleThresholdDeg?: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Derive the rendered outline from the clicked polygon plus its coordinate-free
|
|
48
|
+
* shaping (corner smoothing and per-edge curvature).
|
|
49
|
+
*
|
|
50
|
+
* The polygon stays authoritative — this is purely a rendered curve, so zeroing
|
|
51
|
+
* the shaping restores the exact clicked shape. Deterministic: same input always
|
|
52
|
+
* yields the same path. Returns `null` when there is nothing to draw beyond the
|
|
53
|
+
* raw polygon, letting the caller keep the straight outline.
|
|
54
|
+
*/
|
|
55
|
+
declare function sectionOutlinePathFrom(polygon: Point[], derivation: SectionOutlineDerivation): SectionOutlinePath | null;
|
|
56
|
+
/** Reverse a closed path without changing its painted boundary. */
|
|
57
|
+
declare function reverseSectionOutlinePath(path: SectionOutlinePath): SectionOutlinePath;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Pure row/seat labeling helpers used by the designer's "relabel" tools
|
|
61
|
+
* (e.g. bulk-renumber rows A, B, C… or 1, 2, 3…). No dependencies.
|
|
62
|
+
*/
|
|
63
|
+
interface RelabelOptions {
|
|
64
|
+
scheme: 'letters' | 'numbers';
|
|
65
|
+
/** 1-based start: letters 1=A; numbers 1=1. */
|
|
66
|
+
startAt: number;
|
|
67
|
+
/** Letters only: skip I and O (common theatre convention). */
|
|
68
|
+
skipAmbiguous?: boolean;
|
|
69
|
+
/** Apply labels in reverse order over the given array. */
|
|
70
|
+
reverse?: boolean;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Bijective base-N conversion: 0 -> first letter, N -> second letter's
|
|
74
|
+
* first repeat cycle (e.g. base26: 25 -> 'Z', 26 -> 'AA').
|
|
75
|
+
*/
|
|
76
|
+
declare function toBijectiveBase(index: number, alphabet: string): string;
|
|
77
|
+
declare function indexLabel(i: number, opts: RelabelOptions): string;
|
|
78
|
+
/**
|
|
79
|
+
* Alphabetic label for a 1-based value (1 -> 'A', 26 -> 'Z', 27 -> 'AA').
|
|
80
|
+
* Uppercase by default; `lower` gives the a,b,c… variant. Values ≤ 0 clamp to 'A'.
|
|
81
|
+
*/
|
|
82
|
+
declare function toLetters(value: number, lower?: boolean): string;
|
|
83
|
+
/** Uppercase Roman numeral for a positive integer (1 -> 'I', 4 -> 'IV', 9 -> 'IX').
|
|
84
|
+
* Non-positive / non-finite inputs fall back to their decimal string. */
|
|
85
|
+
declare function toRoman(value: number): string;
|
|
86
|
+
declare function relabelRows<T extends {
|
|
87
|
+
label: string;
|
|
88
|
+
}>(rows: T[], opts: RelabelOptions): T[];
|
|
89
|
+
|
|
90
|
+
export { DEFAULT_SECTION_CORNER_SMOOTHING as D, MAX_EDGE_SAGITTA_RATIO as M, type RelabelOptions as R, type SectionOutlineDerivation as S, reverseSectionOutlinePath as a, sectionCornerSmoothingPath as b, sectionOutlinePathFrom as c, sectionPathSegmentEnd as d, toLetters as e, toRoman as f, transformSectionOutlinePath as g, translateSectionOutlinePath as h, indexLabel as i, relabelRows as r, sampleSectionOutlinePath as s, toBijectiveBase as t, validSectionOutlinePath as v };
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { A as AccessibilityType, S as SeatOverride, R as RowObject, a as SeatViewMetadata, L as LabelStyle, b as RectTableSide, C as ChartDoc, c as ChartObject, B as BoothObject, T as TableObject, P as Point, F as Floor, d as SectionObject, e as RectTableSeatCounts } from './types-COfJorq_.js';
|
|
2
|
+
import { S as SegmentedRowPlacement } from './segmentedRowModel-BPTnJ7Tz.js';
|
|
3
|
+
import { E as ExpandedSeat } from './renderer-IBi9YKWR.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Pure geometry helpers — no Konva, no DOM. Turns the parametric chart
|
|
7
|
+
* document into concrete seat coordinates and computes bounding boxes.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Expand a parametric row into seat positions.
|
|
12
|
+
*
|
|
13
|
+
* Straight (curve === 0): seat i sits at local (i·spacing, 0).
|
|
14
|
+
*
|
|
15
|
+
* Curved: seats lie on a circular arc. Per-seat angular step is
|
|
16
|
+
* `curve/(seatCount-1)`; radius is derived so the chord between neighbours
|
|
17
|
+
* equals seatSpacing → radius = spacing / (2·sin(step/2)). Seat 0 sits at the
|
|
18
|
+
* bottom of the arc (local origin) with the circle centre directly above it at
|
|
19
|
+
* (0,-radius); increasing index sweeps toward +x while the ends rise toward -y,
|
|
20
|
+
* i.e. positive curve is concave toward -y (a row wrapping a stage above it).
|
|
21
|
+
* Local points are then rotated by `rotation` and translated to `origin`.
|
|
22
|
+
*
|
|
23
|
+
* Numbering (labels only, never geometry): `seatNumbering.direction === 'rtl'`
|
|
24
|
+
* numbers from the far physical end; `step === 2` produces odd/even numbering
|
|
25
|
+
* (start at 1 → 1,3,5…; start at 2 → 2,4,6…).
|
|
26
|
+
*/
|
|
27
|
+
/** Base (pre-override) seat centre per index — shared by expandRow + designer edit mode. */
|
|
28
|
+
declare function rowSeatPositions(row: RowObject): Point[];
|
|
29
|
+
/** Sellable row slots: skipped slots are absent; empty wheelchair bays remain. */
|
|
30
|
+
declare function rowInventoryCount(row: RowObject): number;
|
|
31
|
+
/**
|
|
32
|
+
* Every seat slot of a row INCLUDING skipped ones (designer seat-edit mode uses
|
|
33
|
+
* this to draw un-skip handles). Overrides (dx/dy/label/categoryKey) are applied
|
|
34
|
+
* but a skipped slot is flagged, not omitted.
|
|
35
|
+
*/
|
|
36
|
+
interface RowSeatSlot {
|
|
37
|
+
index: number;
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
label: string;
|
|
41
|
+
displayLabel: string;
|
|
42
|
+
categoryKey: string;
|
|
43
|
+
skipped: boolean;
|
|
44
|
+
accessible: boolean;
|
|
45
|
+
accessibility: AccessibilityType[];
|
|
46
|
+
wheelchairSpaceType?: SeatOverride['wheelchairSpaceType'];
|
|
47
|
+
commercial?: RowObject['commercial'];
|
|
48
|
+
viewUrl?: string;
|
|
49
|
+
viewMeta?: SeatViewMetadata;
|
|
50
|
+
labelStyle?: LabelStyle;
|
|
51
|
+
}
|
|
52
|
+
/** Every authored table-chair slot, including skipped inventory. This mirrors
|
|
53
|
+
* row seat slots so Designer, MCP and buyer/event expansion share one semantic
|
|
54
|
+
* source while retaining the table's stable numeric slot identity. */
|
|
55
|
+
interface TableSeatSlot extends RowSeatSlot {
|
|
56
|
+
side?: RectTableSide;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Seat slots for one physical row.
|
|
60
|
+
*
|
|
61
|
+
* `placement` makes the slots read as part of a logical segmented row: labels
|
|
62
|
+
* continue across components (`A-8`, not a second `A-1`) using the logical row's
|
|
63
|
+
* numbering scheme and total seat count.
|
|
64
|
+
*/
|
|
65
|
+
declare function expandRowSlots(row: RowObject, placement?: SegmentedRowPlacement): RowSeatSlot[];
|
|
66
|
+
declare function expandRow(row: RowObject): ExpandedSeat[];
|
|
67
|
+
/**
|
|
68
|
+
* Expand a table into its perimeter seats.
|
|
69
|
+
*
|
|
70
|
+
* Round: seats spread evenly on a circle of radius `radius + 16`, the first at
|
|
71
|
+
* angle `rotation` (degrees, clockwise from +x). Rect: seats line the top and
|
|
72
|
+
* bottom edges (split evenly, any remainder to the top), 16u outside the edge,
|
|
73
|
+
* the whole set rotated about the table centre.
|
|
74
|
+
*/
|
|
75
|
+
/** Legacy rect tables distribute aggregate capacity round-robin across enabled
|
|
76
|
+
* sides, then emit chairs in canonical top/bottom/left/right order. */
|
|
77
|
+
declare function tableSeatCountsBySide(t: TableObject): RectTableSeatCounts;
|
|
78
|
+
/** Expand every authored table chair, including skipped slots needed by the
|
|
79
|
+
* Designer to restore inventory. */
|
|
80
|
+
declare function expandTableSlots(t: TableObject): TableSeatSlot[];
|
|
81
|
+
/** Sellable individual table chairs. Grouped tables own one atomic inventory
|
|
82
|
+
* unit elsewhere and therefore retain their full authored chair capacity. */
|
|
83
|
+
declare function tableInventoryCount(t: TableObject): number;
|
|
84
|
+
declare function expandTable(t: TableObject): ExpandedSeat[];
|
|
85
|
+
/** Expand a booth into its single bookable block unit. */
|
|
86
|
+
declare function expandBooth(b: BoothObject): ExpandedSeat[];
|
|
87
|
+
/** Ray-cast point-in-polygon test — odd crossings ⇒ inside. */
|
|
88
|
+
declare function pointInPolygon(p: Point, poly: Point[]): boolean;
|
|
89
|
+
declare function pointInPolygonWithHoles(p: Point, outer: Point[], holes: Point[][] | undefined): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Stable interior label anchor: the centre of the largest circle that fits in
|
|
92
|
+
* the polygon (holes excluded).
|
|
93
|
+
*
|
|
94
|
+
* This used to return the average-of-vertices centroid whenever that happened
|
|
95
|
+
* to be inside, and only fell back to a coarse 24×24 grid search when it was
|
|
96
|
+
* not. "Inside" is a much weaker property than "has room": on a traced arena
|
|
97
|
+
* the outer arc of a wedge carries dozens of sampled vertices and the radial
|
|
98
|
+
* edges carry two, so the average is dragged onto the arc and the label pill —
|
|
99
|
+
* far wider than a point — straddled the boundary into the next section.
|
|
100
|
+
* Measured on the 36-section traced arena corpus, 15 of 36 anchors had under
|
|
101
|
+
* 75% of the clearance actually available, some as little as 43%.
|
|
102
|
+
*
|
|
103
|
+
* `polygonInscribedAnchor` is deterministic and coordinate-free, so callers may
|
|
104
|
+
* memoize it on geometry alone.
|
|
105
|
+
*/
|
|
106
|
+
declare function polygonLabelPoint(outer: Point[], holes: Point[][] | undefined): Point;
|
|
107
|
+
/**
|
|
108
|
+
* Visual centre of any object — used for spatial section membership and for
|
|
109
|
+
* rotating an object about its centre. Rows: centroid of expanded seats (or
|
|
110
|
+
* origin when empty); tables/booths: centre; GA/section: polygon centroid;
|
|
111
|
+
* shape: bbox centre; text: its position.
|
|
112
|
+
*/
|
|
113
|
+
declare function objectCenter(o: ChartObject): Point;
|
|
114
|
+
/**
|
|
115
|
+
* Resolve one bookable object's owning physical section using the canonical
|
|
116
|
+
* first-match rule. Generated reference inventory may name a logical section,
|
|
117
|
+
* but that provenance is trusted only when the stored geometry confirms it.
|
|
118
|
+
* Keeping this primitive in layout lets section inventory, category painting,
|
|
119
|
+
* and buyer view inheritance share one ownership decision.
|
|
120
|
+
*/
|
|
121
|
+
declare function owningSectionForObject(objects: ChartObject[], object: ChartObject): SectionObject | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* Normalized floor list (Batch 5): a multi-floor chart's `floors`, or a synthetic
|
|
124
|
+
* single floor wrapping a single-floor chart's `objects`. Every consumer that needs
|
|
125
|
+
* to reason about floors goes through this so single-floor charts stay untouched.
|
|
126
|
+
*/
|
|
127
|
+
declare function floorsOf(doc: ChartDoc): Floor[];
|
|
128
|
+
/** Objects of one floor by id (defaults to the first floor). */
|
|
129
|
+
declare function floorObjects(doc: ChartDoc, floorId?: string): ChartObject[];
|
|
130
|
+
/** Every object across ALL floors — the whole venue (single-floor = `doc.objects`). */
|
|
131
|
+
declare function allObjects(doc: ChartDoc): ChartObject[];
|
|
132
|
+
/** A copy of an object translated by (dx, dy) — every coordinate field shifted. */
|
|
133
|
+
declare function translateObject(o: ChartObject, dx: number, dy: number): ChartObject;
|
|
134
|
+
/**
|
|
135
|
+
* Multi-floor 3D stack (Batch 5): flatten every floor into ONE doc with floor `i`
|
|
136
|
+
* lifted by `i * spread` in −y, so the isometric view shows the floors as stacked
|
|
137
|
+
* decks (ground at the bottom). Returns a single-floor doc (no `floors`). Meant
|
|
138
|
+
* only for the 3D overview render — 2D still shows one floor via `floorObjects`.
|
|
139
|
+
*/
|
|
140
|
+
declare function stackFloors(doc: ChartDoc, spread?: number): ChartDoc;
|
|
141
|
+
/**
|
|
142
|
+
* Build the buyer-facing 2D overview of a multi-floor chart.
|
|
143
|
+
*
|
|
144
|
+
* Floors commonly reuse the same drawing origin (a balcony is authored over
|
|
145
|
+
* the stalls it overlooks). Flattening those source coordinates makes a valid
|
|
146
|
+
* import look corrupt because every level is painted on top of every other
|
|
147
|
+
* level. This projection packs complete floors into a compact, content-aware
|
|
148
|
+
* grid. Each floor receives one rigid translation: no seat, row, section,
|
|
149
|
+
* annotation, gap, or rotation changes, and the canonical document is never
|
|
150
|
+
* mutated.
|
|
151
|
+
*/
|
|
152
|
+
declare function layoutFloorOverview(doc: ChartDoc): ChartDoc;
|
|
153
|
+
/**
|
|
154
|
+
* Rigid per-floor translations used by the buyer's complete-venue overview.
|
|
155
|
+
*
|
|
156
|
+
* Kept as a pure public helper so 2D and 3D can present the same non-overlapping
|
|
157
|
+
* level arrangement without either renderer rewriting the authored chart. A
|
|
158
|
+
* zero translation is returned for a single-floor document.
|
|
159
|
+
*/
|
|
160
|
+
declare function floorOverviewTranslations(doc: ChartDoc): Point[];
|
|
161
|
+
interface ExpandChartOptions {
|
|
162
|
+
/** Physical height for a single-floor projection extracted from a multi-floor
|
|
163
|
+
* document. Full multi-floor documents resolve each floor directly. */
|
|
164
|
+
floorBaseHeightM?: number;
|
|
165
|
+
/** Resolve per-seat 3D eye heights (default true). Two-dimensional consumers
|
|
166
|
+
* such as thumbnails can disable this expensive stand-structure pass. */
|
|
167
|
+
resolveEyeHeights?: boolean;
|
|
168
|
+
}
|
|
169
|
+
/** Expand every seat-bearing object across all floors (rows, tables, booths).
|
|
170
|
+
* Multi-floor ownership is resolved one floor at a time: local coordinates may
|
|
171
|
+
* overlap between floors and must never assign a seat to another floor's section. */
|
|
172
|
+
declare function expandChart(doc: ChartDoc, options?: ExpandChartOptions): ExpandedSeat[];
|
|
173
|
+
/** Axis-aligned bounds over every object plus the background image, with padding. */
|
|
174
|
+
declare function chartBounds(doc: ChartDoc): {
|
|
175
|
+
x: number;
|
|
176
|
+
y: number;
|
|
177
|
+
width: number;
|
|
178
|
+
height: number;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export { type ExpandChartOptions as E, type RowSeatSlot as R, type TableSeatSlot as T, allObjects as a, expandChart as b, chartBounds as c, expandRow as d, expandBooth as e, expandRowSlots as f, expandTable as g, expandTableSlots as h, floorObjects as i, floorOverviewTranslations as j, floorsOf as k, layoutFloorOverview as l, owningSectionForObject as m, pointInPolygonWithHoles as n, objectCenter as o, pointInPolygon as p, polygonLabelPoint as q, rowInventoryCount as r, rowSeatPositions as s, stackFloors as t, tableInventoryCount as u, tableSeatCountsBySide as v, translateObject as w };
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { A as AccessibilityType, S as SeatOverride, R as RowObject, a as SeatViewMetadata, L as LabelStyle, b as RectTableSide, C as ChartDoc, c as ChartObject, B as BoothObject, T as TableObject, P as Point, F as Floor, d as SectionObject, e as RectTableSeatCounts } from './types-COfJorq_.cjs';
|
|
2
|
+
import { S as SegmentedRowPlacement } from './segmentedRowModel-CGoH684F.cjs';
|
|
3
|
+
import { E as ExpandedSeat } from './renderer-DhUHFtsI.cjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Pure geometry helpers — no Konva, no DOM. Turns the parametric chart
|
|
7
|
+
* document into concrete seat coordinates and computes bounding boxes.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Expand a parametric row into seat positions.
|
|
12
|
+
*
|
|
13
|
+
* Straight (curve === 0): seat i sits at local (i·spacing, 0).
|
|
14
|
+
*
|
|
15
|
+
* Curved: seats lie on a circular arc. Per-seat angular step is
|
|
16
|
+
* `curve/(seatCount-1)`; radius is derived so the chord between neighbours
|
|
17
|
+
* equals seatSpacing → radius = spacing / (2·sin(step/2)). Seat 0 sits at the
|
|
18
|
+
* bottom of the arc (local origin) with the circle centre directly above it at
|
|
19
|
+
* (0,-radius); increasing index sweeps toward +x while the ends rise toward -y,
|
|
20
|
+
* i.e. positive curve is concave toward -y (a row wrapping a stage above it).
|
|
21
|
+
* Local points are then rotated by `rotation` and translated to `origin`.
|
|
22
|
+
*
|
|
23
|
+
* Numbering (labels only, never geometry): `seatNumbering.direction === 'rtl'`
|
|
24
|
+
* numbers from the far physical end; `step === 2` produces odd/even numbering
|
|
25
|
+
* (start at 1 → 1,3,5…; start at 2 → 2,4,6…).
|
|
26
|
+
*/
|
|
27
|
+
/** Base (pre-override) seat centre per index — shared by expandRow + designer edit mode. */
|
|
28
|
+
declare function rowSeatPositions(row: RowObject): Point[];
|
|
29
|
+
/** Sellable row slots: skipped slots are absent; empty wheelchair bays remain. */
|
|
30
|
+
declare function rowInventoryCount(row: RowObject): number;
|
|
31
|
+
/**
|
|
32
|
+
* Every seat slot of a row INCLUDING skipped ones (designer seat-edit mode uses
|
|
33
|
+
* this to draw un-skip handles). Overrides (dx/dy/label/categoryKey) are applied
|
|
34
|
+
* but a skipped slot is flagged, not omitted.
|
|
35
|
+
*/
|
|
36
|
+
interface RowSeatSlot {
|
|
37
|
+
index: number;
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
label: string;
|
|
41
|
+
displayLabel: string;
|
|
42
|
+
categoryKey: string;
|
|
43
|
+
skipped: boolean;
|
|
44
|
+
accessible: boolean;
|
|
45
|
+
accessibility: AccessibilityType[];
|
|
46
|
+
wheelchairSpaceType?: SeatOverride['wheelchairSpaceType'];
|
|
47
|
+
commercial?: RowObject['commercial'];
|
|
48
|
+
viewUrl?: string;
|
|
49
|
+
viewMeta?: SeatViewMetadata;
|
|
50
|
+
labelStyle?: LabelStyle;
|
|
51
|
+
}
|
|
52
|
+
/** Every authored table-chair slot, including skipped inventory. This mirrors
|
|
53
|
+
* row seat slots so Designer, MCP and buyer/event expansion share one semantic
|
|
54
|
+
* source while retaining the table's stable numeric slot identity. */
|
|
55
|
+
interface TableSeatSlot extends RowSeatSlot {
|
|
56
|
+
side?: RectTableSide;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Seat slots for one physical row.
|
|
60
|
+
*
|
|
61
|
+
* `placement` makes the slots read as part of a logical segmented row: labels
|
|
62
|
+
* continue across components (`A-8`, not a second `A-1`) using the logical row's
|
|
63
|
+
* numbering scheme and total seat count.
|
|
64
|
+
*/
|
|
65
|
+
declare function expandRowSlots(row: RowObject, placement?: SegmentedRowPlacement): RowSeatSlot[];
|
|
66
|
+
declare function expandRow(row: RowObject): ExpandedSeat[];
|
|
67
|
+
/**
|
|
68
|
+
* Expand a table into its perimeter seats.
|
|
69
|
+
*
|
|
70
|
+
* Round: seats spread evenly on a circle of radius `radius + 16`, the first at
|
|
71
|
+
* angle `rotation` (degrees, clockwise from +x). Rect: seats line the top and
|
|
72
|
+
* bottom edges (split evenly, any remainder to the top), 16u outside the edge,
|
|
73
|
+
* the whole set rotated about the table centre.
|
|
74
|
+
*/
|
|
75
|
+
/** Legacy rect tables distribute aggregate capacity round-robin across enabled
|
|
76
|
+
* sides, then emit chairs in canonical top/bottom/left/right order. */
|
|
77
|
+
declare function tableSeatCountsBySide(t: TableObject): RectTableSeatCounts;
|
|
78
|
+
/** Expand every authored table chair, including skipped slots needed by the
|
|
79
|
+
* Designer to restore inventory. */
|
|
80
|
+
declare function expandTableSlots(t: TableObject): TableSeatSlot[];
|
|
81
|
+
/** Sellable individual table chairs. Grouped tables own one atomic inventory
|
|
82
|
+
* unit elsewhere and therefore retain their full authored chair capacity. */
|
|
83
|
+
declare function tableInventoryCount(t: TableObject): number;
|
|
84
|
+
declare function expandTable(t: TableObject): ExpandedSeat[];
|
|
85
|
+
/** Expand a booth into its single bookable block unit. */
|
|
86
|
+
declare function expandBooth(b: BoothObject): ExpandedSeat[];
|
|
87
|
+
/** Ray-cast point-in-polygon test — odd crossings ⇒ inside. */
|
|
88
|
+
declare function pointInPolygon(p: Point, poly: Point[]): boolean;
|
|
89
|
+
declare function pointInPolygonWithHoles(p: Point, outer: Point[], holes: Point[][] | undefined): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Stable interior label anchor: the centre of the largest circle that fits in
|
|
92
|
+
* the polygon (holes excluded).
|
|
93
|
+
*
|
|
94
|
+
* This used to return the average-of-vertices centroid whenever that happened
|
|
95
|
+
* to be inside, and only fell back to a coarse 24×24 grid search when it was
|
|
96
|
+
* not. "Inside" is a much weaker property than "has room": on a traced arena
|
|
97
|
+
* the outer arc of a wedge carries dozens of sampled vertices and the radial
|
|
98
|
+
* edges carry two, so the average is dragged onto the arc and the label pill —
|
|
99
|
+
* far wider than a point — straddled the boundary into the next section.
|
|
100
|
+
* Measured on the 36-section traced arena corpus, 15 of 36 anchors had under
|
|
101
|
+
* 75% of the clearance actually available, some as little as 43%.
|
|
102
|
+
*
|
|
103
|
+
* `polygonInscribedAnchor` is deterministic and coordinate-free, so callers may
|
|
104
|
+
* memoize it on geometry alone.
|
|
105
|
+
*/
|
|
106
|
+
declare function polygonLabelPoint(outer: Point[], holes: Point[][] | undefined): Point;
|
|
107
|
+
/**
|
|
108
|
+
* Visual centre of any object — used for spatial section membership and for
|
|
109
|
+
* rotating an object about its centre. Rows: centroid of expanded seats (or
|
|
110
|
+
* origin when empty); tables/booths: centre; GA/section: polygon centroid;
|
|
111
|
+
* shape: bbox centre; text: its position.
|
|
112
|
+
*/
|
|
113
|
+
declare function objectCenter(o: ChartObject): Point;
|
|
114
|
+
/**
|
|
115
|
+
* Resolve one bookable object's owning physical section using the canonical
|
|
116
|
+
* first-match rule. Generated reference inventory may name a logical section,
|
|
117
|
+
* but that provenance is trusted only when the stored geometry confirms it.
|
|
118
|
+
* Keeping this primitive in layout lets section inventory, category painting,
|
|
119
|
+
* and buyer view inheritance share one ownership decision.
|
|
120
|
+
*/
|
|
121
|
+
declare function owningSectionForObject(objects: ChartObject[], object: ChartObject): SectionObject | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* Normalized floor list (Batch 5): a multi-floor chart's `floors`, or a synthetic
|
|
124
|
+
* single floor wrapping a single-floor chart's `objects`. Every consumer that needs
|
|
125
|
+
* to reason about floors goes through this so single-floor charts stay untouched.
|
|
126
|
+
*/
|
|
127
|
+
declare function floorsOf(doc: ChartDoc): Floor[];
|
|
128
|
+
/** Objects of one floor by id (defaults to the first floor). */
|
|
129
|
+
declare function floorObjects(doc: ChartDoc, floorId?: string): ChartObject[];
|
|
130
|
+
/** Every object across ALL floors — the whole venue (single-floor = `doc.objects`). */
|
|
131
|
+
declare function allObjects(doc: ChartDoc): ChartObject[];
|
|
132
|
+
/** A copy of an object translated by (dx, dy) — every coordinate field shifted. */
|
|
133
|
+
declare function translateObject(o: ChartObject, dx: number, dy: number): ChartObject;
|
|
134
|
+
/**
|
|
135
|
+
* Multi-floor 3D stack (Batch 5): flatten every floor into ONE doc with floor `i`
|
|
136
|
+
* lifted by `i * spread` in −y, so the isometric view shows the floors as stacked
|
|
137
|
+
* decks (ground at the bottom). Returns a single-floor doc (no `floors`). Meant
|
|
138
|
+
* only for the 3D overview render — 2D still shows one floor via `floorObjects`.
|
|
139
|
+
*/
|
|
140
|
+
declare function stackFloors(doc: ChartDoc, spread?: number): ChartDoc;
|
|
141
|
+
/**
|
|
142
|
+
* Build the buyer-facing 2D overview of a multi-floor chart.
|
|
143
|
+
*
|
|
144
|
+
* Floors commonly reuse the same drawing origin (a balcony is authored over
|
|
145
|
+
* the stalls it overlooks). Flattening those source coordinates makes a valid
|
|
146
|
+
* import look corrupt because every level is painted on top of every other
|
|
147
|
+
* level. This projection packs complete floors into a compact, content-aware
|
|
148
|
+
* grid. Each floor receives one rigid translation: no seat, row, section,
|
|
149
|
+
* annotation, gap, or rotation changes, and the canonical document is never
|
|
150
|
+
* mutated.
|
|
151
|
+
*/
|
|
152
|
+
declare function layoutFloorOverview(doc: ChartDoc): ChartDoc;
|
|
153
|
+
/**
|
|
154
|
+
* Rigid per-floor translations used by the buyer's complete-venue overview.
|
|
155
|
+
*
|
|
156
|
+
* Kept as a pure public helper so 2D and 3D can present the same non-overlapping
|
|
157
|
+
* level arrangement without either renderer rewriting the authored chart. A
|
|
158
|
+
* zero translation is returned for a single-floor document.
|
|
159
|
+
*/
|
|
160
|
+
declare function floorOverviewTranslations(doc: ChartDoc): Point[];
|
|
161
|
+
interface ExpandChartOptions {
|
|
162
|
+
/** Physical height for a single-floor projection extracted from a multi-floor
|
|
163
|
+
* document. Full multi-floor documents resolve each floor directly. */
|
|
164
|
+
floorBaseHeightM?: number;
|
|
165
|
+
/** Resolve per-seat 3D eye heights (default true). Two-dimensional consumers
|
|
166
|
+
* such as thumbnails can disable this expensive stand-structure pass. */
|
|
167
|
+
resolveEyeHeights?: boolean;
|
|
168
|
+
}
|
|
169
|
+
/** Expand every seat-bearing object across all floors (rows, tables, booths).
|
|
170
|
+
* Multi-floor ownership is resolved one floor at a time: local coordinates may
|
|
171
|
+
* overlap between floors and must never assign a seat to another floor's section. */
|
|
172
|
+
declare function expandChart(doc: ChartDoc, options?: ExpandChartOptions): ExpandedSeat[];
|
|
173
|
+
/** Axis-aligned bounds over every object plus the background image, with padding. */
|
|
174
|
+
declare function chartBounds(doc: ChartDoc): {
|
|
175
|
+
x: number;
|
|
176
|
+
y: number;
|
|
177
|
+
width: number;
|
|
178
|
+
height: number;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export { type ExpandChartOptions as E, type RowSeatSlot as R, type TableSeatSlot as T, allObjects as a, expandChart as b, chartBounds as c, expandRow as d, expandBooth as e, expandRowSlots as f, expandTable as g, expandTableSlots as h, floorObjects as i, floorOverviewTranslations as j, floorsOf as k, layoutFloorOverview as l, owningSectionForObject as m, pointInPolygonWithHoles as n, objectCenter as o, pointInPolygon as p, polygonLabelPoint as q, rowInventoryCount as r, rowSeatPositions as s, stackFloors as t, tableInventoryCount as u, tableSeatCountsBySide as v, translateObject as w };
|
|
@@ -1,80 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/picker/minimapGeometry.ts
|
|
21
|
-
var minimapGeometry_exports = {};
|
|
22
|
-
__export(minimapGeometry_exports, {
|
|
23
|
-
createMinimapTransform: () => createMinimapTransform,
|
|
24
|
-
minimapPointToWorld: () => minimapPointToWorld,
|
|
25
|
-
minimapViewportPlan: () => minimapViewportPlan,
|
|
26
|
-
worldRectToMinimap: () => worldRectToMinimap
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(minimapGeometry_exports);
|
|
29
|
-
function createMinimapTransform(world, pixelWidth, pixelHeight, dpr, cssPadding = 6) {
|
|
30
|
-
const padding = cssPadding * dpr;
|
|
31
|
-
const scale = Math.min(
|
|
32
|
-
(pixelWidth - padding * 2) / Math.max(1, world.width),
|
|
33
|
-
(pixelHeight - padding * 2) / Math.max(1, world.height)
|
|
34
|
-
);
|
|
35
|
-
return {
|
|
36
|
-
scale,
|
|
37
|
-
offX: (pixelWidth - world.width * scale) / 2 - world.x * scale,
|
|
38
|
-
offY: (pixelHeight - world.height * scale) / 2 - world.y * scale,
|
|
39
|
-
dpr
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
function worldRectToMinimap(rect, transform) {
|
|
43
|
-
return {
|
|
44
|
-
x: rect.x * transform.scale + transform.offX,
|
|
45
|
-
y: rect.y * transform.scale + transform.offY,
|
|
46
|
-
width: rect.width * transform.scale,
|
|
47
|
-
height: rect.height * transform.scale
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
function minimapViewportPlan(visible, transform, pixelWidth, pixelHeight, strokeInset = 2) {
|
|
51
|
-
const raw = worldRectToMinimap(visible, transform);
|
|
52
|
-
const left = Math.max(strokeInset, raw.x);
|
|
53
|
-
const top = Math.max(strokeInset, raw.y);
|
|
54
|
-
const right = Math.min(pixelWidth - strokeInset, raw.x + raw.width);
|
|
55
|
-
const bottom = Math.min(pixelHeight - strokeInset, raw.y + raw.height);
|
|
56
|
-
return {
|
|
57
|
-
raw,
|
|
58
|
-
clipped: right > left && bottom > top ? { x: left, y: top, width: right - left, height: bottom - top } : null,
|
|
59
|
-
clippedEdges: {
|
|
60
|
-
left: raw.x < strokeInset,
|
|
61
|
-
top: raw.y < strokeInset,
|
|
62
|
-
right: raw.x + raw.width > pixelWidth - strokeInset,
|
|
63
|
-
bottom: raw.y + raw.height > pixelHeight - strokeInset
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
function minimapPointToWorld(pixel, transform) {
|
|
68
|
-
return {
|
|
69
|
-
x: (pixel.x - transform.offX) / transform.scale,
|
|
70
|
-
y: (pixel.y - transform.offY) / transform.scale
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
74
|
-
0 && (module.exports = {
|
|
75
|
-
createMinimapTransform,
|
|
76
|
-
minimapPointToWorld,
|
|
77
|
-
minimapViewportPlan,
|
|
78
|
-
worldRectToMinimap
|
|
79
|
-
});
|
|
80
|
-
//# sourceMappingURL=minimapGeometry.cjs.map
|
|
1
|
+
"use strict";var c=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var x=(n,i)=>{for(var t in i)c(n,t,{get:i[t],enumerable:!0})},l=(n,i,t,o)=>{if(i&&typeof i=="object"||typeof i=="function")for(let e of f(i))!M.call(n,e)&&e!==t&&c(n,e,{get:()=>i[e],enumerable:!(o=b(i,e))||o.enumerable});return n};var y=n=>l(c({},"__esModule",{value:!0}),n);var R={};x(R,{createMinimapTransform:()=>g,minimapPointToWorld:()=>w,minimapViewportPlan:()=>d,worldRectToMinimap:()=>u});module.exports=y(R);function g(n,i,t,o,e=6){let a=e*o,m=Math.min((i-a*2)/Math.max(1,n.width),(t-a*2)/Math.max(1,n.height));return{scale:m,offX:(i-n.width*m)/2-n.x*m,offY:(t-n.height*m)/2-n.y*m,dpr:o}}function u(n,i){return{x:n.x*i.scale+i.offX,y:n.y*i.scale+i.offY,width:n.width*i.scale,height:n.height*i.scale}}function d(n,i,t,o,e=2){let a=u(n,i),m=Math.max(e,a.x),p=Math.max(e,a.y),h=Math.min(t-e,a.x+a.width),r=Math.min(o-e,a.y+a.height);return{raw:a,clipped:h>m&&r>p?{x:m,y:p,width:h-m,height:r-p}:null,clippedEdges:{left:a.x<e,top:a.y<e,right:a.x+a.width>t-e,bottom:a.y+a.height>o-e}}}function w(n,i){return{x:(n.x-i.offX)/i.scale,y:(n.y-i.offY)/i.scale}}0&&(module.exports={createMinimapTransform,minimapPointToWorld,minimapViewportPlan,worldRectToMinimap});
|