@descope/web-components-ui 1.0.295 → 1.0.297

Sign up to get free protection for your applications and to get access to all the features.
Files changed (213) hide show
  1. package/dist/cjs/index.cjs.js +586 -359
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.d.ts +2 -1
  4. package/dist/index.esm.js +569 -341
  5. package/dist/index.esm.js.map +1 -1
  6. package/dist/umd/1224.js +1 -1
  7. package/dist/umd/1438.js +16 -9
  8. package/dist/umd/1438.js.LICENSE.txt +12 -0
  9. package/dist/umd/1612.js +338 -0
  10. package/dist/umd/1621.js +2 -2
  11. package/dist/umd/2362.js +129 -0
  12. package/dist/umd/3830.js +2 -0
  13. package/dist/umd/{3003.js.LICENSE.txt → 3830.js.LICENSE.txt} +12 -0
  14. package/dist/umd/3951.js +116 -4
  15. package/dist/umd/3951.js.LICENSE.txt +18 -0
  16. package/dist/umd/{9211.js → 4024.js} +5 -5
  17. package/dist/umd/{2775.js → 4028.js} +10 -10
  18. package/dist/umd/4028.js.LICENSE.txt +23 -0
  19. package/dist/umd/4052.js +338 -0
  20. package/dist/umd/4392.js +1 -0
  21. package/dist/umd/4569.js +1 -0
  22. package/dist/umd/4746.js +124 -0
  23. package/dist/umd/{6091.js.LICENSE.txt → 4746.js.LICENSE.txt} +6 -0
  24. package/dist/umd/4978.js +1 -0
  25. package/dist/umd/{4595.js → 5135.js} +93 -5
  26. package/dist/umd/{2775.js.LICENSE.txt → 5135.js.LICENSE.txt} +2 -2
  27. package/dist/umd/5517.js +1 -1
  28. package/dist/umd/5806.js +4 -4
  29. package/dist/umd/5910.js +1 -1
  30. package/dist/umd/63.js +147 -1
  31. package/dist/umd/63.js.LICENSE.txt +13 -1
  32. package/dist/umd/6594.js +2 -0
  33. package/dist/umd/{1940.js.LICENSE.txt → 6594.js.LICENSE.txt} +1 -1
  34. package/dist/umd/6770.js +4 -4
  35. package/dist/umd/7056.js +376 -5
  36. package/dist/umd/7056.js.LICENSE.txt +6 -0
  37. package/dist/umd/7164.js +148 -0
  38. package/dist/umd/{2106.js.LICENSE.txt → 7164.js.LICENSE.txt} +1 -7
  39. package/dist/umd/7531.js +2 -2
  40. package/dist/umd/7911.js +4 -4
  41. package/dist/umd/7911.js.LICENSE.txt +6 -0
  42. package/dist/umd/{3092.js → 8191.js} +40 -5
  43. package/dist/umd/8866.js +97 -5
  44. package/dist/umd/8866.js.LICENSE.txt +12 -0
  45. package/dist/umd/9092.js +440 -12
  46. package/dist/umd/9092.js.LICENSE.txt +6 -0
  47. package/dist/umd/{1940.js → 9314.js} +126 -7
  48. package/dist/umd/9314.js.LICENSE.txt +11 -0
  49. package/dist/umd/9423.js +608 -0
  50. package/dist/umd/9423.js.LICENSE.txt +23 -0
  51. package/dist/umd/9562.js +338 -0
  52. package/dist/umd/9562.js.LICENSE.txt +11 -0
  53. package/dist/umd/DescopeDev.js +1 -0
  54. package/dist/umd/boolean-fields-descope-boolean-field-internal-index-js.js +1 -1
  55. package/dist/umd/boolean-fields-descope-checkbox-index-js.js +2 -1
  56. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +2 -1
  57. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js +1 -1
  58. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-internal-index-js.js +1 -1
  59. package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js +1 -1
  60. package/dist/umd/button-selection-group-fields-descope-button-selection-group-internal-index-js.js +1 -1
  61. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +1 -1
  62. package/dist/umd/descope-avatar-index-js.js +1 -1
  63. package/dist/umd/descope-badge-index-js.js +1 -1
  64. package/dist/umd/descope-button-index-js.js +338 -1
  65. package/dist/umd/descope-button-index-js.js.LICENSE.txt +11 -0
  66. package/dist/umd/descope-combo-box-index-js.js +113 -1
  67. package/dist/umd/descope-container-index-js.js +1 -1
  68. package/dist/umd/descope-date-picker-index-js.js +1 -1
  69. package/dist/umd/descope-divider-index-js.js +1 -1
  70. package/dist/umd/descope-email-field-index-js.js +54 -1
  71. package/dist/umd/descope-email-field-index-js.js.LICENSE.txt +11 -0
  72. package/dist/umd/descope-grid-descope-grid-custom-column-index-js.js +90 -1
  73. package/dist/umd/{1735.js.LICENSE.txt → descope-grid-descope-grid-custom-column-index-js.js.LICENSE.txt} +2 -2
  74. package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js +2 -1
  75. package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js.LICENSE.txt +17 -0
  76. package/dist/umd/descope-grid-descope-grid-text-column-index-js.js +90 -1
  77. package/dist/umd/descope-grid-descope-grid-text-column-index-js.js.LICENSE.txt +17 -0
  78. package/dist/umd/descope-grid-index-js.js +1 -1
  79. package/dist/umd/descope-image-index-js.js +1 -1
  80. package/dist/umd/descope-link-index-js.js +1 -1
  81. package/dist/umd/descope-loader-linear-index-js.js +1 -1
  82. package/dist/umd/descope-loader-radial-index-js.js +1 -1
  83. package/dist/umd/descope-logo-index-js.js +1 -1
  84. package/dist/umd/descope-modal-index-js.js +1 -1
  85. package/dist/umd/descope-multi-select-combo-box-index-js.js +1 -1
  86. package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
  87. package/dist/umd/descope-new-password-index-js.js +1 -1
  88. package/dist/umd/descope-notification-descope-notification-card-index-js.js +1 -1
  89. package/dist/umd/descope-notification-index-js.js +1 -1
  90. package/dist/umd/descope-notp-image-index-js.js +1 -1
  91. package/dist/umd/descope-number-field-index-js.js +1 -1
  92. package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +1 -1
  93. package/dist/umd/descope-passcode-index-js.js +37 -1
  94. package/dist/umd/descope-passcode-index-js.js.LICENSE.txt +11 -0
  95. package/dist/umd/descope-password-index-js.js +1 -1
  96. package/dist/umd/descope-policy-validation-index-js.js +1 -1
  97. package/dist/umd/descope-recaptcha-index-js.js +1 -1
  98. package/dist/umd/descope-text-area-index-js.js +1 -1
  99. package/dist/umd/descope-text-field-index-js.js +37 -1
  100. package/dist/umd/descope-text-field-index-js.js.LICENSE.txt +11 -0
  101. package/dist/umd/descope-totp-image-index-js.js +1 -1
  102. package/dist/umd/descope-upload-file-index-js.js +1 -1
  103. package/dist/umd/descope-user-attribute-index-js.js +1 -1
  104. package/dist/umd/descope-user-auth-method-index-js.js +1 -1
  105. package/dist/umd/index.js +1 -1
  106. package/dist/umd/mapping-fields-descope-mappings-field-descope-mapping-item-index-js.js +1 -1
  107. package/dist/umd/mapping-fields-descope-mappings-field-descope-mappings-field-internal-index-js.js +1 -1
  108. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -126
  109. package/dist/umd/mapping-fields-descope-saml-group-mappings-descope-saml-group-mappings-internal-index-js.js +1 -1
  110. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
  111. package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
  112. package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
  113. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +37 -1
  114. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js.LICENSE.txt +11 -0
  115. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +1 -1
  116. package/dist/umd/text-components-descope-markdown-content-index-js.js +1 -0
  117. package/dist/umd/text-components-descope-text-index-js.js +1 -0
  118. package/package.json +4 -2
  119. package/src/components/descope-divider/DividerClass.js +1 -1
  120. package/src/components/descope-divider/index.js +1 -1
  121. package/src/components/descope-link/LinkClass.js +1 -1
  122. package/src/components/descope-link/index.js +1 -1
  123. package/src/components/descope-user-attribute/UserAttributeClass.js +1 -1
  124. package/src/components/descope-user-attribute/index.js +1 -1
  125. package/src/components/descope-user-auth-method/UserAuthMethodClass.js +3 -2
  126. package/src/components/descope-user-auth-method/index.js +1 -1
  127. package/src/components/mapping-fields/descope-mappings-field/MappingsFieldClass.js +1 -1
  128. package/src/components/mapping-fields/descope-mappings-field/index.js +1 -1
  129. package/src/components/text-components/createBaseTextClass.js +26 -0
  130. package/src/components/text-components/descope-markdown-content/MarkdownContentClass.js +98 -0
  131. package/src/components/text-components/descope-markdown-content/helpers.js +41 -0
  132. package/src/components/text-components/descope-markdown-content/index.js +5 -0
  133. package/src/components/text-components/descope-text/TextClass.js +34 -0
  134. package/src/components/text-components/hideWhenEmptyMixin.js +17 -0
  135. package/src/dev/index.js +1 -0
  136. package/src/index.cjs.js +2 -1
  137. package/src/index.d.ts +2 -1
  138. package/src/index.js +2 -1
  139. package/src/mixins/normalizeBooleanAttributesMixin.js +1 -1
  140. package/src/theme/components/index.js +2 -0
  141. package/src/theme/components/markdownContent.js +84 -0
  142. package/src/theme/components/text.js +1 -1
  143. package/dist/umd/1000.js +0 -1
  144. package/dist/umd/1037.js +0 -2
  145. package/dist/umd/1721.js +0 -1
  146. package/dist/umd/1735.js +0 -73
  147. package/dist/umd/2066.js +0 -2
  148. package/dist/umd/2106.js +0 -73
  149. package/dist/umd/2269.js +0 -2
  150. package/dist/umd/2269.js.LICENSE.txt +0 -5
  151. package/dist/umd/2481.js +0 -1
  152. package/dist/umd/262.js +0 -2
  153. package/dist/umd/262.js.LICENSE.txt +0 -5
  154. package/dist/umd/3003.js +0 -2
  155. package/dist/umd/3208.js +0 -2
  156. package/dist/umd/3208.js.LICENSE.txt +0 -5
  157. package/dist/umd/322.js +0 -90
  158. package/dist/umd/322.js.LICENSE.txt +0 -5
  159. package/dist/umd/3249.js +0 -2
  160. package/dist/umd/3249.js.LICENSE.txt +0 -5
  161. package/dist/umd/3373.js +0 -2
  162. package/dist/umd/3373.js.LICENSE.txt +0 -5
  163. package/dist/umd/3585.js +0 -1
  164. package/dist/umd/3878.js +0 -1
  165. package/dist/umd/4201.js +0 -1
  166. package/dist/umd/422.js +0 -2
  167. package/dist/umd/422.js.LICENSE.txt +0 -5
  168. package/dist/umd/4226.js +0 -114
  169. package/dist/umd/4447.js +0 -1
  170. package/dist/umd/4567.js +0 -1
  171. package/dist/umd/4577.js +0 -1
  172. package/dist/umd/4595.js.LICENSE.txt +0 -11
  173. package/dist/umd/4803.js +0 -1
  174. package/dist/umd/4905.js +0 -2
  175. package/dist/umd/4905.js.LICENSE.txt +0 -5
  176. package/dist/umd/4946.js +0 -2
  177. package/dist/umd/4946.js.LICENSE.txt +0 -5
  178. package/dist/umd/6091.js +0 -124
  179. package/dist/umd/6606.js +0 -17
  180. package/dist/umd/6687.js +0 -9
  181. package/dist/umd/6687.js.LICENSE.txt +0 -5
  182. package/dist/umd/6977.js +0 -2
  183. package/dist/umd/6977.js.LICENSE.txt +0 -5
  184. package/dist/umd/7044.js +0 -1
  185. package/dist/umd/7583.js +0 -113
  186. package/dist/umd/8623.js +0 -2
  187. package/dist/umd/8623.js.LICENSE.txt +0 -5
  188. package/dist/umd/8725.js +0 -37
  189. package/dist/umd/9189.js +0 -2
  190. package/dist/umd/9189.js.LICENSE.txt +0 -5
  191. package/dist/umd/9211.js.LICENSE.txt +0 -5
  192. package/dist/umd/9214.js +0 -1
  193. package/dist/umd/9320.js +0 -2
  194. package/dist/umd/9320.js.LICENSE.txt +0 -5
  195. package/dist/umd/9383.js +0 -94
  196. package/dist/umd/9434.js +0 -1
  197. package/dist/umd/9437.js +0 -19
  198. package/dist/umd/9437.js.LICENSE.txt +0 -5
  199. package/dist/umd/9680.js +0 -2
  200. package/dist/umd/9680.js.LICENSE.txt +0 -5
  201. package/dist/umd/9789.js +0 -1
  202. package/dist/umd/descope-text-index-js.js +0 -1
  203. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js.LICENSE.txt +0 -5
  204. package/src/components/descope-text/TextClass.js +0 -67
  205. /package/dist/umd/{3092.js.LICENSE.txt → 1612.js.LICENSE.txt} +0 -0
  206. /package/dist/umd/{6606.js.LICENSE.txt → 2362.js.LICENSE.txt} +0 -0
  207. /package/dist/umd/{4226.js.LICENSE.txt → 4024.js.LICENSE.txt} +0 -0
  208. /package/dist/umd/{8725.js.LICENSE.txt → 4052.js.LICENSE.txt} +0 -0
  209. /package/dist/umd/{9383.js.LICENSE.txt → 8191.js.LICENSE.txt} +0 -0
  210. /package/dist/umd/{1037.js.LICENSE.txt → boolean-fields-descope-checkbox-index-js.js.LICENSE.txt} +0 -0
  211. /package/dist/umd/{2066.js.LICENSE.txt → boolean-fields-descope-switch-toggle-index-js.js.LICENSE.txt} +0 -0
  212. /package/dist/umd/{7583.js.LICENSE.txt → descope-combo-box-index-js.js.LICENSE.txt} +0 -0
  213. /package/src/components/{descope-text → text-components/descope-text}/index.js +0 -0
package/dist/umd/9092.js CHANGED
@@ -1,5 +1,341 @@
1
1
  /*! For license information please see 9092.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[9092],{9092:(e,t,s)=>{s(9098),s(9416);var i=s(6754),a=s(6570);const n=a.iv`
2
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[9092],{7078:(t,e,i)=>{i.d(e,{z:()=>p});var o=i(4241),a=i(6155),s=i(2807),n=i(2521),r=i(4463),l=i(6570);const h=i(235).iv`
3
+ :host {
4
+ display: inline-block;
5
+ position: relative;
6
+ outline: none;
7
+ white-space: nowrap;
8
+ -webkit-user-select: none;
9
+ -moz-user-select: none;
10
+ user-select: none;
11
+ }
12
+
13
+ :host([hidden]) {
14
+ display: none !important;
15
+ }
16
+
17
+ /* Aligns the button with form fields when placed on the same line.
18
+ Note, to make it work, the form fields should have the same "::before" pseudo-element. */
19
+ .vaadin-button-container::before {
20
+ content: '\\2003';
21
+ display: inline-block;
22
+ width: 0;
23
+ max-height: 100%;
24
+ }
25
+
26
+ .vaadin-button-container {
27
+ display: inline-flex;
28
+ align-items: center;
29
+ justify-content: center;
30
+ text-align: center;
31
+ width: 100%;
32
+ height: 100%;
33
+ min-height: inherit;
34
+ text-shadow: inherit;
35
+ }
36
+
37
+ [part='prefix'],
38
+ [part='suffix'] {
39
+ flex: none;
40
+ }
41
+
42
+ [part='label'] {
43
+ white-space: nowrap;
44
+ overflow: hidden;
45
+ text-overflow: ellipsis;
46
+ }
47
+
48
+ @media (forced-colors: active) {
49
+ :host {
50
+ outline: 1px solid;
51
+ outline-offset: -1px;
52
+ }
53
+
54
+ :host([focused]) {
55
+ outline-width: 2px;
56
+ }
57
+
58
+ :host([disabled]) {
59
+ outline-color: GrayText;
60
+ }
61
+ }
62
+ `;var d=i(1224),c=i(1360),u=i(8298);const _=t=>class extends((0,d.D)((0,u.N)((0,c.W)(t)))){static get properties(){return{tabindex:{type:Number,value:0,reflectToAttribute:!0}}}get _activeKeys(){return["Enter"," "]}ready(){super.ready(),this.hasAttribute("role")||this.setAttribute("role","button")}_onKeyDown(t){super._onKeyDown(t),t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||this._activeKeys.includes(t.key)&&(t.preventDefault(),this.click())}};(0,l.hC)("vaadin-button",h,{moduleId:"vaadin-button-styles"});class p extends(_((0,n.S)((0,l.Tb)((0,a.k)(o.H3))))){static get is(){return"vaadin-button"}static get template(){return o.dy`
63
+ <div class="vaadin-button-container">
64
+ <span part="prefix" aria-hidden="true">
65
+ <slot name="prefix"></slot>
66
+ </span>
67
+ <span part="label">
68
+ <slot></slot>
69
+ </span>
70
+ <span part="suffix" aria-hidden="true">
71
+ <slot name="suffix"></slot>
72
+ </span>
73
+ </div>
74
+ <slot name="tooltip"></slot>
75
+ `}ready(){super.ready(),this._tooltipController=new r.f(this),this.addController(this._tooltipController)}}(0,s.M)(p)},4750:(t,e,i)=>{i.d(e,{L:()=>a}),i(1195),i(9098),i(9416),i(9849),i(4173);var o=i(6570);const a=o.iv`
76
+ :host {
77
+ /* Sizing */
78
+ --lumo-button-size: var(--lumo-size-m);
79
+ min-width: var(--vaadin-button-min-width, calc(var(--_button-size) * 2));
80
+ height: var(--_button-size);
81
+ padding: var(--vaadin-button-padding, 0 calc(var(--_button-size) / 3 + var(--lumo-border-radius-m) / 2));
82
+ margin: var(--vaadin-button-margin, var(--lumo-space-xs) 0);
83
+ box-sizing: border-box;
84
+ /* Style */
85
+ font-family: var(--lumo-font-family);
86
+ font-size: var(--vaadin-button-font-size, var(--lumo-font-size-m));
87
+ font-weight: var(--vaadin-button-font-weight, 500);
88
+ color: var(--_lumo-button-text-color);
89
+ background: var(--_lumo-button-background);
90
+ border: var(--vaadin-button-border, none);
91
+ border-radius: var(--vaadin-button-border-radius, var(--lumo-border-radius-m));
92
+ cursor: var(--lumo-clickable-cursor);
93
+ -webkit-tap-highlight-color: transparent;
94
+ -webkit-font-smoothing: antialiased;
95
+ -moz-osx-font-smoothing: grayscale;
96
+ flex-shrink: 0;
97
+ --_button-size: var(--vaadin-button-height, var(--lumo-button-size));
98
+ --_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));
99
+ --_focus-ring-width: var(--vaadin-focus-ring-width, 2px);
100
+ /* Used by notification */
101
+ --_lumo-button-background: var(--vaadin-button-background, var(--lumo-contrast-5pct));
102
+ --_lumo-button-text-color: var(--vaadin-button-text-color, var(--lumo-primary-text-color));
103
+ --_lumo-button-primary-background: var(--vaadin-button-primary-background, var(--lumo-primary-color));
104
+ --_lumo-button-primary-text-color: var(--vaadin-button-primary-text-color, var(--lumo-primary-contrast-color));
105
+ }
106
+
107
+ /* Set only for the internal parts so we don't affect the host vertical alignment */
108
+ [part='label'],
109
+ [part='prefix'],
110
+ [part='suffix'] {
111
+ line-height: var(--lumo-line-height-xs);
112
+ }
113
+
114
+ [part='label'] {
115
+ padding: calc(var(--lumo-button-size) / 6) 0;
116
+ }
117
+
118
+ :host([theme~='small']) {
119
+ font-size: var(--lumo-font-size-s);
120
+ --lumo-button-size: var(--lumo-size-s);
121
+ }
122
+
123
+ :host([theme~='large']) {
124
+ font-size: var(--lumo-font-size-l);
125
+ --lumo-button-size: var(--lumo-size-l);
126
+ }
127
+
128
+ /* For interaction states */
129
+ :host::before,
130
+ :host::after {
131
+ content: '';
132
+ /* We rely on the host always being relative */
133
+ position: absolute;
134
+ z-index: 1;
135
+ inset: 0;
136
+ background-color: currentColor;
137
+ border-radius: inherit;
138
+ opacity: 0;
139
+ pointer-events: none;
140
+ }
141
+
142
+ /* Hover */
143
+
144
+ @media (any-hover: hover) {
145
+ :host(:hover)::before {
146
+ opacity: 0.02;
147
+ }
148
+ }
149
+
150
+ /* Active */
151
+
152
+ :host::after {
153
+ transition: opacity 1.4s, transform 0.1s;
154
+ filter: blur(8px);
155
+ }
156
+
157
+ :host([active])::before {
158
+ opacity: 0.05;
159
+ transition-duration: 0s;
160
+ }
161
+
162
+ :host([active])::after {
163
+ opacity: 0.1;
164
+ transition-duration: 0s, 0s;
165
+ transform: scale(0);
166
+ }
167
+
168
+ /* Keyboard focus */
169
+
170
+ :host([focus-ring]) {
171
+ box-shadow: 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);
172
+ }
173
+
174
+ :host([theme~='primary'][focus-ring]) {
175
+ box-shadow: 0 0 0 1px var(--lumo-base-color), 0 0 0 3px var(--lumo-primary-color-50pct);
176
+ }
177
+
178
+ /* Types (primary, tertiary, tertiary-inline */
179
+
180
+ :host([theme~='tertiary']),
181
+ :host([theme~='tertiary-inline']) {
182
+ --_background: transparent !important;
183
+ background: var(--vaadin-button-tertiary-background, var(--_background));
184
+ min-width: 0;
185
+ }
186
+
187
+ :host([theme~='tertiary']) {
188
+ border: var(--vaadin-button-tertiary-border, none);
189
+ color: var(--vaadin-button-tertiary-text-color, var(--lumo-primary-text-color));
190
+ font-weight: var(--vaadin-button-tertiary-font-weight, 500);
191
+ padding: var(--vaadin-button-tertiary-padding, 0 calc(var(--_button-size) / 6));
192
+ }
193
+
194
+ :host([theme~='tertiary-inline'])::before {
195
+ display: none;
196
+ }
197
+
198
+ :host([theme~='tertiary-inline']) {
199
+ margin: 0;
200
+ height: auto;
201
+ padding: 0;
202
+ line-height: inherit;
203
+ font-size: inherit;
204
+ }
205
+
206
+ :host([theme~='tertiary-inline']) [part='label'] {
207
+ padding: 0;
208
+ overflow: visible;
209
+ line-height: inherit;
210
+ }
211
+
212
+ :host([theme~='primary']) {
213
+ background: var(--_lumo-button-primary-background);
214
+ border: var(--vaadin-button-primary-border, none);
215
+ color: var(--_lumo-button-primary-text-color);
216
+ font-weight: var(--vaadin-button-primary-font-weight, 600);
217
+ min-width: calc(var(--lumo-button-size) * 2.5);
218
+ }
219
+
220
+ :host([theme~='primary'])::before {
221
+ background-color: black;
222
+ }
223
+
224
+ @media (any-hover: hover) {
225
+ :host([theme~='primary']:hover)::before {
226
+ opacity: 0.05;
227
+ }
228
+ }
229
+
230
+ :host([theme~='primary'][active])::before {
231
+ opacity: 0.1;
232
+ }
233
+
234
+ :host([theme~='primary'][active])::after {
235
+ opacity: 0.2;
236
+ }
237
+
238
+ /* Colors (success, error, contrast) */
239
+
240
+ :host([theme~='success']) {
241
+ color: var(--lumo-success-text-color);
242
+ }
243
+
244
+ :host([theme~='success'][theme~='primary']) {
245
+ background-color: var(--lumo-success-color);
246
+ color: var(--lumo-success-contrast-color);
247
+ }
248
+
249
+ :host([theme~='error']) {
250
+ color: var(--lumo-error-text-color);
251
+ }
252
+
253
+ :host([theme~='error'][theme~='primary']) {
254
+ background-color: var(--lumo-error-color);
255
+ color: var(--lumo-error-contrast-color);
256
+ }
257
+
258
+ :host([theme~='contrast']) {
259
+ color: var(--lumo-contrast);
260
+ }
261
+
262
+ :host([theme~='contrast'][theme~='primary']) {
263
+ background-color: var(--lumo-contrast);
264
+ color: var(--lumo-base-color);
265
+ }
266
+
267
+ /* Disabled state. Keep selectors after other color variants. */
268
+
269
+ :host([disabled]) {
270
+ pointer-events: none;
271
+ color: var(--lumo-disabled-text-color);
272
+ }
273
+
274
+ :host([theme~='primary'][disabled]) {
275
+ background-color: var(--lumo-contrast-30pct);
276
+ color: var(--lumo-base-color);
277
+ }
278
+
279
+ :host([theme~='primary'][disabled]) [part] {
280
+ opacity: 0.7;
281
+ }
282
+
283
+ /* Icons */
284
+
285
+ [part] ::slotted(vaadin-icon) {
286
+ display: inline-block;
287
+ width: var(--lumo-icon-size-m);
288
+ height: var(--lumo-icon-size-m);
289
+ }
290
+
291
+ /* Vaadin icons are based on a 16x16 grid (unlike Lumo and Material icons with 24x24), so they look too big by default */
292
+ [part] ::slotted(vaadin-icon[icon^='vaadin:']) {
293
+ padding: 0.25em;
294
+ box-sizing: border-box !important;
295
+ }
296
+
297
+ [part='prefix'] {
298
+ margin-left: -0.25em;
299
+ margin-right: 0.25em;
300
+ }
301
+
302
+ [part='suffix'] {
303
+ margin-left: 0.25em;
304
+ margin-right: -0.25em;
305
+ }
306
+
307
+ /* Icon-only */
308
+
309
+ :host([theme~='icon']:not([theme~='tertiary-inline'])) {
310
+ min-width: var(--lumo-button-size);
311
+ padding-left: calc(var(--lumo-button-size) / 4);
312
+ padding-right: calc(var(--lumo-button-size) / 4);
313
+ }
314
+
315
+ :host([theme~='icon']) [part='prefix'],
316
+ :host([theme~='icon']) [part='suffix'] {
317
+ margin-left: 0;
318
+ margin-right: 0;
319
+ }
320
+
321
+ /* RTL specific styles */
322
+
323
+ :host([dir='rtl']) [part='prefix'] {
324
+ margin-left: 0.25em;
325
+ margin-right: -0.25em;
326
+ }
327
+
328
+ :host([dir='rtl']) [part='suffix'] {
329
+ margin-left: -0.25em;
330
+ margin-right: 0.25em;
331
+ }
332
+
333
+ :host([dir='rtl'][theme~='icon']) [part='prefix'],
334
+ :host([dir='rtl'][theme~='icon']) [part='suffix'] {
335
+ margin-left: 0;
336
+ margin-right: 0;
337
+ }
338
+ `;(0,o.hC)("vaadin-button",a,{moduleId:"lumo-button"})},9092:(t,e,i)=>{i(9098),i(9416);var o=i(6754),a=i(6570);const s=a.iv`
3
339
  [part='overlay'] {
4
340
  /*
5
341
  Width:
@@ -47,7 +383,7 @@
47
383
  max-height: 70vh;
48
384
  }
49
385
  }
50
- `;(0,a.hC)("vaadin-date-picker-overlay",[i.L,n],{moduleId:"lumo-date-picker-overlay"}),s(1195),s(9849),s(4173),s(4750),(0,a.hC)("vaadin-date-picker-year",a.iv`
386
+ `;(0,a.hC)("vaadin-date-picker-overlay",[o.L,s],{moduleId:"lumo-date-picker-overlay"}),i(1195),i(9849),i(4173),i(4750),(0,a.hC)("vaadin-date-picker-year",a.iv`
51
387
  :host([current]) [part='year-number'] {
52
388
  color: var(--lumo-primary-text-color);
53
389
  }
@@ -365,7 +701,7 @@
365
701
  :host([disabled]) * {
366
702
  color: var(--lumo-disabled-text-color) !important;
367
703
  }
368
- `,{moduleId:"lumo-month-calendar"});const o=document.createElement("template");o.innerHTML="\n <style>\n @keyframes vaadin-date-picker-month-calendar-focus-date {\n 50% {\n box-shadow: 0 0 0 var(--_focus-ring-width) transparent;\n }\n }\n </style>\n",document.head.appendChild(o.content),s(1578),s(1735);var r=s(7205);const l=a.iv`
704
+ `,{moduleId:"lumo-month-calendar"});const n=document.createElement("template");n.innerHTML="\n <style>\n @keyframes vaadin-date-picker-month-calendar-focus-date {\n 50% {\n box-shadow: 0 0 0 var(--_focus-ring-width) transparent;\n }\n }\n </style>\n",document.head.appendChild(n.content),i(1578),i(1735);var r=i(7205);const l=a.iv`
369
705
  :host {
370
706
  outline: none;
371
707
  }
@@ -391,7 +727,7 @@
391
727
  :host([dir='rtl']) [part='input-field'] ::slotted(input:placeholder-shown) {
392
728
  --_lumo-text-field-overflow-mask-image: none;
393
729
  }
394
- `;(0,a.hC)("vaadin-date-picker",[r.J,l],{moduleId:"lumo-date-picker"}),s(3553);var h=s(4241),d=s(2807),c=s(1914),u=s(4457),_=s(3373),p=s(6196),m=s(9392);const f=m.iv`
730
+ `;(0,a.hC)("vaadin-date-picker",[r.J,l],{moduleId:"lumo-date-picker"}),i(3553);var h=i(4241),d=i(2807),c=i(1914),u=i(4457),_=i(3373),p=i(6196),m=i(235);const f=m.iv`
395
731
  [part='overlay'] {
396
732
  display: flex;
397
733
  flex: auto;
@@ -413,7 +749,7 @@
413
749
  <slot></slot>
414
750
  </div>
415
751
  </div>
416
- `}}function g(e,t){return e instanceof Date&&t instanceof Date&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function b(e,t,s){return(!t||e>=t)&&(!s||e<=s)}function v(e,t){return t.filter((e=>void 0!==e)).reduce(((t,s)=>s?t?Math.abs(e.getTime()-s.getTime())<Math.abs(t.getTime()-e.getTime())?s:t:s:t))}function D(e){return{day:e.getDate(),month:e.getMonth(),year:e.getFullYear()}}function w(e){const t=new Date,s=new Date(t);return s.setDate(1),s.setMonth(parseInt(e)+t.getMonth()),s}function k(e){const t=/^([-+]\d{1}|\d{2,4}|[-+]\d{6})-(\d{1,2})-(\d{1,2})$/u.exec(e);if(!t)return;const s=new Date(0,0);return s.setFullYear(parseInt(t[1],10)),s.setMonth(parseInt(t[2],10)-1),s.setDate(parseInt(t[3],10)),s}(0,d.M)(y),s(7078);var C=s(7913),x=s(1037),S=s(6139),T=s(3971);const E=document.createElement("template");E.innerHTML='\n <style>\n :host {\n display: block;\n overflow: hidden;\n height: 500px;\n }\n\n #scroller {\n position: relative;\n height: 100%;\n overflow: auto;\n outline: none;\n margin-right: -40px;\n -webkit-overflow-scrolling: touch;\n overflow-x: hidden;\n }\n\n #scroller.notouchscroll {\n -webkit-overflow-scrolling: auto;\n }\n\n #scroller::-webkit-scrollbar {\n display: none;\n }\n\n .buffer {\n position: absolute;\n width: var(--vaadin-infinite-scroller-buffer-width, 100%);\n box-sizing: border-box;\n padding-right: 40px;\n top: var(--vaadin-infinite-scroller-buffer-offset, 0);\n animation: fadein 0.2s;\n }\n\n @keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n </style>\n\n <div id="scroller">\n <div class="buffer"></div>\n <div class="buffer"></div>\n <div id="fullHeight"></div>\n </div>\n';class M extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}).appendChild(E.content.cloneNode(!0)),this.bufferSize=20,this._initialScroll=5e5,this._initialIndex=0,this._activated=!1}get active(){return this._activated}set active(e){e&&!this._activated&&(this._createPool(),this._activated=!0)}get bufferOffset(){return this._buffers[0].offsetTop}get itemHeight(){if(!this._itemHeightVal){const e=getComputedStyle(this).getPropertyValue("--vaadin-infinite-scroller-item-height"),t="background-position";this.$.fullHeight.style.setProperty(t,e);const s=getComputedStyle(this.$.fullHeight).getPropertyValue(t);this.$.fullHeight.style.removeProperty(t),this._itemHeightVal=parseFloat(s)}return this._itemHeightVal}get _bufferHeight(){return this.itemHeight*this.bufferSize}get position(){return(this.$.scroller.scrollTop-this._buffers[0].translateY)/this.itemHeight+this._firstIndex}set position(e){this._preventScrollEvent=!0,e>this._firstIndex&&e<this._firstIndex+2*this.bufferSize?this.$.scroller.scrollTop=this.itemHeight*(e-this._firstIndex)+this._buffers[0].translateY:(this._initialIndex=~~e,this._reset(),this._scrollDisabled=!0,this.$.scroller.scrollTop+=e%1*this.itemHeight,this._scrollDisabled=!1),this._mayHaveMomentum&&(this.$.scroller.classList.add("notouchscroll"),this._mayHaveMomentum=!1,setTimeout((()=>{this.$.scroller.classList.remove("notouchscroll")}),10))}connectedCallback(){this._ready||(this._ready=!0,this.$={},this.shadowRoot.querySelectorAll("[id]").forEach((e=>{this.$[e.id]=e})),this.$.scroller.addEventListener("scroll",(()=>this._scroll())),this._buffers=[...this.shadowRoot.querySelectorAll(".buffer")],this.$.fullHeight.style.height=2*this._initialScroll+"px",x.vU&&(this.$.scroller.tabIndex=-1))}forceUpdate(){this._debouncerUpdateClones&&(this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones(),this._debouncerUpdateClones.cancel())}_createElement(){}_updateElement(e,t){}_finishInit(){this._initDone||(this._buffers.forEach((e=>{[...e.children].forEach((e=>{this._ensureStampedInstance(e._itemWrapper)}))})),this._buffers[0].translateY||this._reset(),this._initDone=!0,this.dispatchEvent(new CustomEvent("init-done")))}_translateBuffer(e){const t=e?1:0;this._buffers[t].translateY=this._buffers[t?0:1].translateY+this._bufferHeight*(t?-1:1),this._buffers[t].style.transform=`translate3d(0, ${this._buffers[t].translateY}px, 0)`,this._buffers[t].updated=!1,this._buffers.reverse()}_scroll(){if(this._scrollDisabled)return;const e=this.$.scroller.scrollTop;(e<this._bufferHeight||e>2*this._initialScroll-this._bufferHeight)&&(this._initialIndex=~~this.position,this._reset());const t=this.itemHeight+this.bufferOffset,s=e>this._buffers[1].translateY+t,i=e<this._buffers[0].translateY+t;(s||i)&&(this._translateBuffer(i),this._updateClones()),this._preventScrollEvent||(this.dispatchEvent(new CustomEvent("custom-scroll",{bubbles:!1,composed:!0})),this._mayHaveMomentum=!0),this._preventScrollEvent=!1,this._debouncerScrollFinish=S.dx.debounce(this._debouncerScrollFinish,C.Wc.after(200),(()=>{const e=this.$.scroller.getBoundingClientRect();this._isVisible(this._buffers[0],e)||this._isVisible(this._buffers[1],e)||(this.position=this.position)}))}_reset(){this._scrollDisabled=!0,this.$.scroller.scrollTop=this._initialScroll,this._buffers[0].translateY=this._initialScroll-this._bufferHeight,this._buffers[1].translateY=this._initialScroll,this._buffers.forEach((e=>{e.style.transform=`translate3d(0, ${e.translateY}px, 0)`})),this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones(!0),this._debouncerUpdateClones=S.dx.debounce(this._debouncerUpdateClones,C.Wc.after(200),(()=>{this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones()})),this._scrollDisabled=!1}_createPool(){const e=this.getBoundingClientRect();this._buffers.forEach((t=>{for(let s=0;s<this.bufferSize;s++){const s=document.createElement("div");s.style.height=`${this.itemHeight}px`,s.instance={};const i=`vaadin-infinite-scroller-item-content-${(0,T.l)()}`,a=document.createElement("slot");a.setAttribute("name",i),a._itemWrapper=s,t.appendChild(a),s.setAttribute("slot",i),this.appendChild(s),this._isVisible(s,e)&&this._ensureStampedInstance(s)}})),requestAnimationFrame((()=>{this._finishInit()}))}_ensureStampedInstance(e){if(e.firstElementChild)return;const t=e.instance;e.instance=this._createElement(),e.appendChild(e.instance),Object.keys(t).forEach((s=>{e.instance[s]=t[s]}))}_updateClones(e){this._firstIndex=~~((this._buffers[0].translateY-this._initialScroll)/this.itemHeight)+this._initialIndex;const t=e?this.$.scroller.getBoundingClientRect():void 0;this._buffers.forEach(((s,i)=>{if(!s.updated){const a=this._firstIndex+this.bufferSize*i;[...s.children].forEach(((s,i)=>{const n=s._itemWrapper;e&&!this._isVisible(n,t)||this._updateElement(n.instance,a+i)})),s.updated=!0}}))}_isVisible(e,t){const s=e.getBoundingClientRect();return s.bottom>t.top&&s.top<t.bottom}}const P=document.createElement("template");P.innerHTML="\n <style>\n :host {\n --vaadin-infinite-scroller-item-height: 270px;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n }\n </style>\n",(0,d.M)(class extends M{static get is(){return"vaadin-date-picker-month-scroller"}constructor(){super(),this.bufferSize=3,this.shadowRoot.appendChild(P.content.cloneNode(!0))}_createElement(){return document.createElement("vaadin-month-calendar")}_updateElement(e,t){e.month=w(t)}});const I=document.createElement("template");I.innerHTML="\n <style>\n :host {\n --vaadin-infinite-scroller-item-height: 80px;\n width: 50px;\n display: block;\n height: 100%;\n position: absolute;\n right: 0;\n transform: translateX(100%);\n -webkit-tap-highlight-color: transparent;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n /* Center the year scroller position. */\n --vaadin-infinite-scroller-buffer-offset: 50%;\n }\n\n :host::before {\n content: '';\n display: block;\n background: transparent;\n width: 0;\n height: 0;\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n border-width: 6px;\n border-style: solid;\n border-color: transparent;\n border-left-color: #000;\n }\n </style>\n",(0,d.M)(class extends M{static get is(){return"vaadin-date-picker-year-scroller"}constructor(){super(),this.bufferSize=12,this.shadowRoot.appendChild(I.content.cloneNode(!0))}_createElement(){return document.createElement("vaadin-date-picker-year")}_updateElement(e,t){e.year=this._yearAfterXYears(t)}_yearAfterXYears(e){const t=new Date,s=new Date(t);return s.setFullYear(parseInt(e)+t.getFullYear()),s.getFullYear()}});const O=e=>class extends e{static get properties(){return{year:{type:String,sync:!0},selectedDate:{type:Object,sync:!0}}}static get observers(){return["__updateSelected(year, selectedDate)"]}__updateSelected(e,t){this.toggleAttribute("selected",t&&t.getFullYear()===e),this.toggleAttribute("current",e===(new Date).getFullYear())}};class F extends((0,a.Tb)(O(h.H3))){static get is(){return"vaadin-date-picker-year"}static get template(){return h.dy`
752
+ `}}function g(t,e){return t instanceof Date&&e instanceof Date&&t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function v(t,e,i){return(!e||t>=e)&&(!i||t<=i)}function b(t,e){return e.filter((t=>void 0!==t)).reduce(((e,i)=>i?e?Math.abs(t.getTime()-i.getTime())<Math.abs(e.getTime()-t.getTime())?i:e:i:e))}function D(t){return{day:t.getDate(),month:t.getMonth(),year:t.getFullYear()}}function w(t){const e=new Date,i=new Date(e);return i.setDate(1),i.setMonth(parseInt(t)+e.getMonth()),i}function k(t){const e=/^([-+]\d{1}|\d{2,4}|[-+]\d{6})-(\d{1,2})-(\d{1,2})$/u.exec(t);if(!e)return;const i=new Date(0,0);return i.setFullYear(parseInt(e[1],10)),i.setMonth(parseInt(e[2],10)-1),i.setDate(parseInt(e[3],10)),i}(0,d.M)(y),i(7078);var x=i(7913),C=i(1037),S=i(6139),E=i(3971);const T=document.createElement("template");T.innerHTML='\n <style>\n :host {\n display: block;\n overflow: hidden;\n height: 500px;\n }\n\n #scroller {\n position: relative;\n height: 100%;\n overflow: auto;\n outline: none;\n margin-right: -40px;\n -webkit-overflow-scrolling: touch;\n overflow-x: hidden;\n }\n\n #scroller.notouchscroll {\n -webkit-overflow-scrolling: auto;\n }\n\n #scroller::-webkit-scrollbar {\n display: none;\n }\n\n .buffer {\n position: absolute;\n width: var(--vaadin-infinite-scroller-buffer-width, 100%);\n box-sizing: border-box;\n padding-right: 40px;\n top: var(--vaadin-infinite-scroller-buffer-offset, 0);\n animation: fadein 0.2s;\n }\n\n @keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n </style>\n\n <div id="scroller">\n <div class="buffer"></div>\n <div class="buffer"></div>\n <div id="fullHeight"></div>\n </div>\n';class M extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}).appendChild(T.content.cloneNode(!0)),this.bufferSize=20,this._initialScroll=5e5,this._initialIndex=0,this._activated=!1}get active(){return this._activated}set active(t){t&&!this._activated&&(this._createPool(),this._activated=!0)}get bufferOffset(){return this._buffers[0].offsetTop}get itemHeight(){if(!this._itemHeightVal){const t=getComputedStyle(this).getPropertyValue("--vaadin-infinite-scroller-item-height"),e="background-position";this.$.fullHeight.style.setProperty(e,t);const i=getComputedStyle(this.$.fullHeight).getPropertyValue(e);this.$.fullHeight.style.removeProperty(e),this._itemHeightVal=parseFloat(i)}return this._itemHeightVal}get _bufferHeight(){return this.itemHeight*this.bufferSize}get position(){return(this.$.scroller.scrollTop-this._buffers[0].translateY)/this.itemHeight+this._firstIndex}set position(t){this._preventScrollEvent=!0,t>this._firstIndex&&t<this._firstIndex+2*this.bufferSize?this.$.scroller.scrollTop=this.itemHeight*(t-this._firstIndex)+this._buffers[0].translateY:(this._initialIndex=~~t,this._reset(),this._scrollDisabled=!0,this.$.scroller.scrollTop+=t%1*this.itemHeight,this._scrollDisabled=!1),this._mayHaveMomentum&&(this.$.scroller.classList.add("notouchscroll"),this._mayHaveMomentum=!1,setTimeout((()=>{this.$.scroller.classList.remove("notouchscroll")}),10))}connectedCallback(){this._ready||(this._ready=!0,this.$={},this.shadowRoot.querySelectorAll("[id]").forEach((t=>{this.$[t.id]=t})),this.$.scroller.addEventListener("scroll",(()=>this._scroll())),this._buffers=[...this.shadowRoot.querySelectorAll(".buffer")],this.$.fullHeight.style.height=2*this._initialScroll+"px",C.vU&&(this.$.scroller.tabIndex=-1))}forceUpdate(){this._debouncerUpdateClones&&(this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones(),this._debouncerUpdateClones.cancel())}_createElement(){}_updateElement(t,e){}_finishInit(){this._initDone||(this._buffers.forEach((t=>{[...t.children].forEach((t=>{this._ensureStampedInstance(t._itemWrapper)}))})),this._buffers[0].translateY||this._reset(),this._initDone=!0,this.dispatchEvent(new CustomEvent("init-done")))}_translateBuffer(t){const e=t?1:0;this._buffers[e].translateY=this._buffers[e?0:1].translateY+this._bufferHeight*(e?-1:1),this._buffers[e].style.transform=`translate3d(0, ${this._buffers[e].translateY}px, 0)`,this._buffers[e].updated=!1,this._buffers.reverse()}_scroll(){if(this._scrollDisabled)return;const t=this.$.scroller.scrollTop;(t<this._bufferHeight||t>2*this._initialScroll-this._bufferHeight)&&(this._initialIndex=~~this.position,this._reset());const e=this.itemHeight+this.bufferOffset,i=t>this._buffers[1].translateY+e,o=t<this._buffers[0].translateY+e;(i||o)&&(this._translateBuffer(o),this._updateClones()),this._preventScrollEvent||(this.dispatchEvent(new CustomEvent("custom-scroll",{bubbles:!1,composed:!0})),this._mayHaveMomentum=!0),this._preventScrollEvent=!1,this._debouncerScrollFinish=S.dx.debounce(this._debouncerScrollFinish,x.Wc.after(200),(()=>{const t=this.$.scroller.getBoundingClientRect();this._isVisible(this._buffers[0],t)||this._isVisible(this._buffers[1],t)||(this.position=this.position)}))}_reset(){this._scrollDisabled=!0,this.$.scroller.scrollTop=this._initialScroll,this._buffers[0].translateY=this._initialScroll-this._bufferHeight,this._buffers[1].translateY=this._initialScroll,this._buffers.forEach((t=>{t.style.transform=`translate3d(0, ${t.translateY}px, 0)`})),this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones(!0),this._debouncerUpdateClones=S.dx.debounce(this._debouncerUpdateClones,x.Wc.after(200),(()=>{this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones()})),this._scrollDisabled=!1}_createPool(){const t=this.getBoundingClientRect();this._buffers.forEach((e=>{for(let i=0;i<this.bufferSize;i++){const i=document.createElement("div");i.style.height=`${this.itemHeight}px`,i.instance={};const o=`vaadin-infinite-scroller-item-content-${(0,E.l)()}`,a=document.createElement("slot");a.setAttribute("name",o),a._itemWrapper=i,e.appendChild(a),i.setAttribute("slot",o),this.appendChild(i),this._isVisible(i,t)&&this._ensureStampedInstance(i)}})),requestAnimationFrame((()=>{this._finishInit()}))}_ensureStampedInstance(t){if(t.firstElementChild)return;const e=t.instance;t.instance=this._createElement(),t.appendChild(t.instance),Object.keys(e).forEach((i=>{t.instance[i]=e[i]}))}_updateClones(t){this._firstIndex=~~((this._buffers[0].translateY-this._initialScroll)/this.itemHeight)+this._initialIndex;const e=t?this.$.scroller.getBoundingClientRect():void 0;this._buffers.forEach(((i,o)=>{if(!i.updated){const a=this._firstIndex+this.bufferSize*o;[...i.children].forEach(((i,o)=>{const s=i._itemWrapper;t&&!this._isVisible(s,e)||this._updateElement(s.instance,a+o)})),i.updated=!0}}))}_isVisible(t,e){const i=t.getBoundingClientRect();return i.bottom>e.top&&i.top<e.bottom}}const P=document.createElement("template");P.innerHTML="\n <style>\n :host {\n --vaadin-infinite-scroller-item-height: 270px;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n }\n </style>\n",(0,d.M)(class extends M{static get is(){return"vaadin-date-picker-month-scroller"}constructor(){super(),this.bufferSize=3,this.shadowRoot.appendChild(P.content.cloneNode(!0))}_createElement(){return document.createElement("vaadin-month-calendar")}_updateElement(t,e){t.month=w(e)}});const A=document.createElement("template");A.innerHTML="\n <style>\n :host {\n --vaadin-infinite-scroller-item-height: 80px;\n width: 50px;\n display: block;\n height: 100%;\n position: absolute;\n right: 0;\n transform: translateX(100%);\n -webkit-tap-highlight-color: transparent;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n /* Center the year scroller position. */\n --vaadin-infinite-scroller-buffer-offset: 50%;\n }\n\n :host::before {\n content: '';\n display: block;\n background: transparent;\n width: 0;\n height: 0;\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n border-width: 6px;\n border-style: solid;\n border-color: transparent;\n border-left-color: #000;\n }\n </style>\n",(0,d.M)(class extends M{static get is(){return"vaadin-date-picker-year-scroller"}constructor(){super(),this.bufferSize=12,this.shadowRoot.appendChild(A.content.cloneNode(!0))}_createElement(){return document.createElement("vaadin-date-picker-year")}_updateElement(t,e){t.year=this._yearAfterXYears(e)}_yearAfterXYears(t){const e=new Date,i=new Date(e);return i.setFullYear(parseInt(t)+e.getFullYear()),i.getFullYear()}});const I=t=>class extends t{static get properties(){return{year:{type:String,sync:!0},selectedDate:{type:Object,sync:!0}}}static get observers(){return["__updateSelected(year, selectedDate)"]}__updateSelected(t,e){this.toggleAttribute("selected",e&&e.getFullYear()===t),this.toggleAttribute("current",t===(new Date).getFullYear())}};class O extends((0,a.Tb)(I(h.H3))){static get is(){return"vaadin-date-picker-year"}static get template(){return h.dy`
417
753
  <style>
418
754
  :host {
419
755
  display: block;
@@ -422,7 +758,7 @@
422
758
  </style>
423
759
  <div part="year-number">[[year]]</div>
424
760
  <div part="year-separator" aria-hidden="true"></div>
425
- `}}(0,d.M)(F),s(7894);var A=s(4933),H=s(1014);function Y(e,t,s,i,a){let n;a&&(n="object"==typeof s&&null!==s,n&&(i=e.__dataTemp[t]));let o=i!==s&&(i==i||s==s);return n&&o&&(e.__dataTemp[t]=s),o}const B=(0,H.o)((e=>class extends e{_shouldPropertyChange(e,t,s){return Y(this,e,t,s,!0)}})),N=(0,H.o)((e=>class extends e{static get properties(){return{mutableData:Boolean}}_shouldPropertyChange(e,t,s){return Y(this,e,t,s,this.mutableData)}}));B._mutablePropertyChange=Y;var z=s(9387),$=s(1342);let V=null;function L(){return V}L.prototype=Object.create(HTMLTemplateElement.prototype,{constructor:{value:L,writable:!0}});const W=(0,A.q)(L),R=B(W),j=(0,A.q)(class{});class q extends j{constructor(e){super(),this._configureProperties(e),this.root=this._stampTemplate(this.__dataHost);let t=[];this.children=t;for(let e=this.root.firstChild;e;e=e.nextSibling)t.push(e),e.__templatizeInstance=this;this.__templatizeOwner&&this.__templatizeOwner.__hideTemplateChildren__&&this._showHideChildren(!0);let s=this.__templatizeOptions;(e&&s.instanceProps||!s.instanceProps)&&this._enableProperties()}_configureProperties(e){if(this.__templatizeOptions.forwardHostProp)for(let e in this.__hostProps)this._setPendingProperty(e,this.__dataHost["_host_"+e]);for(let t in e)this._setPendingProperty(t,e[t])}forwardHostProp(e,t){this._setPendingPropertyOrPath(e,t,!1,!0)&&this.__dataHost._enqueueClient(this)}_addEventListenerToNode(e,t,s){if(this._methodHost&&this.__templatizeOptions.parentModel)this._methodHost._addEventListenerToNode(e,t,(e=>{e.model=this,s(e)}));else{let i=this.__dataHost.__dataHost;i&&i._addEventListenerToNode(e,t,s)}}_showHideChildren(e){!function(e,t){for(let s=0;s<t.length;s++){let i=t[s];if(Boolean(e)!=Boolean(i.__hideTemplateChildren__))if(i.nodeType===Node.TEXT_NODE)e?(i.__polymerTextContent__=i.textContent,i.textContent=""):i.textContent=i.__polymerTextContent__;else if("slot"===i.localName)if(e)i.__polymerReplaced__=document.createComment("hidden-slot"),(0,$.r)((0,$.r)(i).parentNode).replaceChild(i.__polymerReplaced__,i);else{const e=i.__polymerReplaced__;e&&(0,$.r)((0,$.r)(e).parentNode).replaceChild(i,e)}else i.style&&(e?(i.__polymerDisplay__=i.style.display,i.style.display="none"):i.style.display=i.__polymerDisplay__);i.__hideTemplateChildren__=e,i._showHideChildren&&i._showHideChildren(e)}}(e,this.children)}_setUnmanagedPropertyToNode(e,t,s){e.__hideTemplateChildren__&&e.nodeType==Node.TEXT_NODE&&"textContent"==t?e.__polymerTextContent__=s:super._setUnmanagedPropertyToNode(e,t,s)}get parentModel(){let e=this.__parentModel;if(!e){let t;e=this;do{e=e.__dataHost.__dataHost}while((t=e.__templatizeOptions)&&!t.parentModel);this.__parentModel=e}return e}dispatchEvent(e){return!0}}q.prototype.__dataHost,q.prototype.__templatizeOptions,q.prototype._methodHost,q.prototype.__templatizeOwner,q.prototype.__hostProps;const K=B(q);function U(e){let t=e.__dataHost;return t&&t._methodHost||t}function X(e,t){return function(e,s,i){t.call(e.__templatizeOwner,s.substring(6),i[s])}}function Q(e,t){return function(e,s,i){t.call(e.__templatizeOwner,e,s,i[s])}}function J(e,t,s){if(z.XN&&!U(e))throw new Error("strictTemplatePolicy: template owner not trusted");if(s=s||{},e.__templatizeOwner)throw new Error("A <template> can only be templatized once");e.__templatizeOwner=t;let i=(t?t.constructor:q)._parseTemplate(e),a=i.templatizeInstanceClass;a||(a=function(e,t,s){let i=s.mutableData?K:q;J.mixin&&(i=J.mixin(i));let a=class extends i{};return a.prototype.__templatizeOptions=s,a.prototype._bindTemplate(e),function(e,t,s,i){let a=s.hostProps||{};for(let t in i.instanceProps){delete a[t];let s=i.notifyInstanceProp;s&&e.prototype._addPropertyEffect(t,e.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:Q(0,s)})}if(i.forwardHostProp&&t.__dataHost)for(let t in a)s.hasHostProps||(s.hasHostProps=!0),e.prototype._addPropertyEffect(t,e.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:function(e,t,s){e.__dataHost._setPendingPropertyOrPath("_host_"+t,s[t],!0,!0)}})}(a,e,t,s),a}(e,i,s),i.templatizeInstanceClass=a);const n=U(e);!function(e,t,s,i){let a=s.forwardHostProp;if(a&&t.hasHostProps){const n="template"==e.localName;let o=t.templatizeTemplateClass;if(!o){if(n){let e=s.mutableData?R:W;class i extends e{}o=t.templatizeTemplateClass=i}else{const s=e.constructor;class i extends s{}o=t.templatizeTemplateClass=i}let r=t.hostProps;for(let e in r)o.prototype._addPropertyEffect("_host_"+e,o.prototype.PROPERTY_EFFECT_TYPES.PROPAGATE,{fn:X(0,a)}),o.prototype._createNotifyingProperty("_host_"+e);z.a2&&i&&function(e,t,s){const i=s.constructor._properties,{propertyEffects:a}=e,{instanceProps:n}=t;for(let e in a)if(!(i[e]||n&&n[e])){const t=a[e];for(let s=0;s<t.length;s++){const{part:i}=t[s].info;if(!i.signature||!i.signature.static){console.warn(`Property '${e}' used in template but not declared in 'properties'; attribute will not be observed.`);break}}}}(t,s,i)}if(e.__dataProto&&Object.assign(e.__data,e.__dataProto),n)!function(e,t){V=e,Object.setPrototypeOf(e,t.prototype),new t,V=null}(e,o),e.__dataTemp={},e.__dataPending=null,e.__dataOld=null,e._enableProperties();else{Object.setPrototypeOf(e,o.prototype);const s=t.hostProps;for(let t in s)if(t="_host_"+t,t in e){const s=e[t];delete e[t],e.__data[t]=s}}}}(e,i,s,n);let o=class extends a{};return o.prototype._methodHost=n,o.prototype.__dataHost=e,o.prototype.__templatizeOwner=t,o.prototype.__hostProps=i.hostProps,o}var G=s(2224);class Z{constructor(){this._asyncModule=null,this._callback=null,this._timer=null}setConfig(e,t){this._asyncModule=e,this._callback=t,this._timer=this._asyncModule.run((()=>{this._timer=null,ee.delete(this),this._callback()}))}cancel(){this.isActive()&&(this._cancelAsync(),ee.delete(this))}_cancelAsync(){this.isActive()&&(this._asyncModule.cancel(this._timer),this._timer=null)}flush(){this.isActive()&&(this.cancel(),this._callback())}isActive(){return null!=this._timer}static debounce(e,t,s){return e instanceof Z?e._cancelAsync():e=new Z,e.setConfig(t,s),e}}let ee=new Set;const te=function(){const e=Boolean(ee.size);return ee.forEach((e=>{try{e.flush()}catch(e){setTimeout((()=>{throw e}))}})),e},se=function(){let e,t;do{e=window.ShadyDOM&&ShadyDOM.flush(),window.ShadyCSS&&window.ShadyCSS.ScopingShim&&window.ShadyCSS.ScopingShim.flush(),t=te()}while(e||t)};var ie=s(1446);let ae=!1;const ne=N(h.H3);class oe extends ne{static get is(){return"dom-repeat"}static get template(){return null}static get properties(){return{items:{type:Array},as:{type:String,value:"item"},indexAs:{type:String,value:"index"},itemsIndexAs:{type:String,value:"itemsIndex"},sort:{type:Function,observer:"__sortChanged"},filter:{type:Function,observer:"__filterChanged"},observe:{type:String,observer:"__observeChanged"},delay:Number,renderedItemCount:{type:Number,notify:!z.dJ,readOnly:!0},initialCount:{type:Number},targetFramerate:{type:Number,value:20},_targetFrameTime:{type:Number,computed:"__computeFrameTime(targetFramerate)"},notifyDomChange:{type:Boolean},reuseChunkedInstances:{type:Boolean}}}static get observers(){return["__itemsChanged(items.*)"]}constructor(){super(),this.__instances=[],this.__renderDebouncer=null,this.__itemsIdxToInstIdx={},this.__chunkCount=null,this.__renderStartTime=null,this.__itemsArrayChanged=!1,this.__shouldMeasureChunk=!1,this.__shouldContinueChunking=!1,this.__chunkingId=0,this.__sortFn=null,this.__filterFn=null,this.__observePaths=null,this.__ctor=null,this.__isDetached=!0,this.template=null,this._templateInfo}disconnectedCallback(){super.disconnectedCallback(),this.__isDetached=!0;for(let e=0;e<this.__instances.length;e++)this.__detachInstance(e);this.__chunkingId&&cancelAnimationFrame(this.__chunkingId)}connectedCallback(){if(super.connectedCallback(),function(){if(z.nL&&!z.my){if(!ae){ae=!0;const e=document.createElement("style");e.textContent="dom-bind,dom-if,dom-repeat{display:none;}",document.head.appendChild(e)}return!0}return!1}()||(this.style.display="none"),this.__isDetached){this.__isDetached=!1;let e=(0,$.r)((0,$.r)(this).parentNode);for(let t=0;t<this.__instances.length;t++)this.__attachInstance(t,e);this.__chunkingId&&this.__render()}}__ensureTemplatized(){if(!this.__ctor){const e=this;let t=this.template=e._templateInfo?e:this.querySelector("template");if(!t){let e=new MutationObserver((()=>{if(!this.querySelector("template"))throw new Error("dom-repeat requires a <template> child");e.disconnect(),this.__render()}));return e.observe(this,{childList:!0}),!1}let s={};s[this.as]=!0,s[this.indexAs]=!0,s[this.itemsIndexAs]=!0,this.__ctor=J(t,this,{mutableData:this.mutableData,parentModel:!0,instanceProps:s,forwardHostProp:function(e,t){let s=this.__instances;for(let i,a=0;a<s.length&&(i=s[a]);a++)i.forwardHostProp(e,t)},notifyInstanceProp:function(e,t,s){if((0,ie.wB)(this.as,t)){let i=e[this.itemsIndexAs];t==this.as&&(this.items[i]=s);let a=(0,ie.Iu)(this.as,`${JSCompiler_renameProperty("items",this)}.${i}`,t);this.notifyPath(a,s)}}})}return!0}__getMethodHost(){return this.__dataHost._methodHost||this.__dataHost}__functionFromPropertyValue(e){if("string"==typeof e){let t=e,s=this.__getMethodHost();return function(){return s[t].apply(s,arguments)}}return e}__sortChanged(e){this.__sortFn=this.__functionFromPropertyValue(e),this.items&&this.__debounceRender(this.__render)}__filterChanged(e){this.__filterFn=this.__functionFromPropertyValue(e),this.items&&this.__debounceRender(this.__render)}__computeFrameTime(e){return Math.ceil(1e3/e)}__observeChanged(){this.__observePaths=this.observe&&this.observe.replace(".*",".").split(" ")}__handleObservedPaths(e){if(this.__sortFn||this.__filterFn)if(e){if(this.__observePaths){let t=this.__observePaths;for(let s=0;s<t.length;s++)0===e.indexOf(t[s])&&this.__debounceRender(this.__render,this.delay)}}else this.__debounceRender(this.__render,this.delay)}__itemsChanged(e){this.items&&!Array.isArray(this.items)&&console.warn("dom-repeat expected array for `items`, found",this.items),this.__handleItemPath(e.path,e.value)||("items"===e.path&&(this.__itemsArrayChanged=!0),this.__debounceRender(this.__render))}__debounceRender(e,t=0){var s;this.__renderDebouncer=Z.debounce(this.__renderDebouncer,t>0?G.Wc.after(t):G.YA,e.bind(this)),s=this.__renderDebouncer,ee.add(s)}render(){this.__debounceRender(this.__render),se()}__render(){if(!this.__ensureTemplatized())return;let e=this.items||[];const t=this.__sortAndFilterItems(e),s=this.__calculateLimit(t.length);this.__updateInstances(e,s,t),this.initialCount&&(this.__shouldMeasureChunk||this.__shouldContinueChunking)&&(cancelAnimationFrame(this.__chunkingId),this.__chunkingId=requestAnimationFrame((()=>{this.__chunkingId=null,this.__continueChunking()}))),this._setRenderedItemCount(this.__instances.length),z.dJ&&!this.notifyDomChange||this.dispatchEvent(new CustomEvent("dom-change",{bubbles:!0,composed:!0}))}__sortAndFilterItems(e){let t=new Array(e.length);for(let s=0;s<e.length;s++)t[s]=s;return this.__filterFn&&(t=t.filter(((t,s,i)=>this.__filterFn(e[t],s,i)))),this.__sortFn&&t.sort(((t,s)=>this.__sortFn(e[t],e[s]))),t}__calculateLimit(e){let t=e;const s=this.__instances.length;if(this.initialCount){let i;!this.__chunkCount||this.__itemsArrayChanged&&!this.reuseChunkedInstances?(t=Math.min(e,this.initialCount),i=Math.max(t-s,0),this.__chunkCount=i||1):(i=Math.min(Math.max(e-s,0),this.__chunkCount),t=Math.min(s+i,e)),this.__shouldMeasureChunk=i===this.__chunkCount,this.__shouldContinueChunking=t<e,this.__renderStartTime=performance.now()}return this.__itemsArrayChanged=!1,t}__continueChunking(){if(this.__shouldMeasureChunk){const e=performance.now()-this.__renderStartTime,t=this._targetFrameTime/e;this.__chunkCount=Math.round(this.__chunkCount*t)||1}this.__shouldContinueChunking&&this.__debounceRender(this.__render)}__updateInstances(e,t,s){const i=this.__itemsIdxToInstIdx={};let a;for(a=0;a<t;a++){let t=this.__instances[a],n=s[a],o=e[n];i[n]=a,t?(t._setPendingProperty(this.as,o),t._setPendingProperty(this.indexAs,a),t._setPendingProperty(this.itemsIndexAs,n),t._flushProperties()):this.__insertInstance(o,a,n)}for(let e=this.__instances.length-1;e>=a;e--)this.__detachAndRemoveInstance(e)}__detachInstance(e){let t=this.__instances[e];const s=(0,$.r)(t.root);for(let e=0;e<t.children.length;e++){let i=t.children[e];s.appendChild(i)}return t}__attachInstance(e,t){let s=this.__instances[e];t.insertBefore(s.root,this)}__detachAndRemoveInstance(e){this.__detachInstance(e),this.__instances.splice(e,1)}__stampInstance(e,t,s){let i={};return i[this.as]=e,i[this.indexAs]=t,i[this.itemsIndexAs]=s,new this.__ctor(i)}__insertInstance(e,t,s){const i=this.__stampInstance(e,t,s);let a=this.__instances[t+1],n=a?a.children[0]:this;return(0,$.r)((0,$.r)(this).parentNode).insertBefore(i.root,n),this.__instances[t]=i,i}_showHideChildren(e){for(let t=0;t<this.__instances.length;t++)this.__instances[t]._showHideChildren(e)}__handleItemPath(e,t){let s=e.slice(6),i=s.indexOf("."),a=i<0?s:s.substring(0,i);if(a==parseInt(a,10)){let e=i<0?"":s.substring(i+1);this.__handleObservedPaths(e);let n=this.__itemsIdxToInstIdx[a],o=this.__instances[n];if(o){let s=this.as+(e?"."+e:"");o._setPendingPropertyOrPath(s,t,!1,!0),o._flushProperties()}return!0}}itemForElement(e){let t=this.modelForElement(e);return t&&t[this.as]}indexForElement(e){let t=this.modelForElement(e);return t&&t[this.indexAs]}modelForElement(e){return function(e,t){let s;for(;t;)if(s=t.__dataHost?t:t.__templatizeInstance){if(s.__dataHost==e)return s;t=s.__dataHost}else t=(0,$.r)(t).parentNode;return null}(this.template,e)}}customElements.define(oe.is,oe);var re=s(1360),le=s(9109);const he=e=>class extends((0,re.W)(e)){static get properties(){return{month:{type:Object,value:new Date,sync:!0},selectedDate:{type:Object,notify:!0,sync:!0},focusedDate:{type:Object},showWeekNumbers:{type:Boolean,value:!1},i18n:{type:Object},ignoreTaps:{type:Boolean},minDate:{type:Date,value:null,sync:!0},maxDate:{type:Date,value:null,sync:!0},disabled:{type:Boolean,reflectToAttribute:!0},_days:{type:Array},_weeks:{type:Array},_notTapping:{type:Boolean}}}static get observers(){return["__focusedDateChanged(focusedDate, _days)"]}get focusableDateElement(){return[...this.shadowRoot.querySelectorAll("[part~=date]")].find((e=>g(e.date,this.focusedDate)))}ready(){super.ready(),(0,le.NH)(this.$.monthGrid,"tap",this._handleTap.bind(this))}_isDisabled(e,t,s){const i=new Date(0,0);i.setFullYear(e.getFullYear()),i.setMonth(e.getMonth()),i.setDate(1);const a=new Date(0,0);return a.setFullYear(e.getFullYear()),a.setMonth(e.getMonth()+1),a.setDate(0),!(t&&s&&t.getMonth()===s.getMonth()&&t.getMonth()===e.getMonth()&&s.getDate()-t.getDate()>=0||b(i,t,s)||b(a,t,s))}_getTitle(e,t){if(void 0!==e&&void 0!==t)return t.formatTitle(t.monthNames[e.getMonth()],e.getFullYear())}_onMonthGridTouchStart(){this._notTapping=!1,setTimeout((()=>{this._notTapping=!0}),300)}_dateAdd(e,t){e.setDate(e.getDate()+t)}_applyFirstDayOfWeek(e,t){if(void 0!==e&&void 0!==t)return e.slice(t).concat(e.slice(0,t))}_getWeekDayNames(e,t){if(void 0===e||void 0===t)return[];const{weekdays:s,weekdaysShort:i,firstDayOfWeek:a}=e,n=this._applyFirstDayOfWeek(i,a);return this._applyFirstDayOfWeek(s,a).map(((e,t)=>({weekDay:e,weekDayShort:n[t]})))}__focusedDateChanged(e,t){Array.isArray(t)&&t.some((t=>g(t,e)))?this.removeAttribute("aria-hidden"):this.setAttribute("aria-hidden","true")}_getDate(e){return e?e.getDate():""}_showWeekSeparator(e,t){return e&&t&&1===t.firstDayOfWeek}_isToday(e){return g(new Date,e)}_getDays(e,t){if(void 0===e||void 0===t)return[];const s=new Date(0,0);for(s.setFullYear(e.getFullYear()),s.setMonth(e.getMonth()),s.setDate(1);s.getDay()!==t.firstDayOfWeek;)this._dateAdd(s,-1);const i=[],a=s.getMonth(),n=e.getMonth();for(;s.getMonth()===n||s.getMonth()===a;)i.push(s.getMonth()===n?new Date(s.getTime()):null),this._dateAdd(s,1);return i}_getWeeks(e){return e.reduce(((e,t,s)=>(s%7==0&&e.push([]),e[e.length-1].push(t),e)),[])}_handleTap(e){this.ignoreTaps||this._notTapping||!e.target.date||e.target.hasAttribute("disabled")||(this.selectedDate=e.target.date,this.dispatchEvent(new CustomEvent("date-tap",{detail:{date:e.target.date},bubbles:!0,composed:!0})))}_preventDefault(e){e.preventDefault()}__getWeekNumber(e){return function(e){let t=e.getDay();0===t&&(t=7);const s=4-t,i=new Date(e.getTime()+24*s*3600*1e3),a=new Date(0,0);a.setFullYear(i.getFullYear());const n=i.getTime()-a.getTime(),o=Math.round(n/864e5);return Math.floor(o/7+1)}(e.reduce(((e,t)=>!e&&t?t:e)))}__getDayAriaLabel(e){if(!e)return"";let t=`${this._getDate(e)} ${this.i18n.monthNames[e.getMonth()]} ${e.getFullYear()}, ${this.i18n.weekdays[e.getDay()]}`;return this._isToday(e)&&(t+=`, ${this.i18n.today}`),t}},de=m.iv`
761
+ `}}(0,d.M)(O),i(7894);var F=i(4933),H=i(1014);function z(t,e,i,o,a){let s;a&&(s="object"==typeof i&&null!==i,s&&(o=t.__dataTemp[e]));let n=o!==i&&(o==o||i==i);return s&&n&&(t.__dataTemp[e]=i),n}const Y=(0,H.o)((t=>class extends t{_shouldPropertyChange(t,e,i){return z(this,t,e,i,!0)}})),V=(0,H.o)((t=>class extends t{static get properties(){return{mutableData:Boolean}}_shouldPropertyChange(t,e,i){return z(this,t,e,i,this.mutableData)}}));Y._mutablePropertyChange=z;var B=i(9387),L=i(1342);let N=null;function $(){return N}$.prototype=Object.create(HTMLTemplateElement.prototype,{constructor:{value:$,writable:!0}});const W=(0,F.q)($),R=Y(W),j=(0,F.q)(class{});class q extends j{constructor(t){super(),this._configureProperties(t),this.root=this._stampTemplate(this.__dataHost);let e=[];this.children=e;for(let t=this.root.firstChild;t;t=t.nextSibling)e.push(t),t.__templatizeInstance=this;this.__templatizeOwner&&this.__templatizeOwner.__hideTemplateChildren__&&this._showHideChildren(!0);let i=this.__templatizeOptions;(t&&i.instanceProps||!i.instanceProps)&&this._enableProperties()}_configureProperties(t){if(this.__templatizeOptions.forwardHostProp)for(let t in this.__hostProps)this._setPendingProperty(t,this.__dataHost["_host_"+t]);for(let e in t)this._setPendingProperty(e,t[e])}forwardHostProp(t,e){this._setPendingPropertyOrPath(t,e,!1,!0)&&this.__dataHost._enqueueClient(this)}_addEventListenerToNode(t,e,i){if(this._methodHost&&this.__templatizeOptions.parentModel)this._methodHost._addEventListenerToNode(t,e,(t=>{t.model=this,i(t)}));else{let o=this.__dataHost.__dataHost;o&&o._addEventListenerToNode(t,e,i)}}_showHideChildren(t){!function(t,e){for(let i=0;i<e.length;i++){let o=e[i];if(Boolean(t)!=Boolean(o.__hideTemplateChildren__))if(o.nodeType===Node.TEXT_NODE)t?(o.__polymerTextContent__=o.textContent,o.textContent=""):o.textContent=o.__polymerTextContent__;else if("slot"===o.localName)if(t)o.__polymerReplaced__=document.createComment("hidden-slot"),(0,L.r)((0,L.r)(o).parentNode).replaceChild(o.__polymerReplaced__,o);else{const t=o.__polymerReplaced__;t&&(0,L.r)((0,L.r)(t).parentNode).replaceChild(o,t)}else o.style&&(t?(o.__polymerDisplay__=o.style.display,o.style.display="none"):o.style.display=o.__polymerDisplay__);o.__hideTemplateChildren__=t,o._showHideChildren&&o._showHideChildren(t)}}(t,this.children)}_setUnmanagedPropertyToNode(t,e,i){t.__hideTemplateChildren__&&t.nodeType==Node.TEXT_NODE&&"textContent"==e?t.__polymerTextContent__=i:super._setUnmanagedPropertyToNode(t,e,i)}get parentModel(){let t=this.__parentModel;if(!t){let e;t=this;do{t=t.__dataHost.__dataHost}while((e=t.__templatizeOptions)&&!e.parentModel);this.__parentModel=t}return t}dispatchEvent(t){return!0}}q.prototype.__dataHost,q.prototype.__templatizeOptions,q.prototype._methodHost,q.prototype.__templatizeOwner,q.prototype.__hostProps;const K=Y(q);function U(t){let e=t.__dataHost;return e&&e._methodHost||e}function X(t,e){return function(t,i,o){e.call(t.__templatizeOwner,i.substring(6),o[i])}}function Q(t,e){return function(t,i,o){e.call(t.__templatizeOwner,t,i,o[i])}}function J(t,e,i){if(B.XN&&!U(t))throw new Error("strictTemplatePolicy: template owner not trusted");if(i=i||{},t.__templatizeOwner)throw new Error("A <template> can only be templatized once");t.__templatizeOwner=e;let o=(e?e.constructor:q)._parseTemplate(t),a=o.templatizeInstanceClass;a||(a=function(t,e,i){let o=i.mutableData?K:q;J.mixin&&(o=J.mixin(o));let a=class extends o{};return a.prototype.__templatizeOptions=i,a.prototype._bindTemplate(t),function(t,e,i,o){let a=i.hostProps||{};for(let e in o.instanceProps){delete a[e];let i=o.notifyInstanceProp;i&&t.prototype._addPropertyEffect(e,t.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:Q(0,i)})}if(o.forwardHostProp&&e.__dataHost)for(let e in a)i.hasHostProps||(i.hasHostProps=!0),t.prototype._addPropertyEffect(e,t.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:function(t,e,i){t.__dataHost._setPendingPropertyOrPath("_host_"+e,i[e],!0,!0)}})}(a,t,e,i),a}(t,o,i),o.templatizeInstanceClass=a);const s=U(t);!function(t,e,i,o){let a=i.forwardHostProp;if(a&&e.hasHostProps){const s="template"==t.localName;let n=e.templatizeTemplateClass;if(!n){if(s){let t=i.mutableData?R:W;class o extends t{}n=e.templatizeTemplateClass=o}else{const i=t.constructor;class o extends i{}n=e.templatizeTemplateClass=o}let r=e.hostProps;for(let t in r)n.prototype._addPropertyEffect("_host_"+t,n.prototype.PROPERTY_EFFECT_TYPES.PROPAGATE,{fn:X(0,a)}),n.prototype._createNotifyingProperty("_host_"+t);B.a2&&o&&function(t,e,i){const o=i.constructor._properties,{propertyEffects:a}=t,{instanceProps:s}=e;for(let t in a)if(!(o[t]||s&&s[t])){const e=a[t];for(let i=0;i<e.length;i++){const{part:o}=e[i].info;if(!o.signature||!o.signature.static){console.warn(`Property '${t}' used in template but not declared in 'properties'; attribute will not be observed.`);break}}}}(e,i,o)}if(t.__dataProto&&Object.assign(t.__data,t.__dataProto),s)!function(t,e){N=t,Object.setPrototypeOf(t,e.prototype),new e,N=null}(t,n),t.__dataTemp={},t.__dataPending=null,t.__dataOld=null,t._enableProperties();else{Object.setPrototypeOf(t,n.prototype);const i=e.hostProps;for(let e in i)if(e="_host_"+e,e in t){const i=t[e];delete t[e],t.__data[e]=i}}}}(t,o,i,s);let n=class extends a{};return n.prototype._methodHost=s,n.prototype.__dataHost=t,n.prototype.__templatizeOwner=e,n.prototype.__hostProps=o.hostProps,n}var G=i(2224);class Z{constructor(){this._asyncModule=null,this._callback=null,this._timer=null}setConfig(t,e){this._asyncModule=t,this._callback=e,this._timer=this._asyncModule.run((()=>{this._timer=null,tt.delete(this),this._callback()}))}cancel(){this.isActive()&&(this._cancelAsync(),tt.delete(this))}_cancelAsync(){this.isActive()&&(this._asyncModule.cancel(this._timer),this._timer=null)}flush(){this.isActive()&&(this.cancel(),this._callback())}isActive(){return null!=this._timer}static debounce(t,e,i){return t instanceof Z?t._cancelAsync():t=new Z,t.setConfig(e,i),t}}let tt=new Set;const et=function(){const t=Boolean(tt.size);return tt.forEach((t=>{try{t.flush()}catch(t){setTimeout((()=>{throw t}))}})),t},it=function(){let t,e;do{t=window.ShadyDOM&&ShadyDOM.flush(),window.ShadyCSS&&window.ShadyCSS.ScopingShim&&window.ShadyCSS.ScopingShim.flush(),e=et()}while(t||e)};var ot=i(1446);let at=!1;const st=V(h.H3);class nt extends st{static get is(){return"dom-repeat"}static get template(){return null}static get properties(){return{items:{type:Array},as:{type:String,value:"item"},indexAs:{type:String,value:"index"},itemsIndexAs:{type:String,value:"itemsIndex"},sort:{type:Function,observer:"__sortChanged"},filter:{type:Function,observer:"__filterChanged"},observe:{type:String,observer:"__observeChanged"},delay:Number,renderedItemCount:{type:Number,notify:!B.dJ,readOnly:!0},initialCount:{type:Number},targetFramerate:{type:Number,value:20},_targetFrameTime:{type:Number,computed:"__computeFrameTime(targetFramerate)"},notifyDomChange:{type:Boolean},reuseChunkedInstances:{type:Boolean}}}static get observers(){return["__itemsChanged(items.*)"]}constructor(){super(),this.__instances=[],this.__renderDebouncer=null,this.__itemsIdxToInstIdx={},this.__chunkCount=null,this.__renderStartTime=null,this.__itemsArrayChanged=!1,this.__shouldMeasureChunk=!1,this.__shouldContinueChunking=!1,this.__chunkingId=0,this.__sortFn=null,this.__filterFn=null,this.__observePaths=null,this.__ctor=null,this.__isDetached=!0,this.template=null,this._templateInfo}disconnectedCallback(){super.disconnectedCallback(),this.__isDetached=!0;for(let t=0;t<this.__instances.length;t++)this.__detachInstance(t);this.__chunkingId&&cancelAnimationFrame(this.__chunkingId)}connectedCallback(){if(super.connectedCallback(),function(){if(B.nL&&!B.my){if(!at){at=!0;const t=document.createElement("style");t.textContent="dom-bind,dom-if,dom-repeat{display:none;}",document.head.appendChild(t)}return!0}return!1}()||(this.style.display="none"),this.__isDetached){this.__isDetached=!1;let t=(0,L.r)((0,L.r)(this).parentNode);for(let e=0;e<this.__instances.length;e++)this.__attachInstance(e,t);this.__chunkingId&&this.__render()}}__ensureTemplatized(){if(!this.__ctor){const t=this;let e=this.template=t._templateInfo?t:this.querySelector("template");if(!e){let t=new MutationObserver((()=>{if(!this.querySelector("template"))throw new Error("dom-repeat requires a <template> child");t.disconnect(),this.__render()}));return t.observe(this,{childList:!0}),!1}let i={};i[this.as]=!0,i[this.indexAs]=!0,i[this.itemsIndexAs]=!0,this.__ctor=J(e,this,{mutableData:this.mutableData,parentModel:!0,instanceProps:i,forwardHostProp:function(t,e){let i=this.__instances;for(let o,a=0;a<i.length&&(o=i[a]);a++)o.forwardHostProp(t,e)},notifyInstanceProp:function(t,e,i){if((0,ot.wB)(this.as,e)){let o=t[this.itemsIndexAs];e==this.as&&(this.items[o]=i);let a=(0,ot.Iu)(this.as,`${JSCompiler_renameProperty("items",this)}.${o}`,e);this.notifyPath(a,i)}}})}return!0}__getMethodHost(){return this.__dataHost._methodHost||this.__dataHost}__functionFromPropertyValue(t){if("string"==typeof t){let e=t,i=this.__getMethodHost();return function(){return i[e].apply(i,arguments)}}return t}__sortChanged(t){this.__sortFn=this.__functionFromPropertyValue(t),this.items&&this.__debounceRender(this.__render)}__filterChanged(t){this.__filterFn=this.__functionFromPropertyValue(t),this.items&&this.__debounceRender(this.__render)}__computeFrameTime(t){return Math.ceil(1e3/t)}__observeChanged(){this.__observePaths=this.observe&&this.observe.replace(".*",".").split(" ")}__handleObservedPaths(t){if(this.__sortFn||this.__filterFn)if(t){if(this.__observePaths){let e=this.__observePaths;for(let i=0;i<e.length;i++)0===t.indexOf(e[i])&&this.__debounceRender(this.__render,this.delay)}}else this.__debounceRender(this.__render,this.delay)}__itemsChanged(t){this.items&&!Array.isArray(this.items)&&console.warn("dom-repeat expected array for `items`, found",this.items),this.__handleItemPath(t.path,t.value)||("items"===t.path&&(this.__itemsArrayChanged=!0),this.__debounceRender(this.__render))}__debounceRender(t,e=0){var i;this.__renderDebouncer=Z.debounce(this.__renderDebouncer,e>0?G.Wc.after(e):G.YA,t.bind(this)),i=this.__renderDebouncer,tt.add(i)}render(){this.__debounceRender(this.__render),it()}__render(){if(!this.__ensureTemplatized())return;let t=this.items||[];const e=this.__sortAndFilterItems(t),i=this.__calculateLimit(e.length);this.__updateInstances(t,i,e),this.initialCount&&(this.__shouldMeasureChunk||this.__shouldContinueChunking)&&(cancelAnimationFrame(this.__chunkingId),this.__chunkingId=requestAnimationFrame((()=>{this.__chunkingId=null,this.__continueChunking()}))),this._setRenderedItemCount(this.__instances.length),B.dJ&&!this.notifyDomChange||this.dispatchEvent(new CustomEvent("dom-change",{bubbles:!0,composed:!0}))}__sortAndFilterItems(t){let e=new Array(t.length);for(let i=0;i<t.length;i++)e[i]=i;return this.__filterFn&&(e=e.filter(((e,i,o)=>this.__filterFn(t[e],i,o)))),this.__sortFn&&e.sort(((e,i)=>this.__sortFn(t[e],t[i]))),e}__calculateLimit(t){let e=t;const i=this.__instances.length;if(this.initialCount){let o;!this.__chunkCount||this.__itemsArrayChanged&&!this.reuseChunkedInstances?(e=Math.min(t,this.initialCount),o=Math.max(e-i,0),this.__chunkCount=o||1):(o=Math.min(Math.max(t-i,0),this.__chunkCount),e=Math.min(i+o,t)),this.__shouldMeasureChunk=o===this.__chunkCount,this.__shouldContinueChunking=e<t,this.__renderStartTime=performance.now()}return this.__itemsArrayChanged=!1,e}__continueChunking(){if(this.__shouldMeasureChunk){const t=performance.now()-this.__renderStartTime,e=this._targetFrameTime/t;this.__chunkCount=Math.round(this.__chunkCount*e)||1}this.__shouldContinueChunking&&this.__debounceRender(this.__render)}__updateInstances(t,e,i){const o=this.__itemsIdxToInstIdx={};let a;for(a=0;a<e;a++){let e=this.__instances[a],s=i[a],n=t[s];o[s]=a,e?(e._setPendingProperty(this.as,n),e._setPendingProperty(this.indexAs,a),e._setPendingProperty(this.itemsIndexAs,s),e._flushProperties()):this.__insertInstance(n,a,s)}for(let t=this.__instances.length-1;t>=a;t--)this.__detachAndRemoveInstance(t)}__detachInstance(t){let e=this.__instances[t];const i=(0,L.r)(e.root);for(let t=0;t<e.children.length;t++){let o=e.children[t];i.appendChild(o)}return e}__attachInstance(t,e){let i=this.__instances[t];e.insertBefore(i.root,this)}__detachAndRemoveInstance(t){this.__detachInstance(t),this.__instances.splice(t,1)}__stampInstance(t,e,i){let o={};return o[this.as]=t,o[this.indexAs]=e,o[this.itemsIndexAs]=i,new this.__ctor(o)}__insertInstance(t,e,i){const o=this.__stampInstance(t,e,i);let a=this.__instances[e+1],s=a?a.children[0]:this;return(0,L.r)((0,L.r)(this).parentNode).insertBefore(o.root,s),this.__instances[e]=o,o}_showHideChildren(t){for(let e=0;e<this.__instances.length;e++)this.__instances[e]._showHideChildren(t)}__handleItemPath(t,e){let i=t.slice(6),o=i.indexOf("."),a=o<0?i:i.substring(0,o);if(a==parseInt(a,10)){let t=o<0?"":i.substring(o+1);this.__handleObservedPaths(t);let s=this.__itemsIdxToInstIdx[a],n=this.__instances[s];if(n){let i=this.as+(t?"."+t:"");n._setPendingPropertyOrPath(i,e,!1,!0),n._flushProperties()}return!0}}itemForElement(t){let e=this.modelForElement(t);return e&&e[this.as]}indexForElement(t){let e=this.modelForElement(t);return e&&e[this.indexAs]}modelForElement(t){return function(t,e){let i;for(;e;)if(i=e.__dataHost?e:e.__templatizeInstance){if(i.__dataHost==t)return i;e=i.__dataHost}else e=(0,L.r)(e).parentNode;return null}(this.template,t)}}customElements.define(nt.is,nt);var rt=i(1360),lt=i(9109);const ht=t=>class extends((0,rt.W)(t)){static get properties(){return{month:{type:Object,value:new Date,sync:!0},selectedDate:{type:Object,notify:!0,sync:!0},focusedDate:{type:Object},showWeekNumbers:{type:Boolean,value:!1},i18n:{type:Object},ignoreTaps:{type:Boolean},minDate:{type:Date,value:null,sync:!0},maxDate:{type:Date,value:null,sync:!0},disabled:{type:Boolean,reflectToAttribute:!0},_days:{type:Array},_weeks:{type:Array},_notTapping:{type:Boolean}}}static get observers(){return["__focusedDateChanged(focusedDate, _days)"]}get focusableDateElement(){return[...this.shadowRoot.querySelectorAll("[part~=date]")].find((t=>g(t.date,this.focusedDate)))}ready(){super.ready(),(0,lt.NH)(this.$.monthGrid,"tap",this._handleTap.bind(this))}_isDisabled(t,e,i){const o=new Date(0,0);o.setFullYear(t.getFullYear()),o.setMonth(t.getMonth()),o.setDate(1);const a=new Date(0,0);return a.setFullYear(t.getFullYear()),a.setMonth(t.getMonth()+1),a.setDate(0),!(e&&i&&e.getMonth()===i.getMonth()&&e.getMonth()===t.getMonth()&&i.getDate()-e.getDate()>=0||v(o,e,i)||v(a,e,i))}_getTitle(t,e){if(void 0!==t&&void 0!==e)return e.formatTitle(e.monthNames[t.getMonth()],t.getFullYear())}_onMonthGridTouchStart(){this._notTapping=!1,setTimeout((()=>{this._notTapping=!0}),300)}_dateAdd(t,e){t.setDate(t.getDate()+e)}_applyFirstDayOfWeek(t,e){if(void 0!==t&&void 0!==e)return t.slice(e).concat(t.slice(0,e))}_getWeekDayNames(t,e){if(void 0===t||void 0===e)return[];const{weekdays:i,weekdaysShort:o,firstDayOfWeek:a}=t,s=this._applyFirstDayOfWeek(o,a);return this._applyFirstDayOfWeek(i,a).map(((t,e)=>({weekDay:t,weekDayShort:s[e]})))}__focusedDateChanged(t,e){Array.isArray(e)&&e.some((e=>g(e,t)))?this.removeAttribute("aria-hidden"):this.setAttribute("aria-hidden","true")}_getDate(t){return t?t.getDate():""}_showWeekSeparator(t,e){return t&&e&&1===e.firstDayOfWeek}_isToday(t){return g(new Date,t)}_getDays(t,e){if(void 0===t||void 0===e)return[];const i=new Date(0,0);for(i.setFullYear(t.getFullYear()),i.setMonth(t.getMonth()),i.setDate(1);i.getDay()!==e.firstDayOfWeek;)this._dateAdd(i,-1);const o=[],a=i.getMonth(),s=t.getMonth();for(;i.getMonth()===s||i.getMonth()===a;)o.push(i.getMonth()===s?new Date(i.getTime()):null),this._dateAdd(i,1);return o}_getWeeks(t){return t.reduce(((t,e,i)=>(i%7==0&&t.push([]),t[t.length-1].push(e),t)),[])}_handleTap(t){this.ignoreTaps||this._notTapping||!t.target.date||t.target.hasAttribute("disabled")||(this.selectedDate=t.target.date,this.dispatchEvent(new CustomEvent("date-tap",{detail:{date:t.target.date},bubbles:!0,composed:!0})))}_preventDefault(t){t.preventDefault()}__getWeekNumber(t){return function(t){let e=t.getDay();0===e&&(e=7);const i=4-e,o=new Date(t.getTime()+24*i*3600*1e3),a=new Date(0,0);a.setFullYear(o.getFullYear());const s=o.getTime()-a.getTime(),n=Math.round(s/864e5);return Math.floor(n/7+1)}(t.reduce(((t,e)=>!t&&e?e:t)))}__getDayAriaLabel(t){if(!t)return"";let e=`${this._getDate(t)} ${this.i18n.monthNames[t.getMonth()]} ${t.getFullYear()}, ${this.i18n.weekdays[t.getDay()]}`;return this._isToday(t)&&(e+=`, ${this.i18n.today}`),e}},dt=m.iv`
426
762
  :host {
427
763
  display: block;
428
764
  }
@@ -478,7 +814,7 @@
478
814
  outline: 3px solid;
479
815
  }
480
816
  }
481
- `;(0,a.hC)("vaadin-month-calendar",de,{moduleId:"vaadin-month-calendar-styles"});class ce extends(he((0,a.Tb)(h.H3))){static get template(){return h.dy`
817
+ `;(0,a.hC)("vaadin-month-calendar",dt,{moduleId:"vaadin-month-calendar-styles"});class ct extends(ht((0,a.Tb)(h.H3))){static get template(){return h.dy`
482
818
  <div part="month-header" id="month-header" aria-hidden="true">[[_getTitle(month, i18n)]]</div>
483
819
  <table
484
820
  id="monthGrid"
@@ -520,7 +856,7 @@
520
856
  </template>
521
857
  </tbody>
522
858
  </table>
523
- `}static get is(){return"vaadin-month-calendar"}static get properties(){return{_days:{type:Array,computed:"_getDays(month, i18n, minDate, maxDate)"},_weeks:{type:Array,computed:"_getWeeks(_days)"},disabled:{type:Boolean,reflectToAttribute:!0,computed:"_isDisabled(month, minDate, maxDate)"}}}static get observers(){return["_showWeekNumbersChanged(showWeekNumbers, i18n)"]}_showWeekNumbersChanged(e,t){e&&t&&1===t.firstDayOfWeek?this.setAttribute("week-numbers",""):this.removeAttribute("week-numbers")}__getDatePart(e,t,s,i,a){const n=["date"];return this.__isDayDisabled(e,i,a)&&n.push("disabled"),this.__isDayFocused(e,t)&&n.push("focused"),this.__isDaySelected(e,s)&&n.push("selected"),this._isToday(e)&&n.push("today"),n.join(" ")}__isDayFocused(e,t){return g(e,t)}__isDaySelected(e,t){return g(e,t)}__getDayAriaSelected(e,t){if(this.__isDaySelected(e,t))return"true"}__isDayDisabled(e,t,s){return!b(e,t,s)}__getDayAriaDisabled(e,t,s){if(void 0!==e&&void 0!==t&&void 0!==s)return this.__isDayDisabled(e,t,s)?"true":void 0}__getDayTabindex(e,t){return this.__isDayFocused(e,t)?"0":"-1"}}(0,d.M)(ce);var ue=s(6155),_e=s(2223);class pe{constructor(e,t){this.query=e,this.callback=t,this._boundQueryHandler=this._queryHandler.bind(this)}hostConnected(){this._removeListener(),this._mediaQuery=window.matchMedia(this.query),this._addListener(),this._queryHandler(this._mediaQuery)}hostDisconnected(){this._removeListener()}_addListener(){this._mediaQuery&&this._mediaQuery.addListener(this._boundQueryHandler)}_removeListener(){this._mediaQuery&&this._mediaQuery.removeListener(this._boundQueryHandler),this._mediaQuery=null}_queryHandler(e){"function"==typeof this.callback&&this.callback(e.matches)}}var me=s(9229);const fe=e=>class extends e{static get properties(){return{scrollDuration:{type:Number,value:300},selectedDate:{type:Object,value:null,sync:!0},focusedDate:{type:Object,notify:!0,observer:"_focusedDateChanged",sync:!0},_focusedMonthDate:Number,initialPosition:{type:Object,observer:"_initialPositionChanged"},_originDate:{type:Object,value:new Date},_visibleMonthIndex:Number,_desktopMode:{type:Boolean,observer:"_desktopModeChanged"},_desktopMediaQuery:{type:String,value:"(min-width: 375px)"},_translateX:{observer:"_translateXChanged"},_yearScrollerWidth:{value:50},i18n:{type:Object},showWeekNumbers:{type:Boolean,value:!1},_ignoreTaps:Boolean,_notTapping:Boolean,minDate:{type:Object,sync:!0},maxDate:{type:Object,sync:!0},label:String,_cancelButton:{type:Object},_todayButton:{type:Object},calendars:{type:Array,value:()=>[]},years:{type:Array,value:()=>[]}}}static get observers(){return["__updateCalendars(calendars, i18n, minDate, maxDate, selectedDate, focusedDate, showWeekNumbers, _ignoreTaps, _theme)","__updateCancelButton(_cancelButton, i18n)","__updateTodayButton(_todayButton, i18n, minDate, maxDate)","__updateYears(years, selectedDate, _theme)"]}get __useSubMonthScrolling(){return this._monthScroller.clientHeight<this._monthScroller.itemHeight+this._monthScroller.bufferOffset}get focusableDateElement(){return this.calendars.map((e=>e.focusableDateElement)).find(Boolean)}_addListeners(){(0,le.BP)(this.$.scrollers,"pan-y"),(0,le.NH)(this.$.scrollers,"track",this._track.bind(this)),(0,le.NH)(this.shadowRoot.querySelector('[part="clear-button"]'),"tap",this._clear.bind(this)),(0,le.NH)(this.shadowRoot.querySelector('[part="toggle-button"]'),"tap",this._cancel.bind(this)),(0,le.NH)(this.shadowRoot.querySelector('[part="years-toggle-button"]'),"tap",this._toggleYearScroller.bind(this))}_initControllers(){this.addController(new pe(this._desktopMediaQuery,(e=>{this._desktopMode=e}))),this.addController(new me.n(this,"today-button","vaadin-button",{observe:!1,initializer:e=>{e.setAttribute("theme","tertiary"),e.addEventListener("keydown",(e=>this.__onTodayButtonKeyDown(e))),(0,le.NH)(e,"tap",this._onTodayTap.bind(this)),this._todayButton=e}})),this.addController(new me.n(this,"cancel-button","vaadin-button",{observe:!1,initializer:e=>{e.setAttribute("theme","tertiary"),e.addEventListener("keydown",(e=>this.__onCancelButtonKeyDown(e))),(0,le.NH)(e,"tap",this._cancel.bind(this)),this._cancelButton=e}})),this.__initMonthScroller(),this.__initYearScroller()}reset(){this._closeYearScroller(),this._toggleAnimateClass(!0)}focusCancel(){this._cancelButton.focus()}scrollToDate(e,t){const s=this.__useSubMonthScrolling?this._calculateWeekScrollOffset(e):0;this._scrollToPosition(this._differenceInMonths(e,this._originDate)+s,t),this._monthScroller.forceUpdate()}__initMonthScroller(){this.addController(new me.n(this,"months","vaadin-date-picker-month-scroller",{observe:!1,initializer:e=>{e.addEventListener("custom-scroll",(()=>{this._onMonthScroll()})),e.addEventListener("touchstart",(()=>{this._onMonthScrollTouchStart()})),e.addEventListener("keydown",(e=>{this.__onMonthCalendarKeyDown(e)})),e.addEventListener("init-done",(()=>{const e=[...this.querySelectorAll("vaadin-month-calendar")];e.forEach((e=>{e.addEventListener("selected-date-changed",(e=>{this.selectedDate=e.detail.value}))})),this.calendars=e})),this._monthScroller=e}}))}__initYearScroller(){this.addController(new me.n(this,"years","vaadin-date-picker-year-scroller",{observe:!1,initializer:e=>{e.setAttribute("aria-hidden","true"),(0,le.NH)(e,"tap",(e=>{this._onYearTap(e)})),e.addEventListener("custom-scroll",(()=>{this._onYearScroll()})),e.addEventListener("touchstart",(()=>{this._onYearScrollTouchStart()})),e.addEventListener("init-done",(()=>{this.years=[...this.querySelectorAll("vaadin-date-picker-year")]})),this._yearScroller=e}}))}__updateCancelButton(e,t){e&&(e.textContent=t&&t.cancel)}__updateTodayButton(e,t,s,i){e&&(e.textContent=t&&t.today,e.disabled=!this._isTodayAllowed(s,i))}__updateCalendars(e,t,s,i,a,n,o,r,l){e&&e.length&&e.forEach((e=>{e.i18n=t,e.minDate=s,e.maxDate=i,e.focusedDate=n,e.selectedDate=a,e.showWeekNumbers=o,e.ignoreTaps=r,l?e.setAttribute("theme",l):e.removeAttribute("theme")}))}__updateYears(e,t,s){e&&e.length&&e.forEach((e=>{e.selectedDate=t,s?e.setAttribute("theme",s):e.removeAttribute("theme")}))}_selectDate(e){this.selectedDate=e,this.dispatchEvent(new CustomEvent("date-selected",{detail:{date:e},bubbles:!0,composed:!0}))}_desktopModeChanged(e){this.toggleAttribute("desktop",e)}_focusedDateChanged(e){this.revealDate(e)}revealDate(e,t=!0){if(!e)return;const s=this._differenceInMonths(e,this._originDate);if(this.__useSubMonthScrolling){const i=this._calculateWeekScrollOffset(e);return void this._scrollToPosition(s+i,t)}const i=this._monthScroller.position>s,a=Math.max(this._monthScroller.itemHeight,this._monthScroller.clientHeight-2*this._monthScroller.bufferOffset)/this._monthScroller.itemHeight,n=this._monthScroller.position+a-1<s;i?this._scrollToPosition(s,t):n&&this._scrollToPosition(s-a+1,t)}_calculateWeekScrollOffset(e){const t=new Date(0,0);t.setFullYear(e.getFullYear()),t.setMonth(e.getMonth()),t.setDate(1);let s=0;for(;t.getDate()<e.getDate();)t.setDate(t.getDate()+1),t.getDay()===this.i18n.firstDayOfWeek&&(s+=1);return s/6}_initialPositionChanged(e){this._monthScroller&&this._yearScroller&&(this._monthScroller.active=!0,this._yearScroller.active=!0),this.scrollToDate(e)}_repositionYearScroller(){const e=this._monthScroller.position;this._visibleMonthIndex=Math.floor(e),this._yearScroller.position=(e+this._originDate.getMonth())/12}_repositionMonthScroller(){this._monthScroller.position=12*this._yearScroller.position-this._originDate.getMonth(),this._visibleMonthIndex=Math.floor(this._monthScroller.position)}_onMonthScroll(){this._repositionYearScroller(),this._doIgnoreTaps()}_onYearScroll(){this._repositionMonthScroller(),this._doIgnoreTaps()}_onYearScrollTouchStart(){this._notTapping=!1,setTimeout((()=>{this._notTapping=!0}),300),this._repositionMonthScroller()}_onMonthScrollTouchStart(){this._repositionYearScroller()}_doIgnoreTaps(){this._ignoreTaps=!0,this._debouncer=S.dx.debounce(this._debouncer,C.Wc.after(300),(()=>{this._ignoreTaps=!1}))}_formatDisplayed(e,t,s){return e&&t&&"function"==typeof t.formatDate?t.formatDate(D(e)):s}_onTodayTap(){const e=new Date;Math.abs(this._monthScroller.position-this._differenceInMonths(e,this._originDate))<.001?(this._selectDate(e),this._close()):this._scrollToCurrentMonth()}_scrollToCurrentMonth(){this.focusedDate&&(this.focusedDate=new Date),this.scrollToDate(new Date,!0)}_onYearTap(e){if(!this._ignoreTaps&&!this._notTapping){const t=(e.detail.y-(this._yearScroller.getBoundingClientRect().top+this._yearScroller.clientHeight/2))/this._yearScroller.itemHeight;this._scrollToPosition(this._monthScroller.position+12*t,!0)}}_scrollToPosition(e,t){if(void 0!==this._targetPosition)return void(this._targetPosition=e);if(!t)return this._monthScroller.position=e,this._targetPosition=void 0,this._repositionYearScroller(),void this.__tryFocusDate();let s;this._targetPosition=e,this._revealPromise=new Promise((e=>{s=e}));let i=0;const a=this._monthScroller.position,n=e=>{i||(i=e);const t=e-i;if(t<this.scrollDuration){const e=(o=t,r=a,l=this._targetPosition-a,(o/=this.scrollDuration/2)<1?l/2*o*o+r:-l/2*((o-=1)*(o-2)-1)+r);this._monthScroller.position=e,window.requestAnimationFrame(n)}else this.dispatchEvent(new CustomEvent("scroll-animation-finished",{bubbles:!0,composed:!0,detail:{position:this._targetPosition,oldPosition:a}})),this._monthScroller.position=this._targetPosition,this._targetPosition=void 0,s(),this._revealPromise=void 0;var o,r,l;setTimeout(this._repositionYearScroller.bind(this),1)};window.requestAnimationFrame(n)}_limit(e,t){return Math.min(t.max,Math.max(t.min,e))}_handleTrack(e){if(Math.abs(e.detail.dx)<10||Math.abs(e.detail.ddy)>10)return;Math.abs(e.detail.ddx)>this._yearScrollerWidth/3&&this._toggleAnimateClass(!0);const t=this._translateX+e.detail.ddx;this._translateX=this._limit(t,{min:0,max:this._yearScrollerWidth})}_track(e){if(!this._desktopMode)switch(e.detail.state){case"start":this._toggleAnimateClass(!1);break;case"track":this._handleTrack(e);break;case"end":this._toggleAnimateClass(!0),this._translateX>=this._yearScrollerWidth/2?this._closeYearScroller():this._openYearScroller()}}_toggleAnimateClass(e){e?this.classList.add("animate"):this.classList.remove("animate")}_toggleYearScroller(){this._isYearScrollerVisible()?this._closeYearScroller():this._openYearScroller()}_openYearScroller(){this._translateX=0,this.setAttribute("years-visible","")}_closeYearScroller(){this.removeAttribute("years-visible"),this._translateX=this._yearScrollerWidth}_isYearScrollerVisible(){return this._translateX<this._yearScrollerWidth/2}_translateXChanged(e){this._desktopMode||(this._monthScroller.style.transform=`translateX(${e-this._yearScrollerWidth}px)`,this._yearScroller.style.transform=`translateX(${e}px)`)}_yearAfterXMonths(e){return w(e).getFullYear()}_differenceInMonths(e,t){return 12*(e.getFullYear()-t.getFullYear())-t.getMonth()+e.getMonth()}_clear(){this._selectDate("")}_close(){this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}_cancel(){this.focusedDate=this.selectedDate,this._close()}_preventDefault(e){e.preventDefault()}__toggleDate(e){g(e,this.selectedDate)?(this._clear(),this.focusedDate=e):this._selectDate(e)}__onMonthCalendarKeyDown(e){let t=!1;switch(e.key){case"ArrowDown":this._moveFocusByDays(7),t=!0;break;case"ArrowUp":this._moveFocusByDays(-7),t=!0;break;case"ArrowRight":this._moveFocusByDays(this.__isRTL?-1:1),t=!0;break;case"ArrowLeft":this._moveFocusByDays(this.__isRTL?1:-1),t=!0;break;case"Enter":this._selectDate(this.focusedDate),this._close(),t=!0;break;case" ":this.__toggleDate(this.focusedDate),t=!0;break;case"Home":this._moveFocusInsideMonth(this.focusedDate,"minDate"),t=!0;break;case"End":this._moveFocusInsideMonth(this.focusedDate,"maxDate"),t=!0;break;case"PageDown":this._moveFocusByMonths(e.shiftKey?12:1),t=!0;break;case"PageUp":this._moveFocusByMonths(e.shiftKey?-12:-1),t=!0;break;case"Tab":this._onTabKeyDown(e,"calendar")}t&&(e.preventDefault(),e.stopPropagation())}_onTabKeyDown(e,t){switch(e.stopPropagation(),t){case"calendar":e.shiftKey&&(e.preventDefault(),this.hasAttribute("fullscreen")?this.focusCancel():this.__focusInput());break;case"today":e.shiftKey&&(e.preventDefault(),this.focusDateElement());break;case"cancel":e.shiftKey||(e.preventDefault(),this.hasAttribute("fullscreen")?this.focusDateElement():this.__focusInput())}}__onTodayButtonKeyDown(e){"Tab"===e.key&&this._onTabKeyDown(e,"today")}__onCancelButtonKeyDown(e){"Tab"===e.key&&this._onTabKeyDown(e,"cancel")}__focusInput(){this.dispatchEvent(new CustomEvent("focus-input",{bubbles:!0,composed:!0}))}__tryFocusDate(){if(this.__pendingDateFocus){const e=this.focusableDateElement;e&&g(e.date,this.__pendingDateFocus)&&(delete this.__pendingDateFocus,e.focus())}}async focusDate(e,t){const s=e||this.selectedDate||this.initialPosition||new Date;this.focusedDate=s,t||(this._focusedMonthDate=s.getDate()),await this.focusDateElement(!1)}async focusDateElement(e=!0){this.__pendingDateFocus=this.focusedDate,this.calendars.length||await new Promise((e=>{(0,_e.T8)(this,(()=>{se(),e()}))})),e&&this.revealDate(this.focusedDate),this._revealPromise&&await this._revealPromise,this.__tryFocusDate()}_focusClosestDate(e){this.focusDate(v(e,[this.minDate,this.maxDate]))}_focusAllowedDate(e,t,s){this._dateAllowed(e)?this.focusDate(e,s):this._dateAllowed(this.focusedDate)?t>0?this.focusDate(this.maxDate):this.focusDate(this.minDate):this._focusClosestDate(this.focusedDate)}_getDateDiff(e,t){const s=new Date(0,0);return s.setFullYear(this.focusedDate.getFullYear()),s.setMonth(this.focusedDate.getMonth()+e),t&&s.setDate(this.focusedDate.getDate()+t),s}_moveFocusByDays(e){const t=this._getDateDiff(0,e);this._focusAllowedDate(t,e,!1)}_moveFocusByMonths(e){const t=this._getDateDiff(e),s=t.getMonth();this._focusedMonthDate||(this._focusedMonthDate=this.focusedDate.getDate()),t.setDate(this._focusedMonthDate),t.getMonth()!==s&&t.setDate(0),this._focusAllowedDate(t,e,!0)}_moveFocusInsideMonth(e,t){const s=new Date(0,0);s.setFullYear(e.getFullYear()),"minDate"===t?(s.setMonth(e.getMonth()),s.setDate(1)):(s.setMonth(e.getMonth()+1),s.setDate(0)),this._dateAllowed(s)?this.focusDate(s):this._dateAllowed(e)?this.focusDate(this[t]):this._focusClosestDate(e)}_dateAllowed(e,t=this.minDate,s=this.maxDate){return(!t||e>=t)&&(!s||e<=s)}_isTodayAllowed(e,t){const s=new Date,i=new Date(0,0);return i.setFullYear(s.getFullYear()),i.setMonth(s.getMonth()),i.setDate(s.getDate()),this._dateAllowed(i,e,t)}},ye=m.iv`
859
+ `}static get is(){return"vaadin-month-calendar"}static get properties(){return{_days:{type:Array,computed:"_getDays(month, i18n, minDate, maxDate)"},_weeks:{type:Array,computed:"_getWeeks(_days)"},disabled:{type:Boolean,reflectToAttribute:!0,computed:"_isDisabled(month, minDate, maxDate)"}}}static get observers(){return["_showWeekNumbersChanged(showWeekNumbers, i18n)"]}_showWeekNumbersChanged(t,e){t&&e&&1===e.firstDayOfWeek?this.setAttribute("week-numbers",""):this.removeAttribute("week-numbers")}__getDatePart(t,e,i,o,a){const s=["date"];return this.__isDayDisabled(t,o,a)&&s.push("disabled"),this.__isDayFocused(t,e)&&s.push("focused"),this.__isDaySelected(t,i)&&s.push("selected"),this._isToday(t)&&s.push("today"),s.join(" ")}__isDayFocused(t,e){return g(t,e)}__isDaySelected(t,e){return g(t,e)}__getDayAriaSelected(t,e){if(this.__isDaySelected(t,e))return"true"}__isDayDisabled(t,e,i){return!v(t,e,i)}__getDayAriaDisabled(t,e,i){if(void 0!==t&&void 0!==e&&void 0!==i)return this.__isDayDisabled(t,e,i)?"true":void 0}__getDayTabindex(t,e){return this.__isDayFocused(t,e)?"0":"-1"}}(0,d.M)(ct);var ut=i(6155),_t=i(2223);class pt{constructor(t,e){this.query=t,this.callback=e,this._boundQueryHandler=this._queryHandler.bind(this)}hostConnected(){this._removeListener(),this._mediaQuery=window.matchMedia(this.query),this._addListener(),this._queryHandler(this._mediaQuery)}hostDisconnected(){this._removeListener()}_addListener(){this._mediaQuery&&this._mediaQuery.addListener(this._boundQueryHandler)}_removeListener(){this._mediaQuery&&this._mediaQuery.removeListener(this._boundQueryHandler),this._mediaQuery=null}_queryHandler(t){"function"==typeof this.callback&&this.callback(t.matches)}}var mt=i(9229);const ft=t=>class extends t{static get properties(){return{scrollDuration:{type:Number,value:300},selectedDate:{type:Object,value:null,sync:!0},focusedDate:{type:Object,notify:!0,observer:"_focusedDateChanged",sync:!0},_focusedMonthDate:Number,initialPosition:{type:Object,observer:"_initialPositionChanged"},_originDate:{type:Object,value:new Date},_visibleMonthIndex:Number,_desktopMode:{type:Boolean,observer:"_desktopModeChanged"},_desktopMediaQuery:{type:String,value:"(min-width: 375px)"},_translateX:{observer:"_translateXChanged"},_yearScrollerWidth:{value:50},i18n:{type:Object},showWeekNumbers:{type:Boolean,value:!1},_ignoreTaps:Boolean,_notTapping:Boolean,minDate:{type:Object,sync:!0},maxDate:{type:Object,sync:!0},label:String,_cancelButton:{type:Object},_todayButton:{type:Object},calendars:{type:Array,value:()=>[]},years:{type:Array,value:()=>[]}}}static get observers(){return["__updateCalendars(calendars, i18n, minDate, maxDate, selectedDate, focusedDate, showWeekNumbers, _ignoreTaps, _theme)","__updateCancelButton(_cancelButton, i18n)","__updateTodayButton(_todayButton, i18n, minDate, maxDate)","__updateYears(years, selectedDate, _theme)"]}get __useSubMonthScrolling(){return this._monthScroller.clientHeight<this._monthScroller.itemHeight+this._monthScroller.bufferOffset}get focusableDateElement(){return this.calendars.map((t=>t.focusableDateElement)).find(Boolean)}_addListeners(){(0,lt.BP)(this.$.scrollers,"pan-y"),(0,lt.NH)(this.$.scrollers,"track",this._track.bind(this)),(0,lt.NH)(this.shadowRoot.querySelector('[part="clear-button"]'),"tap",this._clear.bind(this)),(0,lt.NH)(this.shadowRoot.querySelector('[part="toggle-button"]'),"tap",this._cancel.bind(this)),(0,lt.NH)(this.shadowRoot.querySelector('[part="years-toggle-button"]'),"tap",this._toggleYearScroller.bind(this))}_initControllers(){this.addController(new pt(this._desktopMediaQuery,(t=>{this._desktopMode=t}))),this.addController(new mt.n(this,"today-button","vaadin-button",{observe:!1,initializer:t=>{t.setAttribute("theme","tertiary"),t.addEventListener("keydown",(t=>this.__onTodayButtonKeyDown(t))),(0,lt.NH)(t,"tap",this._onTodayTap.bind(this)),this._todayButton=t}})),this.addController(new mt.n(this,"cancel-button","vaadin-button",{observe:!1,initializer:t=>{t.setAttribute("theme","tertiary"),t.addEventListener("keydown",(t=>this.__onCancelButtonKeyDown(t))),(0,lt.NH)(t,"tap",this._cancel.bind(this)),this._cancelButton=t}})),this.__initMonthScroller(),this.__initYearScroller()}reset(){this._closeYearScroller(),this._toggleAnimateClass(!0)}focusCancel(){this._cancelButton.focus()}scrollToDate(t,e){const i=this.__useSubMonthScrolling?this._calculateWeekScrollOffset(t):0;this._scrollToPosition(this._differenceInMonths(t,this._originDate)+i,e),this._monthScroller.forceUpdate()}__initMonthScroller(){this.addController(new mt.n(this,"months","vaadin-date-picker-month-scroller",{observe:!1,initializer:t=>{t.addEventListener("custom-scroll",(()=>{this._onMonthScroll()})),t.addEventListener("touchstart",(()=>{this._onMonthScrollTouchStart()})),t.addEventListener("keydown",(t=>{this.__onMonthCalendarKeyDown(t)})),t.addEventListener("init-done",(()=>{const t=[...this.querySelectorAll("vaadin-month-calendar")];t.forEach((t=>{t.addEventListener("selected-date-changed",(t=>{this.selectedDate=t.detail.value}))})),this.calendars=t})),this._monthScroller=t}}))}__initYearScroller(){this.addController(new mt.n(this,"years","vaadin-date-picker-year-scroller",{observe:!1,initializer:t=>{t.setAttribute("aria-hidden","true"),(0,lt.NH)(t,"tap",(t=>{this._onYearTap(t)})),t.addEventListener("custom-scroll",(()=>{this._onYearScroll()})),t.addEventListener("touchstart",(()=>{this._onYearScrollTouchStart()})),t.addEventListener("init-done",(()=>{this.years=[...this.querySelectorAll("vaadin-date-picker-year")]})),this._yearScroller=t}}))}__updateCancelButton(t,e){t&&(t.textContent=e&&e.cancel)}__updateTodayButton(t,e,i,o){t&&(t.textContent=e&&e.today,t.disabled=!this._isTodayAllowed(i,o))}__updateCalendars(t,e,i,o,a,s,n,r,l){t&&t.length&&t.forEach((t=>{t.i18n=e,t.minDate=i,t.maxDate=o,t.focusedDate=s,t.selectedDate=a,t.showWeekNumbers=n,t.ignoreTaps=r,l?t.setAttribute("theme",l):t.removeAttribute("theme")}))}__updateYears(t,e,i){t&&t.length&&t.forEach((t=>{t.selectedDate=e,i?t.setAttribute("theme",i):t.removeAttribute("theme")}))}_selectDate(t){this.selectedDate=t,this.dispatchEvent(new CustomEvent("date-selected",{detail:{date:t},bubbles:!0,composed:!0}))}_desktopModeChanged(t){this.toggleAttribute("desktop",t)}_focusedDateChanged(t){this.revealDate(t)}revealDate(t,e=!0){if(!t)return;const i=this._differenceInMonths(t,this._originDate);if(this.__useSubMonthScrolling){const o=this._calculateWeekScrollOffset(t);return void this._scrollToPosition(i+o,e)}const o=this._monthScroller.position>i,a=Math.max(this._monthScroller.itemHeight,this._monthScroller.clientHeight-2*this._monthScroller.bufferOffset)/this._monthScroller.itemHeight,s=this._monthScroller.position+a-1<i;o?this._scrollToPosition(i,e):s&&this._scrollToPosition(i-a+1,e)}_calculateWeekScrollOffset(t){const e=new Date(0,0);e.setFullYear(t.getFullYear()),e.setMonth(t.getMonth()),e.setDate(1);let i=0;for(;e.getDate()<t.getDate();)e.setDate(e.getDate()+1),e.getDay()===this.i18n.firstDayOfWeek&&(i+=1);return i/6}_initialPositionChanged(t){this._monthScroller&&this._yearScroller&&(this._monthScroller.active=!0,this._yearScroller.active=!0),this.scrollToDate(t)}_repositionYearScroller(){const t=this._monthScroller.position;this._visibleMonthIndex=Math.floor(t),this._yearScroller.position=(t+this._originDate.getMonth())/12}_repositionMonthScroller(){this._monthScroller.position=12*this._yearScroller.position-this._originDate.getMonth(),this._visibleMonthIndex=Math.floor(this._monthScroller.position)}_onMonthScroll(){this._repositionYearScroller(),this._doIgnoreTaps()}_onYearScroll(){this._repositionMonthScroller(),this._doIgnoreTaps()}_onYearScrollTouchStart(){this._notTapping=!1,setTimeout((()=>{this._notTapping=!0}),300),this._repositionMonthScroller()}_onMonthScrollTouchStart(){this._repositionYearScroller()}_doIgnoreTaps(){this._ignoreTaps=!0,this._debouncer=S.dx.debounce(this._debouncer,x.Wc.after(300),(()=>{this._ignoreTaps=!1}))}_formatDisplayed(t,e,i){return t&&e&&"function"==typeof e.formatDate?e.formatDate(D(t)):i}_onTodayTap(){const t=new Date;Math.abs(this._monthScroller.position-this._differenceInMonths(t,this._originDate))<.001?(this._selectDate(t),this._close()):this._scrollToCurrentMonth()}_scrollToCurrentMonth(){this.focusedDate&&(this.focusedDate=new Date),this.scrollToDate(new Date,!0)}_onYearTap(t){if(!this._ignoreTaps&&!this._notTapping){const e=(t.detail.y-(this._yearScroller.getBoundingClientRect().top+this._yearScroller.clientHeight/2))/this._yearScroller.itemHeight;this._scrollToPosition(this._monthScroller.position+12*e,!0)}}_scrollToPosition(t,e){if(void 0!==this._targetPosition)return void(this._targetPosition=t);if(!e)return this._monthScroller.position=t,this._targetPosition=void 0,this._repositionYearScroller(),void this.__tryFocusDate();let i;this._targetPosition=t,this._revealPromise=new Promise((t=>{i=t}));let o=0;const a=this._monthScroller.position,s=t=>{o||(o=t);const e=t-o;if(e<this.scrollDuration){const t=(n=e,r=a,l=this._targetPosition-a,(n/=this.scrollDuration/2)<1?l/2*n*n+r:-l/2*((n-=1)*(n-2)-1)+r);this._monthScroller.position=t,window.requestAnimationFrame(s)}else this.dispatchEvent(new CustomEvent("scroll-animation-finished",{bubbles:!0,composed:!0,detail:{position:this._targetPosition,oldPosition:a}})),this._monthScroller.position=this._targetPosition,this._targetPosition=void 0,i(),this._revealPromise=void 0;var n,r,l;setTimeout(this._repositionYearScroller.bind(this),1)};window.requestAnimationFrame(s)}_limit(t,e){return Math.min(e.max,Math.max(e.min,t))}_handleTrack(t){if(Math.abs(t.detail.dx)<10||Math.abs(t.detail.ddy)>10)return;Math.abs(t.detail.ddx)>this._yearScrollerWidth/3&&this._toggleAnimateClass(!0);const e=this._translateX+t.detail.ddx;this._translateX=this._limit(e,{min:0,max:this._yearScrollerWidth})}_track(t){if(!this._desktopMode)switch(t.detail.state){case"start":this._toggleAnimateClass(!1);break;case"track":this._handleTrack(t);break;case"end":this._toggleAnimateClass(!0),this._translateX>=this._yearScrollerWidth/2?this._closeYearScroller():this._openYearScroller()}}_toggleAnimateClass(t){t?this.classList.add("animate"):this.classList.remove("animate")}_toggleYearScroller(){this._isYearScrollerVisible()?this._closeYearScroller():this._openYearScroller()}_openYearScroller(){this._translateX=0,this.setAttribute("years-visible","")}_closeYearScroller(){this.removeAttribute("years-visible"),this._translateX=this._yearScrollerWidth}_isYearScrollerVisible(){return this._translateX<this._yearScrollerWidth/2}_translateXChanged(t){this._desktopMode||(this._monthScroller.style.transform=`translateX(${t-this._yearScrollerWidth}px)`,this._yearScroller.style.transform=`translateX(${t}px)`)}_yearAfterXMonths(t){return w(t).getFullYear()}_differenceInMonths(t,e){return 12*(t.getFullYear()-e.getFullYear())-e.getMonth()+t.getMonth()}_clear(){this._selectDate("")}_close(){this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}_cancel(){this.focusedDate=this.selectedDate,this._close()}_preventDefault(t){t.preventDefault()}__toggleDate(t){g(t,this.selectedDate)?(this._clear(),this.focusedDate=t):this._selectDate(t)}__onMonthCalendarKeyDown(t){let e=!1;switch(t.key){case"ArrowDown":this._moveFocusByDays(7),e=!0;break;case"ArrowUp":this._moveFocusByDays(-7),e=!0;break;case"ArrowRight":this._moveFocusByDays(this.__isRTL?-1:1),e=!0;break;case"ArrowLeft":this._moveFocusByDays(this.__isRTL?1:-1),e=!0;break;case"Enter":this._selectDate(this.focusedDate),this._close(),e=!0;break;case" ":this.__toggleDate(this.focusedDate),e=!0;break;case"Home":this._moveFocusInsideMonth(this.focusedDate,"minDate"),e=!0;break;case"End":this._moveFocusInsideMonth(this.focusedDate,"maxDate"),e=!0;break;case"PageDown":this._moveFocusByMonths(t.shiftKey?12:1),e=!0;break;case"PageUp":this._moveFocusByMonths(t.shiftKey?-12:-1),e=!0;break;case"Tab":this._onTabKeyDown(t,"calendar")}e&&(t.preventDefault(),t.stopPropagation())}_onTabKeyDown(t,e){switch(t.stopPropagation(),e){case"calendar":t.shiftKey&&(t.preventDefault(),this.hasAttribute("fullscreen")?this.focusCancel():this.__focusInput());break;case"today":t.shiftKey&&(t.preventDefault(),this.focusDateElement());break;case"cancel":t.shiftKey||(t.preventDefault(),this.hasAttribute("fullscreen")?this.focusDateElement():this.__focusInput())}}__onTodayButtonKeyDown(t){"Tab"===t.key&&this._onTabKeyDown(t,"today")}__onCancelButtonKeyDown(t){"Tab"===t.key&&this._onTabKeyDown(t,"cancel")}__focusInput(){this.dispatchEvent(new CustomEvent("focus-input",{bubbles:!0,composed:!0}))}__tryFocusDate(){if(this.__pendingDateFocus){const t=this.focusableDateElement;t&&g(t.date,this.__pendingDateFocus)&&(delete this.__pendingDateFocus,t.focus())}}async focusDate(t,e){const i=t||this.selectedDate||this.initialPosition||new Date;this.focusedDate=i,e||(this._focusedMonthDate=i.getDate()),await this.focusDateElement(!1)}async focusDateElement(t=!0){this.__pendingDateFocus=this.focusedDate,this.calendars.length||await new Promise((t=>{(0,_t.T8)(this,(()=>{it(),t()}))})),t&&this.revealDate(this.focusedDate),this._revealPromise&&await this._revealPromise,this.__tryFocusDate()}_focusClosestDate(t){this.focusDate(b(t,[this.minDate,this.maxDate]))}_focusAllowedDate(t,e,i){this._dateAllowed(t)?this.focusDate(t,i):this._dateAllowed(this.focusedDate)?e>0?this.focusDate(this.maxDate):this.focusDate(this.minDate):this._focusClosestDate(this.focusedDate)}_getDateDiff(t,e){const i=new Date(0,0);return i.setFullYear(this.focusedDate.getFullYear()),i.setMonth(this.focusedDate.getMonth()+t),e&&i.setDate(this.focusedDate.getDate()+e),i}_moveFocusByDays(t){const e=this._getDateDiff(0,t);this._focusAllowedDate(e,t,!1)}_moveFocusByMonths(t){const e=this._getDateDiff(t),i=e.getMonth();this._focusedMonthDate||(this._focusedMonthDate=this.focusedDate.getDate()),e.setDate(this._focusedMonthDate),e.getMonth()!==i&&e.setDate(0),this._focusAllowedDate(e,t,!0)}_moveFocusInsideMonth(t,e){const i=new Date(0,0);i.setFullYear(t.getFullYear()),"minDate"===e?(i.setMonth(t.getMonth()),i.setDate(1)):(i.setMonth(t.getMonth()+1),i.setDate(0)),this._dateAllowed(i)?this.focusDate(i):this._dateAllowed(t)?this.focusDate(this[e]):this._focusClosestDate(t)}_dateAllowed(t,e=this.minDate,i=this.maxDate){return(!e||t>=e)&&(!i||t<=i)}_isTodayAllowed(t,e){const i=new Date,o=new Date(0,0);return o.setFullYear(i.getFullYear()),o.setMonth(i.getMonth()),o.setDate(i.getDate()),this._dateAllowed(o,t,e)}},yt=m.iv`
524
860
  :host {
525
861
  display: flex;
526
862
  flex-direction: column;
@@ -580,7 +916,7 @@
580
916
  z-index: 2;
581
917
  flex-shrink: 0;
582
918
  }
583
- `;(0,a.hC)("vaadin-date-picker-overlay-content",ye,{moduleId:"vaadin-date-picker-overlay-content-styles"});class ge extends(fe((0,ue.k)((0,a.Tb)((0,c.U)(h.H3))))){static get template(){return h.dy`
919
+ `;(0,a.hC)("vaadin-date-picker-overlay-content",yt,{moduleId:"vaadin-date-picker-overlay-content-styles"});class gt extends(ft((0,ut.k)((0,a.Tb)((0,c.U)(h.H3))))){static get template(){return h.dy`
584
920
  <div part="overlay-header" on-touchend="_preventDefault" aria-hidden="true">
585
921
  <div part="label">[[_formatDisplayed(selectedDate, i18n, label)]]</div>
586
922
  <div part="clear-button" hidden$="[[!selectedDate]]"></div>
@@ -600,7 +936,7 @@
600
936
  <slot name="today-button"></slot>
601
937
  <slot name="cancel-button"></slot>
602
938
  </div>
603
- `}static get is(){return"vaadin-date-picker-overlay-content"}ready(){super.ready(),this.setAttribute("role","dialog"),this._addListeners(),this._initControllers()}}(0,d.M)(ge);var be=s(2521),ve=s(4463),De=s(3406),we=s(3208),ke=s(6729),Ce=s(2743),xe=s(962),Se=s(1370),Te=s(2628),Ee=s(9320),Me=s(9091),Pe=s(9580);const Ie=e=>class extends((0,Ee.u)((0,ue.k)((0,Se.B)((0,Me.t)((0,Te.L)(e)))))){static get properties(){return{_selectedDate:{type:Object,sync:!0},_focusedDate:{type:Object,sync:!0},value:{type:String,notify:!0,value:"",sync:!0},initialPosition:String,opened:{type:Boolean,reflectToAttribute:!0,notify:!0,observer:"_openedChanged",sync:!0},autoOpenDisabled:Boolean,showWeekNumbers:{type:Boolean,value:!1,sync:!0},_fullscreen:{type:Boolean,value:!1,sync:!0},_fullscreenMediaQuery:{value:"(max-width: 420px), (max-height: 420px)"},i18n:{type:Object,sync:!0,value:()=>({monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],firstDayOfWeek:0,today:"Today",cancel:"Cancel",referenceDate:"",formatDate(e){const t=String(e.year).replace(/\d+/u,(e=>"0000".substr(e.length)+e));return[e.month+1,e.day,t].join("/")},parseDate(e){const t=e.split("/"),s=new Date;let i,a=s.getMonth(),n=s.getFullYear();if(3===t.length?(a=parseInt(t[0])-1,i=parseInt(t[1]),n=parseInt(t[2]),t[2].length<3&&n>=0&&(n=function(e,t,s=0,i=1){if(t>99)throw new Error("The provided year cannot have more than 2 digits.");if(t<0)throw new Error("The provided year cannot be negative.");let a=t+100*Math.floor(e.getFullYear()/100);return e<new Date(a-50,s,i)?a-=100:e>new Date(a+50,s,i)&&(a+=100),a}(this.referenceDate?k(this.referenceDate):new Date,n,a,i))):2===t.length?(a=parseInt(t[0])-1,i=parseInt(t[1])):1===t.length&&(i=parseInt(t[0])),void 0!==i)return{day:i,month:a,year:n}},formatTitle:(e,t)=>`${e} ${t}`})},min:{type:String,sync:!0},max:{type:String,sync:!0},_minDate:{type:Date,computed:"__computeMinOrMaxDate(min)",sync:!0},_maxDate:{type:Date,computed:"__computeMinOrMaxDate(max)",sync:!0},_noInput:{type:Boolean,computed:"_isNoInput(inputElement, _fullscreen, _ios, i18n, opened, autoOpenDisabled)"},_ios:{type:Boolean,value:x.gn},_focusOverlayOnOpen:Boolean,_overlayContent:{type:Object,sync:!0},_hasInputValue:{type:Boolean}}}static get observers(){return["_selectedDateChanged(_selectedDate, i18n)","_focusedDateChanged(_focusedDate, i18n)","__updateOverlayContent(_overlayContent, i18n, label, _minDate, _maxDate, _focusedDate, _selectedDate, showWeekNumbers)","__updateOverlayContentTheme(_overlayContent, _theme)","__updateOverlayContentFullScreen(_overlayContent, _fullscreen)"]}static get constraints(){return[...super.constraints,"min","max"]}constructor(){super(),this._boundOnClick=this._onClick.bind(this),this._boundOnScroll=this._onScroll.bind(this),this._boundOverlayRenderer=this._overlayRenderer.bind(this)}get _inputElementValue(){return super._inputElementValue}set _inputElementValue(e){super._inputElementValue=e,this._hasInputValue=!1}get clearElement(){return null}get _nativeInput(){return this.inputElement?this.inputElement.focusElement||this.inputElement:null}get __unparsableValue(){return!this._inputElementValue||this.__parseDate(this._inputElementValue)?"":this._inputElementValue}_onFocus(e){super._onFocus(e),this._noInput&&e.target.blur()}_onBlur(e){super._onBlur(e),this.opened||(this.__commitParsedOrFocusedDate(),document.hasFocus()&&this.validate())}ready(){super.ready(),this.addEventListener("click",this._boundOnClick),this.addController(new pe(this._fullscreenMediaQuery,(e=>{this._fullscreen=e}))),this.addController(new Pe.B(this));const e=this.$.overlay;this._overlayElement=e,e.renderer=this._boundOverlayRenderer,this.addEventListener("mousedown",(()=>this.__bringToFront())),this.addEventListener("touchstart",(()=>this.__bringToFront()))}disconnectedCallback(){super.disconnectedCallback(),this.opened=!1}open(){this.disabled||this.readonly||(this.opened=!0)}close(){this.$.overlay.close()}_overlayRenderer(e){if(e.firstChild)return;const t=document.createElement("vaadin-date-picker-overlay-content");e.appendChild(t),this._overlayContent=t,t.addEventListener("close",(()=>{this._close()})),t.addEventListener("focus-input",this._focusAndSelect.bind(this)),t.addEventListener("date-tap",(e=>{this.__commitDate(e.detail.date),this._close()})),t.addEventListener("date-selected",(e=>{this.__commitDate(e.detail.date)})),t.addEventListener("focusin",(()=>{this._keyboardActive&&this._setFocused(!0)})),t.addEventListener("focused-date-changed",(e=>{this._focusedDate=e.detail.value})),t.addEventListener("click",(e=>e.stopPropagation()))}__parseDate(e){if(!this.i18n.parseDate)return;let t=this.i18n.parseDate(e);return t&&(t=k(`${t.year}-${t.month+1}-${t.day}`)),t&&!isNaN(t.getTime())?t:void 0}__formatDate(e){if(this.i18n.formatDate)return this.i18n.formatDate(D(e))}checkValidity(){const e=this._inputElementValue,t=!e||!!this._selectedDate&&e===this.__formatDate(this._selectedDate),s=!this._selectedDate||b(this._selectedDate,this._minDate,this._maxDate);let i=!0;return this.inputElement&&(this.inputElement.checkValidity?i=this.inputElement.checkValidity():this.inputElement.validate&&(i=this.inputElement.validate())),t&&s&&i}_shouldSetFocus(e){return!this._shouldKeepFocusRing}_shouldRemoveFocus(e){return!this.opened}_setFocused(e){super._setFocused(e),this._shouldKeepFocusRing=e&&this._keyboardActive}__commitValueChange(){const e=this.__unparsableValue;this.__committedValue!==this.value?(this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))):this.__committedUnparsableValue!==e&&(this.validate(),this.dispatchEvent(new CustomEvent("unparsable-change"))),this.__committedValue=this.value,this.__committedUnparsableValue=e}__commitDate(e){this.__keepCommittedValue=!0,this._selectedDate=e,this.__keepCommittedValue=!1,this.__commitValueChange()}_close(){this._focus(),this.close()}__bringToFront(){requestAnimationFrame((()=>{this.$.overlay.bringToFront()}))}_isNoInput(e,t,s,i,a,n){return!e||t&&(!n||a)||s&&a||!i.parseDate}_formatISO(e){if(!(e instanceof Date))return"";const t=(e,t="00")=>(t+e).substr((t+e).length-t.length);let s="",i="0000",a=e.getFullYear();return a<0?(a=-a,s="-",i="000000"):e.getFullYear()>=1e4&&(s="+",i="000000"),[s+t(a,i),t(e.getMonth()+1),t(e.getDate())].join("-")}_inputElementChanged(e){super._inputElementChanged(e),e&&(e.autocomplete="off",e.setAttribute("role","combobox"),e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-expanded",!!this.opened),this._applyInputValue(this._selectedDate))}_openedChanged(e){this.inputElement&&this.inputElement.setAttribute("aria-expanded",e)}_selectedDateChanged(e,t){void 0!==e&&void 0!==t&&(this.__keepInputValue||this._applyInputValue(e),this.value=this._formatISO(e),this._ignoreFocusedDateChange=!0,this._focusedDate=e,this._ignoreFocusedDateChange=!1)}_focusedDateChanged(e,t){void 0!==e&&void 0!==t&&(this._ignoreFocusedDateChange||this._noInput||this._applyInputValue(e))}_valueChanged(e,t){const s=k(e);!e||s?(e?g(this._selectedDate,s)||(this._selectedDate=s,void 0!==t&&this.validate()):this._selectedDate=null,this.__keepCommittedValue||(this.__committedValue=this.value,this.__committedUnparsableValue=""),this._toggleHasValue(this._hasValue)):this.value=t}__updateOverlayContent(e,t,s,i,a,n,o,r){e&&(e.i18n=t,e.label=s,e.minDate=i,e.maxDate=a,e.focusedDate=n,e.selectedDate=o,e.showWeekNumbers=r)}__updateOverlayContentTheme(e,t){e&&(t?e.setAttribute("theme",t):e.removeAttribute("theme"))}__updateOverlayContentFullScreen(e,t){e&&e.toggleAttribute("fullscreen",t)}_onOverlayEscapePress(){this._focusedDate=this._selectedDate,this._close()}_onOverlayOpened(){const e=this._overlayContent;e.reset();const t=this._getInitialPosition();e.initialPosition=t;const s=e.focusedDate||t;e.scrollToDate(s),this._ignoreFocusedDateChange=!0,e.focusedDate=s,this._ignoreFocusedDateChange=!1,window.addEventListener("scroll",this._boundOnScroll,!0),this._focusOverlayOnOpen?(e.focusDateElement(),this._focusOverlayOnOpen=!1):this._focus();const i=this._nativeInput;this._noInput&&i&&(i.blur(),this._overlayContent.focusDateElement());const a=this._noInput?e:[i,e];this.__showOthers=(0,xe.Ry)(a)}_getInitialPosition(){const e=k(this.initialPosition),t=this._selectedDate||this._overlayContent.initialPosition||e||new Date;return e||b(t,this._minDate,this._maxDate)?t:v(t,[this._minDate,this._maxDate])}__commitParsedOrFocusedDate(){if(this._ignoreFocusedDateChange=!0,this.i18n.parseDate){const e=this._inputElementValue||"",t=this.__parseDate(e);t?this.__commitDate(t):(this.__keepInputValue=!0,this.__commitDate(null),this.__keepInputValue=!1)}else this._focusedDate&&this.__commitDate(this._focusedDate);this._ignoreFocusedDateChange=!1}_onOverlayClosed(){this.__showOthers&&(this.__showOthers(),this.__showOthers=null),window.removeEventListener("scroll",this._boundOnScroll,!0),this.__commitParsedOrFocusedDate(),this._nativeInput&&this._nativeInput.selectionStart&&(this._nativeInput.selectionStart=this._nativeInput.selectionEnd),this.value||this._keyboardActive||this.validate()}_onScroll(e){e.target!==window&&this._overlayContent.contains(e.target)||this._overlayContent._repositionYearScroller()}_focus(){this._noInput||this.inputElement.focus()}_focusAndSelect(){this._focus(),this._setSelectionRange(0,this._inputElementValue.length)}_applyInputValue(e){this._inputElementValue=e?this.__formatDate(e):""}_setSelectionRange(e,t){this._nativeInput&&this._nativeInput.setSelectionRange&&this._nativeInput.setSelectionRange(e,t)}_onChange(e){e.stopPropagation()}_onClick(e){this._isClearButton(e)||this._onHostClick(e)}_onHostClick(e){this.autoOpenDisabled&&!this._noInput||(e.preventDefault(),this.open())}_onClearButtonClick(e){e.preventDefault(),this.__commitDate(null)}_onKeyDown(e){switch(super._onKeyDown(e),this._noInput&&-1===[9].indexOf(e.keyCode)&&e.preventDefault(),e.key){case"ArrowDown":case"ArrowUp":e.preventDefault(),this.opened?this._overlayContent.focusDateElement():(this._focusOverlayOnOpen=!0,this.open());break;case"Tab":this.opened&&(e.preventDefault(),e.stopPropagation(),this._setSelectionRange(0,0),e.shiftKey?this._overlayContent.focusCancel():this._overlayContent.focusDateElement())}}_onEnter(e){this.opened?this.close():this.__commitParsedOrFocusedDate()}_onEscape(e){if(!this.opened)return this.clearButtonVisible&&this.value?(e.stopPropagation(),void this._onClearButtonClick(e)):void(""===this.inputElement.value?this.__commitDate(null):this._applyInputValue(this._selectedDate))}_isClearButton(e){return e.composedPath()[0]===this.clearElement}_onInput(){if(this.opened||!this._inputElementValue||this.autoOpenDisabled||this.open(),this._inputElementValue){const e=this.__parseDate(this._inputElementValue);e&&(this._ignoreFocusedDateChange=!0,g(e,this._focusedDate)||(this._focusedDate=e),this._ignoreFocusedDateChange=!1)}}__computeMinOrMaxDate(e){return k(e)}},Oe=m.iv`
939
+ `}static get is(){return"vaadin-date-picker-overlay-content"}ready(){super.ready(),this.setAttribute("role","dialog"),this._addListeners(),this._initControllers()}}(0,d.M)(gt);var vt=i(2521),bt=i(4463),Dt=i(3406),wt=i(3208),kt=i(6729),xt=i(2743),Ct=i(962),St=i(1370),Et=i(2628),Tt=i(9320),Mt=i(9091),Pt=i(9580);const At=t=>class extends((0,Tt.u)((0,ut.k)((0,St.B)((0,Mt.t)((0,Et.L)(t)))))){static get properties(){return{_selectedDate:{type:Object,sync:!0},_focusedDate:{type:Object,sync:!0},value:{type:String,notify:!0,value:"",sync:!0},initialPosition:String,opened:{type:Boolean,reflectToAttribute:!0,notify:!0,observer:"_openedChanged",sync:!0},autoOpenDisabled:Boolean,showWeekNumbers:{type:Boolean,value:!1,sync:!0},_fullscreen:{type:Boolean,value:!1,sync:!0},_fullscreenMediaQuery:{value:"(max-width: 420px), (max-height: 420px)"},i18n:{type:Object,sync:!0,value:()=>({monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],firstDayOfWeek:0,today:"Today",cancel:"Cancel",referenceDate:"",formatDate(t){const e=String(t.year).replace(/\d+/u,(t=>"0000".substr(t.length)+t));return[t.month+1,t.day,e].join("/")},parseDate(t){const e=t.split("/"),i=new Date;let o,a=i.getMonth(),s=i.getFullYear();if(3===e.length?(a=parseInt(e[0])-1,o=parseInt(e[1]),s=parseInt(e[2]),e[2].length<3&&s>=0&&(s=function(t,e,i=0,o=1){if(e>99)throw new Error("The provided year cannot have more than 2 digits.");if(e<0)throw new Error("The provided year cannot be negative.");let a=e+100*Math.floor(t.getFullYear()/100);return t<new Date(a-50,i,o)?a-=100:t>new Date(a+50,i,o)&&(a+=100),a}(this.referenceDate?k(this.referenceDate):new Date,s,a,o))):2===e.length?(a=parseInt(e[0])-1,o=parseInt(e[1])):1===e.length&&(o=parseInt(e[0])),void 0!==o)return{day:o,month:a,year:s}},formatTitle:(t,e)=>`${t} ${e}`})},min:{type:String,sync:!0},max:{type:String,sync:!0},_minDate:{type:Date,computed:"__computeMinOrMaxDate(min)",sync:!0},_maxDate:{type:Date,computed:"__computeMinOrMaxDate(max)",sync:!0},_noInput:{type:Boolean,computed:"_isNoInput(inputElement, _fullscreen, _ios, i18n, opened, autoOpenDisabled)"},_ios:{type:Boolean,value:C.gn},_focusOverlayOnOpen:Boolean,_overlayContent:{type:Object,sync:!0},_hasInputValue:{type:Boolean}}}static get observers(){return["_selectedDateChanged(_selectedDate, i18n)","_focusedDateChanged(_focusedDate, i18n)","__updateOverlayContent(_overlayContent, i18n, label, _minDate, _maxDate, _focusedDate, _selectedDate, showWeekNumbers)","__updateOverlayContentTheme(_overlayContent, _theme)","__updateOverlayContentFullScreen(_overlayContent, _fullscreen)"]}static get constraints(){return[...super.constraints,"min","max"]}constructor(){super(),this._boundOnClick=this._onClick.bind(this),this._boundOnScroll=this._onScroll.bind(this),this._boundOverlayRenderer=this._overlayRenderer.bind(this)}get _inputElementValue(){return super._inputElementValue}set _inputElementValue(t){super._inputElementValue=t,this._hasInputValue=!1}get clearElement(){return null}get _nativeInput(){return this.inputElement?this.inputElement.focusElement||this.inputElement:null}get __unparsableValue(){return!this._inputElementValue||this.__parseDate(this._inputElementValue)?"":this._inputElementValue}_onFocus(t){super._onFocus(t),this._noInput&&t.target.blur()}_onBlur(t){super._onBlur(t),this.opened||(this.__commitParsedOrFocusedDate(),document.hasFocus()&&this.validate())}ready(){super.ready(),this.addEventListener("click",this._boundOnClick),this.addController(new pt(this._fullscreenMediaQuery,(t=>{this._fullscreen=t}))),this.addController(new Pt.B(this));const t=this.$.overlay;this._overlayElement=t,t.renderer=this._boundOverlayRenderer,this.addEventListener("mousedown",(()=>this.__bringToFront())),this.addEventListener("touchstart",(()=>this.__bringToFront()))}disconnectedCallback(){super.disconnectedCallback(),this.opened=!1}open(){this.disabled||this.readonly||(this.opened=!0)}close(){this.$.overlay.close()}_overlayRenderer(t){if(t.firstChild)return;const e=document.createElement("vaadin-date-picker-overlay-content");t.appendChild(e),this._overlayContent=e,e.addEventListener("close",(()=>{this._close()})),e.addEventListener("focus-input",this._focusAndSelect.bind(this)),e.addEventListener("date-tap",(t=>{this.__commitDate(t.detail.date),this._close()})),e.addEventListener("date-selected",(t=>{this.__commitDate(t.detail.date)})),e.addEventListener("focusin",(()=>{this._keyboardActive&&this._setFocused(!0)})),e.addEventListener("focused-date-changed",(t=>{this._focusedDate=t.detail.value})),e.addEventListener("click",(t=>t.stopPropagation()))}__parseDate(t){if(!this.i18n.parseDate)return;let e=this.i18n.parseDate(t);return e&&(e=k(`${e.year}-${e.month+1}-${e.day}`)),e&&!isNaN(e.getTime())?e:void 0}__formatDate(t){if(this.i18n.formatDate)return this.i18n.formatDate(D(t))}checkValidity(){const t=this._inputElementValue,e=!t||!!this._selectedDate&&t===this.__formatDate(this._selectedDate),i=!this._selectedDate||v(this._selectedDate,this._minDate,this._maxDate);let o=!0;return this.inputElement&&(this.inputElement.checkValidity?o=this.inputElement.checkValidity():this.inputElement.validate&&(o=this.inputElement.validate())),e&&i&&o}_shouldSetFocus(t){return!this._shouldKeepFocusRing}_shouldRemoveFocus(t){return!this.opened}_setFocused(t){super._setFocused(t),this._shouldKeepFocusRing=t&&this._keyboardActive}__commitValueChange(){const t=this.__unparsableValue;this.__committedValue!==this.value?(this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))):this.__committedUnparsableValue!==t&&(this.validate(),this.dispatchEvent(new CustomEvent("unparsable-change"))),this.__committedValue=this.value,this.__committedUnparsableValue=t}__commitDate(t){this.__keepCommittedValue=!0,this._selectedDate=t,this.__keepCommittedValue=!1,this.__commitValueChange()}_close(){this._focus(),this.close()}__bringToFront(){requestAnimationFrame((()=>{this.$.overlay.bringToFront()}))}_isNoInput(t,e,i,o,a,s){return!t||e&&(!s||a)||i&&a||!o.parseDate}_formatISO(t){if(!(t instanceof Date))return"";const e=(t,e="00")=>(e+t).substr((e+t).length-e.length);let i="",o="0000",a=t.getFullYear();return a<0?(a=-a,i="-",o="000000"):t.getFullYear()>=1e4&&(i="+",o="000000"),[i+e(a,o),e(t.getMonth()+1),e(t.getDate())].join("-")}_inputElementChanged(t){super._inputElementChanged(t),t&&(t.autocomplete="off",t.setAttribute("role","combobox"),t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-expanded",!!this.opened),this._applyInputValue(this._selectedDate))}_openedChanged(t){this.inputElement&&this.inputElement.setAttribute("aria-expanded",t)}_selectedDateChanged(t,e){void 0!==t&&void 0!==e&&(this.__keepInputValue||this._applyInputValue(t),this.value=this._formatISO(t),this._ignoreFocusedDateChange=!0,this._focusedDate=t,this._ignoreFocusedDateChange=!1)}_focusedDateChanged(t,e){void 0!==t&&void 0!==e&&(this._ignoreFocusedDateChange||this._noInput||this._applyInputValue(t))}_valueChanged(t,e){const i=k(t);!t||i?(t?g(this._selectedDate,i)||(this._selectedDate=i,void 0!==e&&this.validate()):this._selectedDate=null,this.__keepCommittedValue||(this.__committedValue=this.value,this.__committedUnparsableValue=""),this._toggleHasValue(this._hasValue)):this.value=e}__updateOverlayContent(t,e,i,o,a,s,n,r){t&&(t.i18n=e,t.label=i,t.minDate=o,t.maxDate=a,t.focusedDate=s,t.selectedDate=n,t.showWeekNumbers=r)}__updateOverlayContentTheme(t,e){t&&(e?t.setAttribute("theme",e):t.removeAttribute("theme"))}__updateOverlayContentFullScreen(t,e){t&&t.toggleAttribute("fullscreen",e)}_onOverlayEscapePress(){this._focusedDate=this._selectedDate,this._close()}_onOverlayOpened(){const t=this._overlayContent;t.reset();const e=this._getInitialPosition();t.initialPosition=e;const i=t.focusedDate||e;t.scrollToDate(i),this._ignoreFocusedDateChange=!0,t.focusedDate=i,this._ignoreFocusedDateChange=!1,window.addEventListener("scroll",this._boundOnScroll,!0),this._focusOverlayOnOpen?(t.focusDateElement(),this._focusOverlayOnOpen=!1):this._focus();const o=this._nativeInput;this._noInput&&o&&(o.blur(),this._overlayContent.focusDateElement());const a=this._noInput?t:[o,t];this.__showOthers=(0,Ct.Ry)(a)}_getInitialPosition(){const t=k(this.initialPosition),e=this._selectedDate||this._overlayContent.initialPosition||t||new Date;return t||v(e,this._minDate,this._maxDate)?e:b(e,[this._minDate,this._maxDate])}__commitParsedOrFocusedDate(){if(this._ignoreFocusedDateChange=!0,this.i18n.parseDate){const t=this._inputElementValue||"",e=this.__parseDate(t);e?this.__commitDate(e):(this.__keepInputValue=!0,this.__commitDate(null),this.__keepInputValue=!1)}else this._focusedDate&&this.__commitDate(this._focusedDate);this._ignoreFocusedDateChange=!1}_onOverlayClosed(){this.__showOthers&&(this.__showOthers(),this.__showOthers=null),window.removeEventListener("scroll",this._boundOnScroll,!0),this.__commitParsedOrFocusedDate(),this._nativeInput&&this._nativeInput.selectionStart&&(this._nativeInput.selectionStart=this._nativeInput.selectionEnd),this.value||this._keyboardActive||this.validate()}_onScroll(t){t.target!==window&&this._overlayContent.contains(t.target)||this._overlayContent._repositionYearScroller()}_focus(){this._noInput||this.inputElement.focus()}_focusAndSelect(){this._focus(),this._setSelectionRange(0,this._inputElementValue.length)}_applyInputValue(t){this._inputElementValue=t?this.__formatDate(t):""}_setSelectionRange(t,e){this._nativeInput&&this._nativeInput.setSelectionRange&&this._nativeInput.setSelectionRange(t,e)}_onChange(t){t.stopPropagation()}_onClick(t){this._isClearButton(t)||this._onHostClick(t)}_onHostClick(t){this.autoOpenDisabled&&!this._noInput||(t.preventDefault(),this.open())}_onClearButtonClick(t){t.preventDefault(),this.__commitDate(null)}_onKeyDown(t){switch(super._onKeyDown(t),this._noInput&&-1===[9].indexOf(t.keyCode)&&t.preventDefault(),t.key){case"ArrowDown":case"ArrowUp":t.preventDefault(),this.opened?this._overlayContent.focusDateElement():(this._focusOverlayOnOpen=!0,this.open());break;case"Tab":this.opened&&(t.preventDefault(),t.stopPropagation(),this._setSelectionRange(0,0),t.shiftKey?this._overlayContent.focusCancel():this._overlayContent.focusDateElement())}}_onEnter(t){this.opened?this.close():this.__commitParsedOrFocusedDate()}_onEscape(t){if(!this.opened)return this.clearButtonVisible&&this.value?(t.stopPropagation(),void this._onClearButtonClick(t)):void(""===this.inputElement.value?this.__commitDate(null):this._applyInputValue(this._selectedDate))}_isClearButton(t){return t.composedPath()[0]===this.clearElement}_onInput(){if(this.opened||!this._inputElementValue||this.autoOpenDisabled||this.open(),this._inputElementValue){const t=this.__parseDate(this._inputElementValue);t&&(this._ignoreFocusedDateChange=!0,g(t,this._focusedDate)||(this._focusedDate=t),this._ignoreFocusedDateChange=!1)}}__computeMinOrMaxDate(t){return k(t)}},It=m.iv`
604
940
  :host([opened]) {
605
941
  pointer-events: auto;
606
942
  }
@@ -613,7 +949,7 @@
613
949
  direction: rtl;
614
950
  text-align: left;
615
951
  }
616
- `;(0,a.hC)("vaadin-date-picker",[Ce.J,Oe],{moduleId:"vaadin-date-picker-styles"});class Fe extends(Ie((0,De.L)((0,a.Tb)((0,be.S)(h.H3))))){static get is(){return"vaadin-date-picker"}static get template(){return h.dy`
952
+ `;(0,a.hC)("vaadin-date-picker",[xt.J,It],{moduleId:"vaadin-date-picker-styles"});class Ot extends(At((0,Dt.L)((0,a.Tb)((0,vt.S)(h.H3))))){static get is(){return"vaadin-date-picker"}static get template(){return h.dy`
617
953
  <div class="vaadin-date-picker-container">
618
954
  <div part="label">
619
955
  <slot name="label"></slot>
@@ -655,4 +991,96 @@
655
991
  ></vaadin-date-picker-overlay>
656
992
 
657
993
  <slot name="tooltip"></slot>
658
- `}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new we.b(this,(e=>{this._setInputElement(e),this._setFocusElement(e),this.stateTarget=e,this.ariaTarget=e}))),this.addController(new ke.v(this.inputElement,this._labelController)),this._tooltipController=new ve.f(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow((e=>!e.opened)),this.shadowRoot.querySelector('[part="toggle-button"]').addEventListener("mousedown",(e=>e.preventDefault())),this.$.overlay.addEventListener("vaadin-overlay-close",this._onVaadinOverlayClose.bind(this))}_onVaadinOverlayClose(e){e.detail.sourceEvent&&e.detail.sourceEvent.composedPath().includes(this)&&e.preventDefault()}_toggle(e){e.stopPropagation(),this.$.overlay.opened?this.close():this.open()}_openedChanged(e){super._openedChanged(e),this.$.overlay.positionTarget=this.shadowRoot.querySelector('[part="input-field"]'),this.$.overlay.noVerticalOverlap=!0}}(0,d.M)(Fe)}}]);
994
+ `}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new wt.b(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new kt.v(this.inputElement,this._labelController)),this._tooltipController=new bt.f(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow((t=>!t.opened)),this.shadowRoot.querySelector('[part="toggle-button"]').addEventListener("mousedown",(t=>t.preventDefault())),this.$.overlay.addEventListener("vaadin-overlay-close",this._onVaadinOverlayClose.bind(this))}_onVaadinOverlayClose(t){t.detail.sourceEvent&&t.detail.sourceEvent.composedPath().includes(this)&&t.preventDefault()}_toggle(t){t.stopPropagation(),this.$.overlay.opened?this.close():this.open()}_openedChanged(t){super._openedChanged(t),this.$.overlay.positionTarget=this.shadowRoot.querySelector('[part="input-field"]'),this.$.overlay.noVerticalOverlap=!0}}(0,d.M)(Ot)},3208:(t,e,i)=>{i.d(e,{b:()=>a});var o=i(9229);class a extends o.n{constructor(t,e){super(t,"input","input",{initializer:(t,i)=>{i.value&&(t.value=i.value),i.type&&t.setAttribute("type",i.type),t.id=this.defaultId,"function"==typeof e&&e(t)},useUniqueId:!0})}}},9580:(t,e,i)=>{i.d(e,{B:()=>o});class o{constructor(t){this.host=t,t.addEventListener("opened-changed",(()=>{t.opened||this.__setVirtualKeyboardEnabled(!1)})),t.addEventListener("blur",(()=>this.__setVirtualKeyboardEnabled(!0))),t.addEventListener("touchstart",(()=>this.__setVirtualKeyboardEnabled(!0)))}__setVirtualKeyboardEnabled(t){this.host.inputElement&&(this.host.inputElement.inputMode=t?"":"none")}}},3373:(t,e,i)=>{i.d(e,{y:()=>r});var o=i(3726);const a={start:"top",end:"bottom"},s={start:"left",end:"right"},n=new ResizeObserver((t=>{setTimeout((()=>{t.forEach((t=>{t.target.__overlay&&t.target.__overlay._updatePosition()}))}))})),r=t=>class extends t{static get properties(){return{positionTarget:{type:Object,value:null,sync:!0},horizontalAlign:{type:String,value:"start",sync:!0},verticalAlign:{type:String,value:"top",sync:!0},noHorizontalOverlap:{type:Boolean,value:!1,sync:!0},noVerticalOverlap:{type:Boolean,value:!1,sync:!0},requiredVerticalSpace:{type:Number,value:0,sync:!0}}}static get observers(){return["__positionSettingsChanged(horizontalAlign, verticalAlign, noHorizontalOverlap, noVerticalOverlap, requiredVerticalSpace)","__overlayOpenedChanged(opened, positionTarget)"]}constructor(){super(),this.__onScroll=this.__onScroll.bind(this),this._updatePosition=this._updatePosition.bind(this)}connectedCallback(){super.connectedCallback(),this.opened&&this.__addUpdatePositionEventListeners()}disconnectedCallback(){super.disconnectedCallback(),this.__removeUpdatePositionEventListeners()}__addUpdatePositionEventListeners(){window.addEventListener("resize",this._updatePosition),this.__positionTargetAncestorRootNodes=(0,o.AD)(this.positionTarget),this.__positionTargetAncestorRootNodes.forEach((t=>{t.addEventListener("scroll",this.__onScroll,!0)}))}__removeUpdatePositionEventListeners(){window.removeEventListener("resize",this._updatePosition),this.__positionTargetAncestorRootNodes&&(this.__positionTargetAncestorRootNodes.forEach((t=>{t.removeEventListener("scroll",this.__onScroll,!0)})),this.__positionTargetAncestorRootNodes=null)}__overlayOpenedChanged(t,e){if(this.__removeUpdatePositionEventListeners(),e&&(e.__overlay=null,n.unobserve(e),t&&(this.__addUpdatePositionEventListeners(),e.__overlay=this,n.observe(e))),t){const t=getComputedStyle(this);this.__margins||(this.__margins={},["top","bottom","left","right"].forEach((e=>{this.__margins[e]=parseInt(t[e],10)}))),this.setAttribute("dir",t.direction),this._updatePosition(),requestAnimationFrame((()=>this._updatePosition()))}}__positionSettingsChanged(){this._updatePosition()}__onScroll(t){this.contains(t.target)||this._updatePosition()}_updatePosition(){if(!this.positionTarget||!this.opened)return;const t=this.positionTarget.getBoundingClientRect(),e=this.__shouldAlignStartVertically(t);this.style.justifyContent=e?"flex-start":"flex-end";const i=this.__isRTL,o=this.__shouldAlignStartHorizontally(t,i),n=!i&&o||i&&!o;this.style.alignItems=n?"flex-start":"flex-end";const r=this.getBoundingClientRect(),l=this.__calculatePositionInOneDimension(t,r,this.noVerticalOverlap,a,this,e),h=this.__calculatePositionInOneDimension(t,r,this.noHorizontalOverlap,s,this,o);Object.assign(this.style,l,h),this.toggleAttribute("bottom-aligned",!e),this.toggleAttribute("top-aligned",e),this.toggleAttribute("end-aligned",!n),this.toggleAttribute("start-aligned",n)}__shouldAlignStartHorizontally(t,e){const i=Math.max(this.__oldContentWidth||0,this.$.overlay.offsetWidth);this.__oldContentWidth=this.$.overlay.offsetWidth;const o=Math.min(window.innerWidth,document.documentElement.clientWidth),a=!e&&"start"===this.horizontalAlign||e&&"end"===this.horizontalAlign;return this.__shouldAlignStart(t,i,o,this.__margins,a,this.noHorizontalOverlap,s)}__shouldAlignStartVertically(t){const e=this.requiredVerticalSpace||Math.max(this.__oldContentHeight||0,this.$.overlay.offsetHeight);this.__oldContentHeight=this.$.overlay.offsetHeight;const i=Math.min(window.innerHeight,document.documentElement.clientHeight),o="top"===this.verticalAlign;return this.__shouldAlignStart(t,e,i,this.__margins,o,this.noVerticalOverlap,a)}__shouldAlignStart(t,e,i,o,a,s,n){const r=i-t[s?n.end:n.start]-o[n.end],l=t[s?n.start:n.end]-o[n.start],h=a?r:l;return a===(h>(a?l:r)||h>e)}__adjustBottomProperty(t,e,i){let o;if(t===e.end){if(e.end===a.end){const t=Math.min(window.innerHeight,document.documentElement.clientHeight);i>t&&this.__oldViewportHeight&&(o=i-(this.__oldViewportHeight-t)),this.__oldViewportHeight=t}if(e.end===s.end){const t=Math.min(window.innerWidth,document.documentElement.clientWidth);i>t&&this.__oldViewportWidth&&(o=i-(this.__oldViewportWidth-t)),this.__oldViewportWidth=t}}return o}__calculatePositionInOneDimension(t,e,i,o,a,s){const n=s?o.start:o.end,r=s?o.end:o.start,l=parseFloat(a.style[n]||getComputedStyle(a)[n]),h=this.__adjustBottomProperty(n,o,l),d=e[s?o.start:o.end]-t[i===s?o.end:o.start];return{[n]:h?`${h}px`:`${l+d*(s?-1:1)}px`,[r]:""}}}},6754:(t,e,i)=>{i.d(e,{L:()=>r,e:()=>s}),i(9416),i(9849);var o=i(6570),a=i(510);const s=o.iv`
995
+ :host([opening]),
996
+ :host([closing]) {
997
+ animation: 0.14s lumo-overlay-dummy-animation;
998
+ }
999
+
1000
+ [part='overlay'] {
1001
+ will-change: opacity, transform;
1002
+ }
1003
+
1004
+ :host([opening]) [part='overlay'] {
1005
+ animation: 0.1s lumo-menu-overlay-enter ease-out both;
1006
+ }
1007
+
1008
+ @keyframes lumo-menu-overlay-enter {
1009
+ 0% {
1010
+ opacity: 0;
1011
+ transform: translateY(-4px);
1012
+ }
1013
+ }
1014
+
1015
+ :host([closing]) [part='overlay'] {
1016
+ animation: 0.1s lumo-menu-overlay-exit both;
1017
+ }
1018
+
1019
+ @keyframes lumo-menu-overlay-exit {
1020
+ 100% {
1021
+ opacity: 0;
1022
+ }
1023
+ }
1024
+ `;(0,o.hC)("",s,{moduleId:"lumo-menu-overlay-core"});const n=o.iv`
1025
+ /* Small viewport (bottom sheet) styles */
1026
+ /* Use direct media queries instead of the state attributes ([phone] and [fullscreen]) provided by the elements */
1027
+ @media (max-width: 420px), (max-height: 420px) {
1028
+ :host {
1029
+ top: 0 !important;
1030
+ right: 0 !important;
1031
+ bottom: var(--vaadin-overlay-viewport-bottom, 0) !important;
1032
+ left: 0 !important;
1033
+ align-items: stretch !important;
1034
+ justify-content: flex-end !important;
1035
+ }
1036
+
1037
+ [part='overlay'] {
1038
+ max-height: 50vh;
1039
+ width: 100vw;
1040
+ border-radius: 0;
1041
+ box-shadow: var(--lumo-box-shadow-xl);
1042
+ }
1043
+
1044
+ /* The content part scrolls instead of the overlay part, because of the gradient fade-out */
1045
+ [part='content'] {
1046
+ padding: 30px var(--lumo-space-m);
1047
+ max-height: inherit;
1048
+ box-sizing: border-box;
1049
+ -webkit-overflow-scrolling: touch;
1050
+ overflow: auto;
1051
+ -webkit-mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent);
1052
+ mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent);
1053
+ }
1054
+
1055
+ [part='backdrop'] {
1056
+ display: block;
1057
+ }
1058
+
1059
+ /* Animations */
1060
+
1061
+ :host([opening]) [part='overlay'] {
1062
+ animation: 0.2s lumo-mobile-menu-overlay-enter cubic-bezier(0.215, 0.61, 0.355, 1) both;
1063
+ }
1064
+
1065
+ :host([closing]),
1066
+ :host([closing]) [part='backdrop'] {
1067
+ animation-delay: 0.14s;
1068
+ }
1069
+
1070
+ :host([closing]) [part='overlay'] {
1071
+ animation: 0.14s 0.14s lumo-mobile-menu-overlay-exit cubic-bezier(0.55, 0.055, 0.675, 0.19) both;
1072
+ }
1073
+ }
1074
+
1075
+ @keyframes lumo-mobile-menu-overlay-enter {
1076
+ 0% {
1077
+ transform: translateY(150%);
1078
+ }
1079
+ }
1080
+
1081
+ @keyframes lumo-mobile-menu-overlay-exit {
1082
+ 100% {
1083
+ transform: translateY(150%);
1084
+ }
1085
+ }
1086
+ `,r=[a.I,s,n];(0,o.hC)("",r,{moduleId:"lumo-menu-overlay"})}}]);