@sbb-esta/lyne-elements-experimental 3.2.0 → 3.3.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 (50) hide show
  1. package/custom-elements.json +341 -125
  2. package/development/seat-reservation/common/mapper/icon-mapper.d.ts.map +1 -1
  3. package/development/seat-reservation/common/mapper/icon-mapper.js +4 -3
  4. package/development/seat-reservation/common/mapper/mapper.d.ts +4 -4
  5. package/development/seat-reservation/common/mapper/mapper.d.ts.map +1 -1
  6. package/development/seat-reservation/common/mapper/mapper.js +9 -8
  7. package/development/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts +113 -0
  8. package/development/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts.map +1 -1
  9. package/development/seat-reservation/common/mapper/seat-reservation-sample-data.js +20373 -8
  10. package/development/seat-reservation/common/translations/i18n.d.ts.map +1 -1
  11. package/development/seat-reservation/common/translations/i18n.js +35 -4
  12. package/development/seat-reservation/common/types.d.ts +10 -3
  13. package/development/seat-reservation/common/types.d.ts.map +1 -1
  14. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +20 -14
  15. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -1
  16. package/development/seat-reservation/seat-reservation/seat-reservation-base-element.js +129 -79
  17. package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts +11 -10
  18. package/development/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
  19. package/development/seat-reservation/seat-reservation/seat-reservation.component.js +208 -132
  20. package/development/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +1 -1
  21. package/development/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +4 -4
  22. package/development/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +28 -28
  23. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts +2 -0
  24. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts.map +1 -1
  25. package/development/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +22 -5
  26. package/package.json +2 -2
  27. package/seat-reservation/common/mapper/icon-mapper.d.ts.map +1 -1
  28. package/seat-reservation/common/mapper/icon-mapper.js +3 -2
  29. package/seat-reservation/common/mapper/mapper.d.ts +4 -4
  30. package/seat-reservation/common/mapper/mapper.d.ts.map +1 -1
  31. package/seat-reservation/common/mapper/mapper.js +29 -28
  32. package/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts +113 -0
  33. package/seat-reservation/common/mapper/seat-reservation-sample-data.d.ts.map +1 -1
  34. package/seat-reservation/common/mapper/seat-reservation-sample-data.js +20375 -11
  35. package/seat-reservation/common/translations/i18n.d.ts.map +1 -1
  36. package/seat-reservation/common/translations/i18n.js +34 -3
  37. package/seat-reservation/common/types.d.ts +10 -3
  38. package/seat-reservation/common/types.d.ts.map +1 -1
  39. package/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts +20 -14
  40. package/seat-reservation/seat-reservation/seat-reservation-base-element.d.ts.map +1 -1
  41. package/seat-reservation/seat-reservation/seat-reservation-base-element.js +191 -146
  42. package/seat-reservation/seat-reservation/seat-reservation.component.d.ts +11 -10
  43. package/seat-reservation/seat-reservation/seat-reservation.component.d.ts.map +1 -1
  44. package/seat-reservation/seat-reservation/seat-reservation.component.js +211 -188
  45. package/seat-reservation/seat-reservation-area/seat-reservation-area.component.js +1 -1
  46. package/seat-reservation/seat-reservation-graphic/seat-reservation-graphic.component.js +1 -1
  47. package/seat-reservation/seat-reservation-navigation-coach/seat-reservation-navigation-coach.component.js +74 -74
  48. package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts +2 -0
  49. package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.d.ts.map +1 -1
  50. package/seat-reservation/seat-reservation-place-control/seat-reservation-place-control.component.js +64 -53
@@ -1,11 +1,11 @@
1
- import { __esDecorate as $, __runInitializers as x } from "tslib";
2
- import { SbbLanguageController as A } from "@sbb-esta/lyne-elements/core/controllers.js";
3
- import { css as S, isServer as y, html as b, nothing as v } from "lit";
4
- import { customElement as R } from "lit/decorators.js";
5
- import { classMap as k } from "lit/directives/class-map.js";
1
+ import { __esDecorate as C, __runInitializers as S } from "tslib";
2
+ import { SbbLanguageController as y } from "@sbb-esta/lyne-elements/core/controllers.js";
3
+ import { css as A, isServer as R, html as b, nothing as v } from "lit";
4
+ import { customElement as E } from "lit/decorators.js";
5
+ import { classMap as m } from "lit/directives/class-map.js";
6
6
  import { styleMap as g } from "lit/directives/style-map.js";
7
7
  import { getI18nSeatReservation as n } from "../common.js";
8
- import { SeatReservationBaseElement as E } from "./seat-reservation-base-element.js";
8
+ import { SeatReservationBaseElement as P } from "./seat-reservation-base-element.js";
9
9
  import "@sbb-esta/lyne-elements/button.js";
10
10
  import "@sbb-esta/lyne-elements/screen-reader-only.js";
11
11
  import "../seat-reservation-area.js";
@@ -14,14 +14,14 @@ import "../seat-reservation-place-control.js";
14
14
  import "../seat-reservation-navigation-coach.js";
15
15
  import "../seat-reservation-scoped.js";
16
16
  import "@sbb-esta/lyne-elements/popover/popover.js";
17
- const P = S`*,:before,:after{box-sizing:border-box}:host{--sbb-seat-reservation-grid-size: 16px;--sbb-seat-reservation-coach-height: 0;display:block;height:inherit}:host ::part(coach-floor){fill:var(--sbb-color-white)}@media (forced-colors: active){:host ::part(coach-floor){fill:transparent}}:host(:dir(rtl)) :not(.sbb-sr-place-ctrl--type-bicycle,.sbb-sr-place-ctrl--orientation-90,.sbb-sr-place-ctrl--orientation-270,.sbb-sr-place-ctrl--state-selected) ::part(coach-floor){rotate:180deg}[popover]:where(sbb-popover){margin:0;padding:0;border:none;width:auto;height:auto;background-color:transparent;color:inherit;pointer-events:none}.sbb-sr__container{display:flex;height:inherit}.sbb-sr__grid{display:grid;grid-template-columns:20% 1fr 20%;grid-template-rows:auto auto}.sbb-sr__grid .sbb-sr-navigation-first-grid,.sbb-sr__grid .sbb-sr-navigation-last-grid{grid-row-start:1;position:relative}.sbb-sr__grid .sbb-sr-navigation-first-grid{grid-column:1/2}.sbb-sr__grid .sbb-sr-navigation-last-grid{grid-column:3/4}.sbb-sr__grid .sbb-sr__component{display:flex;grid-column:1/4;grid-row:1/3}.sbb-sr__grid .sbb-sr-grid-inner{display:grid;grid-template-columns:20% 60% 20%;grid-template-rows:auto 1fr;grid-gap:0}.sbb-sr__grid .sbb-sr-grid-inner .nav-grid{grid-column:2/3;grid-row:1/2;display:inherit}.sbb-sr__grid .sbb-sr-grid-inner .coaches-grid{grid-column:1/4;grid-row:2/3;display:inherit}.sbb-sr__grid .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper{overflow:hidden}.sbb-sr__navigation-control-button{position:absolute;z-index:10}.sbb-sr__navigation-control-button#first-tab-element{inset-inline-end:var(--sbb-spacing-fixed-2x)}.sbb-sr__navigation-control-button#last-tab-element{inset-inline-start:var(--sbb-spacing-fixed-2x)}.sbb-sr-navigation-wrapper{overflow:hidden;padding-block:0 var(--sbb-spacing-fixed-8x)}.sbb-sr-navigation{--sbb-scrollbar-thumb-width: .125rem;--sbb-scrollbar-thumb-width-hover: .25rem;--sbb-scrollbar-width-firefox: thin;--sbb-scrollbar-color: var(--sbb-color-black-alpha-30);--sbb-scrollbar-color-hover: var(--sbb-color-black-alpha-60);--sbb-scrollbar-track-color: transparent;--sbb-scrollbar-width: var(--sbb-spacing-fixed-3x)}.sbb-sr-navigation::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr-navigation::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr-navigation::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color, currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}.sbb-sr-navigation::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover, currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}.sbb-sr-navigation::-webkit-scrollbar-button,.sbb-sr-navigation::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-sr-navigation{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color, currentcolor) var(--sbb-scrollbar-track-color, transparent)}}.sbb-sr-navigation{--sbb-scrollbar-color: var(--sbb-color-white-alpha-0);display:flex;overflow:scroll hidden;position:relative}.sbb-sr-navigation__list-coaches{list-style:none;margin:0;padding:0;font-size:inherit;display:flex;flex-wrap:nowrap;gap:var(--sbb-spacing-fixed-1x);padding:.125rem}.sbb-sr__parent{--sbb-scrollbar-thumb-width: .125rem;--sbb-scrollbar-thumb-width-hover: .25rem;--sbb-scrollbar-width-firefox: thin;--sbb-scrollbar-color: var(--sbb-color-black-alpha-30);--sbb-scrollbar-color-hover: var(--sbb-color-black-alpha-60);--sbb-scrollbar-track-color: transparent;--sbb-scrollbar-width: var(--sbb-spacing-fixed-3x)}.sbb-sr__parent::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr__parent::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr__parent::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color, currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}.sbb-sr__parent::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover, currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}.sbb-sr__parent::-webkit-scrollbar-button,.sbb-sr__parent::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-sr__parent{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color, currentcolor) var(--sbb-scrollbar-track-color, transparent)}}.sbb-sr__parent{overflow-x:scroll;padding-block:var(--sbb-spacing-fixed-2x) var(--sbb-spacing-fixed-4x)}.sbb-sr__list-coaches{list-style:none;margin:0;padding:0;font-size:inherit;display:flex;gap:.25rem}.sbb-sr__item-coach{position:relative}.sbb-sr-popover{margin:0}.sbb-sr-coach-wrapper__table{outline:0}.sbb-sr.sbb-sr__grid--vertical{grid-template-columns:calc((var(--sbb-seat-reservation-coach-height) + 28) * var(--sbb-seat-reservation-one-px-rem)) 1fr;grid-template-rows:20% 60% 20%}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-navigation-first-grid{grid-column:2/3;grid-row-start:1}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-navigation-first-grid #first-tab-element{position:absolute;inset-block-end:var(--sbb-spacing-fixed-4x);inset-inline-start:var(--sbb-spacing-fixed-8x);inset-inline-end:initial;rotate:90deg}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-navigation-last-grid{grid-column:2/3;grid-row:3/4}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-navigation-last-grid #last-tab-element{inset-block-start:var(--sbb-spacing-fixed-4x);inset-inline-start:var(--sbb-spacing-fixed-8x);rotate:90deg}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-navigation-wrapper{padding-block-end:initial;padding-inline-start:var(--sbb-spacing-fixed-8x)}.sbb-sr.sbb-sr__grid--vertical .sbb-sr__component{grid-column:1/3;grid-row:1/4}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner{grid-template-columns:calc((var(--sbb-seat-reservation-coach-height) + 28) * var(--sbb-seat-reservation-one-px-rem)) 1fr;grid-template-rows:20% 60% 20%}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .nav-grid{grid-column:2/3;grid-row:2/3;height:100%}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .nav-grid .sbb-sr-navigation{display:block;overflow:hidden scroll;height:100%}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .nav-grid .sbb-sr-navigation .sbb-sr-navigation__list-coaches{flex-direction:column;padding:.125rem}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid{grid-column:1/2;grid-row:1/4;overflow:hidden;position:relative}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__parent{--sbb-scrollbar-thumb-width: .125rem;--sbb-scrollbar-thumb-width-hover: .25rem;--sbb-scrollbar-width-firefox: thin;--sbb-scrollbar-color: var(--sbb-color-black-alpha-30);--sbb-scrollbar-color-hover: var(--sbb-color-black-alpha-60);--sbb-scrollbar-track-color: transparent;--sbb-scrollbar-width: var(--sbb-spacing-fixed-3x)}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__parent::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__parent::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__parent::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color, currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__parent::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover, currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__parent::-webkit-scrollbar-button,.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__parent::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__parent{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color, currentcolor) var(--sbb-scrollbar-track-color, transparent)}}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__parent{overflow:hidden scroll;padding:0 var(--sbb-spacing-fixed-4x) 0 0;height:100%}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__parent .sbb-sr__list-coaches{rotate:90deg;transform-origin:calc((var(--sbb-seat-reservation-coach-height) / 2 - 3) * var(--sbb-seat-reservation-one-px-rem)) calc((var(--sbb-seat-reservation-coach-height) / 2 - 3) * var(--sbb-seat-reservation-one-px-rem))}`;
18
- let q = (() => {
19
- var h;
20
- let C = [R("sbb-seat-reservation")], u, m = [], d, f = E;
21
- return h = class extends f {
17
+ const T = A`*,:before,:after{box-sizing:border-box}:host{--sbb-seat-reservation-grid-size: 16px;--sbb-seat-reservation-height: 0;--sbb-seat-reservation-decks: 1;display:block;height:inherit}:host ::part(coach-floor){fill:var(--sbb-color-white)}@media (forced-colors: active){:host ::part(coach-floor){fill:transparent}}:host(:dir(rtl)) :not(.sbb-sr-place-ctrl--type-bicycle,.sbb-sr-place-ctrl--orientation-90,.sbb-sr-place-ctrl--orientation-270,.sbb-sr-place-ctrl--state-selected) ::part(coach-floor){rotate:180deg}[popover]:where(sbb-popover){margin:0;padding:0;border:none;width:auto;height:auto;background-color:transparent;color:inherit;pointer-events:none}.sbb-sr__container{display:flex;height:inherit}.sbb-sr__grid{display:grid;grid-template-columns:20% 1fr 20%;grid-template-rows:auto auto}.sbb-sr__grid .sbb-sr-navigation-first-grid,.sbb-sr__grid .sbb-sr-navigation-last-grid{grid-row-start:1;position:relative}.sbb-sr__grid .sbb-sr-navigation-first-grid{grid-column:1/2}.sbb-sr__grid .sbb-sr-navigation-last-grid{grid-column:3/4}.sbb-sr__grid .sbb-sr__component{display:flex;grid-column:1/4;grid-row:1/3}.sbb-sr__grid .sbb-sr-grid-inner{display:grid;grid-template-columns:20% 60% 20%;grid-template-rows:auto 1fr;grid-gap:0}.sbb-sr__grid .sbb-sr-grid-inner .nav-grid{grid-column:2/3;grid-row:1/2;display:inherit}.sbb-sr__grid .sbb-sr-grid-inner .coaches-grid{grid-column:1/4;grid-row:2/3;display:inherit}.sbb-sr__navigation-control-button{position:absolute;z-index:10}.sbb-sr__navigation-control-button#first-tab-element{inset-inline-end:calc(8 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__navigation-control-button#last-tab-element{inset-inline-start:calc(8 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr-navigation-wrapper{overflow:hidden;padding-block:0 calc(32 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr-navigation{--sbb-scrollbar-thumb-width: .125rem;--sbb-scrollbar-thumb-width-hover: .25rem;--sbb-scrollbar-width-firefox: thin;--sbb-scrollbar-color: var(--sbb-color-black-alpha-30);--sbb-scrollbar-color-hover: var(--sbb-color-black-alpha-60);--sbb-scrollbar-track-color: transparent;--sbb-scrollbar-width: var(--sbb-spacing-fixed-3x)}.sbb-sr-navigation::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr-navigation::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr-navigation::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color, currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}.sbb-sr-navigation::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover, currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}.sbb-sr-navigation::-webkit-scrollbar-button,.sbb-sr-navigation::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-sr-navigation{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color, currentcolor) var(--sbb-scrollbar-track-color, transparent)}}.sbb-sr-navigation{--sbb-scrollbar-color: var(--sbb-color-white-alpha-0);display:flex;overflow:scroll hidden;position:relative}.sbb-sr-navigation__list-coaches{list-style:none;margin:0;padding:0;font-size:inherit;display:flex;flex-wrap:nowrap;gap:calc(4 * var(--sbb-seat-reservation-one-px-rem, .0625rem));padding:calc(2 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__wrapper-coach-decks{display:flex;overflow:hidden;height:inherit}.sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels{display:flex;justify-content:space-between;height:calc(var(--sbb-seat-reservation-height) * var(--sbb-seat-reservation-one-px-rem, .0625rem));writing-mode:vertical-lr}.sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels b{height:calc(50% - 16 * var(--sbb-seat-reservation-one-px-rem, .0625rem));width:calc(20 * var(--sbb-seat-reservation-one-px-rem, .0625rem));margin-block-end:16px;rotate:180deg;text-align:center;line-height:calc(20 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__wrapper{--sbb-scrollbar-thumb-width: .125rem;--sbb-scrollbar-thumb-width-hover: .25rem;--sbb-scrollbar-width-firefox: thin;--sbb-scrollbar-color: var(--sbb-color-black-alpha-30);--sbb-scrollbar-color-hover: var(--sbb-color-black-alpha-60);--sbb-scrollbar-track-color: transparent;--sbb-scrollbar-width: var(--sbb-spacing-fixed-3x)}.sbb-sr__wrapper::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr__wrapper::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr__wrapper::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color, currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}.sbb-sr__wrapper::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover, currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}.sbb-sr__wrapper::-webkit-scrollbar-button,.sbb-sr__wrapper::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-sr__wrapper{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color, currentcolor) var(--sbb-scrollbar-track-color, transparent)}}.sbb-sr__wrapper{overflow-x:scroll;padding-block:calc(8 * var(--sbb-seat-reservation-one-px-rem, .0625rem)) calc(16 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__wrapper .sbb-sr__parent{display:flex;flex-direction:column;position:relative}.sbb-sr__list-decks{list-style:none;margin:0;padding:0;font-size:inherit;display:flex;flex-direction:column}.sbb-sr__list-decks--gap{gap:calc(48 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__list-item-deck{position:relative}.sbb-sr__list-coaches{list-style:none;margin:0;padding:0;font-size:inherit;display:flex;gap:calc(4 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr__item-coach{position:relative}.sbb-sr-popover{margin:0}.sbb-sr-coach-wrapper__table{outline:0}.sbb-sr.sbb-sr__grid--vertical{grid-template-columns:calc((var(--sbb-seat-reservation-height) + 24) * var(--sbb-seat-reservation-one-px-rem, .0625rem)) 1fr;grid-template-rows:20% 60% 20%}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-navigation-first-grid{grid-column:2/3;grid-row-start:1}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-navigation-first-grid #first-tab-element{position:absolute;inset-block-end:calc(16 * var(--sbb-seat-reservation-one-px-rem, .0625rem));inset-inline-start:calc(16 * var(--sbb-seat-reservation-one-px-rem, .0625rem));inset-inline-end:initial;rotate:90deg}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-navigation-last-grid{grid-column:2/3;grid-row:3/4}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-navigation-last-grid #last-tab-element{inset-block-start:calc(16 * var(--sbb-seat-reservation-one-px-rem, .0625rem));inset-inline-start:calc(16 * var(--sbb-seat-reservation-one-px-rem, .0625rem));rotate:90deg}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-navigation-wrapper{padding-block-end:initial;padding-inline-start:calc(16 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr.sbb-sr__grid--vertical .sbb-sr__component{grid-column:1/3;grid-row:1/4}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner{grid-template-columns:calc((var(--sbb-seat-reservation-height) + 24) * var(--sbb-seat-reservation-one-px-rem, .0625rem)) 1fr;grid-template-rows:20% 60% 20%}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .nav-grid{grid-column:2/3;grid-row:2/3;height:100%}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .nav-grid .sbb-sr-navigation{display:block;overflow:hidden scroll;height:100%}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .nav-grid .sbb-sr-navigation .sbb-sr-navigation__list-coaches{flex-direction:column;padding:calc(2 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid{grid-column:1/2;grid-row:1/4;overflow:hidden;position:relative}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks{flex-direction:column}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels{flex-direction:column-reverse;width:calc(100% - 24 * var(--sbb-seat-reservation-one-px-rem, .0625rem));height:initial}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper-deck-labels b{width:calc(50% - 16 * var(--sbb-seat-reservation-one-px-rem, .0625rem));height:calc(20 * var(--sbb-seat-reservation-one-px-rem, .0625rem));margin-bottom:16px;rotate:initial;writing-mode:initial}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper{--sbb-scrollbar-thumb-width: .125rem;--sbb-scrollbar-thumb-width-hover: .25rem;--sbb-scrollbar-width-firefox: thin;--sbb-scrollbar-color: var(--sbb-color-black-alpha-30);--sbb-scrollbar-color-hover: var(--sbb-color-black-alpha-60);--sbb-scrollbar-track-color: transparent;--sbb-scrollbar-width: var(--sbb-spacing-fixed-3x)}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color, currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover, currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper::-webkit-scrollbar-button,.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color, currentcolor) var(--sbb-scrollbar-track-color, transparent)}}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__wrapper{overflow:hidden scroll;height:100%;padding:0}.sbb-sr.sbb-sr__grid--vertical .sbb-sr-grid-inner .coaches-grid .sbb-sr__wrapper-coach-decks .sbb-sr__parent{rotate:90deg;transform-origin:calc((var(--sbb-seat-reservation-height) + 24 - 24 - 6 * (var(--sbb-seat-reservation-decks) - 1)) / 2 * var(--sbb-seat-reservation-one-px-rem, .0625rem)) calc((var(--sbb-seat-reservation-height) + 24 - 24 - 6 * (var(--sbb-seat-reservation-decks) - 1)) / 2 * var(--sbb-seat-reservation-one-px-rem, .0625rem))}`;
18
+ let K = (() => {
19
+ var d;
20
+ let $ = [E("sbb-seat-reservation")], w, f = [], c, k = P;
21
+ return d = class extends k {
22
22
  constructor() {
23
- super(...arguments), this._language = new A(this), this._notAreaElements = [
24
- "DRIVER_AREA_FULL",
23
+ super(...arguments), this._language = new y(this), this._notAreaElements = [
24
+ "DRIVER_AREA",
25
25
  "COACH_PASSAGE",
26
26
  "COACH_WALL_NO_PASSAGE",
27
27
  "COMPARTMENT_PASSAGE",
@@ -31,25 +31,25 @@ let q = (() => {
31
31
  ], this._notFixedRotatableAreaIcons = ["ENTRY_EXIT"];
32
32
  }
33
33
  willUpdate(r) {
34
- super.willUpdate(r), r.has("hasNavigation") && (this.hasNavigation ? this.shadowRoot?.querySelectorAll("table").forEach((s) => s.removeAttribute("tabindex")) : this.shadowRoot?.querySelectorAll("table").forEach((s) => s.setAttribute("tabindex", "0")));
34
+ super.willUpdate(r), r.has("hasNavigation") && (this.hasNavigation ? this.shadowRoot?.querySelectorAll("table").forEach((e) => e.removeAttribute("tabindex")) : this.shadowRoot?.querySelectorAll("table").forEach((e) => e.setAttribute("tabindex", "0")));
35
35
  }
36
36
  firstUpdated(r) {
37
37
  super.firstUpdated(r), this.updateComplete.then(() => {
38
- this.initNavigationSelectionByScrollEvent();
38
+ this.initPrepairSeatReservationData(), this.initNavigationSelectionByScrollEvent(), this.requestUpdate();
39
39
  });
40
40
  }
41
41
  render() {
42
- return y || this._determineBaseFontSize(), this._initVehicleSeatReservationConstruction(), this._coachesHtmlTemplate || null;
42
+ return R || this._determineBaseFontSize(), this._initVehicleSeatReservationConstruction(), this._coachesHtmlTemplate || null;
43
43
  }
44
44
  _determineBaseFontSize() {
45
- const s = 1 / parseInt(window.getComputedStyle(document.body).fontSize, 10);
46
- this.style?.setProperty("--sbb-seat-reservation-one-px-rem", `${s + "rem"}`);
45
+ const e = 1 / parseInt(window.getComputedStyle(document.body).fontSize, 10);
46
+ this.style?.setProperty("--sbb-seat-reservation-one-px-rem", `${e + "rem"}`);
47
47
  }
48
48
  _initVehicleSeatReservationConstruction() {
49
- const r = JSON.parse(JSON.stringify(this.seatReservation?.coachItems)), s = this.alignVertical ? "sbb-sr__grid--vertical" : "";
49
+ const r = this.alignVertical ? "sbb-sr__grid--vertical" : "";
50
50
  this._coachesHtmlTemplate = b`
51
51
  <div class="sbb-sr__container">
52
- <div class="sbb-sr sbb-sr__grid ${s}">
52
+ <div class="sbb-sr sbb-sr__grid ${r}">
53
53
  <div class="sbb-sr-navigation-first-grid">
54
54
  ${this._renderNavigationControlButton("DIRECTION_LEFT")}
55
55
  </div>
@@ -60,11 +60,23 @@ let q = (() => {
60
60
  <div class="sbb-sr-grid-inner">
61
61
  <div class="nav-grid">${this._renderNavigation()}</div>
62
62
  <div class="coaches-grid">
63
- <div class="sbb-sr__wrapper">
64
- <div id="sbb-sr__parent-area" class="sbb-sr__parent" tabindex="-1">
65
- <ul class="sbb-sr__list-coaches" role="presentation">
66
- ${this._renderCoaches(r)}
67
- </ul>
63
+ <div class="sbb-sr__wrapper-coach-decks">
64
+ <div class="sbb-sr__wrapper-deck-labels">${this._renderDeckLabels()}</div>
65
+ <div id="sbb-sr__wrapper-scrollarea" class="sbb-sr__wrapper">
66
+ <div id="sbb-sr__parent-area" class="sbb-sr__parent" tabindex="-1">
67
+ <ul
68
+ class="${m({
69
+ "sbb-sr__list-decks": !0,
70
+ "sbb-sr__list-decks--gap": this.hasMultipleDecks
71
+ })}"
72
+ >
73
+ ${this.seatReservations?.map((e, t) => b`<li class="sbb-sr__list-item-deck">
74
+ <ul class="sbb-sr__list-coaches" role="presentation">
75
+ ${this._renderCoaches(e, t)}
76
+ </ul>
77
+ </li>`)}
78
+ </ul>
79
+ </div>
68
80
  </div>
69
81
  </div>
70
82
  </div>
@@ -77,91 +89,100 @@ let q = (() => {
77
89
  </div>
78
90
  `;
79
91
  }
92
+ _renderDeckLabels() {
93
+ return this.hasMultipleDecks ? this.seatReservations.map((r) => {
94
+ const e = n(r.deckCoachLevel, this._language.current);
95
+ return b`<b aria-hidden="true">${e}</b>`;
96
+ }) : null;
97
+ }
80
98
  _renderNavigationControlButton(r) {
81
- if (!this.hasNavigation)
99
+ if (!this.hasNavigation || !this.seatReservations)
82
100
  return null;
83
- const s = r == "DIRECTION_RIGHT" ? "last-tab-element" : "first-tab-element", e = r == "DIRECTION_RIGHT" ? "arrow-right-small" : "arrow-left-small", t = r == "DIRECTION_RIGHT" ? n("SEAT_RESERVATION_END", this._language.current) : n("SEAT_RESERVATION_BEGIN", this._language.current);
84
- let i = !0;
85
- return (r == "DIRECTION_LEFT" && this.selectedCoachIndex > 0 || r == "DIRECTION_RIGHT" && this.selectedCoachIndex < this.seatReservation.coachItems.length - 1) && (i = !1), b`<sbb-secondary-button
101
+ const e = r == "DIRECTION_RIGHT" ? "last-tab-element" : "first-tab-element", t = r == "DIRECTION_RIGHT" ? "arrow-right-small" : "arrow-left-small", s = r == "DIRECTION_RIGHT" ? n("SEAT_RESERVATION_END", this._language.current) : n("SEAT_RESERVATION_BEGIN", this._language.current);
102
+ let a = !0;
103
+ return (r == "DIRECTION_LEFT" && this.selectedCoachIndex > 0 || r == "DIRECTION_RIGHT" && this.selectedCoachIndex < this.seatReservations[this.currSelectedDeckIndex].coachItems.length - 1) && (a = !1), b`<sbb-secondary-button
86
104
  @click="${() => this.navigateByDirectionBtn(r)}"
87
- id="${s}"
105
+ id="${e}"
88
106
  class="sbb-sr__navigation-control-button"
89
107
  size="s"
90
- icon-name="${e}"
108
+ icon-name="${t}"
91
109
  type="button"
92
- aria-label="${t}"
110
+ aria-label="${s}"
93
111
  role="contentinfo"
94
- .disabledInteractive="${i || v}"
112
+ .disabledInteractive="${a || v}"
95
113
  ></sbb-secondary-button>`;
96
114
  }
97
115
  _renderNavigation() {
98
- return this.hasNavigation ? b`<div class="sbb-sr-navigation-wrapper">
116
+ return !this.hasNavigation || !this.seatReservations ? null : b`<div class="sbb-sr-navigation-wrapper">
99
117
  <nav id="sbb-sr-navigation" class="sbb-sr-navigation">
100
118
  <ul
101
119
  id="sbb-sr__navigation-list-coaches"
102
120
  class="sbb-sr-navigation__list-coaches"
103
121
  aria-label="${n("SEAT_RESERVATION_NAVIGATION", this._language.current)}"
104
122
  >
105
- ${this.seatReservation?.coachItems.map((r, s) => {
106
- const e = this.getAvailableFreePlacesNumFromCoach(s);
123
+ ${this.seatReservations[this.currSelectedDeckIndex]?.coachItems.map((r, e) => {
124
+ const t = this.getAvailableFreePlacesNumFromCoach(e);
107
125
  return b`<li>
108
- <sbb-seat-reservation-navigation-coach
109
- @selectcoach=${(t) => this._onSelectNavCoach(t)}
110
- @focuscoach=${() => this._onFocusNavCoach()}
111
- class="${k({
112
- "sbb-sr__navigation-coach--hover-scroll": this.hoveredScrollCoachIndex === s
126
+ <sbb-seat-reservation-navigation-coach
127
+ @selectcoach=${(s) => this._onSelectNavCoach(s)}
128
+ @focuscoach=${() => this._onFocusNavCoach()}
129
+ class="${m({
130
+ "sbb-sr__navigation-coach--hover-scroll": this.hoveredScrollCoachIndex === e
113
131
  })}"
114
- index="${s}"
115
- coach-id="${r.id}"
116
- .freePlacesByType="${e}"
117
- .selected=${this.selectedCoachIndex === s}
118
- .focused=${this.focusedCoachIndex === s}
119
- .propertyIds="${r.propertyIds}"
120
- .travelClass="${r.travelClass}"
121
- ?driver-area="${!r.places?.length}"
122
- ?first="${s === 0}"
123
- ?last="${s === this.seatReservation?.coachItems.length - 1}"
124
- ?vertical="${this.alignVertical}"
125
- >
126
- </sbb-seat-reservation-navigation-coach>
127
- </li>`;
132
+ index="${e}"
133
+ coach-id="${r.id}"
134
+ .freePlacesByType="${t}"
135
+ .selected=${this.selectedCoachIndex === e}
136
+ .focused=${this.focusedCoachIndex === e}
137
+ .propertyIds="${r.propertyIds}"
138
+ .travelClass="${r.travelClass}"
139
+ ?driver-area="${!r.places?.length}"
140
+ ?first="${r?.driverAreaSide?.left}"
141
+ ?last="${r?.driverAreaSide?.right}"
142
+ ?vertical="${this.alignVertical}"
143
+ >
144
+ </sbb-seat-reservation-navigation-coach>
145
+ </li>`;
128
146
  })}
129
147
  </ul>
130
148
  </nav>
131
- </div>` : null;
149
+ </div>`;
132
150
  }
133
151
  /**
134
152
  *
135
153
  * @param coaches
136
154
  * @returns
137
155
  */
138
- _renderCoaches(r) {
139
- return r ? r.map((s, e) => b`
140
- <li class="sbb-sr__item-coach">${this._renderCoachElement(s, e)}</li>
156
+ _renderCoaches(r, e) {
157
+ const t = JSON.parse(JSON.stringify(r?.coachItems));
158
+ return t ? t.map((s, a) => b`
159
+ <li class="sbb-sr__item-coach">
160
+ ${this._renderCoachElement(s, a, e)}
161
+ </li>
141
162
  `) : null;
142
163
  }
143
- _renderCoachElement(r, s) {
144
- const e = this.getCalculatedDimension(r.dimension), t = this._getDescriptionTableCoach(r, s);
164
+ _renderCoachElement(r, e, t) {
165
+ const s = this.getCalculatedDimension(r.dimension), a = this._getDescriptionTableCoach(r, e);
145
166
  return b`<sbb-seat-reservation-scoped
146
167
  style=${g({
147
- "--sbb-seat-reservation-scoped-width": e.w,
148
- "--sbb-seat-reservation-scoped-height": e.h
168
+ "--sbb-seat-reservation-scoped-width": s.w,
169
+ "--sbb-seat-reservation-scoped-height": s.h
149
170
  })}
150
171
  >
151
- ${this._getRenderedCoachBorders(r, s)}
152
- ${this._getRenderedGraphicalElements(r.graphicElements || [], r.dimension, s)}
153
- ${this._getRenderedServiceElements(s, r.serviceElements)}
172
+ ${this._getRenderedCoachBorders(r)}
173
+ ${this._getRenderedGraphicalElements(r.graphicElements || [], r.dimension, e, t)}
174
+ ${this._getRenderedServiceElements(e, t, r.serviceElements)}
154
175
 
155
176
  <table
156
- @focus=${() => this.onFocusTableCoachAndPreselectPlace(s)}
157
- id="sbb-sr-coach-${s}"
177
+ @focus=${() => this.onFocusTableCoachAndPreselectPlace(e)}
178
+ id="sbb-sr-coach-${e}"
158
179
  class="sbb-sr-coach-wrapper__table"
159
- aria-describedby="sbb-sr-coach-caption-${s}"
180
+ aria-describedby="sbb-sr-coach-caption-${e}"
160
181
  >
161
- <caption id="sbb-sr-coach-caption-${s}" tabindex="-1">
162
- <sbb-screen-reader-only>${t}</sbb-screen-reader-only>
182
+ <caption id="sbb-sr-coach-caption-${e}" tabindex="-1">
183
+ <sbb-screen-reader-only>${a}</sbb-screen-reader-only>
163
184
  </caption>
164
- ${this._getRenderedRowPlaces(r, s)}
185
+ ${this._getRenderedRowPlaces(r, e, t)}
165
186
  </table>
166
187
  </sbb-seat-reservation-scoped>`;
167
188
  }
@@ -169,15 +190,15 @@ let q = (() => {
169
190
  * @returns Returns the border graphic (COACH_BORDER_MIDDLE) of a coach with calculated border gap and coach width,
170
191
  * depending on whether the coach is with a driver area or without.
171
192
  */
172
- _getRenderedCoachBorders(r, s) {
173
- const i = r.graphicElements?.find((c) => c.icon === "DRIVER_AREA_FULL"), a = i ? r.dimension.w - i.dimension.w - 1 : r.dimension.w - 2, o = (r.dimension.h + this.coachBorderOffset * 2) * this.baseGridSize, l = s === 0 && i ? i?.dimension.w * this.baseGridSize : this.baseGridSize;
193
+ _getRenderedCoachBorders(r) {
194
+ const s = r.graphicElements?.find((l) => l.icon === "DRIVER_AREA"), a = s ? r.dimension.w - s.dimension.w - 1 : r.dimension.w - 2, o = (r.dimension.h + this.coachBorderOffset * 2) * this.baseGridSize, i = s && s.position.x === 0 ? s?.dimension.w * this.baseGridSize : this.baseGridSize;
174
195
  return b`
175
196
  <sbb-seat-reservation-graphic
176
197
  style=${g({
177
198
  "--sbb-seat-reservation-graphic-width": a * this.baseGridSize,
178
199
  "--sbb-seat-reservation-graphic-height": o,
179
200
  "--sbb-seat-reservation-graphic-top": this.coachBorderPadding * -1,
180
- "--sbb-seat-reservation-graphic-left": l,
201
+ "--sbb-seat-reservation-graphic-left": i,
181
202
  "--sbb-seat-reservation-graphic-position": "absolute"
182
203
  })}
183
204
  name="COACH_BORDER_MIDDLE"
@@ -186,54 +207,58 @@ let q = (() => {
186
207
  ></sbb-seat-reservation-graphic>
187
208
  `;
188
209
  }
189
- _getRenderedRowPlaces(r, s) {
210
+ _getRenderedRowPlaces(r, e, t) {
190
211
  if (!r.places)
191
212
  return null;
192
- const e = {};
193
- for (const t of r.places)
194
- e[t.position.y] ? e[t.position.y].push(t) : e[t.position.y] = [t];
195
- return Object.values(e).map((t, i) => b`
196
- <tr id="row-${s}-${t[0].position.y}" data-row-index=${i}>
197
- ${this._getRenderedColumnPlaces(t, s)}
213
+ const s = {};
214
+ for (const a of r.places)
215
+ s[a.position.y] ? s[a.position.y].push(a) : s[a.position.y] = [a];
216
+ return Object.values(s).map((a, o) => b`
217
+ <tr id="row-${e}-${a[0].position.y}" data-row-index=${o}>
218
+ ${this._getRenderedColumnPlaces(a, e, t)}
198
219
  </tr>
199
- `).flatMap((t) => t);
220
+ `).flatMap((a) => a);
200
221
  }
201
- _getRenderedColumnPlaces(r, s) {
202
- return r.sort((e, t) => Number(e.position.x) - Number(t.position.x)), r?.map((e, t) => {
203
- const i = this.getCalculatedDimension(e.dimension), a = this.getCalculatedPosition(e.position), o = this.alignVertical ? -90 : 0;
222
+ _getRenderedColumnPlaces(r, e, t) {
223
+ return r.sort((s, a) => Number(s.position.x) - Number(a.position.x)), r?.map((s, a) => {
224
+ const o = this.getCalculatedDimension(s.dimension), i = this.getCalculatedPosition(s.position), l = this.alignVertical ? -90 : 0;
204
225
  return b`
205
- <td id="cell-${s}-${e.position.y}-${t}" class="graphical-element">
226
+ <td
227
+ id="cell-${t}-${e}-${s.position.y}-${a}"
228
+ class="graphical-element"
229
+ >
206
230
  <sbb-seat-reservation-place-control
207
231
  style=${g({
208
- "--sbb-seat-reservation-place-control-width": i.w,
209
- "--sbb-seat-reservation-place-control-height": i.h,
210
- "--sbb-seat-reservation-place-control-top": a.y,
211
- "--sbb-seat-reservation-place-control-left": a.x
232
+ "--sbb-seat-reservation-place-control-width": o.w,
233
+ "--sbb-seat-reservation-place-control-height": o.h,
234
+ "--sbb-seat-reservation-place-control-top": i.y,
235
+ "--sbb-seat-reservation-place-control-left": i.x
212
236
  })}
213
- @selectplace=${(l) => this._onSelectPlace(l)}
237
+ @selectplace=${(h) => this._onSelectPlace(h)}
214
238
  exportparts="sbb-sr-place-part"
215
- id="seat-reservation__place-button-${s}-${e.number}"
239
+ id="seat-reservation__place-button-${t}-${e}-${s.number}"
216
240
  class="seat-reservation-place-control"
217
- data-cell-id="${s}-${e.position.y}-${t}"
218
- text=${e.number}
219
- type=${e.type}
220
- state=${e.state}
221
- width=${e.dimension.w * this.baseGridSize}
222
- height=${e.dimension.h * this.baseGridSize}
223
- rotation=${e.rotation ?? v}
224
- text-rotation=${o}
225
- coach-index=${s}
226
- .propertyIds=${e.propertyIds}
241
+ data-cell-id="${e}-${s.position.y}-${a}"
242
+ text=${s.number}
243
+ type=${s.type}
244
+ state=${s.state}
245
+ width=${s.dimension.w * this.baseGridSize}
246
+ height=${s.dimension.h * this.baseGridSize}
247
+ rotation=${s.rotation ?? v}
248
+ text-rotation=${l}
249
+ coach-index=${e}
250
+ deck-index=${t}
251
+ .propertyIds=${s.propertyIds}
227
252
  .preventClick=${this.preventPlaceClick}
228
253
  ></sbb-seat-reservation-place-control>
229
254
  </td>
230
255
  `;
231
256
  });
232
257
  }
233
- _getRenderedGraphicalElements(r, s, e) {
234
- return r ? r?.map((t) => {
235
- const i = t.icon ?? "", a = t.rotation || 0, o = this._notFixedRotatableAreaIcons.indexOf(t.icon) === -1, l = this.alignVertical && o ? a - 90 : a;
236
- return this._notAreaElements.findIndex((c) => c === i) > -1 ? this._getRenderElementWithoutArea(t, a, s) : this._getRenderElementWithArea(t, l, s, e);
258
+ _getRenderedGraphicalElements(r, e, t, s) {
259
+ return r ? r?.map((a) => {
260
+ const o = a.icon ?? "", i = a.rotation || 0, l = this._notFixedRotatableAreaIcons.indexOf(a.icon) === -1, h = this.alignVertical && l ? i - 90 : i;
261
+ return this._notAreaElements.findIndex((p) => p === o) > -1 ? this._getRenderElementWithoutArea(a, i, e) : this._getRenderElementWithArea(a, h, e, t, s);
237
262
  }) : null;
238
263
  }
239
264
  /**
@@ -244,95 +269,73 @@ let q = (() => {
244
269
  * @param coachIndex used to generate a unique id for the popover trigger
245
270
  * @private
246
271
  */
247
- _getRenderElementWithArea(r, s, e, t) {
248
- const i = r.icon?.indexOf("TABLE") === -1, a = r.icon && i ? r.icon : null, o = a !== "ENTRY_EXIT", l = r.icon ? n(r.icon, this._language.current) : v, c = this.getCalculatedDimension(r.dimension, e, !0, o), p = this.getCalculatedPosition(r.position, r.dimension, e, !0), w = `popover-trigger-${t}-${p.x}-${p.y}`;
249
- let _ = "free";
250
- return r.position.y === this.coachBorderOffset * -1 ? _ = "upper-border" : r.position.y + r.dimension.h === e.h + this.coachBorderOffset && (_ = "lower-border"), b`
272
+ _getRenderElementWithArea(r, e, t, s, a) {
273
+ const o = r.icon?.indexOf("TABLE") === -1, i = r.icon && o ? r.icon : null, l = i !== "ENTRY_EXIT", h = r.icon ? n(r.icon, this._language.current) : v, p = this.getCalculatedDimension(r.dimension, t, !0, l), _ = this.getCalculatedPosition(r.position, r.dimension, t, !0), x = `popover-trigger-${a}-${s}-${_.x}-${_.y}`;
274
+ let u = "free";
275
+ return r.position.y === this.coachBorderOffset * -1 ? u = "upper-border" : r.position.y + r.dimension.h === t.h + this.coachBorderOffset && (u = "lower-border"), b`
251
276
  <sbb-seat-reservation-area
252
- id="${w}"
277
+ id="${x}"
278
+ class="${m({ "sbb-seat-reservation-area--cursor-pointer": i !== null })}"
253
279
  style=${g({
254
- "--sbb-seat-reservation-area-width": c.w,
255
- "--sbb-seat-reservation-area-height": c.h,
256
- "--sbb-seat-reservation-area-top": p.y,
257
- "--sbb-seat-reservation-area-left": p.x
280
+ "--sbb-seat-reservation-area-width": p.w,
281
+ "--sbb-seat-reservation-area-height": p.h,
282
+ "--sbb-seat-reservation-area-top": _.y,
283
+ "--sbb-seat-reservation-area-left": _.x
258
284
  })}
259
- mounting=${_}
285
+ mounting=${u}
260
286
  background="dark"
261
287
  aria-hidden="true"
262
288
  >
263
- ${a ? b`
289
+ ${i ? b`
264
290
  <sbb-seat-reservation-graphic
265
- style=${g({
266
- "--sbb-seat-reservation--cursor-pointer": "pointer"
267
- })}
268
- name=${a}
291
+ name=${i}
269
292
  width=${this.baseGridSize}
270
293
  height=${this.baseGridSize}
271
- rotation=${s}
294
+ rotation=${e}
272
295
  role="img"
273
296
  aria-hidden="true"
274
297
  ></sbb-seat-reservation-graphic>
275
298
  ` : v}
276
299
  </sbb-seat-reservation-area>
277
- ${this._popover(w, l)}
278
- `;
279
- }
280
- /**
281
- * Creates a popover for extra service information
282
- * @param triggerId
283
- * @param popoverContent
284
- * @private
285
- */
286
- _popover(r, s) {
287
- return b`
288
- <sbb-popover trigger="${r}">
289
- <p class="sbb-text-s sbb-sr-popover">${s}</p>
290
- </sbb-popover>
300
+ ${i ? this._popover(x, h) : v}
291
301
  `;
292
302
  }
293
- /**
294
- * trigger to close all opened popovers (normally only one is opened at a time)
295
- * @private
296
- */
297
- _closePopover() {
298
- this.shadowRoot?.querySelectorAll('sbb-popover[data-state="opened"]').forEach((r) => r.setAttribute("data-state", "closed"));
299
- }
300
- _getRenderElementWithoutArea(r, s, e) {
301
- const t = this.getCalculatedDimension(r.dimension, e), i = this.getCalculatedPosition(r.position, r.dimension, e), a = r.icon && r.icon.indexOf("DRIVER_AREA") === -1 ? r.icon : r.icon?.concat("_", this.seatReservation.vehicleType);
303
+ _getRenderElementWithoutArea(r, e, t) {
304
+ const s = this.getCalculatedDimension(r.dimension, t), a = this.getCalculatedPosition(r.position, r.dimension, t), o = r.icon && r.icon.indexOf("DRIVER_AREA") === -1 ? r.icon : r.icon?.concat("_", this.seatReservations[this.currSelectedDeckIndex].vehicleType);
302
305
  return b` <sbb-seat-reservation-graphic
303
306
  style=${g({
304
- "--sbb-seat-reservation-graphic-width": t.w,
305
- "--sbb-seat-reservation-graphic-height": t.h,
306
- "--sbb-seat-reservation-graphic-top": i.y,
307
- "--sbb-seat-reservation-graphic-left": i.x,
307
+ "--sbb-seat-reservation-graphic-width": s.w,
308
+ "--sbb-seat-reservation-graphic-height": s.h,
309
+ "--sbb-seat-reservation-graphic-top": a.y,
310
+ "--sbb-seat-reservation-graphic-left": a.x,
308
311
  "--sbb-seat-reservation-graphic-position": "absolute"
309
312
  })}
310
- name=${a ?? v}
311
- rotation=${s}
313
+ name=${o ?? v}
314
+ rotation=${e}
312
315
  aria-hidden="true"
313
316
  ?stretch=${!0}
314
317
  ></sbb-seat-reservation-graphic>`;
315
318
  }
316
- _getRenderedServiceElements(r, s) {
317
- return s ? s?.map((e) => {
318
- const t = e.icon ? n(e.icon, this._language.current) : null, i = this.getCalculatedDimension(e.dimension), a = this.getCalculatedPosition(e.position), o = e.rotation || 0, l = this.alignVertical ? o - 90 : o, c = `popover-trigger-${r}-${a.x}-${a.y}`;
319
+ _getRenderedServiceElements(r, e, t) {
320
+ return t ? t?.map((s) => {
321
+ const a = s.icon ? n(s.icon, this._language.current) : null, o = this.getCalculatedDimension(s.dimension), i = this.getCalculatedPosition(s.position), l = s.rotation || 0, h = this.alignVertical ? l - 90 : l, p = `popover-trigger-${e}-${r}-${i.x}-${i.y}`;
319
322
  return b`
320
323
  <sbb-seat-reservation-graphic
321
- id="${c}"
324
+ id="${p}"
322
325
  style=${g({
323
- "--sbb-seat-reservation-graphic-width": i.w,
324
- "--sbb-seat-reservation-graphic-height": i.h,
325
- "--sbb-seat-reservation-graphic-top": a.y,
326
- "--sbb-seat-reservation-graphic-left": a.x,
327
- "--sbb-seat-reservation-graphic-position": "absolute",
328
- "--sbb-seat-reservation--cursor-pointer": "pointer"
326
+ "--sbb-seat-reservation-graphic-width": o.w,
327
+ "--sbb-seat-reservation-graphic-height": o.h,
328
+ "--sbb-seat-reservation-graphic-top": i.y,
329
+ "--sbb-seat-reservation-graphic-left": i.x,
330
+ "--sbb-seat-reservation-graphic-position": "absolute"
329
331
  })}
330
- name=${e.icon ?? v}
331
- .rotation=${l}
332
+ class="sbb-seat-reservation-graphic--cursor-pointer"
333
+ name=${s.icon ?? v}
334
+ .rotation=${h}
332
335
  role="img"
333
336
  aria-hidden="true"
334
337
  ></sbb-seat-reservation-graphic>
335
- ${this._popover(c, t)}
338
+ ${this._popover(p, a)}
336
339
  `;
337
340
  }) : null;
338
341
  }
@@ -342,46 +345,66 @@ let q = (() => {
342
345
  * @param selectPlaceEvent
343
346
  */
344
347
  _onSelectPlace(r) {
345
- const s = r.detail;
346
- this.preventCoachScrollByPlaceClick = !0, this.isCoachGridFocusable = !1, this.preventPlaceClick || (this.updateSelectedSeatReservationPlaces(s), this.updateCurrentSelectedPlaceInCoach(s));
348
+ const e = r.detail;
349
+ this.preventCoachScrollByPlaceClick = !0, this.isCoachGridFocusable = !1, this.preventPlaceClick || (this.currSelectedDeckIndex = e.deckIndex, this.updateSelectedSeatReservationPlaces(e), this.updateCurrentSelectedPlaceInCoach(e));
347
350
  }
348
351
  _onSelectNavCoach(r) {
349
- const s = r.detail;
350
- this.isKeyboardNavigation = !1, s !== null && s !== this.currSelectedCoachIndex ? (this.unfocusPlaceElement(), this.scrollToSelectedNavCoach(s)) : s === this.currSelectedCoachIndex && (this.updateCurrentSelectedCoach(), this.preselectPlaceInCoach()), this._closePopover();
352
+ const e = r.detail;
353
+ this.isKeyboardNavigation = !1, e !== null && e !== this.currSelectedCoachIndex ? (this.unfocusPlaceElement(), this.scrollToSelectedNavCoach(e)) : e === this.currSelectedCoachIndex && (this.updateCurrentSelectedCoach(), this.preselectPlaceInCoach()), this._closePopover();
351
354
  }
352
355
  _onFocusNavCoach() {
353
356
  this.preventCoachScrollByPlaceClick ? this.focusPlaceElement(this.currSelectedPlace) : this.preselectPlaceInCoach(), this.isAutoScrolling = !1;
354
357
  }
355
- _getDescriptionTableCoach(r, s) {
358
+ /**
359
+ * Creates a popover for extra service information
360
+ * @param triggerId
361
+ * @param popoverContent
362
+ * @private
363
+ */
364
+ _popover(r, e) {
365
+ return b`
366
+ <sbb-popover trigger="${r}">
367
+ <p class="sbb-text-s sbb-sr-popover">${e}</p>
368
+ </sbb-popover>
369
+ `;
370
+ }
371
+ /**
372
+ * trigger to close all opened popovers (normally only one is opened at a time)
373
+ * @private
374
+ */
375
+ _closePopover() {
376
+ this.shadowRoot?.querySelectorAll('sbb-popover[data-state="opened"]').forEach((r) => r.setAttribute("data-state", "closed"));
377
+ }
378
+ _getDescriptionTableCoach(r, e) {
356
379
  if (!r.places?.length)
357
380
  return n("COACH_BLOCKED_TABLE_CAPTION", this._language.current, [
358
381
  r.id
359
382
  ]);
360
- let e;
361
- const t = this._getTitleDescriptionListString(r.graphicElements), i = this._getTitleDescriptionListString(r.serviceElements);
362
- if (e = n("COACH_TABLE_CAPTION", this._language.current, [
383
+ let t;
384
+ const s = this._getTitleDescriptionListString(r.graphicElements), a = this._getTitleDescriptionListString(r.serviceElements);
385
+ if (t = n("COACH_TABLE_CAPTION", this._language.current, [
363
386
  r.id
364
387
  ]), !this.hasNavigation) {
365
- const a = this.getAvailableFreePlacesNumFromCoach(s), o = n("COACH_AVAILABLE_NUMBER_OF_PLACES", this._language.current, [a.seats, a.bicycles]);
366
- e = e.concat(". ").concat(o).concat(". ");
388
+ const o = this.getAvailableFreePlacesNumFromCoach(e), i = n("COACH_AVAILABLE_NUMBER_OF_PLACES", this._language.current, [o.seats, o.bicycles]);
389
+ t = t.concat(". ").concat(i).concat(". ");
367
390
  }
368
- return (t || i) && (e += ". " + n("COACH_AVAILABLE_SERVICES", this._language.current) + ": ", e += i + ", " + t + "."), e;
391
+ return (s || a) && (t += ". " + n("COACH_AVAILABLE_SERVICES", this._language.current) + ": ", t += a + ", " + s + "."), t;
369
392
  }
370
393
  _getTitleDescriptionListString(r) {
371
- const s = [];
372
- return r?.map((e) => {
373
- const t = e.icon;
374
- if (!t)
394
+ const e = [];
395
+ return r?.map((t) => {
396
+ const s = t.icon;
397
+ if (!s)
375
398
  return null;
376
- const i = s.indexOf(t) > -1, a = n(e.icon, this._language.current), o = this._notFixedRotatableAreaIcons.indexOf(t) === -1 && this._notAreaElements.indexOf(t) === -1;
377
- return i || s.push(e.icon), a && !i && o ? a : null;
378
- }).filter((e) => !!e).join(", ");
399
+ const a = e.indexOf(s) > -1, o = n(t.icon, this._language.current), i = this._notFixedRotatableAreaIcons.indexOf(s) === -1 && this._notAreaElements.indexOf(s) === -1;
400
+ return a || e.push(t.icon), o && !a && i ? o : null;
401
+ }).filter((t) => !!t).join(", ");
379
402
  }
380
- }, d = h, (() => {
381
- const r = typeof Symbol == "function" && Symbol.metadata ? Object.create(f[Symbol.metadata] ?? null) : void 0;
382
- $(null, u = { value: d }, C, { kind: "class", name: d.name, metadata: r }, null, m), d = u.value, r && Object.defineProperty(d, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r });
383
- })(), h.styles = P, x(d, m), d;
403
+ }, c = d, (() => {
404
+ const r = typeof Symbol == "function" && Symbol.metadata ? Object.create(k[Symbol.metadata] ?? null) : void 0;
405
+ C(null, w = { value: c }, $, { kind: "class", name: c.name, metadata: r }, null, f), c = w.value, r && Object.defineProperty(c, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r });
406
+ })(), d.styles = T, S(c, f), c;
384
407
  })();
385
408
  export {
386
- q as SbbSeatReservationElement
409
+ K as SbbSeatReservationElement
387
410
  };