@oicl/openbridge-webcomponents-full-bundle 2.2.0-next.15 → 2.2.0-next.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/openbridge-webcomponents.bundle.js +320 -64
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +1752 -15
- package/dist/automation/analog-threeway-valve/analog-threeway-valve.d.ts +4 -4
- package/dist/automation/analog-threeway-valve/analog-threeway-valve.js.map +1 -1
- package/dist/automation/automation-badge/automation-badge.css_inline.js +6 -0
- package/dist/automation/automation-badge/automation-badge.d.ts +61 -1
- package/dist/automation/automation-badge/automation-badge.d.ts.map +1 -1
- package/dist/automation/automation-badge/automation-badge.js +83 -1
- package/dist/automation/automation-badge/automation-badge.js.map +1 -1
- package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.d.ts +20 -0
- package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.d.ts.map +1 -1
- package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.js +1 -0
- package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.js.map +1 -1
- package/dist/automation/automation-button/abstract-automation-button.d.ts +16 -4
- package/dist/automation/automation-button/abstract-automation-button.d.ts.map +1 -1
- package/dist/automation/automation-button/abstract-automation-button.js +46 -20
- package/dist/automation/automation-button/abstract-automation-button.js.map +1 -1
- package/dist/automation/automation-button/badge-layout.d.ts +34 -0
- package/dist/automation/automation-button/badge-layout.d.ts.map +1 -0
- package/dist/automation/automation-button/badge-layout.js +64 -0
- package/dist/automation/automation-button/badge-layout.js.map +1 -0
- package/dist/automation/automation-tank/automation-tank.d.ts.map +1 -1
- package/dist/automation/automation-tank/automation-tank.js +7 -2
- package/dist/automation/automation-tank/automation-tank.js.map +1 -1
- package/dist/automation/digital-threeway-valve/digital-threeway-valve.d.ts +4 -4
- package/dist/automation/digital-threeway-valve/digital-threeway-valve.js.map +1 -1
- package/dist/automation/electricity-battery/electricity-battery.d.ts +4 -4
- package/dist/automation/electricity-battery/electricity-battery.js.map +1 -1
- package/dist/automation/specialty-tank/abstract-specialty-tank.d.ts.map +1 -1
- package/dist/automation/specialty-tank/abstract-specialty-tank.js +7 -2
- package/dist/automation/specialty-tank/abstract-specialty-tank.js.map +1 -1
- package/dist/internal/global-setting.d.ts +55 -0
- package/dist/internal/global-setting.d.ts.map +1 -0
- package/dist/internal/global-setting.js +86 -0
- package/dist/internal/global-setting.js.map +1 -0
- package/package.json +3 -2
- package/script/check-typography-ramp.ts +144 -0
- package/script/typography/ramp.ts +237 -0
- package/script/typography-ramp.test.ts +267 -0
- package/src/automation/analog-threeway-valve/analog-threeway-valve.ts +4 -4
- package/src/automation/analog-valve/analog-valve.stories.ts +8 -0
- package/src/automation/automation-badge/automation-badge.css +6 -0
- package/src/automation/automation-badge/automation-badge.stories.ts +47 -3
- package/src/automation/automation-badge/automation-badge.ts +124 -1
- package/src/automation/automation-button/abstract-automation-button-storybook-helpers.ts +3 -0
- package/src/automation/automation-button/abstract-automation-button.ts +70 -23
- package/src/automation/automation-button/badge-layout.spec.ts +138 -0
- package/src/automation/automation-button/badge-layout.ts +120 -0
- package/src/automation/automation-tank/automation-tank.ts +11 -6
- package/src/automation/digital-threeway-valve/digital-threeway-valve.ts +4 -4
- package/src/automation/electricity-battery/electricity-battery.ts +4 -4
- package/src/automation/pump/pump.stories.ts +59 -0
- package/src/automation/specialty-tank/abstract-specialty-tank.ts +11 -6
- package/src/internal/global-setting.spec.ts +119 -0
- package/src/internal/global-setting.ts +105 -0
|
@@ -44,10 +44,10 @@ export declare enum AnalogThreewayValveVariant {
|
|
|
44
44
|
* @property orientation - Side the stem points to.
|
|
45
45
|
* @property flows - Readout rows, one per flow: an optional arrow direction with either a value and optional unit (default `%`) or `open` for an `Open`/`Closed` state.
|
|
46
46
|
* @property variant - Visual style of the button surround.
|
|
47
|
-
* @slot badge-top-right - Content projected into the top-right badge position; overrides `
|
|
48
|
-
* @slot badge-top-left - Content projected into the top-left badge position; overrides `
|
|
49
|
-
* @slot badge-bottom-left - Content projected into the bottom-left badge position; overrides `
|
|
50
|
-
* @slot badge-bottom-right - Content projected into the bottom-right badge position; overrides `
|
|
47
|
+
* @slot badge-top-right - Content projected into the top-right badge position; overrides the badge `badgeLayout` puts in that corner.
|
|
48
|
+
* @slot badge-top-left - Content projected into the top-left badge position; overrides the badge `badgeLayout` puts in that corner.
|
|
49
|
+
* @slot badge-bottom-left - Content projected into the bottom-left badge position; overrides the badge `badgeLayout` puts in that corner.
|
|
50
|
+
* @slot badge-bottom-right - Content projected into the bottom-right badge position; overrides the badge `badgeLayout` puts in that corner.
|
|
51
51
|
* @fires click - Fired when the valve is clicked.
|
|
52
52
|
* @experimental
|
|
53
53
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analog-threeway-valve.js","names":["_decorate"],"sources":["../../../src/automation/analog-threeway-valve/analog-threeway-valve.ts"],"sourcesContent":["import {html} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport '../valve-analog-three-way-icon/valve-analog-three-way-icon.js';\nimport {customElement} from '../../decorator.js';\nimport {ObcAbstractAutomationButton} from '../automation-button/abstract-automation-button.js';\nimport {AutomationButtonReadoutPosition} from '../automation-button/automation-button.js';\nimport {AutomationButtonReadoutStack} from '../../components/automation-button-readout-stack/automation-button-readout-stack.js';\nimport {\n ThreewayValveFlow,\n ThreewayValveOrientation,\n threewayValveOpenSide,\n threewayValveReadouts,\n} from '../threeway-valve-shared/threeway-valve-shared.js';\n\nexport enum AnalogThreewayValveVariant {\n regular = 'regular',\n flat = 'flat',\n}\n\n/**\n * `<obc-analog-threeway-valve>` – three-way control valve for process\n * diagrams, with a continuous opening per port.\n *\n * ## Features\n *\n * - **Three ports:** `open1`, `open2` and `open3` set each port's opening in\n * percent. Ports are numbered from the side without a port: with\n * `orientation` `bottom`, port 1 is left, port 2 is the stem at the bottom\n * and port 3 is right. The numbering turns with the symbol.\n * - **Symbol:** a partly open port shows its shut part as a band at the port\n * end, a port at 0 % is drawn plugged, and the handle shows how the most\n * open port splits between the two others (`obc-valve-analog-three-way-icon`).\n * - **Orientation:** `bottom` and `top` lay the valve on a horizontal pipe,\n * `left` and `right` on a vertical one; the value names the side the stem\n * points to.\n * - **Flow readout:** `flows` lists one readout row per flow, each with an\n * optional arrow direction and either a value with a unit (`%` when left out)\n * or a state, `{open}`, shown as `Open` or `Closed` after the arrow, or\n * after the on/off icon when there is no direction. Without flows the\n * readout shows `Open` or `Closed`.\n * - Badges, alert frame, progress and readout placement come from the shared\n * automation button base.\n *\n * ## Usage Guidelines\n *\n * Use for a mixing or diverting valve that opens its ports continuously.\n * With fewer than two ports open no flow can pass, and the valve shows as\n * closed. For on/off ports use `obc-digital-threeway-valve`; for a two-port\n * control valve use `obc-analog-valve`.\n *\n * @property open1 - Opening of port 1 in percent (0–100).\n * @property open2 - Opening of port 2, the stem, in percent (0–100).\n * @property open3 - Opening of port 3 in percent (0–100).\n * @property orientation - Side the stem points to.\n * @property flows - Readout rows, one per flow: an optional arrow direction with either a value and optional unit (default `%`) or `open` for an `Open`/`Closed` state.\n * @property variant - Visual style of the button surround.\n * @slot badge-top-right - Content projected into the top-right badge position; overrides `
|
|
1
|
+
{"version":3,"file":"analog-threeway-valve.js","names":["_decorate"],"sources":["../../../src/automation/analog-threeway-valve/analog-threeway-valve.ts"],"sourcesContent":["import {html} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport '../valve-analog-three-way-icon/valve-analog-three-way-icon.js';\nimport {customElement} from '../../decorator.js';\nimport {ObcAbstractAutomationButton} from '../automation-button/abstract-automation-button.js';\nimport {AutomationButtonReadoutPosition} from '../automation-button/automation-button.js';\nimport {AutomationButtonReadoutStack} from '../../components/automation-button-readout-stack/automation-button-readout-stack.js';\nimport {\n ThreewayValveFlow,\n ThreewayValveOrientation,\n threewayValveOpenSide,\n threewayValveReadouts,\n} from '../threeway-valve-shared/threeway-valve-shared.js';\n\nexport enum AnalogThreewayValveVariant {\n regular = 'regular',\n flat = 'flat',\n}\n\n/**\n * `<obc-analog-threeway-valve>` – three-way control valve for process\n * diagrams, with a continuous opening per port.\n *\n * ## Features\n *\n * - **Three ports:** `open1`, `open2` and `open3` set each port's opening in\n * percent. Ports are numbered from the side without a port: with\n * `orientation` `bottom`, port 1 is left, port 2 is the stem at the bottom\n * and port 3 is right. The numbering turns with the symbol.\n * - **Symbol:** a partly open port shows its shut part as a band at the port\n * end, a port at 0 % is drawn plugged, and the handle shows how the most\n * open port splits between the two others (`obc-valve-analog-three-way-icon`).\n * - **Orientation:** `bottom` and `top` lay the valve on a horizontal pipe,\n * `left` and `right` on a vertical one; the value names the side the stem\n * points to.\n * - **Flow readout:** `flows` lists one readout row per flow, each with an\n * optional arrow direction and either a value with a unit (`%` when left out)\n * or a state, `{open}`, shown as `Open` or `Closed` after the arrow, or\n * after the on/off icon when there is no direction. Without flows the\n * readout shows `Open` or `Closed`.\n * - Badges, alert frame, progress and readout placement come from the shared\n * automation button base.\n *\n * ## Usage Guidelines\n *\n * Use for a mixing or diverting valve that opens its ports continuously.\n * With fewer than two ports open no flow can pass, and the valve shows as\n * closed. For on/off ports use `obc-digital-threeway-valve`; for a two-port\n * control valve use `obc-analog-valve`.\n *\n * @property open1 - Opening of port 1 in percent (0–100).\n * @property open2 - Opening of port 2, the stem, in percent (0–100).\n * @property open3 - Opening of port 3 in percent (0–100).\n * @property orientation - Side the stem points to.\n * @property flows - Readout rows, one per flow: an optional arrow direction with either a value and optional unit (default `%`) or `open` for an `Open`/`Closed` state.\n * @property variant - Visual style of the button surround.\n * @slot badge-top-right - Content projected into the top-right badge position; overrides the badge `badgeLayout` puts in that corner.\n * @slot badge-top-left - Content projected into the top-left badge position; overrides the badge `badgeLayout` puts in that corner.\n * @slot badge-bottom-left - Content projected into the bottom-left badge position; overrides the badge `badgeLayout` puts in that corner.\n * @slot badge-bottom-right - Content projected into the bottom-right badge position; overrides the badge `badgeLayout` puts in that corner.\n * @fires click - Fired when the valve is clicked.\n * @experimental\n */\n@customElement('obc-analog-threeway-valve')\nexport class ObcAnalogThreewayValve extends ObcAbstractAutomationButton {\n @property({type: Number}) open1: number = 0;\n @property({type: Number}) open2: number = 0;\n @property({type: Number}) open3: number = 0;\n @property({type: String}) orientation: ThreewayValveOrientation =\n ThreewayValveOrientation.bottom;\n @property({type: Array, attribute: false}) flows: ThreewayValveFlow[] = [];\n @property({type: String}) variant: AnalogThreewayValveVariant =\n AnalogThreewayValveVariant.regular;\n\n override get _on(): boolean {\n return (\n [this.open1, this.open2, this.open3].filter((o) => o > 0).length >= 2\n );\n }\n\n override get _readoutPosition(): AutomationButtonReadoutPosition {\n return this.readoutPosition ?? threewayValveOpenSide(this.orientation);\n }\n\n override get extraReadouts(): AutomationButtonReadoutStack[] {\n if (!this.showStatus) {\n return [];\n }\n return threewayValveReadouts(this._on, this.flows, this.showStatusIcon);\n }\n\n private renderIcon(slot: string) {\n return html`<obc-valve-analog-three-way-icon\n .open1=${this.open1}\n .open2=${this.open2}\n .open3=${this.open3}\n .orientation=${this.orientation}\n slot=${slot}\n ></obc-valve-analog-three-way-icon>`;\n }\n\n override get icon() {\n return html`${this.renderIcon('icon')}${this.renderIcon('icon-silhouette')}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-analog-threeway-valve': ObcAnalogThreewayValve;\n }\n}\n"],"mappings":";;;;;;;;AAcA,IAAY,6BAAL,yBAAA,4BAAA;CACL,2BAAA,aAAA;CACA,2BAAA,UAAA;;AACF,EAAA,CAAA,CAAA;AA+CO,IAAM,yBAAN,MAAM,+BAA+B,4BAA4B;;;EAC5B,KAAA,QAAA;EACA,KAAA,QAAA;EACA,KAAA,QAAA;EAExC,KAAA,cAAA,yBAAyB;EAC6C,KAAA,QAAA,CAAC;;;CAIzE,IAAa,MAAe;EAC1B,OACE;GAAC,KAAK;GAAO,KAAK;GAAO,KAAK;EAAK,CAAC,CAAC,QAAQ,MAAM,IAAI,CAAC,CAAC,CAAC,UAAU;CAExE;CAEA,IAAa,mBAAoD;EAC/D,OAAO,KAAK,mBAAmB,sBAAsB,KAAK,WAAW;CACvE;CAEA,IAAa,gBAAgD;EAC3D,IAAI,CAAC,KAAK,YACR,OAAO,CAAC;EAEV,OAAO,sBAAsB,KAAK,KAAK,KAAK,OAAO,KAAK,cAAc;CACxE;CAEA,WAAmB,MAAc;EAC/B,OAAO,IAAI;eACA,KAAK,MAAM;eACX,KAAK,MAAM;eACX,KAAK,MAAM;qBACL,KAAK,YAAY;aACzB,KAAK;;CAEhB;CAEA,IAAa,OAAO;EAClB,OAAO,IAAI,GAAG,KAAK,WAAW,MAAM,IAAI,KAAK,WAAW,iBAAiB;CAC3E;AACF;AAvCGA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,uBAAA,WAAA,SAAA,KAAA,CAAA;AACvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,uBAAA,WAAA,SAAA,KAAA,CAAA;AACvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,uBAAA,WAAA,SAAA,KAAA,CAAA;AACvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,uBAAA,WAAA,eAAA,KAAA,CAAA;AAEvBA,WAAA,CAAA,SAAS;CAAC,MAAM;CAAO,WAAW;AAAK,CAAC,CAAA,GAAA,uBAAA,WAAA,SAAA,KAAA,CAAA;AACxCA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,uBAAA,WAAA,WAAA,KAAA,CAAA;AARzB,yBAAAA,WAAA,CAAA,cAAc,2BAA2B,CAAA,GAAA,sBAAA"}
|
|
@@ -40,6 +40,12 @@ var automation_badge_default = css`* {
|
|
|
40
40
|
height: 100%;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
.wrapper .letter {
|
|
44
|
+
font-family: var(--global-typography-font-family);
|
|
45
|
+
/* the design outlines the letters at the bold weight */
|
|
46
|
+
font-weight: var(--font-weight-bold);
|
|
47
|
+
}
|
|
48
|
+
|
|
43
49
|
.wrapper.flat .badge {
|
|
44
50
|
width: var(--automation-components-badge-new-icon-size-flat);
|
|
45
51
|
height: var(--automation-components-badge-new-icon-size-flat);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import '../../icons/icon-alert-off-filled.js';
|
|
3
|
+
import '../../icons/icon-alerts-shelf.js';
|
|
3
4
|
import '../../icons/icon-auto.js';
|
|
4
5
|
import '../../icons/icon-manual.js';
|
|
5
6
|
import '../../icons/icon-manual-only.js';
|
|
@@ -23,6 +24,8 @@ export declare enum ObcAutomationBadgeType {
|
|
|
23
24
|
Interlock = "interlock",
|
|
24
25
|
InterlockInhibit = "interlock-inhibit",
|
|
25
26
|
AlertSilenced = "alert-silenced",
|
|
27
|
+
AlertShelved = "alert-shelved",
|
|
28
|
+
Simulation = "simulation",
|
|
26
29
|
Caution = "caution",
|
|
27
30
|
Warning = "warning",
|
|
28
31
|
Alarm = "alarm",
|
|
@@ -30,20 +33,77 @@ export declare enum ObcAutomationBadgeType {
|
|
|
30
33
|
LevelHigh = "level-high",
|
|
31
34
|
LevelMedium = "level-medium",
|
|
32
35
|
LevelLow = "level-low",
|
|
33
|
-
LevelDiagnostic = "level-diagnostic"
|
|
36
|
+
LevelDiagnostic = "level-diagnostic",
|
|
37
|
+
LetterA = "letter-a",
|
|
38
|
+
LetterB = "letter-b",
|
|
39
|
+
LetterC = "letter-c",
|
|
40
|
+
LetterD = "letter-d",
|
|
41
|
+
LetterE = "letter-e",
|
|
42
|
+
LetterF = "letter-f",
|
|
43
|
+
LetterG = "letter-g",
|
|
44
|
+
LetterH = "letter-h",
|
|
45
|
+
LetterI = "letter-i",
|
|
46
|
+
LetterJ = "letter-j",
|
|
47
|
+
LetterK = "letter-k",
|
|
48
|
+
LetterL = "letter-l",
|
|
49
|
+
LetterM = "letter-m",
|
|
50
|
+
LetterN = "letter-n",
|
|
51
|
+
LetterO = "letter-o",
|
|
52
|
+
LetterP = "letter-p",
|
|
53
|
+
LetterQ = "letter-q",
|
|
54
|
+
LetterR = "letter-r",
|
|
55
|
+
LetterS = "letter-s",
|
|
56
|
+
LetterT = "letter-t",
|
|
57
|
+
LetterU = "letter-u",
|
|
58
|
+
LetterV = "letter-v",
|
|
59
|
+
LetterW = "letter-w",
|
|
60
|
+
LetterX = "letter-x",
|
|
61
|
+
LetterY = "letter-y",
|
|
62
|
+
LetterZ = "letter-z"
|
|
34
63
|
}
|
|
35
64
|
/**
|
|
65
|
+
* Automation badge: one state glyph in the corner of a device button, tank
|
|
66
|
+
* or tile.
|
|
67
|
+
*
|
|
68
|
+
* ## Features
|
|
69
|
+
*
|
|
70
|
+
* - `type` picks the glyph: control mode (`auto`, `manual`, `manual-only`,
|
|
71
|
+
* `local`, `local-only`), `command-locked`, `interlock`,
|
|
72
|
+
* `interlock-inhibit`, `simulation`, `alert-silenced`, `alert-shelved`,
|
|
73
|
+
* the alert categories (`caution`, `warning`, `alarm`), the alert levels
|
|
74
|
+
* (`level-critical` to `level-diagnostic`) and one capital letter
|
|
75
|
+
* (`letter-a` to `letter-z`).
|
|
76
|
+
* - `mode` picks the surface: `flat` draws the glyph with a silhouette
|
|
77
|
+
* outline straight on the device, `regular` and `enhanced` put it on a
|
|
78
|
+
* bordered or raised chip. Alert categories and levels carry their own
|
|
79
|
+
* colour and render flat whatever the mode.
|
|
80
|
+
* - Without a built-in type the slots take a custom glyph.
|
|
81
|
+
*
|
|
82
|
+
* ## Usage
|
|
83
|
+
*
|
|
84
|
+
* Device buttons and tanks place it through `badgeControl`, `badgeAlert`,
|
|
85
|
+
* `badgeInterlock` and `badgeCommandLocked`; use the element directly for a
|
|
86
|
+
* badge outside those four corners.
|
|
87
|
+
*
|
|
88
|
+
* @property mode - Surface of the badge: `flat`, `regular` or `enhanced`.
|
|
89
|
+
* @property type - Built-in glyph to draw; unset renders the slots.
|
|
36
90
|
* @slot icon-silhouette - Custom silhouette/outline icon, rendered behind the default slot content when no built-in badge type matches.
|
|
37
91
|
* @slot - Default slot for custom badge content, rendered when no built-in badge type matches.
|
|
38
92
|
* @stable
|
|
39
93
|
*/
|
|
40
94
|
export declare class ObcAutomationBadge extends LitElement {
|
|
95
|
+
/** Surface of the badge: `flat`, `regular` or `enhanced`. */
|
|
41
96
|
mode: ObcAutomationBadgeMode;
|
|
97
|
+
/** Built-in glyph to draw; unset renders the slots. */
|
|
42
98
|
type?: ObcAutomationBadgeType;
|
|
43
99
|
private get effectiveMode();
|
|
44
100
|
private isAlertType;
|
|
45
101
|
private renderLevelCriticalIcon;
|
|
46
102
|
private renderLevelDiagnosticIcon;
|
|
103
|
+
/** The cube of the simulated badge, as the design draws it (Figma 1188:54997). */
|
|
104
|
+
private renderSimulationIcon;
|
|
105
|
+
/** A letter badge: one capital of the body font, hidden from assistive technology because the badge draws it twice. */
|
|
106
|
+
private renderLetterIcon;
|
|
47
107
|
private getIcon;
|
|
48
108
|
render(): import('lit-html').TemplateResult<1>;
|
|
49
109
|
static styles: import('lit').CSSResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automation-badge.d.ts","sourceRoot":"","sources":["../../../src/automation/automation-badge/automation-badge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAkB,MAAM,KAAK,CAAC;AAKhD,OAAO,sCAAsC,CAAC;AAC9C,OAAO,0BAA0B,CAAC;AAClC,OAAO,4BAA4B,CAAC;AACpC,OAAO,iCAAiC,CAAC;AACzC,OAAO,2BAA2B,CAAC;AACnC,OAAO,gCAAgC,CAAC;AACxC,OAAO,0BAA0B,CAAC;AAClC,OAAO,6BAA6B,CAAC;AACrC,OAAO,sCAAsC,CAAC;AAE9C,oBAAY,sBAAsB;IAChC,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAED,oBAAY,sBAAsB;IAChC,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,UAAU,gBAAgB;IAC1B,KAAK,UAAU;IACf,SAAS,eAAe;IACxB,aAAa,mBAAmB;IAChC,SAAS,cAAc;IACvB,gBAAgB,sBAAsB;IACtC,aAAa,mBAAmB;IAChC,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,aAAa,mBAAmB;IAChC,SAAS,eAAe;IACxB,WAAW,iBAAiB;IAC5B,QAAQ,cAAc;IACtB,eAAe,qBAAqB;
|
|
1
|
+
{"version":3,"file":"automation-badge.d.ts","sourceRoot":"","sources":["../../../src/automation/automation-badge/automation-badge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAkB,MAAM,KAAK,CAAC;AAKhD,OAAO,sCAAsC,CAAC;AAC9C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,0BAA0B,CAAC;AAClC,OAAO,4BAA4B,CAAC;AACpC,OAAO,iCAAiC,CAAC;AACzC,OAAO,2BAA2B,CAAC;AACnC,OAAO,gCAAgC,CAAC;AACxC,OAAO,0BAA0B,CAAC;AAClC,OAAO,6BAA6B,CAAC;AACrC,OAAO,sCAAsC,CAAC;AAE9C,oBAAY,sBAAsB;IAChC,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAED,oBAAY,sBAAsB;IAChC,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,UAAU,gBAAgB;IAC1B,KAAK,UAAU;IACf,SAAS,eAAe;IACxB,aAAa,mBAAmB;IAChC,SAAS,cAAc;IACvB,gBAAgB,sBAAsB;IACtC,aAAa,mBAAmB;IAChC,YAAY,kBAAkB;IAC9B,UAAU,eAAe;IACzB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,aAAa,mBAAmB;IAChC,SAAS,eAAe;IACxB,WAAW,iBAAiB;IAC5B,QAAQ,cAAc;IACtB,eAAe,qBAAqB;IACpC,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;IACpB,OAAO,aAAa;CACrB;AA6BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBACa,kBAAmB,SAAQ,UAAU;IACtB,IAAI,EAAE,sBAAsB,CACxB;IAEJ,IAAI,CAAC,EAAE,sBAAsB,CAAa;IAEpE,OAAO,KAAK,aAAa,GAMxB;IAED,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,uBAAuB;IAiD/B,OAAO,CAAC,yBAAyB;IAejC,kFAAkF;IAClF,OAAO,CAAC,oBAAoB;IAgB5B,uHAAuH;IACvH,OAAO,CAAC,gBAAgB;IAqBxB,OAAO,CAAC,OAAO;IA6SN,MAAM;IAQf,OAAgB,MAAM,0BAA2B;CAClD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,sBAAsB,EAAE,kBAAkB,CAAC;KAC5C;CACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import automation_badge_default from "./automation-badge.css_inline.js";
|
|
2
2
|
import { customElement } from "../../decorator.js";
|
|
3
3
|
import "../../icons/icon-alert-off-filled.js";
|
|
4
|
+
import "../../icons/icon-alerts-shelf.js";
|
|
4
5
|
import "../../icons/icon-auto.js";
|
|
5
6
|
import "../../icons/icon-manual.js";
|
|
6
7
|
import "../../icons/icon-manual-only.js";
|
|
@@ -30,6 +31,8 @@ var ObcAutomationBadgeType = /* @__PURE__ */ function(ObcAutomationBadgeType) {
|
|
|
30
31
|
ObcAutomationBadgeType["Interlock"] = "interlock";
|
|
31
32
|
ObcAutomationBadgeType["InterlockInhibit"] = "interlock-inhibit";
|
|
32
33
|
ObcAutomationBadgeType["AlertSilenced"] = "alert-silenced";
|
|
34
|
+
ObcAutomationBadgeType["AlertShelved"] = "alert-shelved";
|
|
35
|
+
ObcAutomationBadgeType["Simulation"] = "simulation";
|
|
33
36
|
ObcAutomationBadgeType["Caution"] = "caution";
|
|
34
37
|
ObcAutomationBadgeType["Warning"] = "warning";
|
|
35
38
|
ObcAutomationBadgeType["Alarm"] = "alarm";
|
|
@@ -38,6 +41,32 @@ var ObcAutomationBadgeType = /* @__PURE__ */ function(ObcAutomationBadgeType) {
|
|
|
38
41
|
ObcAutomationBadgeType["LevelMedium"] = "level-medium";
|
|
39
42
|
ObcAutomationBadgeType["LevelLow"] = "level-low";
|
|
40
43
|
ObcAutomationBadgeType["LevelDiagnostic"] = "level-diagnostic";
|
|
44
|
+
ObcAutomationBadgeType["LetterA"] = "letter-a";
|
|
45
|
+
ObcAutomationBadgeType["LetterB"] = "letter-b";
|
|
46
|
+
ObcAutomationBadgeType["LetterC"] = "letter-c";
|
|
47
|
+
ObcAutomationBadgeType["LetterD"] = "letter-d";
|
|
48
|
+
ObcAutomationBadgeType["LetterE"] = "letter-e";
|
|
49
|
+
ObcAutomationBadgeType["LetterF"] = "letter-f";
|
|
50
|
+
ObcAutomationBadgeType["LetterG"] = "letter-g";
|
|
51
|
+
ObcAutomationBadgeType["LetterH"] = "letter-h";
|
|
52
|
+
ObcAutomationBadgeType["LetterI"] = "letter-i";
|
|
53
|
+
ObcAutomationBadgeType["LetterJ"] = "letter-j";
|
|
54
|
+
ObcAutomationBadgeType["LetterK"] = "letter-k";
|
|
55
|
+
ObcAutomationBadgeType["LetterL"] = "letter-l";
|
|
56
|
+
ObcAutomationBadgeType["LetterM"] = "letter-m";
|
|
57
|
+
ObcAutomationBadgeType["LetterN"] = "letter-n";
|
|
58
|
+
ObcAutomationBadgeType["LetterO"] = "letter-o";
|
|
59
|
+
ObcAutomationBadgeType["LetterP"] = "letter-p";
|
|
60
|
+
ObcAutomationBadgeType["LetterQ"] = "letter-q";
|
|
61
|
+
ObcAutomationBadgeType["LetterR"] = "letter-r";
|
|
62
|
+
ObcAutomationBadgeType["LetterS"] = "letter-s";
|
|
63
|
+
ObcAutomationBadgeType["LetterT"] = "letter-t";
|
|
64
|
+
ObcAutomationBadgeType["LetterU"] = "letter-u";
|
|
65
|
+
ObcAutomationBadgeType["LetterV"] = "letter-v";
|
|
66
|
+
ObcAutomationBadgeType["LetterW"] = "letter-w";
|
|
67
|
+
ObcAutomationBadgeType["LetterX"] = "letter-x";
|
|
68
|
+
ObcAutomationBadgeType["LetterY"] = "letter-y";
|
|
69
|
+
ObcAutomationBadgeType["LetterZ"] = "letter-z";
|
|
41
70
|
return ObcAutomationBadgeType;
|
|
42
71
|
}({});
|
|
43
72
|
var ALERT_BADGE_TYPES = [
|
|
@@ -50,6 +79,18 @@ var ALERT_BADGE_TYPES = [
|
|
|
50
79
|
"level-low",
|
|
51
80
|
"level-diagnostic"
|
|
52
81
|
];
|
|
82
|
+
/**
|
|
83
|
+
* Letter badge geometry in the 16-unit badge box.
|
|
84
|
+
*
|
|
85
|
+
* The design outlines a 15.33 px capital on a 13.33 baseline, so the glyph
|
|
86
|
+
* fills the box the way the icon badges do (Figma 1188:55068).
|
|
87
|
+
*/
|
|
88
|
+
var LETTER_FONT_SIZE = 15.33;
|
|
89
|
+
var LETTER_BASELINE = 13.33;
|
|
90
|
+
/** The capital a `letter-<x>` type draws, `undefined` for every other type. */
|
|
91
|
+
function badgeLetter(type) {
|
|
92
|
+
return type?.match(/^letter-([a-z])$/)?.[1].toUpperCase();
|
|
93
|
+
}
|
|
53
94
|
var ObcAutomationBadge = class ObcAutomationBadge extends LitElement {
|
|
54
95
|
constructor(..._args) {
|
|
55
96
|
super(..._args);
|
|
@@ -121,10 +162,48 @@ var ObcAutomationBadge = class ObcAutomationBadge extends LitElement {
|
|
|
121
162
|
d="M7 1.33301H9V7.53301L13.2147 5.13301L14.2147 6.86634L10 9.33301L14.2147 11.7997L13.2147 13.533L9 11.133V15.667H7V11.133L2.78534 13.533L1.78534 11.7997L6 9.33301L1.78534 6.86634L2.78534 5.13301L7 7.53301V1.33301Z"
|
|
122
163
|
fill="var(--notification-enabled-background-color)"
|
|
123
164
|
/>
|
|
165
|
+
</svg>`;
|
|
166
|
+
}
|
|
167
|
+
/** The cube of the simulated badge, as the design draws it (Figma 1188:54997). */
|
|
168
|
+
renderSimulationIcon(className) {
|
|
169
|
+
return html`<svg
|
|
170
|
+
class=${className}
|
|
171
|
+
viewBox="0 0 16 16"
|
|
172
|
+
fill="currentColor"
|
|
173
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
174
|
+
>
|
|
175
|
+
<path
|
|
176
|
+
d="M7.33333 14.4833V8.38333L2 5.3V10.65C2 10.8944 2.05833 11.1167 2.175 11.3167C2.29167 11.5167 2.45555 11.6778 2.66667 11.8L7.33333 14.4833ZM8.66667 14.4833L13.3333 11.8C13.5444 11.6778 13.7083 11.5167 13.825 11.3167C13.9417 11.1167 14 10.8944 14 10.65V5.3L8.66667 8.38333V14.4833Z"
|
|
177
|
+
/>
|
|
178
|
+
<path
|
|
179
|
+
d="M13.2833 4.16667L8.66667 1.51667C8.45556 1.39444 8.23333 1.33333 8 1.33333C7.76667 1.33333 7.54444 1.39444 7.33333 1.51667L2.7 4.18333L8 7.23333L13.2833 4.16667Z"
|
|
180
|
+
/>
|
|
181
|
+
</svg>`;
|
|
182
|
+
}
|
|
183
|
+
/** A letter badge: one capital of the body font, hidden from assistive technology because the badge draws it twice. */
|
|
184
|
+
renderLetterIcon(letter, className) {
|
|
185
|
+
return html`<svg
|
|
186
|
+
class=${className}
|
|
187
|
+
viewBox="0 0 16 16"
|
|
188
|
+
fill="currentColor"
|
|
189
|
+
aria-hidden="true"
|
|
190
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
191
|
+
>
|
|
192
|
+
<text
|
|
193
|
+
class="letter"
|
|
194
|
+
x="8"
|
|
195
|
+
y=${LETTER_BASELINE}
|
|
196
|
+
font-size=${LETTER_FONT_SIZE}
|
|
197
|
+
text-anchor="middle"
|
|
198
|
+
>
|
|
199
|
+
${letter}
|
|
200
|
+
</text>
|
|
124
201
|
</svg>`;
|
|
125
202
|
}
|
|
126
203
|
getIcon() {
|
|
127
|
-
|
|
204
|
+
const letter = badgeLetter(this.type);
|
|
205
|
+
if (letter) return html`${this.renderLetterIcon(letter, "icon siluette")}${this.renderLetterIcon(letter, "icon")}`;
|
|
206
|
+
else if (this.type === "auto") return html`<obi-auto class="icon siluette"></obi-auto
|
|
128
207
|
><obi-auto class="icon"></obi-auto>`;
|
|
129
208
|
else if (this.type === "manual") return html`<obi-manual class="icon siluette"></obi-manual
|
|
130
209
|
><obi-manual class="icon"></obi-manual>`;
|
|
@@ -146,6 +225,9 @@ var ObcAutomationBadge = class ObcAutomationBadge extends LitElement {
|
|
|
146
225
|
class="icon siluette"
|
|
147
226
|
></obi-alert-off-filled
|
|
148
227
|
><obi-alert-off-filled class="icon"></obi-alert-off-filled>`;
|
|
228
|
+
else if (this.type === "alert-shelved") return html`<obi-alerts-shelf class="icon siluette"></obi-alerts-shelf
|
|
229
|
+
><obi-alerts-shelf class="icon"></obi-alerts-shelf>`;
|
|
230
|
+
else if (this.type === "simulation") return html`${this.renderSimulationIcon("icon siluette")}${this.renderSimulationIcon("icon")}`;
|
|
149
231
|
else if (this.type === "level-critical") return this.renderLevelCriticalIcon(this.effectiveMode === "flat");
|
|
150
232
|
else if (this.type === "level-diagnostic") return this.renderLevelDiagnosticIcon();
|
|
151
233
|
else if (this.isAlertType("caution", "level-low") && this.effectiveMode === "flat") return html`<svg
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automation-badge.js","names":["compentStyle","_decorate"],"sources":["../../../src/automation/automation-badge/automation-badge.ts"],"sourcesContent":["import {LitElement, html, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport compentStyle from './automation-badge.css?inline';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement} from '../../decorator.js';\nimport '../../icons/icon-alert-off-filled.js';\nimport '../../icons/icon-auto.js';\nimport '../../icons/icon-manual.js';\nimport '../../icons/icon-manual-only.js';\nimport '../../icons/icon-local.js';\nimport '../../icons/icon-local-only.js';\nimport '../../icons/icon-duty.js';\nimport '../../icons/icon-standby.js';\nimport '../../icons/icon-command-locked-f.js';\n\nexport enum ObcAutomationBadgeMode {\n Flat = 'flat',\n Regular = 'regular',\n Enhanced = 'enhanced',\n}\n\nexport enum ObcAutomationBadgeType {\n Auto = 'auto',\n Manual = 'manual',\n ManualOnly = 'manual-only',\n Local = 'local',\n LocalOnly = 'local-only',\n CommandLocked = 'command-locked',\n Interlock = 'interlock',\n InterlockInhibit = 'interlock-inhibit',\n AlertSilenced = 'alert-silenced',\n Caution = 'caution',\n Warning = 'warning',\n Alarm = 'alarm',\n LevelCritical = 'level-critical',\n LevelHigh = 'level-high',\n LevelMedium = 'level-medium',\n LevelLow = 'level-low',\n LevelDiagnostic = 'level-diagnostic',\n}\n\nconst ALERT_BADGE_TYPES: ObcAutomationBadgeType[] = [\n ObcAutomationBadgeType.Caution,\n ObcAutomationBadgeType.Warning,\n ObcAutomationBadgeType.Alarm,\n ObcAutomationBadgeType.LevelCritical,\n ObcAutomationBadgeType.LevelHigh,\n ObcAutomationBadgeType.LevelMedium,\n ObcAutomationBadgeType.LevelLow,\n ObcAutomationBadgeType.LevelDiagnostic,\n];\n\n/**\n * @slot icon-silhouette - Custom silhouette/outline icon, rendered behind the default slot content when no built-in badge type matches.\n * @slot - Default slot for custom badge content, rendered when no built-in badge type matches.\n * @stable\n */\n@customElement('obc-automation-badge')\nexport class ObcAutomationBadge extends LitElement {\n @property({type: String}) mode: ObcAutomationBadgeMode =\n ObcAutomationBadgeMode.Flat;\n\n @property({type: String}) type?: ObcAutomationBadgeType = undefined;\n\n private get effectiveMode() {\n if (this.type && ALERT_BADGE_TYPES.includes(this.type)) {\n return ObcAutomationBadgeMode.Flat;\n } else {\n return this.mode;\n }\n }\n\n private isAlertType(...types: ObcAutomationBadgeType[]): boolean {\n return !!this.type && types.includes(this.type);\n }\n\n private renderLevelCriticalIcon(flat: boolean) {\n if (flat) {\n return html`<svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M14.667 8L11.3337 13.77H4.66634L1.33301 8L4.66634 2.23H11.3337L14.667 8Z\"\n fill=\"var(--critical-enabled-background-color)\"\n />\n <path\n d=\"M11.1543 2.72998H4.8457L2.51237 7.99998L4.8457 13.27H11.1543L13.4876 7.99998L11.1543 2.72998Z\"\n stroke=\"var(--critical-enabled-border-color)\"\n />\n <path\n d=\"M7.66754 10.3343V5.00098H9.00087V10.3343H7.66754Z\"\n fill=\"var(--on-critical-active-color)\"\n />\n <path\n d=\"M9.00087 11.6676H7.66754V13.001H9.00087V11.6676Z\"\n fill=\"var(--on-critical-active-color)\"\n />\n </svg>`;\n }\n return html`<svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M2 0.5H14C14.8284 0.5 15.5 1.17157 15.5 2V14C15.5 14.8284 14.8284 15.5 14 15.5H2C1.17157 15.5 0.5 14.8284 0.5 14V2C0.5 1.17157 1.17157 0.5 2 0.5Z\"\n fill=\"var(--critical-enabled-background-color)\"\n />\n <path\n d=\"M2 0.5H14C14.8284 0.5 15.5 1.17157 15.5 2V14C15.5 14.8284 14.8284 15.5 14 15.5H2C1.17157 15.5 0.5 14.8284 0.5 14V2C0.5 1.17157 1.17157 0.5 2 0.5Z\"\n stroke=\"var(--critical-enabled-border-color)\"\n />\n <path\n d=\"M14 8L10.9282 13.33H5.0718L2 8L5.0718 2.67H10.9282L14 8Z\"\n fill=\"var(--on-critical-active-color)\"\n />\n </svg>`;\n }\n\n private renderLevelDiagnosticIcon() {\n return html`<svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M7 1.33301H9V7.53301L13.2147 5.13301L14.2147 6.86634L10 9.33301L14.2147 11.7997L13.2147 13.533L9 11.133V15.667H7V11.133L2.78534 13.533L1.78534 11.7997L6 9.33301L1.78534 6.86634L2.78534 5.13301L7 7.53301V1.33301Z\"\n fill=\"var(--notification-enabled-background-color)\"\n />\n </svg>`;\n }\n\n // TODO(designer): rename the 'siluette' typo to 'silhouette', in Figma too\n private getIcon() {\n if (this.type === ObcAutomationBadgeType.Auto) {\n return html`<obi-auto class=\"icon siluette\"></obi-auto\n ><obi-auto class=\"icon\"></obi-auto>`;\n } else if (this.type === ObcAutomationBadgeType.Manual) {\n return html`<obi-manual class=\"icon siluette\"></obi-manual\n ><obi-manual class=\"icon\"></obi-manual>`;\n } else if (this.type === ObcAutomationBadgeType.ManualOnly) {\n return html`<obi-manual-only class=\"icon siluette\"></obi-manual-only\n ><obi-manual-only class=\"icon\"></obi-manual-only>`;\n } else if (this.type === ObcAutomationBadgeType.Local) {\n return html`<obi-local class=\"icon siluette\"></obi-local\n ><obi-local class=\"icon\"></obi-local>`;\n } else if (this.type === ObcAutomationBadgeType.LocalOnly) {\n return html`<obi-local-only class=\"icon siluette\"></obi-local-only\n ><obi-local-only class=\"icon\"></obi-local-only>`;\n } else if (this.type === ObcAutomationBadgeType.CommandLocked) {\n return html`<obi-command-locked-f\n class=\"icon siluette\"\n ></obi-command-locked-f\n ><obi-command-locked-f class=\"icon\"></obi-command-locked-f>`;\n } else if (this.type === ObcAutomationBadgeType.InterlockInhibit) {\n return html`<obi-standby class=\"icon siluette\"></obi-standby\n ><obi-standby class=\"icon\"></obi-standby>`;\n } else if (this.type === ObcAutomationBadgeType.Interlock) {\n return html`<obi-duty class=\"icon siluette\"></obi-duty\n ><obi-duty class=\"icon\"></obi-duty>`;\n } else if (this.type === ObcAutomationBadgeType.AlertSilenced) {\n return html`<obi-alert-off-filled\n class=\"icon siluette\"\n ></obi-alert-off-filled\n ><obi-alert-off-filled class=\"icon\"></obi-alert-off-filled>`;\n } else if (this.type === ObcAutomationBadgeType.LevelCritical) {\n return this.renderLevelCriticalIcon(\n this.effectiveMode === ObcAutomationBadgeMode.Flat\n );\n } else if (this.type === ObcAutomationBadgeType.LevelDiagnostic) {\n return this.renderLevelDiagnosticIcon();\n } else if (\n this.isAlertType(\n ObcAutomationBadgeType.Caution,\n ObcAutomationBadgeType.LevelLow\n ) &&\n this.effectiveMode === ObcAutomationBadgeMode.Flat\n ) {\n return html`<svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <mask\n id=\"path-2-outside-1_37206_122649\"\n maskUnits=\"userSpaceOnUse\"\n x=\"0.333008\"\n y=\"0.333008\"\n width=\"16\"\n height=\"16\"\n fill=\"black\"\n >\n <rect fill=\"white\" x=\"0.333008\" y=\"0.333008\" width=\"16\" height=\"16\" />\n <path\n d=\"M13.333 1.33301C14.0694 1.33301 14.667 1.93061 14.667 2.66699V13.333C14.667 14.0694 14.0694 14.667 13.333 14.667H2.66699C1.93061 14.667 1.33301 14.0694 1.33301 13.333V2.66699C1.33301 1.93061 1.93061 1.33301 2.66699 1.33301H13.333Z\"\n />\n </mask>\n <path\n d=\"M13.333 1.33301V2.33301C13.5171 2.33301 13.667 2.4829 13.667 2.66699H14.667H15.667C15.667 1.37833 14.6217 0.333008 13.333 0.333008V1.33301ZM14.667 2.66699H13.667V13.333H14.667H15.667V2.66699H14.667ZM14.667 13.333H13.667C13.667 13.5171 13.5171 13.667 13.333 13.667V14.667V15.667C14.6217 15.667 15.667 14.6217 15.667 13.333H14.667ZM13.333 14.667V13.667H2.66699V14.667V15.667H13.333V14.667ZM2.66699 14.667V13.667C2.4829 13.667 2.33301 13.5171 2.33301 13.333H1.33301H0.333008C0.333008 14.6217 1.37833 15.667 2.66699 15.667V14.667ZM1.33301 13.333H2.33301V2.66699H1.33301H0.333008V13.333H1.33301ZM1.33301 2.66699H2.33301C2.33301 2.4829 2.4829 2.33301 2.66699 2.33301V1.33301V0.333008C1.37833 0.333008 0.333008 1.37833 0.333008 2.66699H1.33301ZM2.66699 1.33301V2.33301H13.333V1.33301V0.333008H2.66699V1.33301Z\"\n fill=\"var(--border-silhouette-color)\"\n mask=\"url(#path-2-outside-1_37206_122649)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M2.66665 1.33301C1.93027 1.33301 1.33331 1.92996 1.33331 2.66634V13.333C1.33331 14.0694 1.93027 14.6663 2.66665 14.6663H13.3333C14.0697 14.6663 14.6666 14.0694 14.6666 13.333V2.66634C14.6666 1.92996 14.0697 1.33301 13.3333 1.33301H2.66665Z\"\n fill=\"var(--alert-caution-color)\"\n />\n <path\n d=\"M2.66632 1.83301H13.3333C13.7934 1.83301 14.1661 2.20593 14.1663 2.66602V13.333C14.1663 13.7932 13.7936 14.166 13.3333 14.166H2.66632C2.20623 14.1658 1.83331 13.7931 1.83331 13.333V2.66602C1.83348 2.2347 2.16127 1.8796 2.58136 1.83691L2.66632 1.83301Z\"\n stroke=\"var(--alert-caution-outline-color)\"\n />\n <path\n d=\"M7.33331 9.33333V4H8.66665V9.33333H7.33331Z\"\n fill=\"var(--on-caution-active-color)\"\n />\n <path\n d=\"M8.66665 10.6667H7.33331V12H8.66665V10.6667Z\"\n fill=\"var(--on-caution-active-color)\"\n />\n </svg>`;\n } else if (\n this.isAlertType(\n ObcAutomationBadgeType.Caution,\n ObcAutomationBadgeType.LevelLow\n )\n ) {\n return html`<svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M2 0.5H14C14.8284 0.5 15.5 1.17157 15.5 2V14C15.5 14.8284 14.8284 15.5 14 15.5H2C1.17157 15.5 0.5 14.8284 0.5 14V2C0.5 1.17157 1.17157 0.5 2 0.5Z\"\n fill=\"var(--alert-caution-color)\"\n />\n <path\n d=\"M2 0.5H14C14.8284 0.5 15.5 1.17157 15.5 2V14C15.5 14.8284 14.8284 15.5 14 15.5H2C1.17157 15.5 0.5 14.8284 0.5 14V2C0.5 1.17157 1.17157 0.5 2 0.5Z\"\n stroke=\"var(--alert-caution-outline-color)\"\n />\n <path\n d=\"M3.5 4.3C3.5 4.01997 3.5 3.87996 3.5545 3.773C3.60243 3.67892 3.67892 3.60243 3.773 3.5545C3.87996 3.5 4.01997 3.5 4.3 3.5H11.7C11.98 3.5 12.12 3.5 12.227 3.5545C12.3211 3.60243 12.3976 3.67892 12.4455 3.773C12.5 3.87996 12.5 4.01997 12.5 4.3V11.7C12.5 11.98 12.5 12.12 12.4455 12.227C12.3976 12.3211 12.3211 12.3976 12.227 12.4455C12.12 12.5 11.98 12.5 11.7 12.5H4.3C4.01997 12.5 3.87996 12.5 3.773 12.4455C3.67892 12.3976 3.60243 12.3211 3.5545 12.227C3.5 12.12 3.5 11.98 3.5 11.7V4.3Z\"\n fill=\"var(--on-caution-active-color)\"\n />\n </svg> `;\n } else if (\n this.isAlertType(\n ObcAutomationBadgeType.Warning,\n ObcAutomationBadgeType.LevelMedium\n ) &&\n this.effectiveMode === ObcAutomationBadgeMode.Flat\n ) {\n return html`\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <mask\n id=\"path-2-outside-1_37206_122675\"\n maskUnits=\"userSpaceOnUse\"\n x=\"0.333008\"\n y=\"0.333008\"\n width=\"16\"\n height=\"16\"\n fill=\"black\"\n >\n <rect\n fill=\"white\"\n x=\"0.333008\"\n y=\"0.333008\"\n width=\"16\"\n height=\"16\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M8 1.33301C11.6819 1.33301 14.667 4.3181 14.667 8C14.667 11.6819 11.6819 14.667 8 14.667C4.3181 14.667 1.33301 11.6819 1.33301 8C1.33301 4.3181 4.3181 1.33301 8 1.33301Z\"\n />\n </mask>\n <path\n d=\"M8 1.33301V0.333008V0.333008V1.33301ZM14.667 8H15.667V8H14.667ZM8 14.667V15.667V15.667V14.667ZM1.33301 8H0.333008V8H1.33301ZM8 1.33301V2.33301C11.1296 2.33301 13.667 4.87039 13.667 8H14.667H15.667C15.667 3.76582 12.2342 0.333008 8 0.333008V1.33301ZM14.667 8H13.667C13.667 11.1296 11.1296 13.667 8 13.667V14.667V15.667C12.2342 15.667 15.667 12.2342 15.667 8H14.667ZM8 14.667V13.667C4.87039 13.667 2.33301 11.1296 2.33301 8H1.33301H0.333008C0.333008 12.2342 3.76582 15.667 8 15.667V14.667ZM1.33301 8H2.33301C2.33301 4.87039 4.87039 2.33301 8 2.33301V1.33301V0.333008C3.76582 0.333008 0.333008 3.76582 0.333008 8H1.33301Z\"\n fill=\"var(--border-silhouette-color)\"\n mask=\"url(#path-2-outside-1_37206_122675)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M14.6666 7.99967C14.6666 11.6816 11.6819 14.6663 7.99998 14.6663C4.31808 14.6663 1.33331 11.6816 1.33331 7.99967C1.33331 4.31778 4.31808 1.33301 7.99998 1.33301C11.6819 1.33301 14.6666 4.31778 14.6666 7.99967Z\"\n fill=\"var(--alert-warning-color)\"\n />\n <path\n d=\"M8.00031 1.83301C11.4059 1.83318 14.1663 4.59435 14.1663 8C14.1661 11.4055 11.4058 14.1658 8.00031 14.166C4.59466 14.166 1.83349 11.4056 1.83331 8C1.83331 4.59424 4.59455 1.83301 8.00031 1.83301Z\"\n stroke=\"var(--alert-warning-outline-color)\"\n />\n <path\n d=\"M8.66665 8.66699V4.66699H7.33331V8.66699H8.66665Z\"\n fill=\"var(--on-warning-active-color)\"\n />\n <path\n d=\"M8.66665 11.3337V10.0003H7.33331V11.3337H8.66665Z\"\n fill=\"var(--on-warning-active-color)\"\n />\n </svg>\n `;\n } else if (\n this.isAlertType(\n ObcAutomationBadgeType.Warning,\n ObcAutomationBadgeType.LevelMedium\n )\n ) {\n return html`<svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M2 0.5H14C14.8284 0.5 15.5 1.17157 15.5 2V14C15.5 14.8284 14.8284 15.5 14 15.5H2C1.17157 15.5 0.5 14.8284 0.5 14V2C0.5 1.17157 1.17157 0.5 2 0.5Z\"\n fill=\"var(--alert-warning-color)\"\n />\n <path\n d=\"M2 0.5H14C14.8284 0.5 15.5 1.17157 15.5 2V14C15.5 14.8284 14.8284 15.5 14 15.5H2C1.17157 15.5 0.5 14.8284 0.5 14V2C0.5 1.17157 1.17157 0.5 2 0.5Z\"\n stroke=\"var(--alert-warning-outline-color)\"\n />\n <circle cx=\"8\" cy=\"8\" r=\"5\" fill=\"var(--on-warning-active-color)\" />\n </svg> `;\n } else if (\n this.isAlertType(\n ObcAutomationBadgeType.Alarm,\n ObcAutomationBadgeType.LevelHigh\n ) &&\n this.effectiveMode === ObcAutomationBadgeMode.Flat\n ) {\n return html`<svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0.5 0.5 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <mask\n id=\"path-2-outside-1_37206_122701\"\n maskUnits=\"userSpaceOnUse\"\n x=\"-0.998657\"\n y=\"0\"\n width=\"18\"\n height=\"17\"\n fill=\"black\"\n >\n <rect fill=\"white\" x=\"-0.998657\" width=\"18\" height=\"17\" />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M7.74502 1.35587C7.99509 0.881431 8.67474 0.881322 8.9247 1.35587L15.5897 14.0229C15.8233 14.4669 15.5015 15.0004 14.9999 15.0004H1.66884C1.16718 15.0004 0.845307 14.4669 1.079 14.0229L7.74502 1.35587Z\"\n />\n </mask>\n <path\n d=\"M7.74502 1.35587L6.86038 0.889586L6.86007 0.89017L7.74502 1.35587ZM8.9247 1.35587L9.80967 0.890223L9.80947 0.889831L8.9247 1.35587ZM15.5897 14.0229L16.4748 13.5573L16.4747 13.5572L15.5897 14.0229ZM1.079 14.0229L1.96393 14.4886L1.96394 14.4886L1.079 14.0229ZM7.74502 1.35587L8.62965 1.82216C8.50484 2.05895 8.16519 2.0597 8.03994 1.82191L8.9247 1.35587L9.80947 0.889831C9.18429 -0.297052 7.48534 -0.296087 6.86038 0.889586L7.74502 1.35587ZM8.9247 1.35587L8.03973 1.82152L14.7048 14.4885L15.5897 14.0229L16.4747 13.5572L9.80967 0.890223L8.9247 1.35587ZM15.5897 14.0229L14.7047 14.4884C14.5885 14.2675 14.7481 14.0004 14.9999 14.0004V15.0004V16.0004C16.255 16.0004 17.0582 14.6663 16.4748 13.5573L15.5897 14.0229ZM14.9999 15.0004V14.0004H1.66884V15.0004V16.0004H14.9999V15.0004ZM1.66884 15.0004V14.0004C1.92039 14.0004 2.08037 14.2673 1.96393 14.4886L1.079 14.0229L0.194074 13.5571C-0.389754 14.6665 0.413976 16.0004 1.66884 16.0004V15.0004ZM1.079 14.0229L1.96394 14.4886L8.62996 1.82157L7.74502 1.35587L6.86007 0.89017L0.194059 13.5572L1.079 14.0229Z\"\n fill=\"var(--border-silhouette-color)\"\n mask=\"url(#path-2-outside-1_37206_122701)\"\n />\n <path\n d=\"M1.07857 14.0235L7.74479 1.35716C7.99473 0.882236 8.6746 0.882252 8.92453 1.35719L15.5899 14.0236C15.8236 14.4676 15.5017 15.001 15.0001 15.001L1.66843 15.001C1.16677 15.001 0.844878 14.4676 1.07857 14.0235Z\"\n fill=\"var(--alert-alarm-color)\"\n />\n <path\n d=\"M8.18744 1.58984C8.25002 1.47134 8.41991 1.4712 8.48236 1.58984L15.1474 14.2568C15.2057 14.3681 15.125 14.501 14.9999 14.501H1.66888C1.54379 14.501 1.46302 14.3681 1.52142 14.2568L8.18744 1.58984Z\"\n stroke=\"var(--alert-alarm-outline-color)\"\n />\n <path\n d=\"M7.66754 10.3343V5.00098H9.00087V10.3343H7.66754Z\"\n fill=\"var(--on-alarm-active-color)\"\n />\n <path\n d=\"M9.00087 11.6676H7.66754V13.001H9.00087V11.6676Z\"\n fill=\"var(--on-alarm-active-color)\"\n />\n </svg> `;\n } else if (\n this.isAlertType(\n ObcAutomationBadgeType.Alarm,\n ObcAutomationBadgeType.LevelHigh\n )\n ) {\n return html`\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M2 0.5H14C14.8284 0.5 15.5 1.17157 15.5 2V14C15.5 14.8284 14.8284 15.5 14 15.5H2C1.17157 15.5 0.5 14.8284 0.5 14V2C0.5 1.17157 1.17157 0.5 2 0.5Z\"\n fill=\"var(--alert-alarm-color)\"\n />\n <path\n d=\"M2 0.5H14C14.8284 0.5 15.5 1.17157 15.5 2V14C15.5 14.8284 14.8284 15.5 14 15.5H2C1.17157 15.5 0.5 14.8284 0.5 14V2C0.5 1.17157 1.17157 0.5 2 0.5Z\"\n stroke=\"var(--alert-alarm-outline-color)\"\n />\n <path\n d=\"M7.29883 3.72622L3.05891 11.3269C2.84063 11.7182 2.73149 11.9139 2.75 12.0741C2.76615 12.2138 2.84042 12.3403 2.9546 12.4225C3.08546 12.5167 3.30949 12.5167 3.75756 12.5167H12.2348C12.6828 12.5167 12.9068 12.5167 13.0376 12.4225C13.1518 12.3403 13.2261 12.2139 13.2422 12.0741C13.2608 11.914 13.1517 11.7184 12.9336 11.3271L8.69623 3.7264C8.46805 3.31712 8.35396 3.11247 8.2037 3.04447C8.07271 2.98519 7.92254 2.98517 7.79153 3.04442C7.64125 3.11238 7.52711 3.317 7.29883 3.72622Z\"\n fill=\"var(--on-alarm-active-color)\"\n />\n </svg>\n `;\n } else {\n return html`<slot name=\"icon-silhouette\"></slot><slot></slot>`;\n }\n }\n\n override render() {\n return html`\n <div class=${classMap({wrapper: true, [this.effectiveMode]: true})}>\n <div class=\"badge\">${this.getIcon()}</div>\n </div>\n `;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-automation-badge': ObcAutomationBadge;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,IAAY,yBAAL,yBAAA,wBAAA;CACL,uBAAA,UAAA;CACA,uBAAA,aAAA;CACA,uBAAA,cAAA;;AACF,EAAA,CAAA,CAAA;AAEA,IAAY,yBAAL,yBAAA,wBAAA;CACL,uBAAA,UAAA;CACA,uBAAA,YAAA;CACA,uBAAA,gBAAA;CACA,uBAAA,WAAA;CACA,uBAAA,eAAA;CACA,uBAAA,mBAAA;CACA,uBAAA,eAAA;CACA,uBAAA,sBAAA;CACA,uBAAA,mBAAA;CACA,uBAAA,aAAA;CACA,uBAAA,aAAA;CACA,uBAAA,WAAA;CACA,uBAAA,mBAAA;CACA,uBAAA,eAAA;CACA,uBAAA,iBAAA;CACA,uBAAA,cAAA;CACA,uBAAA,qBAAA;;AACF,EAAA,CAAA,CAAA;AAEA,IAAM,oBAA8C;;;;;;;;;AASpD;AAQO,IAAM,qBAAN,MAAM,2BAA2B,WAAW;;;;EAIS,KAAA,OAAA,KAAA;;CAE1D,IAAY,gBAAgB;EAC1B,IAAI,KAAK,QAAQ,kBAAkB,SAAS,KAAK,IAAI,GACnD,OAAA;OAEA,OAAO,KAAK;CAEhB;CAEA,YAAoB,GAAG,OAA0C;EAC/D,OAAO,CAAC,CAAC,KAAK,QAAQ,MAAM,SAAS,KAAK,IAAI;CAChD;CAEA,wBAAgC,MAAe;EAC7C,IAAI,MACF,OAAO,IAAI;;;;;;;;;;;;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;;;;;;;;;;;;;OAuBX,OAAO,IAAI;CAEf;CAEA,SAAkB;EAChB,OAAO,IAAI;mBACI,SAAS;GAAC,SAAS;IAAO,KAAK,gBAAgB;EAAI,CAAC,EAAE;6BAC5C,KAAK,QAAQ,EAAE;;;CAG1C;;EAEyB,KAAA,SAAA,UAAUA,wBAAY;;AACjD;AAzXGC,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,mBAAA,WAAA,QAAA,KAAA,CAAA;AAGvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,mBAAA,WAAA,QAAA,KAAA,CAAA;AALzB,qBAAAA,WAAA,CAAA,cAAc,sBAAsB,CAAA,GAAA,kBAAA"}
|
|
1
|
+
{"version":3,"file":"automation-badge.js","names":["compentStyle","_decorate"],"sources":["../../../src/automation/automation-badge/automation-badge.ts"],"sourcesContent":["import {LitElement, html, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport compentStyle from './automation-badge.css?inline';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement} from '../../decorator.js';\nimport '../../icons/icon-alert-off-filled.js';\nimport '../../icons/icon-alerts-shelf.js';\nimport '../../icons/icon-auto.js';\nimport '../../icons/icon-manual.js';\nimport '../../icons/icon-manual-only.js';\nimport '../../icons/icon-local.js';\nimport '../../icons/icon-local-only.js';\nimport '../../icons/icon-duty.js';\nimport '../../icons/icon-standby.js';\nimport '../../icons/icon-command-locked-f.js';\n\nexport enum ObcAutomationBadgeMode {\n Flat = 'flat',\n Regular = 'regular',\n Enhanced = 'enhanced',\n}\n\nexport enum ObcAutomationBadgeType {\n Auto = 'auto',\n Manual = 'manual',\n ManualOnly = 'manual-only',\n Local = 'local',\n LocalOnly = 'local-only',\n CommandLocked = 'command-locked',\n Interlock = 'interlock',\n InterlockInhibit = 'interlock-inhibit',\n AlertSilenced = 'alert-silenced',\n AlertShelved = 'alert-shelved',\n Simulation = 'simulation',\n Caution = 'caution',\n Warning = 'warning',\n Alarm = 'alarm',\n LevelCritical = 'level-critical',\n LevelHigh = 'level-high',\n LevelMedium = 'level-medium',\n LevelLow = 'level-low',\n LevelDiagnostic = 'level-diagnostic',\n LetterA = 'letter-a',\n LetterB = 'letter-b',\n LetterC = 'letter-c',\n LetterD = 'letter-d',\n LetterE = 'letter-e',\n LetterF = 'letter-f',\n LetterG = 'letter-g',\n LetterH = 'letter-h',\n LetterI = 'letter-i',\n LetterJ = 'letter-j',\n LetterK = 'letter-k',\n LetterL = 'letter-l',\n LetterM = 'letter-m',\n LetterN = 'letter-n',\n LetterO = 'letter-o',\n LetterP = 'letter-p',\n LetterQ = 'letter-q',\n LetterR = 'letter-r',\n LetterS = 'letter-s',\n LetterT = 'letter-t',\n LetterU = 'letter-u',\n LetterV = 'letter-v',\n LetterW = 'letter-w',\n LetterX = 'letter-x',\n LetterY = 'letter-y',\n LetterZ = 'letter-z',\n}\n\nconst ALERT_BADGE_TYPES: ObcAutomationBadgeType[] = [\n ObcAutomationBadgeType.Caution,\n ObcAutomationBadgeType.Warning,\n ObcAutomationBadgeType.Alarm,\n ObcAutomationBadgeType.LevelCritical,\n ObcAutomationBadgeType.LevelHigh,\n ObcAutomationBadgeType.LevelMedium,\n ObcAutomationBadgeType.LevelLow,\n ObcAutomationBadgeType.LevelDiagnostic,\n];\n\n/**\n * Letter badge geometry in the 16-unit badge box.\n *\n * The design outlines a 15.33 px capital on a 13.33 baseline, so the glyph\n * fills the box the way the icon badges do (Figma 1188:55068).\n */\nconst LETTER_FONT_SIZE = 15.33;\nconst LETTER_BASELINE = 13.33;\n\n/** The capital a `letter-<x>` type draws, `undefined` for every other type. */\nfunction badgeLetter(\n type: ObcAutomationBadgeType | undefined\n): string | undefined {\n return type?.match(/^letter-([a-z])$/)?.[1].toUpperCase();\n}\n\n/**\n * Automation badge: one state glyph in the corner of a device button, tank\n * or tile.\n *\n * ## Features\n *\n * - `type` picks the glyph: control mode (`auto`, `manual`, `manual-only`,\n * `local`, `local-only`), `command-locked`, `interlock`,\n * `interlock-inhibit`, `simulation`, `alert-silenced`, `alert-shelved`,\n * the alert categories (`caution`, `warning`, `alarm`), the alert levels\n * (`level-critical` to `level-diagnostic`) and one capital letter\n * (`letter-a` to `letter-z`).\n * - `mode` picks the surface: `flat` draws the glyph with a silhouette\n * outline straight on the device, `regular` and `enhanced` put it on a\n * bordered or raised chip. Alert categories and levels carry their own\n * colour and render flat whatever the mode.\n * - Without a built-in type the slots take a custom glyph.\n *\n * ## Usage\n *\n * Device buttons and tanks place it through `badgeControl`, `badgeAlert`,\n * `badgeInterlock` and `badgeCommandLocked`; use the element directly for a\n * badge outside those four corners.\n *\n * @property mode - Surface of the badge: `flat`, `regular` or `enhanced`.\n * @property type - Built-in glyph to draw; unset renders the slots.\n * @slot icon-silhouette - Custom silhouette/outline icon, rendered behind the default slot content when no built-in badge type matches.\n * @slot - Default slot for custom badge content, rendered when no built-in badge type matches.\n * @stable\n */\n@customElement('obc-automation-badge')\nexport class ObcAutomationBadge extends LitElement {\n @property({type: String}) mode: ObcAutomationBadgeMode =\n ObcAutomationBadgeMode.Flat;\n\n @property({type: String}) type?: ObcAutomationBadgeType = undefined;\n\n private get effectiveMode() {\n if (this.type && ALERT_BADGE_TYPES.includes(this.type)) {\n return ObcAutomationBadgeMode.Flat;\n } else {\n return this.mode;\n }\n }\n\n private isAlertType(...types: ObcAutomationBadgeType[]): boolean {\n return !!this.type && types.includes(this.type);\n }\n\n private renderLevelCriticalIcon(flat: boolean) {\n if (flat) {\n return html`<svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M14.667 8L11.3337 13.77H4.66634L1.33301 8L4.66634 2.23H11.3337L14.667 8Z\"\n fill=\"var(--critical-enabled-background-color)\"\n />\n <path\n d=\"M11.1543 2.72998H4.8457L2.51237 7.99998L4.8457 13.27H11.1543L13.4876 7.99998L11.1543 2.72998Z\"\n stroke=\"var(--critical-enabled-border-color)\"\n />\n <path\n d=\"M7.66754 10.3343V5.00098H9.00087V10.3343H7.66754Z\"\n fill=\"var(--on-critical-active-color)\"\n />\n <path\n d=\"M9.00087 11.6676H7.66754V13.001H9.00087V11.6676Z\"\n fill=\"var(--on-critical-active-color)\"\n />\n </svg>`;\n }\n return html`<svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M2 0.5H14C14.8284 0.5 15.5 1.17157 15.5 2V14C15.5 14.8284 14.8284 15.5 14 15.5H2C1.17157 15.5 0.5 14.8284 0.5 14V2C0.5 1.17157 1.17157 0.5 2 0.5Z\"\n fill=\"var(--critical-enabled-background-color)\"\n />\n <path\n d=\"M2 0.5H14C14.8284 0.5 15.5 1.17157 15.5 2V14C15.5 14.8284 14.8284 15.5 14 15.5H2C1.17157 15.5 0.5 14.8284 0.5 14V2C0.5 1.17157 1.17157 0.5 2 0.5Z\"\n stroke=\"var(--critical-enabled-border-color)\"\n />\n <path\n d=\"M14 8L10.9282 13.33H5.0718L2 8L5.0718 2.67H10.9282L14 8Z\"\n fill=\"var(--on-critical-active-color)\"\n />\n </svg>`;\n }\n\n private renderLevelDiagnosticIcon() {\n return html`<svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M7 1.33301H9V7.53301L13.2147 5.13301L14.2147 6.86634L10 9.33301L14.2147 11.7997L13.2147 13.533L9 11.133V15.667H7V11.133L2.78534 13.533L1.78534 11.7997L6 9.33301L1.78534 6.86634L2.78534 5.13301L7 7.53301V1.33301Z\"\n fill=\"var(--notification-enabled-background-color)\"\n />\n </svg>`;\n }\n\n /** The cube of the simulated badge, as the design draws it (Figma 1188:54997). */\n private renderSimulationIcon(className: string) {\n return html`<svg\n class=${className}\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M7.33333 14.4833V8.38333L2 5.3V10.65C2 10.8944 2.05833 11.1167 2.175 11.3167C2.29167 11.5167 2.45555 11.6778 2.66667 11.8L7.33333 14.4833ZM8.66667 14.4833L13.3333 11.8C13.5444 11.6778 13.7083 11.5167 13.825 11.3167C13.9417 11.1167 14 10.8944 14 10.65V5.3L8.66667 8.38333V14.4833Z\"\n />\n <path\n d=\"M13.2833 4.16667L8.66667 1.51667C8.45556 1.39444 8.23333 1.33333 8 1.33333C7.76667 1.33333 7.54444 1.39444 7.33333 1.51667L2.7 4.18333L8 7.23333L13.2833 4.16667Z\"\n />\n </svg>`;\n }\n\n /** A letter badge: one capital of the body font, hidden from assistive technology because the badge draws it twice. */\n private renderLetterIcon(letter: string, className: string) {\n return html`<svg\n class=${className}\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <text\n class=\"letter\"\n x=\"8\"\n y=${LETTER_BASELINE}\n font-size=${LETTER_FONT_SIZE}\n text-anchor=\"middle\"\n >\n ${letter}\n </text>\n </svg>`;\n }\n\n // TODO(designer): rename the 'siluette' typo to 'silhouette', in Figma too\n private getIcon() {\n const letter = badgeLetter(this.type);\n if (letter) {\n return html`${this.renderLetterIcon(\n letter,\n 'icon siluette'\n )}${this.renderLetterIcon(letter, 'icon')}`;\n } else if (this.type === ObcAutomationBadgeType.Auto) {\n return html`<obi-auto class=\"icon siluette\"></obi-auto\n ><obi-auto class=\"icon\"></obi-auto>`;\n } else if (this.type === ObcAutomationBadgeType.Manual) {\n return html`<obi-manual class=\"icon siluette\"></obi-manual\n ><obi-manual class=\"icon\"></obi-manual>`;\n } else if (this.type === ObcAutomationBadgeType.ManualOnly) {\n return html`<obi-manual-only class=\"icon siluette\"></obi-manual-only\n ><obi-manual-only class=\"icon\"></obi-manual-only>`;\n } else if (this.type === ObcAutomationBadgeType.Local) {\n return html`<obi-local class=\"icon siluette\"></obi-local\n ><obi-local class=\"icon\"></obi-local>`;\n } else if (this.type === ObcAutomationBadgeType.LocalOnly) {\n return html`<obi-local-only class=\"icon siluette\"></obi-local-only\n ><obi-local-only class=\"icon\"></obi-local-only>`;\n } else if (this.type === ObcAutomationBadgeType.CommandLocked) {\n return html`<obi-command-locked-f\n class=\"icon siluette\"\n ></obi-command-locked-f\n ><obi-command-locked-f class=\"icon\"></obi-command-locked-f>`;\n } else if (this.type === ObcAutomationBadgeType.InterlockInhibit) {\n return html`<obi-standby class=\"icon siluette\"></obi-standby\n ><obi-standby class=\"icon\"></obi-standby>`;\n } else if (this.type === ObcAutomationBadgeType.Interlock) {\n return html`<obi-duty class=\"icon siluette\"></obi-duty\n ><obi-duty class=\"icon\"></obi-duty>`;\n } else if (this.type === ObcAutomationBadgeType.AlertSilenced) {\n return html`<obi-alert-off-filled\n class=\"icon siluette\"\n ></obi-alert-off-filled\n ><obi-alert-off-filled class=\"icon\"></obi-alert-off-filled>`;\n } else if (this.type === ObcAutomationBadgeType.AlertShelved) {\n // TODO(designer): the sketch draws shelved as a diamond with a plus and\n // the alert counter uses a timer; this badge keeps alerts-shelf (#1424)\n return html`<obi-alerts-shelf class=\"icon siluette\"></obi-alerts-shelf\n ><obi-alerts-shelf class=\"icon\"></obi-alerts-shelf>`;\n } else if (this.type === ObcAutomationBadgeType.Simulation) {\n return html`${this.renderSimulationIcon(\n 'icon siluette'\n )}${this.renderSimulationIcon('icon')}`;\n } else if (this.type === ObcAutomationBadgeType.LevelCritical) {\n return this.renderLevelCriticalIcon(\n this.effectiveMode === ObcAutomationBadgeMode.Flat\n );\n } else if (this.type === ObcAutomationBadgeType.LevelDiagnostic) {\n return this.renderLevelDiagnosticIcon();\n } else if (\n this.isAlertType(\n ObcAutomationBadgeType.Caution,\n ObcAutomationBadgeType.LevelLow\n ) &&\n this.effectiveMode === ObcAutomationBadgeMode.Flat\n ) {\n return html`<svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <mask\n id=\"path-2-outside-1_37206_122649\"\n maskUnits=\"userSpaceOnUse\"\n x=\"0.333008\"\n y=\"0.333008\"\n width=\"16\"\n height=\"16\"\n fill=\"black\"\n >\n <rect fill=\"white\" x=\"0.333008\" y=\"0.333008\" width=\"16\" height=\"16\" />\n <path\n d=\"M13.333 1.33301C14.0694 1.33301 14.667 1.93061 14.667 2.66699V13.333C14.667 14.0694 14.0694 14.667 13.333 14.667H2.66699C1.93061 14.667 1.33301 14.0694 1.33301 13.333V2.66699C1.33301 1.93061 1.93061 1.33301 2.66699 1.33301H13.333Z\"\n />\n </mask>\n <path\n d=\"M13.333 1.33301V2.33301C13.5171 2.33301 13.667 2.4829 13.667 2.66699H14.667H15.667C15.667 1.37833 14.6217 0.333008 13.333 0.333008V1.33301ZM14.667 2.66699H13.667V13.333H14.667H15.667V2.66699H14.667ZM14.667 13.333H13.667C13.667 13.5171 13.5171 13.667 13.333 13.667V14.667V15.667C14.6217 15.667 15.667 14.6217 15.667 13.333H14.667ZM13.333 14.667V13.667H2.66699V14.667V15.667H13.333V14.667ZM2.66699 14.667V13.667C2.4829 13.667 2.33301 13.5171 2.33301 13.333H1.33301H0.333008C0.333008 14.6217 1.37833 15.667 2.66699 15.667V14.667ZM1.33301 13.333H2.33301V2.66699H1.33301H0.333008V13.333H1.33301ZM1.33301 2.66699H2.33301C2.33301 2.4829 2.4829 2.33301 2.66699 2.33301V1.33301V0.333008C1.37833 0.333008 0.333008 1.37833 0.333008 2.66699H1.33301ZM2.66699 1.33301V2.33301H13.333V1.33301V0.333008H2.66699V1.33301Z\"\n fill=\"var(--border-silhouette-color)\"\n mask=\"url(#path-2-outside-1_37206_122649)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M2.66665 1.33301C1.93027 1.33301 1.33331 1.92996 1.33331 2.66634V13.333C1.33331 14.0694 1.93027 14.6663 2.66665 14.6663H13.3333C14.0697 14.6663 14.6666 14.0694 14.6666 13.333V2.66634C14.6666 1.92996 14.0697 1.33301 13.3333 1.33301H2.66665Z\"\n fill=\"var(--alert-caution-color)\"\n />\n <path\n d=\"M2.66632 1.83301H13.3333C13.7934 1.83301 14.1661 2.20593 14.1663 2.66602V13.333C14.1663 13.7932 13.7936 14.166 13.3333 14.166H2.66632C2.20623 14.1658 1.83331 13.7931 1.83331 13.333V2.66602C1.83348 2.2347 2.16127 1.8796 2.58136 1.83691L2.66632 1.83301Z\"\n stroke=\"var(--alert-caution-outline-color)\"\n />\n <path\n d=\"M7.33331 9.33333V4H8.66665V9.33333H7.33331Z\"\n fill=\"var(--on-caution-active-color)\"\n />\n <path\n d=\"M8.66665 10.6667H7.33331V12H8.66665V10.6667Z\"\n fill=\"var(--on-caution-active-color)\"\n />\n </svg>`;\n } else if (\n this.isAlertType(\n ObcAutomationBadgeType.Caution,\n ObcAutomationBadgeType.LevelLow\n )\n ) {\n return html`<svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M2 0.5H14C14.8284 0.5 15.5 1.17157 15.5 2V14C15.5 14.8284 14.8284 15.5 14 15.5H2C1.17157 15.5 0.5 14.8284 0.5 14V2C0.5 1.17157 1.17157 0.5 2 0.5Z\"\n fill=\"var(--alert-caution-color)\"\n />\n <path\n d=\"M2 0.5H14C14.8284 0.5 15.5 1.17157 15.5 2V14C15.5 14.8284 14.8284 15.5 14 15.5H2C1.17157 15.5 0.5 14.8284 0.5 14V2C0.5 1.17157 1.17157 0.5 2 0.5Z\"\n stroke=\"var(--alert-caution-outline-color)\"\n />\n <path\n d=\"M3.5 4.3C3.5 4.01997 3.5 3.87996 3.5545 3.773C3.60243 3.67892 3.67892 3.60243 3.773 3.5545C3.87996 3.5 4.01997 3.5 4.3 3.5H11.7C11.98 3.5 12.12 3.5 12.227 3.5545C12.3211 3.60243 12.3976 3.67892 12.4455 3.773C12.5 3.87996 12.5 4.01997 12.5 4.3V11.7C12.5 11.98 12.5 12.12 12.4455 12.227C12.3976 12.3211 12.3211 12.3976 12.227 12.4455C12.12 12.5 11.98 12.5 11.7 12.5H4.3C4.01997 12.5 3.87996 12.5 3.773 12.4455C3.67892 12.3976 3.60243 12.3211 3.5545 12.227C3.5 12.12 3.5 11.98 3.5 11.7V4.3Z\"\n fill=\"var(--on-caution-active-color)\"\n />\n </svg> `;\n } else if (\n this.isAlertType(\n ObcAutomationBadgeType.Warning,\n ObcAutomationBadgeType.LevelMedium\n ) &&\n this.effectiveMode === ObcAutomationBadgeMode.Flat\n ) {\n return html`\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <mask\n id=\"path-2-outside-1_37206_122675\"\n maskUnits=\"userSpaceOnUse\"\n x=\"0.333008\"\n y=\"0.333008\"\n width=\"16\"\n height=\"16\"\n fill=\"black\"\n >\n <rect\n fill=\"white\"\n x=\"0.333008\"\n y=\"0.333008\"\n width=\"16\"\n height=\"16\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M8 1.33301C11.6819 1.33301 14.667 4.3181 14.667 8C14.667 11.6819 11.6819 14.667 8 14.667C4.3181 14.667 1.33301 11.6819 1.33301 8C1.33301 4.3181 4.3181 1.33301 8 1.33301Z\"\n />\n </mask>\n <path\n d=\"M8 1.33301V0.333008V0.333008V1.33301ZM14.667 8H15.667V8H14.667ZM8 14.667V15.667V15.667V14.667ZM1.33301 8H0.333008V8H1.33301ZM8 1.33301V2.33301C11.1296 2.33301 13.667 4.87039 13.667 8H14.667H15.667C15.667 3.76582 12.2342 0.333008 8 0.333008V1.33301ZM14.667 8H13.667C13.667 11.1296 11.1296 13.667 8 13.667V14.667V15.667C12.2342 15.667 15.667 12.2342 15.667 8H14.667ZM8 14.667V13.667C4.87039 13.667 2.33301 11.1296 2.33301 8H1.33301H0.333008C0.333008 12.2342 3.76582 15.667 8 15.667V14.667ZM1.33301 8H2.33301C2.33301 4.87039 4.87039 2.33301 8 2.33301V1.33301V0.333008C3.76582 0.333008 0.333008 3.76582 0.333008 8H1.33301Z\"\n fill=\"var(--border-silhouette-color)\"\n mask=\"url(#path-2-outside-1_37206_122675)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M14.6666 7.99967C14.6666 11.6816 11.6819 14.6663 7.99998 14.6663C4.31808 14.6663 1.33331 11.6816 1.33331 7.99967C1.33331 4.31778 4.31808 1.33301 7.99998 1.33301C11.6819 1.33301 14.6666 4.31778 14.6666 7.99967Z\"\n fill=\"var(--alert-warning-color)\"\n />\n <path\n d=\"M8.00031 1.83301C11.4059 1.83318 14.1663 4.59435 14.1663 8C14.1661 11.4055 11.4058 14.1658 8.00031 14.166C4.59466 14.166 1.83349 11.4056 1.83331 8C1.83331 4.59424 4.59455 1.83301 8.00031 1.83301Z\"\n stroke=\"var(--alert-warning-outline-color)\"\n />\n <path\n d=\"M8.66665 8.66699V4.66699H7.33331V8.66699H8.66665Z\"\n fill=\"var(--on-warning-active-color)\"\n />\n <path\n d=\"M8.66665 11.3337V10.0003H7.33331V11.3337H8.66665Z\"\n fill=\"var(--on-warning-active-color)\"\n />\n </svg>\n `;\n } else if (\n this.isAlertType(\n ObcAutomationBadgeType.Warning,\n ObcAutomationBadgeType.LevelMedium\n )\n ) {\n return html`<svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M2 0.5H14C14.8284 0.5 15.5 1.17157 15.5 2V14C15.5 14.8284 14.8284 15.5 14 15.5H2C1.17157 15.5 0.5 14.8284 0.5 14V2C0.5 1.17157 1.17157 0.5 2 0.5Z\"\n fill=\"var(--alert-warning-color)\"\n />\n <path\n d=\"M2 0.5H14C14.8284 0.5 15.5 1.17157 15.5 2V14C15.5 14.8284 14.8284 15.5 14 15.5H2C1.17157 15.5 0.5 14.8284 0.5 14V2C0.5 1.17157 1.17157 0.5 2 0.5Z\"\n stroke=\"var(--alert-warning-outline-color)\"\n />\n <circle cx=\"8\" cy=\"8\" r=\"5\" fill=\"var(--on-warning-active-color)\" />\n </svg> `;\n } else if (\n this.isAlertType(\n ObcAutomationBadgeType.Alarm,\n ObcAutomationBadgeType.LevelHigh\n ) &&\n this.effectiveMode === ObcAutomationBadgeMode.Flat\n ) {\n return html`<svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0.5 0.5 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <mask\n id=\"path-2-outside-1_37206_122701\"\n maskUnits=\"userSpaceOnUse\"\n x=\"-0.998657\"\n y=\"0\"\n width=\"18\"\n height=\"17\"\n fill=\"black\"\n >\n <rect fill=\"white\" x=\"-0.998657\" width=\"18\" height=\"17\" />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M7.74502 1.35587C7.99509 0.881431 8.67474 0.881322 8.9247 1.35587L15.5897 14.0229C15.8233 14.4669 15.5015 15.0004 14.9999 15.0004H1.66884C1.16718 15.0004 0.845307 14.4669 1.079 14.0229L7.74502 1.35587Z\"\n />\n </mask>\n <path\n d=\"M7.74502 1.35587L6.86038 0.889586L6.86007 0.89017L7.74502 1.35587ZM8.9247 1.35587L9.80967 0.890223L9.80947 0.889831L8.9247 1.35587ZM15.5897 14.0229L16.4748 13.5573L16.4747 13.5572L15.5897 14.0229ZM1.079 14.0229L1.96393 14.4886L1.96394 14.4886L1.079 14.0229ZM7.74502 1.35587L8.62965 1.82216C8.50484 2.05895 8.16519 2.0597 8.03994 1.82191L8.9247 1.35587L9.80947 0.889831C9.18429 -0.297052 7.48534 -0.296087 6.86038 0.889586L7.74502 1.35587ZM8.9247 1.35587L8.03973 1.82152L14.7048 14.4885L15.5897 14.0229L16.4747 13.5572L9.80967 0.890223L8.9247 1.35587ZM15.5897 14.0229L14.7047 14.4884C14.5885 14.2675 14.7481 14.0004 14.9999 14.0004V15.0004V16.0004C16.255 16.0004 17.0582 14.6663 16.4748 13.5573L15.5897 14.0229ZM14.9999 15.0004V14.0004H1.66884V15.0004V16.0004H14.9999V15.0004ZM1.66884 15.0004V14.0004C1.92039 14.0004 2.08037 14.2673 1.96393 14.4886L1.079 14.0229L0.194074 13.5571C-0.389754 14.6665 0.413976 16.0004 1.66884 16.0004V15.0004ZM1.079 14.0229L1.96394 14.4886L8.62996 1.82157L7.74502 1.35587L6.86007 0.89017L0.194059 13.5572L1.079 14.0229Z\"\n fill=\"var(--border-silhouette-color)\"\n mask=\"url(#path-2-outside-1_37206_122701)\"\n />\n <path\n d=\"M1.07857 14.0235L7.74479 1.35716C7.99473 0.882236 8.6746 0.882252 8.92453 1.35719L15.5899 14.0236C15.8236 14.4676 15.5017 15.001 15.0001 15.001L1.66843 15.001C1.16677 15.001 0.844878 14.4676 1.07857 14.0235Z\"\n fill=\"var(--alert-alarm-color)\"\n />\n <path\n d=\"M8.18744 1.58984C8.25002 1.47134 8.41991 1.4712 8.48236 1.58984L15.1474 14.2568C15.2057 14.3681 15.125 14.501 14.9999 14.501H1.66888C1.54379 14.501 1.46302 14.3681 1.52142 14.2568L8.18744 1.58984Z\"\n stroke=\"var(--alert-alarm-outline-color)\"\n />\n <path\n d=\"M7.66754 10.3343V5.00098H9.00087V10.3343H7.66754Z\"\n fill=\"var(--on-alarm-active-color)\"\n />\n <path\n d=\"M9.00087 11.6676H7.66754V13.001H9.00087V11.6676Z\"\n fill=\"var(--on-alarm-active-color)\"\n />\n </svg> `;\n } else if (\n this.isAlertType(\n ObcAutomationBadgeType.Alarm,\n ObcAutomationBadgeType.LevelHigh\n )\n ) {\n return html`\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M2 0.5H14C14.8284 0.5 15.5 1.17157 15.5 2V14C15.5 14.8284 14.8284 15.5 14 15.5H2C1.17157 15.5 0.5 14.8284 0.5 14V2C0.5 1.17157 1.17157 0.5 2 0.5Z\"\n fill=\"var(--alert-alarm-color)\"\n />\n <path\n d=\"M2 0.5H14C14.8284 0.5 15.5 1.17157 15.5 2V14C15.5 14.8284 14.8284 15.5 14 15.5H2C1.17157 15.5 0.5 14.8284 0.5 14V2C0.5 1.17157 1.17157 0.5 2 0.5Z\"\n stroke=\"var(--alert-alarm-outline-color)\"\n />\n <path\n d=\"M7.29883 3.72622L3.05891 11.3269C2.84063 11.7182 2.73149 11.9139 2.75 12.0741C2.76615 12.2138 2.84042 12.3403 2.9546 12.4225C3.08546 12.5167 3.30949 12.5167 3.75756 12.5167H12.2348C12.6828 12.5167 12.9068 12.5167 13.0376 12.4225C13.1518 12.3403 13.2261 12.2139 13.2422 12.0741C13.2608 11.914 13.1517 11.7184 12.9336 11.3271L8.69623 3.7264C8.46805 3.31712 8.35396 3.11247 8.2037 3.04447C8.07271 2.98519 7.92254 2.98517 7.79153 3.04442C7.64125 3.11238 7.52711 3.317 7.29883 3.72622Z\"\n fill=\"var(--on-alarm-active-color)\"\n />\n </svg>\n `;\n } else {\n return html`<slot name=\"icon-silhouette\"></slot><slot></slot>`;\n }\n }\n\n override render() {\n return html`\n <div class=${classMap({wrapper: true, [this.effectiveMode]: true})}>\n <div class=\"badge\">${this.getIcon()}</div>\n </div>\n `;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-automation-badge': ObcAutomationBadge;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,IAAY,yBAAL,yBAAA,wBAAA;CACL,uBAAA,UAAA;CACA,uBAAA,aAAA;CACA,uBAAA,cAAA;;AACF,EAAA,CAAA,CAAA;AAEA,IAAY,yBAAL,yBAAA,wBAAA;CACL,uBAAA,UAAA;CAC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41
|
progressMode: {
|
|
37
42
|
options: CircularProgressMode[];
|
|
38
43
|
control: {
|
|
@@ -132,6 +137,11 @@ export declare const argTypesAbstractAutomationButtonPassiveRound: {
|
|
|
132
137
|
type: string;
|
|
133
138
|
};
|
|
134
139
|
};
|
|
140
|
+
badgeLayout: {
|
|
141
|
+
control: {
|
|
142
|
+
type: string;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
135
145
|
progressMode: {
|
|
136
146
|
options: CircularProgressMode[];
|
|
137
147
|
control: {
|
|
@@ -243,6 +253,11 @@ export declare const argTypesAbstractAutomationButtonPassiveSquare: {
|
|
|
243
253
|
type: string;
|
|
244
254
|
};
|
|
245
255
|
};
|
|
256
|
+
badgeLayout: {
|
|
257
|
+
control: {
|
|
258
|
+
type: string;
|
|
259
|
+
};
|
|
260
|
+
};
|
|
246
261
|
progressMode: {
|
|
247
262
|
options: CircularProgressMode[];
|
|
248
263
|
control: {
|
|
@@ -384,6 +399,11 @@ export declare const argTypesAbstractAutomationButtonMotorized: {
|
|
|
384
399
|
type: string;
|
|
385
400
|
};
|
|
386
401
|
};
|
|
402
|
+
badgeLayout: {
|
|
403
|
+
control: {
|
|
404
|
+
type: string;
|
|
405
|
+
};
|
|
406
|
+
};
|
|
387
407
|
progressMode: {
|
|
388
408
|
options: CircularProgressMode[];
|
|
389
409
|
control: {
|
package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-automation-button-storybook-helpers.d.ts","sourceRoot":"","sources":["../../../src/automation/automation-button/abstract-automation-button-storybook-helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC9B,2BAA2B,EAC3B,2BAA2B,EAC5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAC,oBAAoB,EAAC,MAAM,8DAA8D,CAAC;AAClG,OAAO,EACL,0BAA0B,EAC1B,kCAAkC,EAClC,4BAA4B,EAC5B,8BAA8B,EAC/B,MAAM,iCAAiC,CAAC;AAEzC,eAAO,MAAM,gCAAgC
|
|
1
|
+
{"version":3,"file":"abstract-automation-button-storybook-helpers.d.ts","sourceRoot":"","sources":["../../../src/automation/automation-button/abstract-automation-button-storybook-helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC9B,2BAA2B,EAC3B,2BAA2B,EAC5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAC,oBAAoB,EAAC,MAAM,8DAA8D,CAAC;AAClG,OAAO,EACL,0BAA0B,EAC1B,kCAAkC,EAClC,4BAA4B,EAC5B,8BAA8B,EAC/B,MAAM,iCAAiC,CAAC;AAEzC,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6C5C,CAAC;AAEF,eAAO,MAAM,4CAA4C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMxD,CAAC;AAEF,eAAO,MAAM,6CAA6C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWzD,CAAC;AAEF,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BrD,CAAC"}
|
|
@@ -44,6 +44,7 @@ var argTypesAbstractAutomationButton = {
|
|
|
44
44
|
options: Object.values(AutomationButtonBadgeAlert),
|
|
45
45
|
control: { type: "select" }
|
|
46
46
|
},
|
|
47
|
+
badgeLayout: { control: { type: "object" } },
|
|
47
48
|
progressMode: {
|
|
48
49
|
options: Object.values(CircularProgressMode),
|
|
49
50
|
control: { type: "select" },
|
package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-automation-button-storybook-helpers.js","names":[],"sources":["../../../src/automation/automation-button/abstract-automation-button-storybook-helpers.ts"],"sourcesContent":["import {argTypesAlertFrame} from '../../components/alert-frame/alert-frame-storybook-helpers.js';\nimport {MotorizedVariant} from './abstract-automation-button-motorized.js';\nimport {\n AutomationButtonDirection,\n AutomationButtonLabelDirection,\n AutomationButtonOrientation,\n AutomationButtonPositioning,\n} from './automation-button.js';\nimport {CircularProgressMode} from '../../building-blocks/circular-progress/circular-progress.js';\nimport {\n AutomationButtonBadgeAlert,\n AutomationButtonBadgeCommandLocked,\n AutomationButtonBadgeControl,\n AutomationButtonBadgeInterlock,\n} from './abstract-automation-button.js';\n\nexport const argTypesAbstractAutomationButton = {\n tag: {\n control: {type: 'text'},\n },\n readoutPosition: {\n options: ['top', 'bottom', 'left', 'right'],\n control: {type: 'radio'},\n },\n readoutSize: {\n options: ['small', 'regular', 'enhanced'],\n control: {type: 'radio'},\n },\n ...argTypesAlertFrame,\n positioning: {\n options: Object.values(AutomationButtonPositioning),\n control: {type: 'select'},\n },\n badgeControl: {\n options: Object.values(AutomationButtonBadgeControl),\n control: {type: 'select'},\n },\n badgeCommandLocked: {\n options: Object.values(AutomationButtonBadgeCommandLocked),\n control: {type: 'select'},\n },\n badgeInterlock: {\n options: Object.values(AutomationButtonBadgeInterlock),\n control: {type: 'select'},\n },\n badgeAlert: {\n options: Object.values(AutomationButtonBadgeAlert),\n control: {type: 'select'},\n },\n progressMode: {\n options: Object.values(CircularProgressMode),\n control: {type: 'select'},\n if: {arg: 'progress'},\n },\n progressValue: {\n control: {type: 'range', min: 0, max: 100, step: 1},\n if: {arg: 'progress'},\n },\n};\n\nexport const argTypesAbstractAutomationButtonPassiveRound = {\n ...argTypesAbstractAutomationButton,\n variant: {\n options: ['regular', 'flat'],\n control: {type: 'radio'},\n },\n};\n\nexport const argTypesAbstractAutomationButtonPassiveSquare = {\n ...argTypesAbstractAutomationButton,\n on: {table: {disable: true}, control: false},\n variant: {\n options: ['square', 'flat'],\n control: {type: 'radio'},\n },\n orientation: {\n options: Object.values(AutomationButtonOrientation),\n control: {type: 'radio'},\n },\n};\n\nexport const argTypesAbstractAutomationButtonMotorized = {\n ...argTypesAbstractAutomationButton,\n on: {table: {disable: true}, control: false},\n speedInPercent: {\n control: {type: 'range', min: 0, max: 100, step: 1},\n description: 'Deprecated, use `speed` together with `speedUnit` instead.',\n },\n speed: {\n control: {type: 'number'},\n },\n speedUnit: {\n control: {type: 'text'},\n },\n speedMaxDigits: {\n control: {type: 'number'},\n },\n labelDirection: {\n options: Object.values(AutomationButtonLabelDirection),\n control: {type: 'radio'},\n },\n direction: {\n options: Object.values(AutomationButtonDirection),\n control: {type: 'radio'},\n },\n variant: {\n options: Object.values(MotorizedVariant),\n control: {type: 'radio'},\n },\n};\n"],"mappings":";;;;;;AAgBA,IAAa,mCAAmC;CAC9C,KAAK,EACH,SAAS,EAAC,MAAM,OAAM,EACxB;CACA,iBAAiB;EACf,SAAS;GAAC;GAAO;GAAU;GAAQ;EAAO;EAC1C,SAAS,EAAC,MAAM,QAAO;CACzB;CACA,aAAa;EACX,SAAS;GAAC;GAAS;GAAW;EAAU;EACxC,SAAS,EAAC,MAAM,QAAO;CACzB;CACA,GAAG;CACH,aAAa;EACX,SAAS,OAAO,OAAO,2BAA2B;EAClD,SAAS,EAAC,MAAM,SAAQ;CAC1B;CACA,cAAc;EACZ,SAAS,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EAC1B;CACA,gBAAgB;EACd,SAAS,OAAO,OAAO,8BAA8B;EACrD,SAAS,EAAC,MAAM,QAAO;CACzB;CACA,WAAW;EACT,SAAS,OAAO,OAAO,yBAAyB;EAChD,SAAS,EAAC,MAAM,QAAO;CACzB;CACA,SAAS;EACP,SAAS,OAAO,OAAO,gBAAgB;EACvC,SAAS,EAAC,MAAM,QAAO;CACzB;AACF"}
|
|
1
|
+
{"version":3,"file":"abstract-automation-button-storybook-helpers.js","names":[],"sources":["../../../src/automation/automation-button/abstract-automation-button-storybook-helpers.ts"],"sourcesContent":["import {argTypesAlertFrame} from '../../components/alert-frame/alert-frame-storybook-helpers.js';\nimport {MotorizedVariant} from './abstract-automation-button-motorized.js';\nimport {\n AutomationButtonDirection,\n AutomationButtonLabelDirection,\n AutomationButtonOrientation,\n AutomationButtonPositioning,\n} from './automation-button.js';\nimport {CircularProgressMode} from '../../building-blocks/circular-progress/circular-progress.js';\nimport {\n AutomationButtonBadgeAlert,\n AutomationButtonBadgeCommandLocked,\n AutomationButtonBadgeControl,\n AutomationButtonBadgeInterlock,\n} from './abstract-automation-button.js';\n\nexport const argTypesAbstractAutomationButton = {\n tag: {\n control: {type: 'text'},\n },\n readoutPosition: {\n options: ['top', 'bottom', 'left', 'right'],\n control: {type: 'radio'},\n },\n readoutSize: {\n options: ['small', 'regular', 'enhanced'],\n control: {type: 'radio'},\n },\n ...argTypesAlertFrame,\n positioning: {\n options: Object.values(AutomationButtonPositioning),\n control: {type: 'select'},\n },\n badgeControl: {\n options: Object.values(AutomationButtonBadgeControl),\n control: {type: 'select'},\n },\n badgeCommandLocked: {\n options: Object.values(AutomationButtonBadgeCommandLocked),\n control: {type: 'select'},\n },\n badgeInterlock: {\n options: Object.values(AutomationButtonBadgeInterlock),\n control: {type: 'select'},\n },\n badgeAlert: {\n options: Object.values(AutomationButtonBadgeAlert),\n control: {type: 'select'},\n },\n badgeLayout: {\n control: {type: 'object'},\n },\n progressMode: {\n options: Object.values(CircularProgressMode),\n control: {type: 'select'},\n if: {arg: 'progress'},\n },\n progressValue: {\n control: {type: 'range', min: 0, max: 100, step: 1},\n if: {arg: 'progress'},\n },\n};\n\nexport const argTypesAbstractAutomationButtonPassiveRound = {\n ...argTypesAbstractAutomationButton,\n variant: {\n options: ['regular', 'flat'],\n control: {type: 'radio'},\n },\n};\n\nexport const argTypesAbstractAutomationButtonPassiveSquare = {\n ...argTypesAbstractAutomationButton,\n on: {table: {disable: true}, control: false},\n variant: {\n options: ['square', 'flat'],\n control: {type: 'radio'},\n },\n orientation: {\n options: Object.values(AutomationButtonOrientation),\n control: {type: 'radio'},\n },\n};\n\nexport const argTypesAbstractAutomationButtonMotorized = {\n ...argTypesAbstractAutomationButton,\n on: {table: {disable: true}, control: false},\n speedInPercent: {\n control: {type: 'range', min: 0, max: 100, step: 1},\n description: 'Deprecated, use `speed` together with `speedUnit` instead.',\n },\n speed: {\n control: {type: 'number'},\n },\n speedUnit: {\n control: {type: 'text'},\n },\n speedMaxDigits: {\n control: {type: 'number'},\n },\n labelDirection: {\n options: Object.values(AutomationButtonLabelDirection),\n control: {type: 'radio'},\n },\n direction: {\n options: Object.values(AutomationButtonDirection),\n control: {type: 'radio'},\n },\n variant: {\n options: Object.values(MotorizedVariant),\n control: {type: 'radio'},\n },\n};\n"],"mappings":";;;;;;AAgBA,IAAa,mCAAmC;CAC9C,KAAK,EACH,SAAS,EAAC,MAAM,OAAM,EACxB;CACA,iBAAiB;EACf,SAAS;GAAC;GAAO;GAAU;GAAQ;EAAO;EAC1C,SAAS,EAAC,MAAM,QAAO;CACzB;CACA,aAAa;EACX,SAAS;GAAC;GAAS;GAAW;EAAU;EACxC,SAAS,EAAC,MAAM,QAAO;CACzB;CACA,GAAG;CACH,aAAa;EACX,SAAS,OAAO,OAAO,2BAA2B;EAClD,SAAS,EAAC,MAAM,SAAQ;CAC1B;CACA,cAAc;EACZ,SAAS,OAAO,OAAO,4BAA4B;EACnD,SAAS,EAAC,MAAM,SAAQ;CAC1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ACA,gBAAgB;EACd,SAAS,OAAO,OAAO,8BAA8B;EACrD,SAAS,EAAC,MAAM,QAAO;CACzB;CACA,WAAW;EACT,SAAS,OAAO,OAAO,yBAAyB;EAChD,SAAS,EAAC,MAAM,QAAO;CACzB;CACA,SAAS;EACP,SAAS,OAAO,OAAO,gBAAgB;EACvC,SAAS,EAAC,MAAM,QAAO;CACzB;AACF"}
|
|
@@ -5,11 +5,13 @@ import { AutomationButtonReadoutStack, AutomationButtonReadoutStackSize } from '
|
|
|
5
5
|
import { ObcAlertFrameThickness, ObcAlertFrameType, ObcAlertFrameMode } from '../../components/alert-frame/alert-frame.js';
|
|
6
6
|
import { AlertType } from '../../types.js';
|
|
7
7
|
import { CircularProgressMode } from '../../building-blocks/circular-progress/circular-progress.js';
|
|
8
|
+
import { AutomationButtonBadgeLayout } from './badge-layout.js';
|
|
8
9
|
import '../automation-button/automation-button.js';
|
|
9
10
|
import '../automation-badge/automation-badge.js';
|
|
10
11
|
export declare enum AutomationButtonBadgeAlert {
|
|
11
12
|
None = "none",
|
|
12
13
|
Silence = "silence",
|
|
14
|
+
Shelved = "shelved",
|
|
13
15
|
Caution = "caution",
|
|
14
16
|
Warning = "warning",
|
|
15
17
|
Alarm = "alarm",
|
|
@@ -22,7 +24,8 @@ export declare enum AutomationButtonBadgeAlert {
|
|
|
22
24
|
export declare enum AutomationButtonBadgeInterlock {
|
|
23
25
|
None = "none",
|
|
24
26
|
Interlock = "interlock",
|
|
25
|
-
InterlockInhibit = "interlock-inhibit"
|
|
27
|
+
InterlockInhibit = "interlock-inhibit",
|
|
28
|
+
Simulation = "simulation"
|
|
26
29
|
}
|
|
27
30
|
export declare enum AutomationButtonBadgeControl {
|
|
28
31
|
None = "none",
|
|
@@ -34,15 +37,19 @@ export declare enum AutomationButtonBadgeControl {
|
|
|
34
37
|
}
|
|
35
38
|
export declare enum AutomationButtonBadgeCommandLocked {
|
|
36
39
|
None = "none",
|
|
37
|
-
CommandLocked = "command-locked"
|
|
40
|
+
CommandLocked = "command-locked",
|
|
41
|
+
Simulation = "simulation"
|
|
38
42
|
}
|
|
39
43
|
/**
|
|
40
44
|
* Base class for the automation device buttons.
|
|
41
45
|
*
|
|
42
46
|
* Renders an `<obc-automation-button>` with the shared surface every device
|
|
43
47
|
* button needs: the readout stack and its status row, the alert frame, the
|
|
44
|
-
* circular progress indicator, and the four badge corners
|
|
45
|
-
*
|
|
48
|
+
* circular progress indicator, and the four badge corners with their slots and
|
|
49
|
+
* enum-driven fallbacks. Which badge goes in which corner follows the badge
|
|
50
|
+
* layout (`badge-layout.ts`): control top-left, alert top-right, interlock
|
|
51
|
+
* bottom-left and command-locked bottom-right unless the app or `badgeLayout`
|
|
52
|
+
* moves them.
|
|
46
53
|
*
|
|
47
54
|
* ## Usage Guidelines
|
|
48
55
|
*
|
|
@@ -64,6 +71,7 @@ export declare enum AutomationButtonBadgeCommandLocked {
|
|
|
64
71
|
* @availableWhen alertFrameMode alert==true
|
|
65
72
|
* @availableWhen showAlertCategoryIcon alert==true && alertFrameType in [SmallSideFlip, LargeSideFlip, BottomFlip, TopFlip]
|
|
66
73
|
* @availableWhen showAlertIcon alert==true && alertFrameType in [LargeSideFlip, BottomFlip, TopFlip]
|
|
74
|
+
* @property badgeLayout - Which badge kind each corner shows, on top of the app-wide layout set with `setAutomationBadgeLayout()`. A corner left out keeps the app-wide badge, `null` leaves it empty, and a badge moved here leaves the corner it came from.
|
|
67
75
|
* @property progress - Shows a progress indicator, used to indicate that an user action is in progress
|
|
68
76
|
* @availableWhen progressMode progress==true
|
|
69
77
|
* @availableWhen progressValue progress==true && progressMode in [determinate, progressiveIndeterminate]
|
|
@@ -107,6 +115,9 @@ export declare class ObcAbstractAutomationButton extends LitElement {
|
|
|
107
115
|
badgeCommandLocked: AutomationButtonBadgeCommandLocked;
|
|
108
116
|
badgeInterlock: AutomationButtonBadgeInterlock;
|
|
109
117
|
badgeAlert: AutomationButtonBadgeAlert;
|
|
118
|
+
/** Which badge kind each corner shows, on top of the app-wide layout set with `setAutomationBadgeLayout()`. A corner left out keeps the app-wide badge, `null` leaves it empty, and a badge moved here leaves the corner it came from. */
|
|
119
|
+
badgeLayout: AutomationButtonBadgeLayout | undefined;
|
|
120
|
+
private readonly _badgeLayout;
|
|
110
121
|
get icon(): TemplateResult;
|
|
111
122
|
get _on(): boolean;
|
|
112
123
|
get _variant(): AutomationButtonVariant;
|
|
@@ -130,6 +141,7 @@ export declare class ObcAbstractAutomationButton extends LitElement {
|
|
|
130
141
|
protected get _isVertical(): boolean;
|
|
131
142
|
private getBadgeSpacer;
|
|
132
143
|
private handleBadgeSlotChange;
|
|
144
|
+
private getBadgeType;
|
|
133
145
|
private getBadgeAlertType;
|
|
134
146
|
private getBadgeControlType;
|
|
135
147
|
private getBadgeInterlockType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-automation-button.d.ts","sourceRoot":"","sources":["../../../src/automation/automation-button/abstract-automation-button.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EAGf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,kBAAkB,EAClB,UAAU,EACV,cAAc,EAGf,MAAM,KAAK,CAAC;AAEb,OAAO,2CAA2C,CAAC;AACnD,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC9B,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,EAC3B,+BAA+B,EAC/B,iCAAiC,EAEjC,uBAAuB,EACxB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,4BAA4B,EAC5B,gCAAgC,EACjC,MAAM,qFAAqF,CAAC;AAC7F,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAC,oBAAoB,EAAC,MAAM,8DAA8D,CAAC;
|
|
1
|
+
{"version":3,"file":"abstract-automation-button.d.ts","sourceRoot":"","sources":["../../../src/automation/automation-button/abstract-automation-button.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EAGf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,kBAAkB,EAClB,UAAU,EACV,cAAc,EAGf,MAAM,KAAK,CAAC;AAEb,OAAO,2CAA2C,CAAC;AACnD,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC9B,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,EAC3B,+BAA+B,EAC/B,iCAAiC,EAEjC,uBAAuB,EACxB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,4BAA4B,EAC5B,gCAAgC,EACjC,MAAM,qFAAqF,CAAC;AAC7F,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAC,oBAAoB,EAAC,MAAM,8DAA8D,CAAC;AAClG,OAAO,EAEL,2BAA2B,EAE5B,MAAM,mBAAmB,CAAC;AAE3B,oBAAY,0BAA0B;IACpC,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,aAAa,mBAAmB;IAChC,SAAS,eAAe;IACxB,WAAW,iBAAiB;IAC5B,QAAQ,cAAc;IACtB,eAAe,qBAAqB;CACrC;AAED,oBAAY,8BAA8B;IACxC,IAAI,SAAS;IACb,SAAS,cAAc;IACvB,gBAAgB,sBAAsB;IACtC,UAAU,eAAe;CAC1B;AAED,oBAAY,4BAA4B;IACtC,IAAI,SAAS;IACb,KAAK,UAAU;IACf,SAAS,eAAe;IACxB,MAAM,WAAW;IACjB,UAAU,gBAAgB;IAC1B,IAAI,SAAS;CACd;AAED,oBAAY,kCAAkC;IAC5C,IAAI,SAAS;IACb,a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