@descope/web-components-ui 1.0.234 → 1.0.236

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. package/dist/cjs/index.cjs.js +770 -647
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.esm.js +754 -632
  5. package/dist/index.esm.js.map +1 -1
  6. package/dist/umd/{4513.js → 1721.js} +1 -1
  7. package/dist/umd/3003.js +1 -1
  8. package/dist/umd/3092.js +23 -18
  9. package/dist/umd/322.js +90 -0
  10. package/dist/umd/4226.js +1 -1
  11. package/dist/umd/4447.js +1 -2
  12. package/dist/umd/5345.js +1 -1
  13. package/dist/umd/5517.js +2 -0
  14. package/dist/umd/5806.js +3 -3
  15. package/dist/umd/5977.js +18 -13
  16. package/dist/umd/6091.js +1 -1
  17. package/dist/umd/6542.js +22 -22
  18. package/dist/umd/6770.js +2 -2
  19. package/dist/umd/7531.js +77 -6
  20. package/dist/umd/849.js +744 -0
  21. package/dist/umd/849.js.LICENSE.txt +11 -0
  22. package/dist/umd/8623.js +2 -0
  23. package/dist/umd/8725.js +2 -2
  24. package/dist/umd/{1990.js → 9092.js} +21 -17
  25. package/dist/umd/9211.js +33 -19
  26. package/dist/umd/{7514.js → 9558.js} +128 -110
  27. package/dist/umd/descope-badge-index-js.js +1 -0
  28. package/dist/umd/descope-button-index-js.js +1 -1
  29. package/dist/umd/descope-date-picker-index-js.js +1 -1
  30. package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js +1 -1
  31. package/dist/umd/descope-grid-descope-grid-status-column-index-js.js +1 -1
  32. package/dist/umd/descope-grid-descope-grid-text-column-index-js.js +1 -1
  33. package/dist/umd/descope-grid-index-js.js +1 -1
  34. package/dist/umd/index.js +1 -1
  35. package/package.json +14 -13
  36. package/src/components/descope-badge/BadgeClass.js +54 -0
  37. package/src/components/descope-badge/index.js +5 -0
  38. package/src/index.cjs.js +1 -0
  39. package/src/index.d.ts +1 -0
  40. package/src/theme/components/badge.js +71 -0
  41. package/src/theme/components/index.js +2 -0
  42. package/dist/umd/2873.js +0 -738
  43. package/dist/umd/2873.js.LICENSE.txt +0 -21
  44. package/dist/umd/446.js +0 -92
  45. package/dist/umd/729.js +0 -1
  46. package/dist/umd/9629.js +0 -2
  47. package/dist/umd/9671.js +0 -1
  48. /package/dist/umd/{4447.js.LICENSE.txt → 322.js.LICENSE.txt} +0 -0
  49. /package/dist/umd/{446.js.LICENSE.txt → 5517.js.LICENSE.txt} +0 -0
  50. /package/dist/umd/{9629.js.LICENSE.txt → 8623.js.LICENSE.txt} +0 -0
  51. /package/dist/umd/{1990.js.LICENSE.txt → 9092.js.LICENSE.txt} +0 -0
  52. /package/dist/umd/{7514.js.LICENSE.txt → 9558.js.LICENSE.txt} +0 -0
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2016 - 2023 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+
7
+ /**
8
+ * @license
9
+ * Copyright (c) 2021 - 2023 Vaadin Ltd.
10
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
11
+ */
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 8623.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[8623],{8623:(e,t,i)=>{i.d(t,{w:()=>_}),i(3556),i(3654);var s=i(2807),r=i(5517),d=i(9109);const n=e=>class extends e{static get properties(){return{width:{type:String,value:"58px",sync:!0},flexGrow:{type:Number,value:0,sync:!0},selectAll:{type:Boolean,value:!1,notify:!0,sync:!0},autoSelect:{type:Boolean,value:!1,sync:!0},dragSelect:{type:Boolean,value:!1,sync:!0},_indeterminate:{type:Boolean,sync:!0},_selectAllHidden:Boolean}}static get observers(){return["_onHeaderRendererOrBindingChanged(_headerRenderer, _headerCell, path, header, selectAll, _indeterminate, _selectAllHidden)"]}_defaultHeaderRenderer(e,t){let i=e.firstElementChild;i||(i=document.createElement("vaadin-checkbox"),i.setAttribute("aria-label","Select All"),i.classList.add("vaadin-grid-select-all-checkbox"),e.appendChild(i),i.addEventListener("checked-changed",this.__onSelectAllCheckedChanged.bind(this)));const s=this.__isChecked(this.selectAll,this._indeterminate);i.__rendererChecked=s,i.checked=s,i.hidden=this._selectAllHidden,i.indeterminate=this._indeterminate}_defaultRenderer(e,t,{item:i,selected:s}){let r=e.firstElementChild;r||(r=document.createElement("vaadin-checkbox"),r.setAttribute("aria-label","Select Row"),e.appendChild(r),r.addEventListener("checked-changed",this.__onSelectRowCheckedChanged.bind(this)),(0,d.NH)(e,"track",this.__onCellTrack.bind(this)),e.addEventListener("mousedown",this.__onCellMouseDown.bind(this)),e.addEventListener("click",this.__onCellClick.bind(this))),r.__item=i,r.__rendererChecked=s,r.checked=s}__onSelectAllCheckedChanged(e){e.target.checked!==e.target.__rendererChecked&&(this._indeterminate||e.target.checked?this._selectAll():this._deselectAll())}__onSelectRowCheckedChanged(e){e.target.checked!==e.target.__rendererChecked&&(e.target.checked?this._selectItem(e.target.__item):this._deselectItem(e.target.__item))}__onCellTrack(e){if(this.dragSelect)if(this.__dragCurrentY=e.detail.y,this.__dragDy=e.detail.dy,"start"===e.detail.state){const t=this._grid._getRenderedRows().find((t=>t.contains(e.currentTarget.assignedSlot)));this.__selectOnDrag=!this._grid._isSelected(t._item),this.__dragStartIndex=t.index,this.__dragStartItem=t._item,this.__dragAutoScroller()}else"end"===e.detail.state&&(this.__dragStartItem&&(this.__selectOnDrag?this._selectItem(this.__dragStartItem):this._deselectItem(this.__dragStartItem)),setTimeout((()=>{this.__dragStartIndex=void 0})))}__onCellMouseDown(e){this.dragSelect&&e.preventDefault()}__onCellClick(e){void 0!==this.__dragStartIndex&&e.preventDefault()}__dragAutoScroller(){if(void 0===this.__dragStartIndex)return;const e=this._grid._getRenderedRows(),t=e.find((e=>{const t=e.getBoundingClientRect();return this.__dragCurrentY>=t.top&&this.__dragCurrentY<=t.bottom}));let i=t?t.index:void 0;const s=this.__getScrollableArea();this.__dragCurrentY<s.top?i=this._grid._firstVisibleIndex:this.__dragCurrentY>s.bottom&&(i=this._grid._lastVisibleIndex),void 0!==i&&e.forEach((e=>{(i>this.__dragStartIndex&&e.index>=this.__dragStartIndex&&e.index<=i||i<this.__dragStartIndex&&e.index<=this.__dragStartIndex&&e.index>=i)&&(this.__selectOnDrag?this._selectItem(e._item):this._deselectItem(e._item),this.__dragStartItem=void 0)}));const r=.15*s.height;if(this.__dragDy<0&&this.__dragCurrentY<s.top+r){const e=s.top+r-this.__dragCurrentY,t=Math.min(1,e/r);this._grid.$.table.scrollTop-=10*t}if(this.__dragDy>0&&this.__dragCurrentY>s.bottom-r){const e=this.__dragCurrentY-(s.bottom-r),t=Math.min(1,e/r);this._grid.$.table.scrollTop+=10*t}setTimeout((()=>this.__dragAutoScroller()),10)}__getScrollableArea(){const e=this._grid.$.table.getBoundingClientRect(),t=this._grid.$.header.getBoundingClientRect(),i=this._grid.$.footer.getBoundingClientRect();return{top:e.top+t.height,bottom:e.bottom-i.height,left:e.left,right:e.right,height:e.height-t.height-i.height,width:e.width}}_selectAll(){}_deselectAll(){}_selectItem(e){}_deselectItem(e){}__isChecked(e,t){return t||e}},a=e=>class extends(n(e)){static get properties(){return{__previousActiveItem:Object}}static get observers(){return["__onSelectAllChanged(selectAll)"]}constructor(){super(),this.__boundOnActiveItemChanged=this.__onActiveItemChanged.bind(this),this.__boundOnDataProviderChanged=this.__onDataProviderChanged.bind(this),this.__boundOnSelectedItemsChanged=this.__onSelectedItemsChanged.bind(this)}disconnectedCallback(){this._grid.removeEventListener("active-item-changed",this.__boundOnActiveItemChanged),this._grid.removeEventListener("data-provider-changed",this.__boundOnDataProviderChanged),this._grid.removeEventListener("filter-changed",this.__boundOnSelectedItemsChanged),this._grid.removeEventListener("selected-items-changed",this.__boundOnSelectedItemsChanged),super.disconnectedCallback()}connectedCallback(){super.connectedCallback(),this._grid&&(this._grid.addEventListener("active-item-changed",this.__boundOnActiveItemChanged),this._grid.addEventListener("data-provider-changed",this.__boundOnDataProviderChanged),this._grid.addEventListener("filter-changed",this.__boundOnSelectedItemsChanged),this._grid.addEventListener("selected-items-changed",this.__boundOnSelectedItemsChanged))}__onSelectAllChanged(e){void 0!==e&&this._grid&&(this.__selectAllInitialized?this._selectAllChangeLock||(e&&this.__hasArrayDataProvider()?this.__withFilteredItemsArray((e=>{this._grid.selectedItems=e})):this._grid.selectedItems=[]):this.__selectAllInitialized=!0)}__arrayContains(e,t){return Array.isArray(e)&&Array.isArray(t)&&t.every((t=>e.includes(t)))}_selectAll(){this.selectAll=!0}_deselectAll(){this.selectAll=!1}_selectItem(e){this._grid.selectItem(e)}_deselectItem(e){this._grid.deselectItem(e)}__onActiveItemChanged(e){const t=e.detail.value;if(this.autoSelect){const e=t||this.__previousActiveItem;e&&this._grid._toggleItem(e)}this.__previousActiveItem=t}__hasArrayDataProvider(){return Array.isArray(this._grid.items)&&!!this._grid.dataProvider}__onSelectedItemsChanged(){this._selectAllChangeLock=!0,this.__hasArrayDataProvider()&&this.__withFilteredItemsArray((e=>{this._grid.selectedItems.length?this.__arrayContains(this._grid.selectedItems,e)?(this.selectAll=!0,this._indeterminate=!1):(this.selectAll=!1,this._indeterminate=!0):(this.selectAll=!1,this._indeterminate=!1)})),this._selectAllChangeLock=!1}__onDataProviderChanged(){this._selectAllHidden=!Array.isArray(this._grid.items)}__withFilteredItemsArray(e){const t={page:0,pageSize:1/0,sortOrders:[],filters:this._grid._mapFilters()};this._grid.dataProvider(t,(t=>e(t)))}};class _ extends(a(r.C)){static get is(){return"vaadin-grid-selection-column"}}(0,s.M)(_)}}]);
package/dist/umd/8725.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*! For license information please see 8725.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[8725],{8005:(t,e,i)=>{i.d(e,{n:()=>m}),i(3130);var r=i(4241),s=i(2807),l=i(2521),a=i(4463),n=i(2743),o=i(6570),d=i(3208),p=i(422),u=i(6729);const h=t=>class extends((0,p.j)(t)){static get properties(){return{maxlength:{type:Number},minlength:{type:Number},pattern:{type:String}}}static get delegateAttrs(){return[...super.delegateAttrs,"maxlength","minlength","pattern"]}static get constraints(){return[...super.constraints,"maxlength","minlength","pattern"]}constructor(){super(),this._setType("text")}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new d.b(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new u.v(this.inputElement,this._labelController))}};(0,o.hC)("vaadin-text-field",n.J,{moduleId:"vaadin-text-field-styles"});class m extends(h((0,o.Tb)((0,l.S)(r.H3)))){static get is(){return"vaadin-text-field"}static get template(){return r.dy`
2
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[8725],{8005:(t,e,i)=>{i.d(e,{n:()=>m}),i(3553);var r=i(4241),s=i(2807),l=i(2521),a=i(4463),n=i(2743),o=i(6570),d=i(3208),p=i(422),u=i(6729);const h=t=>class extends((0,p.j)(t)){static get properties(){return{maxlength:{type:Number},minlength:{type:Number},pattern:{type:String}}}static get delegateAttrs(){return[...super.delegateAttrs,"maxlength","minlength","pattern"]}static get constraints(){return[...super.constraints,"maxlength","minlength","pattern"]}constructor(){super(),this._setType("text")}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new d.b(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new u.v(this.inputElement,this._labelController))}};(0,o.hC)("vaadin-text-field",n.J,{moduleId:"vaadin-text-field-styles"});class m extends(h((0,o.Tb)((0,l.S)(r.H3)))){static get is(){return"vaadin-text-field"}static get template(){return r.dy`
3
3
  <style>
4
4
  [part='input-field'] {
5
5
  flex-grow: 0;
@@ -34,4 +34,4 @@
34
34
  </div>
35
35
  </div>
36
36
  <slot name="tooltip"></slot>
37
- `}static get properties(){return{maxlength:{type:Number},minlength:{type:Number}}}ready(){super.ready(),this._tooltipController=new a.f(this),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this.addController(this._tooltipController)}}(0,s.M)(m)},8725:(t,e,i)=>{i(3787);var r=i(2279);(0,i(6570).hC)("vaadin-text-field",r.J,{moduleId:"lumo-text-field-styles"}),i(8005)}}]);
37
+ `}static get properties(){return{maxlength:{type:Number},minlength:{type:Number}}}ready(){super.ready(),this._tooltipController=new a.f(this),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this.addController(this._tooltipController)}}(0,s.M)(m)},8725:(t,e,i)=>{i(1578);var r=i(2279);(0,i(6570).hC)("vaadin-text-field",r.J,{moduleId:"lumo-text-field-styles"}),i(8005)}}]);
@@ -1,5 +1,5 @@
1
- /*! For license information please see 1990.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[1990],{1990:(e,t,s)=>{s(3787),s(9098),s(9416);var i=s(6754),a=s(6570);const n=a.iv`
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`
3
3
  [part='overlay'] {
4
4
  /*
5
5
  Width:
@@ -47,7 +47,7 @@
47
47
  max-height: 70vh;
48
48
  }
49
49
  }
50
- `;(0,a.hC)("vaadin-date-picker-overlay",[i.L,n],{moduleId:"lumo-date-picker-overlay"}),s(1195),s(9849),s(4173),s(4513),(0,a.hC)("vaadin-date-picker-year",a.iv`
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`
51
51
  :host([current]) [part='year-number'] {
52
52
  color: var(--lumo-primary-text-color);
53
53
  }
@@ -231,6 +231,10 @@
231
231
  color: var(--lumo-body-text-color);
232
232
  text-align: center;
233
233
  padding: 0 var(--lumo-space-xs);
234
+ --_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));
235
+ --_focus-ring-width: var(--vaadin-focus-ring-width, 2px);
236
+ --_selection-color: var(--vaadin-selection-color, var(--lumo-primary-color));
237
+ --_selection-color-text: var(--vaadin-selection-color-text, var(--lumo-primary-text-color));
234
238
  }
235
239
 
236
240
  /* Month header */
@@ -290,7 +294,7 @@
290
294
  /* Today date */
291
295
 
292
296
  [part~='date'][part~='today'] {
293
- color: var(--lumo-primary-text-color);
297
+ color: var(--_selection-color-text);
294
298
  }
295
299
 
296
300
  /* Focused date */
@@ -312,7 +316,7 @@
312
316
  }
313
317
 
314
318
  [part~='date'][part~='focused']::before {
315
- box-shadow: 0 0 0 1px var(--lumo-base-color), 0 0 0 3px var(--lumo-primary-color-50pct);
319
+ box-shadow: 0 0 0 1px var(--lumo-base-color), 0 0 0 calc(var(--_focus-ring-width) + 1px) var(--_focus-ring-color);
316
320
  }
317
321
 
318
322
  :host(:not([focused])) [part~='date'][part~='focused']::before {
@@ -321,7 +325,7 @@
321
325
 
322
326
  @keyframes vaadin-date-picker-month-calendar-focus-date {
323
327
  50% {
324
- box-shadow: 0 0 0 1px var(--lumo-base-color), 0 0 0 3px transparent;
328
+ box-shadow: 0 0 0 1px var(--lumo-base-color), 0 0 0 calc(var(--_focus-ring-width) + 1px) transparent;
325
329
  }
326
330
  }
327
331
 
@@ -334,7 +338,7 @@
334
338
  }
335
339
 
336
340
  [part~='date'][part~='selected']::before {
337
- background-color: var(--lumo-primary-color);
341
+ background-color: var(--_selection-color);
338
342
  }
339
343
 
340
344
  [part~='date'][part~='disabled'] {
@@ -361,7 +365,7 @@
361
365
  :host([disabled]) * {
362
366
  color: var(--lumo-disabled-text-color) !important;
363
367
  }
364
- `,{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 2px transparent;\n }\n }\n </style>\n",document.head.appendChild(o.content),s(1735);var r=s(2279);const l=a.iv`
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(2279);const l=a.iv`
365
369
  :host {
366
370
  outline: none;
367
371
  }
@@ -387,7 +391,7 @@
387
391
  :host([dir='rtl']) [part='input-field'] ::slotted(input:placeholder-shown) {
388
392
  --_lumo-text-field-overflow-mask-image: none;
389
393
  }
390
- `;(0,a.hC)("vaadin-date-picker",[r.J,l],{moduleId:"lumo-date-picker"}),s(3130);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`
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`
391
395
  [part='overlay'] {
392
396
  display: flex;
393
397
  flex: auto;
@@ -409,7 +413,7 @@
409
413
  <slot></slot>
410
414
  </div>
411
415
  </div>
412
- `}}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()}});class O extends((0,a.Tb)(h.H3)){static get is(){return"vaadin-date-picker-year"}static get template(){return h.dy`
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`
413
417
  <style>
414
418
  :host {
415
419
  display: block;
@@ -418,7 +422,7 @@
418
422
  </style>
419
423
  <div part="year-number">[[year]]</div>
420
424
  <div part="year-separator" aria-hidden="true"></div>
421
- `}static get properties(){return{year:{type:String},selectedDate:{type:Object}}}static get observers(){return["__updateSelected(year, selectedDate)"]}__updateSelected(e,t){this.toggleAttribute("selected",t&&t.getFullYear()===e),this.toggleAttribute("current",e===(new Date).getFullYear())}}(0,d.M)(O),s(7894);var F=s(4933),A=s(1014);function H(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 Y=(0,A.o)((e=>class extends e{_shouldPropertyChange(e,t,s){return H(this,e,t,s,!0)}})),B=(0,A.o)((e=>class extends e{static get properties(){return{mutableData:Boolean}}_shouldPropertyChange(e,t,s){return H(this,e,t,s,this.mutableData)}}));Y._mutablePropertyChange=H;var N=s(9387),z=s(1342);let $=null;function L(){return $}L.prototype=Object.create(HTMLTemplateElement.prototype,{constructor:{value:L,writable:!0}});const W=(0,F.q)(L),R=Y(W),V=(0,F.q)(class{});class j extends V{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,z.r)((0,z.r)(i).parentNode).replaceChild(i.__polymerReplaced__,i);else{const e=i.__polymerReplaced__;e&&(0,z.r)((0,z.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}}j.prototype.__dataHost,j.prototype.__templatizeOptions,j.prototype._methodHost,j.prototype.__templatizeOwner,j.prototype.__hostProps;const q=Y(j);function K(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 U(e,t){return function(e,s,i){t.call(e.__templatizeOwner,e,s,i[s])}}function Q(e,t,s){if(N.XN&&!K(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:j)._parseTemplate(e),a=i.templatizeInstanceClass;a||(a=function(e,t,s){let i=s.mutableData?q:j;Q.mixin&&(i=Q.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:U(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=K(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);N.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){$=e,Object.setPrototypeOf(e,t.prototype),new t,$=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 J=s(2224);class G{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,Z.delete(this),this._callback()}))}cancel(){this.isActive()&&(this._cancelAsync(),Z.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 G?e._cancelAsync():e=new G,e.setConfig(t,s),e}}let Z=new Set;const ee=function(){const e=Boolean(Z.size);return Z.forEach((e=>{try{e.flush()}catch(e){setTimeout((()=>{throw e}))}})),e},te=function(){let e,t;do{e=window.ShadyDOM&&ShadyDOM.flush(),window.ShadyCSS&&window.ShadyCSS.ScopingShim&&window.ShadyCSS.ScopingShim.flush(),t=ee()}while(e||t)};var se=s(1446);let ie=!1;const ae=B(h.H3);class ne extends ae{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:!N.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(N.nL&&!N.my){if(!ie){ie=!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,z.r)((0,z.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=Q(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,se.wB)(this.as,t)){let i=e[this.itemsIndexAs];t==this.as&&(this.items[i]=s);let a=(0,se.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=G.debounce(this.__renderDebouncer,t>0?J.Wc.after(t):J.YA,e.bind(this)),s=this.__renderDebouncer,Z.add(s)}render(){this.__debounceRender(this.__render),te()}__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),N.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,z.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,z.r)((0,z.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,z.r)(t).parentNode;return null}(this.template,e)}}customElements.define(ne.is,ne);var oe=s(1360),re=s(9109);const le=e=>class extends((0,oe.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,re.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}},he=m.iv`
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`
422
426
  :host {
423
427
  display: block;
424
428
  }
@@ -474,7 +478,7 @@
474
478
  outline: 3px solid;
475
479
  }
476
480
  }
477
- `;(0,a.hC)("vaadin-month-calendar",he,{moduleId:"vaadin-month-calendar-styles"});class de extends(le((0,a.Tb)(h.H3))){static get template(){return h.dy`
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`
478
482
  <div part="month-header" id="month-header" aria-hidden="true">[[_getTitle(month, i18n)]]</div>
479
483
  <table
480
484
  id="monthGrid"
@@ -516,7 +520,7 @@
516
520
  </template>
517
521
  </tbody>
518
522
  </table>
519
- `}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)(de);var ce=s(6155),ue=s(2223);class _e{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 pe=s(9229);const me=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,re.BP)(this.$.scrollers,"pan-y"),(0,re.NH)(this.$.scrollers,"track",this._track.bind(this)),(0,re.NH)(this.shadowRoot.querySelector('[part="clear-button"]'),"tap",this._clear.bind(this)),(0,re.NH)(this.shadowRoot.querySelector('[part="toggle-button"]'),"tap",this._cancel.bind(this)),(0,re.NH)(this.shadowRoot.querySelector('[part="years-toggle-button"]'),"tap",this._toggleYearScroller.bind(this))}_initControllers(){this.addController(new _e(this._desktopMediaQuery,(e=>{this._desktopMode=e}))),this.addController(new pe.n(this,"today-button","vaadin-button",{observe:!1,initializer:e=>{e.setAttribute("theme","tertiary"),e.addEventListener("keydown",(e=>this.__onTodayButtonKeyDown(e))),(0,re.NH)(e,"tap",this._onTodayTap.bind(this)),this._todayButton=e}})),this.addController(new pe.n(this,"cancel-button","vaadin-button",{observe:!1,initializer:e=>{e.setAttribute("theme","tertiary"),e.addEventListener("keydown",(e=>this.__onCancelButtonKeyDown(e))),(0,re.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 pe.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 pe.n(this,"years","vaadin-date-picker-year-scroller",{observe:!1,initializer:e=>{e.setAttribute("aria-hidden","true"),(0,re.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,ue.T8)(this,(()=>{te(),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)}},fe=m.iv`
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`
520
524
  :host {
521
525
  display: flex;
522
526
  flex-direction: column;
@@ -576,7 +580,7 @@
576
580
  z-index: 2;
577
581
  flex-shrink: 0;
578
582
  }
579
- `;(0,a.hC)("vaadin-date-picker-overlay-content",fe,{moduleId:"vaadin-date-picker-overlay-content-styles"});class ye extends(me((0,ce.k)((0,a.Tb)((0,c.U)(h.H3))))){static get template(){return h.dy`
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`
580
584
  <div part="overlay-header" on-touchend="_preventDefault" aria-hidden="true">
581
585
  <div part="label">[[_formatDisplayed(selectedDate, i18n, label)]]</div>
582
586
  <div part="clear-button" hidden$="[[!selectedDate]]"></div>
@@ -596,7 +600,7 @@
596
600
  <slot name="today-button"></slot>
597
601
  <slot name="cancel-button"></slot>
598
602
  </div>
599
- `}static get is(){return"vaadin-date-picker-overlay-content"}ready(){super.ready(),this.setAttribute("role","dialog"),this._addListeners(),this._initControllers()}}(0,d.M)(ye);var ge=s(2521),be=s(4463),ve=s(1174),De=s(3208),we=s(6729),ke=s(2743),Ce=s(962),xe=s(1370),Se=s(2628),Te=s(9320),Ee=s(9091),Me=s(9580);const Pe=e=>class extends((0,Te.u)((0,ce.k)((0,xe.B)((0,Ee.t)((0,Se.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}_onFocus(e){super._onFocus(e),this._noInput&&e.target.blur()}_onBlur(e){super._onBlur(e),this.opened||(this._selectParsedOrFocusedDate(),document.hasFocus()&&this.validate())}ready(){super.ready(),this.addEventListener("click",this._boundOnClick),this.addController(new _e(this._fullscreenMediaQuery,(e=>{this._fullscreen=e}))),this.addController(new Me.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.__userConfirmedDate=!0,this._selectDate(e.detail.date),this._close()})),t.addEventListener("date-selected",(e=>{this.__userConfirmedDate=!!e.detail.date,this._selectDate(e.detail.date)})),t.addEventListener("focusin",(()=>{this._keyboardActive&&this._setFocused(!0)})),t.addEventListener("focused-date-changed",(e=>{this._focusedDate=e.detail.value}))}__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}__dispatchChange(){this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}_selectDate(e){const t=this.value;this._selectedDate=e,t!==this.value&&this.__dispatchChange()}_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._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,Ce.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])}_selectParsedOrFocusedDate(){if(this._ignoreFocusedDateChange=!0,this.i18n.parseDate){const e=this._inputElementValue||"",t=this.__parseDate(e);t?this._selectDate(t):(this.__keepInputValue=!0,this._selectDate(null),this._selectedDate=null,this.__keepInputValue=!1)}else this._focusedDate&&this._selectDate(this._focusedDate);this._ignoreFocusedDateChange=!1}_onOverlayClosed(){this.__showOthers&&(this.__showOthers(),this.__showOthers=null),window.removeEventListener("scroll",this._boundOnScroll,!0),this.__userConfirmedDate?this.__userConfirmedDate=!1:this._selectParsedOrFocusedDate(),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._inputElementValue="",this.value="",this.__dispatchChange()}_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){const t=this.value;this.opened?this.close():this._selectParsedOrFocusedDate(),t===this.value&&this.validate()}_onEscape(e){if(!this.opened)return this.clearButtonVisible&&this.value?(e.stopPropagation(),void this._onClearButtonClick(e)):void(this.autoOpenDisabled?(""===this.inputElement.value&&this._selectDate(null),this._applyInputValue(this._selectedDate)):(this._focusedDate=this._selectedDate,this._selectParsedOrFocusedDate()))}_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)}},Ie=m.iv`
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(1174),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`
600
604
  :host([opened]) {
601
605
  pointer-events: auto;
602
606
  }
@@ -609,7 +613,7 @@
609
613
  direction: rtl;
610
614
  text-align: left;
611
615
  }
612
- `;(0,a.hC)("vaadin-date-picker",[ke.J,Ie],{moduleId:"vaadin-date-picker-styles"});class Oe extends(Pe((0,ve.L)((0,a.Tb)((0,ge.S)(h.H3))))){static get is(){return"vaadin-date-picker"}static get template(){return h.dy`
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`
613
617
  <div class="vaadin-date-picker-container">
614
618
  <div part="label">
615
619
  <slot name="label"></slot>
@@ -651,4 +655,4 @@
651
655
  ></vaadin-date-picker-overlay>
652
656
 
653
657
  <slot name="tooltip"></slot>
654
- `}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new De.b(this,(e=>{this._setInputElement(e),this._setFocusElement(e),this.stateTarget=e,this.ariaTarget=e}))),this.addController(new we.v(this.inputElement,this._labelController)),this._tooltipController=new be.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)(Oe)}}]);
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)}}]);
package/dist/umd/9211.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*! For license information please see 9211.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[9211],{7078:(t,e,o)=>{o.d(e,{z:()=>p});var r=o(4241),i=o(6155),a=o(2807),n=o(2521),s=o(4463),l=o(6570);const c=o(9392).iv`
2
+ "use strict";(self.webpackChunkDescopeUI=self.webpackChunkDescopeUI||[]).push([[9211],{7078:(t,o,r)=>{r.d(o,{z:()=>v});var e=r(4241),a=r(6155),i=r(2807),n=r(2521),s=r(4463),l=r(6570);const c=r(9392).iv`
3
3
  :host {
4
4
  display: inline-block;
5
5
  position: relative;
@@ -59,7 +59,7 @@
59
59
  outline-color: GrayText;
60
60
  }
61
61
  }
62
- `;var h=o(1224),m=o(1360),u=o(8298);const d=t=>class extends((0,h.D)((0,u.N)((0,m.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",c,{moduleId:"vaadin-button-styles"});class p extends(d((0,n.S)((0,l.Tb)((0,i.k)(r.H3))))){static get is(){return"vaadin-button"}static get template(){return r.dy`
62
+ `;var u=r(1224),h=r(1360),m=r(8298);const d=t=>class extends((0,u.D)((0,m.N)((0,h.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",c,{moduleId:"vaadin-button-styles"});class v extends(d((0,n.S)((0,l.Tb)((0,a.k)(e.H3))))){static get is(){return"vaadin-button"}static get template(){return e.dy`
63
63
  <div class="vaadin-button-container">
64
64
  <span part="prefix" aria-hidden="true">
65
65
  <slot name="prefix"></slot>
@@ -72,27 +72,36 @@
72
72
  </span>
73
73
  </div>
74
74
  <slot name="tooltip"></slot>
75
- `}ready(){super.ready(),this._tooltipController=new s.f(this),this.addController(this._tooltipController)}}(0,a.M)(p)},4750:(t,e,o)=>{o.d(e,{L:()=>i}),o(1195),o(9098),o(9416),o(9849),o(4173);var r=o(6570);const i=r.iv`
75
+ `}ready(){super.ready(),this._tooltipController=new s.f(this),this.addController(this._tooltipController)}}(0,i.M)(v)},4750:(t,o,r)=>{r.d(o,{L:()=>a}),r(1195),r(9098),r(9416),r(9849),r(4173);var e=r(6570);const a=e.iv`
76
76
  :host {
77
77
  /* Sizing */
78
78
  --lumo-button-size: var(--lumo-size-m);
79
- min-width: calc(var(--lumo-button-size) * 2);
80
- height: var(--lumo-button-size);
81
- padding: 0 calc(var(--lumo-button-size) / 3 + var(--lumo-border-radius-m) / 2);
82
- margin: var(--lumo-space-xs) 0;
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
83
  box-sizing: border-box;
84
84
  /* Style */
85
85
  font-family: var(--lumo-font-family);
86
- font-size: var(--lumo-font-size-m);
87
- font-weight: 500;
88
- color: var(--_lumo-button-color, var(--lumo-primary-text-color));
89
- background-color: var(--_lumo-button-background-color, var(--lumo-contrast-5pct));
90
- border-radius: var(--lumo-border-radius-m);
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));
91
92
  cursor: var(--lumo-clickable-cursor);
92
93
  -webkit-tap-highlight-color: transparent;
93
94
  -webkit-font-smoothing: antialiased;
94
95
  -moz-osx-font-smoothing: grayscale;
95
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));
96
105
  }
97
106
 
98
107
  /* Set only for the internal parts so we don't affect the host vertical alignment */
@@ -159,7 +168,7 @@
159
168
  /* Keyboard focus */
160
169
 
161
170
  :host([focus-ring]) {
162
- box-shadow: 0 0 0 2px var(--lumo-primary-color-50pct);
171
+ box-shadow: 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);
163
172
  }
164
173
 
165
174
  :host([theme~='primary'][focus-ring]) {
@@ -170,12 +179,16 @@
170
179
 
171
180
  :host([theme~='tertiary']),
172
181
  :host([theme~='tertiary-inline']) {
173
- background-color: transparent !important;
182
+ --_background: transparent !important;
183
+ background: var(--vaadin-button-tertiary-background, var(--_background));
174
184
  min-width: 0;
175
185
  }
176
186
 
177
187
  :host([theme~='tertiary']) {
178
- padding: 0 calc(var(--lumo-button-size) / 6);
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));
179
192
  }
180
193
 
181
194
  :host([theme~='tertiary-inline'])::before {
@@ -197,9 +210,10 @@
197
210
  }
198
211
 
199
212
  :host([theme~='primary']) {
200
- background-color: var(--_lumo-button-primary-background-color, var(--lumo-primary-color));
201
- color: var(--_lumo-button-primary-color, var(--lumo-primary-contrast-color));
202
- font-weight: 600;
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);
203
217
  min-width: calc(var(--lumo-button-size) * 2.5);
204
218
  }
205
219
 
@@ -321,4 +335,4 @@
321
335
  margin-left: 0;
322
336
  margin-right: 0;
323
337
  }
324
- `;(0,r.hC)("vaadin-button",i,{moduleId:"lumo-button"})}}]);
338
+ `;(0,e.hC)("vaadin-button",a,{moduleId:"lumo-button"})}}]);