@oicl/openbridge-webcomponents 2.0.0-next.55 → 2.0.0-next.57

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 (29) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +395 -123
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +326 -2
  4. package/dist/automation/automation-tank/automation-tank.d.ts +11 -0
  5. package/dist/automation/automation-tank/automation-tank.d.ts.map +1 -1
  6. package/dist/automation/automation-tank/automation-tank.js.map +1 -1
  7. package/dist/navigation-instruments/compass-sector/compass-sector.css.js +12 -0
  8. package/dist/navigation-instruments/compass-sector/compass-sector.css.js.map +1 -1
  9. package/dist/navigation-instruments/compass-sector/compass-sector.d.ts +23 -0
  10. package/dist/navigation-instruments/compass-sector/compass-sector.d.ts.map +1 -1
  11. package/dist/navigation-instruments/compass-sector/compass-sector.js +47 -0
  12. package/dist/navigation-instruments/compass-sector/compass-sector.js.map +1 -1
  13. package/dist/navigation-instruments/pitch/pitch.d.ts +37 -0
  14. package/dist/navigation-instruments/pitch/pitch.d.ts.map +1 -1
  15. package/dist/navigation-instruments/pitch/pitch.js +130 -62
  16. package/dist/navigation-instruments/pitch/pitch.js.map +1 -1
  17. package/dist/navigation-instruments/pitch-roll/pitch-roll.d.ts +7 -0
  18. package/dist/navigation-instruments/pitch-roll/pitch-roll.d.ts.map +1 -1
  19. package/dist/navigation-instruments/pitch-roll/pitch-roll.js +58 -2
  20. package/dist/navigation-instruments/pitch-roll/pitch-roll.js.map +1 -1
  21. package/dist/navigation-instruments/roll/roll.d.ts +37 -0
  22. package/dist/navigation-instruments/roll/roll.d.ts.map +1 -1
  23. package/dist/navigation-instruments/roll/roll.js +119 -63
  24. package/dist/navigation-instruments/roll/roll.js.map +1 -1
  25. package/dist/navigation-instruments/rot-sector/rot-sector.d.ts +15 -0
  26. package/dist/navigation-instruments/rot-sector/rot-sector.d.ts.map +1 -1
  27. package/dist/navigation-instruments/rot-sector/rot-sector.js +53 -1
  28. package/dist/navigation-instruments/rot-sector/rot-sector.js.map +1 -1
  29. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"automation-tank.js","sources":["../../../src/automation/automation-tank/automation-tank.ts"],"sourcesContent":["import {\n HTMLTemplateResult,\n LitElement,\n html,\n nothing,\n svg,\n unsafeCSS,\n} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport compentStyle from './automation-tank.css?inline';\nimport {LineMedium} from '../index.js';\nimport '../automation-badge/automation-badge.js';\nimport {ObcAutomationBadgeType} from '../automation-badge/automation-badge.js';\nimport {\n AutomationButtonBadgeAlert,\n AutomationButtonBadgeCommandLocked,\n AutomationButtonBadgeControl,\n AutomationButtonBadgeInterlock,\n} from '../automation-button/abstract-automation-button.js';\n\nimport '../../icons/icon-chevron-double-up-google.js';\nimport '../../icons/icon-chevron-up-google.js';\nimport '../../icons/icon-chevron-double-down-google.js';\nimport '../../icons/icon-chevron-down-google.js';\nimport '../../icons/icon-off.js';\nimport '../../icons/icon-tank.js';\nimport '../../icons/icon-energy-battery.js';\nimport '../../navigation-instruments/gauge-trend/gauge-trend.js';\nimport '../../building-blocks/bar-vertical/bar-vertical.js';\nimport '../../components/alert-frame/alert-frame.js';\nimport {Priority} from '../../navigation-instruments/types.js';\nimport {\n ObcAlertFrameStatus,\n ObcAlertFrameThickness,\n ObcAlertFrameType,\n} from '../../components/alert-frame/alert-frame.js';\nimport type {ChartLineDataItem} from '../../building-blocks/chart-line/chart-line-base.js';\nimport type {LinearAdvice} from '../../building-blocks/instrument-linear/advice.js';\nimport {\n AdvicePosition,\n ExternalScaleSide,\n FillMode,\n} from '../../building-blocks/external-scale/external-scale.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement} from '../../decorator.js';\n\nexport enum TankTrend {\n fastRising = 'fast-rising',\n rising = 'rising',\n stable = 'stable',\n falling = 'falling',\n fastFalling = 'fast-falling',\n closed = 'closed',\n}\n\nexport enum TankType {\n generic = 'generic',\n atmospheric = 'atmospheric',\n pressurized = 'pressurized',\n battery = 'battery',\n}\n\nexport enum TankOrientation {\n vertical = 'vertical',\n horizontal = 'horizontal',\n}\n\n/**\n * Host positioning model.\n *\n * - `point` (default): the host has fixed default dimensions (per\n * orientation and compact / static variant) and a P&ID anchor — the\n * visual content is shifted with `translateX(-50%)` and (in non-compact)\n * `top: -20px` so the tank's top-center aligns with the host's top-left\n * placement coordinate. Use this when dropping the tank onto a P&ID\n * canvas at a pipe-grid coordinate.\n * - `button`: the host fills its parent container (100% × 100%) with no\n * anchor offset. Use this when embedding the tank inside a sized layout\n * slot — the parent controls the footprint and the tank renders\n * responsively inside it, just like a regular button. Compact / static\n * inner layout still applies; only the host box is changed.\n */\nexport enum TankPositioning {\n point = 'point',\n button = 'button',\n}\n\nexport enum TankChartMode {\n /** Static fill bar driven by `value` / `max` (default, backward compatible). */\n bar = 'bar',\n /** Embedded `obc-gauge-trend` line/area chart, no side bar. */\n graph = 'graph',\n /** Embedded `obc-gauge-trend` line/area chart with a side bar. */\n graphAndBar = 'graph-and-bar',\n}\n\n/**\n * A single detail row rendered in the tank's `readout` rich list (below the\n * main percent / value block, separated by a divider). Each row is rendered\n * as `<label>` on the left and `<value><degree?><percent?><unit>` on the\n * right, all on a single line.\n */\nexport interface TankReadoutItem {\n /** Left-aligned label text (e.g. `Temperature`). */\n label: string;\n /** Numeric value, formatted with the tank's `percentFractionDigits`. */\n value: number;\n /** Append a `°` glyph directly after the value with no gap. */\n hasDegree?: boolean;\n /** Append a `%` glyph directly after the value with no gap. */\n hasPercentage?: boolean;\n /** Unit text (e.g. `C`, `Pa`, `m/s`). Rendered after the value/glyph. */\n unit: string;\n}\n\n/**\n *\n *\n * @ignition-base-height: 173px\n * @ignition-base-width: 168px\n * @ignition-center-horizontal\n */\n@customElement('obc-automation-tank')\nexport class ObcAutomationTank extends LitElement {\n @property({type: String}) medium: LineMedium = LineMedium.water;\n @property({type: Number}) value: number = 0;\n @property({type: Number}) max: number = 100;\n @property({type: String}) trend: TankTrend = TankTrend.stable;\n @property({type: String, reflect: true}) type: TankType = TankType.generic;\n @property({type: String, reflect: true}) orientation: TankOrientation =\n TankOrientation.vertical;\n @property({type: Boolean, reflect: true}) compact: boolean = false;\n /**\n * Host positioning model — see `TankPositioning` for details. Defaults to\n * `point` for backward compatibility (fixed default dimensions + P&ID\n * top-center anchor). Set to `button` to make the host fill its parent\n * container (100% × 100%) with no anchor offset.\n */\n @property({type: String, reflect: true}) positioning: TankPositioning =\n TankPositioning.point;\n /**\n * Static (display-only) variant. Always rendered at the compact size; the\n * inner chart/bar is hidden, the bordered area is filled with\n * `--container-section-color`, and the readout is centered inside the frame.\n * Tag is rendered below the bordered area; badges (when slotted) sit above\n * the frame inside the halo and shrink the frame just like in compact mode.\n * Overrides `compact` (a static tank is always compact-sized).\n *\n * Static tanks render as a non-interactive `<div role=\"img\">` (not a\n * `<button>`), so they are not in the tab order and do not announce as\n * activatable controls.\n */\n @property({type: Boolean, reflect: true}) static: boolean = false;\n @property({type: String}) tag: string = '';\n\n /**\n * Chart cell rendering mode.\n * - `bar`: static fill bar driven by `value`/`max` (default).\n * - `graph`: embedded `obc-gauge-trend` line/area chart.\n * - `graphAndBar`: embedded `obc-gauge-trend` with an integrated side bar.\n */\n @property({type: String, reflect: true, attribute: 'chart-mode'})\n chartMode: TankChartMode = TankChartMode.bar;\n\n /** Time-series data points for the embedded gauge-trend (graph modes only). */\n @property({type: Array, attribute: false})\n chartData: ChartLineDataItem[] = [];\n\n /** Priority hint forwarded to child charts (regular | enhanced). */\n @property({type: String}) priority: Priority = Priority.regular;\n\n /**\n * Advice overlays. Forwarded to the embedded `obc-gauge-trend` in\n * `graph` / `graph-and-bar` modes, or rendered as pills over the static\n * bar in `bar` mode.\n */\n @property({type: Array, attribute: false})\n advice: LinearAdvice[] = [];\n\n /** Show advice overlays (works in all `chartMode` variants). */\n @property({type: Boolean}) hasAdvice = false;\n\n /**\n * Overlay a 32×32 decorative icon (currently `<obi-tank>`) centered on the\n * chart cell. Works in all three `chartMode` variants (bar, graph,\n * graph-and-bar) and in both orientations. The icon is rendered above the\n * bar/graph in a fixed CSS layer (does not scale with the SVG meet\n * transform) and is silhouetted with a `--border-silhouette-color` halo so\n * it stays legible on any underlying fill. The icon size scales with the\n * ambient `obc-component-size-*` class on an ancestor via the design token\n * `--automation-components-tanks-graphs-graph-icon-size` (32 → 48 → 64 → 64\n * for regular → medium → large → xl).\n *\n * TODO(future): replace the hard-coded `<obi-tank>` with a `slot=\"graph-icon\"`\n * so consumers can pass any `<obi-*>` icon. The current API ships the\n * smallest viable surface; the slot can be added without breaking the\n * boolean property.\n */\n @property({type: Boolean, attribute: false}) hasGraphIcon = false;\n\n /**\n * Show an `<obc-alert-frame>` overlay around the bordered tank area (the\n * `.halo` wrapper). Mirrors the API of `obc-automation-button`: same six\n * properties, same three slots (`alert-icon`, `alert-label`, `alert-timer`).\n * The ring overlays `.halo` only, so the tag and readout that sit outside\n * the halo in compact / static layouts remain unaffected.\n */\n @property({type: Boolean}) alert: boolean = false;\n @property({type: String}) alertFrameType: ObcAlertFrameType =\n ObcAlertFrameType.SmallSideFlip;\n @property({type: String}) alertFrameThickness: ObcAlertFrameThickness =\n ObcAlertFrameThickness.Small;\n @property({type: String}) alertFrameStatus: ObcAlertFrameStatus =\n ObcAlertFrameStatus.Alarm;\n @property({type: Boolean, attribute: false}) showAlertCategoryIcon: boolean =\n true;\n @property({type: Boolean}) showAlertIcon: boolean = false;\n\n /**\n * Show the trend chevron / off icon next to the percent readout. Default\n * `true` preserves existing behavior. Set to `false` to hide the trend\n * indicator in both compact and non-compact readouts — useful when the\n * trend is not meaningful for a given tank, or when the consumer wants\n * to keep the readout compact. Has no effect in `static` mode, which\n * renders the tank's capacity (`max` + `unit`) instead of a percent and\n * intentionally omits the trend indicator (a static tank represents\n * \"device present, current state unknown\"). `attribute: false` per the\n * repo's positive-default-true boolean convention.\n */\n @property({type: Boolean, attribute: false}) showTrendSymbol: boolean = true;\n\n /**\n * Number of fraction digits used to format the percent readout in the\n * non-compact (regular) layout. Defaults to `0` (integer percent). The\n * compact layout always renders integer percent to keep its fixed-width\n * footprint stable. The static layout renders capacity (`max` + `unit`)\n * rather than percent, so this property has no effect there — pass a\n * pre-formatted value through the `max-value` slot if fractional\n * precision is needed (see the `WithFractionDigits` story).\n */\n @property({type: Number}) percentFractionDigits: number = 0;\n\n /**\n * Rich detail rows shown below the main percent/value block in the regular\n * (non-compact, non-static) layout, separated by a divider. When empty (the\n * default), nothing is rendered — neither the divider nor the list. In\n * vertical orientation the chart cell shrinks to make room; in horizontal\n * orientation the readout column already has reserved whitespace so the\n * chart is unaffected.\n *\n * Values are formatted using `percentFractionDigits`. Consumers that need\n * full control over the markup can replace the entire fallback by slotting\n * arbitrary content into `slot=\"rich\"` (note: this is a different name from\n * the existing `slot=\"readout\"` which replaces the whole readout block).\n */\n @property({type: Array, attribute: false}) readout: TankReadoutItem[] = [];\n\n /**\n * Enum-driven badges rendered inside the `badges` cell. Mirrors the API\n * introduced for `ObcAbstractAutomationButton` in PR #839 (#829). When set\n * to a non-`None` value, an `<obc-automation-badge>` of the corresponding\n * type is rendered as fallback content for the `badges` slot. Any content\n * the consumer slots into `badges` overrides these defaults, preserving\n * backward compatibility with the existing slot-based API.\n *\n * Render order (left → right): control, alert, interlock, commandLocked —\n * matching the positional convention used by `ObcAbstractAutomationButton`\n * (top-left, top-right, bottom-left, bottom-right) read row-by-row.\n */\n @property({type: String}) badgeControl: AutomationButtonBadgeControl =\n AutomationButtonBadgeControl.None;\n @property({type: String}) badgeAlert: AutomationButtonBadgeAlert =\n AutomationButtonBadgeAlert.None;\n @property({type: String}) badgeInterlock: AutomationButtonBadgeInterlock =\n AutomationButtonBadgeInterlock.None;\n @property({type: String})\n badgeCommandLocked: AutomationButtonBadgeCommandLocked =\n AutomationButtonBadgeCommandLocked.None;\n\n @state() private _cellWidth = 0;\n @state() private _cellHeight = 0;\n /**\n * Tracks whether the `badges` and `tag` slots have assigned content. Used\n * in compact/static mode to collapse empty cells to 0px so the tank-frame\n * can absorb the freed space (per spec: \"if there are no badges it would\n * grow upward; if there are no readout or tags it would grow downward\").\n * Non-compact (regular) layout keeps its grid-based reserved rows.\n */\n @state() private _hasBadges = false;\n @state() private _hasTagSlot = false;\n private _chartResizeObserver?: ResizeObserver;\n private _observedCell?: Element;\n\n private get isCompact(): boolean {\n return this.compact || this.static;\n }\n\n private _badgeAlertType(): ObcAutomationBadgeType | null {\n switch (this.badgeAlert) {\n case AutomationButtonBadgeAlert.Silence:\n return ObcAutomationBadgeType.AlertSilenced;\n case AutomationButtonBadgeAlert.Caution:\n return ObcAutomationBadgeType.Caution;\n case AutomationButtonBadgeAlert.Warning:\n return ObcAutomationBadgeType.Warning;\n case AutomationButtonBadgeAlert.Alarm:\n return ObcAutomationBadgeType.Alarm;\n default:\n return null;\n }\n }\n\n private _badgeControlType(): ObcAutomationBadgeType | null {\n switch (this.badgeControl) {\n case AutomationButtonBadgeControl.Local:\n return ObcAutomationBadgeType.Local;\n case AutomationButtonBadgeControl.LocalOnly:\n return ObcAutomationBadgeType.LocalOnly;\n case AutomationButtonBadgeControl.Manual:\n return ObcAutomationBadgeType.Manual;\n case AutomationButtonBadgeControl.ManualOnly:\n return ObcAutomationBadgeType.ManualOnly;\n case AutomationButtonBadgeControl.Auto:\n return ObcAutomationBadgeType.Auto;\n default:\n return null;\n }\n }\n\n private _badgeInterlockType(): ObcAutomationBadgeType | null {\n switch (this.badgeInterlock) {\n case AutomationButtonBadgeInterlock.Interlock:\n return ObcAutomationBadgeType.Interlock;\n case AutomationButtonBadgeInterlock.InterlockInhibit:\n return ObcAutomationBadgeType.InterlockInhibit;\n default:\n return null;\n }\n }\n\n private _badgeCommandLockedType(): ObcAutomationBadgeType | null {\n if (\n this.badgeCommandLocked ===\n AutomationButtonBadgeCommandLocked.CommandLocked\n ) {\n return ObcAutomationBadgeType.CommandLocked;\n }\n return null;\n }\n\n private get _usesGaugeTrend(): boolean {\n return (\n this.chartMode === TankChartMode.graph ||\n this.chartMode === TankChartMode.graphAndBar\n );\n }\n\n private _onBadgesSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasBadges = slot\n .assignedNodes({flatten: true})\n .some(\n (n) =>\n n.nodeType === Node.ELEMENT_NODE ||\n (n.nodeType === Node.TEXT_NODE && !!n.textContent?.trim())\n );\n }\n\n private _onTagSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasTagSlot = slot\n .assignedNodes({flatten: true})\n .some(\n (n) =>\n n.nodeType === Node.ELEMENT_NODE ||\n (n.nodeType === Node.TEXT_NODE && !!n.textContent?.trim())\n );\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._chartResizeObserver?.disconnect();\n this._chartResizeObserver = undefined;\n this._observedCell = undefined;\n }\n\n protected override updated(\n changed: Map<string | number | symbol, unknown>\n ): void {\n super.updated(changed);\n // No imperative forwarding here — child components receive `priority`\n // via template property bindings (`.priority=${this.priority}`). Rely on\n // their reactive `updated()` logic (e.g. `ObcGaugeTrend._updateBarVerticalProperties()`)\n // to propagate palette changes internally.\n // The chart cell DOM element is recreated when chartMode toggles between\n // bar and graph modes (different class/contents), and may also appear/\n // disappear with static/compact. Re-attach the observer to the current\n // .bar-container instance.\n this._syncChartResizeObserver();\n }\n\n private _syncChartResizeObserver(): void {\n // Observe the bar-container in BOTH bar mode and graph modes — the bar\n // mode now renders an SVG `obc-bar-vertical` / `-horizontal` that needs\n // measured pixel dimensions for its viewBox and barThickness.\n const cell = this.renderRoot.querySelector('.bar-container');\n if (!cell) {\n if (this._chartResizeObserver) {\n this._chartResizeObserver.disconnect();\n this._observedCell = undefined;\n }\n return;\n }\n if (cell === this._observedCell) return;\n\n if (!this._chartResizeObserver) {\n this._chartResizeObserver = new ResizeObserver((entries) => {\n const entry = entries[0];\n if (!entry) return;\n const w = Math.round(entry.contentRect.width);\n const h = Math.round(entry.contentRect.height);\n if (w !== this._cellWidth) this._cellWidth = w;\n if (h !== this._cellHeight) this._cellHeight = h;\n });\n } else {\n this._chartResizeObserver.disconnect();\n }\n this._chartResizeObserver.observe(cell);\n this._observedCell = cell;\n }\n\n trendIcon(): HTMLTemplateResult | typeof nothing {\n if (this.trend === TankTrend.fastRising) {\n return html`<obi-chevron-double-up-google\n class=\"trend-icon\"\n ></obi-chevron-double-up-google>`;\n } else if (this.trend === TankTrend.rising) {\n return html`<obi-chevron-up-google\n class=\"trend-icon\"\n ></obi-chevron-up-google>`;\n } else if (this.trend === TankTrend.fastFalling) {\n return html`<obi-chevron-double-down-google\n class=\"trend-icon\"\n ></obi-chevron-double-down-google>`;\n } else if (this.trend === TankTrend.falling) {\n return html`<obi-chevron-down-google\n class=\"trend-icon\"\n ></obi-chevron-down-google>`;\n } else if (this.trend === TankTrend.closed) {\n return html`<obi-off class=\"trend-icon\"></obi-off>`;\n } else {\n // stable: render no icon\n return nothing;\n }\n }\n\n /**\n * Atmospheric cap, 3-piece (corner-start / stretchable middle arc / corner-end).\n * Each piece draws its own fill (closed) and stroke (open) so adjacent pieces\n * abut without a visible vertical seam line. Coordinates are derived from the\n * Figma 248x14 path; corners stay 12px wide while the middle arc stretches.\n * Position (start vs end) and orientation flipping are handled in CSS.\n *\n * Horizontal orientation reuses the same path data but rotates each piece\n * via an inner `<g transform=\"translate(0 H) rotate(-90)\">`, mapping the\n * source coord (x, y) to (y, H - x). The viewBox is swapped accordingly:\n * corner: 12x14 -> 14x12 (H=12)\n * middle: 224x14 -> 14x224 (H=224)\n * Cap-end (right side in horizontal) is mirrored via CSS scaleX(-1).\n */\n private renderAtmosphericCap(side: 'start' | 'end'): HTMLTemplateResult {\n const isHorizontal = this.orientation === TankOrientation.horizontal;\n\n // Path data. Two variants — regular (14px tall, 12px corners) and compact\n // (10px tall, 7px corners). Curve Y-values are proportionally scaled from\n // the original 18/12-tall Figma reference so the corner curves stay\n // continuous at the new thickness.\n // Horizontal orientation reuses the same vertical path data inside an\n // inner `<g transform=\"translate(0 H) rotate(-90)\">`; the SVG viewBox is\n // swapped accordingly. Cap-end is mirrored via CSS scaleY/scaleX(-1).\n let cornerStartFill: string;\n let cornerStartStroke: string;\n let midFill: string;\n let midStroke: string;\n let cornerEndFill: string;\n let cornerEndStroke: string;\n let cornerW: number;\n let capH: number;\n let midW: number;\n\n if (this.isCompact) {\n cornerW = 7;\n capH = 10;\n midW = 149;\n cornerStartFill =\n 'M 6.374 4.8214 C 6.138 4.8429, 6.005 4.8543, 5.83 4.8771 C 2.937 5.2557, 0.669 7.0957, 0.51 9.1936 C 0.5 9.3214, 0.5 9.4357, 0.5 9.6429 L 0.5 10 L 6.374 10 Z';\n cornerStartStroke =\n 'M 6.374 4.8214 C 6.138 4.8429, 6.005 4.8543, 5.83 4.8771 C 2.937 5.2557, 0.669 7.0957, 0.51 9.1936 C 0.5 9.3214, 0.5 9.4357, 0.5 9.6429 L 0.5 10';\n midFill =\n 'M 0 4.8214 C 10.97 3.8214, 37.83 1.7857, 74.626 1.7857 C 111.42 1.7857, 138.28 3.8214, 149.252 4.8214 L 149.252 10 L 0 10 Z';\n midStroke =\n 'M 0 4.8214 C 10.97 3.8214, 37.83 1.7857, 74.626 1.7857 C 111.42 1.7857, 138.28 3.8214, 149.252 4.8214';\n cornerEndFill =\n 'M 0 4.8214 C 0.236 4.8429, 0.369 4.8543, 0.544 4.8771 C 3.437 5.2557, 5.705 7.0957, 5.864 9.1936 C 5.874 9.3214, 5.874 9.4357, 5.874 9.6429 L 5.874 10 L 0 10 Z';\n cornerEndStroke =\n 'M 0 4.8214 C 0.236 4.8429, 0.369 4.8543, 0.544 4.8771 C 3.437 5.2557, 5.705 7.0957, 5.864 9.1936 C 5.874 9.3214, 5.874 9.4357, 5.874 9.6429 L 5.874 10';\n } else {\n cornerW = 12;\n capH = 14;\n midW = 224;\n cornerStartFill =\n 'M 12 6.5837 C 6.346 6.7737, 5.176 6.8744, 4.168 7.2537 C 2.6445 7.8272, 1.418 8.8983, 0.8613 10.1415 C 0.493 10.9641, 0.5 11.9099, 0.5 13.6111 L 0.5 14 L 12 14 Z';\n // Stroke draws the curve + outer vertical edge only. The seam with\n // `.middle` (y = capH) is painted by a 1px CSS `border-top` on\n // `.tank-frame.type-atmospheric:not(.compact) .middle` so it pixel-\n // snaps identically to the pressurized cap's CSS border. Drawing it\n // as an SVG stroke here would render thinner / blurrier due to\n // sub-pixel anti-aliasing.\n cornerStartStroke =\n 'M 12 6.5837 C 6.346 6.7737, 5.176 6.8744, 4.168 7.2537 C 2.6445 7.8272, 1.418 8.8983, 0.8613 10.1415 C 0.493 10.9641, 0.5 11.9099, 0.5 13.6111 L 0.5 14';\n midFill =\n 'M 0 6.5837 C 16 5.1124, 56 1.9444, 112 1.9444 C 168 1.9444, 208 5.1124, 224 6.5837 L 224 14 L 0 14 Z';\n midStroke =\n 'M 0 6.5837 C 16 5.1124, 56 1.9444, 112 1.9444 C 168 1.9444, 208 5.1124, 224 6.5837';\n cornerEndFill =\n 'M 0 6.5837 C 5.654 6.7737, 6.824 6.8744, 7.832 7.2537 C 9.3555 7.8272, 10.582 8.8983, 11.1387 10.1415 C 11.507 10.9641, 11.5 11.9099, 11.5 13.6111 L 11.5 14 L 0 14 Z';\n cornerEndStroke =\n 'M 0 6.5837 C 5.654 6.7737, 6.824 6.8744, 7.832 7.2537 C 9.3555 7.8272, 10.582 8.8983, 11.1387 10.1415 C 11.507 10.9641, 11.5 11.9099, 11.5 13.6111 L 11.5 14';\n }\n\n if (isHorizontal) {\n // Rotate vertical paths -90deg into a `capH`-wide column. Source coord\n // (x, y) maps to (y, cornerW - x) for corners and (y, midW - x) for mid.\n return html`\n <div class=\"cap cap-atmospheric cap-${side}\">\n <svg\n class=\"cap-corner cap-corner-start\"\n viewBox=\"0 0 ${capH} ${cornerW}\"\n preserveAspectRatio=\"xMidYMax meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <g transform=\"translate(0 ${cornerW}) rotate(-90)\">\n <path class=\"cap-fill\" d=\"${cornerStartFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerStartStroke}\" />\n </g>\n `}\n </svg>\n <svg\n class=\"cap-mid\"\n viewBox=\"0 0 ${capH} ${midW}\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n ${svg`\n <g transform=\"translate(0 ${midW}) rotate(-90)\">\n <path class=\"cap-fill\" d=\"${midFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" vector-effect=\"non-scaling-stroke\" d=\"${midStroke}\" />\n </g>\n `}\n </svg>\n <svg\n class=\"cap-corner cap-corner-end\"\n viewBox=\"0 0 ${capH} ${cornerW}\"\n preserveAspectRatio=\"xMidYMin meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <g transform=\"translate(0 ${cornerW}) rotate(-90)\">\n <path class=\"cap-fill\" d=\"${cornerEndFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerEndStroke}\" />\n </g>\n `}\n </svg>\n </div>\n `;\n }\n\n return html`\n <div class=\"cap cap-atmospheric cap-${side}\">\n <svg\n class=\"cap-corner cap-corner-start\"\n viewBox=\"0 0 ${cornerW} ${capH}\"\n preserveAspectRatio=\"xMaxYMid meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <path class=\"cap-fill\" d=\"${cornerStartFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerStartStroke}\" />\n `}\n </svg>\n <svg\n class=\"cap-mid\"\n viewBox=\"0 0 ${midW} ${capH}\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n ${svg`\n <path class=\"cap-fill\" d=\"${midFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" vector-effect=\"non-scaling-stroke\" d=\"${midStroke}\" />\n `}\n </svg>\n <svg\n class=\"cap-corner cap-corner-end\"\n viewBox=\"0 0 ${cornerW} ${capH}\"\n preserveAspectRatio=\"xMinYMid meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <path class=\"cap-fill\" d=\"${cornerEndFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerEndStroke}\" />\n `}\n </svg>\n </div>\n `;\n }\n\n private renderCap(side: 'start' | 'end'): HTMLTemplateResult | null {\n if (this.type === TankType.generic) return null;\n if (this.type === TankType.battery && side === 'end') return null;\n if (this.type === TankType.atmospheric) {\n return this.renderAtmosphericCap(side);\n }\n if (this.type === TankType.pressurized) {\n return html`<div class=\"cap cap-pressurized cap-${side}\"></div>`;\n }\n // battery, start only\n return html`<div class=\"cap cap-battery cap-${side}\"></div>`;\n }\n\n override render() {\n const safeMax = this.max > 0 ? this.max : 1;\n const percent = Math.max(0, Math.min(100, (this.value / safeMax) * 100));\n const isCompact = this.isCompact;\n\n // In compact/static the `.halo` is a fixed-size column flex container\n // that holds badges + tank-frame + (compact only) readout + tag. To let\n // the tank-frame absorb the freed space when adjacent cells are empty,\n // we collapse the empty cells with the `hidden` attribute (see CSS).\n // In non-compact mode cells live inside the inner `.grid` and always\n // reserve their min-content rows — unchanged from previous behavior.\n const controlBadge = this._badgeControlType();\n const alertBadge = this._badgeAlertType();\n const interlockBadge = this._badgeInterlockType();\n const commandLockedBadge = this._badgeCommandLockedType();\n const hasEnumBadges =\n controlBadge !== null ||\n alertBadge !== null ||\n interlockBadge !== null ||\n commandLockedBadge !== null;\n\n const badgesHidden = isCompact && !this._hasBadges && !hasEnumBadges;\n const tagHidden = isCompact && !this._hasTagSlot && !this.tag;\n\n const badgesCell = html`\n <div class=\"badges\" ?hidden=${badgesHidden}>\n <slot name=\"badges\" @slotchange=${this._onBadgesSlotChange}>\n ${controlBadge\n ? html`<obc-automation-badge\n .type=${controlBadge}\n ></obc-automation-badge>`\n : nothing}\n ${alertBadge\n ? html`<obc-automation-badge\n .type=${alertBadge}\n ></obc-automation-badge>`\n : nothing}\n ${interlockBadge\n ? html`<obc-automation-badge\n .type=${interlockBadge}\n ></obc-automation-badge>`\n : nothing}\n ${commandLockedBadge\n ? html`<obc-automation-badge\n .type=${commandLockedBadge}\n ></obc-automation-badge>`\n : nothing}\n </slot>\n </div>\n `;\n const tagCell = html`\n <div class=\"tag\" ?hidden=${tagHidden}>\n <slot name=\"tag\" @slotchange=${this._onTagSlotChange}>${this.tag}</slot>\n </div>\n `;\n // Static mode intentionally renders the tank's capacity (max + unit)\n // instead of a percent reading: a static tank represents \"device is\n // present, current state unknown\", so a percent value would be\n // misleading. The trend icon is omitted for the same reason. Consumers\n // who need a custom label can still override the whole cell via the\n // `readout` slot, or supply formatted text through the existing\n // `max-value` / `unit` slots (no new API).\n const readoutCell = this.static\n ? html`\n <div class=\"readout readout-compact readout-static\">\n <slot name=\"readout\">\n <slot name=\"max-value\">${this.max.toFixed(0)}</slot>\n <slot name=\"unit\">m<sup>3</sup></slot>\n </slot>\n </div>\n `\n : isCompact\n ? html`\n <div class=\"readout readout-compact\">\n <slot name=\"readout\">\n ${this.showTrendSymbol ? this.trendIcon() : null}\n <span class=\"percent\"\n >${percent.toFixed(0)}<span class=\"percent-symbol\"\n >%</span\n ></span\n >\n </slot>\n </div>\n `\n : html`\n <div class=\"readout\">\n <slot name=\"readout\">\n <div class=\"header\">\n ${this.showTrendSymbol ? this.trendIcon() : null}\n <div class=\"percent\">\n ${percent.toFixed(this.percentFractionDigits)}<span\n class=\"percent-symbol\"\n >%</span\n >\n </div>\n </div>\n <div class=\"value\">\n <div class=\"current\">\n <slot name=\"current-value\" class=\"current-value\"\n >${this.value.toFixed(0)}</slot\n ><span class=\"divider\">/</span>\n </div>\n <div class=\"max\">\n <slot class=\"max-value\" name=\"max-value\"\n >${this.max.toFixed(0)}</slot\n >\n <slot class=\"unit\" name=\"unit\">m<sup>3</sup></slot>\n </div>\n </div>\n <slot name=\"rich\">\n ${this.readout.length > 0\n ? html`\n <div class=\"rich-divider\"></div>\n <div class=\"rich\">\n ${this.readout.map(\n (row) => html`\n <div class=\"rich-row\">\n <span class=\"rich-label\">${row.label}</span>\n <span class=\"rich-value\"\n >${row.value.toFixed(\n this.percentFractionDigits\n )}</span\n >\n <span class=\"rich-suffix\"\n >${row.hasDegree\n ? html`<span class=\"rich-glyph\">°</span>`\n : nothing}${row.hasPercentage\n ? html`<span class=\"rich-glyph\">%</span>`\n : nothing}<span class=\"rich-unit\"\n >${row.unit}</span\n ></span\n >\n </div>\n `\n )}\n </div>\n `\n : nothing}\n </slot>\n </slot>\n </div>\n `;\n // Decorative icon overlay (centered on the chart cell). Two stacked\n // icon elements: the back layer paints an inherited SVG `stroke` halo\n // (the icon's paths use `fill=\"currentColor\"`, and SVG `stroke` is\n // inherited across the icon's shadow DOM); the front layer paints the\n // colored fill via the `color` property. This mirrors the established\n // silhouette pattern used by `obc-automation-button` (back-layer slot\n // with stroke, front-layer slot with fill).\n //\n // The icon variant follows `type`: battery tanks show an energy-battery\n // icon, all other types show the generic tank icon.\n const graphIconClasses = classMap({\n 'graph-icon': true,\n 'priority-enhanced': this.priority === Priority.enhanced,\n });\n const graphIconOverlay =\n this.type === TankType.battery\n ? html`\n <div class=${graphIconClasses} aria-hidden=\"true\">\n <obi-energy-battery\n class=\"graph-icon-stroke\"\n ></obi-energy-battery>\n <obi-energy-battery class=\"graph-icon-fill\"></obi-energy-battery>\n </div>\n `\n : html`\n <div class=${graphIconClasses} aria-hidden=\"true\">\n <obi-tank class=\"graph-icon-stroke\"></obi-tank>\n <obi-tank class=\"graph-icon-fill\"></obi-tank>\n </div>\n `;\n // Alert-frame overlay. Mirrors the `obc-automation-button` pattern\n // exactly so consumer API is identical. Placed inside `.halo` so the\n // ring hugs only the bordered tank area; `belowHalo` (tag / readout) is\n // unaffected. `.halo` is `position: relative` (see CSS) to anchor the\n // absolutely-positioned alert-frame.\n const alertFrameOverlay = this.alert\n ? html`<obc-alert-frame\n class=\"alert-frame\"\n .type=${this.alertFrameType}\n .thickness=${this.alertFrameThickness}\n .status=${this.alertFrameStatus}\n .showAlertCategoryIcon=${this.showAlertCategoryIcon}\n .showIcon=${this.showAlertIcon}\n >\n <span slot=\"icon\"><slot name=\"alert-icon\"></slot></span>\n <span slot=\"label\"><slot name=\"alert-label\"></slot></span>\n <span slot=\"timer\"><slot name=\"alert-timer\"></slot></span>\n </obc-alert-frame>`\n : null;\n let chartCell: HTMLTemplateResult;\n if (this._usesGaugeTrend) {\n // Forward the measured cell size as the gauge-trend's width/height,\n // which it interprets as an aspect-ratio reference. Its internal\n // ResizeObserver then picks up its own wrapper's clientWidth (= cell\n // width, since we set style width:100%) and computes height from the\n // aspect ratio — so the chart matches the cell exactly. We delay\n // rendering until both dimensions are measured to avoid a divide-by-\n // zero in the aspect-ratio math on first paint.\n const hasSize = this._cellWidth > 0 && this._cellHeight > 0;\n chartCell = html`\n <div class=\"bar-container chart-cell\">\n ${hasSize\n ? html`<obc-gauge-trend\n .data=${this.chartData}\n .minValue=${0}\n .maxValue=${safeMax}\n .value=${this.value}\n .hasBar=${this.chartMode === TankChartMode.graphAndBar}\n .hasScale=${false}\n .hasLabelPadding=${false}\n .chartFill=${true}\n .hasAdvice=${this.hasAdvice}\n .advice=${this.advice}\n .width=${this._cellWidth}\n .height=${this._cellHeight}\n style=\"width: 100%; height: 100%;\"\n .priority=${this.priority}\n ></obc-gauge-trend>`\n : null}\n ${this.hasGraphIcon ? graphIconOverlay : null}\n </div>\n `;\n } else {\n // Bar mode: render the shared SVG bar (`obc-bar-vertical` /\n // `-horizontal`) — the same renderer used by gauge-trend's side bar —\n // so advice overlays work the same way across all three chart modes.\n //\n // TODO(refactor): once `obc-gauge-trend` supports a bar-only layout at\n // this size (no chart-line area), migrate this branch to gauge-trend\n // too so all three chart modes share a single implementation.\n //\n // TODO(theming): the bar fill currently uses the standard instrument\n // palette (`--instrument-regular-tertiary-color` for tint mode). The\n // legacy CSS bar used per-medium colors (e.g. `--automation-medium-fuel`).\n // Extend `external-scale.ts` (and the bar-vertical/-horizontal wrappers)\n // to accept a medium / fuel color so the tank can restore its\n // per-`medium` coloring through the shared renderer.\n const hasSize = this._cellWidth > 0 && this._cellHeight > 0;\n // The inner bar always renders vertically, regardless of the tank's\n // outer `orientation`. Only the tank's outer wrapper flips; its inner\n // chart cell stays portrait. This matches gauge-trend behavior.\n //\n // Match gauge-trend's proportional sizing so advice pills (and other\n // fixed-pixel SVG primitives) render at the same on-screen size in\n // every chart mode. We mirror gauge-trend's defaults exactly:\n // `fixedAspectRatio=true` + `scaleReferenceSize=384`. The bar SVG is\n // then built in a 384-unit-tall viewBox and shrunk into the cell via\n // `xMidYMid meet`, giving on-screen scale = cellHeight / 384.\n //\n // Because the meet transform scales the viewBox uniformly, we must\n // also size `barThickness` in viewBox units (not cell pixels) so the\n // bar still fills the cell width after scaling. We pick the viewBox\n // cross-axis size so width-fit and height-fit ratios match exactly\n // (no horizontal gutters): viewBoxCross = cellWidth * 384 / cellHeight.\n const SCALE_REFERENCE_SIZE = 384;\n const adviceReserveVb = this.hasAdvice ? 16 : 0;\n const safeCellHeight = Math.max(1, this._cellHeight);\n const viewBoxCross =\n (this._cellWidth * SCALE_REFERENCE_SIZE) / safeCellHeight;\n const barThickness = Math.max(0, viewBoxCross - adviceReserveVb);\n // `tint` is locked in for tank bar mode: it draws a fill from 0 to\n // value plus a small marker at the value position, which mirrors the\n // legacy CSS bar's \"fill + top border at value\" visual idiom.\n const barWrapper = html`<obc-bar-vertical\n .minValue=${0}\n .maxValue=${safeMax}\n .value=${this.value}\n .height=${this._cellHeight}\n .fixedAspectRatio=${true}\n .scaleReferenceSize=${SCALE_REFERENCE_SIZE}\n .paddingTop=${0}\n .paddingBottom=${0}\n .side=${ExternalScaleSide.right}\n .hasBar=${true}\n .hasScale=${false}\n .showLabels=${false}\n .barThickness=${barThickness}\n .fillMode=${FillMode.tint}\n .instrumentMode=${true}\n .borderRadius=${2}\n .advices=${this.hasAdvice ? this.advice : []}\n .advicePosition=${AdvicePosition.inner}\n style=\"width: 100%; height: 100%;\"\n .priority=${this.priority}\n ></obc-bar-vertical>`;\n chartCell = html`\n <div class=\"bar-container bar-cell\">\n ${hasSize ? barWrapper : null}\n ${this.hasGraphIcon ? graphIconOverlay : null}\n </div>\n `;\n }\n\n const frameClasses = classMap({\n 'tank-frame': true,\n [`type-${this.type}`]: true,\n [`orientation-${this.orientation}`]: true,\n [this.medium]: true,\n compact: isCompact,\n static: this.static,\n });\n\n let middleContents: HTMLTemplateResult;\n if (this.static) {\n middleContents = html`<div class=\"static-readout\">${readoutCell}</div>`;\n } else if (this.compact) {\n middleContents = chartCell;\n } else {\n middleContents = html`<div class=\"grid\">\n ${tagCell}${badgesCell}${readoutCell}${chartCell}\n </div>`;\n }\n\n const tankFrame = html`\n <div class=${frameClasses}>\n ${this.renderCap('start')}\n <div class=\"middle\">${middleContents}</div>\n ${this.renderCap('end')}\n </div>\n `;\n\n // Whole component is one interactive element. The halo (flat-mixin\n // border/background that appears on hover/pressed/focus) is painted on\n // the inner `.halo` wrapper via `visibleWrapperClass`, so the surround\n // hugs only the bordered area:\n // - non-compact: just the tank-frame (grid inside it carries badges,\n // readout, tag).\n // - compact: fixed-size column flex — badges, tank-frame (flex-grow),\n // readout, tag. Empty cells (badges/tag) collapse via `?hidden`\n // above so the tank-frame absorbs the freed space.\n // - static: same as compact but no separate readout cell (the readout\n // is centered INSIDE the tank-frame via `static-readout`).\n //\n // The alert-frame overlay is the last child of `.halo` so the ring\n // overlays every cell (and any cell-collapse mechanics work uniformly).\n let haloContents: HTMLTemplateResult;\n if (this.static) {\n haloContents = html`${badgesCell}${tankFrame}${tagCell}`;\n } else if (this.compact) {\n haloContents = html`${badgesCell}${tankFrame}${readoutCell}${tagCell}`;\n } else {\n haloContents = tankFrame;\n }\n const halo = html`\n <div class=\"halo\">${haloContents}${alertFrameOverlay}</div>\n `;\n\n // `aria-live=\"polite\"` + `aria-atomic=\"true\"` on the root so the\n // slotted alert label (and any state change of the alert frame) is\n // announced once when `alert` flips on. Always present — an empty live\n // region is harmless and avoids screen-reader re-registration races.\n // TODO(a11y): the rest of the automation component family still lacks\n // this live-region announcement; consolidate when alert support is\n // factored into a shared mixin.\n return html`\n ${this.static\n ? html`<div\n class=\"root\"\n role=\"img\"\n aria-label=${this.tag || 'Tank'}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </div>`\n : html`<button\n class=\"root\"\n type=\"button\"\n aria-label=${this.tag || 'Tank'}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </button>`}\n `;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-automation-tank': ObcAutomationTank;\n }\n}\n"],"names":["TankTrend","TankType","TankOrientation","TankPositioning","TankChartMode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CO,IAAK,8BAAAA,eAAL;AACLA,aAAA,YAAA,IAAa;AACbA,aAAA,QAAA,IAAS;AACTA,aAAA,QAAA,IAAS;AACTA,aAAA,SAAA,IAAU;AACVA,aAAA,aAAA,IAAc;AACdA,aAAA,QAAA,IAAS;AANC,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AASL,IAAK,6BAAAC,cAAL;AACLA,YAAA,SAAA,IAAU;AACVA,YAAA,aAAA,IAAc;AACdA,YAAA,aAAA,IAAc;AACdA,YAAA,SAAA,IAAU;AAJA,SAAAA;AAAA,GAAA,YAAA,CAAA,CAAA;AAOL,IAAK,oCAAAC,qBAAL;AACLA,mBAAA,UAAA,IAAW;AACXA,mBAAA,YAAA,IAAa;AAFH,SAAAA;AAAA,GAAA,mBAAA,CAAA,CAAA;AAoBL,IAAK,oCAAAC,qBAAL;AACLA,mBAAA,OAAA,IAAQ;AACRA,mBAAA,QAAA,IAAS;AAFC,SAAAA;AAAA,GAAA,mBAAA,CAAA,CAAA;AAKL,IAAK,kCAAAC,mBAAL;AAELA,iBAAA,KAAA,IAAM;AAENA,iBAAA,OAAA,IAAQ;AAERA,iBAAA,aAAA,IAAc;AANJ,SAAAA;AAAA,GAAA,iBAAA,CAAA,CAAA;AAoCL,IAAM,oBAAN,cAAgC,WAAW;AAAA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AAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GA7Fd,kBA6FgB,WAAA,iBAAA,CAAA;AAakB,gBAAA;AAAA,EAA5C,SAAS,EAAC,MAAM,SAAS,WAAW,OAAM;AAAA,GA1GhC,kBA0GkC,WAAA,mBAAA,CAAA;AAWnB,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GArHb,kBAqHe,WAAA,yBAAA,CAAA;AAeiB,gBAAA;AAAA,EAA1C,SAAS,EAAC,MAAM,OAAO,WAAW,OAAM;AAAA,GApI9B,kBAoIgC,WAAA,WAAA,CAAA;AAcjB,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAlJb,kBAkJe,WAAA,gBAAA,CAAA;AAEA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GApJb,kBAoJe,WAAA,cAAA,CAAA;AAEA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAtJb,kBAsJe,WAAA,kBAAA,CAAA;AAG1B,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAxJb,kBAyJX,WAAA,sBAAA,CAAA;AAGiB,gBAAA;AAAA,EAAhB,MAAA;AAAM,GA5JI,kBA4JM,WAAA,cAAA,CAAA;AACA,gBAAA;AAAA,EAAhB,MAAA;AAAM,GA7JI,kBA6JM,WAAA,eAAA,CAAA;AAQA,gBAAA;AAAA,EAAhB,MAAA;AAAM,GArKI,kBAqKM,WAAA,cAAA,CAAA;AACA,gBAAA;AAAA,EAAhB,MAAA;AAAM,GAtKI,kBAsKM,WAAA,eAAA,CAAA;AAtKN,oBAAN,gBAAA;AAAA,EADN,cAAc,qBAAqB;AAAA,GACvB,iBAAA;"}
1
+ {"version":3,"file":"automation-tank.js","sources":["../../../src/automation/automation-tank/automation-tank.ts"],"sourcesContent":["import {\n HTMLTemplateResult,\n LitElement,\n html,\n nothing,\n svg,\n unsafeCSS,\n} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport compentStyle from './automation-tank.css?inline';\nimport {LineMedium} from '../index.js';\nimport '../automation-badge/automation-badge.js';\nimport {ObcAutomationBadgeType} from '../automation-badge/automation-badge.js';\nimport {\n AutomationButtonBadgeAlert,\n AutomationButtonBadgeCommandLocked,\n AutomationButtonBadgeControl,\n AutomationButtonBadgeInterlock,\n} from '../automation-button/abstract-automation-button.js';\n\nimport '../../icons/icon-chevron-double-up-google.js';\nimport '../../icons/icon-chevron-up-google.js';\nimport '../../icons/icon-chevron-double-down-google.js';\nimport '../../icons/icon-chevron-down-google.js';\nimport '../../icons/icon-off.js';\nimport '../../icons/icon-tank.js';\nimport '../../icons/icon-energy-battery.js';\nimport '../../navigation-instruments/gauge-trend/gauge-trend.js';\nimport '../../building-blocks/bar-vertical/bar-vertical.js';\nimport '../../components/alert-frame/alert-frame.js';\nimport {Priority} from '../../navigation-instruments/types.js';\nimport {\n ObcAlertFrameStatus,\n ObcAlertFrameThickness,\n ObcAlertFrameType,\n} from '../../components/alert-frame/alert-frame.js';\nimport type {ChartLineDataItem} from '../../building-blocks/chart-line/chart-line-base.js';\nimport type {LinearAdvice} from '../../building-blocks/instrument-linear/advice.js';\nimport {\n AdvicePosition,\n ExternalScaleSide,\n FillMode,\n} from '../../building-blocks/external-scale/external-scale.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement} from '../../decorator.js';\n\nexport enum TankTrend {\n fastRising = 'fast-rising',\n rising = 'rising',\n stable = 'stable',\n falling = 'falling',\n fastFalling = 'fast-falling',\n closed = 'closed',\n}\n\nexport enum TankType {\n generic = 'generic',\n atmospheric = 'atmospheric',\n pressurized = 'pressurized',\n battery = 'battery',\n}\n\nexport enum TankOrientation {\n vertical = 'vertical',\n horizontal = 'horizontal',\n}\n\n/**\n * Host positioning model.\n *\n * - `point` (default): the host has fixed default dimensions (per\n * orientation and compact / static variant) and a P&ID anchor — the\n * visual content is shifted with `translateX(-50%)` and (in non-compact)\n * `top: -20px` so the tank's top-center aligns with the host's top-left\n * placement coordinate. Use this when dropping the tank onto a P&ID\n * canvas at a pipe-grid coordinate.\n * - `button`: the host fills its parent container (100% × 100%) with no\n * anchor offset. Use this when embedding the tank inside a sized layout\n * slot — the parent controls the footprint and the tank renders\n * responsively inside it, just like a regular button. Compact / static\n * inner layout still applies; only the host box is changed.\n */\nexport enum TankPositioning {\n point = 'point',\n button = 'button',\n}\n\nexport enum TankChartMode {\n /** Static fill bar driven by `value` / `max` (default, backward compatible). */\n bar = 'bar',\n /** Embedded `obc-gauge-trend` line/area chart, no side bar. */\n graph = 'graph',\n /** Embedded `obc-gauge-trend` line/area chart with a side bar. */\n graphAndBar = 'graph-and-bar',\n}\n\n/**\n * A single detail row rendered in the tank's `readout` rich list (below the\n * main percent / value block, separated by a divider). Each row is rendered\n * as `<label>` on the left and `<value><degree?><percent?><unit>` on the\n * right, all on a single line.\n */\nexport interface TankReadoutItem {\n /** Left-aligned label text (e.g. `Temperature`). */\n label: string;\n /** Numeric value, formatted with the tank's `percentFractionDigits`. */\n value: number;\n /** Append a `°` glyph directly after the value with no gap. */\n hasDegree?: boolean;\n /** Append a `%` glyph directly after the value with no gap. */\n hasPercentage?: boolean;\n /** Unit text (e.g. `C`, `Pa`, `m/s`). Rendered after the value/glyph. */\n unit: string;\n}\n\n/**\n *\n *\n * @slot badges - Custom badges to be displayed in the badge area.\n * @slot tag - Text or element for the tank's tag/label.\n * @slot readout - Replaces the entire readout content block.\n * @slot max-value - Content for the capacity value.\n * @slot unit - Content for the unit of measurement.\n * @slot current-value - Content for the current level value.\n * @slot rich - Content for additional detail rows.\n * @slot alert-icon - Custom icon for the alert frame.\n * @slot alert-label - Label for the alert frame.\n * @slot alert-timer - Timer for the alert frame.\n *\n * @ignition-base-height: 173px\n * @ignition-base-width: 168px\n * @ignition-center-horizontal\n */\n@customElement('obc-automation-tank')\nexport class ObcAutomationTank extends LitElement {\n @property({type: String}) medium: LineMedium = LineMedium.water;\n @property({type: Number}) value: number = 0;\n @property({type: Number}) max: number = 100;\n @property({type: String}) trend: TankTrend = TankTrend.stable;\n @property({type: String, reflect: true}) type: TankType = TankType.generic;\n @property({type: String, reflect: true}) orientation: TankOrientation =\n TankOrientation.vertical;\n @property({type: Boolean, reflect: true}) compact: boolean = false;\n /**\n * Host positioning model — see `TankPositioning` for details. Defaults to\n * `point` for backward compatibility (fixed default dimensions + P&ID\n * top-center anchor). Set to `button` to make the host fill its parent\n * container (100% × 100%) with no anchor offset.\n */\n @property({type: String, reflect: true}) positioning: TankPositioning =\n TankPositioning.point;\n /**\n * Static (display-only) variant. Always rendered at the compact size; the\n * inner chart/bar is hidden, the bordered area is filled with\n * `--container-section-color`, and the readout is centered inside the frame.\n * Tag is rendered below the bordered area; badges (when slotted) sit above\n * the frame inside the halo and shrink the frame just like in compact mode.\n * Overrides `compact` (a static tank is always compact-sized).\n *\n * Static tanks render as a non-interactive `<div role=\"img\">` (not a\n * `<button>`), so they are not in the tab order and do not announce as\n * activatable controls.\n */\n @property({type: Boolean, reflect: true}) static: boolean = false;\n @property({type: String}) tag: string = '';\n\n /**\n * Chart cell rendering mode.\n * - `bar`: static fill bar driven by `value`/`max` (default).\n * - `graph`: embedded `obc-gauge-trend` line/area chart.\n * - `graphAndBar`: embedded `obc-gauge-trend` with an integrated side bar.\n */\n @property({type: String, reflect: true, attribute: 'chart-mode'})\n chartMode: TankChartMode = TankChartMode.bar;\n\n /** Time-series data points for the embedded gauge-trend (graph modes only). */\n @property({type: Array, attribute: false})\n chartData: ChartLineDataItem[] = [];\n\n /** Priority hint forwarded to child charts (regular | enhanced). */\n @property({type: String}) priority: Priority = Priority.regular;\n\n /**\n * Advice overlays. Forwarded to the embedded `obc-gauge-trend` in\n * `graph` / `graph-and-bar` modes, or rendered as pills over the static\n * bar in `bar` mode.\n */\n @property({type: Array, attribute: false})\n advice: LinearAdvice[] = [];\n\n /** Show advice overlays (works in all `chartMode` variants). */\n @property({type: Boolean}) hasAdvice = false;\n\n /**\n * Overlay a 32×32 decorative icon (currently `<obi-tank>`) centered on the\n * chart cell. Works in all three `chartMode` variants (bar, graph,\n * graph-and-bar) and in both orientations. The icon is rendered above the\n * bar/graph in a fixed CSS layer (does not scale with the SVG meet\n * transform) and is silhouetted with a `--border-silhouette-color` halo so\n * it stays legible on any underlying fill. The icon size scales with the\n * ambient `obc-component-size-*` class on an ancestor via the design token\n * `--automation-components-tanks-graphs-graph-icon-size` (32 → 48 → 64 → 64\n * for regular → medium → large → xl).\n *\n * TODO(future): replace the hard-coded `<obi-tank>` with a `slot=\"graph-icon\"`\n * so consumers can pass any `<obi-*>` icon. The current API ships the\n * smallest viable surface; the slot can be added without breaking the\n * boolean property.\n */\n @property({type: Boolean, attribute: false}) hasGraphIcon = false;\n\n /**\n * Show an `<obc-alert-frame>` overlay around the bordered tank area (the\n * `.halo` wrapper). Mirrors the API of `obc-automation-button`: same six\n * properties, same three slots (`alert-icon`, `alert-label`, `alert-timer`).\n * The ring overlays `.halo` only, so the tag and readout that sit outside\n * the halo in compact / static layouts remain unaffected.\n */\n @property({type: Boolean}) alert: boolean = false;\n @property({type: String}) alertFrameType: ObcAlertFrameType =\n ObcAlertFrameType.SmallSideFlip;\n @property({type: String}) alertFrameThickness: ObcAlertFrameThickness =\n ObcAlertFrameThickness.Small;\n @property({type: String}) alertFrameStatus: ObcAlertFrameStatus =\n ObcAlertFrameStatus.Alarm;\n @property({type: Boolean, attribute: false}) showAlertCategoryIcon: boolean =\n true;\n @property({type: Boolean}) showAlertIcon: boolean = false;\n\n /**\n * Show the trend chevron / off icon next to the percent readout. Default\n * `true` preserves existing behavior. Set to `false` to hide the trend\n * indicator in both compact and non-compact readouts — useful when the\n * trend is not meaningful for a given tank, or when the consumer wants\n * to keep the readout compact. Has no effect in `static` mode, which\n * renders the tank's capacity (`max` + `unit`) instead of a percent and\n * intentionally omits the trend indicator (a static tank represents\n * \"device present, current state unknown\"). `attribute: false` per the\n * repo's positive-default-true boolean convention.\n */\n @property({type: Boolean, attribute: false}) showTrendSymbol: boolean = true;\n\n /**\n * Number of fraction digits used to format the percent readout in the\n * non-compact (regular) layout. Defaults to `0` (integer percent). The\n * compact layout always renders integer percent to keep its fixed-width\n * footprint stable. The static layout renders capacity (`max` + `unit`)\n * rather than percent, so this property has no effect there — pass a\n * pre-formatted value through the `max-value` slot if fractional\n * precision is needed (see the `WithFractionDigits` story).\n */\n @property({type: Number}) percentFractionDigits: number = 0;\n\n /**\n * Rich detail rows shown below the main percent/value block in the regular\n * (non-compact, non-static) layout, separated by a divider. When empty (the\n * default), nothing is rendered — neither the divider nor the list. In\n * vertical orientation the chart cell shrinks to make room; in horizontal\n * orientation the readout column already has reserved whitespace so the\n * chart is unaffected.\n *\n * Values are formatted using `percentFractionDigits`. Consumers that need\n * full control over the markup can replace the entire fallback by slotting\n * arbitrary content into `slot=\"rich\"` (note: this is a different name from\n * the existing `slot=\"readout\"` which replaces the whole readout block).\n */\n @property({type: Array, attribute: false}) readout: TankReadoutItem[] = [];\n\n /**\n * Enum-driven badges rendered inside the `badges` cell. Mirrors the API\n * introduced for `ObcAbstractAutomationButton` in PR #839 (#829). When set\n * to a non-`None` value, an `<obc-automation-badge>` of the corresponding\n * type is rendered as fallback content for the `badges` slot. Any content\n * the consumer slots into `badges` overrides these defaults, preserving\n * backward compatibility with the existing slot-based API.\n *\n * Render order (left → right): control, alert, interlock, commandLocked —\n * matching the positional convention used by `ObcAbstractAutomationButton`\n * (top-left, top-right, bottom-left, bottom-right) read row-by-row.\n */\n @property({type: String}) badgeControl: AutomationButtonBadgeControl =\n AutomationButtonBadgeControl.None;\n @property({type: String}) badgeAlert: AutomationButtonBadgeAlert =\n AutomationButtonBadgeAlert.None;\n @property({type: String}) badgeInterlock: AutomationButtonBadgeInterlock =\n AutomationButtonBadgeInterlock.None;\n @property({type: String})\n badgeCommandLocked: AutomationButtonBadgeCommandLocked =\n AutomationButtonBadgeCommandLocked.None;\n\n @state() private _cellWidth = 0;\n @state() private _cellHeight = 0;\n /**\n * Tracks whether the `badges` and `tag` slots have assigned content. Used\n * in compact/static mode to collapse empty cells to 0px so the tank-frame\n * can absorb the freed space (per spec: \"if there are no badges it would\n * grow upward; if there are no readout or tags it would grow downward\").\n * Non-compact (regular) layout keeps its grid-based reserved rows.\n */\n @state() private _hasBadges = false;\n @state() private _hasTagSlot = false;\n private _chartResizeObserver?: ResizeObserver;\n private _observedCell?: Element;\n\n private get isCompact(): boolean {\n return this.compact || this.static;\n }\n\n private _badgeAlertType(): ObcAutomationBadgeType | null {\n switch (this.badgeAlert) {\n case AutomationButtonBadgeAlert.Silence:\n return ObcAutomationBadgeType.AlertSilenced;\n case AutomationButtonBadgeAlert.Caution:\n return ObcAutomationBadgeType.Caution;\n case AutomationButtonBadgeAlert.Warning:\n return ObcAutomationBadgeType.Warning;\n case AutomationButtonBadgeAlert.Alarm:\n return ObcAutomationBadgeType.Alarm;\n default:\n return null;\n }\n }\n\n private _badgeControlType(): ObcAutomationBadgeType | null {\n switch (this.badgeControl) {\n case AutomationButtonBadgeControl.Local:\n return ObcAutomationBadgeType.Local;\n case AutomationButtonBadgeControl.LocalOnly:\n return ObcAutomationBadgeType.LocalOnly;\n case AutomationButtonBadgeControl.Manual:\n return ObcAutomationBadgeType.Manual;\n case AutomationButtonBadgeControl.ManualOnly:\n return ObcAutomationBadgeType.ManualOnly;\n case AutomationButtonBadgeControl.Auto:\n return ObcAutomationBadgeType.Auto;\n default:\n return null;\n }\n }\n\n private _badgeInterlockType(): ObcAutomationBadgeType | null {\n switch (this.badgeInterlock) {\n case AutomationButtonBadgeInterlock.Interlock:\n return ObcAutomationBadgeType.Interlock;\n case AutomationButtonBadgeInterlock.InterlockInhibit:\n return ObcAutomationBadgeType.InterlockInhibit;\n default:\n return null;\n }\n }\n\n private _badgeCommandLockedType(): ObcAutomationBadgeType | null {\n if (\n this.badgeCommandLocked ===\n AutomationButtonBadgeCommandLocked.CommandLocked\n ) {\n return ObcAutomationBadgeType.CommandLocked;\n }\n return null;\n }\n\n private get _usesGaugeTrend(): boolean {\n return (\n this.chartMode === TankChartMode.graph ||\n this.chartMode === TankChartMode.graphAndBar\n );\n }\n\n private _onBadgesSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasBadges = slot\n .assignedNodes({flatten: true})\n .some(\n (n) =>\n n.nodeType === Node.ELEMENT_NODE ||\n (n.nodeType === Node.TEXT_NODE && !!n.textContent?.trim())\n );\n }\n\n private _onTagSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasTagSlot = slot\n .assignedNodes({flatten: true})\n .some(\n (n) =>\n n.nodeType === Node.ELEMENT_NODE ||\n (n.nodeType === Node.TEXT_NODE && !!n.textContent?.trim())\n );\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._chartResizeObserver?.disconnect();\n this._chartResizeObserver = undefined;\n this._observedCell = undefined;\n }\n\n protected override updated(\n changed: Map<string | number | symbol, unknown>\n ): void {\n super.updated(changed);\n // No imperative forwarding here — child components receive `priority`\n // via template property bindings (`.priority=${this.priority}`). Rely on\n // their reactive `updated()` logic (e.g. `ObcGaugeTrend._updateBarVerticalProperties()`)\n // to propagate palette changes internally.\n // The chart cell DOM element is recreated when chartMode toggles between\n // bar and graph modes (different class/contents), and may also appear/\n // disappear with static/compact. Re-attach the observer to the current\n // .bar-container instance.\n this._syncChartResizeObserver();\n }\n\n private _syncChartResizeObserver(): void {\n // Observe the bar-container in BOTH bar mode and graph modes — the bar\n // mode now renders an SVG `obc-bar-vertical` / `-horizontal` that needs\n // measured pixel dimensions for its viewBox and barThickness.\n const cell = this.renderRoot.querySelector('.bar-container');\n if (!cell) {\n if (this._chartResizeObserver) {\n this._chartResizeObserver.disconnect();\n this._observedCell = undefined;\n }\n return;\n }\n if (cell === this._observedCell) return;\n\n if (!this._chartResizeObserver) {\n this._chartResizeObserver = new ResizeObserver((entries) => {\n const entry = entries[0];\n if (!entry) return;\n const w = Math.round(entry.contentRect.width);\n const h = Math.round(entry.contentRect.height);\n if (w !== this._cellWidth) this._cellWidth = w;\n if (h !== this._cellHeight) this._cellHeight = h;\n });\n } else {\n this._chartResizeObserver.disconnect();\n }\n this._chartResizeObserver.observe(cell);\n this._observedCell = cell;\n }\n\n trendIcon(): HTMLTemplateResult | typeof nothing {\n if (this.trend === TankTrend.fastRising) {\n return html`<obi-chevron-double-up-google\n class=\"trend-icon\"\n ></obi-chevron-double-up-google>`;\n } else if (this.trend === TankTrend.rising) {\n return html`<obi-chevron-up-google\n class=\"trend-icon\"\n ></obi-chevron-up-google>`;\n } else if (this.trend === TankTrend.fastFalling) {\n return html`<obi-chevron-double-down-google\n class=\"trend-icon\"\n ></obi-chevron-double-down-google>`;\n } else if (this.trend === TankTrend.falling) {\n return html`<obi-chevron-down-google\n class=\"trend-icon\"\n ></obi-chevron-down-google>`;\n } else if (this.trend === TankTrend.closed) {\n return html`<obi-off class=\"trend-icon\"></obi-off>`;\n } else {\n // stable: render no icon\n return nothing;\n }\n }\n\n /**\n * Atmospheric cap, 3-piece (corner-start / stretchable middle arc / corner-end).\n * Each piece draws its own fill (closed) and stroke (open) so adjacent pieces\n * abut without a visible vertical seam line. Coordinates are derived from the\n * Figma 248x14 path; corners stay 12px wide while the middle arc stretches.\n * Position (start vs end) and orientation flipping are handled in CSS.\n *\n * Horizontal orientation reuses the same path data but rotates each piece\n * via an inner `<g transform=\"translate(0 H) rotate(-90)\">`, mapping the\n * source coord (x, y) to (y, H - x). The viewBox is swapped accordingly:\n * corner: 12x14 -> 14x12 (H=12)\n * middle: 224x14 -> 14x224 (H=224)\n * Cap-end (right side in horizontal) is mirrored via CSS scaleX(-1).\n */\n private renderAtmosphericCap(side: 'start' | 'end'): HTMLTemplateResult {\n const isHorizontal = this.orientation === TankOrientation.horizontal;\n\n // Path data. Two variants — regular (14px tall, 12px corners) and compact\n // (10px tall, 7px corners). Curve Y-values are proportionally scaled from\n // the original 18/12-tall Figma reference so the corner curves stay\n // continuous at the new thickness.\n // Horizontal orientation reuses the same vertical path data inside an\n // inner `<g transform=\"translate(0 H) rotate(-90)\">`; the SVG viewBox is\n // swapped accordingly. Cap-end is mirrored via CSS scaleY/scaleX(-1).\n let cornerStartFill: string;\n let cornerStartStroke: string;\n let midFill: string;\n let midStroke: string;\n let cornerEndFill: string;\n let cornerEndStroke: string;\n let cornerW: number;\n let capH: number;\n let midW: number;\n\n if (this.isCompact) {\n cornerW = 7;\n capH = 10;\n midW = 149;\n cornerStartFill =\n 'M 6.374 4.8214 C 6.138 4.8429, 6.005 4.8543, 5.83 4.8771 C 2.937 5.2557, 0.669 7.0957, 0.51 9.1936 C 0.5 9.3214, 0.5 9.4357, 0.5 9.6429 L 0.5 10 L 6.374 10 Z';\n cornerStartStroke =\n 'M 6.374 4.8214 C 6.138 4.8429, 6.005 4.8543, 5.83 4.8771 C 2.937 5.2557, 0.669 7.0957, 0.51 9.1936 C 0.5 9.3214, 0.5 9.4357, 0.5 9.6429 L 0.5 10';\n midFill =\n 'M 0 4.8214 C 10.97 3.8214, 37.83 1.7857, 74.626 1.7857 C 111.42 1.7857, 138.28 3.8214, 149.252 4.8214 L 149.252 10 L 0 10 Z';\n midStroke =\n 'M 0 4.8214 C 10.97 3.8214, 37.83 1.7857, 74.626 1.7857 C 111.42 1.7857, 138.28 3.8214, 149.252 4.8214';\n cornerEndFill =\n 'M 0 4.8214 C 0.236 4.8429, 0.369 4.8543, 0.544 4.8771 C 3.437 5.2557, 5.705 7.0957, 5.864 9.1936 C 5.874 9.3214, 5.874 9.4357, 5.874 9.6429 L 5.874 10 L 0 10 Z';\n cornerEndStroke =\n 'M 0 4.8214 C 0.236 4.8429, 0.369 4.8543, 0.544 4.8771 C 3.437 5.2557, 5.705 7.0957, 5.864 9.1936 C 5.874 9.3214, 5.874 9.4357, 5.874 9.6429 L 5.874 10';\n } else {\n cornerW = 12;\n capH = 14;\n midW = 224;\n cornerStartFill =\n 'M 12 6.5837 C 6.346 6.7737, 5.176 6.8744, 4.168 7.2537 C 2.6445 7.8272, 1.418 8.8983, 0.8613 10.1415 C 0.493 10.9641, 0.5 11.9099, 0.5 13.6111 L 0.5 14 L 12 14 Z';\n // Stroke draws the curve + outer vertical edge only. The seam with\n // `.middle` (y = capH) is painted by a 1px CSS `border-top` on\n // `.tank-frame.type-atmospheric:not(.compact) .middle` so it pixel-\n // snaps identically to the pressurized cap's CSS border. Drawing it\n // as an SVG stroke here would render thinner / blurrier due to\n // sub-pixel anti-aliasing.\n cornerStartStroke =\n 'M 12 6.5837 C 6.346 6.7737, 5.176 6.8744, 4.168 7.2537 C 2.6445 7.8272, 1.418 8.8983, 0.8613 10.1415 C 0.493 10.9641, 0.5 11.9099, 0.5 13.6111 L 0.5 14';\n midFill =\n 'M 0 6.5837 C 16 5.1124, 56 1.9444, 112 1.9444 C 168 1.9444, 208 5.1124, 224 6.5837 L 224 14 L 0 14 Z';\n midStroke =\n 'M 0 6.5837 C 16 5.1124, 56 1.9444, 112 1.9444 C 168 1.9444, 208 5.1124, 224 6.5837';\n cornerEndFill =\n 'M 0 6.5837 C 5.654 6.7737, 6.824 6.8744, 7.832 7.2537 C 9.3555 7.8272, 10.582 8.8983, 11.1387 10.1415 C 11.507 10.9641, 11.5 11.9099, 11.5 13.6111 L 11.5 14 L 0 14 Z';\n cornerEndStroke =\n 'M 0 6.5837 C 5.654 6.7737, 6.824 6.8744, 7.832 7.2537 C 9.3555 7.8272, 10.582 8.8983, 11.1387 10.1415 C 11.507 10.9641, 11.5 11.9099, 11.5 13.6111 L 11.5 14';\n }\n\n if (isHorizontal) {\n // Rotate vertical paths -90deg into a `capH`-wide column. Source coord\n // (x, y) maps to (y, cornerW - x) for corners and (y, midW - x) for mid.\n return html`\n <div class=\"cap cap-atmospheric cap-${side}\">\n <svg\n class=\"cap-corner cap-corner-start\"\n viewBox=\"0 0 ${capH} ${cornerW}\"\n preserveAspectRatio=\"xMidYMax meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <g transform=\"translate(0 ${cornerW}) rotate(-90)\">\n <path class=\"cap-fill\" d=\"${cornerStartFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerStartStroke}\" />\n </g>\n `}\n </svg>\n <svg\n class=\"cap-mid\"\n viewBox=\"0 0 ${capH} ${midW}\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n ${svg`\n <g transform=\"translate(0 ${midW}) rotate(-90)\">\n <path class=\"cap-fill\" d=\"${midFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" vector-effect=\"non-scaling-stroke\" d=\"${midStroke}\" />\n </g>\n `}\n </svg>\n <svg\n class=\"cap-corner cap-corner-end\"\n viewBox=\"0 0 ${capH} ${cornerW}\"\n preserveAspectRatio=\"xMidYMin meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <g transform=\"translate(0 ${cornerW}) rotate(-90)\">\n <path class=\"cap-fill\" d=\"${cornerEndFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerEndStroke}\" />\n </g>\n `}\n </svg>\n </div>\n `;\n }\n\n return html`\n <div class=\"cap cap-atmospheric cap-${side}\">\n <svg\n class=\"cap-corner cap-corner-start\"\n viewBox=\"0 0 ${cornerW} ${capH}\"\n preserveAspectRatio=\"xMaxYMid meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <path class=\"cap-fill\" d=\"${cornerStartFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerStartStroke}\" />\n `}\n </svg>\n <svg\n class=\"cap-mid\"\n viewBox=\"0 0 ${midW} ${capH}\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n ${svg`\n <path class=\"cap-fill\" d=\"${midFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" vector-effect=\"non-scaling-stroke\" d=\"${midStroke}\" />\n `}\n </svg>\n <svg\n class=\"cap-corner cap-corner-end\"\n viewBox=\"0 0 ${cornerW} ${capH}\"\n preserveAspectRatio=\"xMinYMid meet\"\n aria-hidden=\"true\"\n >\n ${svg`\n <path class=\"cap-fill\" d=\"${cornerEndFill}\" />\n <path class=\"cap-stroke\" fill=\"none\" d=\"${cornerEndStroke}\" />\n `}\n </svg>\n </div>\n `;\n }\n\n private renderCap(side: 'start' | 'end'): HTMLTemplateResult | null {\n if (this.type === TankType.generic) return null;\n if (this.type === TankType.battery && side === 'end') return null;\n if (this.type === TankType.atmospheric) {\n return this.renderAtmosphericCap(side);\n }\n if (this.type === TankType.pressurized) {\n return html`<div class=\"cap cap-pressurized cap-${side}\"></div>`;\n }\n // battery, start only\n return html`<div class=\"cap cap-battery cap-${side}\"></div>`;\n }\n\n override render() {\n const safeMax = this.max > 0 ? this.max : 1;\n const percent = Math.max(0, Math.min(100, (this.value / safeMax) * 100));\n const isCompact = this.isCompact;\n\n // In compact/static the `.halo` is a fixed-size column flex container\n // that holds badges + tank-frame + (compact only) readout + tag. To let\n // the tank-frame absorb the freed space when adjacent cells are empty,\n // we collapse the empty cells with the `hidden` attribute (see CSS).\n // In non-compact mode cells live inside the inner `.grid` and always\n // reserve their min-content rows — unchanged from previous behavior.\n const controlBadge = this._badgeControlType();\n const alertBadge = this._badgeAlertType();\n const interlockBadge = this._badgeInterlockType();\n const commandLockedBadge = this._badgeCommandLockedType();\n const hasEnumBadges =\n controlBadge !== null ||\n alertBadge !== null ||\n interlockBadge !== null ||\n commandLockedBadge !== null;\n\n const badgesHidden = isCompact && !this._hasBadges && !hasEnumBadges;\n const tagHidden = isCompact && !this._hasTagSlot && !this.tag;\n\n const badgesCell = html`\n <div class=\"badges\" ?hidden=${badgesHidden}>\n <slot name=\"badges\" @slotchange=${this._onBadgesSlotChange}>\n ${controlBadge\n ? html`<obc-automation-badge\n .type=${controlBadge}\n ></obc-automation-badge>`\n : nothing}\n ${alertBadge\n ? html`<obc-automation-badge\n .type=${alertBadge}\n ></obc-automation-badge>`\n : nothing}\n ${interlockBadge\n ? html`<obc-automation-badge\n .type=${interlockBadge}\n ></obc-automation-badge>`\n : nothing}\n ${commandLockedBadge\n ? html`<obc-automation-badge\n .type=${commandLockedBadge}\n ></obc-automation-badge>`\n : nothing}\n </slot>\n </div>\n `;\n const tagCell = html`\n <div class=\"tag\" ?hidden=${tagHidden}>\n <slot name=\"tag\" @slotchange=${this._onTagSlotChange}>${this.tag}</slot>\n </div>\n `;\n // Static mode intentionally renders the tank's capacity (max + unit)\n // instead of a percent reading: a static tank represents \"device is\n // present, current state unknown\", so a percent value would be\n // misleading. The trend icon is omitted for the same reason. Consumers\n // who need a custom label can still override the whole cell via the\n // `readout` slot, or supply formatted text through the existing\n // `max-value` / `unit` slots (no new API).\n const readoutCell = this.static\n ? html`\n <div class=\"readout readout-compact readout-static\">\n <slot name=\"readout\">\n <slot name=\"max-value\">${this.max.toFixed(0)}</slot>\n <slot name=\"unit\">m<sup>3</sup></slot>\n </slot>\n </div>\n `\n : isCompact\n ? html`\n <div class=\"readout readout-compact\">\n <slot name=\"readout\">\n ${this.showTrendSymbol ? this.trendIcon() : null}\n <span class=\"percent\"\n >${percent.toFixed(0)}<span class=\"percent-symbol\"\n >%</span\n ></span\n >\n </slot>\n </div>\n `\n : html`\n <div class=\"readout\">\n <slot name=\"readout\">\n <div class=\"header\">\n ${this.showTrendSymbol ? this.trendIcon() : null}\n <div class=\"percent\">\n ${percent.toFixed(this.percentFractionDigits)}<span\n class=\"percent-symbol\"\n >%</span\n >\n </div>\n </div>\n <div class=\"value\">\n <div class=\"current\">\n <slot name=\"current-value\" class=\"current-value\"\n >${this.value.toFixed(0)}</slot\n ><span class=\"divider\">/</span>\n </div>\n <div class=\"max\">\n <slot class=\"max-value\" name=\"max-value\"\n >${this.max.toFixed(0)}</slot\n >\n <slot class=\"unit\" name=\"unit\">m<sup>3</sup></slot>\n </div>\n </div>\n <slot name=\"rich\">\n ${this.readout.length > 0\n ? html`\n <div class=\"rich-divider\"></div>\n <div class=\"rich\">\n ${this.readout.map(\n (row) => html`\n <div class=\"rich-row\">\n <span class=\"rich-label\">${row.label}</span>\n <span class=\"rich-value\"\n >${row.value.toFixed(\n this.percentFractionDigits\n )}</span\n >\n <span class=\"rich-suffix\"\n >${row.hasDegree\n ? html`<span class=\"rich-glyph\">°</span>`\n : nothing}${row.hasPercentage\n ? html`<span class=\"rich-glyph\">%</span>`\n : nothing}<span class=\"rich-unit\"\n >${row.unit}</span\n ></span\n >\n </div>\n `\n )}\n </div>\n `\n : nothing}\n </slot>\n </slot>\n </div>\n `;\n // Decorative icon overlay (centered on the chart cell). Two stacked\n // icon elements: the back layer paints an inherited SVG `stroke` halo\n // (the icon's paths use `fill=\"currentColor\"`, and SVG `stroke` is\n // inherited across the icon's shadow DOM); the front layer paints the\n // colored fill via the `color` property. This mirrors the established\n // silhouette pattern used by `obc-automation-button` (back-layer slot\n // with stroke, front-layer slot with fill).\n //\n // The icon variant follows `type`: battery tanks show an energy-battery\n // icon, all other types show the generic tank icon.\n const graphIconClasses = classMap({\n 'graph-icon': true,\n 'priority-enhanced': this.priority === Priority.enhanced,\n });\n const graphIconOverlay =\n this.type === TankType.battery\n ? html`\n <div class=${graphIconClasses} aria-hidden=\"true\">\n <obi-energy-battery\n class=\"graph-icon-stroke\"\n ></obi-energy-battery>\n <obi-energy-battery class=\"graph-icon-fill\"></obi-energy-battery>\n </div>\n `\n : html`\n <div class=${graphIconClasses} aria-hidden=\"true\">\n <obi-tank class=\"graph-icon-stroke\"></obi-tank>\n <obi-tank class=\"graph-icon-fill\"></obi-tank>\n </div>\n `;\n // Alert-frame overlay. Mirrors the `obc-automation-button` pattern\n // exactly so consumer API is identical. Placed inside `.halo` so the\n // ring hugs only the bordered tank area; `belowHalo` (tag / readout) is\n // unaffected. `.halo` is `position: relative` (see CSS) to anchor the\n // absolutely-positioned alert-frame.\n const alertFrameOverlay = this.alert\n ? html`<obc-alert-frame\n class=\"alert-frame\"\n .type=${this.alertFrameType}\n .thickness=${this.alertFrameThickness}\n .status=${this.alertFrameStatus}\n .showAlertCategoryIcon=${this.showAlertCategoryIcon}\n .showIcon=${this.showAlertIcon}\n >\n <span slot=\"icon\"><slot name=\"alert-icon\"></slot></span>\n <span slot=\"label\"><slot name=\"alert-label\"></slot></span>\n <span slot=\"timer\"><slot name=\"alert-timer\"></slot></span>\n </obc-alert-frame>`\n : null;\n let chartCell: HTMLTemplateResult;\n if (this._usesGaugeTrend) {\n // Forward the measured cell size as the gauge-trend's width/height,\n // which it interprets as an aspect-ratio reference. Its internal\n // ResizeObserver then picks up its own wrapper's clientWidth (= cell\n // width, since we set style width:100%) and computes height from the\n // aspect ratio — so the chart matches the cell exactly. We delay\n // rendering until both dimensions are measured to avoid a divide-by-\n // zero in the aspect-ratio math on first paint.\n const hasSize = this._cellWidth > 0 && this._cellHeight > 0;\n chartCell = html`\n <div class=\"bar-container chart-cell\">\n ${hasSize\n ? html`<obc-gauge-trend\n .data=${this.chartData}\n .minValue=${0}\n .maxValue=${safeMax}\n .value=${this.value}\n .hasBar=${this.chartMode === TankChartMode.graphAndBar}\n .hasScale=${false}\n .hasLabelPadding=${false}\n .chartFill=${true}\n .hasAdvice=${this.hasAdvice}\n .advice=${this.advice}\n .width=${this._cellWidth}\n .height=${this._cellHeight}\n style=\"width: 100%; height: 100%;\"\n .priority=${this.priority}\n ></obc-gauge-trend>`\n : null}\n ${this.hasGraphIcon ? graphIconOverlay : null}\n </div>\n `;\n } else {\n // Bar mode: render the shared SVG bar (`obc-bar-vertical` /\n // `-horizontal`) — the same renderer used by gauge-trend's side bar —\n // so advice overlays work the same way across all three chart modes.\n //\n // TODO(refactor): once `obc-gauge-trend` supports a bar-only layout at\n // this size (no chart-line area), migrate this branch to gauge-trend\n // too so all three chart modes share a single implementation.\n //\n // TODO(theming): the bar fill currently uses the standard instrument\n // palette (`--instrument-regular-tertiary-color` for tint mode). The\n // legacy CSS bar used per-medium colors (e.g. `--automation-medium-fuel`).\n // Extend `external-scale.ts` (and the bar-vertical/-horizontal wrappers)\n // to accept a medium / fuel color so the tank can restore its\n // per-`medium` coloring through the shared renderer.\n const hasSize = this._cellWidth > 0 && this._cellHeight > 0;\n // The inner bar always renders vertically, regardless of the tank's\n // outer `orientation`. Only the tank's outer wrapper flips; its inner\n // chart cell stays portrait. This matches gauge-trend behavior.\n //\n // Match gauge-trend's proportional sizing so advice pills (and other\n // fixed-pixel SVG primitives) render at the same on-screen size in\n // every chart mode. We mirror gauge-trend's defaults exactly:\n // `fixedAspectRatio=true` + `scaleReferenceSize=384`. The bar SVG is\n // then built in a 384-unit-tall viewBox and shrunk into the cell via\n // `xMidYMid meet`, giving on-screen scale = cellHeight / 384.\n //\n // Because the meet transform scales the viewBox uniformly, we must\n // also size `barThickness` in viewBox units (not cell pixels) so the\n // bar still fills the cell width after scaling. We pick the viewBox\n // cross-axis size so width-fit and height-fit ratios match exactly\n // (no horizontal gutters): viewBoxCross = cellWidth * 384 / cellHeight.\n const SCALE_REFERENCE_SIZE = 384;\n const adviceReserveVb = this.hasAdvice ? 16 : 0;\n const safeCellHeight = Math.max(1, this._cellHeight);\n const viewBoxCross =\n (this._cellWidth * SCALE_REFERENCE_SIZE) / safeCellHeight;\n const barThickness = Math.max(0, viewBoxCross - adviceReserveVb);\n // `tint` is locked in for tank bar mode: it draws a fill from 0 to\n // value plus a small marker at the value position, which mirrors the\n // legacy CSS bar's \"fill + top border at value\" visual idiom.\n const barWrapper = html`<obc-bar-vertical\n .minValue=${0}\n .maxValue=${safeMax}\n .value=${this.value}\n .height=${this._cellHeight}\n .fixedAspectRatio=${true}\n .scaleReferenceSize=${SCALE_REFERENCE_SIZE}\n .paddingTop=${0}\n .paddingBottom=${0}\n .side=${ExternalScaleSide.right}\n .hasBar=${true}\n .hasScale=${false}\n .showLabels=${false}\n .barThickness=${barThickness}\n .fillMode=${FillMode.tint}\n .instrumentMode=${true}\n .borderRadius=${2}\n .advices=${this.hasAdvice ? this.advice : []}\n .advicePosition=${AdvicePosition.inner}\n style=\"width: 100%; height: 100%;\"\n .priority=${this.priority}\n ></obc-bar-vertical>`;\n chartCell = html`\n <div class=\"bar-container bar-cell\">\n ${hasSize ? barWrapper : null}\n ${this.hasGraphIcon ? graphIconOverlay : null}\n </div>\n `;\n }\n\n const frameClasses = classMap({\n 'tank-frame': true,\n [`type-${this.type}`]: true,\n [`orientation-${this.orientation}`]: true,\n [this.medium]: true,\n compact: isCompact,\n static: this.static,\n });\n\n let middleContents: HTMLTemplateResult;\n if (this.static) {\n middleContents = html`<div class=\"static-readout\">${readoutCell}</div>`;\n } else if (this.compact) {\n middleContents = chartCell;\n } else {\n middleContents = html`<div class=\"grid\">\n ${tagCell}${badgesCell}${readoutCell}${chartCell}\n </div>`;\n }\n\n const tankFrame = html`\n <div class=${frameClasses}>\n ${this.renderCap('start')}\n <div class=\"middle\">${middleContents}</div>\n ${this.renderCap('end')}\n </div>\n `;\n\n // Whole component is one interactive element. The halo (flat-mixin\n // border/background that appears on hover/pressed/focus) is painted on\n // the inner `.halo` wrapper via `visibleWrapperClass`, so the surround\n // hugs only the bordered area:\n // - non-compact: just the tank-frame (grid inside it carries badges,\n // readout, tag).\n // - compact: fixed-size column flex — badges, tank-frame (flex-grow),\n // readout, tag. Empty cells (badges/tag) collapse via `?hidden`\n // above so the tank-frame absorbs the freed space.\n // - static: same as compact but no separate readout cell (the readout\n // is centered INSIDE the tank-frame via `static-readout`).\n //\n // The alert-frame overlay is the last child of `.halo` so the ring\n // overlays every cell (and any cell-collapse mechanics work uniformly).\n let haloContents: HTMLTemplateResult;\n if (this.static) {\n haloContents = html`${badgesCell}${tankFrame}${tagCell}`;\n } else if (this.compact) {\n haloContents = html`${badgesCell}${tankFrame}${readoutCell}${tagCell}`;\n } else {\n haloContents = tankFrame;\n }\n const halo = html`\n <div class=\"halo\">${haloContents}${alertFrameOverlay}</div>\n `;\n\n // `aria-live=\"polite\"` + `aria-atomic=\"true\"` on the root so the\n // slotted alert label (and any state change of the alert frame) is\n // announced once when `alert` flips on. Always present — an empty live\n // region is harmless and avoids screen-reader re-registration races.\n // TODO(a11y): the rest of the automation component family still lacks\n // this live-region announcement; consolidate when alert support is\n // factored into a shared mixin.\n return html`\n ${this.static\n ? html`<div\n class=\"root\"\n role=\"img\"\n aria-label=${this.tag || 'Tank'}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </div>`\n : html`<button\n class=\"root\"\n type=\"button\"\n aria-label=${this.tag || 'Tank'}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </button>`}\n `;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-automation-tank': ObcAutomationTank;\n }\n}\n"],"names":["TankTrend","TankType","TankOrientation","TankPositioning","TankChartMode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CO,IAAK,8BAAAA,eAAL;AACLA,aAAA,YAAA,IAAa;AACbA,aAAA,QAAA,IAAS;AACTA,aAAA,QAAA,IAAS;AACTA,aAAA,SAAA,IAAU;AACVA,aAAA,aAAA,IAAc;AACdA,aAAA,QAAA,IAAS;AANC,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AASL,IAAK,6BAAAC,cAAL;AACLA,YAAA,SAAA,IAAU;AACVA,YAAA,aAAA,IAAc;AACdA,YAAA,aAAA,IAAc;AACdA,YAAA,SAAA,IAAU;AAJA,SAAAA;AAAA,GAAA,YAAA,CAAA,CAAA;AAOL,IAAK,oCAAAC,qBAAL;AACLA,mBAAA,UAAA,IAAW;AACXA,mBAAA,YAAA,IAAa;AAFH,SAAAA;AAAA,GAAA,mBAAA,CAAA,CAAA;AAoBL,IAAK,oCAAAC,qBAAL;AACLA,mBAAA,OAAA,IAAQ;AACRA,mBAAA,QAAA,IAAS;AAFC,SAAAA;AAAA,GAAA,mBAAA,CAAA,CAAA;AAKL,IAAK,kCAAAC,mBAAL;AAELA,iBAAA,KAAA,IAAM;AAENA,iBAAA,OAAA,IAAQ;AAERA,iBAAA,aAAA,IAAc;AANJ,SAAAA;AAAA,GAAA,iBAAA,CAAA,CAAA;AA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readout {
26
+ left: 50%;
27
+ width: auto;
28
+ height: auto;
29
+ transform: translate(-50%, -50%);
30
+ }
31
+
32
+ obc-readout::part(value-wrapper),
33
+ obc-readout::part(meta-wrapper) {
34
+ justify-self: center;
35
+ }
36
+
25
37
  :host {
26
38
  display: block;
27
39
  width: 100%;
@@ -1 +1 @@
1
- {"version":3,"file":"compass-sector.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"compass-sector.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3,6 +3,7 @@ import { AngleAdvice } from '../watch/advice.js';
3
3
  import { RotType, RotPosition } from '../watch/watch.js';
4
4
  import { InstrumentState, Priority } from '../types.js';
5
5
  import '../watch/watch.js';
6
+ import '../readout/readout.js';
6
7
  export { RotType, RotPosition };
7
8
  export declare enum CompassSectorPriorityElement {
8
9
  hdg = "hdg",
@@ -98,6 +99,12 @@ export declare class ObcCompassSector extends LitElement {
98
99
  priorityElements: CompassSectorPriorityElement[];
99
100
  tickmarksInside: boolean;
100
101
  zoomToFitArc: boolean;
102
+ /**
103
+ * When `true`, shows a centered `<obc-readout>` under the arc displaying the
104
+ * heading (label `HDG`, unit `DEG`). The value color follows the HDG entry in
105
+ * `priorityElements`, matching the HDG arrow.
106
+ */
107
+ hasReadout: boolean;
101
108
  private _headingSp;
102
109
  private _halfFOV;
103
110
  private _arcHalfExtent;
@@ -119,6 +126,22 @@ export declare class ObcCompassSector extends LitElement {
119
126
  private get _effectiveRotDegPerMin();
120
127
  private get _rotEndAngle();
121
128
  private priorityFor;
129
+ /**
130
+ * Vertical placement of the readout as a percentage of the host height.
131
+ *
132
+ * With `zoomToFitArc` the arc is reframed by `computeZoomToFitArcFrame`, whose
133
+ * `radiusOffset`/`viewBox` depend on the arc's *absolute* orientation (which
134
+ * cardinal axes its bounding box crosses), not just its bend. The arc itself
135
+ * is always rotated back to the top, so it stays put on screen — but a
136
+ * frame-derived offset would swing wildly as `heading` rotates the bbox around
137
+ * the circle. So in zoom we use a fixed offset, which keeps the readout steady
138
+ * under the (stationary) arc regardless of heading.
139
+ *
140
+ * Without zoom the viewBox is the fixed, origin-symmetric 120° framing, so the
141
+ * geometry is orientation-independent: place the readout halfway down the inner
142
+ * radius from the watch center toward the arc's inner edge.
143
+ */
144
+ private get _readoutTopPercent();
122
145
  render(): import('lit-html').TemplateResult<1>;
123
146
  static styles: import('lit').CSSResult;
124
147
  }
@@ -1 +1 @@
1
- {"version":3,"file":"compass-sector.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/compass-sector/compass-sector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,cAAc,EAAgC,MAAM,KAAK,CAAC;AAG9E,OAAO,mBAAmB,CAAC;AAG3B,OAAO,EAAc,WAAW,EAAiB,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAKL,OAAO,EACP,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,EAAC,eAAe,EAAE,QAAQ,EAAC,MAAM,aAAa,CAAC;AACtD,OAAO,EAAC,OAAO,EAAE,WAAW,EAAC,CAAC;AAE9B,oBAAY,4BAA4B;IACtC,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,GAAG,QAAQ;CACZ;AA+BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,qBACa,gBAAiB,SAAQ,UAAU;IACpB,OAAO,SAAK;IACZ,gBAAgB,SAAK;IAErB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAQ;IACtC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,iBAAiB,EAAE,OAAO,CAAS;IACpC,6BAA6B,EAAE,MAAM,CAAO;IAC3C,uBAAuB,EAAE,OAAO,CAAS;IACvB,qBAAqB,UAAQ;IAChD,6BAA6B,EAAE,MAAM,CAAK;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AED,OAAO,KAAK,YAAY,GAKvB;IAED,OAAO,CAAC,WAAW;IAWV,MAAM;IAiFf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,gBAAgB,CAAC;KACxC;CACF"}
1
+ {"version":3,"file":"compass-sector.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/compass-sector/compass-sector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,cAAc,EAAgC,MAAM,KAAK,CAAC;AAG9E,OAAO,mBAAmB,CAAC;AAC3B,OAAO,uBAAuB,CAAC;AAI/B,OAAO,EAAc,WAAW,EAAiB,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAKL,OAAO,EACP,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,EAAC,eAAe,EAAE,QAAQ,EAAC,MAAM,aAAa,CAAC;AACtD,OAAO,EAAC,OAAO,EAAE,WAAW,EAAC,CAAC;AAE9B,oBAAY,4BAA4B;IACtC,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,GAAG,QAAQ;CACZ;AA+BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,qBACa,gBAAiB,SAAQ,UAAU;IACpB,OAAO,SAAK;IACZ,gBAAgB,SAAK;IAErB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAQ;IACtC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,iBAAiB,EAAE,OAAO,CAAS;IACpC,6BAA6B,EAAE,MAAM,CAAO;IAC3C,uBAAuB,EAAE,OAAO,CAAS;IACvB,qBAAqB,UAAQ;IAChD,6BAA6B,EAAE,MAAM,CAAK;IACzC,eAAe,EAAE,OAAO,CAAS;IACjC,QAAQ,EAAE,OAAO,CAAS;IACV,cAAc,EAAE,WAAW,EAAE,CAAM;IAEpD,MAAM,EAAE,MAAM,CAAM;IAEpB,OAAO,EAA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BAAkB,GAU7B;IAMQ,MAAM;IAkGf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,gBAAgB,CAAC;KACxC;CACF"}
@@ -2,6 +2,7 @@ import { unsafeCSS, LitElement, nothing, svg, html } from "lit";
2
2
  import { property } from "lit/decorators.js";
3
3
  import componentStyle from "./compass-sector.css.js";
4
4
  import { WatchCircleType, innerRingRadiusFor, OUTER_RING_RADIUS } from "../watch/watch.js";
5
+ import { ReadoutVariant, ReadoutDirection } from "../readout/readout.js";
5
6
  import { TickmarkType, TickmarkStyle } from "../watch/tickmark.js";
6
7
  import { arrow, ArrowStyle } from "../compass/arrow.js";
7
8
  import { AdviceState } from "../watch/advice.js";
@@ -75,6 +76,7 @@ let ObcCompassSector = class extends LitElement {
75
76
  ];
76
77
  this.tickmarksInside = false;
77
78
  this.zoomToFitArc = false;
79
+ this.hasReadout = false;
78
80
  this._headingSp = new SetpointBundle({
79
81
  angularWraparound: true,
80
82
  onAnimationEnd: () => this.requestUpdate()
@@ -262,6 +264,32 @@ let ObcCompassSector = class extends LitElement {
262
264
  const selected = Array.isArray(this.priorityElements) ? this.priorityElements : [];
263
265
  return selected.includes(element) ? this.priority : Priority.regular;
264
266
  }
267
+ /**
268
+ * Vertical placement of the readout as a percentage of the host height.
269
+ *
270
+ * With `zoomToFitArc` the arc is reframed by `computeZoomToFitArcFrame`, whose
271
+ * `radiusOffset`/`viewBox` depend on the arc's *absolute* orientation (which
272
+ * cardinal axes its bounding box crosses), not just its bend. The arc itself
273
+ * is always rotated back to the top, so it stays put on screen — but a
274
+ * frame-derived offset would swing wildly as `heading` rotates the bbox around
275
+ * the circle. So in zoom we use a fixed offset, which keeps the readout steady
276
+ * under the (stationary) arc regardless of heading.
277
+ *
278
+ * Without zoom the viewBox is the fixed, origin-symmetric 120° framing, so the
279
+ * geometry is orientation-independent: place the readout halfway down the inner
280
+ * radius from the watch center toward the arc's inner edge.
281
+ */
282
+ get _readoutTopPercent() {
283
+ if (this.zoomToFitArc) {
284
+ return 70;
285
+ }
286
+ const [, vy, , vh] = this._cachedViewBox.split(" ").map(Number);
287
+ if (!vh || Number.isNaN(vy)) {
288
+ return 50;
289
+ }
290
+ const anchorY = -INNER_RADIUS * 0.5;
291
+ return Math.round((anchorY - vy) / vh * 1e3) / 10;
292
+ }
265
293
  // ---------------------------------------------------------------------------
266
294
  // Render
267
295
  // ---------------------------------------------------------------------------
@@ -343,6 +371,22 @@ let ObcCompassSector = class extends LitElement {
343
371
  rOff
344
372
  )}
345
373
  </svg>
374
+ ${this.hasReadout ? html`<div class="readout" style="top: ${this._readoutTopPercent}%">
375
+ <obc-readout
376
+ .variant=${ReadoutVariant.enhanced}
377
+ .direction=${ReadoutDirection.vertical}
378
+ .hasSetpoint=${false}
379
+ .hasAdvice=${false}
380
+ .value=${this.heading}
381
+ .fractionDigits=${0}
382
+ .valuePriority=${this.priorityFor(
383
+ "hdg"
384
+ /* hdg */
385
+ )}
386
+ label="HDG"
387
+ unit="DEG"
388
+ ></obc-readout>
389
+ </div>` : nothing}
346
390
  </div>
347
391
  `;
348
392
  }
@@ -426,6 +470,9 @@ __decorateClass([
426
470
  __decorateClass([
427
471
  property({ type: Boolean })
428
472
  ], ObcCompassSector.prototype, "zoomToFitArc", 2);
473
+ __decorateClass([
474
+ property({ type: Boolean })
475
+ ], ObcCompassSector.prototype, "hasReadout", 2);
429
476
  ObcCompassSector = __decorateClass([
430
477
  customElement("obc-compass-sector")
431
478
  ], ObcCompassSector);
@@ -1 +1 @@
1
- {"version":3,"file":"compass-sector.js","sources":["../../../src/navigation-instruments/compass-sector/compass-sector.ts"],"sourcesContent":["import {LitElement, PropertyValues, html, svg, unsafeCSS, nothing} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport componentStyle from './compass-sector.css?inline';\nimport '../watch/watch.js';\nimport {Tickmark, TickmarkType, TickmarkStyle} from '../watch/tickmark.js';\nimport {arrow, ArrowStyle} from '../compass/arrow.js';\nimport {AdviceState, AngleAdvice, AngleAdviceRaw} from '../watch/advice.js';\nimport {\n WatchCircleType,\n WatchArea,\n OUTER_RING_RADIUS,\n innerRingRadiusFor,\n RotType,\n RotPosition,\n} from '../watch/watch.js';\nimport {SetpointBundle} from '../../svghelpers/setpoint-bundle.js';\nimport {\n computeZoomToFitArcFrame,\n type ZoomToFitArcFrame,\n} from '../../svghelpers/arc-frame.js';\nimport {ROT_ZERO_DEADBAND_DEG} from '../rate-of-turn/rot-renderer.js';\nimport {customElement} from '../../decorator.js';\nimport {InstrumentState, Priority} from '../types.js';\nexport {RotType, RotPosition};\n\nexport enum CompassSectorPriorityElement {\n hdg = 'hdg',\n cog = 'cog',\n rot = 'rot',\n}\n\nconst PADDING = 72;\nconst WATCH_TYPE = WatchCircleType.triple;\nconst INNER_RADIUS = innerRingRadiusFor(WATCH_TYPE);\n/** Half of the fixed 120° arc on the watch face. */\nconst ARC_HALF_EXTENT = 60;\nconst SCALE_INNER_RADIUS = innerRingRadiusFor(WatchCircleType.single);\n\ninterface TickDensity {\n mainInterval: number;\n primaryInterval: number;\n secondaryInterval: number | undefined;\n}\n\nfunction tickDensityForFOV(fov: number): TickDensity {\n if (fov <= 30) {\n return {mainInterval: 10, primaryInterval: 5, secondaryInterval: 1};\n } else if (fov <= 60) {\n return {mainInterval: 10, primaryInterval: 5, secondaryInterval: undefined};\n } else if (fov <= 120) {\n return {mainInterval: 30, primaryInterval: 10, secondaryInterval: 5};\n } else {\n return {mainInterval: 90, primaryInterval: 30, secondaryInterval: 10};\n }\n}\n\nfunction normalizeAngle(a: number): number {\n return ((a % 360) + 360) % 360;\n}\n\n/**\n * `<obc-compass-sector>` — Curved compass strip that auto‑scales to keep HDG and COG visible.\n *\n * Renders a fixed 120° arc of a triple‑ring compass face. The visible\n * compass range (field of view) adjusts automatically so that both the\n * heading (HDG) and course‑over‑ground (COG) arrows are always in view.\n * This is the radial equivalent of `<obc-compass-flat>`: the arc shape\n * never changes — only the scale (compass‑degrees per arc‑degree) changes.\n *\n * ## Features\n *\n * - **Fixed 120° arc**: The watch face is always a 120° sector (±60° from\n * center), identical in shape to `<obc-rot-sector>`.\n * - **FOV auto‑scaling**: The field of view widens when the HDG–COG\n * angular difference grows, compressing more compass degrees into the\n * fixed arc. Tickmark density adjusts automatically.\n * - **HDG / COG arrows**: Solid (HDG) arrow is always at the arc center.\n * Hollow (COG) arrow is positioned proportionally within the arc.\n * - **North arrow**: A gray triangle in the outer scale band indicates\n * north when it falls within the visible FOV.\n * - **Heading setpoint**: Optional setpoint marker with auto at‑setpoint\n * detection and confirm animation, positioned at the mapped arc angle.\n * - **Advice zones**: Pass `headingAdvices` to render caution/alert arcs,\n * mapped into the scaled arc.\n * - **Rate of turn**: Animated ROT indicator (dots or bar) spanning from\n * HDG to the mapped COG position, clipped to the arc.\n * - **Zoom to fit**: When `zoomToFitArc` is `true`, the fixed 120° arc is\n * enlarged to fill the available space.\n *\n * ## Usage Guidelines\n *\n * - Set `heading` and `courseOverGround` to sensor values in degrees.\n * - Adjust `minFOV` to control the minimum zoom level (default 30°).\n * - Enable `zoomToFitArc` to enlarge the arc to fill the viewport.\n * - For a full‑circle compass, use `<obc-compass>` instead.\n *\n * @fires None\n */\n@customElement('obc-compass-sector')\nexport class ObcCompassSector extends LitElement {\n @property({type: Number}) heading = 0;\n @property({type: Number}) courseOverGround = 0;\n\n @property({type: Number}) headingSetpoint: number | null = null;\n @property({type: Number}) newHeadingSetpoint: number | undefined;\n @property({type: Boolean}) atHeadingSetpoint: boolean = false;\n @property({type: Number}) headingSetpointAtZeroDeadband: number = 0.5;\n @property({type: Boolean}) headingSetpointOverride: boolean = false;\n @property({type: Boolean, attribute: false}) autoAtHeadingSetpoint = true;\n @property({type: Number}) autoAtHeadingSetpointDeadband: number = 2;\n @property({type: Boolean}) animateSetpoint: boolean = false;\n @property({type: Boolean}) touching: boolean = false;\n @property({type: Array, attribute: false}) headingAdvices: AngleAdvice[] = [];\n\n @property({type: Number}) minFOV: number = 30;\n\n @property({type: String}) rotType: RotType | undefined;\n @property({type: String}) rotPosition: RotPosition = RotPosition.innerCircle;\n /**\n * Measured rate of turn in degrees per minute (positive = starboard).\n * Drives both the bar extent and (after multiplication by\n * `rotDotAnimationFactor`) the spinning dot animation. When `undefined`,\n * falls back to the deprecated `rotationsPerMinute`.\n */\n @property({type: Number}) rateOfTurnDegreesPerMinute: number | undefined;\n /**\n * Visual amplification applied only to the spinning dot animation\n * (not to the bar extent). Default `18` keeps the legacy visual feel\n * (≈1 rpm at 20°/min).\n */\n @property({type: Number}) rotDotAnimationFactor: number = 18;\n /**\n * @deprecated Use `rateOfTurnDegreesPerMinute` (and optionally\n * `rotDotAnimationFactor`) instead. Takes effect only when\n * `rateOfTurnDegreesPerMinute` is `undefined`.\n */\n @property({type: Number}) rotationsPerMinute: number = 1;\n /**\n * Bar-extent reference value in **degrees per minute**. The bar fills the\n * full ±`ARC_HALF_EXTENT` arc when the measured ROT equals\n * ±`rotMaxValue`. Default `60` aligns with ES-TRIN 2025/1 Art. 3.02.\n *\n * Note: the unit changed from rotations per minute to degrees per minute\n * with the introduction of `rateOfTurnDegreesPerMinute`.\n */\n @property({type: Number}) rotMaxValue: number = 60;\n @property({type: Boolean}) rotPortStarboard: boolean = false;\n @property({type: Number}) rotAtZeroDeadband: number = ROT_ZERO_DEADBAND_DEG;\n\n @property({type: String}) state: InstrumentState = InstrumentState.active;\n @property({type: String}) priority: Priority = Priority.regular;\n @property({type: Array, attribute: false})\n priorityElements: CompassSectorPriorityElement[] = [\n CompassSectorPriorityElement.hdg,\n ];\n @property({type: Boolean}) tickmarksInside: boolean = false;\n @property({type: Boolean}) zoomToFitArc: boolean = false;\n\n private _headingSp = new SetpointBundle({\n angularWraparound: true,\n onAnimationEnd: () => this.requestUpdate(),\n });\n\n // Cached computed values — updated in willUpdate()\n private _halfFOV = 30;\n private _arcHalfExtent = ARC_HALF_EXTENT;\n private _scale = 1;\n private _radiusOffset = 0;\n private _cachedViewBox = '';\n private _cachedArcFrame: ZoomToFitArcFrame | undefined;\n private _cachedAreas: WatchArea[] = [];\n private _cachedTickmarks: Tickmark[] = [];\n private _cachedAdvices: AngleAdviceRaw[] = [];\n\n override willUpdate(changed: PropertyValues): void {\n super.willUpdate(changed);\n this._headingSp.sync({\n setpoint: this.headingSetpoint ?? undefined,\n newSetpoint: this.newHeadingSetpoint,\n atSetpoint: this.atHeadingSetpoint,\n touching: this.touching,\n autoAtSetpoint: this.autoAtHeadingSetpoint,\n autoAtSetpointDeadband: this.autoAtHeadingSetpointDeadband,\n setpointAtZeroDeadband: this.headingSetpointAtZeroDeadband,\n setpointOverride: this.headingSetpointOverride,\n animateSetpoint: this.animateSetpoint,\n });\n\n const arcInputsChanged =\n changed.has('heading') ||\n changed.has('courseOverGround') ||\n changed.has('minFOV') ||\n changed.has('zoomToFitArc');\n\n if (arcInputsChanged) {\n let diff = this.courseOverGround - this.heading;\n if (diff > 180) diff -= 360;\n else if (diff < -180) diff += 360;\n const minFov = Math.max(1, this.minFOV);\n const MARGIN = 15;\n\n if (this.zoomToFitArc) {\n const needed = Math.max(minFov, Math.abs(diff) + MARGIN);\n if (needed <= ARC_HALF_EXTENT) {\n this._halfFOV = needed;\n this._arcHalfExtent = needed;\n this._scale = 1;\n } else {\n this._halfFOV = needed;\n this._arcHalfExtent = ARC_HALF_EXTENT;\n this._scale = ARC_HALF_EXTENT / needed;\n }\n } else {\n this._halfFOV = Math.max(minFov, Math.abs(diff));\n this._arcHalfExtent = ARC_HALF_EXTENT;\n this._scale = ARC_HALF_EXTENT / this._halfFOV;\n }\n\n this._cachedAreas = [\n {\n startAngle: this.heading - this._arcHalfExtent,\n endAngle: this.heading + this._arcHalfExtent,\n roundInsideCut: true,\n roundOutsideCut: true,\n },\n ];\n\n this._computeViewBox();\n this._cachedTickmarks = this._buildTickmarks();\n }\n\n if (arcInputsChanged || changed.has('headingAdvices')) {\n this._cachedAdvices = this._buildAdvices();\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._headingSp.dispose();\n }\n\n // ---------------------------------------------------------------------------\n // Angle mapping — maps compass degrees to arc positions\n // ---------------------------------------------------------------------------\n\n private _mapAngle(compassDeg: number): number {\n let diff = compassDeg - this.heading;\n if (diff > 180) diff -= 360;\n else if (diff < -180) diff += 360;\n return this.heading + diff * this._scale;\n }\n\n // ---------------------------------------------------------------------------\n // Areas — fixed 120° arc centered on heading (built in willUpdate)\n // ---------------------------------------------------------------------------\n\n // ---------------------------------------------------------------------------\n // Tickmarks — compass-degree labels at mapped arc positions\n // ---------------------------------------------------------------------------\n\n private _buildTickmarks(): Tickmark[] {\n const fov = this._halfFOV * 2;\n const {mainInterval, primaryInterval, secondaryInterval} =\n tickDensityForFOV(fov);\n const halfFov = this._halfFOV;\n const compassStart = this.heading - halfFov;\n const compassEnd = this.heading + halfFov;\n\n const tickmarks: Tickmark[] = [];\n const added = new Set<number>();\n\n const addTick = (\n arcAngle: number,\n type: TickmarkType,\n text?: string\n ): void => {\n const key = Math.round(arcAngle * 1000);\n if (added.has(key)) return;\n added.add(key);\n tickmarks.push({angle: arcAngle, type, text});\n };\n\n const step = secondaryInterval ?? primaryInterval;\n const firstTick = Math.ceil(compassStart / step) * step;\n\n for (\n let compassDeg = firstTick;\n compassDeg <= compassEnd;\n compassDeg += step\n ) {\n const norm = normalizeAngle(compassDeg);\n const arcAngle = this._mapAngle(compassDeg);\n const isMain = norm % mainInterval === 0;\n const isPrimary = norm % primaryInterval === 0;\n\n if (isMain) {\n addTick(arcAngle, TickmarkType.main, Math.round(norm).toString());\n } else if (isPrimary) {\n addTick(arcAngle, TickmarkType.primary);\n } else {\n addTick(arcAngle, TickmarkType.secondary);\n }\n }\n\n return tickmarks;\n }\n\n // ---------------------------------------------------------------------------\n // ViewBox\n // ---------------------------------------------------------------------------\n\n private _computeViewBox(): void {\n if (this.zoomToFitArc) {\n const targetSize = (176 + PADDING) * 2;\n const frame = computeZoomToFitArcFrame({\n areas: this._cachedAreas,\n outerRadius: OUTER_RING_RADIUS,\n innerRadius: INNER_RADIUS,\n extension: PADDING,\n targetSize,\n });\n this._radiusOffset = frame.radiusOffset;\n this._cachedViewBox = frame.viewBox;\n this._cachedArcFrame = frame;\n } else {\n this._radiusOffset = 0;\n const width = (176 + PADDING) * 2;\n this._cachedViewBox = `-${width / 2} -${width / 2} ${width} ${width}`;\n this._cachedArcFrame = undefined;\n }\n }\n\n // ---------------------------------------------------------------------------\n // North arrow — rendered in overlay at mapped 0° position\n // ---------------------------------------------------------------------------\n\n private _renderNorthArrow(rOff: number) {\n let northOffset = -this.heading;\n if (northOffset > 180) northOffset -= 360;\n else if (northOffset < -180) northOffset += 360;\n if (Math.abs(northOffset) > this._halfFOV) return nothing;\n\n const northArcAngle = this._mapAngle(0);\n const radius = OUTER_RING_RADIUS + rOff;\n return svg`\n <g transform=\"rotate(${northArcAngle}) translate(0, ${-radius})\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M-17.8457 24.984 0 0 17.8458 24.984C11.9868 24.3338 6.0324 24 0 24-6.0323 24-11.9867 24.3338-17.8457 24.984Z\"\n fill=\"var(--instrument-frame-tertiary-color)\"/>\n </g>\n `;\n }\n\n // ---------------------------------------------------------------------------\n // Priority & advice helpers\n // ---------------------------------------------------------------------------\n\n private _angleInRange(value: number, min: number, max: number): boolean {\n const v = normalizeAngle(value);\n const start = normalizeAngle(min);\n const end = normalizeAngle(max);\n return start <= end ? v >= start && v <= end : v >= start || v <= end;\n }\n\n private _buildAdvices(): AngleAdviceRaw[] {\n return this.headingAdvices.map(({minAngle, maxAngle, hinted, type}) => {\n const state = this._angleInRange(this.heading, minAngle, maxAngle)\n ? AdviceState.triggered\n : hinted\n ? AdviceState.hinted\n : AdviceState.regular;\n return {\n minAngle: this._mapAngle(minAngle),\n maxAngle: this._mapAngle(maxAngle),\n type,\n state,\n };\n });\n }\n\n private get _effectiveRotDegPerMin(): number {\n return this.rateOfTurnDegreesPerMinute ?? this.rotationsPerMinute;\n }\n\n private get _rotEndAngle(): number {\n const maxVal = this.rotMaxValue || 1;\n const barCompassDeg =\n (this._effectiveRotDegPerMin / maxVal) * ARC_HALF_EXTENT;\n return this._mapAngle(this.heading + barCompassDeg);\n }\n\n private priorityFor(element: CompassSectorPriorityElement): Priority {\n const selected = Array.isArray(this.priorityElements)\n ? this.priorityElements\n : [];\n return selected.includes(element) ? this.priority : Priority.regular;\n }\n\n // ---------------------------------------------------------------------------\n // Render\n // ---------------------------------------------------------------------------\n\n override render() {\n const rotation = -this.heading;\n const viewBox = this._cachedViewBox;\n const rOff = this._radiusOffset;\n\n const mappedCOG = this._mapAngle(this.courseOverGround);\n const mappedSetpoint =\n this.headingSetpoint != null\n ? this._mapAngle(this.headingSetpoint)\n : undefined;\n const mappedNewSetpoint =\n this.newHeadingSetpoint != null\n ? this._mapAngle(this.newHeadingSetpoint)\n : undefined;\n\n return html`\n <div class=\"container\">\n <obc-watch\n .touching=${this.touching}\n .padding=${PADDING}\n .advices=${this._cachedAdvices}\n .tickmarks=${this._cachedTickmarks}\n .tickmarkStyle=${TickmarkStyle.regular}\n .tickmarksInside=${this.tickmarksInside}\n .state=${this.state}\n .watchCircleType=${WATCH_TYPE}\n .northArrow=${false}\n .areas=${this._cachedAreas}\n .arcFrame=${this._cachedArcFrame}\n .zoomToFitArc=${this.zoomToFitArc}\n .tickFadeAngle=${this._arcHalfExtent * 0.2}\n .rotation=${rotation}\n .angleSetpoint=${mappedSetpoint}\n .newAngleSetpoint=${mappedNewSetpoint}\n .atAngleSetpoint=${this._headingSp.computeAtSetpoint(this.heading)}\n .angleSetpointAtZeroDeadband=${this.headingSetpointAtZeroDeadband}\n .setpointOverride=${this.headingSetpointOverride}\n .priority=${this.priority}\n .animateSetpoint=${this.animateSetpoint}\n .rotType=${this.rotType}\n .rotPosition=${this.rotPosition}\n .rotStartAngle=${this.heading}\n .rotEndAngle=${this._rotEndAngle}\n .rotPriority=${this.priorityFor(CompassSectorPriorityElement.rot)}\n .rotPortStarboard=${this.rotPortStarboard}\n .rotAtZeroDeadband=${this.rotAtZeroDeadband}\n .rateOfTurnDegreesPerMinute=${this.rateOfTurnDegreesPerMinute}\n .rotDotAnimationFactor=${this.rotDotAnimationFactor}\n .rotationsPerMinute=${this.rotationsPerMinute}\n >\n </obc-watch>\n <svg viewBox=\"${viewBox}\" transform=\"rotate(${rotation})\">\n <g transform=\"rotate(${this.heading})\">\n <line\n x1=\"0\"\n y1=\"${-(SCALE_INNER_RADIUS + rOff)}\"\n x2=\"0\"\n y2=\"${-(INNER_RADIUS + rOff)}\"\n stroke=\"var(--instrument-frame-tertiary-color)\"\n stroke-width=\"1\"\n vector-effect=\"non-scaling-stroke\"\n />\n </g>\n ${this._renderNorthArrow(rOff)}\n ${arrow(\n ArrowStyle.HDG,\n this.heading,\n this.priorityFor(CompassSectorPriorityElement.hdg),\n rOff\n )}\n ${arrow(\n ArrowStyle.COG,\n mappedCOG,\n this.priorityFor(CompassSectorPriorityElement.cog),\n rOff\n )}\n </svg>\n </div>\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-compass-sector': ObcCompassSector;\n }\n}\n"],"names":["CompassSectorPriorityElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyBO,IAAK,iDAAAA,kCAAL;AACLA,gCAAA,KAAA,IAAM;AACNA,gCAAA,KAAA,IAAM;AACNA,gCAAA,KAAA,IAAM;AAHI,SAAAA;AAAA,GAAA,gCAAA,CAAA,CAAA;AAMZ,MAAM,UAAU;AAChB,MAAM,aAAa,gBAAgB;AACnC,MAAM,eAAe,mBAAmB,UAAU;AAElD,MAAM,kBAAkB;AACxB,MAAM,qBAAqB,mBAAmB,gBAAgB,MAAM;AAQpE,SAAS,kBAAkB,KAA0B;AACnD,MAAI,OAAO,IAAI;AACb,WAAO,EAAC,cAAc,IAAI,iBAAiB,GAAG,mBAAmB,EAAA;AAAA,EACn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A,CAAA;AAzDhB,mBAAN,gBAAA;AAAA,EADN,cAAc,oBAAoB;AAAA,GACtB,gBAAA;"}
1
+ {"version":3,"file":"compass-sector.js","sources":["../../../src/navigation-instruments/compass-sector/compass-sector.ts"],"sourcesContent":["import {LitElement, PropertyValues, html, svg, unsafeCSS, nothing} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport componentStyle from './compass-sector.css?inline';\nimport '../watch/watch.js';\nimport '../readout/readout.js';\nimport {ReadoutDirection, ReadoutVariant} from '../readout/readout.js';\nimport {Tickmark, TickmarkType, TickmarkStyle} from '../watch/tickmark.js';\nimport {arrow, ArrowStyle} from '../compass/arrow.js';\nimport {AdviceState, AngleAdvice, AngleAdviceRaw} from '../watch/advice.js';\nimport {\n WatchCircleType,\n WatchArea,\n OUTER_RING_RADIUS,\n innerRingRadiusFor,\n RotType,\n RotPosition,\n} from '../watch/watch.js';\nimport {SetpointBundle} from '../../svghelpers/setpoint-bundle.js';\nimport {\n computeZoomToFitArcFrame,\n type ZoomToFitArcFrame,\n} from '../../svghelpers/arc-frame.js';\nimport {ROT_ZERO_DEADBAND_DEG} from '../rate-of-turn/rot-renderer.js';\nimport {customElement} from '../../decorator.js';\nimport {InstrumentState, Priority} from '../types.js';\nexport {RotType, RotPosition};\n\nexport enum CompassSectorPriorityElement {\n hdg = 'hdg',\n cog = 'cog',\n rot = 'rot',\n}\n\nconst PADDING = 72;\nconst WATCH_TYPE = WatchCircleType.triple;\nconst INNER_RADIUS = innerRingRadiusFor(WATCH_TYPE);\n/** Half of the fixed 120° arc on the watch face. */\nconst ARC_HALF_EXTENT = 60;\nconst SCALE_INNER_RADIUS = innerRingRadiusFor(WatchCircleType.single);\n\ninterface TickDensity {\n mainInterval: number;\n primaryInterval: number;\n secondaryInterval: number | undefined;\n}\n\nfunction tickDensityForFOV(fov: number): TickDensity {\n if (fov <= 30) {\n return {mainInterval: 10, primaryInterval: 5, secondaryInterval: 1};\n } else if (fov <= 60) {\n return {mainInterval: 10, primaryInterval: 5, secondaryInterval: undefined};\n } else if (fov <= 120) {\n return {mainInterval: 30, primaryInterval: 10, secondaryInterval: 5};\n } else {\n return {mainInterval: 90, primaryInterval: 30, secondaryInterval: 10};\n }\n}\n\nfunction normalizeAngle(a: number): number {\n return ((a % 360) + 360) % 360;\n}\n\n/**\n * `<obc-compass-sector>` — Curved compass strip that auto‑scales to keep HDG and COG visible.\n *\n * Renders a fixed 120° arc of a triple‑ring compass face. The visible\n * compass range (field of view) adjusts automatically so that both the\n * heading (HDG) and course‑over‑ground (COG) arrows are always in view.\n * This is the radial equivalent of `<obc-compass-flat>`: the arc shape\n * never changes — only the scale (compass‑degrees per arc‑degree) changes.\n *\n * ## Features\n *\n * - **Fixed 120° arc**: The watch face is always a 120° sector (±60° from\n * center), identical in shape to `<obc-rot-sector>`.\n * - **FOV auto‑scaling**: The field of view widens when the HDG–COG\n * angular difference grows, compressing more compass degrees into the\n * fixed arc. Tickmark density adjusts automatically.\n * - **HDG / COG arrows**: Solid (HDG) arrow is always at the arc center.\n * Hollow (COG) arrow is positioned proportionally within the arc.\n * - **North arrow**: A gray triangle in the outer scale band indicates\n * north when it falls within the visible FOV.\n * - **Heading setpoint**: Optional setpoint marker with auto at‑setpoint\n * detection and confirm animation, positioned at the mapped arc angle.\n * - **Advice zones**: Pass `headingAdvices` to render caution/alert arcs,\n * mapped into the scaled arc.\n * - **Rate of turn**: Animated ROT indicator (dots or bar) spanning from\n * HDG to the mapped COG position, clipped to the arc.\n * - **Zoom to fit**: When `zoomToFitArc` is `true`, the fixed 120° arc is\n * enlarged to fill the available space.\n *\n * ## Usage Guidelines\n *\n * - Set `heading` and `courseOverGround` to sensor values in degrees.\n * - Adjust `minFOV` to control the minimum zoom level (default 30°).\n * - Enable `zoomToFitArc` to enlarge the arc to fill the viewport.\n * - For a full‑circle compass, use `<obc-compass>` instead.\n *\n * @fires None\n */\n@customElement('obc-compass-sector')\nexport class ObcCompassSector extends LitElement {\n @property({type: Number}) heading = 0;\n @property({type: Number}) courseOverGround = 0;\n\n @property({type: Number}) headingSetpoint: number | null = null;\n @property({type: Number}) newHeadingSetpoint: number | undefined;\n @property({type: Boolean}) atHeadingSetpoint: boolean = false;\n @property({type: Number}) headingSetpointAtZeroDeadband: number = 0.5;\n @property({type: Boolean}) headingSetpointOverride: boolean = false;\n @property({type: Boolean, attribute: false}) autoAtHeadingSetpoint = true;\n @property({type: Number}) autoAtHeadingSetpointDeadband: number = 2;\n @property({type: Boolean}) animateSetpoint: boolean = false;\n @property({type: Boolean}) touching: boolean = false;\n @property({type: Array, attribute: false}) headingAdvices: AngleAdvice[] = [];\n\n @property({type: Number}) minFOV: number = 30;\n\n @property({type: String}) rotType: RotType | undefined;\n @property({type: String}) rotPosition: RotPosition = RotPosition.innerCircle;\n /**\n * Measured rate of turn in degrees per minute (positive = starboard).\n * Drives both the bar extent and (after multiplication by\n * `rotDotAnimationFactor`) the spinning dot animation. When `undefined`,\n * falls back to the deprecated `rotationsPerMinute`.\n */\n @property({type: Number}) rateOfTurnDegreesPerMinute: number | undefined;\n /**\n * Visual amplification applied only to the spinning dot animation\n * (not to the bar extent). Default `18` keeps the legacy visual feel\n * (≈1 rpm at 20°/min).\n */\n @property({type: Number}) rotDotAnimationFactor: number = 18;\n /**\n * @deprecated Use `rateOfTurnDegreesPerMinute` (and optionally\n * `rotDotAnimationFactor`) instead. Takes effect only when\n * `rateOfTurnDegreesPerMinute` is `undefined`.\n */\n @property({type: Number}) rotationsPerMinute: number = 1;\n /**\n * Bar-extent reference value in **degrees per minute**. The bar fills the\n * full ±`ARC_HALF_EXTENT` arc when the measured ROT equals\n * ±`rotMaxValue`. Default `60` aligns with ES-TRIN 2025/1 Art. 3.02.\n *\n * Note: the unit changed from rotations per minute to degrees per minute\n * with the introduction of `rateOfTurnDegreesPerMinute`.\n */\n @property({type: Number}) rotMaxValue: number = 60;\n @property({type: Boolean}) rotPortStarboard: boolean = false;\n @property({type: Number}) rotAtZeroDeadband: number = ROT_ZERO_DEADBAND_DEG;\n\n @property({type: String}) state: InstrumentState = InstrumentState.active;\n @property({type: String}) priority: Priority = Priority.regular;\n @property({type: Array, attribute: false})\n priorityElements: CompassSectorPriorityElement[] = [\n CompassSectorPriorityElement.hdg,\n ];\n @property({type: Boolean}) tickmarksInside: boolean = false;\n @property({type: Boolean}) zoomToFitArc: boolean = false;\n /**\n * When `true`, shows a centered `<obc-readout>` under the arc displaying the\n * heading (label `HDG`, unit `DEG`). The value color follows the HDG entry in\n * `priorityElements`, matching the HDG arrow.\n */\n @property({type: Boolean}) hasReadout: boolean = false;\n\n private _headingSp = new SetpointBundle({\n angularWraparound: true,\n onAnimationEnd: () => this.requestUpdate(),\n });\n\n // Cached computed values — updated in willUpdate()\n private _halfFOV = 30;\n private _arcHalfExtent = ARC_HALF_EXTENT;\n private _scale = 1;\n private _radiusOffset = 0;\n private _cachedViewBox = '';\n private _cachedArcFrame: ZoomToFitArcFrame | undefined;\n private _cachedAreas: WatchArea[] = [];\n private _cachedTickmarks: Tickmark[] = [];\n private _cachedAdvices: AngleAdviceRaw[] = [];\n\n override willUpdate(changed: PropertyValues): void {\n super.willUpdate(changed);\n this._headingSp.sync({\n setpoint: this.headingSetpoint ?? undefined,\n newSetpoint: this.newHeadingSetpoint,\n atSetpoint: this.atHeadingSetpoint,\n touching: this.touching,\n autoAtSetpoint: this.autoAtHeadingSetpoint,\n autoAtSetpointDeadband: this.autoAtHeadingSetpointDeadband,\n setpointAtZeroDeadband: this.headingSetpointAtZeroDeadband,\n setpointOverride: this.headingSetpointOverride,\n animateSetpoint: this.animateSetpoint,\n });\n\n const arcInputsChanged =\n changed.has('heading') ||\n changed.has('courseOverGround') ||\n changed.has('minFOV') ||\n changed.has('zoomToFitArc');\n\n if (arcInputsChanged) {\n let diff = this.courseOverGround - this.heading;\n if (diff > 180) diff -= 360;\n else if (diff < -180) diff += 360;\n const minFov = Math.max(1, this.minFOV);\n const MARGIN = 15;\n\n if (this.zoomToFitArc) {\n const needed = Math.max(minFov, Math.abs(diff) + MARGIN);\n if (needed <= ARC_HALF_EXTENT) {\n this._halfFOV = needed;\n this._arcHalfExtent = needed;\n this._scale = 1;\n } else {\n this._halfFOV = needed;\n this._arcHalfExtent = ARC_HALF_EXTENT;\n this._scale = ARC_HALF_EXTENT / needed;\n }\n } else {\n this._halfFOV = Math.max(minFov, Math.abs(diff));\n this._arcHalfExtent = ARC_HALF_EXTENT;\n this._scale = ARC_HALF_EXTENT / this._halfFOV;\n }\n\n this._cachedAreas = [\n {\n startAngle: this.heading - this._arcHalfExtent,\n endAngle: this.heading + this._arcHalfExtent,\n roundInsideCut: true,\n roundOutsideCut: true,\n },\n ];\n\n this._computeViewBox();\n this._cachedTickmarks = this._buildTickmarks();\n }\n\n if (arcInputsChanged || changed.has('headingAdvices')) {\n this._cachedAdvices = this._buildAdvices();\n }\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._headingSp.dispose();\n }\n\n // ---------------------------------------------------------------------------\n // Angle mapping — maps compass degrees to arc positions\n // ---------------------------------------------------------------------------\n\n private _mapAngle(compassDeg: number): number {\n let diff = compassDeg - this.heading;\n if (diff > 180) diff -= 360;\n else if (diff < -180) diff += 360;\n return this.heading + diff * this._scale;\n }\n\n // ---------------------------------------------------------------------------\n // Areas — fixed 120° arc centered on heading (built in willUpdate)\n // ---------------------------------------------------------------------------\n\n // ---------------------------------------------------------------------------\n // Tickmarks — compass-degree labels at mapped arc positions\n // ---------------------------------------------------------------------------\n\n private _buildTickmarks(): Tickmark[] {\n const fov = this._halfFOV * 2;\n const {mainInterval, primaryInterval, secondaryInterval} =\n tickDensityForFOV(fov);\n const halfFov = this._halfFOV;\n const compassStart = this.heading - halfFov;\n const compassEnd = this.heading + halfFov;\n\n const tickmarks: Tickmark[] = [];\n const added = new Set<number>();\n\n const addTick = (\n arcAngle: number,\n type: TickmarkType,\n text?: string\n ): void => {\n const key = Math.round(arcAngle * 1000);\n if (added.has(key)) return;\n added.add(key);\n tickmarks.push({angle: arcAngle, type, text});\n };\n\n const step = secondaryInterval ?? primaryInterval;\n const firstTick = Math.ceil(compassStart / step) * step;\n\n for (\n let compassDeg = firstTick;\n compassDeg <= compassEnd;\n compassDeg += step\n ) {\n const norm = normalizeAngle(compassDeg);\n const arcAngle = this._mapAngle(compassDeg);\n const isMain = norm % mainInterval === 0;\n const isPrimary = norm % primaryInterval === 0;\n\n if (isMain) {\n addTick(arcAngle, TickmarkType.main, Math.round(norm).toString());\n } else if (isPrimary) {\n addTick(arcAngle, TickmarkType.primary);\n } else {\n addTick(arcAngle, TickmarkType.secondary);\n }\n }\n\n return tickmarks;\n }\n\n // ---------------------------------------------------------------------------\n // ViewBox\n // ---------------------------------------------------------------------------\n\n private _computeViewBox(): void {\n if (this.zoomToFitArc) {\n const targetSize = (176 + PADDING) * 2;\n const frame = computeZoomToFitArcFrame({\n areas: this._cachedAreas,\n outerRadius: OUTER_RING_RADIUS,\n innerRadius: INNER_RADIUS,\n extension: PADDING,\n targetSize,\n });\n this._radiusOffset = frame.radiusOffset;\n this._cachedViewBox = frame.viewBox;\n this._cachedArcFrame = frame;\n } else {\n this._radiusOffset = 0;\n const width = (176 + PADDING) * 2;\n this._cachedViewBox = `-${width / 2} -${width / 2} ${width} ${width}`;\n this._cachedArcFrame = undefined;\n }\n }\n\n // ---------------------------------------------------------------------------\n // North arrow — rendered in overlay at mapped 0° position\n // ---------------------------------------------------------------------------\n\n private _renderNorthArrow(rOff: number) {\n let northOffset = -this.heading;\n if (northOffset > 180) northOffset -= 360;\n else if (northOffset < -180) northOffset += 360;\n if (Math.abs(northOffset) > this._halfFOV) return nothing;\n\n const northArcAngle = this._mapAngle(0);\n const radius = OUTER_RING_RADIUS + rOff;\n return svg`\n <g transform=\"rotate(${northArcAngle}) translate(0, ${-radius})\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M-17.8457 24.984 0 0 17.8458 24.984C11.9868 24.3338 6.0324 24 0 24-6.0323 24-11.9867 24.3338-17.8457 24.984Z\"\n fill=\"var(--instrument-frame-tertiary-color)\"/>\n </g>\n `;\n }\n\n // ---------------------------------------------------------------------------\n // Priority & advice helpers\n // ---------------------------------------------------------------------------\n\n private _angleInRange(value: number, min: number, max: number): boolean {\n const v = normalizeAngle(value);\n const start = normalizeAngle(min);\n const end = normalizeAngle(max);\n return start <= end ? v >= start && v <= end : v >= start || v <= end;\n }\n\n private _buildAdvices(): AngleAdviceRaw[] {\n return this.headingAdvices.map(({minAngle, maxAngle, hinted, type}) => {\n const state = this._angleInRange(this.heading, minAngle, maxAngle)\n ? AdviceState.triggered\n : hinted\n ? AdviceState.hinted\n : AdviceState.regular;\n return {\n minAngle: this._mapAngle(minAngle),\n maxAngle: this._mapAngle(maxAngle),\n type,\n state,\n };\n });\n }\n\n private get _effectiveRotDegPerMin(): number {\n return this.rateOfTurnDegreesPerMinute ?? this.rotationsPerMinute;\n }\n\n private get _rotEndAngle(): number {\n const maxVal = this.rotMaxValue || 1;\n const barCompassDeg =\n (this._effectiveRotDegPerMin / maxVal) * ARC_HALF_EXTENT;\n return this._mapAngle(this.heading + barCompassDeg);\n }\n\n private priorityFor(element: CompassSectorPriorityElement): Priority {\n const selected = Array.isArray(this.priorityElements)\n ? this.priorityElements\n : [];\n return selected.includes(element) ? this.priority : Priority.regular;\n }\n\n /**\n * Vertical placement of the readout as a percentage of the host height.\n *\n * With `zoomToFitArc` the arc is reframed by `computeZoomToFitArcFrame`, whose\n * `radiusOffset`/`viewBox` depend on the arc's *absolute* orientation (which\n * cardinal axes its bounding box crosses), not just its bend. The arc itself\n * is always rotated back to the top, so it stays put on screen — but a\n * frame-derived offset would swing wildly as `heading` rotates the bbox around\n * the circle. So in zoom we use a fixed offset, which keeps the readout steady\n * under the (stationary) arc regardless of heading.\n *\n * Without zoom the viewBox is the fixed, origin-symmetric 120° framing, so the\n * geometry is orientation-independent: place the readout halfway down the inner\n * radius from the watch center toward the arc's inner edge.\n */\n private get _readoutTopPercent(): number {\n if (this.zoomToFitArc) {\n return 70;\n }\n const [, vy, , vh] = this._cachedViewBox.split(' ').map(Number);\n if (!vh || Number.isNaN(vy)) {\n return 50;\n }\n const anchorY = -INNER_RADIUS * 0.5;\n return Math.round(((anchorY - vy) / vh) * 1000) / 10;\n }\n\n // ---------------------------------------------------------------------------\n // Render\n // ---------------------------------------------------------------------------\n\n override render() {\n const rotation = -this.heading;\n const viewBox = this._cachedViewBox;\n const rOff = this._radiusOffset;\n\n const mappedCOG = this._mapAngle(this.courseOverGround);\n const mappedSetpoint =\n this.headingSetpoint != null\n ? this._mapAngle(this.headingSetpoint)\n : undefined;\n const mappedNewSetpoint =\n this.newHeadingSetpoint != null\n ? this._mapAngle(this.newHeadingSetpoint)\n : undefined;\n\n return html`\n <div class=\"container\">\n <obc-watch\n .touching=${this.touching}\n .padding=${PADDING}\n .advices=${this._cachedAdvices}\n .tickmarks=${this._cachedTickmarks}\n .tickmarkStyle=${TickmarkStyle.regular}\n .tickmarksInside=${this.tickmarksInside}\n .state=${this.state}\n .watchCircleType=${WATCH_TYPE}\n .northArrow=${false}\n .areas=${this._cachedAreas}\n .arcFrame=${this._cachedArcFrame}\n .zoomToFitArc=${this.zoomToFitArc}\n .tickFadeAngle=${this._arcHalfExtent * 0.2}\n .rotation=${rotation}\n .angleSetpoint=${mappedSetpoint}\n .newAngleSetpoint=${mappedNewSetpoint}\n .atAngleSetpoint=${this._headingSp.computeAtSetpoint(this.heading)}\n .angleSetpointAtZeroDeadband=${this.headingSetpointAtZeroDeadband}\n .setpointOverride=${this.headingSetpointOverride}\n .priority=${this.priority}\n .animateSetpoint=${this.animateSetpoint}\n .rotType=${this.rotType}\n .rotPosition=${this.rotPosition}\n .rotStartAngle=${this.heading}\n .rotEndAngle=${this._rotEndAngle}\n .rotPriority=${this.priorityFor(CompassSectorPriorityElement.rot)}\n .rotPortStarboard=${this.rotPortStarboard}\n .rotAtZeroDeadband=${this.rotAtZeroDeadband}\n .rateOfTurnDegreesPerMinute=${this.rateOfTurnDegreesPerMinute}\n .rotDotAnimationFactor=${this.rotDotAnimationFactor}\n .rotationsPerMinute=${this.rotationsPerMinute}\n >\n </obc-watch>\n <svg viewBox=\"${viewBox}\" transform=\"rotate(${rotation})\">\n <g transform=\"rotate(${this.heading})\">\n <line\n x1=\"0\"\n y1=\"${-(SCALE_INNER_RADIUS + rOff)}\"\n x2=\"0\"\n y2=\"${-(INNER_RADIUS + rOff)}\"\n stroke=\"var(--instrument-frame-tertiary-color)\"\n stroke-width=\"1\"\n vector-effect=\"non-scaling-stroke\"\n />\n </g>\n ${this._renderNorthArrow(rOff)}\n ${arrow(\n ArrowStyle.HDG,\n this.heading,\n this.priorityFor(CompassSectorPriorityElement.hdg),\n rOff\n )}\n ${arrow(\n ArrowStyle.COG,\n mappedCOG,\n this.priorityFor(CompassSectorPriorityElement.cog),\n rOff\n )}\n </svg>\n ${this.hasReadout\n ? html`<div class=\"readout\" style=\"top: ${this._readoutTopPercent}%\">\n <obc-readout\n .variant=${ReadoutVariant.enhanced}\n .direction=${ReadoutDirection.vertical}\n .hasSetpoint=${false}\n .hasAdvice=${false}\n .value=${this.heading}\n .fractionDigits=${0}\n .valuePriority=${this.priorityFor(\n CompassSectorPriorityElement.hdg\n )}\n label=\"HDG\"\n unit=\"DEG\"\n ></obc-readout>\n </div>`\n : nothing}\n </div>\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-compass-sector': ObcCompassSector;\n }\n}\n"],"names":["CompassSectorPriorityElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA2BO,IAAK,iDAAAA,kCAAL;AACLA,gCAAA,KAAA,IAAM;AACNA,gCAAA,KAAA,IAAM;AACNA,gCAAA,KAAA,IAAM;AAHI,SAAAA;AAAA,GAAA,gCAAA,CAAA,CAAA;AAMZ,MAAM,UAAU;AAChB,MAAM,aAAa,gBAAgB;AACnC,MAAM,eAAe,mBAAmB,UAAU;AAElD,MAAM,kBAAkB;AACxB,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