wcs-core 2.14.0 → 2.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +7 -38
  2. package/dist/cjs/{select-arrow-18088ced.js → select-arrow-54b3e7b8.js} +1 -1
  3. package/dist/cjs/wcs-accordion-panel.cjs.entry.js +3 -3
  4. package/dist/cjs/wcs-com-nav.cjs.entry.js +18 -0
  5. package/dist/cjs/wcs-dropdown.cjs.entry.js +1 -1
  6. package/dist/cjs/wcs-grid.cjs.entry.js +8 -5
  7. package/dist/cjs/wcs-label.cjs.entry.js +1 -1
  8. package/dist/cjs/wcs-select_2.cjs.entry.js +3 -2
  9. package/dist/collection/components/accordion-panel/accordion-panel.css +9 -0
  10. package/dist/collection/components/accordion-panel/accordion-panel.js +3 -3
  11. package/dist/collection/components/com-nav/com-nav.js +18 -0
  12. package/dist/collection/components/grid/grid.js +8 -5
  13. package/dist/collection/components/label/label.css +3 -1
  14. package/dist/collection/components/select/select-arrow.js +1 -1
  15. package/dist/collection/components/select/select.js +2 -1
  16. package/dist/esm/{select-arrow-66a47b7a.js → select-arrow-f24031e4.js} +1 -1
  17. package/dist/esm/wcs-accordion-panel.entry.js +3 -3
  18. package/dist/esm/wcs-com-nav.entry.js +18 -0
  19. package/dist/esm/wcs-dropdown.entry.js +1 -1
  20. package/dist/esm/wcs-grid.entry.js +8 -5
  21. package/dist/esm/wcs-label.entry.js +1 -1
  22. package/dist/esm/wcs-select_2.entry.js +3 -2
  23. package/dist/types/components/com-nav/com-nav.d.ts +3 -0
  24. package/dist/types/components/grid/grid.d.ts +2 -1
  25. package/dist/types/components/select/select-arrow.d.ts +1 -0
  26. package/dist/wcs/{p-23e6c574.entry.js → p-18c6e4df.entry.js} +2 -2
  27. package/dist/wcs/p-1b8330aa.entry.js +1 -0
  28. package/dist/wcs/{p-ae70c0ce.entry.js → p-3ede8428.entry.js} +1 -1
  29. package/dist/wcs/p-79feb1b2.entry.js +1 -0
  30. package/dist/wcs/p-8a000290.entry.js +1 -0
  31. package/dist/wcs/p-c09e5b82.js +1 -0
  32. package/dist/wcs/p-f79a36b2.entry.js +1 -0
  33. package/dist/wcs/wcs.esm.js +1 -1
  34. package/package.json +1 -1
  35. package/dist/wcs/p-1421429d.js +0 -1
  36. package/dist/wcs/p-174e238e.entry.js +0 -1
  37. package/dist/wcs/p-1a901934.entry.js +0 -1
  38. package/dist/wcs/p-b07c8dc4.entry.js +0 -1
  39. package/dist/wcs/p-d639802e.entry.js +0 -1
package/README.md CHANGED
@@ -25,9 +25,10 @@ Select and select options size behavior, especially with multiple select. As of
25
25
 
26
26
  ## Documentation
27
27
 
28
- There is documentation available at https://sncf.gitlab.io/wcs/develop/. It is only available for the develop branch though as the project remains unreleased.
28
+ There is documentation available at
29
+ - https://sncf.gitlab.io/wcs/master/ for production (latest release)
30
+ - https://sncf.gitlab.io/wcs/develop/ for development branch
29
31
 
30
- For a specific component you can also look under src/components/`{the-component-you-want-the-doc-for}`/README.md.
31
32
 
32
33
  ### Example usage
33
34
 
@@ -53,9 +54,11 @@ If you have any question, don't hesitate to fill an issue !
53
54
 
54
55
  ### Install in your project
55
56
 
56
- StencilJS offers many integrations with different JS frameworks.
57
+ You can refer to the
58
+ [official WCS documentation](https://sncf.gitlab.io/wcs/master/?path=/story/documentation-framework-integrations--page)
59
+ to use wcs with Angular or React. For other frameworks, StencilJS offers many integrations with different JS frameworks.
57
60
 
58
- You can refer to their official documentation to add WCS to your project : https://stenciljs.com/docs/overview
61
+ You can refer to [their official documentation](https://stenciljs.com/docs/overview) to add WCS to your project.
59
62
 
60
63
  After added wcs dependencies, you must add Avenir and icons font faces like so :
61
64
 
@@ -93,40 +96,6 @@ After added wcs dependencies, you must add Avenir and icons font faces like so :
93
96
  }
94
97
  ```
95
98
 
96
- #### Example with Angular
97
-
98
- Install `wcs-core` and `wcs-angular` packages.
99
-
100
- ```
101
- npm install wcs-core wcs-angular
102
- ```
103
-
104
- Include wcs-core refering to this documentation : https://stenciljs.com/docs/angular
105
-
106
- Add the `WcsAngular` module to your App module.
107
-
108
- ```ts
109
- @NgModule({
110
- ...
111
- imports: [
112
- ...
113
- WcsAngularModule // add the module
114
- ],
115
- ...
116
- })
117
- export class AppModule { }
118
- ```
119
-
120
- Import the wcs stylesheet (for example in the styles.scss), if you don't use scss, you can include it in the `angular.json` file (in the architect build config, key: `styles`)
121
-
122
- ```scss
123
- @import "~wcs-core/dist/wcs/wcs.css";
124
- ```
125
-
126
- We provide a base stylesheet in [/doc/base.scss](./doc/base.scss)
127
-
128
- You're ready! (Don't forget to add font-faces 😉)
129
-
130
99
  ## Contributing
131
100
 
132
101
  ### Bug, Feature request, etc...
@@ -16,7 +16,7 @@ const index = require('./index-9e1b7371.js');
16
16
  from="20,35 50,65 80,35"></animate>
17
17
  </polyline>
18
18
  </svg> */
19
- const SelectArrow = ({ up }) => (index.h("svg", { style: { marginLeft: 'auto' }, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" },
19
+ const SelectArrow = ({ up, ariaLabel }) => (index.h("svg", { "aria-hidden": ariaLabel ? false : "true", role: "img", "aria-label": ariaLabel ? ariaLabel : false, style: { marginLeft: 'auto' }, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" },
20
20
  index.h("style", { type: "text/css" }, `
21
21
  .arrow-group {
22
22
  transform-origin: 50% 50%;
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-9e1b7371.js');
6
- const selectArrow = require('./select-arrow-18088ced.js');
6
+ const selectArrow = require('./select-arrow-54b3e7b8.js');
7
7
 
8
- const accordionPanelCss = ":host{display:flex;flex-direction:column;cursor:pointer;margin-bottom:16px}:host .header{display:flex;align-items:center;justify-content:space-between;padding:14px 24px;border-radius:7px;font-weight:500;font-size:16px;color:var(--wcs-primary);background-color:var(--wcs-light)}:host .header-action{display:flex;align-items:center;user-select:none}:host .header-action .arrow{fill:var(--wcs-primary)}:host .content{display:none}:host([open]){margin-bottom:0}:host([open]) .content{display:block}:host([open]):host([group-content-with-header]) .header{border-radius:7px 7px 0 0;padding-bottom:0}:host([open]):host([group-content-with-header]) .content{border-radius:0 0 7px 7px;margin-bottom:14px;background-color:var(--wcs-light)}:host([open]):host([highlight]) .header{background-color:var(--wcs-primary);color:var(--wcs-light)}:host([open]):host([highlight]) .arrow{fill:var(--wcs-light)}:host([open]):host([highlight]):host([group-content-with-header]) .content{background-color:var(--wcs-primary);color:var(--wcs-light)}";
8
+ const accordionPanelCss = ":host{display:flex;flex-direction:column;cursor:pointer;margin-bottom:16px}:host .header{display:flex;align-items:center;justify-content:space-between;padding:14px 24px;border-radius:7px;font-weight:500;font-size:16px;color:var(--wcs-primary);background-color:var(--wcs-light);border:none}@media (forced-colors: active){:host .header{border:1px solid ButtonBorder}}:host .header:focus-visible{outline:2px solid var(--wcs-primary)}:host .header-action{display:flex;align-items:center;user-select:none}:host .header-action .arrow{fill:var(--wcs-primary)}:host .content{display:none}:host([open]){margin-bottom:0}:host([open]) .content{display:block}:host([open]):host([group-content-with-header]) .header{border-radius:7px 7px 0 0;padding-bottom:0}:host([open]):host([group-content-with-header]) .content{border-radius:0 0 7px 7px;margin-bottom:14px;background-color:var(--wcs-light)}:host([open]):host([highlight]) .header{background-color:var(--wcs-primary);color:var(--wcs-light)}:host([open]):host([highlight]) .arrow{fill:var(--wcs-light)}:host([open]):host([highlight]):host([group-content-with-header]) .content{background-color:var(--wcs-primary);color:var(--wcs-light)}";
9
9
 
10
10
  let AccordionPanel = class {
11
11
  constructor(hostRef) {
@@ -37,7 +37,7 @@ let AccordionPanel = class {
37
37
  this.open = false;
38
38
  }
39
39
  render() {
40
- return (index.h(index.Host, null, index.h("div", { class: "header", onClick: () => this.open = !this.open }, index.h("slot", { name: "header" }), index.h("div", { class: "header-action" }, !this.hideActionText && (index.h("span", null, this.open ? 'Fermez' : 'Ouvrez')), index.h(selectArrow.SelectArrow, { up: this.open }))), index.h("div", { class: "content" }, index.h("slot", { name: "content" }))));
40
+ return (index.h(index.Host, null, index.h("button", { "aria-expanded": this.open ? "true" : "false", "aria-controls": "content", class: "header", onClick: () => this.open = !this.open }, index.h("slot", { name: "header" }), index.h("span", { class: "header-action" }, !this.hideActionText && (index.h("span", null, this.open ? 'Fermez' : 'Ouvrez')), index.h(selectArrow.SelectArrow, { up: this.open }))), index.h("div", { class: "content", id: "content" }, index.h("slot", { name: "content" }))));
41
41
  }
42
42
  static get watchers() { return {
43
43
  "open": ["openChange"]
@@ -10,6 +10,7 @@ let ComNav = class {
10
10
  constructor(hostRef) {
11
11
  index.registerInstance(this, hostRef);
12
12
  this.mobileMenuOpen = false;
13
+ this.hasAlreadyRegisteredClickHandlerOnSlottedLink = false;
13
14
  }
14
15
  mobileMenuIconClick() {
15
16
  this.mobileMenuOpen = !this.mobileMenuOpen;
@@ -31,6 +32,23 @@ let ComNav = class {
31
32
  });
32
33
  this.resizeObserver.observe(document.body);
33
34
  }
35
+ componentDidRender() {
36
+ this.registerHandlerToCloseMobileMenuOnClickOnSlottedLinkTag();
37
+ }
38
+ registerHandlerToCloseMobileMenuOnClickOnSlottedLinkTag() {
39
+ if (this.hasAlreadyRegisteredClickHandlerOnSlottedLink)
40
+ return;
41
+ const mainSlot = this.el.shadowRoot.querySelector('slot:not([name])');
42
+ if (mainSlot) {
43
+ this.hasAlreadyRegisteredClickHandlerOnSlottedLink = true;
44
+ // If the user click on a `a` tag, we close the mobile menu overlay.
45
+ mainSlot.assignedElements().filter(e => e.tagName === 'A').forEach(a => {
46
+ a.addEventListener('click', _ => {
47
+ this.mobileMenuOpen = false;
48
+ });
49
+ });
50
+ }
51
+ }
34
52
  //region Handlers for mobile menu overlay visibility
35
53
  //
36
54
  // In mobile mode, we have only one global drawer to display the menu, that why we have to listen the clicks events
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-9e1b7371.js');
6
- const selectArrow = require('./select-arrow-18088ced.js');
6
+ const selectArrow = require('./select-arrow-54b3e7b8.js');
7
7
  const helpers = require('./helpers-6abce594.js');
8
8
  const popper = require('./popper-8cf375ec.js');
9
9
 
@@ -110,6 +110,7 @@ let Grid = class {
110
110
  }
111
111
  onDataChange(newValue) {
112
112
  this.updateGridRows(newValue);
113
+ this.refreshSort(false);
113
114
  }
114
115
  onSelectedItemsPropertyChange(newValue) {
115
116
  this.updateSelectionWithValues(newValue);
@@ -174,19 +175,21 @@ let Grid = class {
174
175
  if (this.selectedItems) {
175
176
  this.updateSelectionWithValues(this.selectedItems);
176
177
  }
177
- this.applyInitialSortConfig();
178
+ this.refreshSort(true);
178
179
  }
179
180
  /**
180
181
  * Handle existing column's filters (defined before the grid is instantiated)
181
182
  * @private
182
183
  */
183
- applyInitialSortConfig() {
184
+ refreshSort(refreshOthersColmumnsSortOrderState) {
184
185
  const [first, ...other] = this.columns.filter(c => c.sortOrder !== 'none');
185
- // We keep only one active sorted column
186
- other === null || other === void 0 ? void 0 : other.forEach(o => o.sortOrder = 'none');
187
186
  if (first && !this.serverMode) {
188
187
  this.sortBy(first);
189
188
  }
189
+ refreshOthersColmumnsSortOrderState && this.disableSortOrderForColumns(other);
190
+ }
191
+ disableSortOrderForColumns(columns) {
192
+ columns === null || columns === void 0 ? void 0 : columns.forEach(c => c.sortOrder = 'none');
190
193
  }
191
194
  getGridColumnsFromTemplate() {
192
195
  const slotted = this.el.shadowRoot.querySelector('slot[name="grid-column"]');
@@ -200,7 +203,7 @@ let Grid = class {
200
203
  if (event.detail.order === 'none')
201
204
  return;
202
205
  // We keep only one active sort column
203
- this.columns.filter(c => c !== event.detail.column).forEach(c => c.sortOrder = 'none');
206
+ this.disableSortOrderForColumns(this.columns.filter(c => c !== event.detail.column));
204
207
  if (this.serverMode)
205
208
  return;
206
209
  this.sortBy(event.detail.column);
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-9e1b7371.js');
6
6
 
7
- const labelCss = ":host{font-weight:500;margin-bottom:8px}:host([required])::after{font-weight:500;color:var(--wcs-red);content:\"*\"}label{display:inline-flex;align-items:center}label ::slotted(wcs-mat-icon){margin-left:calc(var(--wcs-base-margin) / 2)}";
7
+ const labelCss = ":host{font-weight:500;margin-bottom:8px}:host([required])::after{font-weight:500;color:var(--wcs-red);content:\" *\"}label{display:inline-flex;align-items:center}label ::slotted(wcs-mat-icon){display:inline;vertical-align:middle;margin-left:calc(var(--wcs-base-margin) / 2)}";
8
8
 
9
9
  let Label = class {
10
10
  constructor(hostRef) {
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-9e1b7371.js');
6
6
  const lodash = require('./lodash-776d6f03.js');
7
- const selectArrow = require('./select-arrow-18088ced.js');
7
+ const selectArrow = require('./select-arrow-54b3e7b8.js');
8
8
  const helpers = require('./helpers-6abce594.js');
9
9
  const component = require('./component-fc28ed16.js');
10
10
 
@@ -5012,7 +5012,8 @@ let Select = class {
5012
5012
  onMouseDown(event) {
5013
5013
  const clickOnScroll = helpers.isElement(event.target)
5014
5014
  && (event.offsetX > event.target.clientWidth
5015
- || event.offsetY > event.target.clientHeight);
5015
+ || event.offsetY > event.target.clientHeight // If the click il located bellow the component height the click happen in the overlay
5016
+ || event.offsetY < 0); // If the click is made above the component
5016
5017
  const clickOnRemoveChip = event.composedPath()
5017
5018
  .filter(x => {
5018
5019
  const el = x;
@@ -14,6 +14,15 @@
14
14
  font-size: 16px;
15
15
  color: var(--wcs-primary);
16
16
  background-color: var(--wcs-light);
17
+ border: none;
18
+ }
19
+ @media (forced-colors: active) {
20
+ :host .header {
21
+ border: 1px solid ButtonBorder;
22
+ }
23
+ }
24
+ :host .header:focus-visible {
25
+ outline: 2px solid var(--wcs-primary);
17
26
  }
18
27
  :host .header-action {
19
28
  display: flex;
@@ -29,12 +29,12 @@ export class AccordionPanel {
29
29
  }
30
30
  render() {
31
31
  return (h(Host, null,
32
- h("div", { class: "header", onClick: () => this.open = !this.open },
32
+ h("button", { "aria-expanded": this.open ? "true" : "false", "aria-controls": "content", class: "header", onClick: () => this.open = !this.open },
33
33
  h("slot", { name: "header" }),
34
- h("div", { class: "header-action" },
34
+ h("span", { class: "header-action" },
35
35
  !this.hideActionText && (h("span", null, this.open ? 'Fermez' : 'Ouvrez')),
36
36
  h(SelectArrow, { up: this.open }))),
37
- h("div", { class: "content" },
37
+ h("div", { class: "content", id: "content" },
38
38
  h("slot", { name: "content" }))));
39
39
  }
40
40
  static get is() { return "wcs-accordion-panel"; }
@@ -2,6 +2,7 @@ import { Component, Host, h, Prop, Element, State, Listen } from '@stencil/core'
2
2
  export class ComNav {
3
3
  constructor() {
4
4
  this.mobileMenuOpen = false;
5
+ this.hasAlreadyRegisteredClickHandlerOnSlottedLink = false;
5
6
  }
6
7
  mobileMenuIconClick() {
7
8
  this.mobileMenuOpen = !this.mobileMenuOpen;
@@ -23,6 +24,23 @@ export class ComNav {
23
24
  });
24
25
  this.resizeObserver.observe(document.body);
25
26
  }
27
+ componentDidRender() {
28
+ this.registerHandlerToCloseMobileMenuOnClickOnSlottedLinkTag();
29
+ }
30
+ registerHandlerToCloseMobileMenuOnClickOnSlottedLinkTag() {
31
+ if (this.hasAlreadyRegisteredClickHandlerOnSlottedLink)
32
+ return;
33
+ const mainSlot = this.el.shadowRoot.querySelector('slot:not([name])');
34
+ if (mainSlot) {
35
+ this.hasAlreadyRegisteredClickHandlerOnSlottedLink = true;
36
+ // If the user click on a `a` tag, we close the mobile menu overlay.
37
+ mainSlot.assignedElements().filter(e => e.tagName === 'A').forEach(a => {
38
+ a.addEventListener('click', _ => {
39
+ this.mobileMenuOpen = false;
40
+ });
41
+ });
42
+ }
43
+ }
26
44
  //region Handlers for mobile menu overlay visibility
27
45
  //
28
46
  // In mobile mode, we have only one global drawer to display the menu, that why we have to listen the clicks events
@@ -19,6 +19,7 @@ export class Grid {
19
19
  }
20
20
  onDataChange(newValue) {
21
21
  this.updateGridRows(newValue);
22
+ this.refreshSort(false);
22
23
  }
23
24
  onSelectedItemsPropertyChange(newValue) {
24
25
  this.updateSelectionWithValues(newValue);
@@ -83,19 +84,21 @@ export class Grid {
83
84
  if (this.selectedItems) {
84
85
  this.updateSelectionWithValues(this.selectedItems);
85
86
  }
86
- this.applyInitialSortConfig();
87
+ this.refreshSort(true);
87
88
  }
88
89
  /**
89
90
  * Handle existing column's filters (defined before the grid is instantiated)
90
91
  * @private
91
92
  */
92
- applyInitialSortConfig() {
93
+ refreshSort(refreshOthersColmumnsSortOrderState) {
93
94
  const [first, ...other] = this.columns.filter(c => c.sortOrder !== 'none');
94
- // We keep only one active sorted column
95
- other === null || other === void 0 ? void 0 : other.forEach(o => o.sortOrder = 'none');
96
95
  if (first && !this.serverMode) {
97
96
  this.sortBy(first);
98
97
  }
98
+ refreshOthersColmumnsSortOrderState && this.disableSortOrderForColumns(other);
99
+ }
100
+ disableSortOrderForColumns(columns) {
101
+ columns === null || columns === void 0 ? void 0 : columns.forEach(c => c.sortOrder = 'none');
99
102
  }
100
103
  getGridColumnsFromTemplate() {
101
104
  const slotted = this.el.shadowRoot.querySelector('slot[name="grid-column"]');
@@ -109,7 +112,7 @@ export class Grid {
109
112
  if (event.detail.order === 'none')
110
113
  return;
111
114
  // We keep only one active sort column
112
- this.columns.filter(c => c !== event.detail.column).forEach(c => c.sortOrder = 'none');
115
+ this.disableSortOrderForColumns(this.columns.filter(c => c !== event.detail.column));
113
116
  if (this.serverMode)
114
117
  return;
115
118
  this.sortBy(event.detail.column);
@@ -6,7 +6,7 @@
6
6
  :host([required])::after {
7
7
  font-weight: 500;
8
8
  color: var(--wcs-red);
9
- content: "*";
9
+ content: " *";
10
10
  }
11
11
 
12
12
  label {
@@ -14,5 +14,7 @@ label {
14
14
  align-items: center;
15
15
  }
16
16
  label ::slotted(wcs-mat-icon) {
17
+ display: inline;
18
+ vertical-align: middle;
17
19
  margin-left: calc(var(--wcs-base-margin) / 2);
18
20
  }
@@ -13,7 +13,7 @@ import { h } from '@stencil/core';
13
13
  from="20,35 50,65 80,35"></animate>
14
14
  </polyline>
15
15
  </svg> */
16
- export const SelectArrow = ({ up }) => (h("svg", { style: { marginLeft: 'auto' }, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" },
16
+ export const SelectArrow = ({ up, ariaLabel }) => (h("svg", { "aria-hidden": ariaLabel ? false : "true", role: "img", "aria-label": ariaLabel ? ariaLabel : false, style: { marginLeft: 'auto' }, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" },
17
17
  h("style", { type: "text/css" }, `
18
18
  .arrow-group {
19
19
  transform-origin: 50% 50%;
@@ -289,7 +289,8 @@ export class Select {
289
289
  onMouseDown(event) {
290
290
  const clickOnScroll = isElement(event.target)
291
291
  && (event.offsetX > event.target.clientWidth
292
- || event.offsetY > event.target.clientHeight);
292
+ || event.offsetY > event.target.clientHeight // If the click il located bellow the component height the click happen in the overlay
293
+ || event.offsetY < 0); // If the click is made above the component
293
294
  const clickOnRemoveChip = event.composedPath()
294
295
  .filter(x => {
295
296
  const el = x;
@@ -14,7 +14,7 @@ import { h } from './index-2a90353f.js';
14
14
  from="20,35 50,65 80,35"></animate>
15
15
  </polyline>
16
16
  </svg> */
17
- const SelectArrow = ({ up }) => (h("svg", { style: { marginLeft: 'auto' }, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" },
17
+ const SelectArrow = ({ up, ariaLabel }) => (h("svg", { "aria-hidden": ariaLabel ? false : "true", role: "img", "aria-label": ariaLabel ? ariaLabel : false, style: { marginLeft: 'auto' }, xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24" },
18
18
  h("style", { type: "text/css" }, `
19
19
  .arrow-group {
20
20
  transform-origin: 50% 50%;
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-2a90353f.js';
2
- import { S as SelectArrow } from './select-arrow-66a47b7a.js';
2
+ import { S as SelectArrow } from './select-arrow-f24031e4.js';
3
3
 
4
- const accordionPanelCss = ":host{display:flex;flex-direction:column;cursor:pointer;margin-bottom:16px}:host .header{display:flex;align-items:center;justify-content:space-between;padding:14px 24px;border-radius:7px;font-weight:500;font-size:16px;color:var(--wcs-primary);background-color:var(--wcs-light)}:host .header-action{display:flex;align-items:center;user-select:none}:host .header-action .arrow{fill:var(--wcs-primary)}:host .content{display:none}:host([open]){margin-bottom:0}:host([open]) .content{display:block}:host([open]):host([group-content-with-header]) .header{border-radius:7px 7px 0 0;padding-bottom:0}:host([open]):host([group-content-with-header]) .content{border-radius:0 0 7px 7px;margin-bottom:14px;background-color:var(--wcs-light)}:host([open]):host([highlight]) .header{background-color:var(--wcs-primary);color:var(--wcs-light)}:host([open]):host([highlight]) .arrow{fill:var(--wcs-light)}:host([open]):host([highlight]):host([group-content-with-header]) .content{background-color:var(--wcs-primary);color:var(--wcs-light)}";
4
+ const accordionPanelCss = ":host{display:flex;flex-direction:column;cursor:pointer;margin-bottom:16px}:host .header{display:flex;align-items:center;justify-content:space-between;padding:14px 24px;border-radius:7px;font-weight:500;font-size:16px;color:var(--wcs-primary);background-color:var(--wcs-light);border:none}@media (forced-colors: active){:host .header{border:1px solid ButtonBorder}}:host .header:focus-visible{outline:2px solid var(--wcs-primary)}:host .header-action{display:flex;align-items:center;user-select:none}:host .header-action .arrow{fill:var(--wcs-primary)}:host .content{display:none}:host([open]){margin-bottom:0}:host([open]) .content{display:block}:host([open]):host([group-content-with-header]) .header{border-radius:7px 7px 0 0;padding-bottom:0}:host([open]):host([group-content-with-header]) .content{border-radius:0 0 7px 7px;margin-bottom:14px;background-color:var(--wcs-light)}:host([open]):host([highlight]) .header{background-color:var(--wcs-primary);color:var(--wcs-light)}:host([open]):host([highlight]) .arrow{fill:var(--wcs-light)}:host([open]):host([highlight]):host([group-content-with-header]) .content{background-color:var(--wcs-primary);color:var(--wcs-light)}";
5
5
 
6
6
  let AccordionPanel = class {
7
7
  constructor(hostRef) {
@@ -33,7 +33,7 @@ let AccordionPanel = class {
33
33
  this.open = false;
34
34
  }
35
35
  render() {
36
- return (h(Host, null, h("div", { class: "header", onClick: () => this.open = !this.open }, h("slot", { name: "header" }), h("div", { class: "header-action" }, !this.hideActionText && (h("span", null, this.open ? 'Fermez' : 'Ouvrez')), h(SelectArrow, { up: this.open }))), h("div", { class: "content" }, h("slot", { name: "content" }))));
36
+ return (h(Host, null, h("button", { "aria-expanded": this.open ? "true" : "false", "aria-controls": "content", class: "header", onClick: () => this.open = !this.open }, h("slot", { name: "header" }), h("span", { class: "header-action" }, !this.hideActionText && (h("span", null, this.open ? 'Fermez' : 'Ouvrez')), h(SelectArrow, { up: this.open }))), h("div", { class: "content", id: "content" }, h("slot", { name: "content" }))));
37
37
  }
38
38
  static get watchers() { return {
39
39
  "open": ["openChange"]
@@ -6,6 +6,7 @@ let ComNav = class {
6
6
  constructor(hostRef) {
7
7
  registerInstance(this, hostRef);
8
8
  this.mobileMenuOpen = false;
9
+ this.hasAlreadyRegisteredClickHandlerOnSlottedLink = false;
9
10
  }
10
11
  mobileMenuIconClick() {
11
12
  this.mobileMenuOpen = !this.mobileMenuOpen;
@@ -27,6 +28,23 @@ let ComNav = class {
27
28
  });
28
29
  this.resizeObserver.observe(document.body);
29
30
  }
31
+ componentDidRender() {
32
+ this.registerHandlerToCloseMobileMenuOnClickOnSlottedLinkTag();
33
+ }
34
+ registerHandlerToCloseMobileMenuOnClickOnSlottedLinkTag() {
35
+ if (this.hasAlreadyRegisteredClickHandlerOnSlottedLink)
36
+ return;
37
+ const mainSlot = this.el.shadowRoot.querySelector('slot:not([name])');
38
+ if (mainSlot) {
39
+ this.hasAlreadyRegisteredClickHandlerOnSlottedLink = true;
40
+ // If the user click on a `a` tag, we close the mobile menu overlay.
41
+ mainSlot.assignedElements().filter(e => e.tagName === 'A').forEach(a => {
42
+ a.addEventListener('click', _ => {
43
+ this.mobileMenuOpen = false;
44
+ });
45
+ });
46
+ }
47
+ }
30
48
  //region Handlers for mobile menu overlay visibility
31
49
  //
32
50
  // In mobile mode, we have only one global drawer to display the menu, that why we have to listen the clicks events
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, H as Host, g as getElement } from './index-2a90353f.js';
2
- import { S as SelectArrow } from './select-arrow-66a47b7a.js';
2
+ import { S as SelectArrow } from './select-arrow-f24031e4.js';
3
3
  import { c as clickTargetIsElementOrChildren } from './helpers-e2993152.js';
4
4
  import { c as createPopper } from './popper-548df79b.js';
5
5
 
@@ -106,6 +106,7 @@ let Grid = class {
106
106
  }
107
107
  onDataChange(newValue) {
108
108
  this.updateGridRows(newValue);
109
+ this.refreshSort(false);
109
110
  }
110
111
  onSelectedItemsPropertyChange(newValue) {
111
112
  this.updateSelectionWithValues(newValue);
@@ -170,19 +171,21 @@ let Grid = class {
170
171
  if (this.selectedItems) {
171
172
  this.updateSelectionWithValues(this.selectedItems);
172
173
  }
173
- this.applyInitialSortConfig();
174
+ this.refreshSort(true);
174
175
  }
175
176
  /**
176
177
  * Handle existing column's filters (defined before the grid is instantiated)
177
178
  * @private
178
179
  */
179
- applyInitialSortConfig() {
180
+ refreshSort(refreshOthersColmumnsSortOrderState) {
180
181
  const [first, ...other] = this.columns.filter(c => c.sortOrder !== 'none');
181
- // We keep only one active sorted column
182
- other === null || other === void 0 ? void 0 : other.forEach(o => o.sortOrder = 'none');
183
182
  if (first && !this.serverMode) {
184
183
  this.sortBy(first);
185
184
  }
185
+ refreshOthersColmumnsSortOrderState && this.disableSortOrderForColumns(other);
186
+ }
187
+ disableSortOrderForColumns(columns) {
188
+ columns === null || columns === void 0 ? void 0 : columns.forEach(c => c.sortOrder = 'none');
186
189
  }
187
190
  getGridColumnsFromTemplate() {
188
191
  const slotted = this.el.shadowRoot.querySelector('slot[name="grid-column"]');
@@ -196,7 +199,7 @@ let Grid = class {
196
199
  if (event.detail.order === 'none')
197
200
  return;
198
201
  // We keep only one active sort column
199
- this.columns.filter(c => c !== event.detail.column).forEach(c => c.sortOrder = 'none');
202
+ this.disableSortOrderForColumns(this.columns.filter(c => c !== event.detail.column));
200
203
  if (this.serverMode)
201
204
  return;
202
205
  this.sortBy(event.detail.column);
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-2a90353f.js';
2
2
 
3
- const labelCss = ":host{font-weight:500;margin-bottom:8px}:host([required])::after{font-weight:500;color:var(--wcs-red);content:\"*\"}label{display:inline-flex;align-items:center}label ::slotted(wcs-mat-icon){margin-left:calc(var(--wcs-base-margin) / 2)}";
3
+ const labelCss = ":host{font-weight:500;margin-bottom:8px}:host([required])::after{font-weight:500;color:var(--wcs-red);content:\" *\"}label{display:inline-flex;align-items:center}label ::slotted(wcs-mat-icon){display:inline;vertical-align:middle;margin-left:calc(var(--wcs-base-margin) / 2)}";
4
4
 
5
5
  let Label = class {
6
6
  constructor(hostRef) {
@@ -1,6 +1,6 @@
1
1
  import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-2a90353f.js';
2
2
  import { l as lodash } from './lodash-d6d9d079.js';
3
- import { S as SelectArrow } from './select-arrow-66a47b7a.js';
3
+ import { S as SelectArrow } from './select-arrow-f24031e4.js';
4
4
  import { b as isElement } from './helpers-e2993152.js';
5
5
  import { M as MDCRipple } from './component-6b4d470f.js';
6
6
 
@@ -5008,7 +5008,8 @@ let Select = class {
5008
5008
  onMouseDown(event) {
5009
5009
  const clickOnScroll = isElement(event.target)
5010
5010
  && (event.offsetX > event.target.clientWidth
5011
- || event.offsetY > event.target.clientHeight);
5011
+ || event.offsetY > event.target.clientHeight // If the click il located bellow the component height the click happen in the overlay
5012
+ || event.offsetY < 0); // If the click is made above the component
5012
5013
  const clickOnRemoveChip = event.composedPath()
5013
5014
  .filter(x => {
5014
5015
  const el = x;
@@ -6,9 +6,12 @@ export declare class ComNav implements ComponentInterface {
6
6
  mobileMenuOpen: boolean;
7
7
  currentActiveSizing: 'desktop' | 'mobile';
8
8
  resizeObserver: ResizeObserver;
9
+ private hasAlreadyRegisteredClickHandlerOnSlottedLink;
9
10
  private mobileMenuIconClick;
10
11
  disconnectedCallback(): void;
11
12
  componentWillLoad(): Promise<void> | void;
13
+ componentDidRender(): void;
14
+ private registerHandlerToCloseMobileMenuOnClickOnSlottedLinkTag;
12
15
  onClickOnFinalAction(): void;
13
16
  onClickOnFinalActionCat(): void;
14
17
  render(): any;
@@ -50,7 +50,8 @@ export declare class Grid implements ComponentInterface, ComponentDidLoad {
50
50
  * Handle existing column's filters (defined before the grid is instantiated)
51
51
  * @private
52
52
  */
53
- private applyInitialSortConfig;
53
+ private refreshSort;
54
+ private disableSortOrderForColumns;
54
55
  private getGridColumnsFromTemplate;
55
56
  private getGridPaginationsFromTemplate;
56
57
  sortChangeEventHandler(event: CustomEvent<WcsGridColumnSortChangeEventDetails>): void;
@@ -1,4 +1,5 @@
1
1
  import { FunctionalComponent } from '../../stencil-public-runtime';
2
2
  export declare const SelectArrow: FunctionalComponent<{
3
3
  up: boolean;
4
+ ariaLabel?: string;
4
5
  }>;
@@ -1,4 +1,4 @@
1
- import{h as t,r,c as i,H as e,g as n}from"./p-255365bc.js";import{l as o}from"./p-adef7aaf.js";import{S as s}from"./p-1421429d.js";import{b as c}from"./p-cf4d7a83.js";import{M as a}from"./p-16dfbae8.js";
1
+ import{h as t,r,c as i,H as e,g as n}from"./p-255365bc.js";import{l as o}from"./p-adef7aaf.js";import{S as s}from"./p-c09e5b82.js";import{b as c}from"./p-cf4d7a83.js";import{M as a}from"./p-16dfbae8.js";
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -12,4 +12,4 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */var u,l,f=function(){return(f=Object.assign||function(t){for(var r,i=1,e=arguments.length;i<e;i++)for(var n in r=arguments[i])Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);return t}).apply(this,arguments)};function d(t,r){var i={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&r.indexOf(e)<0&&(i[e]=t[e]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(e=Object.getOwnPropertySymbols(t);n<e.length;n++)r.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(t,e[n])&&(i[e[n]]=t[e[n]])}return i}function h(t){var r="function"==typeof Symbol&&Symbol.iterator,i=r&&t[r],e=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(t,r){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var e,n,o=i.call(t),s=[];try{for(;(void 0===r||r-- >0)&&!(e=o.next()).done;)s.push(e.value)}catch(t){n={error:t}}finally{try{e&&!e.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return s}function v(t,r,i){if(i||2===arguments.length)for(var e,n=0,o=r.length;n<o;n++)!e&&n in r||(e||(e=Array.prototype.slice.call(r,0,n)),e[n]=r[n]);return t.concat(e||Array.prototype.slice.call(r))}!function(t){t.Start="xstate.start",t.Stop="xstate.stop",t.Raise="xstate.raise",t.Send="xstate.send",t.Cancel="xstate.cancel",t.NullEvent="",t.Assign="xstate.assign",t.After="xstate.after",t.DoneState="done.state",t.DoneInvoke="done.invoke",t.Log="xstate.log",t.Init="xstate.init",t.Invoke="xstate.invoke",t.ErrorExecution="error.execution",t.ErrorCommunication="error.communication",t.ErrorPlatform="error.platform",t.ErrorCustom="xstate.error",t.Update="xstate.update",t.Pure="xstate.pure",t.Choose="xstate.choose"}(u||(u={})),function(t){t.Parent="#_parent",t.Internal="#_internal"}(l||(l={}));var m,y=u.Start,g=u.Stop,b=u.Raise,w=u.Send,x=u.Cancel,O=u.NullEvent,S=u.Assign,k=u.Log,j=u.Init,z=u.Invoke,C=u.ErrorPlatform,E=u.ErrorCustom,_=u.Update,T=u.Choose,N=u.Pure,M={};function L(t,r,i){void 0===i&&(i=".");var e=D(t,i),n=D(r,i);return X(n)?!!X(e)&&n===e:X(e)?e in n:Object.keys(e).every((function(t){return t in n&&L(e[t],n[t])}))}function A(t){try{return X(t)||"number"==typeof t?"".concat(t):t.type}catch(t){throw new Error("Events must be strings or objects with a string event.type property.")}}function I(t,r){try{return G(t)?t:t.toString().split(r)}catch(r){throw new Error("'".concat(t,"' is not a valid state path."))}}function D(t,r){return"object"==typeof(i=t)&&"value"in i&&"context"in i&&"event"in i&&"_event"in i?t.value:G(t)?V(t):"string"!=typeof t?t:V(I(t,r));var i}function V(t){if(1===t.length)return t[0];for(var r={},i=r,e=0;e<t.length-1;e++)e===t.length-2?i[t[e]]=t[e+1]:(i[t[e]]={},i=i[t[e]]);return r}function P(t,r){for(var i={},e=Object.keys(t),n=0;n<e.length;n++){var o=e[n];i[o]=r(t[o],o,t,n)}return i}function J(t,r,i){var e,n,o={};try{for(var s=h(Object.keys(t)),c=s.next();!c.done;c=s.next()){var a=c.value,u=t[a];i(u)&&(o[a]=r(u,a,t))}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return o}var U=function(t){return function(r){var i,e,n=r;try{for(var o=h(t),s=o.next();!s.done;s=o.next())n=n[s.value]}catch(t){i={error:t}}finally{try{s&&!s.done&&(e=o.return)&&e.call(o)}finally{if(i)throw i.error}}return n}};function B(t){return t?X(t)?[[t]]:K(Object.keys(t).map((function(r){var i=t[r];return"string"==typeof i||i&&Object.keys(i).length?B(t[r]).map((function(t){return[r].concat(t)})):[[r]]}))):[[]]}function K(t){var r;return(r=[]).concat.apply(r,v([],p(t),!1))}function W(t){return G(t)?t:[t]}function $(t){return void 0===t?[]:W(t)}function F(t,r,i){var e,n;if(Q(t))return t(r,i.data);var o={};try{for(var s=h(Object.keys(t)),c=s.next();!c.done;c=s.next()){var a=c.value,u=t[a];o[a]=Q(u)?u(r,i.data):u}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return o}function R(t){return t instanceof Promise||!(null===t||!Q(t)&&"object"!=typeof t||!Q(t.then))}function H(t,r){var i,e,n=p([[],[]],2),o=n[0],s=n[1];try{for(var c=h(t),a=c.next();!a.done;a=c.next()){var u=a.value;r(u)?o.push(u):s.push(u)}}catch(t){i={error:t}}finally{try{a&&!a.done&&(e=c.return)&&e.call(c)}finally{if(i)throw i.error}}return[o,s]}function Y(t,r){return P(t.states,(function(t,i){if(t){var e=(X(r)?void 0:r[i])||(t?t.current:void 0);if(e)return{current:e,states:Y(t,e)}}}))}function q(t,r,i,e){return t?i.reduce((function(t,i){var n,o,s=i.assignment,c={state:e,action:i,_event:r},a={};if(Q(s))a=s(t,r.data,c);else try{for(var u=h(Object.keys(s)),l=u.next();!l.done;l=u.next()){var f=l.value,d=s[f];a[f]=Q(d)?d(t,r.data,c):d}}catch(t){n={error:t}}finally{try{l&&!l.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}return Object.assign({},t,a)}),t):t}function G(t){return Array.isArray(t)}function Q(t){return"function"==typeof t}function X(t){return"string"==typeof t}function Z(t,r){if(t)return X(t)?{type:"xstate.guard",name:t,predicate:r?r[t]:void 0}:Q(t)?{type:"xstate.guard",name:t.name,predicate:t}:t}var tt=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function rt(t){return!!t&&"__xstatenode"in t}function it(t,r){return X(t)||"number"==typeof t?f({type:t},r):t}function et(t,r){if(!X(t)&&"$$type"in t&&"scxml"===t.$$type)return t;var i=it(t);return f({name:i.type,data:i,$$type:"scxml",type:"external"},r)}function nt(t,r){return W(r).map((function(r){return void 0===r||"string"==typeof r||rt(r)?{target:r,event:t}:f(f({},r),{event:t})}))}function ot(t,r,i,e,n){var o=t.options.guards,s={state:n,cond:r,_event:e};if("xstate.guard"===r.type)return((null==o?void 0:o[r.name])||r.predicate)(i,e.data,s);var c=null==o?void 0:o[r.type];if(!c)throw new Error("Guard '".concat(r.type,"' is not implemented on machine '").concat(t.id,"'."));return c(i,e.data,s)}function st(t){return"string"==typeof t?{type:t}:t}function ct(t,r,i){if("object"==typeof t)return t;var e=function(){};return{next:t,error:r||e,complete:i||e}}function at(t,r){return"".concat(t,":invocation[").concat(r,"]")}(m={})[tt]=function(){return this},m[Symbol.observable]=function(){return this};var ut=et({type:j});function lt(t,r){return r&&r[t]||void 0}function ft(t,r){var i;if(X(t)||"number"==typeof t)i=Q(e=lt(t,r))?{type:t,exec:e}:e||{type:t,exec:void 0};else if(Q(t))i={type:t.name||t.toString(),exec:t};else{var e;if(Q(e=lt(t.type,r)))i=f(f({},t),{exec:e});else if(e){var n=e.type||t.type;i=f(f(f({},e),t),{type:n})}else i=t}return i}var dt=function(t,r){return t?(G(t)?t:[t]).map((function(t){return ft(t,r)})):[]};function ht(t){var r=ft(t);return f(f({id:X(t)?t:r.id},r),{type:r.type})}function pt(t){return X(t)?{type:b,event:t}:vt(t,{to:l.Internal})}function vt(t,r){return{to:r?r.to:void 0,type:w,event:Q(t)?t:it(t),delay:r?r.delay:void 0,id:r&&void 0!==r.id?r.id:Q(t)?t.name:A(t)}}function mt(t,r){var i="".concat(u.DoneState,".").concat(t);return{type:i,data:r,toString:function(){return i}}}function yt(t,r){var i="".concat(u.DoneInvoke,".").concat(t);return{type:i,data:r,toString:function(){return i}}}function gt(t,r){var i="".concat(u.ErrorPlatform,".").concat(t);return{type:i,data:r,toString:function(){return i}}}function bt(t,r,i,e,n,o){void 0===o&&(o=!1);var s=p(o?[[],n]:H(n,(function(t){return t.type===S})),2),c=s[0],a=s[1],l=c.length?q(i,e,c,r):i,d=o?[i]:void 0;return[K(a.map((function(i){var n;switch(i.type){case b:return{type:b,_event:et(i.event)};case w:return function(t,r,i,e){var n,o={_event:i},s=et(Q(t.event)?t.event(r,i.data,o):t.event);if(X(t.delay)){var c=e&&e[t.delay];n=Q(c)?c(r,i.data,o):c}else n=Q(t.delay)?t.delay(r,i.data,o):t.delay;var a=Q(t.to)?t.to(r,i.data,o):t.to;return f(f({},t),{to:a,_event:s,event:s.data,delay:n})}(i,l,e,t.options.delays);case k:return function(t,r,i){return f(f({},t),{value:X(t.expr)?t.expr:t.expr(r,i.data,{_event:i})})}(i,l,e);case T:if(!(a=null===(n=i.conds.find((function(i){var n=Z(i.cond,t.options.guards);return!n||ot(t,n,l,e,r)})))||void 0===n?void 0:n.actions))return[];var s=p(bt(t,r,l,e,dt($(a),t.options.actions),o),2),c=s[0];return l=s[1],null==d||d.push(l),c;case N:var a;if(!(a=i.get(l,e.data)))return[];var h=p(bt(t,r,l,e,dt($(a),t.options.actions),o),2),m=h[0];return l=h[1],null==d||d.push(l),m;case g:return function(t,r,i){var e=Q(t.activity)?t.activity(r,i.data):t.activity;return{type:u.Stop,activity:"string"==typeof e?{id:e}:e}}(i,l,e);case S:l=q(l,e,[i],r),null==d||d.push(l);break;default:var y=ft(i,t.options.actions),x=y.exec;if(x&&d){var O=d.length-1;y=f(f({},y),{exec:function(t){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];x.apply(void 0,v([d[O]],p(r),!1))}})}return y}})).filter((function(t){return!!t}))),l]}var wt=function(t,r){return r(t)};function xt(t){var r;return(r={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:t}}})[tt]=function(){return this},r}var Ot=function(t){return"atomic"===t.type||"final"===t.type};function St(t){return Object.keys(t.states).map((function(r){return t.states[r]}))}function kt(t){var r=[t];return Ot(t)?r:r.concat(K(St(t).map(kt)))}function jt(t,r){var i,e,n,o,s,c,a,u,l=Ct(new Set(t)),f=new Set(r);try{for(var d=h(f),p=d.next();!p.done;p=d.next())for(var v=(k=p.value).parent;v&&!f.has(v);)f.add(v),v=v.parent}catch(t){i={error:t}}finally{try{p&&!p.done&&(e=d.return)&&e.call(d)}finally{if(i)throw i.error}}var m=Ct(f);try{for(var y=h(f),g=y.next();!g.done;g=y.next())if("compound"!==(k=g.value).type||m.get(k)&&m.get(k).length){if("parallel"===k.type)try{for(var b=(s=void 0,h(St(k))),w=b.next();!w.done;w=b.next()){var x=w.value;"history"!==x.type&&(f.has(x)||(f.add(x),l.get(x)?l.get(x).forEach((function(t){return f.add(t)})):x.initialStateNodes.forEach((function(t){return f.add(t)}))))}}catch(t){s={error:t}}finally{try{w&&!w.done&&(c=b.return)&&c.call(b)}finally{if(s)throw s.error}}}else l.get(k)?l.get(k).forEach((function(t){return f.add(t)})):k.initialStateNodes.forEach((function(t){return f.add(t)}))}catch(t){n={error:t}}finally{try{g&&!g.done&&(o=y.return)&&o.call(y)}finally{if(n)throw n.error}}try{for(var O=h(f),S=O.next();!S.done;S=O.next()){var k;for(v=(k=S.value).parent;v&&!f.has(v);)f.add(v),v=v.parent}}catch(t){a={error:t}}finally{try{S&&!S.done&&(u=O.return)&&u.call(O)}finally{if(a)throw a.error}}return f}function zt(t,r){var i=r.get(t);if(!i)return{};if("compound"===t.type){var e=i[0];if(!e)return{};if(Ot(e))return e.key}var n={};return i.forEach((function(t){n[t.key]=zt(t,r)})),n}function Ct(t){var r,i,e=new Map;try{for(var n=h(t),o=n.next();!o.done;o=n.next()){var s=o.value;e.has(s)||e.set(s,[]),s.parent&&(e.has(s.parent)||e.set(s.parent,[]),e.get(s.parent).push(s))}}catch(t){r={error:t}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return e}function Et(t,r){return zt(t,Ct(jt([t],r)))}function _t(t,r){return Array.isArray(t)?t.some((function(t){return t===r})):t instanceof Set&&t.has(r)}function Tt(t,r){return"compound"===r.type?St(r).some((function(r){return"final"===r.type&&_t(t,r)})):"parallel"===r.type&&St(r).every((function(r){return Tt(t,r)}))}function Nt(t){return new Set(K(t.map((function(t){return t.tags}))))}function Mt(t,r){if(t===r)return!0;if(void 0===t||void 0===r)return!1;if(X(t)||X(r))return t===r;var i=Object.keys(t),e=Object.keys(r);return i.length===e.length&&i.every((function(i){return Mt(t[i],r[i])}))}var Lt=function(){function t(t){var r,i,e=this;this.actions=[],this.activities=M,this.meta={},this.events=[],this.value=t.value,this.context=t.context,this._event=t._event,this._sessionid=t._sessionid,this.event=this._event.data,this.historyValue=t.historyValue,this.history=t.history,this.actions=t.actions||[],this.activities=t.activities||M,this.meta=(void 0===(i=t.configuration)&&(i=[]),i.reduce((function(t,r){return void 0!==r.meta&&(t[r.id]=r.meta),t}),{})),this.events=t.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=t.configuration,this.transitions=t.transitions,this.children=t.children,this.done=!!t.done,this.tags=null!==(r=Array.isArray(t.tags)?new Set(t.tags):t.tags)&&void 0!==r?r:new Set,this.machine=t.machine,Object.defineProperty(this,"nextEvents",{get:function(){return function(t){return v([],p(new Set(K(v([],p(t.map((function(t){return t.ownEvents}))),!1)))),!1)}(e.configuration)}})}return t.from=function(r,i){return r instanceof t?r.context!==i?new t({value:r.value,context:i,_event:r._event,_sessionid:null,historyValue:r.historyValue,history:r.history,actions:[],activities:r.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):r:new t({value:r,context:i,_event:ut,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},t.create=function(r){return new t(r)},t.inert=function(r,i){return r instanceof t?r.actions.length?new t({value:r.value,context:i,_event:ut,_sessionid:null,historyValue:r.historyValue,history:r.history,activities:r.activities,configuration:r.configuration,transitions:[],children:{}}):r:t.from(r,i)},t.prototype.toStrings=function(t,r){var i=this;if(void 0===t&&(t=this.value),void 0===r&&(r="."),X(t))return[t];var e=Object.keys(t);return e.concat.apply(e,v([],p(e.map((function(e){return i.toStrings(t[e],r).map((function(t){return e+r+t}))}))),!1))},t.prototype.toJSON=function(){var t=this.tags,r=d(this,["configuration","transitions","tags","machine"]);return f(f({},r),{tags:Array.from(t)})},t.prototype.matches=function(t){return L(t,this.value)},t.prototype.hasTag=function(t){return this.tags.has(t)},t.prototype.can=function(t){var r,i=null===(r=this.machine)||void 0===r?void 0:r.getTransitionData(this,t);return!!(null==i?void 0:i.transitions.length)&&i.transitions.some((function(t){return void 0!==t.target||t.actions.length}))},t}(),At={deferEvents:!1},It=function(){function t(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=f(f({},At),t)}return t.prototype.initialize=function(t){if(this.initialized=!0,t){if(!this.options.deferEvents)return void this.schedule(t);this.process(t)}this.flushEvents()},t.prototype.schedule=function(t){if(this.initialized&&!this.processingEvent){if(0!==this.queue.length)throw new Error("Event queue should be empty when it is not processing events");this.process(t),this.flushEvents()}else this.queue.push(t)},t.prototype.clear=function(){this.queue=[]},t.prototype.flushEvents=function(){for(var t=this.queue.shift();t;)this.process(t),t=this.queue.shift()},t.prototype.process=function(t){this.processingEvent=!0;try{t()}catch(t){throw this.clear(),t}finally{this.processingEvent=!1}},t}(),Dt=new Map,Vt=0;function Pt(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0}var Jt,Ut={sync:!1,autoForward:!1};!function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(Jt||(Jt={}));var Bt=function(){function t(r,i){var e=this;void 0===i&&(i=t.defaultOptions),this.machine=r,this.scheduler=new It,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=Jt.NotStarted,this.children=new Map,this.forwardTo=new Set,this.init=this.start,this.send=function(t,r){if(G(t))return e.batch(t),e.state;var i=et(it(t,r));if(e.status===Jt.Stopped)return e.state;if(e.status!==Jt.Running&&!e.options.deferEvents)throw new Error('Event "'.concat(i.name,'" was sent to uninitialized service "').concat(e.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: ').concat(JSON.stringify(i.data)));return e.scheduler.schedule((function(){e.forward(i);var t=e.nextState(i);e.update(t,i)})),e._state},this.sendTo=function(t,r){var i,n=e.parent&&(r===l.Parent||e.parent.id===r),o=n?e.parent:X(r)?e.children.get(r)||function(t){return Dt.get(t)}(r):(i=r)&&"function"==typeof i.send?r:void 0;if(o)o.send("machine"in o?f(f({},t),{name:t.name===E?"".concat(gt(e.id)):t.name,origin:e.sessionId}):t.data);else if(!n)throw new Error("Unable to send event to child '".concat(r,"' from service '").concat(e.id,"'."))};var n=f(f({},t.defaultOptions),i),o=n.clock,s=n.logger,c=n.parent,a=n.id;this.id=void 0!==a?a:r.id,this.logger=s,this.clock=o,this.parent=c,this.options=n,this.scheduler=new It({deferEvents:this.options.deferEvents}),this.sessionId="x:".concat(Vt++)}return Object.defineProperty(t.prototype,"initialState",{get:function(){var t=this;return this._initialState?this._initialState:wt(this,(function(){return t._initialState=t.machine.initialState,t._initialState}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),t.prototype.execute=function(t,r){var i,e;try{for(var n=h(t.actions),o=n.next();!o.done;o=n.next())this.exec(o.value,t,r)}catch(t){i={error:t}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(i)throw i.error}}},t.prototype.update=function(t,r){var i,e,n,o,s,c,a,u,l=this;if(t._sessionid=this.sessionId,this._state=t,this.options.execute&&this.execute(this.state),this.children.forEach((function(t){l.state.children[t.id]=t})),this.devTools&&this.devTools.send(r.data,t),t.event)try{for(var f=h(this.eventListeners),d=f.next();!d.done;d=f.next())(0,d.value)(t.event)}catch(t){i={error:t}}finally{try{d&&!d.done&&(e=f.return)&&e.call(f)}finally{if(i)throw i.error}}try{for(var p=h(this.listeners),v=p.next();!v.done;v=p.next())(0,v.value)(t,t.event)}catch(t){n={error:t}}finally{try{v&&!v.done&&(o=p.return)&&o.call(p)}finally{if(n)throw n.error}}try{for(var m=h(this.contextListeners),y=m.next();!y.done;y=m.next())(0,y.value)(this.state.context,this.state.history?this.state.history.context:void 0)}catch(t){s={error:t}}finally{try{y&&!y.done&&(c=m.return)&&c.call(m)}finally{if(s)throw s.error}}var g=Tt(t.configuration||[],this.machine);if(this.state.configuration&&g){var b=t.configuration.find((function(t){return"final"===t.type&&t.parent===l.machine})),w=b&&b.doneData?F(b.doneData,t.context,r):void 0;try{for(var x=h(this.doneListeners),O=x.next();!O.done;O=x.next())(0,O.value)(yt(this.id,w))}catch(t){a={error:t}}finally{try{O&&!O.done&&(u=x.return)&&u.call(x)}finally{if(a)throw a.error}}this.stop()}},t.prototype.onTransition=function(t){return this.listeners.add(t),this.status===Jt.Running&&t(this.state,this.state.event),this},t.prototype.subscribe=function(t,r,i){var e,n=this;if(!t)return{unsubscribe:function(){}};var o=i;return"function"==typeof t?e=t:(e=t.next.bind(t),o=t.complete.bind(t)),this.listeners.add(e),this.status===Jt.Running&&e(this.state),o&&this.onDone(o),{unsubscribe:function(){e&&n.listeners.delete(e),o&&n.doneListeners.delete(o)}}},t.prototype.onEvent=function(t){return this.eventListeners.add(t),this},t.prototype.onSend=function(t){return this.sendListeners.add(t),this},t.prototype.onChange=function(t){return this.contextListeners.add(t),this},t.prototype.onStop=function(t){return this.stopListeners.add(t),this},t.prototype.onDone=function(t){return this.doneListeners.add(t),this},t.prototype.off=function(t){return this.listeners.delete(t),this.eventListeners.delete(t),this.sendListeners.delete(t),this.stopListeners.delete(t),this.doneListeners.delete(t),this.contextListeners.delete(t),this},t.prototype.start=function(t){var r=this;if(this.status===Jt.Running)return this;this.machine._init(),Dt.set(this.sessionId,this),this.initialized=!0,this.status=Jt.Running;var i=void 0===t?this.initialState:wt(this,(function(){return r.machine.resolveState("object"==typeof(i=t)&&null!==i&&"value"in i&&"_event"in i?t:Lt.from(t,r.machine.context));var i}));return this.options.devTools&&this.attachDev(),this.scheduler.initialize((function(){r.update(i,ut)})),this},t.prototype.stop=function(){var t,r,i,e,n,o,s,c,a,u,l=this;try{for(var f=h(this.listeners),d=f.next();!d.done;d=f.next())this.listeners.delete(O=d.value)}catch(r){t={error:r}}finally{try{d&&!d.done&&(r=f.return)&&r.call(f)}finally{if(t)throw t.error}}try{for(var m=h(this.stopListeners),y=m.next();!y.done;y=m.next())(O=y.value)(),this.stopListeners.delete(O)}catch(t){i={error:t}}finally{try{y&&!y.done&&(e=m.return)&&e.call(m)}finally{if(i)throw i.error}}try{for(var g=h(this.contextListeners),b=g.next();!b.done;b=g.next())this.contextListeners.delete(O=b.value)}catch(t){n={error:t}}finally{try{b&&!b.done&&(o=g.return)&&o.call(g)}finally{if(n)throw n.error}}try{for(var w=h(this.doneListeners),x=w.next();!x.done;x=w.next()){var O;this.doneListeners.delete(O=x.value)}}catch(t){s={error:t}}finally{try{x&&!x.done&&(c=w.return)&&c.call(w)}finally{if(s)throw s.error}}if(!this.initialized)return this;v([],p(this.state.configuration),!1).sort((function(t,r){return r.order-t.order})).forEach((function(t){var r,i;try{for(var e=h(t.definition.exit),n=e.next();!n.done;n=e.next())l.exec(n.value,l.state)}catch(t){r={error:t}}finally{try{n&&!n.done&&(i=e.return)&&i.call(e)}finally{if(r)throw r.error}}})),this.children.forEach((function(t){Q(t.stop)&&t.stop()}));try{for(var S=h(Object.keys(this.delayedEventsMap)),k=S.next();!k.done;k=S.next())this.clock.clearTimeout(this.delayedEventsMap[k.value])}catch(t){a={error:t}}finally{try{k&&!k.done&&(u=S.return)&&u.call(S)}finally{if(a)throw a.error}}return this.scheduler.clear(),this.initialized=!1,this.status=Jt.Stopped,Dt.delete(this.sessionId),this},t.prototype.batch=function(t){var r=this;if(this.status===Jt.NotStarted&&this.options.deferEvents);else if(this.status!==Jt.Running)throw new Error("".concat(t.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));this.scheduler.schedule((function(){var i,e,n=r.state,o=!1,s=[],c=function(t){var i=et(t);r.forward(i),n=wt(r,(function(){return r.machine.transition(n,i)})),s.push.apply(s,v([],p(n.actions.map((function(t){return i=n,e=(r=t).exec,f(f({},r),{exec:void 0!==e?function(){return e(i.context,i.event,{action:r,state:i,_event:i._event})}:void 0});var r,i,e}))),!1)),o=o||!!n.changed};try{for(var a=h(t),u=a.next();!u.done;u=a.next())c(u.value)}catch(t){i={error:t}}finally{try{u&&!u.done&&(e=a.return)&&e.call(a)}finally{if(i)throw i.error}}n.changed=o,n.actions=s,r.update(n,et(t[t.length-1]))}))},t.prototype.sender=function(t){return this.send.bind(this,t)},t.prototype.nextState=function(t){var r=this,i=et(t);if(0===i.name.indexOf(C)&&!this.state.nextEvents.some((function(t){return 0===t.indexOf(C)})))throw i.data.data;return wt(this,(function(){return r.machine.transition(r.state,i)}))},t.prototype.forward=function(t){var r,i;try{for(var e=h(this.forwardTo),n=e.next();!n.done;n=e.next()){var o=n.value,s=this.children.get(o);if(!s)throw new Error("Unable to forward event '".concat(t,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(o,"'."));s.send(t)}}catch(t){r={error:t}}finally{try{n&&!n.done&&(i=e.return)&&i.call(e)}finally{if(r)throw r.error}}},t.prototype.defer=function(t){var r=this;this.delayedEventsMap[t.id]=this.clock.setTimeout((function(){t.to?r.sendTo(t._event,t.to):r.send(t._event)}),t.delay)},t.prototype.cancel=function(t){this.clock.clearTimeout(this.delayedEventsMap[t]),delete this.delayedEventsMap[t]},t.prototype.exec=function(t,r,i){void 0===i&&(i=this.machine.options.actions);var e=r.context,n=r._event,o=t.exec||lt(t.type,i),s=Q(o)?o:o?o.exec:t.exec;if(s)try{return s(e,n.data,{action:t,state:this.state,_event:n})}catch(t){throw this.parent&&this.parent.send({type:"xstate.error",data:t}),t}switch(t.type){case w:var c=t;if("number"==typeof c.delay)return void this.defer(c);c.to?this.sendTo(c._event,c.to):this.send(c._event);break;case x:this.cancel(t.sendId);break;case y:if(this.status!==Jt.Running)return;var a=t.activity;if(!this.state.activities[a.id||a.type])break;if(a.type===u.Invoke){var l=st(a.src),f=this.machine.options.services?this.machine.options.services[l.type]:void 0,d=a.id,h=a.data,p="autoForward"in a?a.autoForward:!!a.forward;if(!f)return;var v=h?F(h,e,n):void 0;if("string"==typeof f)return;var m=Q(f)?f(e,n.data,{data:v,src:l,meta:a.meta}):f;if(!m)return;var b=void 0;rt(m)&&(m=v?m.withContext(v):m,b={autoForward:p}),this.spawn(m,d,b)}else this.spawnActivity(a);break;case g:this.stopChild(t.activity.id);break;case k:var O=t.label,S=t.value;O?this.logger(O,S):this.logger(S)}},t.prototype.removeChild=function(t){var r;this.children.delete(t),this.forwardTo.delete(t),null===(r=this.state)||void 0===r||delete r.children[t]},t.prototype.stopChild=function(t){var r=this.children.get(t);r&&(this.removeChild(t),Q(r.stop)&&r.stop())},t.prototype.spawn=function(t,r,i){if(R(t))return this.spawnPromise(Promise.resolve(t),r);if(Q(t))return this.spawnCallback(t,r);if(function(t){try{return"function"==typeof t.send}catch(t){return!1}}(n=t)&&"id"in n)return this.spawnActor(t,r);if(function(t){try{return"subscribe"in t&&Q(t.subscribe)}catch(t){return!1}}(t))return this.spawnObservable(t,r);if(rt(t))return this.spawnMachine(t,f(f({},i),{id:r}));if(null!==(e=t)&&"object"==typeof e&&"transition"in e&&"function"==typeof e.transition)return this.spawnBehavior(t,r);throw new Error('Unable to spawn entity "'.concat(r,'" of type "').concat(typeof t,'".'));var e,n},t.prototype.spawnMachine=function(r,i){var e=this;void 0===i&&(i={});var n=new t(r,f(f({},this.options),{parent:this,id:i.id||r.id})),o=f(f({},Ut),i);o.sync&&n.onTransition((function(t){e.send(_,{state:t,id:n.id})}));var s=n;return this.children.set(n.id,s),o.autoForward&&this.forwardTo.add(n.id),n.onDone((function(t){e.removeChild(n.id),e.send(et(t,{origin:n.id}))})).start(),s},t.prototype.spawnBehavior=function(t,r){var i=function(t,r){void 0===r&&(r={});var i=t.initialState,e=new Set,n=[],o=!1,s=function(t){var r;return f(((r={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}})[tt]=function(){return this},r),t)}({id:r.id,send:function(r){n.push(r),function(){if(!o){for(o=!0;n.length>0;){var r=n.shift();i=t.transition(i,r,c),e.forEach((function(t){return t.next(i)}))}o=!1}}()},getSnapshot:function(){return i},subscribe:function(t,r,n){var o=ct(t,r,n);return e.add(o),o.next(i),{unsubscribe:function(){e.delete(o)}}}}),c={parent:r.parent,self:s,id:r.id||"anonymous",observers:e};return i=t.start?t.start(c):i,s}(t,{id:r,parent:this});return this.children.set(r,i),i},t.prototype.spawnPromise=function(t,r){var i,e,n=this,o=!1;t.then((function(t){o||(e=t,n.removeChild(r),n.send(et(yt(r,t),{origin:r})))}),(function(t){if(!o){n.removeChild(r);var i=gt(r,t);try{n.send(et(i,{origin:r}))}catch(t){n.devTools&&n.devTools.send(i,n.state),n.machine.strict&&n.stop()}}}));var s=((i={id:r,send:function(){},subscribe:function(r,i,e){var n=ct(r,i,e),o=!1;return t.then((function(t){o||(n.next(t),o||n.complete())}),(function(t){o||n.error(t)})),{unsubscribe:function(){return o=!0}}},stop:function(){o=!0},toJSON:function(){return{id:r}},getSnapshot:function(){return e}})[tt]=function(){return this},i);return this.children.set(r,s),s},t.prototype.spawnCallback=function(t,r){var i,e,n,o=this,s=!1,c=new Set,a=new Set;try{n=t((function(t){e=t,a.forEach((function(r){return r(t)})),s||o.send(et(t,{origin:r}))}),(function(t){c.add(t)}))}catch(t){this.send(gt(r,t))}if(R(n))return this.spawnPromise(n,r);var u=((i={id:r,send:function(t){return c.forEach((function(r){return r(t)}))},subscribe:function(t){var r=ct(t);return a.add(r.next),{unsubscribe:function(){a.delete(r.next)}}},stop:function(){s=!0,Q(n)&&n()},toJSON:function(){return{id:r}},getSnapshot:function(){return e}})[tt]=function(){return this},i);return this.children.set(r,u),u},t.prototype.spawnObservable=function(t,r){var i,e,n=this,o=t.subscribe((function(t){e=t,n.send(et(t,{origin:r}))}),(function(t){n.removeChild(r),n.send(et(gt(r,t),{origin:r}))}),(function(){n.removeChild(r),n.send(et(yt(r),{origin:r}))})),s=((i={id:r,send:function(){},subscribe:function(r,i,e){return t.subscribe(r,i,e)},stop:function(){return o.unsubscribe()},getSnapshot:function(){return e},toJSON:function(){return{id:r}}})[tt]=function(){return this},i);return this.children.set(r,s),s},t.prototype.spawnActor=function(t,r){return this.children.set(r,t),t},t.prototype.spawnActivity=function(t){var r=this.machine.options&&this.machine.options.activities?this.machine.options.activities[t.type]:void 0;if(r){var i=r(this.state.context,t);this.spawnEffect(t.id,i)}},t.prototype.spawnEffect=function(t,r){var i;this.children.set(t,((i={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:r||void 0,getSnapshot:function(){},toJSON:function(){return{id:t}}})[tt]=function(){return this},i))},t.prototype.attachDev=function(){var t=Pt();if(this.options.devTools&&t){if(t.__REDUX_DEVTOOLS_EXTENSION__){var r="object"==typeof this.options.devTools?this.options.devTools:void 0;this.devTools=t.__REDUX_DEVTOOLS_EXTENSION__.connect(f(f({name:this.id,autoPause:!0,stateSanitizer:function(t){return{value:t.value,context:t.context,actions:t.actions}}},r),{features:f({jump:!1,skip:!1},r?r.features:void 0)}),this.machine),this.devTools.init(this.state)}!function(t){if(Pt()){var r=function(){var t=Pt();if(t&&"__xstate__"in t)return t.__xstate__}();r&&r.register(t)}}(this)}},t.prototype.toJSON=function(){return{id:this.id}},t.prototype[tt]=function(){return this},t.prototype.getSnapshot=function(){return this.status===Jt.NotStarted?this.initialState:this._state},t.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(t,r){return setTimeout(t,r)},clearTimeout:function(t){return clearTimeout(t)}},logger:console.log.bind(console),devTools:!1},t.interpret=Kt,t}();function Kt(t,r){return new Bt(t,r)}function Wt(t){return f(f({type:z},t),{toJSON:function(){var r,i=d(t,["onDone","onError"]);return f(f({},i),{type:z,src:(r=t.src,"string"==typeof r?{type:r,toString:function(){return r}}:r)})}})}var $t={},Ft=function(t){return"#"===t[0]},Rt=function(){function t(r,i,e,n){var o,s=this;void 0===e&&(e="context"in r?r.context:void 0),this.config=r,this._context=e,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign({actions:{},guards:{},services:{},activities:{},delays:{}},i),this.parent=null==n?void 0:n.parent,this.key=this.config.key||(null==n?void 0:n.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:"."),this.id=this.config.id||v([this.machine.key],p(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:null!==(o=this.config.schema)&&void 0!==o?o:{},this.description=this.config.description,this.initial=this.config.initial,this.states=this.config.states?P(this.config.states,(function(r,i){var e,n=new t(r,{},void 0,{parent:s,key:i});return Object.assign(s.idMap,f(((e={})[n.id]=n,e),n.idMap)),n})):$t;var c=0;!function t(r){var i,e;r.order=c++;try{for(var n=h(St(r)),o=n.next();!o.done;o=n.next())t(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(i)throw i.error}}}(this),this.history=!0===this.config.history?"shallow":this.config.history||!1,this._transient=!!this.config.always||!!this.config.on&&(Array.isArray(this.config.on)?this.config.on.some((function(t){return""===t.event})):""in this.config.on),this.strict=!!this.config.strict,this.onEntry=$(this.config.entry||this.config.onEntry).map((function(t){return ft(t)})),this.onExit=$(this.config.exit||this.config.onExit).map((function(t){return ft(t)})),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=$(this.config.invoke).map((function(t,r){var i,e;if(rt(t)){var n=at(s.id,r);return s.machine.options.services=f(((i={})[n]=t,i),s.machine.options.services),Wt({src:n,id:n})}if(X(t.src))return n=t.id||at(s.id,r),Wt(f(f({},t),{id:n,src:t.src}));if(rt(t.src)||Q(t.src))return n=t.id||at(s.id,r),s.machine.options.services=f(((e={})[n]=t.src,e),s.machine.options.services),Wt(f(f({id:n},t),{src:n}));var o=t.src;return Wt(f(f({id:at(s.id,r)},t),{src:o}))})),this.activities=$(this.config.activities).concat(this.invoke).map((function(t){return ht(t)})),this.transition=this.transition.bind(this),this.tags=$(this.config.tags)}return t.prototype._init=function(){this.__cache.transitions||kt(this).forEach((function(t){return t.on}))},t.prototype.withConfig=function(r,i){var e=this.options,n=e.activities,o=e.guards,s=e.services,c=e.delays;return new t(this.config,{actions:f(f({},e.actions),r.actions),activities:f(f({},n),r.activities),guards:f(f({},o),r.guards),services:f(f({},s),r.services),delays:f(f({},c),r.delays)},null!=i?i:this.context)},t.prototype.withContext=function(r){return new t(this.config,this.options,r)},Object.defineProperty(t.prototype,"context",{get:function(){return Q(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:P(this.states,(function(t){return t.definition})),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){return this.definition},Object.defineProperty(t.prototype,"on",{get:function(){return this.__cache.on?this.__cache.on:this.__cache.on=this.transitions.reduce((function(t,r){return t[r.eventType]=t[r.eventType]||[],t[r.eventType].push(r),t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),t.prototype.getCandidates=function(t){if(this.__cache.candidates[t])return this.__cache.candidates[t];var r=""===t,i=this.transitions.filter((function(i){var e=i.eventType===t;return r?e:e||"*"===i.eventType}));return this.__cache.candidates[t]=i,i},t.prototype.getDelayedTransitions=function(){var t=this,r=this.config.after;if(!r)return[];var i=function(r,i){var e,n,o,s=(e=Q(r)?"".concat(t.id,":delay[").concat(i,"]"):r,o=(n=t.id)?"#".concat(n):"","".concat(u.After,"(").concat(e,")").concat(o));return t.onEntry.push(vt(s,{delay:r})),t.onExit.push({type:x,sendId:s}),s};return(G(r)?r.map((function(t,r){var e=i(t.delay,r);return f(f({},t),{event:e})})):K(Object.keys(r).map((function(t,e){var n=r[t],o=X(n)?{target:n}:n,s=isNaN(+t)?t:+t,c=i(s,e);return $(o).map((function(t){return f(f({},t),{event:c,delay:s})}))})))).map((function(r){var i=r.delay;return f(f({},t.formatTransition(r)),{delay:i})}))},t.prototype.getStateNodes=function(t){var r,i=this;if(!t)return[];var e=t instanceof Lt?t.value:D(t,this.delimiter);if(X(e)){var n=this.getStateNode(e).initial;return void 0!==n?this.getStateNodes(((r={})[e]=n,r)):[this,this.states[e]]}var o=Object.keys(e),s=[this];return s.push.apply(s,v([],p(K(o.map((function(t){return i.getStateNode(t).getStateNodes(e[t])})))),!1)),s},t.prototype.handles=function(t){var r=A(t);return this.events.includes(r)},t.prototype.resolveState=function(t){var r=t instanceof Lt?t:Lt.create(t),i=Array.from(jt([],this.getStateNodes(r.value)));return new Lt(f(f({},r),{value:this.resolve(r.value),configuration:i,done:Tt(i,this),tags:Nt(i),machine:this.machine}))},t.prototype.transitionLeafNode=function(t,r,i){var e=this.getStateNode(t).next(r,i);return e&&e.transitions.length?e:this.next(r,i)},t.prototype.transitionCompoundNode=function(t,r,i){var e=Object.keys(t),n=this.getStateNode(e[0])._transition(t[e[0]],r,i);return n&&n.transitions.length?n:this.next(r,i)},t.prototype.transitionParallelNode=function(t,r,i){var e,n,o={};try{for(var s=h(Object.keys(t)),c=s.next();!c.done;c=s.next()){var a=c.value,u=t[a];if(u){var l=this.getStateNode(a)._transition(u,r,i);l&&(o[a]=l)}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}var f=Object.keys(o).map((function(t){return o[t]})),d=K(f.map((function(t){return t.transitions})));if(!f.some((function(t){return t.transitions.length>0})))return this.next(r,i);var p=K(f.map((function(t){return t.entrySet}))),v=K(Object.keys(o).map((function(t){return o[t].configuration})));return{transitions:d,entrySet:p,exitSet:K(f.map((function(t){return t.exitSet}))),configuration:v,source:r,actions:K(Object.keys(o).map((function(t){return o[t].actions})))}},t.prototype._transition=function(t,r,i){return X(t)?this.transitionLeafNode(t,r,i):1===Object.keys(t).length?this.transitionCompoundNode(t,r,i):this.transitionParallelNode(t,r,i)},t.prototype.getTransitionData=function(t,r){return this._transition(t.value,t,et(r))},t.prototype.next=function(t,r){var i,e,n,o=this,s=r.name,c=[],a=[];try{for(var u=h(this.getCandidates(s)),l=u.next();!l.done;l=u.next()){var f=l.value,d=f.cond,m=f.in,y=t.context,g=!m||(X(m)&&Ft(m)?t.matches(D(this.getStateNodeById(m).path,this.delimiter)):L(D(m,this.delimiter),U(this.path.slice(0,-2))(t.value))),b=!1;try{b=!d||ot(this.machine,d,y,r,t)}catch(t){throw new Error("Unable to evaluate guard '".concat(d.name||d.type,"' in transition for event '").concat(s,"' in state node '").concat(this.id,"':\n").concat(t.message))}if(b&&g){void 0!==f.target&&(a=f.target),c.push.apply(c,v([],p(f.actions),!1)),n=f;break}}}catch(t){i={error:t}}finally{try{l&&!l.done&&(e=u.return)&&e.call(u)}finally{if(i)throw i.error}}if(n){if(!a.length)return{transitions:[n],entrySet:[],exitSet:[],configuration:t.value?[this]:[],source:t,actions:c};var w=K(a.map((function(r){return o.getRelativeStateNodes(r,t.historyValue)}))),x=!!n.internal;return{transitions:[n],entrySet:x?[]:K(w.map((function(t){return o.nodesFromChild(t)}))),exitSet:x?[]:[this],configuration:w,source:t,actions:c}}},t.prototype.nodesFromChild=function(t){if(t.escapes(this))return[];for(var r=[],i=t;i&&i!==this;)r.push(i),i=i.parent;return r.push(this),r},t.prototype.escapes=function(t){if(this===t)return!1;for(var r=this.parent;r;){if(r===t)return!1;r=r.parent}return!0},t.prototype.getActions=function(t,r,i,e){var n,o,s,c,a=jt([],e?this.getStateNodes(e.value):[this]),l=t.configuration.length?jt(a,t.configuration):a;try{for(var f=h(l),d=f.next();!d.done;d=f.next())_t(a,g=d.value)||t.entrySet.push(g)}catch(t){n={error:t}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}try{for(var m=h(a),y=m.next();!y.done;y=m.next()){var g;_t(l,g=y.value)&&!_t(t.exitSet,g.parent)||t.exitSet.push(g)}}catch(t){s={error:t}}finally{try{y&&!y.done&&(c=m.return)&&c.call(m)}finally{if(s)throw s.error}}var b=K(t.entrySet.map((function(e){var n=[];if("final"!==e.type)return n;var o=e.parent;if(!o.parent)return n;n.push(mt(e.id,e.doneData),mt(o.id,e.doneData?F(e.doneData,r,i):void 0));var s=o.parent;return"parallel"===s.type&&St(s).every((function(r){return Tt(t.configuration,r)}))&&n.push(mt(s.id)),n})));t.exitSet.sort((function(t,r){return r.order-t.order})),t.entrySet.sort((function(t,r){return t.order-r.order}));var w=new Set(t.entrySet),x=new Set(t.exitSet),O=p([K(Array.from(w).map((function(t){return v(v([],p(t.activities.map((function(t){return function(t){var r=ht(t);return{type:u.Start,activity:r,exec:void 0}}(t)}))),!1),p(t.onEntry),!1)}))).concat(b.map(pt)),K(Array.from(x).map((function(t){return v(v([],p(t.onExit),!1),p(t.activities.map((function(t){return function(t){var r=Q(t)?t:ht(t);return{type:u.Stop,activity:r,exec:void 0}}(t)}))),!1)})))],2),S=O[0];return dt(O[1].concat(t.actions).concat(S),this.machine.options.actions)},t.prototype.transition=function(t,r,i){void 0===t&&(t=this.initialState);var e,n=et(r);if(t instanceof Lt)e=void 0===i?t:this.resolveState(Lt.from(t,i));else{var o=X(t)?this.resolve(V(this.getResolvedPath(t))):this.resolve(t);e=this.resolveState(Lt.from(o,null!=i?i:this.machine.context))}if(this.strict&&!this.events.includes(n.name)&&!/^(done|error)\./.test(n.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(n.name,"'"));var s=this._transition(e.value,e,n)||{transitions:[],configuration:[],entrySet:[],exitSet:[],source:e,actions:[]},c=jt([],this.getStateNodes(e.value)),a=s.configuration.length?jt(c,s.configuration):c;return s.configuration=v([],p(a),!1),this.resolveTransition(s,e,e.context,n)},t.prototype.resolveRaisedTransition=function(t,r,i){var e,n=t.actions;return(t=this.transition(t,r))._event=i,t.event=i.data,(e=t.actions).unshift.apply(e,v([],p(n),!1)),t},t.prototype.resolveTransition=function(t,r,i,e){var n,o,s=this;void 0===e&&(e=ut);var c=t.configuration,a=!r||t.transitions.length>0,u=a?Et(this.machine,c):void 0,d=r?r.historyValue?r.historyValue:t.source?this.machine.historyValue(r.value):void 0:void 0,v=this.getActions(t,i,e,r),m=r?f({},r.activities):{};try{for(var x=h(v),S=x.next();!S.done;S=x.next()){var k=S.value;k.type===y?m[k.activity.id||k.activity.type]=k:k.type===g&&(m[k.activity.id||k.activity.type]=!1)}}catch(t){n={error:t}}finally{try{S&&!S.done&&(o=x.return)&&o.call(x)}finally{if(n)throw n.error}}var j,C,E=p(bt(this,r,i,e,v,this.machine.config.preserveActionOrder),2),T=E[0],N=E[1],M=p(H(T,(function(t){return t.type===b||t.type===w&&t.to===l.Internal})),2),L=M[0],A=M[1],I=T.filter((function(t){var r;return t.type===y&&(null===(r=t.activity)||void 0===r?void 0:r.type)===z})).reduce((function(t,r){return t[r.activity.id]=function(t,r,i,e){var n,o=st(t.src),s=null===(n=null==r?void 0:r.options.services)||void 0===n?void 0:n[o.type],c=t.data?F(t.data,i,e):void 0,a=s?function(t,r,i){var e=xt(r);if(e.deferred=!0,rt(t)){var n=e.state=wt(void 0,(function(){return(i?t.withContext(i):t).initialState}));e.getSnapshot=function(){return n}}return e}(s,t.id,c):xt(t.id);return a.meta=t,a}(r.activity,s.machine,N,e),t}),r?f({},r.children):{}),D=a?t.configuration:r?r.configuration:[],V=Tt(D,this),P=new Lt({value:u||r.value,context:N,_event:e,_sessionid:r?r._sessionid:null,historyValue:u?d?(j=d,C=u,{current:C,states:Y(j,C)}):void 0:r?r.historyValue:void 0,history:!u||t.source?r:void 0,actions:u?A:[],activities:u?m:r?r.activities:{},events:[],configuration:D,transitions:t.transitions,children:I,done:V,tags:null==r?void 0:r.tags,machine:this}),J=i!==N;P.changed=e.name===_||J;var U=P.history;U&&delete U.history;var B=!V&&(this._transient||c.some((function(t){return t._transient})));if(!(a||B&&""!==e.name))return P;var K=P;if(!V)for(B&&(K=this.resolveRaisedTransition(K,{type:O},e));L.length;){var W=L.shift();K=this.resolveRaisedTransition(K,W._event,e)}var $=K.changed||(U?!!K.actions.length||J||typeof U.value!=typeof K.value||!Mt(K.value,U.value):void 0);return K.changed=$,K.history=U,K.tags=Nt(K.configuration),K},t.prototype.getStateNode=function(t){if(Ft(t))return this.machine.getStateNodeById(t);if(!this.states)throw new Error("Unable to retrieve child state '".concat(t,"' from '").concat(this.id,"'; no child states exist."));var r=this.states[t];if(!r)throw new Error("Child state '".concat(t,"' does not exist on '").concat(this.id,"'"));return r},t.prototype.getStateNodeById=function(t){var r=Ft(t)?t.slice("#".length):t;if(r===this.id)return this;var i=this.machine.idMap[r];if(!i)throw new Error("Child state node '#".concat(r,"' does not exist on machine '").concat(this.id,"'"));return i},t.prototype.getStateNodeByPath=function(t){if("string"==typeof t&&Ft(t))try{return this.getStateNodeById(t.slice(1))}catch(t){}for(var r=I(t,this.delimiter).slice(),i=this;r.length;){var e=r.shift();if(!e.length)break;i=i.getStateNode(e)}return i},t.prototype.resolve=function(t){var r,i=this;if(!t)return this.initialStateValue||$t;switch(this.type){case"parallel":return P(this.initialStateValue,(function(r,e){return r?i.getStateNode(e).resolve(t[e]||r):$t}));case"compound":if(X(t)){var e=this.getStateNode(t);return"parallel"===e.type||"compound"===e.type?((r={})[t]=e.initialStateValue,r):t}return Object.keys(t).length?P(t,(function(t,r){return t?i.getStateNode(r).resolve(t):$t})):this.initialStateValue||{};default:return t||$t}},t.prototype.getResolvedPath=function(t){if(Ft(t)){var r=this.machine.idMap[t.slice("#".length)];if(!r)throw new Error("Unable to find state node '".concat(t,"'"));return r.path}return I(t,this.delimiter)},Object.defineProperty(t.prototype,"initialStateValue",{get:function(){var t,r;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;if("parallel"===this.type)r=J(this.states,(function(t){return t.initialStateValue||$t}),(function(t){return!("history"===t.type)}));else if(void 0!==this.initial){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));r=Ot(this.states[this.initial])?this.initial:((t={})[this.initial]=this.states[this.initial].initialStateValue,t)}else r={};return this.__cache.initialStateValue=r,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),t.prototype.getInitialState=function(t,r){this._init();var i=this.getStateNodes(t);return this.resolveTransition({configuration:i,entrySet:i,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,null!=r?r:this.machine.context,void 0)},Object.defineProperty(t.prototype,"initialState",{get:function(){var t=this.initialStateValue;if(!t)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){var t;if("history"===this.type){var r=this.config;t=X(r.target)&&Ft(r.target)?V(this.machine.getStateNodeById(r.target).path.slice(this.path.length-1)):r.target}return t},enumerable:!1,configurable:!0}),t.prototype.getRelativeStateNodes=function(t,r,i){return void 0===i&&(i=!0),i?"history"===t.type?t.resolveHistory(r):t.initialStateNodes:[t]},Object.defineProperty(t.prototype,"initialStateNodes",{get:function(){var t=this;return Ot(this)?[this]:"compound"!==this.type||this.initial?K(B(this.initialStateValue).map((function(r){return t.getFromRelativePath(r)}))):[this]},enumerable:!1,configurable:!0}),t.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var r=p(t),i=r[0],e=r.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(i,"' from node with no states"));var n=this.getStateNode(i);if("history"===n.type)return n.resolveHistory();if(!this.states[i])throw new Error("Child state '".concat(i,"' does not exist on '").concat(this.id,"'"));return this.states[i].getFromRelativePath(e)},t.prototype.historyValue=function(t){if(Object.keys(this.states).length)return{current:t||this.initialStateValue,states:J(this.states,(function(r,i){if(!t)return r.historyValue();var e=X(t)?void 0:t[i];return r.historyValue(e||r.initialStateValue)}),(function(t){return!t.history}))}},t.prototype.resolveHistory=function(t){var r=this;if("history"!==this.type)return[this];var i=this.parent;if(!t){var e=this.target;return e?K(B(e).map((function(t){return i.getFromRelativePath(t)}))):i.initialStateNodes}var n,o=(n=i.path,"states",function(t){var r,i,e=t;try{for(var o=h(n),s=o.next();!s.done;s=o.next())e=e.states[s.value]}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return e})(t).current;return X(o)?[i.getStateNode(o)]:K(B(o).map((function(t){return"deep"===r.history?i.getFromRelativePath(t):[i.states[t[0]]]})))},Object.defineProperty(t.prototype,"stateIds",{get:function(){var t=this,r=K(Object.keys(this.states).map((function(r){return t.states[r].stateIds})));return[this.id].concat(r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"events",{get:function(){var t,r,i,e;if(this.__cache.events)return this.__cache.events;var n=this.states,o=new Set(this.ownEvents);if(n)try{for(var s=h(Object.keys(n)),c=s.next();!c.done;c=s.next()){var a=n[c.value];if(a.states)try{for(var u=(i=void 0,h(a.events)),l=u.next();!l.done;l=u.next())o.add("".concat(l.value))}catch(t){i={error:t}}finally{try{l&&!l.done&&(e=u.return)&&e.call(u)}finally{if(i)throw i.error}}}}catch(r){t={error:r}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return this.__cache.events=Array.from(o)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ownEvents",{get:function(){var t=new Set(this.transitions.filter((function(t){return!(!t.target&&!t.actions.length&&t.internal)})).map((function(t){return t.eventType})));return Array.from(t)},enumerable:!1,configurable:!0}),t.prototype.resolveTarget=function(t){var r=this;if(void 0!==t)return t.map((function(t){if(!X(t))return t;var i=t[0]===r.delimiter;if(i&&!r.parent)return r.getStateNodeByPath(t.slice(1));var e=i?r.key+t:t;if(!r.parent)return r.getStateNodeByPath(e);try{return r.parent.getStateNodeByPath(e)}catch(t){throw new Error("Invalid transition definition for state node '".concat(r.id,"':\n").concat(t.message))}}))},t.prototype.formatTransition=function(t){var r=this,i=function(t){if(void 0!==t&&""!==t)return $(t)}(t.target),e="internal"in t?t.internal:!i||i.some((function(t){return X(t)&&t[0]===r.delimiter})),n=this.machine.options.guards,o=this.resolveTarget(i),s=f(f({},t),{actions:dt($(t.actions)),cond:Z(t.cond,n),target:o,source:this,internal:e,eventType:t.event,toJSON:function(){return f(f({},s),{target:s.target?s.target.map((function(t){return"#".concat(t.id)})):void 0,source:"#".concat(r.id)})}});return s},t.prototype.formatTransitions=function(){var t,r,i,e=this;if(this.config.on)if(Array.isArray(this.config.on))i=this.config.on;else{var n=this.config.on,o=n["*"],s=void 0===o?[]:o,c=d(n,["*"]);i=K(Object.keys(c).map((function(t){return nt(t,c[t])})).concat(nt("*",s)))}else i=[];var a=this.config.always?nt("",this.config.always):[],u=this.config.onDone?nt(String(mt(this.id)),this.config.onDone):[],l=K(this.invoke.map((function(t){var r=[];return t.onDone&&r.push.apply(r,v([],p(nt(String(yt(t.id)),t.onDone)),!1)),t.onError&&r.push.apply(r,v([],p(nt(String(gt(t.id)),t.onError)),!1)),r}))),f=this.after,m=K(v(v(v(v([],p(u),!1),p(l),!1),p(i),!1),p(a),!1).map((function(t){return $(t).map((function(t){return e.formatTransition(t)}))})));try{for(var y=h(f),g=y.next();!g.done;g=y.next())m.push(g.value)}catch(r){t={error:r}}finally{try{g&&!g.done&&(r=y.return)&&r.call(y)}finally{if(t)throw t.error}}return m},t}();const Ht=({disabled:r,option:i,onRemove:e})=>{const n={};return i.chipColor&&(n.color=i.chipColor),i.chipBackgroundColor&&(n["background-color"]=i.chipBackgroundColor),t("label",{class:"wcs-select-chip",style:n,onClick:t=>t.stopImmediatePropagation()},t("div",null,i.displayText),r?null:t("div",{onClick:()=>e(i)},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"12",viewBox:"0 0 20 12",class:"chip"},t("path",{d:"M2,0 6,4 10,0 12,2 8,6 12,10 10,12 6,8 2,12 0,10 4,6 0,2 2,0",fill:i.chipColor,transform:"translate(8 0)"}))))},Yt={key:"select",initial:"closed",states:{closed:{entry:["close"],on:{CLICK:"opened",OPEN:"opened",OPTION_CLICKED:{actions:["selectOption"]}}},opened:{entry:["open"],on:{CLICK:"closed",CLOSE:"closed",OPTION_CLICKED:{actions:["selectOption"]}}}}};let qt=class{constructor(t){r(this,t),this.wcsChange=i(this,"wcsChange",7),this.wcsFocus=i(this,"wcsFocus",7),this.wcsBlur=i(this,"wcsBlur",7),this.expanded=!1,this.hasLoaded=!1,this.disabled=!1,this.multiple=!1,this.chips=!1,this.compareWith=(t,r)=>o.isEqual(t,r),this.overlayDirection="bottom"}async open(){this.stateService.send("OPEN")}async close(){this.stateService.send("CLOSE")}onValueChangeHandler(t){this.updateSelectedValue(t),this.emitChange(this.value)}updateSelectedValue(t){t||this.reset(),this.multiple?(Array.isArray(t)||(t=[t]),this.values=[],this.options.forEach((r=>{const i=!!t&&-1!==t.findIndex((t=>this.compareWith(r.value,t)));i&&this.values.push({value:r.value,displayText:r.innerText,chipColor:r.chipColor,chipBackgroundColor:r.chipBackgroundColor}),r.selected=i})),this.displayText=0!==this.values.length?this.values.map((t=>t.displayText)).join(", "):void 0):this.options.forEach((r=>{const i=this.compareWith(r.value,t);i&&(this.displayText=r.innerText),r.selected=i}))}reset(){this.values=[],this.displayText=void 0,this.options.forEach((t=>{t.selected=!1}))}componentDidLoad(){this.optionsEl=this.el.shadowRoot.querySelector(".wcs-select-options"),this.controlEl=this.el.shadowRoot.querySelector(".wcs-select-control");const t=(r=Yt,i=this.initMachineOptions(),void 0===e&&(e=r.context),new Rt(r,i,e));var r,i,e;this.stateService=Kt(t),this.multiple&&(this.values=[]),this.addRippleEffect(),this.stateService.start(),null===this.optionsEl.querySelector("slot")&&(this.replaceOptions_firefoxBefore63(),this.listenDomUpdate_firefoxBefore63()),void 0!==this.value&&this.updateSelectedValue(this.value),this.hasLoaded=!0}emitChange(t){this.wcsChange.emit({value:t})}replaceOptions_firefoxBefore63(){Array.from(this.el.querySelectorAll("wcs-select-option")).forEach((t=>{t.parentNode===this.el&&(this.el.removeChild(t),this.optionsEl.appendChild(t))}))}listenDomUpdate_firefoxBefore63(){new MutationObserver((t=>{for(const r of t)"childList"===r.type&&this.replaceOptions_firefoxBefore63()})).observe(this.el,{childList:!0})}componentWillUpdate(){this.multiple&&this.options.forEach((t=>t.multiple=!0))}get options(){var t;const r=null===(t=this.el)||void 0===t?void 0:t.querySelectorAll("wcs-select-option");return r&&0!==r.length?r:[]}initMachineOptions(){return{actions:{open:()=>{this.disabled||(this.updateOverlayDirection(),this.expanded=!0,this.focused=!0)},close:()=>{this.focused=!0,this.expanded=!1},selectOption:(t,r)=>{"OPTION_CLICKED"===r.type&&this.handleClickEvent(r.value)}},guards:{enabled:()=>!this.disabled}}}updateOverlayDirection(){const t=+getComputedStyle(this.el).getPropertyValue("--wcs-select-overlay-max-height").replace(/\D/g,""),r=+getComputedStyle(this.el).getPropertyValue("--wcs-select-option-height").replace(/\D/g,""),i=this.el.getBoundingClientRect(),e=Math.floor(t/r),n=window.innerHeight-(i.y+i.height+(this.options.length>e?t+1:this.options.length*r+1));this.overlayDirection=n<0?"top":"bottom"}updateOverlayMargin(){this.controlEl&&this.optionsEl&&(this.optionsEl.style.marginTop="top"===this.overlayDirection?"-"+this.controlEl.getBoundingClientRect().height+"px":"0")}handleClickEvent(t){this.multiple?this.handleClickOnMultiple(t):this.handleNormalClick(t)}handleClickOnMultiple(t){const r=this.values.findIndex((r=>r.value===t.value));if(-1===r){const{value:r,displayText:i,chipColor:e,chipBackgroundColor:n}=t;this.values.push({value:r,displayText:i,chipColor:e,chipBackgroundColor:n}),t.source.selected=!0}else t.source.selected=!1,this.values.splice(r,1);this.updateValueWithValues()}updateValueWithValues(){this.value=this.values.map((t=>t.value)),this.displayText=0!==this.values.length?this.values.map((t=>t.displayText)).join(", "):void 0}handleNormalClick(t){this.options.forEach((t=>{t.selected&&(t.selected=!1)})),t.source.selected=!0,this.value=t.value,this.displayText=t.displayText,this.stateService.send("CLOSE")}disconnectedCallback(){this.stateService.stop()}addRippleEffect(){new a(this.controlEl).unbounded=!1}get hasValue(){return void 0!==this.displayText}onMouseDown(t){const r=c(t.target)&&(t.offsetX>t.target.clientWidth||t.offsetY>t.target.clientHeight),i=t.composedPath().filter((t=>"svg"===t.nodeName&&t.classList.contains("chip"))).length>0;r||i||this.stateService.send("CLICK")}onWindowClickEvent(t){const r=-1!==t.composedPath().map((t=>t.nodeName)).indexOf("WCS-SELECT");this.expanded&&!r&&this.stateService.send("CLOSE")}selectedOptionChanged(t){this.sendOptionClickedToStateMachine(t.detail)}sendOptionClickedToStateMachine(t){this.stateService.send({type:"OPTION_CLICKED",value:t})}onSlotchange(){this.updateSelectedValue(this.value)}removeChip(t){this.options.forEach((r=>{r.value===t.value&&this.sendOptionClickedToStateMachine(Object.assign(Object.assign({},t),{source:r}))}))}render(){return this.hasLoaded&&this.updateStyles(),this.updateOverlayMargin(),t(e,Object.assign({class:this.expanded?"expanded ":"",overlayDirection:this.overlayDirection},this.focusedAttributes()),t("div",{class:"wcs-select-control"},this.hasValue?this.chips?this.values.map((r=>t(Ht,{disabled:this.disabled,option:r,onRemove:this.removeChip.bind(this)}))):t("label",{class:"wcs-select-value"},this.displayText):t("label",{class:"wcs-select-placeholder"},this.placeholder),t(s,{up:this.expanded})),t("div",{class:"wcs-select-options"},t("slot",{name:"wcs-select-option",onSlotchange:this.onSlotchange.bind(this)})))}updateStyles(){this.optionsEl.setAttribute("style",`width: ${Math.ceil(this.el.offsetWidth-2)}px;`)}focusedAttributes(){return this.disabled?{}:{tabIndex:0}}get el(){return n(this)}static get watchers(){return{value:["onValueChangeHandler"]}}};qt.style='@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-ripple-surface{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);will-change:transform, opacity;position:relative;outline:none;overflow:hidden}.mdc-ripple-surface::before,.mdc-ripple-surface::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-ripple-surface::before{transition:opacity 15ms linear, background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-ripple-surface::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-ripple-surface.mdc-ripple-upgraded::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface.mdc-ripple-upgraded::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-ripple-surface.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-activation::after{animation:mdc-ripple-fg-radius-in 225ms forwards, mdc-ripple-fg-opacity-in 75ms forwards}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-deactivation::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface::before,.mdc-ripple-surface::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-ripple-surface.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded],.mdc-ripple-upgraded--unbounded{overflow:visible}.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::after,.mdc-ripple-upgraded--unbounded::before,.mdc-ripple-upgraded--unbounded::after{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::before,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{top:var(--mdc-ripple-top, calc(50% - 50%));left:var(--mdc-ripple-left, calc(50% - 50%));width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface::before,.mdc-ripple-surface::after{background-color:#000;background-color:var(--mdc-ripple-color, #000)}.mdc-ripple-surface:hover::before,.mdc-ripple-surface.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}:host{--wcs-select-ligther-percentage:40;--wcs-select-border-radius:var(--wcs-border-radius);--wcs-select-background-color:var(--wcs-light);--wcs-select-placeholder-color:var(--wcs-text-medium);--wcs-select-value-color:var(--wcs-primary);--wcs-select-border-color:transparent;--wcs-select-overlay-max-height:360px;--wcs-select-option-height:42px;display:block;position:relative;outline:none;user-select:none}:host svg{flex-shrink:0}:host .arrow{fill:var(--wcs-select-value-color)}:host .chip{fill:var(--wcs-contrast);opacity:calc((100 - var(--wcs-select-ligther-percentage)) / 100)}:host .chip:hover{opacity:100}:host([class~=expanded][overlaydirection=top]) .wcs-select-control{border:var(--wcs-select-border-color) solid 1px;border-top-left-radius:0;border-top-right-radius:0}:host([class~=expanded][overlaydirection=bottom]) .wcs-select-control{border:var(--wcs-select-border-color) solid 1px;border-bottom-left-radius:0;border-bottom-right-radius:0}:host(.expanded){--wcs-select-border-color:var(--wcs-text-light)}:host(.expanded) .wcs-select-options{display:block}:host(:not(.expanded):focus) .wcs-select-control{border:var(--wcs-primary) solid 1px}:host([disabled]) .wcs-select-control,:host([disabled]) label{cursor:default;pointer-events:none}:host([disabled]) label{color:var(--wcs-text-disabled)}:host([disabled]) .arrow{fill:var(--wcs-text-medium)}label{padding:calc(var(--wcs-padding) / 2) var(--wcs-padding);font-weight:500;cursor:pointer;color:var(--wcs-select-color);transition:color 125ms ease-in;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host([chips]) .wcs-select-control{flex-wrap:wrap}.wcs-select-control{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);will-change:transform, opacity;overflow:hidden;display:flex;align-items:center;padding-right:var(--wcs-text-padding);background-color:var(--wcs-select-background-color);border-radius:var(--wcs-select-border-radius);border:var(--wcs-select-border-color) solid 1px;font-size:1rem;line-height:1.5;cursor:pointer}.wcs-select-control::before,.wcs-select-control::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.wcs-select-control::before{transition:opacity 15ms linear, background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.wcs-select-control::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.wcs-select-control.mdc-ripple-upgraded::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.wcs-select-control.mdc-ripple-upgraded::after{top:0;left:0;transform:scale(0);transform-origin:center center}.wcs-select-control.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.wcs-select-control.mdc-ripple-upgraded--foreground-activation::after{animation:mdc-ripple-fg-radius-in 225ms forwards, mdc-ripple-fg-opacity-in 75ms forwards}.wcs-select-control.mdc-ripple-upgraded--foreground-deactivation::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.wcs-select-control::before,.wcs-select-control::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.wcs-select-control.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.wcs-select-control::before,.wcs-select-control::after{background-color:#999;background-color:var(--mdc-ripple-color, #999)}.wcs-select-control:hover::before,.wcs-select-control.mdc-ripple-surface--hover::before{opacity:0.1;opacity:var(--mdc-ripple-hover-opacity, 0.1)}.wcs-select-control.mdc-ripple-upgraded--background-focused::before,.wcs-select-control:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-focus-opacity, 0.2)}.wcs-select-control:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.wcs-select-control:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.3;opacity:var(--mdc-ripple-press-opacity, 0.3)}.wcs-select-control.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.3)}.wcs-select-placeholder{color:var(--wcs-select-placeholder-color);font-style:italic;font-weight:400}.wcs-select-value{color:var(--wcs-select-value-color);font-weight:var(--wcs-font-weight-form-value)}.wcs-select-chip{color:var(--wcs-contrast);background-color:var(--wcs-base);border-radius:0.75rem;display:flex;align-items:center;margin:calc(var(--wcs-base-margin) / 2);padding:calc((var(--wcs-padding) - 8px) / 2) var(--wcs-padding);overflow:initial}:host([overlaydirection=top]) .wcs-select-options{-webkit-transform:translateY(-100%);transform:translateY(-100%);border-left:var(--wcs-select-border-color) solid 1px;border-right:var(--wcs-select-border-color) solid 1px;border-top:var(--wcs-select-border-color) solid 1px;border-top-right-radius:var(--wcs-border-radius);border-top-left-radius:var(--wcs-border-radius)}:host([overlaydirection=bottom]) .wcs-select-options{border-left:var(--wcs-select-border-color) solid 1px;border-right:var(--wcs-select-border-color) solid 1px;border-bottom:var(--wcs-select-border-color) solid 1px;border-bottom-right-radius:var(--wcs-border-radius);border-bottom-left-radius:var(--wcs-border-radius)}.wcs-select-options{display:none;position:absolute;z-index:1;margin:0;max-height:var(--wcs-select-overlay-max-height);overflow-y:auto;background-color:var(--wcs-white);color:var(--wcs-text-medium)}';let Gt=class{constructor(t){r(this,t),this.wcsSelectOptionClick=i(this,"wcsSelectOptionClick",7),this.disabled=!1,this.selected=!1,this.multiple=!1}componentWillLoad(){void 0===this.value&&(this.value=this.el.innerText||"")}componentDidLoad(){this.mdcRipple=new a(this.el)}onMouseDown(t){this.disabled||(t.stopPropagation(),this.wcsSelectOptionClick.emit({source:this.el,value:this.value,displayText:this.el.innerText}))}render(){return t(e,{slot:"wcs-select-option"},this.multiple&&t("wcs-checkbox",{checked:this.selected}),t("slot",null))}get el(){return n(this)}};Gt.style='@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-ripple-surface{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);will-change:transform, opacity;position:relative;outline:none;overflow:hidden}.mdc-ripple-surface::before,.mdc-ripple-surface::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-ripple-surface::before{transition:opacity 15ms linear, background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-ripple-surface::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-ripple-surface.mdc-ripple-upgraded::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface.mdc-ripple-upgraded::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-ripple-surface.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-activation::after{animation:mdc-ripple-fg-radius-in 225ms forwards, mdc-ripple-fg-opacity-in 75ms forwards}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-deactivation::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface::before,.mdc-ripple-surface::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-ripple-surface.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded],.mdc-ripple-upgraded--unbounded{overflow:visible}.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::after,.mdc-ripple-upgraded--unbounded::before,.mdc-ripple-upgraded--unbounded::after{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::before,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{top:var(--mdc-ripple-top, calc(50% - 50%));left:var(--mdc-ripple-left, calc(50% - 50%));width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface::before,.mdc-ripple-surface::after{background-color:#000;background-color:var(--mdc-ripple-color, #000)}.mdc-ripple-surface:hover::before,.mdc-ripple-surface.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}wcs-select-option{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);will-change:transform, opacity;overflow:hidden;display:flex;padding:0 var(--wcs-padding);height:var(--wcs-select-option-height);line-height:42px;cursor:pointer;user-select:none;font-weight:500;font-size:1rem;color:var(--wcs-black)}wcs-select-option::before,wcs-select-option::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}wcs-select-option::before{transition:opacity 15ms linear, background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}wcs-select-option::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}wcs-select-option.mdc-ripple-upgraded::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}wcs-select-option.mdc-ripple-upgraded::after{top:0;left:0;transform:scale(0);transform-origin:center center}wcs-select-option.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}wcs-select-option.mdc-ripple-upgraded--foreground-activation::after{animation:mdc-ripple-fg-radius-in 225ms forwards, mdc-ripple-fg-opacity-in 75ms forwards}wcs-select-option.mdc-ripple-upgraded--foreground-deactivation::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}wcs-select-option::before,wcs-select-option::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}wcs-select-option.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}wcs-select-option::before,wcs-select-option::after{background-color:#999;background-color:var(--mdc-ripple-color, #999)}wcs-select-option:hover::before,wcs-select-option.mdc-ripple-surface--hover::before{opacity:0.1;opacity:var(--mdc-ripple-hover-opacity, 0.1)}wcs-select-option.mdc-ripple-upgraded--background-focused::before,wcs-select-option:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-focus-opacity, 0.2)}wcs-select-option:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}wcs-select-option:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.3;opacity:var(--mdc-ripple-press-opacity, 0.3)}wcs-select-option.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.3)}wcs-select-option:hover{color:var(--wcs-primary);background-color:var(--wcs-light)}wcs-select-option[disabled]{cursor:default;pointer-events:none;color:var(--wcs-text-disabled)}wcs-select-option[selected]{color:var(--wcs-primary);background-color:var(--wcs-light)}wcs-select-option[multiple] wcs-checkbox{pointer-events:none;margin-right:10px}wcs-select-option[multiple]:hover wcs-checkbox{--wcs-checkbox-border-color:var(--wcs-primary)}';export{qt as wcs_select,Gt as wcs_select_option}
15
+ ***************************************************************************** */var u,l,f=function(){return(f=Object.assign||function(t){for(var r,i=1,e=arguments.length;i<e;i++)for(var n in r=arguments[i])Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);return t}).apply(this,arguments)};function d(t,r){var i={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&r.indexOf(e)<0&&(i[e]=t[e]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(e=Object.getOwnPropertySymbols(t);n<e.length;n++)r.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(t,e[n])&&(i[e[n]]=t[e[n]])}return i}function h(t){var r="function"==typeof Symbol&&Symbol.iterator,i=r&&t[r],e=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(t,r){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var e,n,o=i.call(t),s=[];try{for(;(void 0===r||r-- >0)&&!(e=o.next()).done;)s.push(e.value)}catch(t){n={error:t}}finally{try{e&&!e.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return s}function v(t,r,i){if(i||2===arguments.length)for(var e,n=0,o=r.length;n<o;n++)!e&&n in r||(e||(e=Array.prototype.slice.call(r,0,n)),e[n]=r[n]);return t.concat(e||Array.prototype.slice.call(r))}!function(t){t.Start="xstate.start",t.Stop="xstate.stop",t.Raise="xstate.raise",t.Send="xstate.send",t.Cancel="xstate.cancel",t.NullEvent="",t.Assign="xstate.assign",t.After="xstate.after",t.DoneState="done.state",t.DoneInvoke="done.invoke",t.Log="xstate.log",t.Init="xstate.init",t.Invoke="xstate.invoke",t.ErrorExecution="error.execution",t.ErrorCommunication="error.communication",t.ErrorPlatform="error.platform",t.ErrorCustom="xstate.error",t.Update="xstate.update",t.Pure="xstate.pure",t.Choose="xstate.choose"}(u||(u={})),function(t){t.Parent="#_parent",t.Internal="#_internal"}(l||(l={}));var m,y=u.Start,g=u.Stop,b=u.Raise,w=u.Send,x=u.Cancel,O=u.NullEvent,S=u.Assign,k=u.Log,j=u.Init,z=u.Invoke,C=u.ErrorPlatform,E=u.ErrorCustom,_=u.Update,T=u.Choose,N=u.Pure,M={};function L(t,r,i){void 0===i&&(i=".");var e=D(t,i),n=D(r,i);return X(n)?!!X(e)&&n===e:X(e)?e in n:Object.keys(e).every((function(t){return t in n&&L(e[t],n[t])}))}function A(t){try{return X(t)||"number"==typeof t?"".concat(t):t.type}catch(t){throw new Error("Events must be strings or objects with a string event.type property.")}}function I(t,r){try{return G(t)?t:t.toString().split(r)}catch(r){throw new Error("'".concat(t,"' is not a valid state path."))}}function D(t,r){return"object"==typeof(i=t)&&"value"in i&&"context"in i&&"event"in i&&"_event"in i?t.value:G(t)?V(t):"string"!=typeof t?t:V(I(t,r));var i}function V(t){if(1===t.length)return t[0];for(var r={},i=r,e=0;e<t.length-1;e++)e===t.length-2?i[t[e]]=t[e+1]:(i[t[e]]={},i=i[t[e]]);return r}function P(t,r){for(var i={},e=Object.keys(t),n=0;n<e.length;n++){var o=e[n];i[o]=r(t[o],o,t,n)}return i}function J(t,r,i){var e,n,o={};try{for(var s=h(Object.keys(t)),c=s.next();!c.done;c=s.next()){var a=c.value,u=t[a];i(u)&&(o[a]=r(u,a,t))}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return o}var U=function(t){return function(r){var i,e,n=r;try{for(var o=h(t),s=o.next();!s.done;s=o.next())n=n[s.value]}catch(t){i={error:t}}finally{try{s&&!s.done&&(e=o.return)&&e.call(o)}finally{if(i)throw i.error}}return n}};function B(t){return t?X(t)?[[t]]:K(Object.keys(t).map((function(r){var i=t[r];return"string"==typeof i||i&&Object.keys(i).length?B(t[r]).map((function(t){return[r].concat(t)})):[[r]]}))):[[]]}function K(t){var r;return(r=[]).concat.apply(r,v([],p(t),!1))}function W(t){return G(t)?t:[t]}function $(t){return void 0===t?[]:W(t)}function F(t,r,i){var e,n;if(Q(t))return t(r,i.data);var o={};try{for(var s=h(Object.keys(t)),c=s.next();!c.done;c=s.next()){var a=c.value,u=t[a];o[a]=Q(u)?u(r,i.data):u}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return o}function R(t){return t instanceof Promise||!(null===t||!Q(t)&&"object"!=typeof t||!Q(t.then))}function H(t,r){var i,e,n=p([[],[]],2),o=n[0],s=n[1];try{for(var c=h(t),a=c.next();!a.done;a=c.next()){var u=a.value;r(u)?o.push(u):s.push(u)}}catch(t){i={error:t}}finally{try{a&&!a.done&&(e=c.return)&&e.call(c)}finally{if(i)throw i.error}}return[o,s]}function Y(t,r){return P(t.states,(function(t,i){if(t){var e=(X(r)?void 0:r[i])||(t?t.current:void 0);if(e)return{current:e,states:Y(t,e)}}}))}function q(t,r,i,e){return t?i.reduce((function(t,i){var n,o,s=i.assignment,c={state:e,action:i,_event:r},a={};if(Q(s))a=s(t,r.data,c);else try{for(var u=h(Object.keys(s)),l=u.next();!l.done;l=u.next()){var f=l.value,d=s[f];a[f]=Q(d)?d(t,r.data,c):d}}catch(t){n={error:t}}finally{try{l&&!l.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}return Object.assign({},t,a)}),t):t}function G(t){return Array.isArray(t)}function Q(t){return"function"==typeof t}function X(t){return"string"==typeof t}function Z(t,r){if(t)return X(t)?{type:"xstate.guard",name:t,predicate:r?r[t]:void 0}:Q(t)?{type:"xstate.guard",name:t.name,predicate:t}:t}var tt=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function rt(t){return!!t&&"__xstatenode"in t}function it(t,r){return X(t)||"number"==typeof t?f({type:t},r):t}function et(t,r){if(!X(t)&&"$$type"in t&&"scxml"===t.$$type)return t;var i=it(t);return f({name:i.type,data:i,$$type:"scxml",type:"external"},r)}function nt(t,r){return W(r).map((function(r){return void 0===r||"string"==typeof r||rt(r)?{target:r,event:t}:f(f({},r),{event:t})}))}function ot(t,r,i,e,n){var o=t.options.guards,s={state:n,cond:r,_event:e};if("xstate.guard"===r.type)return((null==o?void 0:o[r.name])||r.predicate)(i,e.data,s);var c=null==o?void 0:o[r.type];if(!c)throw new Error("Guard '".concat(r.type,"' is not implemented on machine '").concat(t.id,"'."));return c(i,e.data,s)}function st(t){return"string"==typeof t?{type:t}:t}function ct(t,r,i){if("object"==typeof t)return t;var e=function(){};return{next:t,error:r||e,complete:i||e}}function at(t,r){return"".concat(t,":invocation[").concat(r,"]")}(m={})[tt]=function(){return this},m[Symbol.observable]=function(){return this};var ut=et({type:j});function lt(t,r){return r&&r[t]||void 0}function ft(t,r){var i;if(X(t)||"number"==typeof t)i=Q(e=lt(t,r))?{type:t,exec:e}:e||{type:t,exec:void 0};else if(Q(t))i={type:t.name||t.toString(),exec:t};else{var e;if(Q(e=lt(t.type,r)))i=f(f({},t),{exec:e});else if(e){var n=e.type||t.type;i=f(f(f({},e),t),{type:n})}else i=t}return i}var dt=function(t,r){return t?(G(t)?t:[t]).map((function(t){return ft(t,r)})):[]};function ht(t){var r=ft(t);return f(f({id:X(t)?t:r.id},r),{type:r.type})}function pt(t){return X(t)?{type:b,event:t}:vt(t,{to:l.Internal})}function vt(t,r){return{to:r?r.to:void 0,type:w,event:Q(t)?t:it(t),delay:r?r.delay:void 0,id:r&&void 0!==r.id?r.id:Q(t)?t.name:A(t)}}function mt(t,r){var i="".concat(u.DoneState,".").concat(t);return{type:i,data:r,toString:function(){return i}}}function yt(t,r){var i="".concat(u.DoneInvoke,".").concat(t);return{type:i,data:r,toString:function(){return i}}}function gt(t,r){var i="".concat(u.ErrorPlatform,".").concat(t);return{type:i,data:r,toString:function(){return i}}}function bt(t,r,i,e,n,o){void 0===o&&(o=!1);var s=p(o?[[],n]:H(n,(function(t){return t.type===S})),2),c=s[0],a=s[1],l=c.length?q(i,e,c,r):i,d=o?[i]:void 0;return[K(a.map((function(i){var n;switch(i.type){case b:return{type:b,_event:et(i.event)};case w:return function(t,r,i,e){var n,o={_event:i},s=et(Q(t.event)?t.event(r,i.data,o):t.event);if(X(t.delay)){var c=e&&e[t.delay];n=Q(c)?c(r,i.data,o):c}else n=Q(t.delay)?t.delay(r,i.data,o):t.delay;var a=Q(t.to)?t.to(r,i.data,o):t.to;return f(f({},t),{to:a,_event:s,event:s.data,delay:n})}(i,l,e,t.options.delays);case k:return function(t,r,i){return f(f({},t),{value:X(t.expr)?t.expr:t.expr(r,i.data,{_event:i})})}(i,l,e);case T:if(!(a=null===(n=i.conds.find((function(i){var n=Z(i.cond,t.options.guards);return!n||ot(t,n,l,e,r)})))||void 0===n?void 0:n.actions))return[];var s=p(bt(t,r,l,e,dt($(a),t.options.actions),o),2),c=s[0];return l=s[1],null==d||d.push(l),c;case N:var a;if(!(a=i.get(l,e.data)))return[];var h=p(bt(t,r,l,e,dt($(a),t.options.actions),o),2),m=h[0];return l=h[1],null==d||d.push(l),m;case g:return function(t,r,i){var e=Q(t.activity)?t.activity(r,i.data):t.activity;return{type:u.Stop,activity:"string"==typeof e?{id:e}:e}}(i,l,e);case S:l=q(l,e,[i],r),null==d||d.push(l);break;default:var y=ft(i,t.options.actions),x=y.exec;if(x&&d){var O=d.length-1;y=f(f({},y),{exec:function(t){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];x.apply(void 0,v([d[O]],p(r),!1))}})}return y}})).filter((function(t){return!!t}))),l]}var wt=function(t,r){return r(t)};function xt(t){var r;return(r={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:t}}})[tt]=function(){return this},r}var Ot=function(t){return"atomic"===t.type||"final"===t.type};function St(t){return Object.keys(t.states).map((function(r){return t.states[r]}))}function kt(t){var r=[t];return Ot(t)?r:r.concat(K(St(t).map(kt)))}function jt(t,r){var i,e,n,o,s,c,a,u,l=Ct(new Set(t)),f=new Set(r);try{for(var d=h(f),p=d.next();!p.done;p=d.next())for(var v=(k=p.value).parent;v&&!f.has(v);)f.add(v),v=v.parent}catch(t){i={error:t}}finally{try{p&&!p.done&&(e=d.return)&&e.call(d)}finally{if(i)throw i.error}}var m=Ct(f);try{for(var y=h(f),g=y.next();!g.done;g=y.next())if("compound"!==(k=g.value).type||m.get(k)&&m.get(k).length){if("parallel"===k.type)try{for(var b=(s=void 0,h(St(k))),w=b.next();!w.done;w=b.next()){var x=w.value;"history"!==x.type&&(f.has(x)||(f.add(x),l.get(x)?l.get(x).forEach((function(t){return f.add(t)})):x.initialStateNodes.forEach((function(t){return f.add(t)}))))}}catch(t){s={error:t}}finally{try{w&&!w.done&&(c=b.return)&&c.call(b)}finally{if(s)throw s.error}}}else l.get(k)?l.get(k).forEach((function(t){return f.add(t)})):k.initialStateNodes.forEach((function(t){return f.add(t)}))}catch(t){n={error:t}}finally{try{g&&!g.done&&(o=y.return)&&o.call(y)}finally{if(n)throw n.error}}try{for(var O=h(f),S=O.next();!S.done;S=O.next()){var k;for(v=(k=S.value).parent;v&&!f.has(v);)f.add(v),v=v.parent}}catch(t){a={error:t}}finally{try{S&&!S.done&&(u=O.return)&&u.call(O)}finally{if(a)throw a.error}}return f}function zt(t,r){var i=r.get(t);if(!i)return{};if("compound"===t.type){var e=i[0];if(!e)return{};if(Ot(e))return e.key}var n={};return i.forEach((function(t){n[t.key]=zt(t,r)})),n}function Ct(t){var r,i,e=new Map;try{for(var n=h(t),o=n.next();!o.done;o=n.next()){var s=o.value;e.has(s)||e.set(s,[]),s.parent&&(e.has(s.parent)||e.set(s.parent,[]),e.get(s.parent).push(s))}}catch(t){r={error:t}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return e}function Et(t,r){return zt(t,Ct(jt([t],r)))}function _t(t,r){return Array.isArray(t)?t.some((function(t){return t===r})):t instanceof Set&&t.has(r)}function Tt(t,r){return"compound"===r.type?St(r).some((function(r){return"final"===r.type&&_t(t,r)})):"parallel"===r.type&&St(r).every((function(r){return Tt(t,r)}))}function Nt(t){return new Set(K(t.map((function(t){return t.tags}))))}function Mt(t,r){if(t===r)return!0;if(void 0===t||void 0===r)return!1;if(X(t)||X(r))return t===r;var i=Object.keys(t),e=Object.keys(r);return i.length===e.length&&i.every((function(i){return Mt(t[i],r[i])}))}var Lt=function(){function t(t){var r,i,e=this;this.actions=[],this.activities=M,this.meta={},this.events=[],this.value=t.value,this.context=t.context,this._event=t._event,this._sessionid=t._sessionid,this.event=this._event.data,this.historyValue=t.historyValue,this.history=t.history,this.actions=t.actions||[],this.activities=t.activities||M,this.meta=(void 0===(i=t.configuration)&&(i=[]),i.reduce((function(t,r){return void 0!==r.meta&&(t[r.id]=r.meta),t}),{})),this.events=t.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=t.configuration,this.transitions=t.transitions,this.children=t.children,this.done=!!t.done,this.tags=null!==(r=Array.isArray(t.tags)?new Set(t.tags):t.tags)&&void 0!==r?r:new Set,this.machine=t.machine,Object.defineProperty(this,"nextEvents",{get:function(){return function(t){return v([],p(new Set(K(v([],p(t.map((function(t){return t.ownEvents}))),!1)))),!1)}(e.configuration)}})}return t.from=function(r,i){return r instanceof t?r.context!==i?new t({value:r.value,context:i,_event:r._event,_sessionid:null,historyValue:r.historyValue,history:r.history,actions:[],activities:r.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):r:new t({value:r,context:i,_event:ut,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},t.create=function(r){return new t(r)},t.inert=function(r,i){return r instanceof t?r.actions.length?new t({value:r.value,context:i,_event:ut,_sessionid:null,historyValue:r.historyValue,history:r.history,activities:r.activities,configuration:r.configuration,transitions:[],children:{}}):r:t.from(r,i)},t.prototype.toStrings=function(t,r){var i=this;if(void 0===t&&(t=this.value),void 0===r&&(r="."),X(t))return[t];var e=Object.keys(t);return e.concat.apply(e,v([],p(e.map((function(e){return i.toStrings(t[e],r).map((function(t){return e+r+t}))}))),!1))},t.prototype.toJSON=function(){var t=this.tags,r=d(this,["configuration","transitions","tags","machine"]);return f(f({},r),{tags:Array.from(t)})},t.prototype.matches=function(t){return L(t,this.value)},t.prototype.hasTag=function(t){return this.tags.has(t)},t.prototype.can=function(t){var r,i=null===(r=this.machine)||void 0===r?void 0:r.getTransitionData(this,t);return!!(null==i?void 0:i.transitions.length)&&i.transitions.some((function(t){return void 0!==t.target||t.actions.length}))},t}(),At={deferEvents:!1},It=function(){function t(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=f(f({},At),t)}return t.prototype.initialize=function(t){if(this.initialized=!0,t){if(!this.options.deferEvents)return void this.schedule(t);this.process(t)}this.flushEvents()},t.prototype.schedule=function(t){if(this.initialized&&!this.processingEvent){if(0!==this.queue.length)throw new Error("Event queue should be empty when it is not processing events");this.process(t),this.flushEvents()}else this.queue.push(t)},t.prototype.clear=function(){this.queue=[]},t.prototype.flushEvents=function(){for(var t=this.queue.shift();t;)this.process(t),t=this.queue.shift()},t.prototype.process=function(t){this.processingEvent=!0;try{t()}catch(t){throw this.clear(),t}finally{this.processingEvent=!1}},t}(),Dt=new Map,Vt=0;function Pt(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0}var Jt,Ut={sync:!1,autoForward:!1};!function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(Jt||(Jt={}));var Bt=function(){function t(r,i){var e=this;void 0===i&&(i=t.defaultOptions),this.machine=r,this.scheduler=new It,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=Jt.NotStarted,this.children=new Map,this.forwardTo=new Set,this.init=this.start,this.send=function(t,r){if(G(t))return e.batch(t),e.state;var i=et(it(t,r));if(e.status===Jt.Stopped)return e.state;if(e.status!==Jt.Running&&!e.options.deferEvents)throw new Error('Event "'.concat(i.name,'" was sent to uninitialized service "').concat(e.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: ').concat(JSON.stringify(i.data)));return e.scheduler.schedule((function(){e.forward(i);var t=e.nextState(i);e.update(t,i)})),e._state},this.sendTo=function(t,r){var i,n=e.parent&&(r===l.Parent||e.parent.id===r),o=n?e.parent:X(r)?e.children.get(r)||function(t){return Dt.get(t)}(r):(i=r)&&"function"==typeof i.send?r:void 0;if(o)o.send("machine"in o?f(f({},t),{name:t.name===E?"".concat(gt(e.id)):t.name,origin:e.sessionId}):t.data);else if(!n)throw new Error("Unable to send event to child '".concat(r,"' from service '").concat(e.id,"'."))};var n=f(f({},t.defaultOptions),i),o=n.clock,s=n.logger,c=n.parent,a=n.id;this.id=void 0!==a?a:r.id,this.logger=s,this.clock=o,this.parent=c,this.options=n,this.scheduler=new It({deferEvents:this.options.deferEvents}),this.sessionId="x:".concat(Vt++)}return Object.defineProperty(t.prototype,"initialState",{get:function(){var t=this;return this._initialState?this._initialState:wt(this,(function(){return t._initialState=t.machine.initialState,t._initialState}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),t.prototype.execute=function(t,r){var i,e;try{for(var n=h(t.actions),o=n.next();!o.done;o=n.next())this.exec(o.value,t,r)}catch(t){i={error:t}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(i)throw i.error}}},t.prototype.update=function(t,r){var i,e,n,o,s,c,a,u,l=this;if(t._sessionid=this.sessionId,this._state=t,this.options.execute&&this.execute(this.state),this.children.forEach((function(t){l.state.children[t.id]=t})),this.devTools&&this.devTools.send(r.data,t),t.event)try{for(var f=h(this.eventListeners),d=f.next();!d.done;d=f.next())(0,d.value)(t.event)}catch(t){i={error:t}}finally{try{d&&!d.done&&(e=f.return)&&e.call(f)}finally{if(i)throw i.error}}try{for(var p=h(this.listeners),v=p.next();!v.done;v=p.next())(0,v.value)(t,t.event)}catch(t){n={error:t}}finally{try{v&&!v.done&&(o=p.return)&&o.call(p)}finally{if(n)throw n.error}}try{for(var m=h(this.contextListeners),y=m.next();!y.done;y=m.next())(0,y.value)(this.state.context,this.state.history?this.state.history.context:void 0)}catch(t){s={error:t}}finally{try{y&&!y.done&&(c=m.return)&&c.call(m)}finally{if(s)throw s.error}}var g=Tt(t.configuration||[],this.machine);if(this.state.configuration&&g){var b=t.configuration.find((function(t){return"final"===t.type&&t.parent===l.machine})),w=b&&b.doneData?F(b.doneData,t.context,r):void 0;try{for(var x=h(this.doneListeners),O=x.next();!O.done;O=x.next())(0,O.value)(yt(this.id,w))}catch(t){a={error:t}}finally{try{O&&!O.done&&(u=x.return)&&u.call(x)}finally{if(a)throw a.error}}this.stop()}},t.prototype.onTransition=function(t){return this.listeners.add(t),this.status===Jt.Running&&t(this.state,this.state.event),this},t.prototype.subscribe=function(t,r,i){var e,n=this;if(!t)return{unsubscribe:function(){}};var o=i;return"function"==typeof t?e=t:(e=t.next.bind(t),o=t.complete.bind(t)),this.listeners.add(e),this.status===Jt.Running&&e(this.state),o&&this.onDone(o),{unsubscribe:function(){e&&n.listeners.delete(e),o&&n.doneListeners.delete(o)}}},t.prototype.onEvent=function(t){return this.eventListeners.add(t),this},t.prototype.onSend=function(t){return this.sendListeners.add(t),this},t.prototype.onChange=function(t){return this.contextListeners.add(t),this},t.prototype.onStop=function(t){return this.stopListeners.add(t),this},t.prototype.onDone=function(t){return this.doneListeners.add(t),this},t.prototype.off=function(t){return this.listeners.delete(t),this.eventListeners.delete(t),this.sendListeners.delete(t),this.stopListeners.delete(t),this.doneListeners.delete(t),this.contextListeners.delete(t),this},t.prototype.start=function(t){var r=this;if(this.status===Jt.Running)return this;this.machine._init(),Dt.set(this.sessionId,this),this.initialized=!0,this.status=Jt.Running;var i=void 0===t?this.initialState:wt(this,(function(){return r.machine.resolveState("object"==typeof(i=t)&&null!==i&&"value"in i&&"_event"in i?t:Lt.from(t,r.machine.context));var i}));return this.options.devTools&&this.attachDev(),this.scheduler.initialize((function(){r.update(i,ut)})),this},t.prototype.stop=function(){var t,r,i,e,n,o,s,c,a,u,l=this;try{for(var f=h(this.listeners),d=f.next();!d.done;d=f.next())this.listeners.delete(O=d.value)}catch(r){t={error:r}}finally{try{d&&!d.done&&(r=f.return)&&r.call(f)}finally{if(t)throw t.error}}try{for(var m=h(this.stopListeners),y=m.next();!y.done;y=m.next())(O=y.value)(),this.stopListeners.delete(O)}catch(t){i={error:t}}finally{try{y&&!y.done&&(e=m.return)&&e.call(m)}finally{if(i)throw i.error}}try{for(var g=h(this.contextListeners),b=g.next();!b.done;b=g.next())this.contextListeners.delete(O=b.value)}catch(t){n={error:t}}finally{try{b&&!b.done&&(o=g.return)&&o.call(g)}finally{if(n)throw n.error}}try{for(var w=h(this.doneListeners),x=w.next();!x.done;x=w.next()){var O;this.doneListeners.delete(O=x.value)}}catch(t){s={error:t}}finally{try{x&&!x.done&&(c=w.return)&&c.call(w)}finally{if(s)throw s.error}}if(!this.initialized)return this;v([],p(this.state.configuration),!1).sort((function(t,r){return r.order-t.order})).forEach((function(t){var r,i;try{for(var e=h(t.definition.exit),n=e.next();!n.done;n=e.next())l.exec(n.value,l.state)}catch(t){r={error:t}}finally{try{n&&!n.done&&(i=e.return)&&i.call(e)}finally{if(r)throw r.error}}})),this.children.forEach((function(t){Q(t.stop)&&t.stop()}));try{for(var S=h(Object.keys(this.delayedEventsMap)),k=S.next();!k.done;k=S.next())this.clock.clearTimeout(this.delayedEventsMap[k.value])}catch(t){a={error:t}}finally{try{k&&!k.done&&(u=S.return)&&u.call(S)}finally{if(a)throw a.error}}return this.scheduler.clear(),this.initialized=!1,this.status=Jt.Stopped,Dt.delete(this.sessionId),this},t.prototype.batch=function(t){var r=this;if(this.status===Jt.NotStarted&&this.options.deferEvents);else if(this.status!==Jt.Running)throw new Error("".concat(t.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));this.scheduler.schedule((function(){var i,e,n=r.state,o=!1,s=[],c=function(t){var i=et(t);r.forward(i),n=wt(r,(function(){return r.machine.transition(n,i)})),s.push.apply(s,v([],p(n.actions.map((function(t){return i=n,e=(r=t).exec,f(f({},r),{exec:void 0!==e?function(){return e(i.context,i.event,{action:r,state:i,_event:i._event})}:void 0});var r,i,e}))),!1)),o=o||!!n.changed};try{for(var a=h(t),u=a.next();!u.done;u=a.next())c(u.value)}catch(t){i={error:t}}finally{try{u&&!u.done&&(e=a.return)&&e.call(a)}finally{if(i)throw i.error}}n.changed=o,n.actions=s,r.update(n,et(t[t.length-1]))}))},t.prototype.sender=function(t){return this.send.bind(this,t)},t.prototype.nextState=function(t){var r=this,i=et(t);if(0===i.name.indexOf(C)&&!this.state.nextEvents.some((function(t){return 0===t.indexOf(C)})))throw i.data.data;return wt(this,(function(){return r.machine.transition(r.state,i)}))},t.prototype.forward=function(t){var r,i;try{for(var e=h(this.forwardTo),n=e.next();!n.done;n=e.next()){var o=n.value,s=this.children.get(o);if(!s)throw new Error("Unable to forward event '".concat(t,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(o,"'."));s.send(t)}}catch(t){r={error:t}}finally{try{n&&!n.done&&(i=e.return)&&i.call(e)}finally{if(r)throw r.error}}},t.prototype.defer=function(t){var r=this;this.delayedEventsMap[t.id]=this.clock.setTimeout((function(){t.to?r.sendTo(t._event,t.to):r.send(t._event)}),t.delay)},t.prototype.cancel=function(t){this.clock.clearTimeout(this.delayedEventsMap[t]),delete this.delayedEventsMap[t]},t.prototype.exec=function(t,r,i){void 0===i&&(i=this.machine.options.actions);var e=r.context,n=r._event,o=t.exec||lt(t.type,i),s=Q(o)?o:o?o.exec:t.exec;if(s)try{return s(e,n.data,{action:t,state:this.state,_event:n})}catch(t){throw this.parent&&this.parent.send({type:"xstate.error",data:t}),t}switch(t.type){case w:var c=t;if("number"==typeof c.delay)return void this.defer(c);c.to?this.sendTo(c._event,c.to):this.send(c._event);break;case x:this.cancel(t.sendId);break;case y:if(this.status!==Jt.Running)return;var a=t.activity;if(!this.state.activities[a.id||a.type])break;if(a.type===u.Invoke){var l=st(a.src),f=this.machine.options.services?this.machine.options.services[l.type]:void 0,d=a.id,h=a.data,p="autoForward"in a?a.autoForward:!!a.forward;if(!f)return;var v=h?F(h,e,n):void 0;if("string"==typeof f)return;var m=Q(f)?f(e,n.data,{data:v,src:l,meta:a.meta}):f;if(!m)return;var b=void 0;rt(m)&&(m=v?m.withContext(v):m,b={autoForward:p}),this.spawn(m,d,b)}else this.spawnActivity(a);break;case g:this.stopChild(t.activity.id);break;case k:var O=t.label,S=t.value;O?this.logger(O,S):this.logger(S)}},t.prototype.removeChild=function(t){var r;this.children.delete(t),this.forwardTo.delete(t),null===(r=this.state)||void 0===r||delete r.children[t]},t.prototype.stopChild=function(t){var r=this.children.get(t);r&&(this.removeChild(t),Q(r.stop)&&r.stop())},t.prototype.spawn=function(t,r,i){if(R(t))return this.spawnPromise(Promise.resolve(t),r);if(Q(t))return this.spawnCallback(t,r);if(function(t){try{return"function"==typeof t.send}catch(t){return!1}}(n=t)&&"id"in n)return this.spawnActor(t,r);if(function(t){try{return"subscribe"in t&&Q(t.subscribe)}catch(t){return!1}}(t))return this.spawnObservable(t,r);if(rt(t))return this.spawnMachine(t,f(f({},i),{id:r}));if(null!==(e=t)&&"object"==typeof e&&"transition"in e&&"function"==typeof e.transition)return this.spawnBehavior(t,r);throw new Error('Unable to spawn entity "'.concat(r,'" of type "').concat(typeof t,'".'));var e,n},t.prototype.spawnMachine=function(r,i){var e=this;void 0===i&&(i={});var n=new t(r,f(f({},this.options),{parent:this,id:i.id||r.id})),o=f(f({},Ut),i);o.sync&&n.onTransition((function(t){e.send(_,{state:t,id:n.id})}));var s=n;return this.children.set(n.id,s),o.autoForward&&this.forwardTo.add(n.id),n.onDone((function(t){e.removeChild(n.id),e.send(et(t,{origin:n.id}))})).start(),s},t.prototype.spawnBehavior=function(t,r){var i=function(t,r){void 0===r&&(r={});var i=t.initialState,e=new Set,n=[],o=!1,s=function(t){var r;return f(((r={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}})[tt]=function(){return this},r),t)}({id:r.id,send:function(r){n.push(r),function(){if(!o){for(o=!0;n.length>0;){var r=n.shift();i=t.transition(i,r,c),e.forEach((function(t){return t.next(i)}))}o=!1}}()},getSnapshot:function(){return i},subscribe:function(t,r,n){var o=ct(t,r,n);return e.add(o),o.next(i),{unsubscribe:function(){e.delete(o)}}}}),c={parent:r.parent,self:s,id:r.id||"anonymous",observers:e};return i=t.start?t.start(c):i,s}(t,{id:r,parent:this});return this.children.set(r,i),i},t.prototype.spawnPromise=function(t,r){var i,e,n=this,o=!1;t.then((function(t){o||(e=t,n.removeChild(r),n.send(et(yt(r,t),{origin:r})))}),(function(t){if(!o){n.removeChild(r);var i=gt(r,t);try{n.send(et(i,{origin:r}))}catch(t){n.devTools&&n.devTools.send(i,n.state),n.machine.strict&&n.stop()}}}));var s=((i={id:r,send:function(){},subscribe:function(r,i,e){var n=ct(r,i,e),o=!1;return t.then((function(t){o||(n.next(t),o||n.complete())}),(function(t){o||n.error(t)})),{unsubscribe:function(){return o=!0}}},stop:function(){o=!0},toJSON:function(){return{id:r}},getSnapshot:function(){return e}})[tt]=function(){return this},i);return this.children.set(r,s),s},t.prototype.spawnCallback=function(t,r){var i,e,n,o=this,s=!1,c=new Set,a=new Set;try{n=t((function(t){e=t,a.forEach((function(r){return r(t)})),s||o.send(et(t,{origin:r}))}),(function(t){c.add(t)}))}catch(t){this.send(gt(r,t))}if(R(n))return this.spawnPromise(n,r);var u=((i={id:r,send:function(t){return c.forEach((function(r){return r(t)}))},subscribe:function(t){var r=ct(t);return a.add(r.next),{unsubscribe:function(){a.delete(r.next)}}},stop:function(){s=!0,Q(n)&&n()},toJSON:function(){return{id:r}},getSnapshot:function(){return e}})[tt]=function(){return this},i);return this.children.set(r,u),u},t.prototype.spawnObservable=function(t,r){var i,e,n=this,o=t.subscribe((function(t){e=t,n.send(et(t,{origin:r}))}),(function(t){n.removeChild(r),n.send(et(gt(r,t),{origin:r}))}),(function(){n.removeChild(r),n.send(et(yt(r),{origin:r}))})),s=((i={id:r,send:function(){},subscribe:function(r,i,e){return t.subscribe(r,i,e)},stop:function(){return o.unsubscribe()},getSnapshot:function(){return e},toJSON:function(){return{id:r}}})[tt]=function(){return this},i);return this.children.set(r,s),s},t.prototype.spawnActor=function(t,r){return this.children.set(r,t),t},t.prototype.spawnActivity=function(t){var r=this.machine.options&&this.machine.options.activities?this.machine.options.activities[t.type]:void 0;if(r){var i=r(this.state.context,t);this.spawnEffect(t.id,i)}},t.prototype.spawnEffect=function(t,r){var i;this.children.set(t,((i={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:r||void 0,getSnapshot:function(){},toJSON:function(){return{id:t}}})[tt]=function(){return this},i))},t.prototype.attachDev=function(){var t=Pt();if(this.options.devTools&&t){if(t.__REDUX_DEVTOOLS_EXTENSION__){var r="object"==typeof this.options.devTools?this.options.devTools:void 0;this.devTools=t.__REDUX_DEVTOOLS_EXTENSION__.connect(f(f({name:this.id,autoPause:!0,stateSanitizer:function(t){return{value:t.value,context:t.context,actions:t.actions}}},r),{features:f({jump:!1,skip:!1},r?r.features:void 0)}),this.machine),this.devTools.init(this.state)}!function(t){if(Pt()){var r=function(){var t=Pt();if(t&&"__xstate__"in t)return t.__xstate__}();r&&r.register(t)}}(this)}},t.prototype.toJSON=function(){return{id:this.id}},t.prototype[tt]=function(){return this},t.prototype.getSnapshot=function(){return this.status===Jt.NotStarted?this.initialState:this._state},t.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(t,r){return setTimeout(t,r)},clearTimeout:function(t){return clearTimeout(t)}},logger:console.log.bind(console),devTools:!1},t.interpret=Kt,t}();function Kt(t,r){return new Bt(t,r)}function Wt(t){return f(f({type:z},t),{toJSON:function(){var r,i=d(t,["onDone","onError"]);return f(f({},i),{type:z,src:(r=t.src,"string"==typeof r?{type:r,toString:function(){return r}}:r)})}})}var $t={},Ft=function(t){return"#"===t[0]},Rt=function(){function t(r,i,e,n){var o,s=this;void 0===e&&(e="context"in r?r.context:void 0),this.config=r,this._context=e,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign({actions:{},guards:{},services:{},activities:{},delays:{}},i),this.parent=null==n?void 0:n.parent,this.key=this.config.key||(null==n?void 0:n.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:"."),this.id=this.config.id||v([this.machine.key],p(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:null!==(o=this.config.schema)&&void 0!==o?o:{},this.description=this.config.description,this.initial=this.config.initial,this.states=this.config.states?P(this.config.states,(function(r,i){var e,n=new t(r,{},void 0,{parent:s,key:i});return Object.assign(s.idMap,f(((e={})[n.id]=n,e),n.idMap)),n})):$t;var c=0;!function t(r){var i,e;r.order=c++;try{for(var n=h(St(r)),o=n.next();!o.done;o=n.next())t(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(i)throw i.error}}}(this),this.history=!0===this.config.history?"shallow":this.config.history||!1,this._transient=!!this.config.always||!!this.config.on&&(Array.isArray(this.config.on)?this.config.on.some((function(t){return""===t.event})):""in this.config.on),this.strict=!!this.config.strict,this.onEntry=$(this.config.entry||this.config.onEntry).map((function(t){return ft(t)})),this.onExit=$(this.config.exit||this.config.onExit).map((function(t){return ft(t)})),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=$(this.config.invoke).map((function(t,r){var i,e;if(rt(t)){var n=at(s.id,r);return s.machine.options.services=f(((i={})[n]=t,i),s.machine.options.services),Wt({src:n,id:n})}if(X(t.src))return n=t.id||at(s.id,r),Wt(f(f({},t),{id:n,src:t.src}));if(rt(t.src)||Q(t.src))return n=t.id||at(s.id,r),s.machine.options.services=f(((e={})[n]=t.src,e),s.machine.options.services),Wt(f(f({id:n},t),{src:n}));var o=t.src;return Wt(f(f({id:at(s.id,r)},t),{src:o}))})),this.activities=$(this.config.activities).concat(this.invoke).map((function(t){return ht(t)})),this.transition=this.transition.bind(this),this.tags=$(this.config.tags)}return t.prototype._init=function(){this.__cache.transitions||kt(this).forEach((function(t){return t.on}))},t.prototype.withConfig=function(r,i){var e=this.options,n=e.activities,o=e.guards,s=e.services,c=e.delays;return new t(this.config,{actions:f(f({},e.actions),r.actions),activities:f(f({},n),r.activities),guards:f(f({},o),r.guards),services:f(f({},s),r.services),delays:f(f({},c),r.delays)},null!=i?i:this.context)},t.prototype.withContext=function(r){return new t(this.config,this.options,r)},Object.defineProperty(t.prototype,"context",{get:function(){return Q(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:P(this.states,(function(t){return t.definition})),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){return this.definition},Object.defineProperty(t.prototype,"on",{get:function(){return this.__cache.on?this.__cache.on:this.__cache.on=this.transitions.reduce((function(t,r){return t[r.eventType]=t[r.eventType]||[],t[r.eventType].push(r),t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),t.prototype.getCandidates=function(t){if(this.__cache.candidates[t])return this.__cache.candidates[t];var r=""===t,i=this.transitions.filter((function(i){var e=i.eventType===t;return r?e:e||"*"===i.eventType}));return this.__cache.candidates[t]=i,i},t.prototype.getDelayedTransitions=function(){var t=this,r=this.config.after;if(!r)return[];var i=function(r,i){var e,n,o,s=(e=Q(r)?"".concat(t.id,":delay[").concat(i,"]"):r,o=(n=t.id)?"#".concat(n):"","".concat(u.After,"(").concat(e,")").concat(o));return t.onEntry.push(vt(s,{delay:r})),t.onExit.push({type:x,sendId:s}),s};return(G(r)?r.map((function(t,r){var e=i(t.delay,r);return f(f({},t),{event:e})})):K(Object.keys(r).map((function(t,e){var n=r[t],o=X(n)?{target:n}:n,s=isNaN(+t)?t:+t,c=i(s,e);return $(o).map((function(t){return f(f({},t),{event:c,delay:s})}))})))).map((function(r){var i=r.delay;return f(f({},t.formatTransition(r)),{delay:i})}))},t.prototype.getStateNodes=function(t){var r,i=this;if(!t)return[];var e=t instanceof Lt?t.value:D(t,this.delimiter);if(X(e)){var n=this.getStateNode(e).initial;return void 0!==n?this.getStateNodes(((r={})[e]=n,r)):[this,this.states[e]]}var o=Object.keys(e),s=[this];return s.push.apply(s,v([],p(K(o.map((function(t){return i.getStateNode(t).getStateNodes(e[t])})))),!1)),s},t.prototype.handles=function(t){var r=A(t);return this.events.includes(r)},t.prototype.resolveState=function(t){var r=t instanceof Lt?t:Lt.create(t),i=Array.from(jt([],this.getStateNodes(r.value)));return new Lt(f(f({},r),{value:this.resolve(r.value),configuration:i,done:Tt(i,this),tags:Nt(i),machine:this.machine}))},t.prototype.transitionLeafNode=function(t,r,i){var e=this.getStateNode(t).next(r,i);return e&&e.transitions.length?e:this.next(r,i)},t.prototype.transitionCompoundNode=function(t,r,i){var e=Object.keys(t),n=this.getStateNode(e[0])._transition(t[e[0]],r,i);return n&&n.transitions.length?n:this.next(r,i)},t.prototype.transitionParallelNode=function(t,r,i){var e,n,o={};try{for(var s=h(Object.keys(t)),c=s.next();!c.done;c=s.next()){var a=c.value,u=t[a];if(u){var l=this.getStateNode(a)._transition(u,r,i);l&&(o[a]=l)}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}var f=Object.keys(o).map((function(t){return o[t]})),d=K(f.map((function(t){return t.transitions})));if(!f.some((function(t){return t.transitions.length>0})))return this.next(r,i);var p=K(f.map((function(t){return t.entrySet}))),v=K(Object.keys(o).map((function(t){return o[t].configuration})));return{transitions:d,entrySet:p,exitSet:K(f.map((function(t){return t.exitSet}))),configuration:v,source:r,actions:K(Object.keys(o).map((function(t){return o[t].actions})))}},t.prototype._transition=function(t,r,i){return X(t)?this.transitionLeafNode(t,r,i):1===Object.keys(t).length?this.transitionCompoundNode(t,r,i):this.transitionParallelNode(t,r,i)},t.prototype.getTransitionData=function(t,r){return this._transition(t.value,t,et(r))},t.prototype.next=function(t,r){var i,e,n,o=this,s=r.name,c=[],a=[];try{for(var u=h(this.getCandidates(s)),l=u.next();!l.done;l=u.next()){var f=l.value,d=f.cond,m=f.in,y=t.context,g=!m||(X(m)&&Ft(m)?t.matches(D(this.getStateNodeById(m).path,this.delimiter)):L(D(m,this.delimiter),U(this.path.slice(0,-2))(t.value))),b=!1;try{b=!d||ot(this.machine,d,y,r,t)}catch(t){throw new Error("Unable to evaluate guard '".concat(d.name||d.type,"' in transition for event '").concat(s,"' in state node '").concat(this.id,"':\n").concat(t.message))}if(b&&g){void 0!==f.target&&(a=f.target),c.push.apply(c,v([],p(f.actions),!1)),n=f;break}}}catch(t){i={error:t}}finally{try{l&&!l.done&&(e=u.return)&&e.call(u)}finally{if(i)throw i.error}}if(n){if(!a.length)return{transitions:[n],entrySet:[],exitSet:[],configuration:t.value?[this]:[],source:t,actions:c};var w=K(a.map((function(r){return o.getRelativeStateNodes(r,t.historyValue)}))),x=!!n.internal;return{transitions:[n],entrySet:x?[]:K(w.map((function(t){return o.nodesFromChild(t)}))),exitSet:x?[]:[this],configuration:w,source:t,actions:c}}},t.prototype.nodesFromChild=function(t){if(t.escapes(this))return[];for(var r=[],i=t;i&&i!==this;)r.push(i),i=i.parent;return r.push(this),r},t.prototype.escapes=function(t){if(this===t)return!1;for(var r=this.parent;r;){if(r===t)return!1;r=r.parent}return!0},t.prototype.getActions=function(t,r,i,e){var n,o,s,c,a=jt([],e?this.getStateNodes(e.value):[this]),l=t.configuration.length?jt(a,t.configuration):a;try{for(var f=h(l),d=f.next();!d.done;d=f.next())_t(a,g=d.value)||t.entrySet.push(g)}catch(t){n={error:t}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}try{for(var m=h(a),y=m.next();!y.done;y=m.next()){var g;_t(l,g=y.value)&&!_t(t.exitSet,g.parent)||t.exitSet.push(g)}}catch(t){s={error:t}}finally{try{y&&!y.done&&(c=m.return)&&c.call(m)}finally{if(s)throw s.error}}var b=K(t.entrySet.map((function(e){var n=[];if("final"!==e.type)return n;var o=e.parent;if(!o.parent)return n;n.push(mt(e.id,e.doneData),mt(o.id,e.doneData?F(e.doneData,r,i):void 0));var s=o.parent;return"parallel"===s.type&&St(s).every((function(r){return Tt(t.configuration,r)}))&&n.push(mt(s.id)),n})));t.exitSet.sort((function(t,r){return r.order-t.order})),t.entrySet.sort((function(t,r){return t.order-r.order}));var w=new Set(t.entrySet),x=new Set(t.exitSet),O=p([K(Array.from(w).map((function(t){return v(v([],p(t.activities.map((function(t){return function(t){var r=ht(t);return{type:u.Start,activity:r,exec:void 0}}(t)}))),!1),p(t.onEntry),!1)}))).concat(b.map(pt)),K(Array.from(x).map((function(t){return v(v([],p(t.onExit),!1),p(t.activities.map((function(t){return function(t){var r=Q(t)?t:ht(t);return{type:u.Stop,activity:r,exec:void 0}}(t)}))),!1)})))],2),S=O[0];return dt(O[1].concat(t.actions).concat(S),this.machine.options.actions)},t.prototype.transition=function(t,r,i){void 0===t&&(t=this.initialState);var e,n=et(r);if(t instanceof Lt)e=void 0===i?t:this.resolveState(Lt.from(t,i));else{var o=X(t)?this.resolve(V(this.getResolvedPath(t))):this.resolve(t);e=this.resolveState(Lt.from(o,null!=i?i:this.machine.context))}if(this.strict&&!this.events.includes(n.name)&&!/^(done|error)\./.test(n.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(n.name,"'"));var s=this._transition(e.value,e,n)||{transitions:[],configuration:[],entrySet:[],exitSet:[],source:e,actions:[]},c=jt([],this.getStateNodes(e.value)),a=s.configuration.length?jt(c,s.configuration):c;return s.configuration=v([],p(a),!1),this.resolveTransition(s,e,e.context,n)},t.prototype.resolveRaisedTransition=function(t,r,i){var e,n=t.actions;return(t=this.transition(t,r))._event=i,t.event=i.data,(e=t.actions).unshift.apply(e,v([],p(n),!1)),t},t.prototype.resolveTransition=function(t,r,i,e){var n,o,s=this;void 0===e&&(e=ut);var c=t.configuration,a=!r||t.transitions.length>0,u=a?Et(this.machine,c):void 0,d=r?r.historyValue?r.historyValue:t.source?this.machine.historyValue(r.value):void 0:void 0,v=this.getActions(t,i,e,r),m=r?f({},r.activities):{};try{for(var x=h(v),S=x.next();!S.done;S=x.next()){var k=S.value;k.type===y?m[k.activity.id||k.activity.type]=k:k.type===g&&(m[k.activity.id||k.activity.type]=!1)}}catch(t){n={error:t}}finally{try{S&&!S.done&&(o=x.return)&&o.call(x)}finally{if(n)throw n.error}}var j,C,E=p(bt(this,r,i,e,v,this.machine.config.preserveActionOrder),2),T=E[0],N=E[1],M=p(H(T,(function(t){return t.type===b||t.type===w&&t.to===l.Internal})),2),L=M[0],A=M[1],I=T.filter((function(t){var r;return t.type===y&&(null===(r=t.activity)||void 0===r?void 0:r.type)===z})).reduce((function(t,r){return t[r.activity.id]=function(t,r,i,e){var n,o=st(t.src),s=null===(n=null==r?void 0:r.options.services)||void 0===n?void 0:n[o.type],c=t.data?F(t.data,i,e):void 0,a=s?function(t,r,i){var e=xt(r);if(e.deferred=!0,rt(t)){var n=e.state=wt(void 0,(function(){return(i?t.withContext(i):t).initialState}));e.getSnapshot=function(){return n}}return e}(s,t.id,c):xt(t.id);return a.meta=t,a}(r.activity,s.machine,N,e),t}),r?f({},r.children):{}),D=a?t.configuration:r?r.configuration:[],V=Tt(D,this),P=new Lt({value:u||r.value,context:N,_event:e,_sessionid:r?r._sessionid:null,historyValue:u?d?(j=d,C=u,{current:C,states:Y(j,C)}):void 0:r?r.historyValue:void 0,history:!u||t.source?r:void 0,actions:u?A:[],activities:u?m:r?r.activities:{},events:[],configuration:D,transitions:t.transitions,children:I,done:V,tags:null==r?void 0:r.tags,machine:this}),J=i!==N;P.changed=e.name===_||J;var U=P.history;U&&delete U.history;var B=!V&&(this._transient||c.some((function(t){return t._transient})));if(!(a||B&&""!==e.name))return P;var K=P;if(!V)for(B&&(K=this.resolveRaisedTransition(K,{type:O},e));L.length;){var W=L.shift();K=this.resolveRaisedTransition(K,W._event,e)}var $=K.changed||(U?!!K.actions.length||J||typeof U.value!=typeof K.value||!Mt(K.value,U.value):void 0);return K.changed=$,K.history=U,K.tags=Nt(K.configuration),K},t.prototype.getStateNode=function(t){if(Ft(t))return this.machine.getStateNodeById(t);if(!this.states)throw new Error("Unable to retrieve child state '".concat(t,"' from '").concat(this.id,"'; no child states exist."));var r=this.states[t];if(!r)throw new Error("Child state '".concat(t,"' does not exist on '").concat(this.id,"'"));return r},t.prototype.getStateNodeById=function(t){var r=Ft(t)?t.slice("#".length):t;if(r===this.id)return this;var i=this.machine.idMap[r];if(!i)throw new Error("Child state node '#".concat(r,"' does not exist on machine '").concat(this.id,"'"));return i},t.prototype.getStateNodeByPath=function(t){if("string"==typeof t&&Ft(t))try{return this.getStateNodeById(t.slice(1))}catch(t){}for(var r=I(t,this.delimiter).slice(),i=this;r.length;){var e=r.shift();if(!e.length)break;i=i.getStateNode(e)}return i},t.prototype.resolve=function(t){var r,i=this;if(!t)return this.initialStateValue||$t;switch(this.type){case"parallel":return P(this.initialStateValue,(function(r,e){return r?i.getStateNode(e).resolve(t[e]||r):$t}));case"compound":if(X(t)){var e=this.getStateNode(t);return"parallel"===e.type||"compound"===e.type?((r={})[t]=e.initialStateValue,r):t}return Object.keys(t).length?P(t,(function(t,r){return t?i.getStateNode(r).resolve(t):$t})):this.initialStateValue||{};default:return t||$t}},t.prototype.getResolvedPath=function(t){if(Ft(t)){var r=this.machine.idMap[t.slice("#".length)];if(!r)throw new Error("Unable to find state node '".concat(t,"'"));return r.path}return I(t,this.delimiter)},Object.defineProperty(t.prototype,"initialStateValue",{get:function(){var t,r;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;if("parallel"===this.type)r=J(this.states,(function(t){return t.initialStateValue||$t}),(function(t){return!("history"===t.type)}));else if(void 0!==this.initial){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));r=Ot(this.states[this.initial])?this.initial:((t={})[this.initial]=this.states[this.initial].initialStateValue,t)}else r={};return this.__cache.initialStateValue=r,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),t.prototype.getInitialState=function(t,r){this._init();var i=this.getStateNodes(t);return this.resolveTransition({configuration:i,entrySet:i,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,null!=r?r:this.machine.context,void 0)},Object.defineProperty(t.prototype,"initialState",{get:function(){var t=this.initialStateValue;if(!t)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){var t;if("history"===this.type){var r=this.config;t=X(r.target)&&Ft(r.target)?V(this.machine.getStateNodeById(r.target).path.slice(this.path.length-1)):r.target}return t},enumerable:!1,configurable:!0}),t.prototype.getRelativeStateNodes=function(t,r,i){return void 0===i&&(i=!0),i?"history"===t.type?t.resolveHistory(r):t.initialStateNodes:[t]},Object.defineProperty(t.prototype,"initialStateNodes",{get:function(){var t=this;return Ot(this)?[this]:"compound"!==this.type||this.initial?K(B(this.initialStateValue).map((function(r){return t.getFromRelativePath(r)}))):[this]},enumerable:!1,configurable:!0}),t.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var r=p(t),i=r[0],e=r.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(i,"' from node with no states"));var n=this.getStateNode(i);if("history"===n.type)return n.resolveHistory();if(!this.states[i])throw new Error("Child state '".concat(i,"' does not exist on '").concat(this.id,"'"));return this.states[i].getFromRelativePath(e)},t.prototype.historyValue=function(t){if(Object.keys(this.states).length)return{current:t||this.initialStateValue,states:J(this.states,(function(r,i){if(!t)return r.historyValue();var e=X(t)?void 0:t[i];return r.historyValue(e||r.initialStateValue)}),(function(t){return!t.history}))}},t.prototype.resolveHistory=function(t){var r=this;if("history"!==this.type)return[this];var i=this.parent;if(!t){var e=this.target;return e?K(B(e).map((function(t){return i.getFromRelativePath(t)}))):i.initialStateNodes}var n,o=(n=i.path,"states",function(t){var r,i,e=t;try{for(var o=h(n),s=o.next();!s.done;s=o.next())e=e.states[s.value]}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return e})(t).current;return X(o)?[i.getStateNode(o)]:K(B(o).map((function(t){return"deep"===r.history?i.getFromRelativePath(t):[i.states[t[0]]]})))},Object.defineProperty(t.prototype,"stateIds",{get:function(){var t=this,r=K(Object.keys(this.states).map((function(r){return t.states[r].stateIds})));return[this.id].concat(r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"events",{get:function(){var t,r,i,e;if(this.__cache.events)return this.__cache.events;var n=this.states,o=new Set(this.ownEvents);if(n)try{for(var s=h(Object.keys(n)),c=s.next();!c.done;c=s.next()){var a=n[c.value];if(a.states)try{for(var u=(i=void 0,h(a.events)),l=u.next();!l.done;l=u.next())o.add("".concat(l.value))}catch(t){i={error:t}}finally{try{l&&!l.done&&(e=u.return)&&e.call(u)}finally{if(i)throw i.error}}}}catch(r){t={error:r}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return this.__cache.events=Array.from(o)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ownEvents",{get:function(){var t=new Set(this.transitions.filter((function(t){return!(!t.target&&!t.actions.length&&t.internal)})).map((function(t){return t.eventType})));return Array.from(t)},enumerable:!1,configurable:!0}),t.prototype.resolveTarget=function(t){var r=this;if(void 0!==t)return t.map((function(t){if(!X(t))return t;var i=t[0]===r.delimiter;if(i&&!r.parent)return r.getStateNodeByPath(t.slice(1));var e=i?r.key+t:t;if(!r.parent)return r.getStateNodeByPath(e);try{return r.parent.getStateNodeByPath(e)}catch(t){throw new Error("Invalid transition definition for state node '".concat(r.id,"':\n").concat(t.message))}}))},t.prototype.formatTransition=function(t){var r=this,i=function(t){if(void 0!==t&&""!==t)return $(t)}(t.target),e="internal"in t?t.internal:!i||i.some((function(t){return X(t)&&t[0]===r.delimiter})),n=this.machine.options.guards,o=this.resolveTarget(i),s=f(f({},t),{actions:dt($(t.actions)),cond:Z(t.cond,n),target:o,source:this,internal:e,eventType:t.event,toJSON:function(){return f(f({},s),{target:s.target?s.target.map((function(t){return"#".concat(t.id)})):void 0,source:"#".concat(r.id)})}});return s},t.prototype.formatTransitions=function(){var t,r,i,e=this;if(this.config.on)if(Array.isArray(this.config.on))i=this.config.on;else{var n=this.config.on,o=n["*"],s=void 0===o?[]:o,c=d(n,["*"]);i=K(Object.keys(c).map((function(t){return nt(t,c[t])})).concat(nt("*",s)))}else i=[];var a=this.config.always?nt("",this.config.always):[],u=this.config.onDone?nt(String(mt(this.id)),this.config.onDone):[],l=K(this.invoke.map((function(t){var r=[];return t.onDone&&r.push.apply(r,v([],p(nt(String(yt(t.id)),t.onDone)),!1)),t.onError&&r.push.apply(r,v([],p(nt(String(gt(t.id)),t.onError)),!1)),r}))),f=this.after,m=K(v(v(v(v([],p(u),!1),p(l),!1),p(i),!1),p(a),!1).map((function(t){return $(t).map((function(t){return e.formatTransition(t)}))})));try{for(var y=h(f),g=y.next();!g.done;g=y.next())m.push(g.value)}catch(r){t={error:r}}finally{try{g&&!g.done&&(r=y.return)&&r.call(y)}finally{if(t)throw t.error}}return m},t}();const Ht=({disabled:r,option:i,onRemove:e})=>{const n={};return i.chipColor&&(n.color=i.chipColor),i.chipBackgroundColor&&(n["background-color"]=i.chipBackgroundColor),t("label",{class:"wcs-select-chip",style:n,onClick:t=>t.stopImmediatePropagation()},t("div",null,i.displayText),r?null:t("div",{onClick:()=>e(i)},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"12",viewBox:"0 0 20 12",class:"chip"},t("path",{d:"M2,0 6,4 10,0 12,2 8,6 12,10 10,12 6,8 2,12 0,10 4,6 0,2 2,0",fill:i.chipColor,transform:"translate(8 0)"}))))},Yt={key:"select",initial:"closed",states:{closed:{entry:["close"],on:{CLICK:"opened",OPEN:"opened",OPTION_CLICKED:{actions:["selectOption"]}}},opened:{entry:["open"],on:{CLICK:"closed",CLOSE:"closed",OPTION_CLICKED:{actions:["selectOption"]}}}}};let qt=class{constructor(t){r(this,t),this.wcsChange=i(this,"wcsChange",7),this.wcsFocus=i(this,"wcsFocus",7),this.wcsBlur=i(this,"wcsBlur",7),this.expanded=!1,this.hasLoaded=!1,this.disabled=!1,this.multiple=!1,this.chips=!1,this.compareWith=(t,r)=>o.isEqual(t,r),this.overlayDirection="bottom"}async open(){this.stateService.send("OPEN")}async close(){this.stateService.send("CLOSE")}onValueChangeHandler(t){this.updateSelectedValue(t),this.emitChange(this.value)}updateSelectedValue(t){t||this.reset(),this.multiple?(Array.isArray(t)||(t=[t]),this.values=[],this.options.forEach((r=>{const i=!!t&&-1!==t.findIndex((t=>this.compareWith(r.value,t)));i&&this.values.push({value:r.value,displayText:r.innerText,chipColor:r.chipColor,chipBackgroundColor:r.chipBackgroundColor}),r.selected=i})),this.displayText=0!==this.values.length?this.values.map((t=>t.displayText)).join(", "):void 0):this.options.forEach((r=>{const i=this.compareWith(r.value,t);i&&(this.displayText=r.innerText),r.selected=i}))}reset(){this.values=[],this.displayText=void 0,this.options.forEach((t=>{t.selected=!1}))}componentDidLoad(){this.optionsEl=this.el.shadowRoot.querySelector(".wcs-select-options"),this.controlEl=this.el.shadowRoot.querySelector(".wcs-select-control");const t=(r=Yt,i=this.initMachineOptions(),void 0===e&&(e=r.context),new Rt(r,i,e));var r,i,e;this.stateService=Kt(t),this.multiple&&(this.values=[]),this.addRippleEffect(),this.stateService.start(),null===this.optionsEl.querySelector("slot")&&(this.replaceOptions_firefoxBefore63(),this.listenDomUpdate_firefoxBefore63()),void 0!==this.value&&this.updateSelectedValue(this.value),this.hasLoaded=!0}emitChange(t){this.wcsChange.emit({value:t})}replaceOptions_firefoxBefore63(){Array.from(this.el.querySelectorAll("wcs-select-option")).forEach((t=>{t.parentNode===this.el&&(this.el.removeChild(t),this.optionsEl.appendChild(t))}))}listenDomUpdate_firefoxBefore63(){new MutationObserver((t=>{for(const r of t)"childList"===r.type&&this.replaceOptions_firefoxBefore63()})).observe(this.el,{childList:!0})}componentWillUpdate(){this.multiple&&this.options.forEach((t=>t.multiple=!0))}get options(){var t;const r=null===(t=this.el)||void 0===t?void 0:t.querySelectorAll("wcs-select-option");return r&&0!==r.length?r:[]}initMachineOptions(){return{actions:{open:()=>{this.disabled||(this.updateOverlayDirection(),this.expanded=!0,this.focused=!0)},close:()=>{this.focused=!0,this.expanded=!1},selectOption:(t,r)=>{"OPTION_CLICKED"===r.type&&this.handleClickEvent(r.value)}},guards:{enabled:()=>!this.disabled}}}updateOverlayDirection(){const t=+getComputedStyle(this.el).getPropertyValue("--wcs-select-overlay-max-height").replace(/\D/g,""),r=+getComputedStyle(this.el).getPropertyValue("--wcs-select-option-height").replace(/\D/g,""),i=this.el.getBoundingClientRect(),e=Math.floor(t/r),n=window.innerHeight-(i.y+i.height+(this.options.length>e?t+1:this.options.length*r+1));this.overlayDirection=n<0?"top":"bottom"}updateOverlayMargin(){this.controlEl&&this.optionsEl&&(this.optionsEl.style.marginTop="top"===this.overlayDirection?"-"+this.controlEl.getBoundingClientRect().height+"px":"0")}handleClickEvent(t){this.multiple?this.handleClickOnMultiple(t):this.handleNormalClick(t)}handleClickOnMultiple(t){const r=this.values.findIndex((r=>r.value===t.value));if(-1===r){const{value:r,displayText:i,chipColor:e,chipBackgroundColor:n}=t;this.values.push({value:r,displayText:i,chipColor:e,chipBackgroundColor:n}),t.source.selected=!0}else t.source.selected=!1,this.values.splice(r,1);this.updateValueWithValues()}updateValueWithValues(){this.value=this.values.map((t=>t.value)),this.displayText=0!==this.values.length?this.values.map((t=>t.displayText)).join(", "):void 0}handleNormalClick(t){this.options.forEach((t=>{t.selected&&(t.selected=!1)})),t.source.selected=!0,this.value=t.value,this.displayText=t.displayText,this.stateService.send("CLOSE")}disconnectedCallback(){this.stateService.stop()}addRippleEffect(){new a(this.controlEl).unbounded=!1}get hasValue(){return void 0!==this.displayText}onMouseDown(t){const r=c(t.target)&&(t.offsetX>t.target.clientWidth||t.offsetY>t.target.clientHeight||t.offsetY<0),i=t.composedPath().filter((t=>"svg"===t.nodeName&&t.classList.contains("chip"))).length>0;r||i||this.stateService.send("CLICK")}onWindowClickEvent(t){const r=-1!==t.composedPath().map((t=>t.nodeName)).indexOf("WCS-SELECT");this.expanded&&!r&&this.stateService.send("CLOSE")}selectedOptionChanged(t){this.sendOptionClickedToStateMachine(t.detail)}sendOptionClickedToStateMachine(t){this.stateService.send({type:"OPTION_CLICKED",value:t})}onSlotchange(){this.updateSelectedValue(this.value)}removeChip(t){this.options.forEach((r=>{r.value===t.value&&this.sendOptionClickedToStateMachine(Object.assign(Object.assign({},t),{source:r}))}))}render(){return this.hasLoaded&&this.updateStyles(),this.updateOverlayMargin(),t(e,Object.assign({class:this.expanded?"expanded ":"",overlayDirection:this.overlayDirection},this.focusedAttributes()),t("div",{class:"wcs-select-control"},this.hasValue?this.chips?this.values.map((r=>t(Ht,{disabled:this.disabled,option:r,onRemove:this.removeChip.bind(this)}))):t("label",{class:"wcs-select-value"},this.displayText):t("label",{class:"wcs-select-placeholder"},this.placeholder),t(s,{up:this.expanded})),t("div",{class:"wcs-select-options"},t("slot",{name:"wcs-select-option",onSlotchange:this.onSlotchange.bind(this)})))}updateStyles(){this.optionsEl.setAttribute("style",`width: ${Math.ceil(this.el.offsetWidth-2)}px;`)}focusedAttributes(){return this.disabled?{}:{tabIndex:0}}get el(){return n(this)}static get watchers(){return{value:["onValueChangeHandler"]}}};qt.style='@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-ripple-surface{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);will-change:transform, opacity;position:relative;outline:none;overflow:hidden}.mdc-ripple-surface::before,.mdc-ripple-surface::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-ripple-surface::before{transition:opacity 15ms linear, background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-ripple-surface::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-ripple-surface.mdc-ripple-upgraded::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface.mdc-ripple-upgraded::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-ripple-surface.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-activation::after{animation:mdc-ripple-fg-radius-in 225ms forwards, mdc-ripple-fg-opacity-in 75ms forwards}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-deactivation::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface::before,.mdc-ripple-surface::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-ripple-surface.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded],.mdc-ripple-upgraded--unbounded{overflow:visible}.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::after,.mdc-ripple-upgraded--unbounded::before,.mdc-ripple-upgraded--unbounded::after{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::before,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{top:var(--mdc-ripple-top, calc(50% - 50%));left:var(--mdc-ripple-left, calc(50% - 50%));width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface::before,.mdc-ripple-surface::after{background-color:#000;background-color:var(--mdc-ripple-color, #000)}.mdc-ripple-surface:hover::before,.mdc-ripple-surface.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}:host{--wcs-select-ligther-percentage:40;--wcs-select-border-radius:var(--wcs-border-radius);--wcs-select-background-color:var(--wcs-light);--wcs-select-placeholder-color:var(--wcs-text-medium);--wcs-select-value-color:var(--wcs-primary);--wcs-select-border-color:transparent;--wcs-select-overlay-max-height:360px;--wcs-select-option-height:42px;display:block;position:relative;outline:none;user-select:none}:host svg{flex-shrink:0}:host .arrow{fill:var(--wcs-select-value-color)}:host .chip{fill:var(--wcs-contrast);opacity:calc((100 - var(--wcs-select-ligther-percentage)) / 100)}:host .chip:hover{opacity:100}:host([class~=expanded][overlaydirection=top]) .wcs-select-control{border:var(--wcs-select-border-color) solid 1px;border-top-left-radius:0;border-top-right-radius:0}:host([class~=expanded][overlaydirection=bottom]) .wcs-select-control{border:var(--wcs-select-border-color) solid 1px;border-bottom-left-radius:0;border-bottom-right-radius:0}:host(.expanded){--wcs-select-border-color:var(--wcs-text-light)}:host(.expanded) .wcs-select-options{display:block}:host(:not(.expanded):focus) .wcs-select-control{border:var(--wcs-primary) solid 1px}:host([disabled]) .wcs-select-control,:host([disabled]) label{cursor:default;pointer-events:none}:host([disabled]) label{color:var(--wcs-text-disabled)}:host([disabled]) .arrow{fill:var(--wcs-text-medium)}label{padding:calc(var(--wcs-padding) / 2) var(--wcs-padding);font-weight:500;cursor:pointer;color:var(--wcs-select-color);transition:color 125ms ease-in;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host([chips]) .wcs-select-control{flex-wrap:wrap}.wcs-select-control{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);will-change:transform, opacity;overflow:hidden;display:flex;align-items:center;padding-right:var(--wcs-text-padding);background-color:var(--wcs-select-background-color);border-radius:var(--wcs-select-border-radius);border:var(--wcs-select-border-color) solid 1px;font-size:1rem;line-height:1.5;cursor:pointer}.wcs-select-control::before,.wcs-select-control::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.wcs-select-control::before{transition:opacity 15ms linear, background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.wcs-select-control::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.wcs-select-control.mdc-ripple-upgraded::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.wcs-select-control.mdc-ripple-upgraded::after{top:0;left:0;transform:scale(0);transform-origin:center center}.wcs-select-control.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.wcs-select-control.mdc-ripple-upgraded--foreground-activation::after{animation:mdc-ripple-fg-radius-in 225ms forwards, mdc-ripple-fg-opacity-in 75ms forwards}.wcs-select-control.mdc-ripple-upgraded--foreground-deactivation::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.wcs-select-control::before,.wcs-select-control::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.wcs-select-control.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.wcs-select-control::before,.wcs-select-control::after{background-color:#999;background-color:var(--mdc-ripple-color, #999)}.wcs-select-control:hover::before,.wcs-select-control.mdc-ripple-surface--hover::before{opacity:0.1;opacity:var(--mdc-ripple-hover-opacity, 0.1)}.wcs-select-control.mdc-ripple-upgraded--background-focused::before,.wcs-select-control:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-focus-opacity, 0.2)}.wcs-select-control:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.wcs-select-control:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.3;opacity:var(--mdc-ripple-press-opacity, 0.3)}.wcs-select-control.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.3)}.wcs-select-placeholder{color:var(--wcs-select-placeholder-color);font-style:italic;font-weight:400}.wcs-select-value{color:var(--wcs-select-value-color);font-weight:var(--wcs-font-weight-form-value)}.wcs-select-chip{color:var(--wcs-contrast);background-color:var(--wcs-base);border-radius:0.75rem;display:flex;align-items:center;margin:calc(var(--wcs-base-margin) / 2);padding:calc((var(--wcs-padding) - 8px) / 2) var(--wcs-padding);overflow:initial}:host([overlaydirection=top]) .wcs-select-options{-webkit-transform:translateY(-100%);transform:translateY(-100%);border-left:var(--wcs-select-border-color) solid 1px;border-right:var(--wcs-select-border-color) solid 1px;border-top:var(--wcs-select-border-color) solid 1px;border-top-right-radius:var(--wcs-border-radius);border-top-left-radius:var(--wcs-border-radius)}:host([overlaydirection=bottom]) .wcs-select-options{border-left:var(--wcs-select-border-color) solid 1px;border-right:var(--wcs-select-border-color) solid 1px;border-bottom:var(--wcs-select-border-color) solid 1px;border-bottom-right-radius:var(--wcs-border-radius);border-bottom-left-radius:var(--wcs-border-radius)}.wcs-select-options{display:none;position:absolute;z-index:1;margin:0;max-height:var(--wcs-select-overlay-max-height);overflow-y:auto;background-color:var(--wcs-white);color:var(--wcs-text-medium)}';let Gt=class{constructor(t){r(this,t),this.wcsSelectOptionClick=i(this,"wcsSelectOptionClick",7),this.disabled=!1,this.selected=!1,this.multiple=!1}componentWillLoad(){void 0===this.value&&(this.value=this.el.innerText||"")}componentDidLoad(){this.mdcRipple=new a(this.el)}onMouseDown(t){this.disabled||(t.stopPropagation(),this.wcsSelectOptionClick.emit({source:this.el,value:this.value,displayText:this.el.innerText}))}render(){return t(e,{slot:"wcs-select-option"},this.multiple&&t("wcs-checkbox",{checked:this.selected}),t("slot",null))}get el(){return n(this)}};Gt.style='@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-ripple-surface{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);will-change:transform, opacity;position:relative;outline:none;overflow:hidden}.mdc-ripple-surface::before,.mdc-ripple-surface::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-ripple-surface::before{transition:opacity 15ms linear, background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-ripple-surface::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-ripple-surface.mdc-ripple-upgraded::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface.mdc-ripple-upgraded::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-ripple-surface.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-activation::after{animation:mdc-ripple-fg-radius-in 225ms forwards, mdc-ripple-fg-opacity-in 75ms forwards}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-deactivation::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface::before,.mdc-ripple-surface::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-ripple-surface.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded],.mdc-ripple-upgraded--unbounded{overflow:visible}.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::after,.mdc-ripple-upgraded--unbounded::before,.mdc-ripple-upgraded--unbounded::after{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::before,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{top:var(--mdc-ripple-top, calc(50% - 50%));left:var(--mdc-ripple-left, calc(50% - 50%));width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface::before,.mdc-ripple-surface::after{background-color:#000;background-color:var(--mdc-ripple-color, #000)}.mdc-ripple-surface:hover::before,.mdc-ripple-surface.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}wcs-select-option{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);will-change:transform, opacity;overflow:hidden;display:flex;padding:0 var(--wcs-padding);height:var(--wcs-select-option-height);line-height:42px;cursor:pointer;user-select:none;font-weight:500;font-size:1rem;color:var(--wcs-black)}wcs-select-option::before,wcs-select-option::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}wcs-select-option::before{transition:opacity 15ms linear, background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}wcs-select-option::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}wcs-select-option.mdc-ripple-upgraded::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}wcs-select-option.mdc-ripple-upgraded::after{top:0;left:0;transform:scale(0);transform-origin:center center}wcs-select-option.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}wcs-select-option.mdc-ripple-upgraded--foreground-activation::after{animation:mdc-ripple-fg-radius-in 225ms forwards, mdc-ripple-fg-opacity-in 75ms forwards}wcs-select-option.mdc-ripple-upgraded--foreground-deactivation::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}wcs-select-option::before,wcs-select-option::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}wcs-select-option.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}wcs-select-option::before,wcs-select-option::after{background-color:#999;background-color:var(--mdc-ripple-color, #999)}wcs-select-option:hover::before,wcs-select-option.mdc-ripple-surface--hover::before{opacity:0.1;opacity:var(--mdc-ripple-hover-opacity, 0.1)}wcs-select-option.mdc-ripple-upgraded--background-focused::before,wcs-select-option:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-focus-opacity, 0.2)}wcs-select-option:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}wcs-select-option:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.3;opacity:var(--mdc-ripple-press-opacity, 0.3)}wcs-select-option.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.3)}wcs-select-option:hover{color:var(--wcs-primary);background-color:var(--wcs-light)}wcs-select-option[disabled]{cursor:default;pointer-events:none;color:var(--wcs-text-disabled)}wcs-select-option[selected]{color:var(--wcs-primary);background-color:var(--wcs-light)}wcs-select-option[multiple] wcs-checkbox{pointer-events:none;margin-right:10px}wcs-select-option[multiple]:hover wcs-checkbox{--wcs-checkbox-border-color:var(--wcs-primary)}';export{qt as wcs_select,Gt as wcs_select_option}
@@ -0,0 +1 @@
1
+ import{r as o,c as t,h as e,H as r}from"./p-255365bc.js";import{S as s}from"./p-c09e5b82.js";let n=class{constructor(e){o(this,e),this.wcsOpenChange=t(this,"wcsOpenChange",7),this.open=!1,this.hideActionText=!1,this.highlight=!1,this.groupContentWithHeader=!1}openChange(o){this.wcsOpenChange.emit(o)}async close(){this.open=!1}render(){return e(r,null,e("button",{"aria-expanded":this.open?"true":"false","aria-controls":"content",class:"header",onClick:()=>this.open=!this.open},e("slot",{name:"header"}),e("span",{class:"header-action"},!this.hideActionText&&e("span",null,this.open?"Fermez":"Ouvrez"),e(s,{up:this.open}))),e("div",{class:"content",id:"content"},e("slot",{name:"content"})))}static get watchers(){return{open:["openChange"]}}};n.style=":host{display:flex;flex-direction:column;cursor:pointer;margin-bottom:16px}:host .header{display:flex;align-items:center;justify-content:space-between;padding:14px 24px;border-radius:7px;font-weight:500;font-size:16px;color:var(--wcs-primary);background-color:var(--wcs-light);border:none}@media (forced-colors: active){:host .header{border:1px solid ButtonBorder}}:host .header:focus-visible{outline:2px solid var(--wcs-primary)}:host .header-action{display:flex;align-items:center;user-select:none}:host .header-action .arrow{fill:var(--wcs-primary)}:host .content{display:none}:host([open]){margin-bottom:0}:host([open]) .content{display:block}:host([open]):host([group-content-with-header]) .header{border-radius:7px 7px 0 0;padding-bottom:0}:host([open]):host([group-content-with-header]) .content{border-radius:0 0 7px 7px;margin-bottom:14px;background-color:var(--wcs-light)}:host([open]):host([highlight]) .header{background-color:var(--wcs-primary);color:var(--wcs-light)}:host([open]):host([highlight]) .arrow{fill:var(--wcs-light)}:host([open]):host([highlight]):host([group-content-with-header]) .content{background-color:var(--wcs-primary);color:var(--wcs-light)}";export{n as wcs_accordion_panel}
@@ -1 +1 @@
1
- import{r as t,h as o,H as s,g as i}from"./p-255365bc.js";import{S as r}from"./p-1421429d.js";import{c as e}from"./p-cf4d7a83.js";import{c as p}from"./p-e4fdcd1f.js";let a=class{constructor(o){t(this,o),this.noArrow=!1,this.mode="stroked",this.shape="normal",this.disabled=!1,this.placement="bottom-end",this.expanded=!1}placementChange(){this.popper.setOptions(Object.assign(Object.assign({},this.popper.state.options),{placement:this.placement})).then((()=>this.popper.update()))}componentDidLoad(){const t=this.el.shadowRoot.querySelector("wcs-button"),o=t.shadowRoot.querySelector("button");this.buttonTextColor=window.getComputedStyle(o).color;const s=this.el.shadowRoot.querySelector(".popover");this.popper=p(t,s,{placement:this.placement,modifiers:[{name:"offset",options:{offset:[0,8]}}]}),this.noArrow||(this.el.shadowRoot.querySelector(".arrow").style.fill=this.buttonTextColor),this.fixForFirefoxBelow63()}fixForFirefoxBelow63(){const t=this.el.querySelectorAll("wcs-dropdown-item"),o=this.el.querySelector(".container");t.length>0&&o&&t.forEach((t=>{this.el.removeChild(t),o.appendChild(t)}))}onButtonClick(t){this.expanded=!this.expanded}onWindowClickEvent(t){const o=e(t,this.el);this.expanded&&!o&&(this.expanded=!1)}dropdownItemClick(t){this.expanded=!1}componentDidRender(){this.popper&&this.popper.update(),this.noArrow||(this.el.shadowRoot.querySelector(".arrow").style.fill=this.buttonTextColor)}render(){return o(s,null,o("wcs-button",{mode:this.mode,shape:this.shape,disabled:this.disabled,onClick:t=>this.onButtonClick(t)},o("div",{class:"wcs-button-content-wrapper"},o("slot",{name:"placeholder"}),this.noArrow?null:o(r,{up:this.expanded}))),o("div",{class:(this.expanded?"show ":"")+"popover"},o("div",{id:"arrow","data-popper-arrow":!0}),o("div",{class:"container"},o("slot",{name:"item"}))))}get el(){return i(this)}static get watchers(){return{placement:["placementChange"]}}};a.style=':host{display:flex}wcs-button{--wcs-button-padding:8px 10px 8px 16px !important}:host([no-arrow]) wcs-button{--wcs-button-padding:8px 16px 8px 16px !important}:host([shape=small]) wcs-button{--wcs-button-padding:2px 10px 2px 16px !important}:host([shape=small][no-arrow]) wcs-button{--wcs-button-padding:2px 16px 2px 16px !important}.wcs-button-content-wrapper{display:flex}.popover{display:none;border:1px solid #d7d7d7;border-radius:var(--wcs-border-radius);background-color:var(--wcs-white);z-index:9999}.show{display:block}.container{border-radius:inherit;overflow:hidden;padding:calc(var(--wcs-padding) / 2) 0;background-color:var(--wcs-white)}#arrow,#arrow::before{position:absolute;width:8px;height:8px;background:inherit;border:solid 1px #d7d7d7}#arrow{visibility:hidden;z-index:-1}#arrow::before{visibility:visible;content:"";transform:rotate(45deg)}.popover[data-popper-placement^=top]>#arrow{bottom:-5px}.popover[data-popper-placement^=bottom]>#arrow{top:-6px}.popover[data-popper-placement^=left]>#arrow{right:-4px}.popover[data-popper-placement^=right]>#arrow{left:-6px}';export{a as wcs_dropdown}
1
+ import{r as t,h as o,H as s,g as i}from"./p-255365bc.js";import{S as r}from"./p-c09e5b82.js";import{c as e}from"./p-cf4d7a83.js";import{c as p}from"./p-e4fdcd1f.js";let a=class{constructor(o){t(this,o),this.noArrow=!1,this.mode="stroked",this.shape="normal",this.disabled=!1,this.placement="bottom-end",this.expanded=!1}placementChange(){this.popper.setOptions(Object.assign(Object.assign({},this.popper.state.options),{placement:this.placement})).then((()=>this.popper.update()))}componentDidLoad(){const t=this.el.shadowRoot.querySelector("wcs-button"),o=t.shadowRoot.querySelector("button");this.buttonTextColor=window.getComputedStyle(o).color;const s=this.el.shadowRoot.querySelector(".popover");this.popper=p(t,s,{placement:this.placement,modifiers:[{name:"offset",options:{offset:[0,8]}}]}),this.noArrow||(this.el.shadowRoot.querySelector(".arrow").style.fill=this.buttonTextColor),this.fixForFirefoxBelow63()}fixForFirefoxBelow63(){const t=this.el.querySelectorAll("wcs-dropdown-item"),o=this.el.querySelector(".container");t.length>0&&o&&t.forEach((t=>{this.el.removeChild(t),o.appendChild(t)}))}onButtonClick(t){this.expanded=!this.expanded}onWindowClickEvent(t){const o=e(t,this.el);this.expanded&&!o&&(this.expanded=!1)}dropdownItemClick(t){this.expanded=!1}componentDidRender(){this.popper&&this.popper.update(),this.noArrow||(this.el.shadowRoot.querySelector(".arrow").style.fill=this.buttonTextColor)}render(){return o(s,null,o("wcs-button",{mode:this.mode,shape:this.shape,disabled:this.disabled,onClick:t=>this.onButtonClick(t)},o("div",{class:"wcs-button-content-wrapper"},o("slot",{name:"placeholder"}),this.noArrow?null:o(r,{up:this.expanded}))),o("div",{class:(this.expanded?"show ":"")+"popover"},o("div",{id:"arrow","data-popper-arrow":!0}),o("div",{class:"container"},o("slot",{name:"item"}))))}get el(){return i(this)}static get watchers(){return{placement:["placementChange"]}}};a.style=':host{display:flex}wcs-button{--wcs-button-padding:8px 10px 8px 16px !important}:host([no-arrow]) wcs-button{--wcs-button-padding:8px 16px 8px 16px !important}:host([shape=small]) wcs-button{--wcs-button-padding:2px 10px 2px 16px !important}:host([shape=small][no-arrow]) wcs-button{--wcs-button-padding:2px 16px 2px 16px !important}.wcs-button-content-wrapper{display:flex}.popover{display:none;border:1px solid #d7d7d7;border-radius:var(--wcs-border-radius);background-color:var(--wcs-white);z-index:9999}.show{display:block}.container{border-radius:inherit;overflow:hidden;padding:calc(var(--wcs-padding) / 2) 0;background-color:var(--wcs-white)}#arrow,#arrow::before{position:absolute;width:8px;height:8px;background:inherit;border:solid 1px #d7d7d7}#arrow{visibility:hidden;z-index:-1}#arrow::before{visibility:visible;content:"";transform:rotate(45deg)}.popover[data-popper-placement^=top]>#arrow{bottom:-5px}.popover[data-popper-placement^=bottom]>#arrow{top:-6px}.popover[data-popper-placement^=left]>#arrow{right:-4px}.popover[data-popper-placement^=right]>#arrow{left:-6px}';export{a as wcs_dropdown}
@@ -0,0 +1 @@
1
+ import{r as t,c as s,f as i,h as e,H as n,g as o}from"./p-255365bc.js";import{l as r}from"./p-adef7aaf.js";function h(t){switch(t){case"asc":return 1;case"desc":return-1}}var a,l=new Uint8Array(16);function c(){if(!a&&!(a="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return a(l)}const d=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function u(t){return"string"==typeof t&&d.test(t)}for(var g=[],p=0;p<256;++p)g.push((p+256).toString(16).substr(1));function f(t,s,i){var e=(t=t||{}).random||(t.rng||c)();if(e[6]=15&e[6]|64,e[8]=63&e[8]|128,s){i=i||0;for(var n=0;n<16;++n)s[i+n]=e[n];return s}return function(t){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(g[t[s+0]]+g[t[s+1]]+g[t[s+2]]+g[t[s+3]]+"-"+g[t[s+4]]+g[t[s+5]]+"-"+g[t[s+6]]+g[t[s+7]]+"-"+g[t[s+8]]+g[t[s+9]]+"-"+g[t[s+10]]+g[t[s+11]]+g[t[s+12]]+g[t[s+13]]+g[t[s+14]]+g[t[s+15]]).toLowerCase();if(!u(i))throw TypeError("Stringified UUID is invalid");return i}(e)}let m=class{constructor(i){t(this,i),this.wcsGridSelectionChange=s(this,"wcsGridSelectionChange",7),this.wcsGridAllSelectionChange=s(this,"wcsGridAllSelectionChange",7),this.selectionConfig="none",this.selectedItems=[],this.rows=[]}onDataChange(t){this.updateGridRows(t),this.refreshSort(!1)}onSelectedItemsPropertyChange(t){this.updateSelectionWithValues(t)}onHiddenColumnChange(){i(this)}updateSelectionWithValues(t){if("single"===this.selectionConfig){this.rows.map((t=>t.selected=!1));for(const s of this.rows)if(r.isEqual(s.data,t)){s.selected=!0;break}}else if("multiple"===this.selectionConfig){this.rows.map((t=>t.selected=!1));for(const s of this.rows)t.find((t=>r.isEqual(t,s.data)))&&(s.selected=!0)}this.rows=r.cloneDeep(this.rows)}wcsGridRowToWcsGridRowData(t){return{selected:t.selected,page:t.page,data:t.data}}updateGridRows(t){const s=[];if(t&&this.columns){for(let i=0;i<t.length;i++){const e={uuid:f(),data:t[i],selected:!1,cells:[]};for(const s of this.columns)e.cells.push({content:r.get(t[i],s.path),column:s,formatter:s.formatter});s.push(e)}this.rows=s,this.updatePageIndex()}}componentDidLoad(){this.columns=this.getGridColumnsFromTemplate(),this.paginationEl=this.wcsGridPaginationId?document.getElementById(this.wcsGridPaginationId):this.getGridPaginationsFromTemplate()[0],this.updateGridRows(this.data),this.selectedItems&&this.updateSelectionWithValues(this.selectedItems),this.refreshSort(!0)}refreshSort(t){const[s,...i]=this.columns.filter((t=>"none"!==t.sortOrder));s&&!this.serverMode&&this.sortBy(s),t&&this.disableSortOrderForColumns(i)}disableSortOrderForColumns(t){null==t||t.forEach((t=>t.sortOrder="none"))}getGridColumnsFromTemplate(){return this.el.shadowRoot.querySelector('slot[name="grid-column"]').assignedElements()}getGridPaginationsFromTemplate(){return this.el.shadowRoot.querySelector('slot[name="grid-pagination"]').assignedElements()}sortChangeEventHandler(t){"none"!==t.detail.order&&(this.disableSortOrderForColumns(this.columns.filter((s=>s!==t.detail.column))),this.serverMode||(this.sortBy(t.detail.column),this.updatePageIndex()))}sortBy(t){this.rows=t.sortFn?r.cloneDeep(this.rows).sort(((s,i)=>t.sortFn(s.data,i.data,t)*h(t.sortOrder))):r.cloneDeep(this.rows).sort(((s,i)=>{const e=t.path;return(r.get(s.data,e)<r.get(i.data,e)?-1:r.get(s.data,e)>r.get(i.data,e)?1:0)*h(t.sortOrder)}))}updatePageIndex(){if(!this.serverMode&&this.paginationEl){this.paginationEl.currentPage+1>this.paginationEl.pageCount&&(this.paginationEl.currentPage=this.paginationEl.pageCount-1),this.paginationEl.itemsCount=this.data.length,this.paginationEl.pageCount=Math.ceil(this.data.length/this.paginationEl.pageSize);const t=r.cloneDeep(this.rows);t.forEach(((t,s)=>t.page=Math.floor(s/this.paginationEl.pageSize))),this.rows=[...t]}}paginationChangeEventHandler(){this.onPaginationChange()}paginationChangeEventHandlerOutside(t){this.wcsGridPaginationId&&this.wcsGridPaginationId===t.target.id&&this.onPaginationChange()}onPaginationChange(){this.serverMode||this.updatePageIndex()}onRowSelection(t){"single"===this.selectionConfig&&this.rows.filter((s=>s.uuid!==t.uuid)).map((t=>t.selected=!1)),t.selected=!t.selected,("single"!==this.selectionConfig||t.selected)&&this.wcsGridSelectionChange.emit({row:this.wcsGridRowToWcsGridRowData(t)}),this.rows=r.cloneDeep(this.rows)}selectAllRows(){const t=this.getRowsForCurrentPage(),s=!this.allRowsAreSelected();t.map((t=>t.selected=s)),this.wcsGridAllSelectionChange.emit({rows:s?t.map((t=>this.wcsGridRowToWcsGridRowData(t))):[]}),this.rows=r.cloneDeep(this.rows)}allRowsAreSelected(){const t=this.getRowsForCurrentPage();return t.length>0&&t.filter((t=>t.selected)).length===t.length}getRowsForCurrentPage(){return this.paginationEl?this.rows.filter((t=>t.page===this.paginationEl.currentPage)):this.rows}renderSelectionColumn(t){switch(this.selectionConfig){case"none":return;case"single":return e("td",null,e("wcs-radio",{checked:t.selected,onClick:this.onRowSelection.bind(this,t)}));case"multiple":return e("td",null,e("wcs-checkbox",{checked:t.selected,onWcsChange:this.onRowSelection.bind(this,t)}))}}getCellContent(t,s){return s.formatter?s.formatter(e,s.column,this.wcsGridRowToWcsGridRowData(t)):s.content}totalColumnCount(){return this.columns?this.columns.length+("none"===this.selectionConfig?0:1):0}render(){var t;return e(n,null,e("table",null,e("thead",null,"none"===this.selectionConfig?"":e("th",{class:"wcs-grid-selection-column"},"single"===this.selectionConfig?"":e("wcs-checkbox",{checked:this.allRowsAreSelected(),onWcsChange:this.selectAllRows.bind(this)})),e("slot",{name:"grid-column"})),e("tbody",null,this.loading?e("tr",null,e("td",{colSpan:this.totalColumnCount(),class:"loading"},e("wcs-spinner",null))):null===(t=this.rows)||void 0===t?void 0:t.filter((t=>this.serverMode||!this.paginationEl||t.page===this.paginationEl.currentPage)).map((t=>this.renderRow(t))))),e("slot",{name:"grid-pagination"}))}renderRow(t){var s;return e("tr",{class:t.selected?"selected":""},this.renderSelectionColumn(t),null===(s=t.cells)||void 0===s?void 0:s.map((s=>{if(!s.column.hidden)return s.column.customCells?e("td",null,e("slot",{name:s.column.id+"-"+t.data[this.rowIdPath]})):e("td",{part:s.column.path+"-column"},this.getCellContent(t,s))})))}get el(){return o(this)}static get watchers(){return{data:["onDataChange"],selectedItems:["onSelectedItemsPropertyChange"]}}};m.style=":host{display:block;--wcs-grid-highlight-color:var(--wcs-light)}:host th{background-color:var(--wcs-light)}:host th:not(:first-child){border-left:solid 1px var(--wcs-text-light)}:host ::slotted([slot=grid-column]:first-child){--wcs-grid-column-border-left:none}:host table{width:100%;border-spacing:0}:host td{color:var(--wcs-gray-light);margin:0;padding:calc(var(--wcs-padding) / 2) var(--wcs-padding)}:host tr:not(:last-child) td{border-bottom:solid 1px var(--wcs-text-light)}:host .wcs-grid-selection-column{padding:calc(var(--wcs-padding) / 2) var(--wcs-padding);width:40px}:host tr.selected{background-color:var(--wcs-grid-highlight-color)}:host .loading{text-align:center}:host([selection]) ::slotted([slot=grid-column]:first-child){--wcs-grid-column-border-left:solid 1px var(--wcs-text-light) !important}";export{m as wcs_grid}
@@ -0,0 +1 @@
1
+ import{r as t,h as e,H as i,g as n}from"./p-255365bc.js";let o=class{constructor(e){t(this,e),this.mobileMenuOpen=!1,this.hasAlreadyRegisteredClickHandlerOnSlottedLink=!1}mobileMenuIconClick(){this.mobileMenuOpen=!this.mobileMenuOpen}disconnectedCallback(){this.resizeObserver.disconnect()}componentWillLoad(){this.resizeObserver=new ResizeObserver((t=>{const e=t[0].contentRect;this.currentActiveSizing=e.width<576-(e.left+(e.right-e.width))?"mobile":"desktop"})),this.resizeObserver.observe(document.body)}componentDidRender(){this.registerHandlerToCloseMobileMenuOnClickOnSlottedLinkTag()}registerHandlerToCloseMobileMenuOnClickOnSlottedLinkTag(){if(this.hasAlreadyRegisteredClickHandlerOnSlottedLink)return;const t=this.el.shadowRoot.querySelector("slot:not([name])");t&&(this.hasAlreadyRegisteredClickHandlerOnSlottedLink=!0,t.assignedElements().filter((t=>"A"===t.tagName)).forEach((t=>{t.addEventListener("click",(()=>{this.mobileMenuOpen=!1}))})))}onClickOnFinalAction(){this.mobileMenuOpen=!1}onClickOnFinalActionCat(){this.mobileMenuOpen=!1}render(){return e(i,null,e("div",{class:"container"},e("div",{class:"container-left"},e("div",{class:"app-name"},this.appName,e("slot",{name:"app-name"})),e("div",{class:"menu-bar"},"desktop"===this.currentActiveSizing?e("slot",null):null)),e("div",{class:"container-right"},e("slot",{name:"actions"}),e("span",{id:"mobile-menu-icon","data-mobile-open":this.mobileMenuOpen,onClick:()=>this.mobileMenuIconClick()}))),e("div",{class:"mobile-overlay","data-mobile-open":this.mobileMenuOpen},"mobile"===this.currentActiveSizing?e("slot",null):null))}get el(){return n(this)}};o.style=':host{display:block;position:relative;height:75px;border-bottom:solid 1px var(--wcs-text-light)}:host .container{padding:0 var(--wcs-padding);height:100%;display:flex;align-items:center;flex-direction:row;justify-content:space-between}:host .container-left{display:flex;height:100%;align-items:center;flex-direction:row}:host .container-right{display:flex;align-items:center}:host .app-name{font-weight:400;font-size:1.5rem;line-height:1.25;color:var(--wcs-gray)}:host .menu-bar{display:none}:host ::slotted(a){padding-top:calc(1.5 * var(--wcs-base-margin));padding-bottom:calc(1.5 * var(--wcs-base-margin));padding-left:calc(3 * var(--wcs-base-margin));display:flex;align-items:center;height:100%;font-size:16px;cursor:pointer;font-weight:500;color:var(--wcs-gray);text-decoration:none}:host ::slotted(a):after{font-family:icons;padding-left:var(--wcs-base-margin);font-size:0.6rem;content:"\\f107";line-height:1;box-sizing:border-box}:host #mobile-menu-icon{height:24px;padding-left:calc(2 * var(--wcs-base-margin));margin-left:var(--wcs-base-margin);border-left:solid 1px var(--wcs-text-light)}:host #mobile-menu-icon:after{font-family:icons;font-size:24px;cursor:pointer;content:"\\f198";line-height:1;box-sizing:border-box}:host #mobile-menu-icon[data-mobile-open]:after{content:"\\f129"}:host .mobile-overlay{display:none}:host .mobile-overlay[data-mobile-open]{padding-top:calc(2 * var(--wcs-base-margin));padding-bottom:calc(2 * var(--wcs-base-margin));position:relative;top:0;left:0;right:0;display:block;z-index:9999;background-color:var(--wcs-white)}@media screen and (min-width: 576px){:host .container{margin:0 auto;max-width:var(--wcs-com-content-max-width)}:host .menu-bar{display:flex;align-items:center;height:100%;margin-left:50px}:host .menu-bar ::slotted(*:not(:first-child)){margin-left:40px}:host #mobile-menu-icon{display:none}:host .mobile-overlay{display:none !important}:host ::slotted(a){padding-top:unset;padding-bottom:unset;padding-left:unset}}';export{o as wcs_com_nav}
@@ -0,0 +1 @@
1
+ import{h as n}from"./p-255365bc.js";const r=({up:r,ariaLabel:a})=>n("svg",{"aria-hidden":!a&&"true",role:"img","aria-label":a||!1,style:{marginLeft:"auto"},xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},n("style",{type:"text/css"},"\n .arrow-group {\n transform-origin: 50% 50%;\n transition: transform 175ms ease-in-out;\n }\n .up {\n transform: scaleY(1);\n }\n .down {\n transform: scaleY(-1);\n }\n "),n("g",{fill:"none",class:(r?"up":"down")+" arrow-group"},n("path",{class:"arrow",fill:"black",d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),n("path",{d:"M0 0h24v24H0z",fill:"none"})));export{r as S}
@@ -0,0 +1 @@
1
+ import{r as l,h as e,H as t}from"./p-255365bc.js";let a=class{constructor(e){l(this,e),this.required=!1}render(){return e(t,{slot:"label"},e("label",null,e("slot",null)))}};a.style=':host{font-weight:500;margin-bottom:8px}:host([required])::after{font-weight:500;color:var(--wcs-red);content:" *"}label{display:inline-flex;align-items:center}label ::slotted(wcs-mat-icon){display:inline;vertical-align:middle;margin-left:calc(var(--wcs-base-margin) / 2)}';export{a as wcs_label}
@@ -1 +1 @@
1
- import{p as e,b as c}from"./p-255365bc.js";(()=>{const c=import.meta.url,a={};return""!==c&&(a.resourcesUrl=new URL(".",c).href),e(a)})().then((e=>c([["p-b06926d7",[[1,"wcs-editable-field",{type:[1],label:[1],readonly:[4],value:[1032],validateFn:[16],formatFn:[16],errorMsg:[1,"error-msg"],currentState:[32],isError:[32]},[[8,"click","onWindowClickEvent"]]]]],["p-d639802e",[[1,"wcs-grid",{serverMode:[4,"server-mode"],data:[16],loading:[4],selectionConfig:[1,"selection-config"],selectedItems:[8,"selected-items"],wcsGridPaginationId:[1,"wcs-grid-pagination-id"],rowIdPath:[1,"row-id-path"],columns:[32],paginationEl:[32],rows:[32]},[[0,"wcsHiddenChange","onHiddenColumnChange"],[0,"wcsSortChange","sortChangeEventHandler"],[0,"wcsGridPaginationChange","paginationChangeEventHandler"],[8,"wcsGridPaginationChange","paginationChangeEventHandlerOutside"]]]]],["p-0f44bbbe",[[1,"wcs-grid-pagination",{availablePageSizes:[16],currentPage:[2,"current-page"],pageSize:[2,"page-size"],itemsCount:[2,"items-count"],pageCount:[2,"page-count"]}]]],["p-9af5d287",[[1,"wcs-horizontal-stepper",{currentStep:[1026,"current-step"],steps:[16],mode:[1],checkOnComplete:[4,"check-on-complete"],buttonMode:[32],internalCurrentStep:[32],previous:[64],next:[64]}]]],["p-9ae3c9e9",[[4,"wcs-modal",{withoutBackdrop:[516,"without-backdrop"],show:[516],showCloseButton:[516,"show-close-button"],size:[1],hideActions:[516,"hide-actions"]},[[4,"keydown","onKeyDown"]]]]],["p-ae70c0ce",[[1,"wcs-dropdown",{noArrow:[4,"no-arrow"],mode:[1],shape:[1],disabled:[4],placement:[1],expanded:[32]},[[8,"click","onWindowClickEvent"],[0,"wcsDropdownItemClick","dropdownItemClick"]]]]],["p-5924d21b",[[1,"wcs-galactic-menu",{text:[1],showPopoverMenu:[32]},[[8,"click","onWindowClickEvent"]]]]],["p-ba608aa0",[[1,"wcs-input",{fireFocusEvents:[4,"fire-focus-events"],accept:[1],autocapitalize:[1],autocomplete:[1],autocorrect:[1],autofocus:[4],clearInput:[4,"clear-input"],clearOnEdit:[4,"clear-on-edit"],debounce:[2],prefixLabel:[1,"prefix-label"],suffixLabel:[1,"suffix-label"],disabled:[4],enterkeyhint:[1],icon:[1],inputmode:[1],max:[1],maxlength:[2],min:[1],minlength:[2],multiple:[4],name:[1],pattern:[1],placeholder:[1],readonly:[4],required:[4],spellcheck:[4],state:[513],step:[1],size:[2],type:[1],value:[1032],hasFocus:[32],passwordReveal:[32],setFocus:[64],setBlur:[64],getInputElement:[64]}]]],["p-a4f8a6b7",[[1,"wcs-textarea",{fireFocusEvents:[4,"fire-focus-events"],autocapitalize:[1],autofocus:[4],clearOnEdit:[1028,"clear-on-edit"],debounce:[2],disabled:[4],icon:[1],inputmode:[1],enterkeyhint:[1],maxlength:[2],minlength:[2],name:[1],placeholder:[1],readonly:[4],required:[4],spellcheck:[4],state:[513],cols:[2],rows:[2],wrap:[1],autoGrow:[4,"auto-grow"],value:[1025],hasFocus:[32],fitContent:[64],setFocus:[64],setBlur:[64],getInputElement:[64]}]]],["p-b5da7536",[[1,"wcs-accordion",{hideActionText:[516,"hide-action-text"],highlight:[516],groupContentWithHeader:[516,"group-content-with-header"]},[[0,"wcsOpenChange","wcsOpenChangeHandler"]]]]],["p-f277846f",[[1,"wcs-accordion-content"]]],["p-b825255d",[[1,"wcs-accordion-header"]]],["p-1a901934",[[1,"wcs-accordion-panel",{open:[1540],hideActionText:[516,"hide-action-text"],highlight:[516],groupContentWithHeader:[516,"group-content-with-header"],close:[64]}]]],["p-13d05c78",[[1,"wcs-action-bar",{gutter:[4],hasTabs:[32]}]]],["p-1f359ba5",[[1,"wcs-app"]]],["p-62bc5d86",[[1,"wcs-badge",{shape:[1],color:[1]}]]],["p-3ec23cf3",[[1,"wcs-card",{mode:[1537]}]]],["p-781b4f9d",[[1,"wcs-card-body"]]],["p-b07c8dc4",[[1,"wcs-com-nav",{appName:[1,"app-name"],mobileMenuOpen:[32],currentActiveSizing:[32]},[[0,"wcsClickOnFinalAction","onClickOnFinalAction"],[0,"wcsCategoryItemClicked","onClickOnFinalActionCat"]]]]],["p-3d035fbf",[[1,"wcs-com-nav-category",{label:[1],categoryOpen:[32],close:[64],open:[64]},[[8,"click","onWindowClickEvent"],[8,"wcsCategoryOpened","onSubmenuOpened"]]]]],["p-d60bec91",[[1,"wcs-com-nav-submenu",{label:[1],panelTitle:[1,"panel-title"],panelDescription:[1,"panel-description"],menuOpen:[32],close:[64],open:[64]},[[8,"click","onWindowClickEvent"],[8,"wcsSubmenuOpened","onSubmenuOpened"],[0,"wcsCategoryItemClicked","wcsCategoryItemClickedHandler"]]]]],["p-b56f032b",[[1,"wcs-divider"]]],["p-059b84f9",[[1,"wcs-dropdown-divider"]]],["p-7ee4b6a1",[[1,"wcs-dropdown-header"]]],["p-1cc7a22c",[[4,"wcs-dropdown-item",null,[[1,"mousedown","onMouseDown"]]]]],["p-976a6697",[[1,"wcs-field"]]],["p-7fdc11ea",[[1,"wcs-field-content"]]],["p-ac07b4e2",[[1,"wcs-field-label"]]],["p-33226fb4",[[1,"wcs-footer"]]],["p-b133b0dc",[[1,"wcs-galactic",{text:[1],show:[32]}]]],["p-8f0a936d",[[1,"wcs-grid-column",{path:[1],name:[1],sort:[4],sortFn:[16],formatter:[16],sortOrder:[1025,"sort-order"],width:[1],customCells:[4,"custom-cells"],hidden:[4]}]]],["p-ff4b222c",[[1,"wcs-grid-custom-cell",{columnId:[1,"column-id"],rowId:[8,"row-id"]}]]],["p-e2a5ddaa",[[1,"wcs-header"]]],["p-5cc5a57d",[[1,"wcs-hint",{small:[1540]}]]],["p-9257912a",[[0,"wcs-icon",{icon:[1],size:[1]}]]],["p-174e238e",[[1,"wcs-label",{required:[516]}]]],["p-f99cd98a",[[1,"wcs-list-item",{activated:[1028]}]]],["p-199c6d1a",[[1,"wcs-list-item-properties"]]],["p-8efe000d",[[1,"wcs-list-item-property"]]],["p-b27b75d7",[[1,"wcs-nav"]]],["p-36061148",[[4,"wcs-nav-item",{text:[513],href:[513]}]]],["p-d3c16915",[[1,"wcs-progress-radial",{size:[2],showLabel:[4,"show-label"],value:[2]}]]],["p-93758284",[[1,"wcs-radio-group",{value:[8],name:[520],mode:[513]},[[0,"wcsRadioClick","selectedOptionChanged"]]]]],["p-77887785",[[1,"wcs-switch",{name:[1],checked:[516],labelAlignment:[513,"label-alignment"],disabled:[4]}]]],["p-1c459dbe",[[1,"wcs-tab",{header:[513],itemKey:[8,"item-key"]}]]],["p-80aafdd9",[[1,"wcs-tabs",{align:[513],selectedIndex:[2,"selected-index"],selectedKey:[8,"selected-key"],headersOnly:[4,"headers-only"],gutter:[4],headers:[32],currentActiveTabIndex:[32]},[[0,"tabLoaded","onTabLoaded"]]]]],["p-3891f057",[[1,"wcs-tooltip",{for:[1],position:[513],interactive:[4],maxWidth:[8,"max-width"],delay:[2],duration:[2],trigger:[1],theme:[1],content:[1],hide:[64],show:[64],disable:[64],enable:[64]}]]],["p-21762963",[[1,"wcs-progress-bar",{small:[4],showLabel:[4,"show-label"],value:[2]}]]],["p-af388d8c",[[1,"wcs-radio",{mode:[513],value:[1544],label:[1537],checked:[1540],disabled:[1028]}]]],["p-23e6c574",[[4,"wcs-select-option",{disabled:[1540],selected:[1540],value:[8],chipColor:[1,"chip-color"],chipBackgroundColor:[1,"chip-background-color"],multiple:[1540]},[[1,"mousedown","onMouseDown"]]],[1,"wcs-select",{value:[1032],placeholder:[1537],disabled:[1028],multiple:[516],chips:[516],name:[1],compareWith:[16],expanded:[32],hasLoaded:[32],displayText:[32],focused:[32],overlayDirection:[32],open:[64],close:[64]},[[1,"mousedown","onMouseDown"],[8,"click","onWindowClickEvent"],[0,"wcsSelectOptionClick","selectedOptionChanged"]]]]],["p-d9578bda",[[1,"wcs-error"],[1,"wcs-form-field",{isError:[1540,"is-error"],hasPrefix:[32],hasSuffix:[32],spiedElement:[32]}]]],["p-05eabb26",[[1,"wcs-spinner",{mode:[513]}]]],["p-83651b14",[[1,"wcs-button",{type:[1025],href:[1],disabled:[516],ripple:[4],shape:[513],mode:[513]},[[0,"click","onClick"]]]]],["p-addef5b2",[[1,"wcs-checkbox",{name:[1],indeterminate:[1540],checked:[1540],labelAlignment:[1537,"label-alignment"],disabled:[4]}]]],["p-4dacca6a",[[1,"wcs-mat-icon",{icon:[1],size:[1],family:[1],familyFile:[32],familyClass:[32]}]]]],e)));
1
+ import{p as e,b as a}from"./p-255365bc.js";(()=>{const a=import.meta.url,o={};return""!==a&&(o.resourcesUrl=new URL(".",a).href),e(o)})().then((e=>a([["p-b06926d7",[[1,"wcs-editable-field",{type:[1],label:[1],readonly:[4],value:[1032],validateFn:[16],formatFn:[16],errorMsg:[1,"error-msg"],currentState:[32],isError:[32]},[[8,"click","onWindowClickEvent"]]]]],["p-79feb1b2",[[1,"wcs-grid",{serverMode:[4,"server-mode"],data:[16],loading:[4],selectionConfig:[1,"selection-config"],selectedItems:[8,"selected-items"],wcsGridPaginationId:[1,"wcs-grid-pagination-id"],rowIdPath:[1,"row-id-path"],columns:[32],paginationEl:[32],rows:[32]},[[0,"wcsHiddenChange","onHiddenColumnChange"],[0,"wcsSortChange","sortChangeEventHandler"],[0,"wcsGridPaginationChange","paginationChangeEventHandler"],[8,"wcsGridPaginationChange","paginationChangeEventHandlerOutside"]]]]],["p-0f44bbbe",[[1,"wcs-grid-pagination",{availablePageSizes:[16],currentPage:[2,"current-page"],pageSize:[2,"page-size"],itemsCount:[2,"items-count"],pageCount:[2,"page-count"]}]]],["p-9af5d287",[[1,"wcs-horizontal-stepper",{currentStep:[1026,"current-step"],steps:[16],mode:[1],checkOnComplete:[4,"check-on-complete"],buttonMode:[32],internalCurrentStep:[32],previous:[64],next:[64]}]]],["p-9ae3c9e9",[[4,"wcs-modal",{withoutBackdrop:[516,"without-backdrop"],show:[516],showCloseButton:[516,"show-close-button"],size:[1],hideActions:[516,"hide-actions"]},[[4,"keydown","onKeyDown"]]]]],["p-3ede8428",[[1,"wcs-dropdown",{noArrow:[4,"no-arrow"],mode:[1],shape:[1],disabled:[4],placement:[1],expanded:[32]},[[8,"click","onWindowClickEvent"],[0,"wcsDropdownItemClick","dropdownItemClick"]]]]],["p-5924d21b",[[1,"wcs-galactic-menu",{text:[1],showPopoverMenu:[32]},[[8,"click","onWindowClickEvent"]]]]],["p-ba608aa0",[[1,"wcs-input",{fireFocusEvents:[4,"fire-focus-events"],accept:[1],autocapitalize:[1],autocomplete:[1],autocorrect:[1],autofocus:[4],clearInput:[4,"clear-input"],clearOnEdit:[4,"clear-on-edit"],debounce:[2],prefixLabel:[1,"prefix-label"],suffixLabel:[1,"suffix-label"],disabled:[4],enterkeyhint:[1],icon:[1],inputmode:[1],max:[1],maxlength:[2],min:[1],minlength:[2],multiple:[4],name:[1],pattern:[1],placeholder:[1],readonly:[4],required:[4],spellcheck:[4],state:[513],step:[1],size:[2],type:[1],value:[1032],hasFocus:[32],passwordReveal:[32],setFocus:[64],setBlur:[64],getInputElement:[64]}]]],["p-a4f8a6b7",[[1,"wcs-textarea",{fireFocusEvents:[4,"fire-focus-events"],autocapitalize:[1],autofocus:[4],clearOnEdit:[1028,"clear-on-edit"],debounce:[2],disabled:[4],icon:[1],inputmode:[1],enterkeyhint:[1],maxlength:[2],minlength:[2],name:[1],placeholder:[1],readonly:[4],required:[4],spellcheck:[4],state:[513],cols:[2],rows:[2],wrap:[1],autoGrow:[4,"auto-grow"],value:[1025],hasFocus:[32],fitContent:[64],setFocus:[64],setBlur:[64],getInputElement:[64]}]]],["p-b5da7536",[[1,"wcs-accordion",{hideActionText:[516,"hide-action-text"],highlight:[516],groupContentWithHeader:[516,"group-content-with-header"]},[[0,"wcsOpenChange","wcsOpenChangeHandler"]]]]],["p-f277846f",[[1,"wcs-accordion-content"]]],["p-b825255d",[[1,"wcs-accordion-header"]]],["p-1b8330aa",[[1,"wcs-accordion-panel",{open:[1540],hideActionText:[516,"hide-action-text"],highlight:[516],groupContentWithHeader:[516,"group-content-with-header"],close:[64]}]]],["p-13d05c78",[[1,"wcs-action-bar",{gutter:[4],hasTabs:[32]}]]],["p-1f359ba5",[[1,"wcs-app"]]],["p-62bc5d86",[[1,"wcs-badge",{shape:[1],color:[1]}]]],["p-3ec23cf3",[[1,"wcs-card",{mode:[1537]}]]],["p-781b4f9d",[[1,"wcs-card-body"]]],["p-8a000290",[[1,"wcs-com-nav",{appName:[1,"app-name"],mobileMenuOpen:[32],currentActiveSizing:[32]},[[0,"wcsClickOnFinalAction","onClickOnFinalAction"],[0,"wcsCategoryItemClicked","onClickOnFinalActionCat"]]]]],["p-3d035fbf",[[1,"wcs-com-nav-category",{label:[1],categoryOpen:[32],close:[64],open:[64]},[[8,"click","onWindowClickEvent"],[8,"wcsCategoryOpened","onSubmenuOpened"]]]]],["p-d60bec91",[[1,"wcs-com-nav-submenu",{label:[1],panelTitle:[1,"panel-title"],panelDescription:[1,"panel-description"],menuOpen:[32],close:[64],open:[64]},[[8,"click","onWindowClickEvent"],[8,"wcsSubmenuOpened","onSubmenuOpened"],[0,"wcsCategoryItemClicked","wcsCategoryItemClickedHandler"]]]]],["p-b56f032b",[[1,"wcs-divider"]]],["p-059b84f9",[[1,"wcs-dropdown-divider"]]],["p-7ee4b6a1",[[1,"wcs-dropdown-header"]]],["p-1cc7a22c",[[4,"wcs-dropdown-item",null,[[1,"mousedown","onMouseDown"]]]]],["p-976a6697",[[1,"wcs-field"]]],["p-7fdc11ea",[[1,"wcs-field-content"]]],["p-ac07b4e2",[[1,"wcs-field-label"]]],["p-33226fb4",[[1,"wcs-footer"]]],["p-b133b0dc",[[1,"wcs-galactic",{text:[1],show:[32]}]]],["p-8f0a936d",[[1,"wcs-grid-column",{path:[1],name:[1],sort:[4],sortFn:[16],formatter:[16],sortOrder:[1025,"sort-order"],width:[1],customCells:[4,"custom-cells"],hidden:[4]}]]],["p-ff4b222c",[[1,"wcs-grid-custom-cell",{columnId:[1,"column-id"],rowId:[8,"row-id"]}]]],["p-e2a5ddaa",[[1,"wcs-header"]]],["p-5cc5a57d",[[1,"wcs-hint",{small:[1540]}]]],["p-9257912a",[[0,"wcs-icon",{icon:[1],size:[1]}]]],["p-f79a36b2",[[1,"wcs-label",{required:[516]}]]],["p-f99cd98a",[[1,"wcs-list-item",{activated:[1028]}]]],["p-199c6d1a",[[1,"wcs-list-item-properties"]]],["p-8efe000d",[[1,"wcs-list-item-property"]]],["p-b27b75d7",[[1,"wcs-nav"]]],["p-36061148",[[4,"wcs-nav-item",{text:[513],href:[513]}]]],["p-d3c16915",[[1,"wcs-progress-radial",{size:[2],showLabel:[4,"show-label"],value:[2]}]]],["p-93758284",[[1,"wcs-radio-group",{value:[8],name:[520],mode:[513]},[[0,"wcsRadioClick","selectedOptionChanged"]]]]],["p-77887785",[[1,"wcs-switch",{name:[1],checked:[516],labelAlignment:[513,"label-alignment"],disabled:[4]}]]],["p-1c459dbe",[[1,"wcs-tab",{header:[513],itemKey:[8,"item-key"]}]]],["p-80aafdd9",[[1,"wcs-tabs",{align:[513],selectedIndex:[2,"selected-index"],selectedKey:[8,"selected-key"],headersOnly:[4,"headers-only"],gutter:[4],headers:[32],currentActiveTabIndex:[32]},[[0,"tabLoaded","onTabLoaded"]]]]],["p-3891f057",[[1,"wcs-tooltip",{for:[1],position:[513],interactive:[4],maxWidth:[8,"max-width"],delay:[2],duration:[2],trigger:[1],theme:[1],content:[1],hide:[64],show:[64],disable:[64],enable:[64]}]]],["p-21762963",[[1,"wcs-progress-bar",{small:[4],showLabel:[4,"show-label"],value:[2]}]]],["p-af388d8c",[[1,"wcs-radio",{mode:[513],value:[1544],label:[1537],checked:[1540],disabled:[1028]}]]],["p-18c6e4df",[[4,"wcs-select-option",{disabled:[1540],selected:[1540],value:[8],chipColor:[1,"chip-color"],chipBackgroundColor:[1,"chip-background-color"],multiple:[1540]},[[1,"mousedown","onMouseDown"]]],[1,"wcs-select",{value:[1032],placeholder:[1537],disabled:[1028],multiple:[516],chips:[516],name:[1],compareWith:[16],expanded:[32],hasLoaded:[32],displayText:[32],focused:[32],overlayDirection:[32],open:[64],close:[64]},[[1,"mousedown","onMouseDown"],[8,"click","onWindowClickEvent"],[0,"wcsSelectOptionClick","selectedOptionChanged"]]]]],["p-d9578bda",[[1,"wcs-error"],[1,"wcs-form-field",{isError:[1540,"is-error"],hasPrefix:[32],hasSuffix:[32],spiedElement:[32]}]]],["p-05eabb26",[[1,"wcs-spinner",{mode:[513]}]]],["p-83651b14",[[1,"wcs-button",{type:[1025],href:[1],disabled:[516],ripple:[4],shape:[513],mode:[513]},[[0,"click","onClick"]]]]],["p-addef5b2",[[1,"wcs-checkbox",{name:[1],indeterminate:[1540],checked:[1540],labelAlignment:[1537,"label-alignment"],disabled:[4]}]]],["p-4dacca6a",[[1,"wcs-mat-icon",{icon:[1],size:[1],family:[1],familyFile:[32],familyClass:[32]}]]]],e)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wcs-core",
3
- "version": "2.14.0",
3
+ "version": "2.15.0",
4
4
  "description": "Web components SNCF",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1 +0,0 @@
1
- import{h as n}from"./p-255365bc.js";const o=({up:o})=>n("svg",{style:{marginLeft:"auto"},xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},n("style",{type:"text/css"},"\n .arrow-group {\n transform-origin: 50% 50%;\n transition: transform 175ms ease-in-out;\n }\n .up {\n transform: scaleY(1);\n }\n .down {\n transform: scaleY(-1);\n }\n "),n("g",{fill:"none",class:(o?"up":"down")+" arrow-group"},n("path",{class:"arrow",fill:"black",d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),n("path",{d:"M0 0h24v24H0z",fill:"none"})));export{o as S}
@@ -1 +0,0 @@
1
- import{r as t,h as l,H as e}from"./p-255365bc.js";let r=class{constructor(l){t(this,l),this.required=!1}render(){return l(e,{slot:"label"},l("label",null,l("slot",null)))}};r.style=':host{font-weight:500;margin-bottom:8px}:host([required])::after{font-weight:500;color:var(--wcs-red);content:"*"}label{display:inline-flex;align-items:center}label ::slotted(wcs-mat-icon){margin-left:calc(var(--wcs-base-margin) / 2)}';export{r as wcs_label}
@@ -1 +0,0 @@
1
- import{r as t,c as o,h as e,H as r}from"./p-255365bc.js";import{S as s}from"./p-1421429d.js";let n=class{constructor(e){t(this,e),this.wcsOpenChange=o(this,"wcsOpenChange",7),this.open=!1,this.hideActionText=!1,this.highlight=!1,this.groupContentWithHeader=!1}openChange(t){this.wcsOpenChange.emit(t)}async close(){this.open=!1}render(){return e(r,null,e("div",{class:"header",onClick:()=>this.open=!this.open},e("slot",{name:"header"}),e("div",{class:"header-action"},!this.hideActionText&&e("span",null,this.open?"Fermez":"Ouvrez"),e(s,{up:this.open}))),e("div",{class:"content"},e("slot",{name:"content"})))}static get watchers(){return{open:["openChange"]}}};n.style=":host{display:flex;flex-direction:column;cursor:pointer;margin-bottom:16px}:host .header{display:flex;align-items:center;justify-content:space-between;padding:14px 24px;border-radius:7px;font-weight:500;font-size:16px;color:var(--wcs-primary);background-color:var(--wcs-light)}:host .header-action{display:flex;align-items:center;user-select:none}:host .header-action .arrow{fill:var(--wcs-primary)}:host .content{display:none}:host([open]){margin-bottom:0}:host([open]) .content{display:block}:host([open]):host([group-content-with-header]) .header{border-radius:7px 7px 0 0;padding-bottom:0}:host([open]):host([group-content-with-header]) .content{border-radius:0 0 7px 7px;margin-bottom:14px;background-color:var(--wcs-light)}:host([open]):host([highlight]) .header{background-color:var(--wcs-primary);color:var(--wcs-light)}:host([open]):host([highlight]) .arrow{fill:var(--wcs-light)}:host([open]):host([highlight]):host([group-content-with-header]) .content{background-color:var(--wcs-primary);color:var(--wcs-light)}";export{n as wcs_accordion_panel}
@@ -1 +0,0 @@
1
- import{r as t,h as e,H as i,g as n}from"./p-255365bc.js";let o=class{constructor(e){t(this,e),this.mobileMenuOpen=!1}mobileMenuIconClick(){this.mobileMenuOpen=!this.mobileMenuOpen}disconnectedCallback(){this.resizeObserver.disconnect()}componentWillLoad(){this.resizeObserver=new ResizeObserver((t=>{const e=t[0].contentRect;this.currentActiveSizing=e.width<576-(e.left+(e.right-e.width))?"mobile":"desktop"})),this.resizeObserver.observe(document.body)}onClickOnFinalAction(){this.mobileMenuOpen=!1}onClickOnFinalActionCat(){this.mobileMenuOpen=!1}render(){return e(i,null,e("div",{class:"container"},e("div",{class:"container-left"},e("div",{class:"app-name"},this.appName,e("slot",{name:"app-name"})),e("div",{class:"menu-bar"},"desktop"===this.currentActiveSizing?e("slot",null):null)),e("div",{class:"container-right"},e("slot",{name:"actions"}),e("span",{id:"mobile-menu-icon","data-mobile-open":this.mobileMenuOpen,onClick:()=>this.mobileMenuIconClick()}))),e("div",{class:"mobile-overlay","data-mobile-open":this.mobileMenuOpen},"mobile"===this.currentActiveSizing?e("slot",null):null))}get el(){return n(this)}};o.style=':host{display:block;position:relative;height:75px;border-bottom:solid 1px var(--wcs-text-light)}:host .container{padding:0 var(--wcs-padding);height:100%;display:flex;align-items:center;flex-direction:row;justify-content:space-between}:host .container-left{display:flex;height:100%;align-items:center;flex-direction:row}:host .container-right{display:flex;align-items:center}:host .app-name{font-weight:400;font-size:1.5rem;line-height:1.25;color:var(--wcs-gray)}:host .menu-bar{display:none}:host ::slotted(a){padding-top:calc(1.5 * var(--wcs-base-margin));padding-bottom:calc(1.5 * var(--wcs-base-margin));padding-left:calc(3 * var(--wcs-base-margin));display:flex;align-items:center;height:100%;font-size:16px;cursor:pointer;font-weight:500;color:var(--wcs-gray);text-decoration:none}:host ::slotted(a):after{font-family:icons;padding-left:var(--wcs-base-margin);font-size:0.6rem;content:"\\f107";line-height:1;box-sizing:border-box}:host #mobile-menu-icon{height:24px;padding-left:calc(2 * var(--wcs-base-margin));margin-left:var(--wcs-base-margin);border-left:solid 1px var(--wcs-text-light)}:host #mobile-menu-icon:after{font-family:icons;font-size:24px;cursor:pointer;content:"\\f198";line-height:1;box-sizing:border-box}:host #mobile-menu-icon[data-mobile-open]:after{content:"\\f129"}:host .mobile-overlay{display:none}:host .mobile-overlay[data-mobile-open]{padding-top:calc(2 * var(--wcs-base-margin));padding-bottom:calc(2 * var(--wcs-base-margin));position:relative;top:0;left:0;right:0;display:block;z-index:9999;background-color:var(--wcs-white)}@media screen and (min-width: 576px){:host .container{margin:0 auto;max-width:var(--wcs-com-content-max-width)}:host .menu-bar{display:flex;align-items:center;height:100%;margin-left:50px}:host .menu-bar ::slotted(*:not(:first-child)){margin-left:40px}:host #mobile-menu-icon{display:none}:host .mobile-overlay{display:none !important}:host ::slotted(a){padding-top:unset;padding-bottom:unset;padding-left:unset}}';export{o as wcs_com_nav}
@@ -1 +0,0 @@
1
- import{r as t,c as s,f as i,h as e,H as n,g as o}from"./p-255365bc.js";import{l as r}from"./p-adef7aaf.js";function h(t){switch(t){case"asc":return 1;case"desc":return-1}}var a,l=new Uint8Array(16);function c(){if(!a&&!(a="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return a(l)}const d=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function u(t){return"string"==typeof t&&d.test(t)}for(var g=[],p=0;p<256;++p)g.push((p+256).toString(16).substr(1));function f(t,s,i){var e=(t=t||{}).random||(t.rng||c)();if(e[6]=15&e[6]|64,e[8]=63&e[8]|128,s){i=i||0;for(var n=0;n<16;++n)s[i+n]=e[n];return s}return function(t){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(g[t[s+0]]+g[t[s+1]]+g[t[s+2]]+g[t[s+3]]+"-"+g[t[s+4]]+g[t[s+5]]+"-"+g[t[s+6]]+g[t[s+7]]+"-"+g[t[s+8]]+g[t[s+9]]+"-"+g[t[s+10]]+g[t[s+11]]+g[t[s+12]]+g[t[s+13]]+g[t[s+14]]+g[t[s+15]]).toLowerCase();if(!u(i))throw TypeError("Stringified UUID is invalid");return i}(e)}let m=class{constructor(i){t(this,i),this.wcsGridSelectionChange=s(this,"wcsGridSelectionChange",7),this.wcsGridAllSelectionChange=s(this,"wcsGridAllSelectionChange",7),this.selectionConfig="none",this.selectedItems=[],this.rows=[]}onDataChange(t){this.updateGridRows(t)}onSelectedItemsPropertyChange(t){this.updateSelectionWithValues(t)}onHiddenColumnChange(){i(this)}updateSelectionWithValues(t){if("single"===this.selectionConfig){this.rows.map((t=>t.selected=!1));for(const s of this.rows)if(r.isEqual(s.data,t)){s.selected=!0;break}}else if("multiple"===this.selectionConfig){this.rows.map((t=>t.selected=!1));for(const s of this.rows)t.find((t=>r.isEqual(t,s.data)))&&(s.selected=!0)}this.rows=r.cloneDeep(this.rows)}wcsGridRowToWcsGridRowData(t){return{selected:t.selected,page:t.page,data:t.data}}updateGridRows(t){const s=[];if(t&&this.columns){for(let i=0;i<t.length;i++){const e={uuid:f(),data:t[i],selected:!1,cells:[]};for(const s of this.columns)e.cells.push({content:r.get(t[i],s.path),column:s,formatter:s.formatter});s.push(e)}this.rows=s,this.updatePageIndex()}}componentDidLoad(){this.columns=this.getGridColumnsFromTemplate(),this.paginationEl=this.wcsGridPaginationId?document.getElementById(this.wcsGridPaginationId):this.getGridPaginationsFromTemplate()[0],this.updateGridRows(this.data),this.selectedItems&&this.updateSelectionWithValues(this.selectedItems),this.applyInitialSortConfig()}applyInitialSortConfig(){const[t,...s]=this.columns.filter((t=>"none"!==t.sortOrder));null==s||s.forEach((t=>t.sortOrder="none")),t&&!this.serverMode&&this.sortBy(t)}getGridColumnsFromTemplate(){return this.el.shadowRoot.querySelector('slot[name="grid-column"]').assignedElements()}getGridPaginationsFromTemplate(){return this.el.shadowRoot.querySelector('slot[name="grid-pagination"]').assignedElements()}sortChangeEventHandler(t){"none"!==t.detail.order&&(this.columns.filter((s=>s!==t.detail.column)).forEach((t=>t.sortOrder="none")),this.serverMode||(this.sortBy(t.detail.column),this.updatePageIndex()))}sortBy(t){this.rows=t.sortFn?r.cloneDeep(this.rows).sort(((s,i)=>t.sortFn(s.data,i.data,t)*h(t.sortOrder))):r.cloneDeep(this.rows).sort(((s,i)=>{const e=t.path;return(r.get(s.data,e)<r.get(i.data,e)?-1:r.get(s.data,e)>r.get(i.data,e)?1:0)*h(t.sortOrder)}))}updatePageIndex(){if(!this.serverMode&&this.paginationEl){this.paginationEl.currentPage+1>this.paginationEl.pageCount&&(this.paginationEl.currentPage=this.paginationEl.pageCount-1),this.paginationEl.itemsCount=this.data.length,this.paginationEl.pageCount=Math.ceil(this.data.length/this.paginationEl.pageSize);const t=r.cloneDeep(this.rows);t.forEach(((t,s)=>t.page=Math.floor(s/this.paginationEl.pageSize))),this.rows=[...t]}}paginationChangeEventHandler(){this.onPaginationChange()}paginationChangeEventHandlerOutside(t){this.wcsGridPaginationId&&this.wcsGridPaginationId===t.target.id&&this.onPaginationChange()}onPaginationChange(){this.serverMode||this.updatePageIndex()}onRowSelection(t){"single"===this.selectionConfig&&this.rows.filter((s=>s.uuid!==t.uuid)).map((t=>t.selected=!1)),t.selected=!t.selected,("single"!==this.selectionConfig||t.selected)&&this.wcsGridSelectionChange.emit({row:this.wcsGridRowToWcsGridRowData(t)}),this.rows=r.cloneDeep(this.rows)}selectAllRows(){const t=this.getRowsForCurrentPage(),s=!this.allRowsAreSelected();t.map((t=>t.selected=s)),this.wcsGridAllSelectionChange.emit({rows:s?t.map((t=>this.wcsGridRowToWcsGridRowData(t))):[]}),this.rows=r.cloneDeep(this.rows)}allRowsAreSelected(){const t=this.getRowsForCurrentPage();return t.length>0&&t.filter((t=>t.selected)).length===t.length}getRowsForCurrentPage(){return this.paginationEl?this.rows.filter((t=>t.page===this.paginationEl.currentPage)):this.rows}renderSelectionColumn(t){switch(this.selectionConfig){case"none":return;case"single":return e("td",null,e("wcs-radio",{checked:t.selected,onClick:this.onRowSelection.bind(this,t)}));case"multiple":return e("td",null,e("wcs-checkbox",{checked:t.selected,onWcsChange:this.onRowSelection.bind(this,t)}))}}getCellContent(t,s){return s.formatter?s.formatter(e,s.column,this.wcsGridRowToWcsGridRowData(t)):s.content}totalColumnCount(){return this.columns?this.columns.length+("none"===this.selectionConfig?0:1):0}render(){var t;return e(n,null,e("table",null,e("thead",null,"none"===this.selectionConfig?"":e("th",{class:"wcs-grid-selection-column"},"single"===this.selectionConfig?"":e("wcs-checkbox",{checked:this.allRowsAreSelected(),onWcsChange:this.selectAllRows.bind(this)})),e("slot",{name:"grid-column"})),e("tbody",null,this.loading?e("tr",null,e("td",{colSpan:this.totalColumnCount(),class:"loading"},e("wcs-spinner",null))):null===(t=this.rows)||void 0===t?void 0:t.filter((t=>this.serverMode||!this.paginationEl||t.page===this.paginationEl.currentPage)).map((t=>this.renderRow(t))))),e("slot",{name:"grid-pagination"}))}renderRow(t){var s;return e("tr",{class:t.selected?"selected":""},this.renderSelectionColumn(t),null===(s=t.cells)||void 0===s?void 0:s.map((s=>{if(!s.column.hidden)return s.column.customCells?e("td",null,e("slot",{name:s.column.id+"-"+t.data[this.rowIdPath]})):e("td",{part:s.column.path+"-column"},this.getCellContent(t,s))})))}get el(){return o(this)}static get watchers(){return{data:["onDataChange"],selectedItems:["onSelectedItemsPropertyChange"]}}};m.style=":host{display:block;--wcs-grid-highlight-color:var(--wcs-light)}:host th{background-color:var(--wcs-light)}:host th:not(:first-child){border-left:solid 1px var(--wcs-text-light)}:host ::slotted([slot=grid-column]:first-child){--wcs-grid-column-border-left:none}:host table{width:100%;border-spacing:0}:host td{color:var(--wcs-gray-light);margin:0;padding:calc(var(--wcs-padding) / 2) var(--wcs-padding)}:host tr:not(:last-child) td{border-bottom:solid 1px var(--wcs-text-light)}:host .wcs-grid-selection-column{padding:calc(var(--wcs-padding) / 2) var(--wcs-padding);width:40px}:host tr.selected{background-color:var(--wcs-grid-highlight-color)}:host .loading{text-align:center}:host([selection]) ::slotted([slot=grid-column]:first-child){--wcs-grid-column-border-left:solid 1px var(--wcs-text-light) !important}";export{m as wcs_grid}