chartgpu 0.2.1 → 0.2.3

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.
Files changed (63) hide show
  1. package/README.md +30 -8
  2. package/dist/ChartGPU.d.ts.map +1 -1
  3. package/dist/components/createLegend.d.ts +1 -1
  4. package/dist/components/createLegend.d.ts.map +1 -1
  5. package/dist/config/OptionResolver.d.ts +4 -2
  6. package/dist/config/OptionResolver.d.ts.map +1 -1
  7. package/dist/config/types.d.ts +24 -0
  8. package/dist/config/types.d.ts.map +1 -1
  9. package/dist/core/GPUContext.d.ts +11 -11
  10. package/dist/core/GPUContext.d.ts.map +1 -1
  11. package/dist/core/createRenderCoordinator.d.ts +3 -3
  12. package/dist/core/createRenderCoordinator.d.ts.map +1 -1
  13. package/dist/core/renderCoordinator/animation/animationHelpers.d.ts +183 -0
  14. package/dist/core/renderCoordinator/animation/animationHelpers.d.ts.map +1 -0
  15. package/dist/core/renderCoordinator/annotations/processAnnotations.d.ts +88 -0
  16. package/dist/core/renderCoordinator/annotations/processAnnotations.d.ts.map +1 -0
  17. package/dist/core/renderCoordinator/axis/axisLabelHelpers.d.ts +91 -0
  18. package/dist/core/renderCoordinator/axis/axisLabelHelpers.d.ts.map +1 -0
  19. package/dist/core/renderCoordinator/axis/computeAxisTicks.d.ts +53 -0
  20. package/dist/core/renderCoordinator/axis/computeAxisTicks.d.ts.map +1 -0
  21. package/dist/core/renderCoordinator/data/computeVisibleSlice.d.ts +68 -0
  22. package/dist/core/renderCoordinator/data/computeVisibleSlice.d.ts.map +1 -0
  23. package/dist/core/renderCoordinator/gpu/textureManager.d.ts +69 -0
  24. package/dist/core/renderCoordinator/gpu/textureManager.d.ts.map +1 -0
  25. package/dist/core/renderCoordinator/interaction/interactionHelpers.d.ts +160 -0
  26. package/dist/core/renderCoordinator/interaction/interactionHelpers.d.ts.map +1 -0
  27. package/dist/core/renderCoordinator/render/renderAnnotationLabels.d.ts +36 -0
  28. package/dist/core/renderCoordinator/render/renderAnnotationLabels.d.ts.map +1 -0
  29. package/dist/core/renderCoordinator/render/renderAxisLabels.d.ts +40 -0
  30. package/dist/core/renderCoordinator/render/renderAxisLabels.d.ts.map +1 -0
  31. package/dist/core/renderCoordinator/render/renderOverlays.d.ts +70 -0
  32. package/dist/core/renderCoordinator/render/renderOverlays.d.ts.map +1 -0
  33. package/dist/core/renderCoordinator/render/renderSeries.d.ts +146 -0
  34. package/dist/core/renderCoordinator/render/renderSeries.d.ts.map +1 -0
  35. package/dist/core/renderCoordinator/renderers/rendererPool.d.ts +112 -0
  36. package/dist/core/renderCoordinator/renderers/rendererPool.d.ts.map +1 -0
  37. package/dist/core/renderCoordinator/types.d.ts +19 -0
  38. package/dist/core/renderCoordinator/types.d.ts.map +1 -0
  39. package/dist/core/renderCoordinator/ui/tooltipLegendHelpers.d.ts +104 -0
  40. package/dist/core/renderCoordinator/ui/tooltipLegendHelpers.d.ts.map +1 -0
  41. package/dist/core/renderCoordinator/utils/axisUtils.d.ts +122 -0
  42. package/dist/core/renderCoordinator/utils/axisUtils.d.ts.map +1 -0
  43. package/dist/core/renderCoordinator/utils/boundsComputation.d.ts +69 -0
  44. package/dist/core/renderCoordinator/utils/boundsComputation.d.ts.map +1 -0
  45. package/dist/core/renderCoordinator/utils/canvasUtils.d.ts +52 -0
  46. package/dist/core/renderCoordinator/utils/canvasUtils.d.ts.map +1 -0
  47. package/dist/core/renderCoordinator/utils/dataPointUtils.d.ts +71 -0
  48. package/dist/core/renderCoordinator/utils/dataPointUtils.d.ts.map +1 -0
  49. package/dist/core/renderCoordinator/utils/index.d.ts +12 -0
  50. package/dist/core/renderCoordinator/utils/index.d.ts.map +1 -0
  51. package/dist/core/renderCoordinator/utils/timeAxisUtils.d.ts +149 -0
  52. package/dist/core/renderCoordinator/utils/timeAxisUtils.d.ts.map +1 -0
  53. package/dist/core/renderCoordinator/zoom/zoomHelpers.d.ts +129 -0
  54. package/dist/core/renderCoordinator/zoom/zoomHelpers.d.ts.map +1 -0
  55. package/dist/index.d.ts +2 -2
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +5579 -5117
  58. package/dist/index.js.map +1 -1
  59. package/dist/interaction/findNearestPoint.d.ts.map +1 -1
  60. package/dist/interaction/findPieSlice.d.ts.map +1 -1
  61. package/dist/interaction/findPointsAtX.d.ts.map +1 -1
  62. package/dist/renderers/createPieRenderer.d.ts.map +1 -1
  63. package/package.json +4 -2
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Annotation processing for the RenderCoordinator.
3
+ *
4
+ * Processes annotation configurations into GPU-renderable instances (reference lines,
5
+ * markers) and DOM label data. Supports layering (above/below series) and multiple
6
+ * annotation types (lineX, lineY, point, text).
7
+ *
8
+ * @module processAnnotations
9
+ */
10
+ import type { AnnotationConfig } from '../../../config/types';
11
+ import type { LinearScale } from '../../../utils/scales';
12
+ import type { ThemeConfig } from '../../../themes/types';
13
+ import type { ReferenceLineInstance } from '../../../renderers/createReferenceLineRenderer';
14
+ import type { AnnotationMarkerInstance } from '../../../renderers/createAnnotationMarkerRenderer';
15
+ /**
16
+ * Internal type for annotation label data (DOM overlay).
17
+ */
18
+ export interface AnnotationLabelData {
19
+ readonly text: string;
20
+ readonly x: number;
21
+ readonly y: number;
22
+ readonly anchor?: 'start' | 'middle' | 'end';
23
+ readonly color?: string;
24
+ readonly fontSize?: number;
25
+ readonly background?: Readonly<{
26
+ readonly backgroundColor: string;
27
+ readonly padding?: readonly [number, number, number, number];
28
+ readonly borderRadius?: number;
29
+ }>;
30
+ }
31
+ /**
32
+ * Plot bounds in CSS pixels.
33
+ */
34
+ export interface PlotBounds {
35
+ readonly leftCss: number;
36
+ readonly rightCss: number;
37
+ readonly topCss: number;
38
+ readonly bottomCss: number;
39
+ readonly widthCss: number;
40
+ readonly heightCss: number;
41
+ }
42
+ /**
43
+ * Context for annotation processing.
44
+ */
45
+ export interface AnnotationContext {
46
+ readonly annotations: ReadonlyArray<AnnotationConfig>;
47
+ readonly xScale: LinearScale;
48
+ readonly yScale: LinearScale;
49
+ readonly plotBounds: PlotBounds;
50
+ readonly canvasCssWidth: number;
51
+ readonly canvasCssHeight: number;
52
+ readonly theme: ThemeConfig;
53
+ readonly offsetX?: number;
54
+ readonly offsetY?: number;
55
+ }
56
+ /**
57
+ * Result of annotation processing.
58
+ */
59
+ export interface AnnotationResult {
60
+ readonly linesBelow: ReferenceLineInstance[];
61
+ readonly linesAbove: ReferenceLineInstance[];
62
+ readonly markersBelow: AnnotationMarkerInstance[];
63
+ readonly markersAbove: AnnotationMarkerInstance[];
64
+ readonly labels: AnnotationLabelData[];
65
+ }
66
+ /**
67
+ * Processes annotations into GPU-renderable instances and DOM labels.
68
+ *
69
+ * **Annotation Types:**
70
+ * - `lineX`: Vertical reference line at x coordinate
71
+ * - `lineY`: Horizontal reference line at y coordinate
72
+ * - `point`: Marker at (x, y) coordinate
73
+ * - `text`: Text annotation with flexible positioning
74
+ *
75
+ * **Layering:**
76
+ * - `belowSeries`: Rendered before series (occluded by data)
77
+ * - `aboveSeries`: Rendered after series (always visible, default)
78
+ *
79
+ * **Labels:**
80
+ * - Optional text labels for all annotation types
81
+ * - Template support with {x}, {y}, {value}, {name} placeholders
82
+ * - Background styling with padding and border radius
83
+ *
84
+ * @param context - Annotation processing context
85
+ * @returns Annotation result with lines, markers, and labels
86
+ */
87
+ export declare function processAnnotations(context: AnnotationContext): AnnotationResult;
88
+ //# sourceMappingURL=processAnnotations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processAnnotations.d.ts","sourceRoot":"","sources":["../../../../src/core/renderCoordinator/annotations/processAnnotations.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AAC5F,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mDAAmD,CAAC;AAMlG;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAC7C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC;QAC7B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;QACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC7D,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;KAChC,CAAC,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IACtD,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,UAAU,EAAE,qBAAqB,EAAE,CAAC;IAC7C,QAAQ,CAAC,UAAU,EAAE,qBAAqB,EAAE,CAAC;IAC7C,QAAQ,CAAC,YAAY,EAAE,wBAAwB,EAAE,CAAC;IAClD,QAAQ,CAAC,YAAY,EAAE,wBAAwB,EAAE,CAAC;IAClD,QAAQ,CAAC,MAAM,EAAE,mBAAmB,EAAE,CAAC;CACxC;AA8FD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,CAoP/E"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Axis label positioning and layout helpers.
3
+ *
4
+ * Provides pure functions for calculating axis label positions, anchor points,
5
+ * and title placements without DOM manipulation. These helpers are used by the
6
+ * render coordinator to position axis labels and titles correctly.
7
+ *
8
+ * @module axisLabelHelpers
9
+ */
10
+ import type { TextOverlayAnchor } from '../../../components/createTextOverlay';
11
+ /**
12
+ * Default label padding in CSS pixels.
13
+ */
14
+ export declare const LABEL_PADDING_CSS_PX = 4;
15
+ /**
16
+ * Calculates the anchor point for an x-axis tick label.
17
+ *
18
+ * - Single tick: centered
19
+ * - First tick: left-aligned (start)
20
+ * - Last tick: right-aligned (end)
21
+ * - Middle ticks: centered (middle)
22
+ *
23
+ * @param tickIndex - Index of the current tick
24
+ * @param totalTicks - Total number of ticks
25
+ * @returns Text anchor for label positioning
26
+ */
27
+ export declare function getXAxisTickLabelAnchor(tickIndex: number, totalTicks: number): TextOverlayAnchor;
28
+ /**
29
+ * Calculates the Y position for x-axis labels.
30
+ *
31
+ * X-axis labels are positioned below the plot area, with spacing for tick marks.
32
+ *
33
+ * @param plotBottomCss - Bottom edge of plot area in CSS pixels
34
+ * @param tickLengthCssPx - Length of tick marks
35
+ * @param fontSize - Font size for labels
36
+ * @returns Y position in CSS pixels (canvas-local)
37
+ */
38
+ export declare function getXAxisLabelY(plotBottomCss: number, tickLengthCssPx: number, fontSize: number): number;
39
+ /**
40
+ * Calculates the X position for y-axis labels.
41
+ *
42
+ * Y-axis labels are positioned to the left of the plot area, with spacing for tick marks.
43
+ *
44
+ * @param plotLeftCss - Left edge of plot area in CSS pixels
45
+ * @param tickLengthCssPx - Length of tick marks
46
+ * @returns X position in CSS pixels (canvas-local)
47
+ */
48
+ export declare function getYAxisLabelX(plotLeftCss: number, tickLengthCssPx: number): number;
49
+ /**
50
+ * Calculates the Y position for the x-axis title.
51
+ *
52
+ * The title is centered vertically between the tick labels and the bottom edge
53
+ * (or zoom slider if present).
54
+ *
55
+ * @param xLabelY - Y position of x-axis tick labels
56
+ * @param fontSize - Font size for tick labels
57
+ * @param canvasCssHeight - Canvas height in CSS pixels
58
+ * @param hasSliderZoom - Whether a slider zoom control is present
59
+ * @param sliderHeightCssPx - Height of slider zoom control (default: 32)
60
+ * @returns Y position for x-axis title in CSS pixels
61
+ */
62
+ export declare function getXAxisTitleY(xLabelY: number, fontSize: number, canvasCssHeight: number, hasSliderZoom: boolean, sliderHeightCssPx?: number): number;
63
+ /**
64
+ * Calculates the X position for the y-axis title.
65
+ *
66
+ * The title is positioned to the left of the tick labels, accounting for their width.
67
+ *
68
+ * @param yLabelX - X position of y-axis tick labels
69
+ * @param maxTickLabelWidth - Maximum width of tick labels in CSS pixels
70
+ * @param titleFontSize - Font size for axis title
71
+ * @returns X position for y-axis title in CSS pixels
72
+ */
73
+ export declare function getYAxisTitleX(yLabelX: number, maxTickLabelWidth: number, titleFontSize: number): number;
74
+ /**
75
+ * Measures the maximum width of a set of rendered labels.
76
+ *
77
+ * @param labelSpans - Array of HTMLSpanElement labels
78
+ * @returns Maximum width in CSS pixels, or 0 if no labels
79
+ */
80
+ export declare function measureMaxLabelWidth(labelSpans: readonly HTMLSpanElement[]): number;
81
+ /**
82
+ * Calculates the center position between two coordinates.
83
+ *
84
+ * Utility for centering axis titles within plot area.
85
+ *
86
+ * @param a - First coordinate
87
+ * @param b - Second coordinate
88
+ * @returns Midpoint between a and b
89
+ */
90
+ export declare function getCenterPosition(a: number, b: number): number;
91
+ //# sourceMappingURL=axisLabelHelpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"axisLabelHelpers.d.ts","sourceRoot":"","sources":["../../../../src/core/renderCoordinator/axis/axisLabelHelpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,iBAAiB,CAKhG;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEvG;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,CAEnF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,EACvB,aAAa,EAAE,OAAO,EACtB,iBAAiB,GAAE,MAAW,GAC7B,MAAM,CAUR;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAGxG;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,SAAS,eAAe,EAAE,GAAG,MAAM,CAGnF;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE9D"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Axis tick computation and formatting.
3
+ *
4
+ * Generates tick values and formatting for linear axes. Handles decimal precision
5
+ * determination based on tick step size and provides number formatting utilities.
6
+ *
7
+ * @module computeAxisTicks
8
+ */
9
+ /**
10
+ * Generates evenly-spaced tick values between domain min and max.
11
+ *
12
+ * @param domainMin - Minimum value of the domain
13
+ * @param domainMax - Maximum value of the domain
14
+ * @param tickCount - Number of ticks to generate (must be >= 1)
15
+ * @returns Array of tick values
16
+ */
17
+ export declare function generateLinearTicks(domainMin: number, domainMax: number, tickCount: number): number[];
18
+ /**
19
+ * Computes the maximum number of decimal places needed to display a tick step cleanly.
20
+ *
21
+ * Prefers "clean" decimal representations (e.g., 2.5, 0.25, 0.125) without relying on
22
+ * magnitude alone. Accepts floating-point noise and caps the search to keep formatting
23
+ * reasonable.
24
+ *
25
+ * @param tickStep - The step size between ticks
26
+ * @param cap - Maximum number of decimal places to consider (default: 8)
27
+ * @returns Number of decimal places (0 to cap)
28
+ */
29
+ export declare function computeMaxFractionDigitsFromStep(tickStep: number, cap?: number): number;
30
+ /**
31
+ * Creates an Intl.NumberFormat for tick value formatting.
32
+ *
33
+ * Automatically determines the appropriate number of decimal places based on the
34
+ * tick step size using `computeMaxFractionDigitsFromStep()`.
35
+ *
36
+ * @param tickStep - The step size between ticks
37
+ * @returns Intl.NumberFormat configured for tick formatting
38
+ */
39
+ export declare function createTickFormatter(tickStep: number): Intl.NumberFormat;
40
+ /**
41
+ * Formats a numeric tick value using the provided number formatter.
42
+ *
43
+ * Handles edge cases:
44
+ * - Non-finite values return null
45
+ * - Values near zero (< 1e-12) are normalized to 0 to avoid "-0" display
46
+ * - Unexpected "NaN" output from formatter is guarded against
47
+ *
48
+ * @param nf - Intl.NumberFormat to use for formatting
49
+ * @param v - Numeric value to format
50
+ * @returns Formatted string or null if value cannot be formatted
51
+ */
52
+ export declare function formatTickValue(nf: Intl.NumberFormat, v: number): string | null;
53
+ //# sourceMappingURL=computeAxisTicks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeAxisTicks.d.ts","sourceRoot":"","sources":["../../../../src/core/renderCoordinator/axis/computeAxisTicks.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CASrG;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gCAAgC,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,GAAE,MAAyC,GAAG,MAAM,CAiBzH;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC,YAAY,CAGvE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO/E"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Visible Slice Computation Utilities
3
+ *
4
+ * Provides efficient data slicing for zoom operations using binary search
5
+ * when data is monotonic, with fallback to linear filtering.
6
+ *
7
+ * Key features:
8
+ * - Binary search slicing for O(log n) performance on sorted data
9
+ * - WeakMap caching of monotonicity checks to avoid O(n) scans
10
+ * - Separate implementations for cartesian (x-based) and OHLC (timestamp-based) data
11
+ * - Support for both tuple and object data formats
12
+ */
13
+ import type { DataPoint, DataPointTuple, OHLCDataPoint, OHLCDataPointTuple } from '../../../config/types';
14
+ type TuplePoint = DataPointTuple;
15
+ export declare function isTuplePoint(p: DataPoint): p is TuplePoint;
16
+ export declare function isTupleDataArray(data: ReadonlyArray<DataPoint>): data is ReadonlyArray<TuplePoint>;
17
+ export declare function isTupleOHLCDataPoint(p: OHLCDataPoint): p is OHLCDataPointTuple;
18
+ /**
19
+ * Checks if cartesian data is monotonic non-decreasing by X coordinate with all finite values.
20
+ * Results are cached in a WeakMap to avoid repeated O(n) scans.
21
+ */
22
+ export declare function isMonotonicNonDecreasingFiniteX(data: ReadonlyArray<DataPoint>, isTuple: boolean): boolean;
23
+ /**
24
+ * Checks if OHLC data is monotonic non-decreasing by timestamp with all finite values.
25
+ * Results are cached in a WeakMap to avoid repeated O(n) scans.
26
+ */
27
+ export declare function isMonotonicNonDecreasingFiniteTimestamp(data: ReadonlyArray<OHLCDataPoint>): boolean;
28
+ /**
29
+ * Slices cartesian data to the visible X range [xMin, xMax].
30
+ *
31
+ * Uses binary search (O(log n)) when data is monotonic by X;
32
+ * otherwise falls back to linear filtering (O(n)).
33
+ *
34
+ * @param data - Cartesian data points (tuple or object format)
35
+ * @param xMin - Minimum X value (inclusive)
36
+ * @param xMax - Maximum X value (inclusive)
37
+ * @returns Sliced data array containing only points within [xMin, xMax]
38
+ */
39
+ export declare function sliceVisibleRangeByX(data: ReadonlyArray<DataPoint>, xMin: number, xMax: number): ReadonlyArray<DataPoint>;
40
+ /**
41
+ * Finds the index range of visible points in cartesian data.
42
+ *
43
+ * Returns { start, end } indices suitable for slicing or iteration.
44
+ * Only works correctly when data is monotonic; returns full range otherwise.
45
+ *
46
+ * @param data - Cartesian data points (tuple or object format)
47
+ * @param xMin - Minimum X value (inclusive)
48
+ * @param xMax - Maximum X value (inclusive)
49
+ * @returns Index range { start, end } for visible data
50
+ */
51
+ export declare function findVisibleRangeIndicesByX(data: ReadonlyArray<DataPoint>, xMin: number, xMax: number): {
52
+ readonly start: number;
53
+ readonly end: number;
54
+ };
55
+ /**
56
+ * Slices OHLC/candlestick data to the visible timestamp range [xMin, xMax].
57
+ *
58
+ * Uses binary search (O(log n)) when timestamps are monotonic;
59
+ * otherwise falls back to linear filtering (O(n)).
60
+ *
61
+ * @param data - OHLC data points (tuple or object format)
62
+ * @param xMin - Minimum timestamp (inclusive)
63
+ * @param xMax - Maximum timestamp (inclusive)
64
+ * @returns Sliced data array containing only points within [xMin, xMax]
65
+ */
66
+ export declare function sliceVisibleRangeByOHLC(data: ReadonlyArray<OHLCDataPoint>, xMin: number, xMax: number): ReadonlyArray<OHLCDataPoint>;
67
+ export {};
68
+ //# sourceMappingURL=computeVisibleSlice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeVisibleSlice.d.ts","sourceRoot":"","sources":["../../../../src/core/renderCoordinator/data/computeVisibleSlice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACV,SAAS,EACT,cAAc,EACd,aAAa,EACb,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAK/B,KAAK,UAAU,GAAG,cAAc,CAAC;AAKjC,wBAAgB,YAAY,CAAC,CAAC,EAAE,SAAS,GAAG,CAAC,IAAI,UAAU,CAE1D;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,GAAG,IAAI,IAAI,aAAa,CAAC,UAAU,CAAC,CAElG;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,aAAa,GAAG,CAAC,IAAI,kBAAkB,CAE9E;AAMD;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAuCzG;AAED;;;GAGG;AACH,wBAAgB,uCAAuC,CAAC,IAAI,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,OAAO,CAqBnG;AAoGD;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,EAC9B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,aAAa,CAAC,SAAS,CAAC,CA8B1B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,EAC9B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAuBlD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,aAAa,CAAC,aAAa,CAAC,EAClC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,aAAa,CAAC,aAAa,CAAC,CA8B9B"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * GPU texture management for the RenderCoordinator.
3
+ *
4
+ * Handles lazy allocation of render target textures and MSAA overlay management.
5
+ * Uses a multi-pass rendering strategy:
6
+ * 1. Main scene → single-sample texture
7
+ * 2. Blit to MSAA target + draw annotations (MSAA overlay pass)
8
+ * 3. Draw UI overlays on resolved swapchain (single-sample)
9
+ *
10
+ * @module textureManager
11
+ */
12
+ /**
13
+ * Texture manager state exposed to the render coordinator.
14
+ */
15
+ export interface TextureManagerState {
16
+ readonly mainColorView: GPUTextureView | null;
17
+ readonly overlayMsaaView: GPUTextureView | null;
18
+ readonly overlayBlitBindGroup: GPUBindGroup | null;
19
+ readonly overlayBlitPipeline: GPURenderPipeline;
20
+ readonly msaaSampleCount: number;
21
+ }
22
+ /**
23
+ * Configuration for texture manager creation.
24
+ */
25
+ export interface TextureManagerConfig {
26
+ readonly device: GPUDevice;
27
+ readonly targetFormat: GPUTextureFormat;
28
+ }
29
+ /**
30
+ * Texture manager interface returned by factory function.
31
+ */
32
+ export interface TextureManager {
33
+ /**
34
+ * Ensures textures are allocated for the given dimensions.
35
+ * Reallocates if size or format changes.
36
+ *
37
+ * @param width - Canvas width in device pixels
38
+ * @param height - Canvas height in device pixels
39
+ */
40
+ ensureTextures(width: number, height: number): void;
41
+ /**
42
+ * Gets current texture manager state for rendering.
43
+ *
44
+ * @returns Current state with texture views and bind groups
45
+ */
46
+ getState(): TextureManagerState;
47
+ /**
48
+ * Disposes all GPU resources.
49
+ * Textures, views, and bind groups are destroyed.
50
+ */
51
+ dispose(): void;
52
+ }
53
+ /**
54
+ * Creates a texture manager for render target allocation and management.
55
+ *
56
+ * The texture manager uses lazy allocation: textures are only created when
57
+ * first requested via ensureTextures(), and are reallocated if dimensions
58
+ * or format change.
59
+ *
60
+ * **Architecture:**
61
+ * - Main color texture: Single-sample render target for main scene
62
+ * - Overlay MSAA texture: Multi-sample render target for annotations
63
+ * - Blit pipeline: Copies main color to MSAA target for overlay pass
64
+ *
65
+ * @param config - Configuration with device and target format
66
+ * @returns Texture manager instance
67
+ */
68
+ export declare function createTextureManager(config: TextureManagerConfig): TextureManager;
69
+ //# sourceMappingURL=textureManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textureManager.d.ts","sourceRoot":"","sources":["../../../../src/core/renderCoordinator/gpu/textureManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAuCH;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,aAAa,EAAE,cAAc,GAAG,IAAI,CAAC;IAC9C,QAAQ,CAAC,eAAe,EAAE,cAAc,GAAG,IAAI,CAAC;IAChD,QAAQ,CAAC,oBAAoB,EAAE,YAAY,GAAG,IAAI,CAAC;IACnD,QAAQ,CAAC,mBAAmB,EAAE,iBAAiB,CAAC;IAChD,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAgBD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,gBAAgB,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;OAMG;IACH,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpD;;;;OAIG;IACH,QAAQ,IAAI,mBAAmB,CAAC;IAEhC;;;OAGG;IACH,OAAO,IAAI,IAAI,CAAC;CACjB;AAiBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,GAAG,cAAc,CA+HjF"}
@@ -0,0 +1,160 @@
1
+ /**
2
+ * Interaction helper utilities for pointer tracking and interaction X management.
3
+ *
4
+ * Provides pure functions for transforming pointer states, managing interaction X
5
+ * in domain coordinates, and computing effective pointer positions for crosshair
6
+ * and tooltip rendering.
7
+ *
8
+ * @module interactionHelpers
9
+ */
10
+ import type { LinearScale } from '../../../utils/scales';
11
+ /**
12
+ * Source of pointer events - either real mouse input or externally synchronized.
13
+ */
14
+ export type PointerSource = 'mouse' | 'sync';
15
+ /**
16
+ * Pointer state tracking both canvas-local CSS pixels and plot-relative grid coordinates.
17
+ */
18
+ export interface PointerState {
19
+ /** Source of the pointer event */
20
+ readonly source: PointerSource;
21
+ /** X position in canvas-local CSS pixels */
22
+ readonly x: number;
23
+ /** Y position in canvas-local CSS pixels */
24
+ readonly y: number;
25
+ /** X position in plot-relative grid CSS pixels */
26
+ readonly gridX: number;
27
+ /** Y position in plot-relative grid CSS pixels */
28
+ readonly gridY: number;
29
+ /** Whether the pointer is inside the plot grid */
30
+ readonly isInGrid: boolean;
31
+ /** Whether a pointer event has occurred */
32
+ readonly hasPointer: boolean;
33
+ }
34
+ /**
35
+ * Interaction scales for coordinate transformations between domain and grid space.
36
+ */
37
+ export interface InteractionScales {
38
+ readonly xScale: LinearScale;
39
+ readonly yScale: LinearScale;
40
+ readonly plotWidthCss: number;
41
+ readonly plotHeightCss: number;
42
+ }
43
+ /**
44
+ * Grid area boundaries in CSS pixels.
45
+ */
46
+ export interface GridArea {
47
+ readonly left: number;
48
+ readonly top: number;
49
+ readonly width: number;
50
+ readonly height: number;
51
+ }
52
+ /**
53
+ * Creates an initial empty pointer state.
54
+ *
55
+ * @returns Pointer state with no active pointer
56
+ */
57
+ export declare function createPointerState(): PointerState;
58
+ /**
59
+ * Updates pointer state from mouse move event payload.
60
+ *
61
+ * @param x - Canvas-local CSS pixel X
62
+ * @param y - Canvas-local CSS pixel Y
63
+ * @param gridX - Plot-relative grid CSS pixel X
64
+ * @param gridY - Plot-relative grid CSS pixel Y
65
+ * @param isInGrid - Whether pointer is inside plot grid
66
+ * @returns Updated pointer state with source 'mouse'
67
+ */
68
+ export declare function updatePointerFromMouse(x: number, y: number, gridX: number, gridY: number, isInGrid: boolean): PointerState;
69
+ /**
70
+ * Clears pointer state when mouse leaves canvas.
71
+ *
72
+ * Preserves source and coordinates but marks as not active.
73
+ *
74
+ * @param prevState - Previous pointer state
75
+ * @returns Updated pointer state with hasPointer=false
76
+ */
77
+ export declare function clearPointer(prevState: PointerState): PointerState;
78
+ /**
79
+ * Converts domain X coordinate to grid CSS pixel coordinate.
80
+ *
81
+ * @param interactionX - X coordinate in domain units
82
+ * @param xScale - Linear scale for X axis
83
+ * @returns Grid X in CSS pixels, or null if conversion fails
84
+ */
85
+ export declare function domainToGridX(interactionX: number, xScale: LinearScale): number | null;
86
+ /**
87
+ * Converts grid CSS pixel coordinate to domain X coordinate.
88
+ *
89
+ * @param gridX - X coordinate in grid CSS pixels
90
+ * @param xScale - Linear scale for X axis
91
+ * @returns Domain X, or null if conversion fails
92
+ */
93
+ export declare function gridToDomainX(gridX: number, xScale: LinearScale): number | null;
94
+ /**
95
+ * Computes effective pointer state for sync mode.
96
+ *
97
+ * When interaction is driven by external synchronization (not mouse), derives
98
+ * a synthetic pointer position from the interaction X in domain units. Y is
99
+ * arbitrary (midpoint) since sync mode only tracks X.
100
+ *
101
+ * Returns null if interactionX is null or coordinate conversion fails.
102
+ *
103
+ * @param interactionX - X coordinate in domain units (or null if inactive)
104
+ * @param scales - Interaction scales for coordinate transformations
105
+ * @param gridArea - Grid area boundaries for canvas-local coordinate calculation
106
+ * @returns Effective pointer state, or null if sync mode is inactive
107
+ */
108
+ export declare function computeSyncPointer(interactionX: number | null, scales: InteractionScales, gridArea: GridArea): PointerState | null;
109
+ /**
110
+ * Resolves effective pointer state based on source mode.
111
+ *
112
+ * - Mouse mode: use the provided pointer state as-is
113
+ * - Sync mode: compute synthetic pointer from interaction X
114
+ *
115
+ * This enables unified rendering logic for both mouse-driven and externally
116
+ * synchronized interactions (e.g., chart sync).
117
+ *
118
+ * @param pointerState - Current pointer state
119
+ * @param interactionX - X coordinate in domain units (for sync mode)
120
+ * @param scales - Interaction scales for coordinate transformations
121
+ * @param gridArea - Grid area boundaries
122
+ * @returns Effective pointer state for rendering
123
+ */
124
+ export declare function computeEffectivePointer(pointerState: PointerState, interactionX: number | null, scales: InteractionScales | null, gridArea: GridArea): PointerState;
125
+ /**
126
+ * Normalizes interaction X value.
127
+ *
128
+ * Returns null for null, NaN, or Infinity values. This ensures consistent
129
+ * null-checking throughout the interaction system.
130
+ *
131
+ * @param x - Interaction X value to normalize
132
+ * @returns Normalized value or null
133
+ */
134
+ export declare function normalizeInteractionX(x: number | null): number | null;
135
+ /**
136
+ * Creates a listener management system for interaction X changes.
137
+ *
138
+ * Returns utilities for adding, removing, and notifying listeners.
139
+ *
140
+ * @returns Listener management utilities
141
+ */
142
+ export declare function createInteractionXListeners(): {
143
+ add: (callback: (x: number | null, source?: unknown) => void) => void;
144
+ remove: (callback: (x: number | null, source?: unknown) => void) => void;
145
+ emit: (x: number | null, source?: unknown) => void;
146
+ clear: () => void;
147
+ };
148
+ /**
149
+ * Determines if interaction X should be updated based on value equality.
150
+ *
151
+ * Prevents redundant updates when the value and source haven't changed.
152
+ *
153
+ * @param current - Current interaction X value
154
+ * @param currentSource - Current source identifier
155
+ * @param next - New interaction X value
156
+ * @param nextSource - New source identifier
157
+ * @returns True if update is needed
158
+ */
159
+ export declare function shouldUpdateInteractionX(current: number | null, currentSource: unknown, next: number | null, nextSource: unknown): boolean;
160
+ //# sourceMappingURL=interactionHelpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactionHelpers.d.ts","sourceRoot":"","sources":["../../../../src/core/renderCoordinator/interaction/interactionHelpers.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Annotation Label Rendering Utilities
3
+ *
4
+ * Generates DOM-based annotation labels for cartesian charts.
5
+ * Handles template rendering, coordinate transformations, and styling
6
+ * for lineX, lineY, point, and text annotations.
7
+ *
8
+ * @module renderAnnotationLabels
9
+ */
10
+ import type { ResolvedChartGPUOptions } from '../../../config/OptionResolver';
11
+ import type { LinearScale } from '../../../utils/scales';
12
+ import type { TextOverlay } from '../../../components/createTextOverlay';
13
+ export interface AnnotationLabelRenderContext {
14
+ currentOptions: ResolvedChartGPUOptions;
15
+ xScale: LinearScale;
16
+ yScale: LinearScale;
17
+ canvasCssWidthForAnnotations: number;
18
+ canvasCssHeightForAnnotations: number;
19
+ plotLeftCss: number;
20
+ plotTopCss: number;
21
+ plotWidthCss: number;
22
+ plotHeightCss: number;
23
+ canvas: HTMLCanvasElement | OffscreenCanvas;
24
+ }
25
+ /**
26
+ * Renders annotation labels to the text overlay.
27
+ *
28
+ * Processes annotations and generates DOM labels with template support,
29
+ * coordinate transformations, and background styling.
30
+ *
31
+ * @param annotationOverlay - Text overlay for rendering labels
32
+ * @param overlayContainer - DOM container for overlay positioning
33
+ * @param context - Rendering context with scales, options, and layout
34
+ */
35
+ export declare function renderAnnotationLabels(annotationOverlay: TextOverlay | null, overlayContainer: HTMLElement | null, context: AnnotationLabelRenderContext): void;
36
+ //# sourceMappingURL=renderAnnotationLabels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderAnnotationLabels.d.ts","sourceRoot":"","sources":["../../../../src/core/renderCoordinator/render/renderAnnotationLabels.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAqB,MAAM,uCAAuC,CAAC;AAK5F,MAAM,WAAW,4BAA4B;IAC3C,cAAc,EAAE,uBAAuB,CAAC;IACxC,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE,WAAW,CAAC;IACpB,4BAA4B,EAAE,MAAM,CAAC;IACrC,6BAA6B,EAAE,MAAM,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,iBAAiB,GAAG,eAAe,CAAC;CAC7C;AAyED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,iBAAiB,EAAE,WAAW,GAAG,IAAI,EACrC,gBAAgB,EAAE,WAAW,GAAG,IAAI,EACpC,OAAO,EAAE,4BAA4B,GACpC,IAAI,CAuMN"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Axis Label Rendering Utilities
3
+ *
4
+ * Generates DOM-based axis labels and titles for cartesian charts.
5
+ * Labels are positioned using canvas-local CSS coordinates and rendered
6
+ * into a text overlay element.
7
+ *
8
+ * @module renderAxisLabels
9
+ */
10
+ import type { ResolvedChartGPUOptions } from '../../../config/OptionResolver';
11
+ import type { LinearScale } from '../../../utils/scales';
12
+ import type { TextOverlay } from '../../../components/createTextOverlay';
13
+ export interface AxisLabelRenderContext {
14
+ gpuContext: {
15
+ canvas: HTMLCanvasElement | OffscreenCanvas | null;
16
+ };
17
+ currentOptions: ResolvedChartGPUOptions;
18
+ xScale: LinearScale;
19
+ yScale: LinearScale;
20
+ xTickValues: ReadonlyArray<number>;
21
+ plotClipRect: {
22
+ left: number;
23
+ right: number;
24
+ top: number;
25
+ bottom: number;
26
+ };
27
+ visibleXRangeMs: number;
28
+ }
29
+ /**
30
+ * Renders axis labels and titles to the text overlay.
31
+ *
32
+ * Generates X and Y axis tick labels with appropriate formatting,
33
+ * and renders axis titles if configured.
34
+ *
35
+ * @param axisLabelOverlay - Text overlay for rendering labels
36
+ * @param overlayContainer - DOM container for overlay positioning
37
+ * @param context - Rendering context with scales, options, and layout
38
+ */
39
+ export declare function renderAxisLabels(axisLabelOverlay: TextOverlay | null, overlayContainer: HTMLElement | null, context: AxisLabelRenderContext): void;
40
+ //# sourceMappingURL=renderAxisLabels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderAxisLabels.d.ts","sourceRoot":"","sources":["../../../../src/core/renderCoordinator/render/renderAxisLabels.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAqB,MAAM,uCAAuC,CAAC;AAW5F,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE;QACV,MAAM,EAAE,iBAAiB,GAAG,eAAe,GAAG,IAAI,CAAC;KACpD,CAAC;IACF,cAAc,EAAE,uBAAuB,CAAC;IACxC,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE,WAAW,CAAC;IACpB,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACnC,YAAY,EAAE;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,eAAe,EAAE,MAAM,CAAC;CACzB;AAiBD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,gBAAgB,EAAE,WAAW,GAAG,IAAI,EACpC,gBAAgB,EAAE,WAAW,GAAG,IAAI,EACpC,OAAO,EAAE,sBAAsB,GAC9B,IAAI,CA6HN"}