@oicl/openbridge-webcomponents-full-bundle 2.2.0-next.18 → 2.2.0-next.19

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 (50) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +141 -145
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +593 -2034
  4. package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.d.ts +20 -0
  5. package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.d.ts.map +1 -1
  6. package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.js +1 -0
  7. package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.js.map +1 -1
  8. package/dist/automation/automation-button/abstract-automation-button.d.ts +5 -5
  9. package/dist/automation/automation-button/abstract-automation-button.d.ts.map +1 -1
  10. package/dist/automation/automation-button/abstract-automation-button.js +21 -47
  11. package/dist/automation/automation-button/abstract-automation-button.js.map +1 -1
  12. package/dist/automation/automation-button/badge-layout.d.ts +5 -7
  13. package/dist/automation/automation-button/badge-layout.d.ts.map +1 -1
  14. package/dist/automation/automation-button/badge-layout.js +32 -14
  15. package/dist/automation/automation-button/badge-layout.js.map +1 -1
  16. package/dist/automation/automation-button/badge-settings-controller.d.ts +11 -0
  17. package/dist/automation/automation-button/badge-settings-controller.d.ts.map +1 -0
  18. package/dist/automation/automation-button/badge-settings-controller.js +13 -0
  19. package/dist/automation/automation-button/badge-settings-controller.js.map +1 -0
  20. package/dist/automation/automation-button/badge-symbols.d.ts +37 -0
  21. package/dist/automation/automation-button/badge-symbols.d.ts.map +1 -0
  22. package/dist/automation/automation-button/badge-symbols.js +84 -0
  23. package/dist/automation/automation-button/badge-symbols.js.map +1 -0
  24. package/dist/automation/automation-tank/automation-tank.d.ts +5 -4
  25. package/dist/automation/automation-tank/automation-tank.d.ts.map +1 -1
  26. package/dist/automation/automation-tank/automation-tank.js +13 -47
  27. package/dist/automation/automation-tank/automation-tank.js.map +1 -1
  28. package/dist/automation/specialty-tank/abstract-specialty-tank.d.ts +5 -4
  29. package/dist/automation/specialty-tank/abstract-specialty-tank.d.ts.map +1 -1
  30. package/dist/automation/specialty-tank/abstract-specialty-tank.js +14 -47
  31. package/dist/automation/specialty-tank/abstract-specialty-tank.js.map +1 -1
  32. package/dist/automation/specialty-tank/specialty-tank-story-meta.d.ts +6 -1
  33. package/dist/automation/specialty-tank/specialty-tank-story-meta.d.ts.map +1 -1
  34. package/dist/automation/specialty-tank/specialty-tank-story-meta.js +10 -0
  35. package/dist/automation/specialty-tank/specialty-tank-story-meta.js.map +1 -1
  36. package/package.json +1 -1
  37. package/src/automation/automation-button/abstract-automation-button-storybook-helpers.ts +3 -0
  38. package/src/automation/automation-button/abstract-automation-button.ts +39 -81
  39. package/src/automation/automation-button/badge-layout.ts +13 -21
  40. package/src/automation/automation-button/badge-settings-controller.ts +33 -0
  41. package/src/automation/automation-button/badge-symbols.spec.ts +203 -0
  42. package/src/automation/automation-button/badge-symbols.ts +178 -0
  43. package/src/automation/automation-tank/automation-tank.stories.ts +15 -0
  44. package/src/automation/automation-tank/automation-tank.ts +36 -73
  45. package/src/automation/heat-exchanger/heat-exchanger.stories.ts +2 -0
  46. package/src/automation/heat-pump/heat-pump.stories.ts +2 -0
  47. package/src/automation/hydraulic-separator/hydraulic-separator.stories.ts +2 -0
  48. package/src/automation/pump/pump.stories.ts +44 -0
  49. package/src/automation/specialty-tank/abstract-specialty-tank.ts +36 -73
  50. package/src/automation/specialty-tank/specialty-tank-story-meta.ts +19 -1
@@ -0,0 +1,84 @@
1
+ import { ObcAutomationBadgeType } from "../automation-badge/automation-badge.js";
2
+ import { GlobalSetting } from "../../internal/global-setting.js";
3
+ // src/automation/automation-button/badge-symbols.ts
4
+ var groups = [
5
+ "control",
6
+ "alert",
7
+ "interlock",
8
+ "commandLocked"
9
+ ];
10
+ var T = ObcAutomationBadgeType;
11
+ var symbols = {
12
+ control: {
13
+ local: T.Local,
14
+ "local-only": T.LocalOnly,
15
+ manual: T.Manual,
16
+ "manual-only": T.ManualOnly,
17
+ auto: T.Auto
18
+ },
19
+ alert: {
20
+ silence: T.AlertSilenced,
21
+ shelved: T.AlertShelved,
22
+ caution: T.Caution,
23
+ warning: T.Warning,
24
+ alarm: T.Alarm,
25
+ "level-critical": T.LevelCritical,
26
+ "level-high": T.LevelHigh,
27
+ "level-medium": T.LevelMedium,
28
+ "level-low": T.LevelLow,
29
+ "level-diagnostic": T.LevelDiagnostic
30
+ },
31
+ interlock: {
32
+ interlock: T.Interlock,
33
+ "interlock-inhibit": T.InterlockInhibit,
34
+ simulation: T.Simulation
35
+ },
36
+ commandLocked: {
37
+ "command-locked": T.CommandLocked,
38
+ simulation: T.Simulation
39
+ }
40
+ };
41
+ /**
42
+ * The badge type a badge property value draws: the letter `override` names
43
+ * for it, else its symbol. `null` for `none`.
44
+ */
45
+ function automationBadgeType(group, value, override) {
46
+ const table = symbols[group];
47
+ if (!Object.prototype.hasOwnProperty.call(table, value)) return null;
48
+ const symbol = table[value];
49
+ const letter = (override?.[group])?.[value];
50
+ return letter ? `letter-${letter.toLowerCase()}` : symbol;
51
+ }
52
+ /** `base` with the letters `override` names put on top of it. */
53
+ function mergeBadgeSymbolOverride(base, override) {
54
+ const result = { ...base };
55
+ if (!override) return result;
56
+ for (const group of groups) {
57
+ const letters = override[group];
58
+ if (!letters) continue;
59
+ const merged = { ...base?.[group] };
60
+ for (const [value, letter] of Object.entries(letters)) if (letter !== void 0) merged[value] = letter;
61
+ Object.assign(result, { [group]: merged });
62
+ }
63
+ return result;
64
+ }
65
+ /** The app-wide letters; a device re-renders on a change through `BadgeSettingsController`. */
66
+ var badgeSymbolOverrideSetting = new GlobalSetting({});
67
+ /**
68
+ * Sets the letters that replace badge symbols on every automation device on
69
+ * the page, and re-renders the ones already connected. `undefined` restores
70
+ * the symbols.
71
+ */
72
+ function setAutomationBadgeSymbolOverride(override) {
73
+ badgeSymbolOverrideSetting.set(mergeBadgeSymbolOverride(void 0, override));
74
+ }
75
+ function getAutomationBadgeSymbolOverride() {
76
+ return mergeBadgeSymbolOverride(void 0, badgeSymbolOverrideSetting.get());
77
+ }
78
+ /** The app-wide letters with a device's own letters on top. */
79
+ function currentBadgeSymbolOverride(local) {
80
+ return mergeBadgeSymbolOverride(badgeSymbolOverrideSetting.get(), local);
81
+ }
82
+ export { automationBadgeType, badgeSymbolOverrideSetting, currentBadgeSymbolOverride, getAutomationBadgeSymbolOverride, mergeBadgeSymbolOverride, setAutomationBadgeSymbolOverride };
83
+
84
+ //# sourceMappingURL=badge-symbols.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badge-symbols.js","names":[],"sources":["../../../src/automation/automation-button/badge-symbols.ts"],"sourcesContent":["/**\n * Badge symbols of the automation devices, and letters that replace them.\n *\n * Maps each value of the four badge properties (`badgeControl`, `badgeAlert`,\n * `badgeInterlock`, `badgeCommandLocked`) to the `obc-automation-badge` type\n * it draws. An app can draw a letter instead of a symbol: for every device\n * with `setAutomationBadgeSymbolOverride()`, for one device with its\n * `badgeSymbolOverride` property, which wins over the app-wide one.\n *\n * Merge rules, per badge value:\n * - a value left out keeps the letter underneath it, or the symbol,\n * - `null` brings the symbol back, over an app-wide letter.\n *\n * ```ts\n * setAutomationBadgeSymbolOverride({commandLocked: {simulation: 's'}});\n * ```\n *\n * The buttons, `obc-automation-tank` and the specialty tanks all read this\n * module, so the four enums map to the same badge everywhere.\n *\n * @module\n */\nimport type {\n AutomationButtonBadgeAlert,\n AutomationButtonBadgeCommandLocked,\n AutomationButtonBadgeControl,\n AutomationButtonBadgeInterlock,\n} from './abstract-automation-button.js';\nimport {ObcAutomationBadgeType} from '../automation-badge/automation-badge.js';\nimport {GlobalSetting} from '../../internal/global-setting.js';\n\n/** The letters `obc-automation-badge` draws: `letter-a` to `letter-z`. */\ntype LowercaseLetter = `${ObcAutomationBadgeType}` extends infer Type\n ? Type extends `letter-${infer Letter}`\n ? Letter\n : never\n : never;\n\n/** One letter, either case; the badge draws it as a capital. */\nexport type AutomationBadgeLetter =\n LowercaseLetter | Uppercase<LowercaseLetter>;\n\n/** A letter per badge value. `null` keeps the symbol. */\nexport type AutomationBadgeLetters<Value extends string> = Partial<\n Record<Exclude<`${Value}`, 'none'>, AutomationBadgeLetter | null>\n>;\n\n/** Letters that replace badge symbols, per badge property. */\nexport interface AutomationBadgeSymbolOverride {\n control?: AutomationBadgeLetters<AutomationButtonBadgeControl>;\n alert?: AutomationBadgeLetters<AutomationButtonBadgeAlert>;\n interlock?: AutomationBadgeLetters<AutomationButtonBadgeInterlock>;\n commandLocked?: AutomationBadgeLetters<AutomationButtonBadgeCommandLocked>;\n}\n\nexport type AutomationBadgeGroup = keyof AutomationBadgeSymbolOverride;\n\nconst groups: AutomationBadgeGroup[] = [\n 'control',\n 'alert',\n 'interlock',\n 'commandLocked',\n];\n\nconst T = ObcAutomationBadgeType;\n\nconst symbols = {\n control: {\n local: T.Local,\n 'local-only': T.LocalOnly,\n manual: T.Manual,\n 'manual-only': T.ManualOnly,\n auto: T.Auto,\n },\n alert: {\n silence: T.AlertSilenced,\n shelved: T.AlertShelved,\n caution: T.Caution,\n warning: T.Warning,\n alarm: T.Alarm,\n 'level-critical': T.LevelCritical,\n 'level-high': T.LevelHigh,\n 'level-medium': T.LevelMedium,\n 'level-low': T.LevelLow,\n 'level-diagnostic': T.LevelDiagnostic,\n },\n interlock: {\n interlock: T.Interlock,\n 'interlock-inhibit': T.InterlockInhibit,\n simulation: T.Simulation,\n },\n commandLocked: {\n 'command-locked': T.CommandLocked,\n simulation: T.Simulation,\n },\n} satisfies {\n [G in AutomationBadgeGroup]-?: Record<\n keyof NonNullable<AutomationBadgeSymbolOverride[G]>,\n ObcAutomationBadgeType\n >;\n};\n\n/**\n * The badge type a badge property value draws: the letter `override` names\n * for it, else its symbol. `null` for `none`.\n */\nexport function automationBadgeType(\n group: AutomationBadgeGroup,\n value: string,\n override?: AutomationBadgeSymbolOverride\n): ObcAutomationBadgeType | null {\n const table = symbols[group] as Record<string, ObcAutomationBadgeType>;\n // A value from an attribute can name an inherited key such as `toString`.\n if (!Object.prototype.hasOwnProperty.call(table, value)) {\n return null;\n }\n const symbol = table[value];\n const letters = override?.[group] as\n Record<string, AutomationBadgeLetter | null | undefined> | undefined;\n const letter = letters?.[value];\n return letter\n ? (`letter-${letter.toLowerCase()}` as ObcAutomationBadgeType)\n : symbol;\n}\n\n/** `base` with the letters `override` names put on top of it. */\nexport function mergeBadgeSymbolOverride(\n base: AutomationBadgeSymbolOverride | undefined,\n override: AutomationBadgeSymbolOverride | undefined\n): AutomationBadgeSymbolOverride {\n const result: AutomationBadgeSymbolOverride = {...base};\n if (!override) {\n return result;\n }\n for (const group of groups) {\n const letters = override[group];\n if (!letters) {\n continue;\n }\n // An entry set to `undefined` is left out, like a layout corner; `null` is kept.\n const merged: Record<string, AutomationBadgeLetter | null> = {\n ...base?.[group],\n };\n for (const [value, letter] of Object.entries(letters)) {\n if (letter !== undefined) {\n merged[value] = letter;\n }\n }\n Object.assign(result, {[group]: merged});\n }\n return result;\n}\n\n/** The app-wide letters; a device re-renders on a change through `BadgeSettingsController`. */\nexport const badgeSymbolOverrideSetting =\n new GlobalSetting<AutomationBadgeSymbolOverride>({});\n\n/**\n * Sets the letters that replace badge symbols on every automation device on\n * the page, and re-renders the ones already connected. `undefined` restores\n * the symbols.\n */\nexport function setAutomationBadgeSymbolOverride(\n override: AutomationBadgeSymbolOverride | undefined\n): void {\n badgeSymbolOverrideSetting.set(mergeBadgeSymbolOverride(undefined, override));\n}\n\nexport function getAutomationBadgeSymbolOverride(): AutomationBadgeSymbolOverride {\n return mergeBadgeSymbolOverride(undefined, badgeSymbolOverrideSetting.get());\n}\n\n/** The app-wide letters with a device's own letters on top. */\nexport function currentBadgeSymbolOverride(\n local: AutomationBadgeSymbolOverride | undefined\n): AutomationBadgeSymbolOverride {\n return mergeBadgeSymbolOverride(badgeSymbolOverrideSetting.get(), local);\n}\n"],"mappings":";;;A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,IAAI,yBAAyB,KAAA,GAAW,QAAQ,CAAC;AAC9E;AAEA,SAAgB,mCAAkE;CAChF,OAAO,yBAAyB,KAAA,GAAW,2BAA2B,IAAI,CAAC;AAC7E;;AAGA,SAAgB,2BACd,OAC+B;CAC/B,OAAO,yBAAyB,2BAA2B,IAAI,GAAG,KAAK;AACzE"}
@@ -1,5 +1,6 @@
1
1
  import { HTMLTemplateResult, LitElement, nothing, PropertyValues } from 'lit';
2
2
  import { LineMedium } from '../index.js';
3
+ import { AutomationBadgeSymbolOverride } from '../automation-button/badge-symbols.js';
3
4
  import { AutomationButtonBadgeAlert, AutomationButtonBadgeCommandLocked, AutomationButtonBadgeControl, AutomationButtonBadgeInterlock } from '../automation-button/abstract-automation-button.js';
4
5
  import { Priority } from '../../navigation-instruments/types.js';
5
6
  import { ObcAlertFrameMode, ObcAlertFrameThickness, ObcAlertFrameType } from '../../components/alert-frame/alert-frame.js';
@@ -132,6 +133,7 @@ declare const ObcAutomationTank_base: (new (...args: any[]) => import('../../svg
132
133
  * `<obc-automation-badge>` as fallback content for the `badges` slot, so any
133
134
  * slotted content wins. The cell orders the four badges control, alert,
134
135
  * interlock, commandLocked, left to right.
136
+ * @property badgeSymbolOverride - Letters that replace badge symbols on this device, per badge property and value, on top of the app-wide ones set with `setAutomationBadgeSymbolOverride()`; for example `{commandLocked: {simulation: 's'}}`. `null` brings the symbol back.
135
137
  * @slot badges - Custom badges to be displayed in the badge area.
136
138
  * @slot tag - Text or element for the tank's tag/label.
137
139
  * @slot readout - Replaces the entire readout content block.
@@ -229,6 +231,9 @@ export declare class ObcAutomationTank extends ObcAutomationTank_base {
229
231
  badgeAlert: AutomationButtonBadgeAlert;
230
232
  badgeInterlock: AutomationButtonBadgeInterlock;
231
233
  badgeCommandLocked: AutomationButtonBadgeCommandLocked;
234
+ /** Letters that replace badge symbols on this device, per badge property and value, on top of the app-wide ones set with `setAutomationBadgeSymbolOverride()`; for example `{commandLocked: {simulation: 's'}}`. `null` brings the symbol back. */
235
+ badgeSymbolOverride: AutomationBadgeSymbolOverride | undefined;
236
+ constructor();
232
237
  private _cellWidth;
233
238
  private _cellHeight;
234
239
  /**
@@ -250,10 +255,6 @@ export declare class ObcAutomationTank extends ObcAutomationTank_base {
250
255
  private _chartResizeObserver?;
251
256
  private _observedCell?;
252
257
  private get isCompact();
253
- private _badgeAlertType;
254
- private _badgeControlType;
255
- private _badgeInterlockType;
256
- private _badgeCommandLockedType;
257
258
  private get _usesGaugeTrend();
258
259
  private _onBadgesSlotChange;
259
260
  private _onTagSlotChange;
@@ -1 +1 @@
1
- {"version":3,"file":"automation-tank.d.ts","sourceRoot":"","sources":["../../../src/automation/automation-tank/automation-tank.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,UAAU,EAEV,OAAO,EAGP,cAAc,EACf,MAAM,KAAK,CAAC;AAGb,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AACvC,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EACL,0BAA0B,EAC1B,kCAAkC,EAClC,4BAA4B,EAC5B,8BAA8B,EAC/B,MAAM,oDAAoD,CAAC;AAE5D,OAAO,8CAA8C,CAAC;AACtD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,gDAAgD,CAAC;AACxD,OAAO,yCAAyC,CAAC;AACjD,OAAO,wCAAwC,CAAC;AAChD,OAAO,yBAAyB,CAAC;AACjC,OAAO,0BAA0B,CAAC;AAClC,OAAO,oCAAoC,CAAC;AAC5C,OAAO,yDAAyD,CAAC;AACjE,OAAO,oDAAoD,CAAC;AAC5D,OAAO,6CAA6C,CAAC;AACrD,OAAO,EAAC,QAAQ,EAAC,MAAM,uCAAuC,CAAC;AAC/D,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,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AAG,OAAO,OAAO;IA0BhD;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,oBAAoB;IA4I5B,OAAO,CAAC,SAAS;IAaR,UAAU,CAAC,OAAO,EAAE,cAAc;IAKlC,MAAM;IAoXf,OAAgB,MAAM,0BAA2B;CAClD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,qBAAqB,EAAE,iBAAiB,CAAC;KAC1C;CACF"}
1
+ {"version":3,"file":"automation-tank.d.ts","sourceRoot":"","sources":["../../../src/automation/automation-tank/automation-tank.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,UAAU,EAEV,OAAO,EAGP,cAAc,EACf,MAAM,KAAK,CAAC;AAGb,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AACvC,OAAO,yCAAyC,CAAC;AACjD,OAAO,EACL,6BAA6B,EAG9B,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EACL,0BAA0B,EAC1B,kCAAkC,EAClC,4BAA4B,EAC5B,8BAA8B,EAC/B,MAAM,oDAAoD,CAAC;AAE5D,OAAO,8CAA8C,CAAC;AACtD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,gDAAgD,CAAC;AACxD,OAAO,yCAAyC,CAAC;AACjD,OAAO,wCAAwC,CAAC;AAChD,OAAO,yBAAyB,CAAC;AACjC,OAAO,0BAA0B,CAAC;AAClC,OAAO,oCAAoC,CAAC;AAC5C,OAAO,yDAAyD,CAAC;AACjE,OAAO,oDAAoD,CAAC;AAC5D,OAAO,6CAA6C,CAAC;AACrD,OAAO,EAAC,QAAQ,EAAC,MAAM,uCAAuC,CAAC;AAC/D,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,qDAAqD,CAAC;AAE3F,OAAO,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AAC,SAAS;IAaR,UAAU,CAAC,OAAO,EAAE,cAAc;IAKlC,MAAM;IAqYf,OAAgB,MAAM,0BAA2B;CAClD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,qBAAqB,EAAE,iBAAiB,CAAC;KAC1C;CACF"}
@@ -1,6 +1,8 @@
1
1
  import automation_tank_default from "./automation-tank.css_inline.js";
2
2
  import { LineMedium } from "../index.js";
3
- import { ObcAutomationBadgeType } from "../automation-badge/automation-badge.js";
3
+ import "../automation-badge/automation-badge.js";
4
+ import { automationBadgeType, currentBadgeSymbolOverride } from "../automation-button/badge-symbols.js";
5
+ import { BadgeSettingsController } from "../automation-button/badge-settings-controller.js";
4
6
  import { AutomationButtonBadgeAlert, AutomationButtonBadgeCommandLocked, AutomationButtonBadgeControl, AutomationButtonBadgeInterlock } from "../automation-button/abstract-automation-button.js";
5
7
  import "../../icons/icon-chevron-double-up-google.js";
6
8
  import "../../icons/icon-chevron-up-google.js";
@@ -57,8 +59,8 @@ var TankChartMode = /* @__PURE__ */ function(TankChartMode) {
57
59
  return TankChartMode;
58
60
  }({});
59
61
  var ObcAutomationTank = class ObcAutomationTank extends AdviceMixin(SetpointMixin(LitElement)) {
60
- constructor(..._args) {
61
- super(..._args);
62
+ constructor() {
63
+ super();
62
64
  this.medium = LineMedium.water;
63
65
  this.value = 0;
64
66
  this.max = 100;
@@ -89,55 +91,17 @@ var ObcAutomationTank = class ObcAutomationTank extends AdviceMixin(SetpointMixi
89
91
  this.badgeAlert = AutomationButtonBadgeAlert.None;
90
92
  this.badgeInterlock = AutomationButtonBadgeInterlock.None;
91
93
  this.badgeCommandLocked = AutomationButtonBadgeCommandLocked.None;
94
+ this.badgeSymbolOverride = void 0;
92
95
  this._cellWidth = 0;
93
96
  this._cellHeight = 0;
94
97
  this._hasBadges = false;
95
98
  this._hasTagSlot = false;
96
99
  this._hasRichSlot = false;
100
+ new BadgeSettingsController(this);
97
101
  }
98
102
  get isCompact() {
99
103
  return this.compact || this.static;
100
104
  }
101
- _badgeAlertType() {
102
- switch (this.badgeAlert) {
103
- case AutomationButtonBadgeAlert.Silence: return ObcAutomationBadgeType.AlertSilenced;
104
- case AutomationButtonBadgeAlert.Shelved: return ObcAutomationBadgeType.AlertShelved;
105
- case AutomationButtonBadgeAlert.Caution: return ObcAutomationBadgeType.Caution;
106
- case AutomationButtonBadgeAlert.Warning: return ObcAutomationBadgeType.Warning;
107
- case AutomationButtonBadgeAlert.Alarm: return ObcAutomationBadgeType.Alarm;
108
- case AutomationButtonBadgeAlert.LevelCritical: return ObcAutomationBadgeType.LevelCritical;
109
- case AutomationButtonBadgeAlert.LevelHigh: return ObcAutomationBadgeType.LevelHigh;
110
- case AutomationButtonBadgeAlert.LevelMedium: return ObcAutomationBadgeType.LevelMedium;
111
- case AutomationButtonBadgeAlert.LevelLow: return ObcAutomationBadgeType.LevelLow;
112
- case AutomationButtonBadgeAlert.LevelDiagnostic: return ObcAutomationBadgeType.LevelDiagnostic;
113
- default: return null;
114
- }
115
- }
116
- _badgeControlType() {
117
- switch (this.badgeControl) {
118
- case AutomationButtonBadgeControl.Local: return ObcAutomationBadgeType.Local;
119
- case AutomationButtonBadgeControl.LocalOnly: return ObcAutomationBadgeType.LocalOnly;
120
- case AutomationButtonBadgeControl.Manual: return ObcAutomationBadgeType.Manual;
121
- case AutomationButtonBadgeControl.ManualOnly: return ObcAutomationBadgeType.ManualOnly;
122
- case AutomationButtonBadgeControl.Auto: return ObcAutomationBadgeType.Auto;
123
- default: return null;
124
- }
125
- }
126
- _badgeInterlockType() {
127
- switch (this.badgeInterlock) {
128
- case AutomationButtonBadgeInterlock.Interlock: return ObcAutomationBadgeType.Interlock;
129
- case AutomationButtonBadgeInterlock.InterlockInhibit: return ObcAutomationBadgeType.InterlockInhibit;
130
- case AutomationButtonBadgeInterlock.Simulation: return ObcAutomationBadgeType.Simulation;
131
- default: return null;
132
- }
133
- }
134
- _badgeCommandLockedType() {
135
- switch (this.badgeCommandLocked) {
136
- case AutomationButtonBadgeCommandLocked.CommandLocked: return ObcAutomationBadgeType.CommandLocked;
137
- case AutomationButtonBadgeCommandLocked.Simulation: return ObcAutomationBadgeType.Simulation;
138
- default: return null;
139
- }
140
- }
141
105
  get _usesGaugeTrend() {
142
106
  return this.chartMode === "graph" || this.chartMode === "graph-and-bar";
143
107
  }
@@ -345,10 +309,11 @@ var ObcAutomationTank = class ObcAutomationTank extends AdviceMixin(SetpointMixi
345
309
  const safeMax = this.max > 0 ? this.max : 1;
346
310
  const percent = clamp(this.value / safeMax * 100, 0, 100);
347
311
  const isCompact = this.isCompact;
348
- const controlBadge = this._badgeControlType();
349
- const alertBadge = this._badgeAlertType();
350
- const interlockBadge = this._badgeInterlockType();
351
- const commandLockedBadge = this._badgeCommandLockedType();
312
+ const symbolOverride = currentBadgeSymbolOverride(this.badgeSymbolOverride);
313
+ const controlBadge = automationBadgeType("control", this.badgeControl, symbolOverride);
314
+ const alertBadge = automationBadgeType("alert", this.badgeAlert, symbolOverride);
315
+ const interlockBadge = automationBadgeType("interlock", this.badgeInterlock, symbolOverride);
316
+ const commandLockedBadge = automationBadgeType("commandLocked", this.badgeCommandLocked, symbolOverride);
352
317
  const hasEnumBadges = controlBadge !== null || alertBadge !== null || interlockBadge !== null || commandLockedBadge !== null;
353
318
  const badgesHidden = isCompact && !this._hasBadges && !hasEnumBadges;
354
319
  const tagHidden = isCompact && !this._hasTagSlot && !this.tag;
@@ -679,6 +644,7 @@ __decorate([property({ type: String })], ObcAutomationTank.prototype, "badgeCont
679
644
  __decorate([property({ type: String })], ObcAutomationTank.prototype, "badgeAlert", void 0);
680
645
  __decorate([property({ type: String })], ObcAutomationTank.prototype, "badgeInterlock", void 0);
681
646
  __decorate([property({ type: String })], ObcAutomationTank.prototype, "badgeCommandLocked", void 0);
647
+ __decorate([property({ attribute: false })], ObcAutomationTank.prototype, "badgeSymbolOverride", void 0);
682
648
  __decorate([state()], ObcAutomationTank.prototype, "_cellWidth", void 0);
683
649
  __decorate([state()], ObcAutomationTank.prototype, "_cellHeight", void 0);
684
650
  __decorate([state()], ObcAutomationTank.prototype, "_hasBadges", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"automation-tank.js","names":["compentStyle","_decorate"],"sources":["../../../src/automation/automation-tank/automation-tank.ts"],"sourcesContent":["import {\n HTMLTemplateResult,\n LitElement,\n html,\n nothing,\n svg,\n unsafeCSS,\n PropertyValues,\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-arrow-right-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 ObcAlertFrameMode,\n ObcAlertFrameThickness,\n ObcAlertFrameType,\n} from '../../components/alert-frame/alert-frame.js';\nimport {AlertType} from '../../types.js';\nimport type {ChartLineDataItem} from '../../building-blocks/chart-line/chart-line-base.js';\nimport {AdviceMixin, syncAdviceAlias} from '../../svghelpers/advice-mixin.js';\nimport type {AdviceInput} from '../../svghelpers/advice.js';\nimport {\n AdvicePosition,\n ExternalScaleSide,\n FillMode,\n ScaleType,\n computeOutsideBarThickness,\n} from '../../building-blocks/external-scale/external-scale.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement} from '../../decorator.js';\nimport {SetpointMixin} from '../../svghelpers/setpoint-mixin.js';\nimport {TankPositioning} from './tank-positioning.js';\nimport {clamp} from '../../svghelpers/math.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\nexport {TankPositioning};\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 *\n *\n * Setpoint properties are inherited from {@link SetpointMixin}\n * (`setpoint`, `newSetpoint`, `touching`, `atSetpoint`, `autoAtSetpoint`,\n * `autoAtSetpointDeadband`, `setpointAtZeroDeadband`, `setpointOverride`,\n * `animateSetpoint`) and are forwarded to the embedded chart: the SVG bar in\n * `bar` mode, or `obc-gauge-trend` in the graph modes (where the marker\n * renders on the side bar, i.e. `graph-and-bar`). Values share the tank's\n * `value` / `max` scale.\n *\n * @property positioning - Host positioning model — see `TankPositioning` for details. Defaults to\n * `button` (host fills parent container, 100% × 100%, falling back to the\n * design aspect ratio on any axis the parent leaves indefinite, no anchor\n * offset). Set to `point` for the legacy P&ID canvas mode (fixed default\n * dimensions + top-center anchor offset).\n * @property activated - Enables the activated background color, used to indicate that the tank is\n * activated/selected. Requires an interactive tank — the `noClick` mixin\n * variant used when `clickable` is `false` only paints the enabled state, so\n * a non-clickable tank ignores this (matching `obc-elevated-card`).\n * @availableWhen activated clickable==true\n * @property chartData - Time-series data points for the embedded gauge-trend (graph modes only).\n * @property priority - Priority hint forwarded to child charts (regular | enhanced).\n * @property advice - 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 * @property hasAdvice - Show advice overlays (works in all `chartMode` variants).\n * @property alert - Show an `<obc-alert-frame>` overlay around the bordered tank area (the\n * `.halo` wrapper). Mirrors the API of `obc-automation-button`: same seven\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 * @property alertFrameType - Shape of the alert frame.\n * @availableWhen alertFrameType alert==true\n * @property alertFrameThickness - Thickness of the alert frame.\n * @availableWhen alertFrameThickness alert==true\n * @property alertFrameStatus - Alert status the frame is coloured for.\n * @availableWhen alertFrameStatus alert==true\n * @property alertFrameMode - Acknowledgement state of the alert: `acked-active` (default) is steady,\n * `unacked-active` flashes, `unacked-rectified` flashes a dashed frame.\n * @availableWhen alertFrameMode alert==true\n * @property showAlertCategoryIcon - Shows the alert category icon inside the frame.\n * @availableWhen showAlertCategoryIcon alert==true && alertFrameType in [SmallSideFlip, LargeSideFlip, BottomFlip, TopFlip]\n * @property showAlertIcon - Shows the slotted alert icon inside the frame.\n * @availableWhen showAlertIcon alert==true && alertFrameType in [LargeSideFlip, BottomFlip, TopFlip]\n * @property showTrendSymbol - 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 * @property percentFractionDigits - 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 * @property static - Display-only variant for a device whose current state is unknown: the\n * chart cell is hidden, the bordered area is filled with\n * `--container-section-color` and the readout is centred inside it. Always\n * compact-sized, so it overrides `compact`, and it renders as a\n * `<div role=\"img\">` — outside the tab order and not announced as a control.\n * @property clickable - Whether the tank is interactive. `true` renders the root as a `<button>`\n * with the flat-mixin interaction surface; `false` renders a `<div>` that\n * keeps the resting appearance (the mixin's `noClick` variant) but loses\n * hover, pressed and focus-visible and leaves the tab order. Everything\n * else — chart, badges, readout, tag and the alert frame — still renders,\n * so use it for a display-only tank that shows live data. No effect on a\n * `static` tank, which is already non-interactive.\n * @property chartMode - Chart cell rendering mode: `bar` (default) is a static fill bar driven by\n * `value` and `max`, `graph` embeds an `obc-gauge-trend` line/area chart,\n * and `graphAndBar` embeds one with an integrated side bar.\n * @property hasGraphIcon - Overlays a decorative icon centred on the chart cell — the energy-battery\n * icon for a battery tank, the generic tank icon otherwise. Works in every\n * `chartMode` and both orientations; the icon sits in a fixed CSS layer\n * above the bar or graph and is silhouetted so it stays legible on any\n * fill, and its size follows the ambient `obc-component-size-*` class.\n * @property badgeControl - Control badge rendered in the `badges` cell. A non-`None` value renders an\n * `<obc-automation-badge>` as fallback content for the `badges` slot, so any\n * slotted content wins. The cell orders the four badges control, alert,\n * interlock, commandLocked, left to right.\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 - Detail rows below the main readout, shown in the regular\n * (non-compact, non-static) layout. Slot an `<obc-readout-list>` of\n * `<obc-readout-list-item>` rows — it owns the row typography and cross-row\n * column alignment; the tank renders a divider above it automatically when\n * the slot is filled.\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 * @fires click - Fired when the tank is clicked. When `clickable` is `false` the tank renders a plain `<div>`, and in `static` mode a `<div role=\"img\">`, instead of a `<button>` — in both cases it is not focusable or keyboard-activatable; pointer clicks still reach the host.\n * @beta\n */\n@customElement('obc-automation-tank')\nexport class ObcAutomationTank extends AdviceMixin(SetpointMixin(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 @property({type: String, reflect: true}) positioning: TankPositioning =\n TankPositioning.button;\n @property({type: Boolean, reflect: true}) static: boolean = false;\n @property({type: Boolean, attribute: false}) clickable: boolean = true;\n @property({type: Boolean}) activated: boolean = false;\n @property({type: String}) tag: string = '';\n\n @property({type: String, reflect: true, attribute: 'chart-mode'})\n chartMode: TankChartMode = TankChartMode.bar;\n\n @property({type: Array, attribute: false})\n chartData: ChartLineDataItem[] = [];\n\n @property({type: String}) priority: Priority = Priority.regular;\n\n /** @deprecated Alias of `advices`. Ranges in tank units. */\n @property({type: Array, attribute: false}) advice?: AdviceInput[];\n\n @property({type: Boolean}) hasAdvice = false;\n\n @property({type: Boolean, attribute: false}) hasGraphIcon = false;\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: AlertType = AlertType.Alarm;\n @property({type: String}) alertFrameMode: ObcAlertFrameMode =\n ObcAlertFrameMode.ackedActive;\n @property({type: Boolean, attribute: false}) showAlertCategoryIcon: boolean =\n true;\n @property({type: Boolean}) showAlertIcon: boolean = false;\n\n @property({type: Boolean, attribute: false}) showTrendSymbol: boolean = true;\n\n @property({type: Number}) percentFractionDigits: number = 0;\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 /**\n * Tracks whether the `rich` slot has assigned content, so the regular\n * (non-compact) layout only draws the rich divider when a consumer has\n * slotted detail rows (canonically an `<obc-readout-list>`). Mirrors\n * `_hasBadges` / `_hasTagSlot`.\n */\n @state() private _hasRichSlot = 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.Shelved:\n return ObcAutomationBadgeType.AlertShelved;\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 case AutomationButtonBadgeAlert.LevelCritical:\n return ObcAutomationBadgeType.LevelCritical;\n case AutomationButtonBadgeAlert.LevelHigh:\n return ObcAutomationBadgeType.LevelHigh;\n case AutomationButtonBadgeAlert.LevelMedium:\n return ObcAutomationBadgeType.LevelMedium;\n case AutomationButtonBadgeAlert.LevelLow:\n return ObcAutomationBadgeType.LevelLow;\n case AutomationButtonBadgeAlert.LevelDiagnostic:\n return ObcAutomationBadgeType.LevelDiagnostic;\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 case AutomationButtonBadgeInterlock.Simulation:\n return ObcAutomationBadgeType.Simulation;\n default:\n return null;\n }\n }\n\n private _badgeCommandLockedType(): ObcAutomationBadgeType | null {\n switch (this.badgeCommandLocked) {\n case AutomationButtonBadgeCommandLocked.CommandLocked:\n return ObcAutomationBadgeType.CommandLocked;\n case AutomationButtonBadgeCommandLocked.Simulation:\n return ObcAutomationBadgeType.Simulation;\n default:\n return null;\n }\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 private _onRichSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasRichSlot = 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 // The chart cell element is recreated when `chartMode` moves between bar\n // and graph, and appears or disappears with `static` and `compact`, so the\n // observer is re-attached to the current `.bar-container`. `priority`\n // needs no forwarding — children take it through template bindings.\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 return html`<obi-arrow-right-google\n class=\"trend-icon\"\n ></obi-arrow-right-google>`;\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 // Curve Y-values are scaled proportionally from the 18/12-tall Figma\n // reference, so the corners stay continuous at both thicknesses\n // (automation-components.md § Tank rendering).\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 // Curve and outer edge only: the seam with `.middle` is a 1px CSS\n // `border-top` so it pixel-snaps like the pressurized cap's border,\n // where an SVG stroke renders thinner and blurrier.\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 willUpdate(changed: PropertyValues) {\n super.willUpdate(changed);\n syncAdviceAlias(this, this.advice);\n }\n\n override render() {\n const safeMax = this.max > 0 ? this.max : 1;\n const percent = clamp((this.value / safeMax) * 100, 0, 100);\n const isCompact = this.isCompact;\n\n // Compact and static collapse their empty cells so the tank frame absorbs\n // the space; non-compact cells sit in the inner `.grid` and always reserve\n // their min-content rows (automation-components.md § Tank rendering).\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 ${\n controlBadge\n ? html`<obc-automation-badge\n .type=${controlBadge}\n ></obc-automation-badge>`\n : nothing\n }\n ${\n alertBadge\n ? html`<obc-automation-badge\n .type=${alertBadge}\n ></obc-automation-badge>`\n : nothing\n }\n ${\n interlockBadge\n ? html`<obc-automation-badge\n .type=${interlockBadge}\n ></obc-automation-badge>`\n : nothing\n }\n ${\n commandLockedBadge\n ? html`<obc-automation-badge\n .type=${commandLockedBadge}\n ></obc-automation-badge>`\n : nothing\n }\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 shows capacity rather than a percent: the state is unknown, so a\n // reading would be a claim the tank cannot make, and the trend icon goes\n // for the same reason (automation-components.md § Tank rendering).\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 <div class=\"rich-divider\" ?hidden=${!this._hasRichSlot}></div>\n <slot name=\"rich\" @slotchange=${this._onRichSlotChange}></slot>\n </slot>\n </div>\n `;\n // Two stacked icons form the silhouette `obc-automation-button` uses: the\n // back layer paints the inherited SVG `stroke` halo, the front layer the\n // fill through `color` (automation-components.md § Tank rendering).\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 .mode=${this.alertFrameMode}\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 // gauge-trend reads these as an aspect-ratio reference and derives its\n // own height from its wrapper. Rendering waits for both measurements —\n // a zero divides in that maths on first paint.\n const hasSize = this._cellWidth > 0 && this._cellHeight > 0;\n chartCell = html`\n <div class=\"bar-container chart-cell\">\n ${\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 .advices=${this.advices}\n .adviceTrigger=${this.adviceTrigger}\n .adviceEmphasis=${this.adviceEmphasis}\n .width=${this._cellWidth}\n .height=${this._cellHeight}\n .setpoint=${this.setpoint}\n .newSetpoint=${this.newSetpoint}\n .touching=${this.touching}\n .atSetpoint=${this.atSetpoint}\n .autoAtSetpoint=${this.autoAtSetpoint}\n .autoAtSetpointDeadband=${this.autoAtSetpointDeadband}\n .setpointAtZeroDeadband=${this.setpointAtZeroDeadband}\n .setpointOverride=${this.setpointOverride}\n .animateSetpoint=${this.animateSetpoint}\n style=\"width: 100%; height: 100%;\"\n .priority=${this.priority}\n ></obc-gauge-trend>`\n : null\n }\n ${this.hasGraphIcon ? graphIconOverlay : null}\n </div>\n `;\n } else {\n // The shared SVG bar, the renderer gauge-trend uses for its side bar, so\n // advice overlays behave the same in all three chart modes; its fill\n // follows the instrument palette, not the tank's `medium` colour.\n // TODO(#1284): carry the medium colour through, and fold this branch\n // into gauge-trend once it offers a bar-only layout at this size.\n const hasSize = this._cellWidth > 0 && this._cellHeight > 0;\n // The inner bar is always portrait and mirrors gauge-trend's\n // `fixedAspectRatio` sizing, so fixed-pixel SVG primitives keep one\n // on-screen size; `barThickness` and the cross-axis size are therefore\n // in viewBox units (automation-components.md § Tank rendering).\n const SCALE_REFERENCE_SIZE = 384;\n // The bar's viewBox cross-axis includes an outside-bar band for advice\n // pills, icons and/or the setpoint marker (see computeExternalScaleLayout).\n // Subtract the same band the bar will reserve so total viewBox width\n // still equals viewBoxCross and the meet-scale fills the cell exactly.\n const hasSetpointMarker =\n this.setpoint !== undefined ||\n this.newSetpoint !== undefined ||\n this.departingNewSetpoint !== undefined;\n const outsideBarReserveVb = computeOutsideBarThickness({\n hasBar: true,\n hasScale: false,\n labels: false,\n labelThickness: 0,\n tickThickness: 0,\n scaleType: ScaleType.regular,\n hasAdvice: this.hasAdvice,\n hasAdviceIcon:\n this.hasAdvice && !!this.advices?.some((a) => a.showIcon),\n advicePosition: AdvicePosition.inner,\n hasSetpoint: hasSetpointMarker,\n });\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 - outsideBarReserveVb);\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.advices : []}\n .adviceTrigger=${this.adviceTrigger}\n .adviceEmphasis=${this.adviceEmphasis}\n .advicePosition=${AdvicePosition.inner}\n .setpoint=${this.setpoint}\n .newSetpoint=${this.newSetpoint}\n .touching=${this.touching}\n .atSetpoint=${this.atSetpoint}\n .autoAtSetpoint=${this.autoAtSetpoint}\n .autoAtSetpointDeadband=${this.autoAtSetpointDeadband}\n .setpointAtZeroDeadband=${this.setpointAtZeroDeadband}\n .setpointOverride=${this.setpointOverride}\n .animateSetpoint=${this.animateSetpoint}\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 // One interactive element: the flat mixin paints `.halo` through\n // `visibleWrapperClass` so the surround hugs the bordered area only, and\n // the alert-frame overlay is its last child so the ring covers every cell\n // (automation-components.md § Tank rendering).\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 // Both classes sit on `.root` so the mixin paints `.halo`: `activated`\n // like its hover and pressed states, `clickable` choosing between the\n // six-state variant and the resting-only `noClick` one\n // (automation-components.md § Tank rendering).\n const isClickable = this.clickable && !this.static;\n const rootClasses = classMap({\n root: true,\n activated: this.activated,\n clickable: isClickable,\n });\n\n // The live region stays on all three root shapes, so an `alert` label is\n // announced whatever the interactivity (automation-components.md § Tank\n // rendering).\n // TODO(a11y): the rest of the automation family lacks the live region;\n // consolidate when alert support moves into a shared mixin.\n if (this.static) {\n return html`<div\n class=${rootClasses}\n role=\"img\"\n aria-label=${this.tag || 'Tank'}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </div>`;\n }\n if (!isClickable) {\n return html`<div\n class=${rootClasses}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </div>`;\n }\n return html`<button\n class=${rootClasses}\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 static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-automation-tank': ObcAutomationTank;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,IAAY,YAAL,yBAAA,WAAA;CACL,UAAA,gBAAA;CACA,UAAA,YAAA;CACA,UAAA,YAAA;CACA,UAAA,aAAA;CACA,UAAA,iBAAA;CACA,UAAA,YAAA;;AACF,EAAA,CAAA,CAAA;AAEA,IAAY,WAAL,yBAAA,UAAA;CACL,SAAA,aAAA;CACA,SAAA,iBAAA;CACA,SAAA,iBAAA;CACA,SAAA,aAAA;;AACF,EAAA,CAAA,CAAA;AAEA,IAAY,kBAAL,yBAAA,iBAAA;CACL,gBAAA,cAAA;CACA,gBAAA,gBAAA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M,CAAC,CAAA,GAAA,kBAAA,WAAA,gBAAA,KAAA,CAAA;AAEvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,kBAAA,WAAA,cAAA,KAAA,CAAA;AAEvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,kBAAA,WAAA,kBAAA,KAAA,CAAA;AAEvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,kBAAA,WAAA,sBAAA,KAAA,CAAA;AAIvBA,WAAA,CAAA,MAAM,CAAA,GAAA,kBAAA,WAAA,cAAA,KAAA,CAAA;AACNA,WAAA,CAAA,MAAM,CAAA,GAAA,kBAAA,WAAA,eAAA,KAAA,CAAA;AAQNA,WAAA,CAAA,MAAM,CAAA,GAAA,kBAAA,WAAA,cAAA,KAAA,CAAA;AACNA,WAAA,CAAA,MAAM,CAAA,GAAA,kBAAA,WAAA,eAAA,KAAA,CAAA;AAONA,WAAA,CAAA,MAAM,CAAA,GAAA,kBAAA,WAAA,gBAAA,KAAA,CAAA;AA3ER,oBAAAA,WAAA,CAAA,cAAc,qBAAqB,CAAA,GAAA,iBAAA"}
1
+ {"version":3,"file":"automation-tank.js","names":["compentStyle","_decorate"],"sources":["../../../src/automation/automation-tank/automation-tank.ts"],"sourcesContent":["import {\n HTMLTemplateResult,\n LitElement,\n html,\n nothing,\n svg,\n unsafeCSS,\n PropertyValues,\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 {\n AutomationBadgeSymbolOverride,\n automationBadgeType,\n currentBadgeSymbolOverride,\n} from '../automation-button/badge-symbols.js';\nimport {BadgeSettingsController} from '../automation-button/badge-settings-controller.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-arrow-right-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 ObcAlertFrameMode,\n ObcAlertFrameThickness,\n ObcAlertFrameType,\n} from '../../components/alert-frame/alert-frame.js';\nimport {AlertType} from '../../types.js';\nimport type {ChartLineDataItem} from '../../building-blocks/chart-line/chart-line-base.js';\nimport {AdviceMixin, syncAdviceAlias} from '../../svghelpers/advice-mixin.js';\nimport type {AdviceInput} from '../../svghelpers/advice.js';\nimport {\n AdvicePosition,\n ExternalScaleSide,\n FillMode,\n ScaleType,\n computeOutsideBarThickness,\n} from '../../building-blocks/external-scale/external-scale.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement} from '../../decorator.js';\nimport {SetpointMixin} from '../../svghelpers/setpoint-mixin.js';\nimport {TankPositioning} from './tank-positioning.js';\nimport {clamp} from '../../svghelpers/math.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\nexport {TankPositioning};\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 *\n *\n * Setpoint properties are inherited from {@link SetpointMixin}\n * (`setpoint`, `newSetpoint`, `touching`, `atSetpoint`, `autoAtSetpoint`,\n * `autoAtSetpointDeadband`, `setpointAtZeroDeadband`, `setpointOverride`,\n * `animateSetpoint`) and are forwarded to the embedded chart: the SVG bar in\n * `bar` mode, or `obc-gauge-trend` in the graph modes (where the marker\n * renders on the side bar, i.e. `graph-and-bar`). Values share the tank's\n * `value` / `max` scale.\n *\n * @property positioning - Host positioning model — see `TankPositioning` for details. Defaults to\n * `button` (host fills parent container, 100% × 100%, falling back to the\n * design aspect ratio on any axis the parent leaves indefinite, no anchor\n * offset). Set to `point` for the legacy P&ID canvas mode (fixed default\n * dimensions + top-center anchor offset).\n * @property activated - Enables the activated background color, used to indicate that the tank is\n * activated/selected. Requires an interactive tank — the `noClick` mixin\n * variant used when `clickable` is `false` only paints the enabled state, so\n * a non-clickable tank ignores this (matching `obc-elevated-card`).\n * @availableWhen activated clickable==true\n * @property chartData - Time-series data points for the embedded gauge-trend (graph modes only).\n * @property priority - Priority hint forwarded to child charts (regular | enhanced).\n * @property advice - 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 * @property hasAdvice - Show advice overlays (works in all `chartMode` variants).\n * @property alert - Show an `<obc-alert-frame>` overlay around the bordered tank area (the\n * `.halo` wrapper). Mirrors the API of `obc-automation-button`: same seven\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 * @property alertFrameType - Shape of the alert frame.\n * @availableWhen alertFrameType alert==true\n * @property alertFrameThickness - Thickness of the alert frame.\n * @availableWhen alertFrameThickness alert==true\n * @property alertFrameStatus - Alert status the frame is coloured for.\n * @availableWhen alertFrameStatus alert==true\n * @property alertFrameMode - Acknowledgement state of the alert: `acked-active` (default) is steady,\n * `unacked-active` flashes, `unacked-rectified` flashes a dashed frame.\n * @availableWhen alertFrameMode alert==true\n * @property showAlertCategoryIcon - Shows the alert category icon inside the frame.\n * @availableWhen showAlertCategoryIcon alert==true && alertFrameType in [SmallSideFlip, LargeSideFlip, BottomFlip, TopFlip]\n * @property showAlertIcon - Shows the slotted alert icon inside the frame.\n * @availableWhen showAlertIcon alert==true && alertFrameType in [LargeSideFlip, BottomFlip, TopFlip]\n * @property showTrendSymbol - 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 * @property percentFractionDigits - 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 * @property static - Display-only variant for a device whose current state is unknown: the\n * chart cell is hidden, the bordered area is filled with\n * `--container-section-color` and the readout is centred inside it. Always\n * compact-sized, so it overrides `compact`, and it renders as a\n * `<div role=\"img\">` — outside the tab order and not announced as a control.\n * @property clickable - Whether the tank is interactive. `true` renders the root as a `<button>`\n * with the flat-mixin interaction surface; `false` renders a `<div>` that\n * keeps the resting appearance (the mixin's `noClick` variant) but loses\n * hover, pressed and focus-visible and leaves the tab order. Everything\n * else — chart, badges, readout, tag and the alert frame — still renders,\n * so use it for a display-only tank that shows live data. No effect on a\n * `static` tank, which is already non-interactive.\n * @property chartMode - Chart cell rendering mode: `bar` (default) is a static fill bar driven by\n * `value` and `max`, `graph` embeds an `obc-gauge-trend` line/area chart,\n * and `graphAndBar` embeds one with an integrated side bar.\n * @property hasGraphIcon - Overlays a decorative icon centred on the chart cell — the energy-battery\n * icon for a battery tank, the generic tank icon otherwise. Works in every\n * `chartMode` and both orientations; the icon sits in a fixed CSS layer\n * above the bar or graph and is silhouetted so it stays legible on any\n * fill, and its size follows the ambient `obc-component-size-*` class.\n * @property badgeControl - Control badge rendered in the `badges` cell. A non-`None` value renders an\n * `<obc-automation-badge>` as fallback content for the `badges` slot, so any\n * slotted content wins. The cell orders the four badges control, alert,\n * interlock, commandLocked, left to right.\n * @property badgeSymbolOverride - Letters that replace badge symbols on this device, per badge property and value, on top of the app-wide ones set with `setAutomationBadgeSymbolOverride()`; for example `{commandLocked: {simulation: 's'}}`. `null` brings the symbol back.\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 - Detail rows below the main readout, shown in the regular\n * (non-compact, non-static) layout. Slot an `<obc-readout-list>` of\n * `<obc-readout-list-item>` rows — it owns the row typography and cross-row\n * column alignment; the tank renders a divider above it automatically when\n * the slot is filled.\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 * @fires click - Fired when the tank is clicked. When `clickable` is `false` the tank renders a plain `<div>`, and in `static` mode a `<div role=\"img\">`, instead of a `<button>` — in both cases it is not focusable or keyboard-activatable; pointer clicks still reach the host.\n * @beta\n */\n@customElement('obc-automation-tank')\nexport class ObcAutomationTank extends AdviceMixin(SetpointMixin(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 @property({type: String, reflect: true}) positioning: TankPositioning =\n TankPositioning.button;\n @property({type: Boolean, reflect: true}) static: boolean = false;\n @property({type: Boolean, attribute: false}) clickable: boolean = true;\n @property({type: Boolean}) activated: boolean = false;\n @property({type: String}) tag: string = '';\n\n @property({type: String, reflect: true, attribute: 'chart-mode'})\n chartMode: TankChartMode = TankChartMode.bar;\n\n @property({type: Array, attribute: false})\n chartData: ChartLineDataItem[] = [];\n\n @property({type: String}) priority: Priority = Priority.regular;\n\n /** @deprecated Alias of `advices`. Ranges in tank units. */\n @property({type: Array, attribute: false}) advice?: AdviceInput[];\n\n @property({type: Boolean}) hasAdvice = false;\n\n @property({type: Boolean, attribute: false}) hasGraphIcon = false;\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: AlertType = AlertType.Alarm;\n @property({type: String}) alertFrameMode: ObcAlertFrameMode =\n ObcAlertFrameMode.ackedActive;\n @property({type: Boolean, attribute: false}) showAlertCategoryIcon: boolean =\n true;\n @property({type: Boolean}) showAlertIcon: boolean = false;\n\n @property({type: Boolean, attribute: false}) showTrendSymbol: boolean = true;\n\n @property({type: Number}) percentFractionDigits: number = 0;\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 @property({attribute: false}) badgeSymbolOverride:\n AutomationBadgeSymbolOverride | undefined = undefined;\n\n constructor() {\n super();\n // Registers itself on the host; nothing else holds it.\n new BadgeSettingsController(this);\n }\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 /**\n * Tracks whether the `rich` slot has assigned content, so the regular\n * (non-compact) layout only draws the rich divider when a consumer has\n * slotted detail rows (canonically an `<obc-readout-list>`). Mirrors\n * `_hasBadges` / `_hasTagSlot`.\n */\n @state() private _hasRichSlot = 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 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 private _onRichSlotChange(e: Event): void {\n const slot = e.target as HTMLSlotElement;\n this._hasRichSlot = 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 // The chart cell element is recreated when `chartMode` moves between bar\n // and graph, and appears or disappears with `static` and `compact`, so the\n // observer is re-attached to the current `.bar-container`. `priority`\n // needs no forwarding — children take it through template bindings.\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 return html`<obi-arrow-right-google\n class=\"trend-icon\"\n ></obi-arrow-right-google>`;\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 // Curve Y-values are scaled proportionally from the 18/12-tall Figma\n // reference, so the corners stay continuous at both thicknesses\n // (automation-components.md § Tank rendering).\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 // Curve and outer edge only: the seam with `.middle` is a 1px CSS\n // `border-top` so it pixel-snaps like the pressurized cap's border,\n // where an SVG stroke renders thinner and blurrier.\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 willUpdate(changed: PropertyValues) {\n super.willUpdate(changed);\n syncAdviceAlias(this, this.advice);\n }\n\n override render() {\n const safeMax = this.max > 0 ? this.max : 1;\n const percent = clamp((this.value / safeMax) * 100, 0, 100);\n const isCompact = this.isCompact;\n\n // Compact and static collapse their empty cells so the tank frame absorbs\n // the space; non-compact cells sit in the inner `.grid` and always reserve\n // their min-content rows (automation-components.md § Tank rendering).\n const symbolOverride = currentBadgeSymbolOverride(this.badgeSymbolOverride);\n const controlBadge = automationBadgeType(\n 'control',\n this.badgeControl,\n symbolOverride\n );\n const alertBadge = automationBadgeType(\n 'alert',\n this.badgeAlert,\n symbolOverride\n );\n const interlockBadge = automationBadgeType(\n 'interlock',\n this.badgeInterlock,\n symbolOverride\n );\n const commandLockedBadge = automationBadgeType(\n 'commandLocked',\n this.badgeCommandLocked,\n symbolOverride\n );\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 ${\n controlBadge\n ? html`<obc-automation-badge\n .type=${controlBadge}\n ></obc-automation-badge>`\n : nothing\n }\n ${\n alertBadge\n ? html`<obc-automation-badge\n .type=${alertBadge}\n ></obc-automation-badge>`\n : nothing\n }\n ${\n interlockBadge\n ? html`<obc-automation-badge\n .type=${interlockBadge}\n ></obc-automation-badge>`\n : nothing\n }\n ${\n commandLockedBadge\n ? html`<obc-automation-badge\n .type=${commandLockedBadge}\n ></obc-automation-badge>`\n : nothing\n }\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 shows capacity rather than a percent: the state is unknown, so a\n // reading would be a claim the tank cannot make, and the trend icon goes\n // for the same reason (automation-components.md § Tank rendering).\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 <div class=\"rich-divider\" ?hidden=${!this._hasRichSlot}></div>\n <slot name=\"rich\" @slotchange=${this._onRichSlotChange}></slot>\n </slot>\n </div>\n `;\n // Two stacked icons form the silhouette `obc-automation-button` uses: the\n // back layer paints the inherited SVG `stroke` halo, the front layer the\n // fill through `color` (automation-components.md § Tank rendering).\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 .mode=${this.alertFrameMode}\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 // gauge-trend reads these as an aspect-ratio reference and derives its\n // own height from its wrapper. Rendering waits for both measurements —\n // a zero divides in that maths on first paint.\n const hasSize = this._cellWidth > 0 && this._cellHeight > 0;\n chartCell = html`\n <div class=\"bar-container chart-cell\">\n ${\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 .advices=${this.advices}\n .adviceTrigger=${this.adviceTrigger}\n .adviceEmphasis=${this.adviceEmphasis}\n .width=${this._cellWidth}\n .height=${this._cellHeight}\n .setpoint=${this.setpoint}\n .newSetpoint=${this.newSetpoint}\n .touching=${this.touching}\n .atSetpoint=${this.atSetpoint}\n .autoAtSetpoint=${this.autoAtSetpoint}\n .autoAtSetpointDeadband=${this.autoAtSetpointDeadband}\n .setpointAtZeroDeadband=${this.setpointAtZeroDeadband}\n .setpointOverride=${this.setpointOverride}\n .animateSetpoint=${this.animateSetpoint}\n style=\"width: 100%; height: 100%;\"\n .priority=${this.priority}\n ></obc-gauge-trend>`\n : null\n }\n ${this.hasGraphIcon ? graphIconOverlay : null}\n </div>\n `;\n } else {\n // The shared SVG bar, the renderer gauge-trend uses for its side bar, so\n // advice overlays behave the same in all three chart modes; its fill\n // follows the instrument palette, not the tank's `medium` colour.\n // TODO(#1284): carry the medium colour through, and fold this branch\n // into gauge-trend once it offers a bar-only layout at this size.\n const hasSize = this._cellWidth > 0 && this._cellHeight > 0;\n // The inner bar is always portrait and mirrors gauge-trend's\n // `fixedAspectRatio` sizing, so fixed-pixel SVG primitives keep one\n // on-screen size; `barThickness` and the cross-axis size are therefore\n // in viewBox units (automation-components.md § Tank rendering).\n const SCALE_REFERENCE_SIZE = 384;\n // The bar's viewBox cross-axis includes an outside-bar band for advice\n // pills, icons and/or the setpoint marker (see computeExternalScaleLayout).\n // Subtract the same band the bar will reserve so total viewBox width\n // still equals viewBoxCross and the meet-scale fills the cell exactly.\n const hasSetpointMarker =\n this.setpoint !== undefined ||\n this.newSetpoint !== undefined ||\n this.departingNewSetpoint !== undefined;\n const outsideBarReserveVb = computeOutsideBarThickness({\n hasBar: true,\n hasScale: false,\n labels: false,\n labelThickness: 0,\n tickThickness: 0,\n scaleType: ScaleType.regular,\n hasAdvice: this.hasAdvice,\n hasAdviceIcon:\n this.hasAdvice && !!this.advices?.some((a) => a.showIcon),\n advicePosition: AdvicePosition.inner,\n hasSetpoint: hasSetpointMarker,\n });\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 - outsideBarReserveVb);\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.advices : []}\n .adviceTrigger=${this.adviceTrigger}\n .adviceEmphasis=${this.adviceEmphasis}\n .advicePosition=${AdvicePosition.inner}\n .setpoint=${this.setpoint}\n .newSetpoint=${this.newSetpoint}\n .touching=${this.touching}\n .atSetpoint=${this.atSetpoint}\n .autoAtSetpoint=${this.autoAtSetpoint}\n .autoAtSetpointDeadband=${this.autoAtSetpointDeadband}\n .setpointAtZeroDeadband=${this.setpointAtZeroDeadband}\n .setpointOverride=${this.setpointOverride}\n .animateSetpoint=${this.animateSetpoint}\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 // One interactive element: the flat mixin paints `.halo` through\n // `visibleWrapperClass` so the surround hugs the bordered area only, and\n // the alert-frame overlay is its last child so the ring covers every cell\n // (automation-components.md § Tank rendering).\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 // Both classes sit on `.root` so the mixin paints `.halo`: `activated`\n // like its hover and pressed states, `clickable` choosing between the\n // six-state variant and the resting-only `noClick` one\n // (automation-components.md § Tank rendering).\n const isClickable = this.clickable && !this.static;\n const rootClasses = classMap({\n root: true,\n activated: this.activated,\n clickable: isClickable,\n });\n\n // The live region stays on all three root shapes, so an `alert` label is\n // announced whatever the interactivity (automation-components.md § Tank\n // rendering).\n // TODO(a11y): the rest of the automation family lacks the live region;\n // consolidate when alert support moves into a shared mixin.\n if (this.static) {\n return html`<div\n class=${rootClasses}\n role=\"img\"\n aria-label=${this.tag || 'Tank'}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </div>`;\n }\n if (!isClickable) {\n return html`<div\n class=${rootClasses}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n ${halo}\n </div>`;\n }\n return html`<button\n class=${rootClasses}\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 static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-automation-tank': ObcAutomationTank;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,IAAY,YAAL,yBAAA,WAAA;CACL,UAAA,gBAAA;CACA,UAAA,YAAA;CACA,UAAA,YAAA;CACA,UAAA,aAAA;CACA,UAAA,iBAAA;CACA,UAAA,YAAA;;AACF,EAAA,CAAA,CAAA;AAEA,IAAY,WAAL,yBAAA,UAAA;CACL,SAAA,aAAA;CACA,SAAA,iBAAA;CACA,SAAA,iBAAA;CACA,SAAA,aAAA;;AACF,EAAA,CAAA,CAAA;AAEA,IAAY,kBAAL,yBAAA,iBAAA;CACL,gBAAA,cAAA;CACA,gBAAA,gBAAA;;AACF,EAAA,CAAA,CAAA;AAIA,IAAY,gBAAL,yBAAA,eAAA;;CAEL,cAAA,SAAA;;CAEA,cAAA,WAAA;;CAEA,cAAA,iBAAA;;AACF,EAAA,CAAA,CAAA;AA0GO,IAAM,oBAAN,MAAM,0BAA0B,YAAY,cAAc,UAAU,CAAC,CAAC,CAAC;CA2D5E,cAAc;EACZ,MAAM;EA3DuC,KAAA,SAAA,WAAW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,CAAA;AAEvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,kBAAA,WAAA,gBAAA,KAAA,CAAA;AAEvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,kBAAA,WAAA,cAAA,KAAA,CAAA;AAEvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,kBAAA,WAAA,kBAAA,KAAA,CAAA;AAEvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,kBAAA,WAAA,sBAAA,KAAA,CAAA;AAGvBA,WAAA,CAAA,SAAS,EAAC,WAAW,MAAK,CAAC,CAAA,GAAA,kBAAA,WAAA,uBAAA,KAAA,CAAA;AAS3BA,WAAA,CAAA,MAAM,CAAA,GAAA,kBAAA,WAAA,cAAA,KAAA,CAAA;AACNA,WAAA,CAAA,MAAM,CAAA,GAAA,kBAAA,WAAA,eAAA,KAAA,CAAA;AAQNA,WAAA,CAAA,MAAM,CAAA,GAAA,kBAAA,WAAA,cAAA,KAAA,CAAA;AACNA,WAAA,CAAA,MAAM,CAAA,GAAA,kBAAA,WAAA,eAAA,KAAA,CAAA;AAONA,WAAA,CAAA,MAAM,CAAA,GAAA,kBAAA,WAAA,gBAAA,KAAA,CAAA;AAnFR,oBAAAA,WAAA,CAAA,cAAc,qBAAqB,CAAA,GAAA,iBAAA"}
@@ -1,4 +1,5 @@
1
1
  import { LitElement, CSSResultGroup, TemplateResult } from 'lit';
2
+ import { AutomationBadgeSymbolOverride } from '../automation-button/badge-symbols.js';
2
3
  import { AutomationButtonBadgeAlert, AutomationButtonBadgeCommandLocked, AutomationButtonBadgeControl, AutomationButtonBadgeInterlock } from '../automation-button/abstract-automation-button.js';
3
4
  import { ObcAlertFrameMode, ObcAlertFrameThickness, ObcAlertFrameType } from '../../components/alert-frame/alert-frame.js';
4
5
  import { AlertType } from '../../types.js';
@@ -70,6 +71,7 @@ export declare enum SpecialtyTankFrame {
70
71
  * @property badgeAlert - Alert badge, second in the badge row.
71
72
  * @property badgeInterlock - Interlock badge, third in the badge row.
72
73
  * @property badgeCommandLocked - Command-locked badge, last in the badge row.
74
+ * @property badgeSymbolOverride - Letters that replace badge symbols on this device, per badge property and value, on top of the app-wide ones set with `setAutomationBadgeSymbolOverride()`; for example `{commandLocked: {simulation: 's'}}`. `null` brings the symbol back.
73
75
  * @property alert - Show an alert-frame overlay around the halo, mirroring `obc-automation-tank`.
74
76
  * @property alertFrameType - Shape of the alert frame.
75
77
  * @availableWhen alertFrameType alert==true
@@ -112,6 +114,9 @@ export declare class ObcAbstractSpecialtyTank extends LitElement {
112
114
  badgeInterlock: AutomationButtonBadgeInterlock;
113
115
  /** Command-locked badge, last in the badge row. */
114
116
  badgeCommandLocked: AutomationButtonBadgeCommandLocked;
117
+ /** Letters that replace badge symbols on this device, per badge property and value, on top of the app-wide ones set with `setAutomationBadgeSymbolOverride()`; for example `{commandLocked: {simulation: 's'}}`. `null` brings the symbol back. */
118
+ badgeSymbolOverride: AutomationBadgeSymbolOverride | undefined;
119
+ constructor();
115
120
  /** Show an alert-frame overlay around the halo, mirroring `obc-automation-tank`. */
116
121
  alert: boolean;
117
122
  /**
@@ -157,10 +162,6 @@ export declare class ObcAbstractSpecialtyTank extends LitElement {
157
162
  protected get equipmentName(): string;
158
163
  protected get frame(): SpecialtyTankFrame;
159
164
  protected get splitMode(): SpecialtyTankSplitMode;
160
- private _badgeControlType;
161
- private _badgeAlertType;
162
- private _badgeInterlockType;
163
- private _badgeCommandLockedType;
164
165
  private _slotHasContent;
165
166
  private _onBadgesSlotChange;
166
167
  private _onTagSlotChange;
@@ -1 +1 @@
1
- {"version":3,"file":"abstract-specialty-tank.d.ts","sourceRoot":"","sources":["../../../src/automation/specialty-tank/abstract-specialty-tank.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAgC,MAAM,KAAK,CAAC;AAC9D,OAAO,KAAK,EAAC,cAAc,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EAAE,OAAO,CAAS;IACxB,cAAc,EAAE,iBAAiB,CACzB;IACR,mBAAmB,EAAE,sBAAsB,CACtC;IACL,gBAAgB,EAAE,SAAS,CAAmB;IAC9C,cAAc,EAAE,iBAAiB,CAC3B;IACa,qBAAqB,EAAE,OAAO,CACpE;IACoB,aAAa,EAAE,OAAO,CAAS;IAEjD,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,WAAW,CAAS;IAErC,SAAS,KAAK,aAAa,IAAI,cAAc,CAE5C;IAED,yDAAyD;IACzD,SAAS,KAAK,aAAa,IAAI,MAAM,CAEpC;IAED,SAAS,KAAK,KAAK,IAAI,kBAAkB,CAExC;IAED,SAAS,KAAK,SAAS,IAAI,sBAAsB,CAEhD;IAED,OAAO,CAAC,iBAAiB;IAiBzB,OAAO,CAAC,eAAe;IA2BvB,OAAO,CAAC,mBAAmB;IAa3B,OAAO,CAAC,uBAAuB;IAW/B,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,aAAa;IAerB;;;;;;OAMG;IACH,OAAO,CAAC,mBAAmB;IAwBlB,MAAM;IAmJf,OAAgB,MAAM,EAAE,cAAc,CAA6B;CACpE"}
1
+ {"version":3,"file":"abstract-specialty-tank.d.ts","sourceRoot":"","sources":["../../../src/automation/specialty-tank/abstract-specialty-tank.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAgC,MAAM,KAAK,CAAC;AAC9D,OAAO,KAAK,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,KAAK,CAAC;AAIxD,OAAO,yCAAyC,CAAC;AACjD,OAAO,EACL,6BAA6B,EAG9B,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EACL,0BAA0B,EAC1B,kCAAkC,EAClC,4BAA4B,EAC5B,8BAA8B,EAC/B,MAAM,oDAAoD,CAAC;AAC5D,OAAO,6CAA6C,CAAC;AACrD,OAAO,EACL,iBAAi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