@descope/web-components-ui 1.0.310 → 1.0.312

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. package/dist/cjs/index.cjs.js +1302 -906
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.esm.js +1308 -911
  5. package/dist/index.esm.js.map +1 -1
  6. package/dist/umd/1224.js +1 -1
  7. package/dist/umd/1438.js +11 -11
  8. package/dist/umd/1612.js +4 -4
  9. package/dist/umd/1621.js +8 -8
  10. package/dist/umd/2362.js +2 -2
  11. package/dist/umd/3830.js +1 -1
  12. package/dist/umd/3951.js +4 -4
  13. package/dist/umd/4024.js +4 -4
  14. package/dist/umd/4028.js +6 -6
  15. package/dist/umd/4052.js +4 -4
  16. package/dist/umd/4392.js +1 -1
  17. package/dist/umd/4569.js +1 -1
  18. package/dist/umd/4746.js +2 -2
  19. package/dist/umd/4978.js +1 -1
  20. package/dist/umd/5135.js +4 -4
  21. package/dist/umd/5517.js +1 -1
  22. package/dist/umd/5806.js +2 -2
  23. package/dist/umd/5910.js +1 -1
  24. package/dist/umd/63.js +7 -7
  25. package/dist/umd/637.js +1 -0
  26. package/dist/umd/6594.js +1 -1
  27. package/dist/umd/6770.js +2 -2
  28. package/dist/umd/7056.js +9 -9
  29. package/dist/umd/7164.js +7 -7
  30. package/dist/umd/7531.js +4 -4
  31. package/dist/umd/7911.js +4 -4
  32. package/dist/umd/8191.js +4 -4
  33. package/dist/umd/8866.js +5 -5
  34. package/dist/umd/9092.js +12 -12
  35. package/dist/umd/9314.js +5 -5
  36. package/dist/umd/9423.js +12 -12
  37. package/dist/umd/9562.js +4 -4
  38. package/dist/umd/DescopeDev.js +1 -1
  39. package/dist/umd/boolean-fields-descope-boolean-field-internal-index-js.js +1 -1
  40. package/dist/umd/boolean-fields-descope-checkbox-index-js.js +1 -1
  41. package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +1 -1
  42. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js +1 -1
  43. package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-internal-index-js.js +1 -1
  44. package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js +1 -1
  45. package/dist/umd/button-selection-group-fields-descope-button-selection-group-internal-index-js.js +1 -1
  46. package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +1 -1
  47. package/dist/umd/descope-avatar-index-js.js +1 -1
  48. package/dist/umd/descope-badge-index-js.js +1 -1
  49. package/dist/umd/descope-button-index-js.js +4 -4
  50. package/dist/umd/descope-code-snippet-index-js.js +1 -0
  51. package/dist/umd/descope-combo-box-index-js.js +5 -5
  52. package/dist/umd/descope-container-index-js.js +1 -1
  53. package/dist/umd/descope-date-picker-index-js.js +1 -1
  54. package/dist/umd/descope-divider-index-js.js +1 -1
  55. package/dist/umd/descope-email-field-index-js.js +4 -4
  56. package/dist/umd/descope-enriched-text-index-js.js +1 -1
  57. package/dist/umd/descope-grid-descope-grid-custom-column-index-js.js +3 -3
  58. package/dist/umd/descope-grid-descope-grid-selection-column-index-js.js +1 -1
  59. package/dist/umd/descope-grid-descope-grid-text-column-index-js.js +3 -3
  60. package/dist/umd/descope-grid-index-js.js +1 -1
  61. package/dist/umd/descope-icon-index-js.js +1 -1
  62. package/dist/umd/descope-image-index-js.js +1 -1
  63. package/dist/umd/descope-link-index-js.js +1 -1
  64. package/dist/umd/descope-loader-linear-index-js.js +1 -1
  65. package/dist/umd/descope-loader-radial-index-js.js +1 -1
  66. package/dist/umd/descope-logo-index-js.js +1 -1
  67. package/dist/umd/descope-modal-index-js.js +1 -1
  68. package/dist/umd/descope-multi-select-combo-box-index-js.js +1 -1
  69. package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
  70. package/dist/umd/descope-new-password-index-js.js +1 -1
  71. package/dist/umd/descope-notification-descope-notification-card-index-js.js +1 -1
  72. package/dist/umd/descope-notification-index-js.js +1 -1
  73. package/dist/umd/descope-notp-image-index-js.js +1 -1
  74. package/dist/umd/descope-number-field-index-js.js +1 -1
  75. package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +1 -1
  76. package/dist/umd/descope-passcode-index-js.js +2 -2
  77. package/dist/umd/descope-password-index-js.js +1 -1
  78. package/dist/umd/descope-policy-validation-index-js.js +1 -1
  79. package/dist/umd/descope-recaptcha-index-js.js +1 -1
  80. package/dist/umd/descope-text-area-index-js.js +1 -1
  81. package/dist/umd/descope-text-field-index-js.js +2 -2
  82. package/dist/umd/descope-text-index-js.js +1 -1
  83. package/dist/umd/descope-totp-image-index-js.js +1 -1
  84. package/dist/umd/descope-upload-file-index-js.js +1 -1
  85. package/dist/umd/descope-user-attribute-index-js.js +1 -1
  86. package/dist/umd/descope-user-auth-method-index-js.js +1 -1
  87. package/dist/umd/index.js +1 -1
  88. package/dist/umd/mapping-fields-descope-mappings-field-descope-mapping-item-index-js.js +1 -1
  89. package/dist/umd/mapping-fields-descope-mappings-field-descope-mappings-field-internal-index-js.js +1 -1
  90. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
  91. package/dist/umd/mapping-fields-descope-saml-group-mappings-descope-saml-group-mappings-internal-index-js.js +1 -1
  92. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
  93. package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
  94. package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
  95. package/dist/umd/phone-fields-descope-phone-input-box-field-descope-phone-input-box-internal-index-js.js +2 -2
  96. package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +1 -1
  97. package/package.json +2 -1
  98. package/src/components/descope-avatar/AvatarClass.js +2 -0
  99. package/src/components/descope-code-snippet/CodeSnippetClass.js +238 -0
  100. package/src/components/descope-code-snippet/helpers.js +9 -0
  101. package/src/components/descope-code-snippet/index.js +5 -0
  102. package/src/darkTheme.js +4 -0
  103. package/src/index.cjs.js +1 -0
  104. package/src/index.d.ts +1 -0
  105. package/src/index.js +1 -0
  106. package/src/theme/components/codeSnippet.js +145 -0
  107. package/src/theme/components/index.js +2 -0
package/dist/umd/9092.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*! For license information please see 9092.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[9092],{7078:(t,e,i)=>{i.d(e,{z:()=>p});var o=i(4241),a=i(6155),s=i(2807),n=i(2521),r=i(4463),l=i(6570);const h=i(235).iv`
2
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[9092],{17078:(t,e,i)=>{i.d(e,{z:()=>p});var o=i(74241),a=i(16155),s=i(52807),n=i(12521),r=i(34463),l=i(46570);const h=i(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 d=i(1224),c=i(1360),u=i(8298);const _=t=>class extends((0,d.D)((0,u.N)((0,c.W)(t)))){static get properties(){return{tabindex:{type:Number,value:0,reflectToAttribute:!0}}}get _activeKeys(){return["Enter"," "]}ready(){super.ready(),this.hasAttribute("role")||this.setAttribute("role","button")}_onKeyDown(t){super._onKeyDown(t),t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||this._activeKeys.includes(t.key)&&(t.preventDefault(),this.click())}};(0,l.hC)("vaadin-button",h,{moduleId:"vaadin-button-styles"});class p extends(_((0,n.S)((0,l.Tb)((0,a.k)(o.H3))))){static get is(){return"vaadin-button"}static get template(){return o.dy`
62
+ `;var d=i(61224),c=i(21360),u=i(58298);const _=t=>class extends((0,d.D)((0,u.N)((0,c.W)(t)))){static get properties(){return{tabindex:{type:Number,value:0,reflectToAttribute:!0}}}get _activeKeys(){return["Enter"," "]}ready(){super.ready(),this.hasAttribute("role")||this.setAttribute("role","button")}_onKeyDown(t){super._onKeyDown(t),t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||this._activeKeys.includes(t.key)&&(t.preventDefault(),this.click())}};(0,l.hC)("vaadin-button",h,{moduleId:"vaadin-button-styles"});class p extends(_((0,n.S)((0,l.Tb)((0,a.k)(o.H3))))){static get is(){return"vaadin-button"}static get template(){return o.dy`
63
63
  <div class="vaadin-button-container">
64
64
  <span part="prefix" aria-hidden="true">
65
65
  <slot name="prefix"></slot>
@@ -72,7 +72,7 @@
72
72
  </span>
73
73
  </div>
74
74
  <slot name="tooltip"></slot>
75
- `}ready(){super.ready(),this._tooltipController=new r.f(this),this.addController(this._tooltipController)}}(0,s.M)(p)},4750:(t,e,i)=>{i.d(e,{L:()=>a}),i(1195),i(9098),i(9416),i(9849),i(4173);var o=i(6570);const a=o.iv`
75
+ `}ready(){super.ready(),this._tooltipController=new r.f(this),this.addController(this._tooltipController)}}(0,s.M)(p)},74750:(t,e,i)=>{i.d(e,{L:()=>a}),i(51195),i(79098),i(29416),i(29849),i(34173);var o=i(46570);const a=o.iv`
76
76
  :host {
77
77
  /* Sizing */
78
78
  --lumo-button-size: var(--lumo-size-m);
@@ -335,7 +335,7 @@
335
335
  margin-left: 0;
336
336
  margin-right: 0;
337
337
  }
338
- `;(0,o.hC)("vaadin-button",a,{moduleId:"lumo-button"})},9092:(t,e,i)=>{i(9098),i(9416);var o=i(6754),a=i(6570);const s=a.iv`
338
+ `;(0,o.hC)("vaadin-button",a,{moduleId:"lumo-button"})},79092:(t,e,i)=>{i(79098),i(29416);var o=i(96754),a=i(46570);const s=a.iv`
339
339
  [part='overlay'] {
340
340
  /*
341
341
  Width:
@@ -383,7 +383,7 @@
383
383
  max-height: 70vh;
384
384
  }
385
385
  }
386
- `;(0,a.hC)("vaadin-date-picker-overlay",[o.L,s],{moduleId:"lumo-date-picker-overlay"}),i(1195),i(9849),i(4173),i(4750),(0,a.hC)("vaadin-date-picker-year",a.iv`
386
+ `;(0,a.hC)("vaadin-date-picker-overlay",[o.L,s],{moduleId:"lumo-date-picker-overlay"}),i(51195),i(29849),i(34173),i(74750),(0,a.hC)("vaadin-date-picker-year",a.iv`
387
387
  :host([current]) [part='year-number'] {
388
388
  color: var(--lumo-primary-text-color);
389
389
  }
@@ -701,7 +701,7 @@
701
701
  :host([disabled]) * {
702
702
  color: var(--lumo-disabled-text-color) !important;
703
703
  }
704
- `,{moduleId:"lumo-month-calendar"});const n=document.createElement("template");n.innerHTML="\n <style>\n @keyframes vaadin-date-picker-month-calendar-focus-date {\n 50% {\n box-shadow: 0 0 0 var(--_focus-ring-width) transparent;\n }\n }\n </style>\n",document.head.appendChild(n.content),i(1578),i(1735);var r=i(7205);const l=a.iv`
704
+ `,{moduleId:"lumo-month-calendar"});const n=document.createElement("template");n.innerHTML="\n <style>\n @keyframes vaadin-date-picker-month-calendar-focus-date {\n 50% {\n box-shadow: 0 0 0 var(--_focus-ring-width) transparent;\n }\n }\n </style>\n",document.head.appendChild(n.content),i(21578),i(41735);var r=i(83208);const l=a.iv`
705
705
  :host {
706
706
  outline: none;
707
707
  }
@@ -727,7 +727,7 @@
727
727
  :host([dir='rtl']) [part='input-field'] ::slotted(input:placeholder-shown) {
728
728
  --_lumo-text-field-overflow-mask-image: none;
729
729
  }
730
- `;(0,a.hC)("vaadin-date-picker",[r.J,l],{moduleId:"lumo-date-picker"}),i(3553);var h=i(4241),d=i(2807),c=i(1914),u=i(4457),_=i(3373),p=i(6196),m=i(235);const f=m.iv`
730
+ `;(0,a.hC)("vaadin-date-picker",[r.J,l],{moduleId:"lumo-date-picker"}),i(13553);var h=i(74241),d=i(52807),c=i(51914),u=i(44457),_=i(63373),p=i(6196),m=i(9392);const f=m.iv`
731
731
  [part='overlay'] {
732
732
  display: flex;
733
733
  flex: auto;
@@ -749,7 +749,7 @@
749
749
  <slot></slot>
750
750
  </div>
751
751
  </div>
752
- `}}function g(t,e){return t instanceof Date&&e instanceof Date&&t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function v(t,e,i){return(!e||t>=e)&&(!i||t<=i)}function b(t,e){return e.filter((t=>void 0!==t)).reduce(((e,i)=>i?e?Math.abs(t.getTime()-i.getTime())<Math.abs(e.getTime()-t.getTime())?i:e:i:e))}function D(t){return{day:t.getDate(),month:t.getMonth(),year:t.getFullYear()}}function w(t){const e=new Date,i=new Date(e);return i.setDate(1),i.setMonth(parseInt(t)+e.getMonth()),i}function k(t){const e=/^([-+]\d{1}|\d{2,4}|[-+]\d{6})-(\d{1,2})-(\d{1,2})$/u.exec(t);if(!e)return;const i=new Date(0,0);return i.setFullYear(parseInt(e[1],10)),i.setMonth(parseInt(e[2],10)-1),i.setDate(parseInt(e[3],10)),i}(0,d.M)(y),i(7078);var x=i(7913),C=i(1037),S=i(6139),E=i(3971);const T=document.createElement("template");T.innerHTML='\n <style>\n :host {\n display: block;\n overflow: hidden;\n height: 500px;\n }\n\n #scroller {\n position: relative;\n height: 100%;\n overflow: auto;\n outline: none;\n margin-right: -40px;\n -webkit-overflow-scrolling: touch;\n overflow-x: hidden;\n }\n\n #scroller.notouchscroll {\n -webkit-overflow-scrolling: auto;\n }\n\n #scroller::-webkit-scrollbar {\n display: none;\n }\n\n .buffer {\n position: absolute;\n width: var(--vaadin-infinite-scroller-buffer-width, 100%);\n box-sizing: border-box;\n padding-right: 40px;\n top: var(--vaadin-infinite-scroller-buffer-offset, 0);\n animation: fadein 0.2s;\n }\n\n @keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n </style>\n\n <div id="scroller">\n <div class="buffer"></div>\n <div class="buffer"></div>\n <div id="fullHeight"></div>\n </div>\n';class M extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}).appendChild(T.content.cloneNode(!0)),this.bufferSize=20,this._initialScroll=5e5,this._initialIndex=0,this._activated=!1}get active(){return this._activated}set active(t){t&&!this._activated&&(this._createPool(),this._activated=!0)}get bufferOffset(){return this._buffers[0].offsetTop}get itemHeight(){if(!this._itemHeightVal){const t=getComputedStyle(this).getPropertyValue("--vaadin-infinite-scroller-item-height"),e="background-position";this.$.fullHeight.style.setProperty(e,t);const i=getComputedStyle(this.$.fullHeight).getPropertyValue(e);this.$.fullHeight.style.removeProperty(e),this._itemHeightVal=parseFloat(i)}return this._itemHeightVal}get _bufferHeight(){return this.itemHeight*this.bufferSize}get position(){return(this.$.scroller.scrollTop-this._buffers[0].translateY)/this.itemHeight+this._firstIndex}set position(t){this._preventScrollEvent=!0,t>this._firstIndex&&t<this._firstIndex+2*this.bufferSize?this.$.scroller.scrollTop=this.itemHeight*(t-this._firstIndex)+this._buffers[0].translateY:(this._initialIndex=~~t,this._reset(),this._scrollDisabled=!0,this.$.scroller.scrollTop+=t%1*this.itemHeight,this._scrollDisabled=!1),this._mayHaveMomentum&&(this.$.scroller.classList.add("notouchscroll"),this._mayHaveMomentum=!1,setTimeout((()=>{this.$.scroller.classList.remove("notouchscroll")}),10))}connectedCallback(){this._ready||(this._ready=!0,this.$={},this.shadowRoot.querySelectorAll("[id]").forEach((t=>{this.$[t.id]=t})),this.$.scroller.addEventListener("scroll",(()=>this._scroll())),this._buffers=[...this.shadowRoot.querySelectorAll(".buffer")],this.$.fullHeight.style.height=2*this._initialScroll+"px",C.vU&&(this.$.scroller.tabIndex=-1))}forceUpdate(){this._debouncerUpdateClones&&(this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones(),this._debouncerUpdateClones.cancel())}_createElement(){}_updateElement(t,e){}_finishInit(){this._initDone||(this._buffers.forEach((t=>{[...t.children].forEach((t=>{this._ensureStampedInstance(t._itemWrapper)}))})),this._buffers[0].translateY||this._reset(),this._initDone=!0,this.dispatchEvent(new CustomEvent("init-done")))}_translateBuffer(t){const e=t?1:0;this._buffers[e].translateY=this._buffers[e?0:1].translateY+this._bufferHeight*(e?-1:1),this._buffers[e].style.transform=`translate3d(0, ${this._buffers[e].translateY}px, 0)`,this._buffers[e].updated=!1,this._buffers.reverse()}_scroll(){if(this._scrollDisabled)return;const t=this.$.scroller.scrollTop;(t<this._bufferHeight||t>2*this._initialScroll-this._bufferHeight)&&(this._initialIndex=~~this.position,this._reset());const e=this.itemHeight+this.bufferOffset,i=t>this._buffers[1].translateY+e,o=t<this._buffers[0].translateY+e;(i||o)&&(this._translateBuffer(o),this._updateClones()),this._preventScrollEvent||(this.dispatchEvent(new CustomEvent("custom-scroll",{bubbles:!1,composed:!0})),this._mayHaveMomentum=!0),this._preventScrollEvent=!1,this._debouncerScrollFinish=S.dx.debounce(this._debouncerScrollFinish,x.Wc.after(200),(()=>{const t=this.$.scroller.getBoundingClientRect();this._isVisible(this._buffers[0],t)||this._isVisible(this._buffers[1],t)||(this.position=this.position)}))}_reset(){this._scrollDisabled=!0,this.$.scroller.scrollTop=this._initialScroll,this._buffers[0].translateY=this._initialScroll-this._bufferHeight,this._buffers[1].translateY=this._initialScroll,this._buffers.forEach((t=>{t.style.transform=`translate3d(0, ${t.translateY}px, 0)`})),this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones(!0),this._debouncerUpdateClones=S.dx.debounce(this._debouncerUpdateClones,x.Wc.after(200),(()=>{this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones()})),this._scrollDisabled=!1}_createPool(){const t=this.getBoundingClientRect();this._buffers.forEach((e=>{for(let i=0;i<this.bufferSize;i++){const i=document.createElement("div");i.style.height=`${this.itemHeight}px`,i.instance={};const o=`vaadin-infinite-scroller-item-content-${(0,E.l)()}`,a=document.createElement("slot");a.setAttribute("name",o),a._itemWrapper=i,e.appendChild(a),i.setAttribute("slot",o),this.appendChild(i),this._isVisible(i,t)&&this._ensureStampedInstance(i)}})),requestAnimationFrame((()=>{this._finishInit()}))}_ensureStampedInstance(t){if(t.firstElementChild)return;const e=t.instance;t.instance=this._createElement(),t.appendChild(t.instance),Object.keys(e).forEach((i=>{t.instance[i]=e[i]}))}_updateClones(t){this._firstIndex=~~((this._buffers[0].translateY-this._initialScroll)/this.itemHeight)+this._initialIndex;const e=t?this.$.scroller.getBoundingClientRect():void 0;this._buffers.forEach(((i,o)=>{if(!i.updated){const a=this._firstIndex+this.bufferSize*o;[...i.children].forEach(((i,o)=>{const s=i._itemWrapper;t&&!this._isVisible(s,e)||this._updateElement(s.instance,a+o)})),i.updated=!0}}))}_isVisible(t,e){const i=t.getBoundingClientRect();return i.bottom>e.top&&i.top<e.bottom}}const P=document.createElement("template");P.innerHTML="\n <style>\n :host {\n --vaadin-infinite-scroller-item-height: 270px;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n }\n </style>\n",(0,d.M)(class extends M{static get is(){return"vaadin-date-picker-month-scroller"}constructor(){super(),this.bufferSize=3,this.shadowRoot.appendChild(P.content.cloneNode(!0))}_createElement(){return document.createElement("vaadin-month-calendar")}_updateElement(t,e){t.month=w(e)}});const A=document.createElement("template");A.innerHTML="\n <style>\n :host {\n --vaadin-infinite-scroller-item-height: 80px;\n width: 50px;\n display: block;\n height: 100%;\n position: absolute;\n right: 0;\n transform: translateX(100%);\n -webkit-tap-highlight-color: transparent;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n /* Center the year scroller position. */\n --vaadin-infinite-scroller-buffer-offset: 50%;\n }\n\n :host::before {\n content: '';\n display: block;\n background: transparent;\n width: 0;\n height: 0;\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n border-width: 6px;\n border-style: solid;\n border-color: transparent;\n border-left-color: #000;\n }\n </style>\n",(0,d.M)(class extends M{static get is(){return"vaadin-date-picker-year-scroller"}constructor(){super(),this.bufferSize=12,this.shadowRoot.appendChild(A.content.cloneNode(!0))}_createElement(){return document.createElement("vaadin-date-picker-year")}_updateElement(t,e){t.year=this._yearAfterXYears(e)}_yearAfterXYears(t){const e=new Date,i=new Date(e);return i.setFullYear(parseInt(t)+e.getFullYear()),i.getFullYear()}});const I=t=>class extends t{static get properties(){return{year:{type:String,sync:!0},selectedDate:{type:Object,sync:!0}}}static get observers(){return["__updateSelected(year, selectedDate)"]}__updateSelected(t,e){this.toggleAttribute("selected",e&&e.getFullYear()===t),this.toggleAttribute("current",t===(new Date).getFullYear())}};class O extends((0,a.Tb)(I(h.H3))){static get is(){return"vaadin-date-picker-year"}static get template(){return h.dy`
752
+ `}}function g(t,e){return t instanceof Date&&e instanceof Date&&t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function v(t,e,i){return(!e||t>=e)&&(!i||t<=i)}function b(t,e){return e.filter((t=>void 0!==t)).reduce(((e,i)=>i?e?Math.abs(t.getTime()-i.getTime())<Math.abs(e.getTime()-t.getTime())?i:e:i:e))}function D(t){return{day:t.getDate(),month:t.getMonth(),year:t.getFullYear()}}function w(t){const e=new Date,i=new Date(e);return i.setDate(1),i.setMonth(parseInt(t)+e.getMonth()),i}function k(t){const e=/^([-+]\d{1}|\d{2,4}|[-+]\d{6})-(\d{1,2})-(\d{1,2})$/u.exec(t);if(!e)return;const i=new Date(0,0);return i.setFullYear(parseInt(e[1],10)),i.setMonth(parseInt(e[2],10)-1),i.setDate(parseInt(e[3],10)),i}(0,d.M)(y),i(17078);var x=i(87913),C=i(61037),S=i(36139),E=i(73971);const T=document.createElement("template");T.innerHTML='\n <style>\n :host {\n display: block;\n overflow: hidden;\n height: 500px;\n }\n\n #scroller {\n position: relative;\n height: 100%;\n overflow: auto;\n outline: none;\n margin-right: -40px;\n -webkit-overflow-scrolling: touch;\n overflow-x: hidden;\n }\n\n #scroller.notouchscroll {\n -webkit-overflow-scrolling: auto;\n }\n\n #scroller::-webkit-scrollbar {\n display: none;\n }\n\n .buffer {\n position: absolute;\n width: var(--vaadin-infinite-scroller-buffer-width, 100%);\n box-sizing: border-box;\n padding-right: 40px;\n top: var(--vaadin-infinite-scroller-buffer-offset, 0);\n animation: fadein 0.2s;\n }\n\n @keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n </style>\n\n <div id="scroller">\n <div class="buffer"></div>\n <div class="buffer"></div>\n <div id="fullHeight"></div>\n </div>\n';class M extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}).appendChild(T.content.cloneNode(!0)),this.bufferSize=20,this._initialScroll=5e5,this._initialIndex=0,this._activated=!1}get active(){return this._activated}set active(t){t&&!this._activated&&(this._createPool(),this._activated=!0)}get bufferOffset(){return this._buffers[0].offsetTop}get itemHeight(){if(!this._itemHeightVal){const t=getComputedStyle(this).getPropertyValue("--vaadin-infinite-scroller-item-height"),e="background-position";this.$.fullHeight.style.setProperty(e,t);const i=getComputedStyle(this.$.fullHeight).getPropertyValue(e);this.$.fullHeight.style.removeProperty(e),this._itemHeightVal=parseFloat(i)}return this._itemHeightVal}get _bufferHeight(){return this.itemHeight*this.bufferSize}get position(){return(this.$.scroller.scrollTop-this._buffers[0].translateY)/this.itemHeight+this._firstIndex}set position(t){this._preventScrollEvent=!0,t>this._firstIndex&&t<this._firstIndex+2*this.bufferSize?this.$.scroller.scrollTop=this.itemHeight*(t-this._firstIndex)+this._buffers[0].translateY:(this._initialIndex=~~t,this._reset(),this._scrollDisabled=!0,this.$.scroller.scrollTop+=t%1*this.itemHeight,this._scrollDisabled=!1),this._mayHaveMomentum&&(this.$.scroller.classList.add("notouchscroll"),this._mayHaveMomentum=!1,setTimeout((()=>{this.$.scroller.classList.remove("notouchscroll")}),10))}connectedCallback(){this._ready||(this._ready=!0,this.$={},this.shadowRoot.querySelectorAll("[id]").forEach((t=>{this.$[t.id]=t})),this.$.scroller.addEventListener("scroll",(()=>this._scroll())),this._buffers=[...this.shadowRoot.querySelectorAll(".buffer")],this.$.fullHeight.style.height=2*this._initialScroll+"px",C.vU&&(this.$.scroller.tabIndex=-1))}forceUpdate(){this._debouncerUpdateClones&&(this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones(),this._debouncerUpdateClones.cancel())}_createElement(){}_updateElement(t,e){}_finishInit(){this._initDone||(this._buffers.forEach((t=>{[...t.children].forEach((t=>{this._ensureStampedInstance(t._itemWrapper)}))})),this._buffers[0].translateY||this._reset(),this._initDone=!0,this.dispatchEvent(new CustomEvent("init-done")))}_translateBuffer(t){const e=t?1:0;this._buffers[e].translateY=this._buffers[e?0:1].translateY+this._bufferHeight*(e?-1:1),this._buffers[e].style.transform=`translate3d(0, ${this._buffers[e].translateY}px, 0)`,this._buffers[e].updated=!1,this._buffers.reverse()}_scroll(){if(this._scrollDisabled)return;const t=this.$.scroller.scrollTop;(t<this._bufferHeight||t>2*this._initialScroll-this._bufferHeight)&&(this._initialIndex=~~this.position,this._reset());const e=this.itemHeight+this.bufferOffset,i=t>this._buffers[1].translateY+e,o=t<this._buffers[0].translateY+e;(i||o)&&(this._translateBuffer(o),this._updateClones()),this._preventScrollEvent||(this.dispatchEvent(new CustomEvent("custom-scroll",{bubbles:!1,composed:!0})),this._mayHaveMomentum=!0),this._preventScrollEvent=!1,this._debouncerScrollFinish=S.dx.debounce(this._debouncerScrollFinish,x.Wc.after(200),(()=>{const t=this.$.scroller.getBoundingClientRect();this._isVisible(this._buffers[0],t)||this._isVisible(this._buffers[1],t)||(this.position=this.position)}))}_reset(){this._scrollDisabled=!0,this.$.scroller.scrollTop=this._initialScroll,this._buffers[0].translateY=this._initialScroll-this._bufferHeight,this._buffers[1].translateY=this._initialScroll,this._buffers.forEach((t=>{t.style.transform=`translate3d(0, ${t.translateY}px, 0)`})),this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones(!0),this._debouncerUpdateClones=S.dx.debounce(this._debouncerUpdateClones,x.Wc.after(200),(()=>{this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones()})),this._scrollDisabled=!1}_createPool(){const t=this.getBoundingClientRect();this._buffers.forEach((e=>{for(let i=0;i<this.bufferSize;i++){const i=document.createElement("div");i.style.height=`${this.itemHeight}px`,i.instance={};const o=`vaadin-infinite-scroller-item-content-${(0,E.l)()}`,a=document.createElement("slot");a.setAttribute("name",o),a._itemWrapper=i,e.appendChild(a),i.setAttribute("slot",o),this.appendChild(i),this._isVisible(i,t)&&this._ensureStampedInstance(i)}})),requestAnimationFrame((()=>{this._finishInit()}))}_ensureStampedInstance(t){if(t.firstElementChild)return;const e=t.instance;t.instance=this._createElement(),t.appendChild(t.instance),Object.keys(e).forEach((i=>{t.instance[i]=e[i]}))}_updateClones(t){this._firstIndex=~~((this._buffers[0].translateY-this._initialScroll)/this.itemHeight)+this._initialIndex;const e=t?this.$.scroller.getBoundingClientRect():void 0;this._buffers.forEach(((i,o)=>{if(!i.updated){const a=this._firstIndex+this.bufferSize*o;[...i.children].forEach(((i,o)=>{const s=i._itemWrapper;t&&!this._isVisible(s,e)||this._updateElement(s.instance,a+o)})),i.updated=!0}}))}_isVisible(t,e){const i=t.getBoundingClientRect();return i.bottom>e.top&&i.top<e.bottom}}const P=document.createElement("template");P.innerHTML="\n <style>\n :host {\n --vaadin-infinite-scroller-item-height: 270px;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n }\n </style>\n",(0,d.M)(class extends M{static get is(){return"vaadin-date-picker-month-scroller"}constructor(){super(),this.bufferSize=3,this.shadowRoot.appendChild(P.content.cloneNode(!0))}_createElement(){return document.createElement("vaadin-month-calendar")}_updateElement(t,e){t.month=w(e)}});const A=document.createElement("template");A.innerHTML="\n <style>\n :host {\n --vaadin-infinite-scroller-item-height: 80px;\n width: 50px;\n display: block;\n height: 100%;\n position: absolute;\n right: 0;\n transform: translateX(100%);\n -webkit-tap-highlight-color: transparent;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n /* Center the year scroller position. */\n --vaadin-infinite-scroller-buffer-offset: 50%;\n }\n\n :host::before {\n content: '';\n display: block;\n background: transparent;\n width: 0;\n height: 0;\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n border-width: 6px;\n border-style: solid;\n border-color: transparent;\n border-left-color: #000;\n }\n </style>\n",(0,d.M)(class extends M{static get is(){return"vaadin-date-picker-year-scroller"}constructor(){super(),this.bufferSize=12,this.shadowRoot.appendChild(A.content.cloneNode(!0))}_createElement(){return document.createElement("vaadin-date-picker-year")}_updateElement(t,e){t.year=this._yearAfterXYears(e)}_yearAfterXYears(t){const e=new Date,i=new Date(e);return i.setFullYear(parseInt(t)+e.getFullYear()),i.getFullYear()}});const I=t=>class extends t{static get properties(){return{year:{type:String,sync:!0},selectedDate:{type:Object,sync:!0}}}static get observers(){return["__updateSelected(year, selectedDate)"]}__updateSelected(t,e){this.toggleAttribute("selected",e&&e.getFullYear()===t),this.toggleAttribute("current",t===(new Date).getFullYear())}};class O extends((0,a.Tb)(I(h.H3))){static get is(){return"vaadin-date-picker-year"}static get template(){return h.dy`
753
753
  <style>
754
754
  :host {
755
755
  display: block;
@@ -758,7 +758,7 @@
758
758
  </style>
759
759
  <div part="year-number">[[year]]</div>
760
760
  <div part="year-separator" aria-hidden="true"></div>
761
- `}}(0,d.M)(O),i(7894);var F=i(4933),H=i(1014);function z(t,e,i,o,a){let s;a&&(s="object"==typeof i&&null!==i,s&&(o=t.__dataTemp[e]));let n=o!==i&&(o==o||i==i);return s&&n&&(t.__dataTemp[e]=i),n}const Y=(0,H.o)((t=>class extends t{_shouldPropertyChange(t,e,i){return z(this,t,e,i,!0)}})),V=(0,H.o)((t=>class extends t{static get properties(){return{mutableData:Boolean}}_shouldPropertyChange(t,e,i){return z(this,t,e,i,this.mutableData)}}));Y._mutablePropertyChange=z;var B=i(9387),L=i(1342);let N=null;function $(){return N}$.prototype=Object.create(HTMLTemplateElement.prototype,{constructor:{value:$,writable:!0}});const W=(0,F.q)($),R=Y(W),j=(0,F.q)(class{});class q extends j{constructor(t){super(),this._configureProperties(t),this.root=this._stampTemplate(this.__dataHost);let e=[];this.children=e;for(let t=this.root.firstChild;t;t=t.nextSibling)e.push(t),t.__templatizeInstance=this;this.__templatizeOwner&&this.__templatizeOwner.__hideTemplateChildren__&&this._showHideChildren(!0);let i=this.__templatizeOptions;(t&&i.instanceProps||!i.instanceProps)&&this._enableProperties()}_configureProperties(t){if(this.__templatizeOptions.forwardHostProp)for(let t in this.__hostProps)this._setPendingProperty(t,this.__dataHost["_host_"+t]);for(let e in t)this._setPendingProperty(e,t[e])}forwardHostProp(t,e){this._setPendingPropertyOrPath(t,e,!1,!0)&&this.__dataHost._enqueueClient(this)}_addEventListenerToNode(t,e,i){if(this._methodHost&&this.__templatizeOptions.parentModel)this._methodHost._addEventListenerToNode(t,e,(t=>{t.model=this,i(t)}));else{let o=this.__dataHost.__dataHost;o&&o._addEventListenerToNode(t,e,i)}}_showHideChildren(t){!function(t,e){for(let i=0;i<e.length;i++){let o=e[i];if(Boolean(t)!=Boolean(o.__hideTemplateChildren__))if(o.nodeType===Node.TEXT_NODE)t?(o.__polymerTextContent__=o.textContent,o.textContent=""):o.textContent=o.__polymerTextContent__;else if("slot"===o.localName)if(t)o.__polymerReplaced__=document.createComment("hidden-slot"),(0,L.r)((0,L.r)(o).parentNode).replaceChild(o.__polymerReplaced__,o);else{const t=o.__polymerReplaced__;t&&(0,L.r)((0,L.r)(t).parentNode).replaceChild(o,t)}else o.style&&(t?(o.__polymerDisplay__=o.style.display,o.style.display="none"):o.style.display=o.__polymerDisplay__);o.__hideTemplateChildren__=t,o._showHideChildren&&o._showHideChildren(t)}}(t,this.children)}_setUnmanagedPropertyToNode(t,e,i){t.__hideTemplateChildren__&&t.nodeType==Node.TEXT_NODE&&"textContent"==e?t.__polymerTextContent__=i:super._setUnmanagedPropertyToNode(t,e,i)}get parentModel(){let t=this.__parentModel;if(!t){let e;t=this;do{t=t.__dataHost.__dataHost}while((e=t.__templatizeOptions)&&!e.parentModel);this.__parentModel=t}return t}dispatchEvent(t){return!0}}q.prototype.__dataHost,q.prototype.__templatizeOptions,q.prototype._methodHost,q.prototype.__templatizeOwner,q.prototype.__hostProps;const K=Y(q);function U(t){let e=t.__dataHost;return e&&e._methodHost||e}function X(t,e){return function(t,i,o){e.call(t.__templatizeOwner,i.substring(6),o[i])}}function Q(t,e){return function(t,i,o){e.call(t.__templatizeOwner,t,i,o[i])}}function J(t,e,i){if(B.XN&&!U(t))throw new Error("strictTemplatePolicy: template owner not trusted");if(i=i||{},t.__templatizeOwner)throw new Error("A <template> can only be templatized once");t.__templatizeOwner=e;let o=(e?e.constructor:q)._parseTemplate(t),a=o.templatizeInstanceClass;a||(a=function(t,e,i){let o=i.mutableData?K:q;J.mixin&&(o=J.mixin(o));let a=class extends o{};return a.prototype.__templatizeOptions=i,a.prototype._bindTemplate(t),function(t,e,i,o){let a=i.hostProps||{};for(let e in o.instanceProps){delete a[e];let i=o.notifyInstanceProp;i&&t.prototype._addPropertyEffect(e,t.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:Q(0,i)})}if(o.forwardHostProp&&e.__dataHost)for(let e in a)i.hasHostProps||(i.hasHostProps=!0),t.prototype._addPropertyEffect(e,t.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:function(t,e,i){t.__dataHost._setPendingPropertyOrPath("_host_"+e,i[e],!0,!0)}})}(a,t,e,i),a}(t,o,i),o.templatizeInstanceClass=a);const s=U(t);!function(t,e,i,o){let a=i.forwardHostProp;if(a&&e.hasHostProps){const s="template"==t.localName;let n=e.templatizeTemplateClass;if(!n){if(s){let t=i.mutableData?R:W;class o extends t{}n=e.templatizeTemplateClass=o}else{const i=t.constructor;class o extends i{}n=e.templatizeTemplateClass=o}let r=e.hostProps;for(let t in r)n.prototype._addPropertyEffect("_host_"+t,n.prototype.PROPERTY_EFFECT_TYPES.PROPAGATE,{fn:X(0,a)}),n.prototype._createNotifyingProperty("_host_"+t);B.a2&&o&&function(t,e,i){const o=i.constructor._properties,{propertyEffects:a}=t,{instanceProps:s}=e;for(let t in a)if(!(o[t]||s&&s[t])){const e=a[t];for(let i=0;i<e.length;i++){const{part:o}=e[i].info;if(!o.signature||!o.signature.static){console.warn(`Property '${t}' used in template but not declared in 'properties'; attribute will not be observed.`);break}}}}(e,i,o)}if(t.__dataProto&&Object.assign(t.__data,t.__dataProto),s)!function(t,e){N=t,Object.setPrototypeOf(t,e.prototype),new e,N=null}(t,n),t.__dataTemp={},t.__dataPending=null,t.__dataOld=null,t._enableProperties();else{Object.setPrototypeOf(t,n.prototype);const i=e.hostProps;for(let e in i)if(e="_host_"+e,e in t){const i=t[e];delete t[e],t.__data[e]=i}}}}(t,o,i,s);let n=class extends a{};return n.prototype._methodHost=s,n.prototype.__dataHost=t,n.prototype.__templatizeOwner=e,n.prototype.__hostProps=o.hostProps,n}var G=i(2224);class Z{constructor(){this._asyncModule=null,this._callback=null,this._timer=null}setConfig(t,e){this._asyncModule=t,this._callback=e,this._timer=this._asyncModule.run((()=>{this._timer=null,tt.delete(this),this._callback()}))}cancel(){this.isActive()&&(this._cancelAsync(),tt.delete(this))}_cancelAsync(){this.isActive()&&(this._asyncModule.cancel(this._timer),this._timer=null)}flush(){this.isActive()&&(this.cancel(),this._callback())}isActive(){return null!=this._timer}static debounce(t,e,i){return t instanceof Z?t._cancelAsync():t=new Z,t.setConfig(e,i),t}}let tt=new Set;const et=function(){const t=Boolean(tt.size);return tt.forEach((t=>{try{t.flush()}catch(t){setTimeout((()=>{throw t}))}})),t},it=function(){let t,e;do{t=window.ShadyDOM&&ShadyDOM.flush(),window.ShadyCSS&&window.ShadyCSS.ScopingShim&&window.ShadyCSS.ScopingShim.flush(),e=et()}while(t||e)};var ot=i(1446);let at=!1;const st=V(h.H3);class nt extends st{static get is(){return"dom-repeat"}static get template(){return null}static get properties(){return{items:{type:Array},as:{type:String,value:"item"},indexAs:{type:String,value:"index"},itemsIndexAs:{type:String,value:"itemsIndex"},sort:{type:Function,observer:"__sortChanged"},filter:{type:Function,observer:"__filterChanged"},observe:{type:String,observer:"__observeChanged"},delay:Number,renderedItemCount:{type:Number,notify:!B.dJ,readOnly:!0},initialCount:{type:Number},targetFramerate:{type:Number,value:20},_targetFrameTime:{type:Number,computed:"__computeFrameTime(targetFramerate)"},notifyDomChange:{type:Boolean},reuseChunkedInstances:{type:Boolean}}}static get observers(){return["__itemsChanged(items.*)"]}constructor(){super(),this.__instances=[],this.__renderDebouncer=null,this.__itemsIdxToInstIdx={},this.__chunkCount=null,this.__renderStartTime=null,this.__itemsArrayChanged=!1,this.__shouldMeasureChunk=!1,this.__shouldContinueChunking=!1,this.__chunkingId=0,this.__sortFn=null,this.__filterFn=null,this.__observePaths=null,this.__ctor=null,this.__isDetached=!0,this.template=null,this._templateInfo}disconnectedCallback(){super.disconnectedCallback(),this.__isDetached=!0;for(let t=0;t<this.__instances.length;t++)this.__detachInstance(t);this.__chunkingId&&cancelAnimationFrame(this.__chunkingId)}connectedCallback(){if(super.connectedCallback(),function(){if(B.nL&&!B.my){if(!at){at=!0;const t=document.createElement("style");t.textContent="dom-bind,dom-if,dom-repeat{display:none;}",document.head.appendChild(t)}return!0}return!1}()||(this.style.display="none"),this.__isDetached){this.__isDetached=!1;let t=(0,L.r)((0,L.r)(this).parentNode);for(let e=0;e<this.__instances.length;e++)this.__attachInstance(e,t);this.__chunkingId&&this.__render()}}__ensureTemplatized(){if(!this.__ctor){const t=this;let e=this.template=t._templateInfo?t:this.querySelector("template");if(!e){let t=new MutationObserver((()=>{if(!this.querySelector("template"))throw new Error("dom-repeat requires a <template> child");t.disconnect(),this.__render()}));return t.observe(this,{childList:!0}),!1}let i={};i[this.as]=!0,i[this.indexAs]=!0,i[this.itemsIndexAs]=!0,this.__ctor=J(e,this,{mutableData:this.mutableData,parentModel:!0,instanceProps:i,forwardHostProp:function(t,e){let i=this.__instances;for(let o,a=0;a<i.length&&(o=i[a]);a++)o.forwardHostProp(t,e)},notifyInstanceProp:function(t,e,i){if((0,ot.wB)(this.as,e)){let o=t[this.itemsIndexAs];e==this.as&&(this.items[o]=i);let a=(0,ot.Iu)(this.as,`${JSCompiler_renameProperty("items",this)}.${o}`,e);this.notifyPath(a,i)}}})}return!0}__getMethodHost(){return this.__dataHost._methodHost||this.__dataHost}__functionFromPropertyValue(t){if("string"==typeof t){let e=t,i=this.__getMethodHost();return function(){return i[e].apply(i,arguments)}}return t}__sortChanged(t){this.__sortFn=this.__functionFromPropertyValue(t),this.items&&this.__debounceRender(this.__render)}__filterChanged(t){this.__filterFn=this.__functionFromPropertyValue(t),this.items&&this.__debounceRender(this.__render)}__computeFrameTime(t){return Math.ceil(1e3/t)}__observeChanged(){this.__observePaths=this.observe&&this.observe.replace(".*",".").split(" ")}__handleObservedPaths(t){if(this.__sortFn||this.__filterFn)if(t){if(this.__observePaths){let e=this.__observePaths;for(let i=0;i<e.length;i++)0===t.indexOf(e[i])&&this.__debounceRender(this.__render,this.delay)}}else this.__debounceRender(this.__render,this.delay)}__itemsChanged(t){this.items&&!Array.isArray(this.items)&&console.warn("dom-repeat expected array for `items`, found",this.items),this.__handleItemPath(t.path,t.value)||("items"===t.path&&(this.__itemsArrayChanged=!0),this.__debounceRender(this.__render))}__debounceRender(t,e=0){var i;this.__renderDebouncer=Z.debounce(this.__renderDebouncer,e>0?G.Wc.after(e):G.YA,t.bind(this)),i=this.__renderDebouncer,tt.add(i)}render(){this.__debounceRender(this.__render),it()}__render(){if(!this.__ensureTemplatized())return;let t=this.items||[];const e=this.__sortAndFilterItems(t),i=this.__calculateLimit(e.length);this.__updateInstances(t,i,e),this.initialCount&&(this.__shouldMeasureChunk||this.__shouldContinueChunking)&&(cancelAnimationFrame(this.__chunkingId),this.__chunkingId=requestAnimationFrame((()=>{this.__chunkingId=null,this.__continueChunking()}))),this._setRenderedItemCount(this.__instances.length),B.dJ&&!this.notifyDomChange||this.dispatchEvent(new CustomEvent("dom-change",{bubbles:!0,composed:!0}))}__sortAndFilterItems(t){let e=new Array(t.length);for(let i=0;i<t.length;i++)e[i]=i;return this.__filterFn&&(e=e.filter(((e,i,o)=>this.__filterFn(t[e],i,o)))),this.__sortFn&&e.sort(((e,i)=>this.__sortFn(t[e],t[i]))),e}__calculateLimit(t){let e=t;const i=this.__instances.length;if(this.initialCount){let o;!this.__chunkCount||this.__itemsArrayChanged&&!this.reuseChunkedInstances?(e=Math.min(t,this.initialCount),o=Math.max(e-i,0),this.__chunkCount=o||1):(o=Math.min(Math.max(t-i,0),this.__chunkCount),e=Math.min(i+o,t)),this.__shouldMeasureChunk=o===this.__chunkCount,this.__shouldContinueChunking=e<t,this.__renderStartTime=performance.now()}return this.__itemsArrayChanged=!1,e}__continueChunking(){if(this.__shouldMeasureChunk){const t=performance.now()-this.__renderStartTime,e=this._targetFrameTime/t;this.__chunkCount=Math.round(this.__chunkCount*e)||1}this.__shouldContinueChunking&&this.__debounceRender(this.__render)}__updateInstances(t,e,i){const o=this.__itemsIdxToInstIdx={};let a;for(a=0;a<e;a++){let e=this.__instances[a],s=i[a],n=t[s];o[s]=a,e?(e._setPendingProperty(this.as,n),e._setPendingProperty(this.indexAs,a),e._setPendingProperty(this.itemsIndexAs,s),e._flushProperties()):this.__insertInstance(n,a,s)}for(let t=this.__instances.length-1;t>=a;t--)this.__detachAndRemoveInstance(t)}__detachInstance(t){let e=this.__instances[t];const i=(0,L.r)(e.root);for(let t=0;t<e.children.length;t++){let o=e.children[t];i.appendChild(o)}return e}__attachInstance(t,e){let i=this.__instances[t];e.insertBefore(i.root,this)}__detachAndRemoveInstance(t){this.__detachInstance(t),this.__instances.splice(t,1)}__stampInstance(t,e,i){let o={};return o[this.as]=t,o[this.indexAs]=e,o[this.itemsIndexAs]=i,new this.__ctor(o)}__insertInstance(t,e,i){const o=this.__stampInstance(t,e,i);let a=this.__instances[e+1],s=a?a.children[0]:this;return(0,L.r)((0,L.r)(this).parentNode).insertBefore(o.root,s),this.__instances[e]=o,o}_showHideChildren(t){for(let e=0;e<this.__instances.length;e++)this.__instances[e]._showHideChildren(t)}__handleItemPath(t,e){let i=t.slice(6),o=i.indexOf("."),a=o<0?i:i.substring(0,o);if(a==parseInt(a,10)){let t=o<0?"":i.substring(o+1);this.__handleObservedPaths(t);let s=this.__itemsIdxToInstIdx[a],n=this.__instances[s];if(n){let i=this.as+(t?"."+t:"");n._setPendingPropertyOrPath(i,e,!1,!0),n._flushProperties()}return!0}}itemForElement(t){let e=this.modelForElement(t);return e&&e[this.as]}indexForElement(t){let e=this.modelForElement(t);return e&&e[this.indexAs]}modelForElement(t){return function(t,e){let i;for(;e;)if(i=e.__dataHost?e:e.__templatizeInstance){if(i.__dataHost==t)return i;e=i.__dataHost}else e=(0,L.r)(e).parentNode;return null}(this.template,t)}}customElements.define(nt.is,nt);var rt=i(1360),lt=i(9109);const ht=t=>class extends((0,rt.W)(t)){static get properties(){return{month:{type:Object,value:new Date,sync:!0},selectedDate:{type:Object,notify:!0,sync:!0},focusedDate:{type:Object},showWeekNumbers:{type:Boolean,value:!1},i18n:{type:Object},ignoreTaps:{type:Boolean},minDate:{type:Date,value:null,sync:!0},maxDate:{type:Date,value:null,sync:!0},disabled:{type:Boolean,reflectToAttribute:!0},_days:{type:Array},_weeks:{type:Array},_notTapping:{type:Boolean}}}static get observers(){return["__focusedDateChanged(focusedDate, _days)"]}get focusableDateElement(){return[...this.shadowRoot.querySelectorAll("[part~=date]")].find((t=>g(t.date,this.focusedDate)))}ready(){super.ready(),(0,lt.NH)(this.$.monthGrid,"tap",this._handleTap.bind(this))}_isDisabled(t,e,i){const o=new Date(0,0);o.setFullYear(t.getFullYear()),o.setMonth(t.getMonth()),o.setDate(1);const a=new Date(0,0);return a.setFullYear(t.getFullYear()),a.setMonth(t.getMonth()+1),a.setDate(0),!(e&&i&&e.getMonth()===i.getMonth()&&e.getMonth()===t.getMonth()&&i.getDate()-e.getDate()>=0||v(o,e,i)||v(a,e,i))}_getTitle(t,e){if(void 0!==t&&void 0!==e)return e.formatTitle(e.monthNames[t.getMonth()],t.getFullYear())}_onMonthGridTouchStart(){this._notTapping=!1,setTimeout((()=>{this._notTapping=!0}),300)}_dateAdd(t,e){t.setDate(t.getDate()+e)}_applyFirstDayOfWeek(t,e){if(void 0!==t&&void 0!==e)return t.slice(e).concat(t.slice(0,e))}_getWeekDayNames(t,e){if(void 0===t||void 0===e)return[];const{weekdays:i,weekdaysShort:o,firstDayOfWeek:a}=t,s=this._applyFirstDayOfWeek(o,a);return this._applyFirstDayOfWeek(i,a).map(((t,e)=>({weekDay:t,weekDayShort:s[e]})))}__focusedDateChanged(t,e){Array.isArray(e)&&e.some((e=>g(e,t)))?this.removeAttribute("aria-hidden"):this.setAttribute("aria-hidden","true")}_getDate(t){return t?t.getDate():""}_showWeekSeparator(t,e){return t&&e&&1===e.firstDayOfWeek}_isToday(t){return g(new Date,t)}_getDays(t,e){if(void 0===t||void 0===e)return[];const i=new Date(0,0);for(i.setFullYear(t.getFullYear()),i.setMonth(t.getMonth()),i.setDate(1);i.getDay()!==e.firstDayOfWeek;)this._dateAdd(i,-1);const o=[],a=i.getMonth(),s=t.getMonth();for(;i.getMonth()===s||i.getMonth()===a;)o.push(i.getMonth()===s?new Date(i.getTime()):null),this._dateAdd(i,1);return o}_getWeeks(t){return t.reduce(((t,e,i)=>(i%7==0&&t.push([]),t[t.length-1].push(e),t)),[])}_handleTap(t){this.ignoreTaps||this._notTapping||!t.target.date||t.target.hasAttribute("disabled")||(this.selectedDate=t.target.date,this.dispatchEvent(new CustomEvent("date-tap",{detail:{date:t.target.date},bubbles:!0,composed:!0})))}_preventDefault(t){t.preventDefault()}__getWeekNumber(t){return function(t){let e=t.getDay();0===e&&(e=7);const i=4-e,o=new Date(t.getTime()+24*i*3600*1e3),a=new Date(0,0);a.setFullYear(o.getFullYear());const s=o.getTime()-a.getTime(),n=Math.round(s/864e5);return Math.floor(n/7+1)}(t.reduce(((t,e)=>!t&&e?e:t)))}__getDayAriaLabel(t){if(!t)return"";let e=`${this._getDate(t)} ${this.i18n.monthNames[t.getMonth()]} ${t.getFullYear()}, ${this.i18n.weekdays[t.getDay()]}`;return this._isToday(t)&&(e+=`, ${this.i18n.today}`),e}},dt=m.iv`
761
+ `}}(0,d.M)(O),i(7894);var F=i(74933),H=i(91014);function z(t,e,i,o,a){let s;a&&(s="object"==typeof i&&null!==i,s&&(o=t.__dataTemp[e]));let n=o!==i&&(o==o||i==i);return s&&n&&(t.__dataTemp[e]=i),n}const Y=(0,H.o)((t=>class extends t{_shouldPropertyChange(t,e,i){return z(this,t,e,i,!0)}})),V=(0,H.o)((t=>class extends t{static get properties(){return{mutableData:Boolean}}_shouldPropertyChange(t,e,i){return z(this,t,e,i,this.mutableData)}}));Y._mutablePropertyChange=z;var B=i(89387),L=i(31342);let N=null;function $(){return N}$.prototype=Object.create(HTMLTemplateElement.prototype,{constructor:{value:$,writable:!0}});const W=(0,F.q)($),R=Y(W),j=(0,F.q)(class{});class q extends j{constructor(t){super(),this._configureProperties(t),this.root=this._stampTemplate(this.__dataHost);let e=[];this.children=e;for(let t=this.root.firstChild;t;t=t.nextSibling)e.push(t),t.__templatizeInstance=this;this.__templatizeOwner&&this.__templatizeOwner.__hideTemplateChildren__&&this._showHideChildren(!0);let i=this.__templatizeOptions;(t&&i.instanceProps||!i.instanceProps)&&this._enableProperties()}_configureProperties(t){if(this.__templatizeOptions.forwardHostProp)for(let t in this.__hostProps)this._setPendingProperty(t,this.__dataHost["_host_"+t]);for(let e in t)this._setPendingProperty(e,t[e])}forwardHostProp(t,e){this._setPendingPropertyOrPath(t,e,!1,!0)&&this.__dataHost._enqueueClient(this)}_addEventListenerToNode(t,e,i){if(this._methodHost&&this.__templatizeOptions.parentModel)this._methodHost._addEventListenerToNode(t,e,(t=>{t.model=this,i(t)}));else{let o=this.__dataHost.__dataHost;o&&o._addEventListenerToNode(t,e,i)}}_showHideChildren(t){!function(t,e){for(let i=0;i<e.length;i++){let o=e[i];if(Boolean(t)!=Boolean(o.__hideTemplateChildren__))if(o.nodeType===Node.TEXT_NODE)t?(o.__polymerTextContent__=o.textContent,o.textContent=""):o.textContent=o.__polymerTextContent__;else if("slot"===o.localName)if(t)o.__polymerReplaced__=document.createComment("hidden-slot"),(0,L.r)((0,L.r)(o).parentNode).replaceChild(o.__polymerReplaced__,o);else{const t=o.__polymerReplaced__;t&&(0,L.r)((0,L.r)(t).parentNode).replaceChild(o,t)}else o.style&&(t?(o.__polymerDisplay__=o.style.display,o.style.display="none"):o.style.display=o.__polymerDisplay__);o.__hideTemplateChildren__=t,o._showHideChildren&&o._showHideChildren(t)}}(t,this.children)}_setUnmanagedPropertyToNode(t,e,i){t.__hideTemplateChildren__&&t.nodeType==Node.TEXT_NODE&&"textContent"==e?t.__polymerTextContent__=i:super._setUnmanagedPropertyToNode(t,e,i)}get parentModel(){let t=this.__parentModel;if(!t){let e;t=this;do{t=t.__dataHost.__dataHost}while((e=t.__templatizeOptions)&&!e.parentModel);this.__parentModel=t}return t}dispatchEvent(t){return!0}}q.prototype.__dataHost,q.prototype.__templatizeOptions,q.prototype._methodHost,q.prototype.__templatizeOwner,q.prototype.__hostProps;const K=Y(q);function U(t){let e=t.__dataHost;return e&&e._methodHost||e}function X(t,e){return function(t,i,o){e.call(t.__templatizeOwner,i.substring(6),o[i])}}function Q(t,e){return function(t,i,o){e.call(t.__templatizeOwner,t,i,o[i])}}function J(t,e,i){if(B.XN&&!U(t))throw new Error("strictTemplatePolicy: template owner not trusted");if(i=i||{},t.__templatizeOwner)throw new Error("A <template> can only be templatized once");t.__templatizeOwner=e;let o=(e?e.constructor:q)._parseTemplate(t),a=o.templatizeInstanceClass;a||(a=function(t,e,i){let o=i.mutableData?K:q;J.mixin&&(o=J.mixin(o));let a=class extends o{};return a.prototype.__templatizeOptions=i,a.prototype._bindTemplate(t),function(t,e,i,o){let a=i.hostProps||{};for(let e in o.instanceProps){delete a[e];let i=o.notifyInstanceProp;i&&t.prototype._addPropertyEffect(e,t.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:Q(0,i)})}if(o.forwardHostProp&&e.__dataHost)for(let e in a)i.hasHostProps||(i.hasHostProps=!0),t.prototype._addPropertyEffect(e,t.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:function(t,e,i){t.__dataHost._setPendingPropertyOrPath("_host_"+e,i[e],!0,!0)}})}(a,t,e,i),a}(t,o,i),o.templatizeInstanceClass=a);const s=U(t);!function(t,e,i,o){let a=i.forwardHostProp;if(a&&e.hasHostProps){const s="template"==t.localName;let n=e.templatizeTemplateClass;if(!n){if(s){let t=i.mutableData?R:W;class o extends t{}n=e.templatizeTemplateClass=o}else{const i=t.constructor;class o extends i{}n=e.templatizeTemplateClass=o}let r=e.hostProps;for(let t in r)n.prototype._addPropertyEffect("_host_"+t,n.prototype.PROPERTY_EFFECT_TYPES.PROPAGATE,{fn:X(0,a)}),n.prototype._createNotifyingProperty("_host_"+t);B.a2&&o&&function(t,e,i){const o=i.constructor._properties,{propertyEffects:a}=t,{instanceProps:s}=e;for(let t in a)if(!(o[t]||s&&s[t])){const e=a[t];for(let i=0;i<e.length;i++){const{part:o}=e[i].info;if(!o.signature||!o.signature.static){console.warn(`Property '${t}' used in template but not declared in 'properties'; attribute will not be observed.`);break}}}}(e,i,o)}if(t.__dataProto&&Object.assign(t.__data,t.__dataProto),s)!function(t,e){N=t,Object.setPrototypeOf(t,e.prototype),new e,N=null}(t,n),t.__dataTemp={},t.__dataPending=null,t.__dataOld=null,t._enableProperties();else{Object.setPrototypeOf(t,n.prototype);const i=e.hostProps;for(let e in i)if(e="_host_"+e,e in t){const i=t[e];delete t[e],t.__data[e]=i}}}}(t,o,i,s);let n=class extends a{};return n.prototype._methodHost=s,n.prototype.__dataHost=t,n.prototype.__templatizeOwner=e,n.prototype.__hostProps=o.hostProps,n}var G=i(2224);class Z{constructor(){this._asyncModule=null,this._callback=null,this._timer=null}setConfig(t,e){this._asyncModule=t,this._callback=e,this._timer=this._asyncModule.run((()=>{this._timer=null,tt.delete(this),this._callback()}))}cancel(){this.isActive()&&(this._cancelAsync(),tt.delete(this))}_cancelAsync(){this.isActive()&&(this._asyncModule.cancel(this._timer),this._timer=null)}flush(){this.isActive()&&(this.cancel(),this._callback())}isActive(){return null!=this._timer}static debounce(t,e,i){return t instanceof Z?t._cancelAsync():t=new Z,t.setConfig(e,i),t}}let tt=new Set;const et=function(){const t=Boolean(tt.size);return tt.forEach((t=>{try{t.flush()}catch(t){setTimeout((()=>{throw t}))}})),t},it=function(){let t,e;do{t=window.ShadyDOM&&ShadyDOM.flush(),window.ShadyCSS&&window.ShadyCSS.ScopingShim&&window.ShadyCSS.ScopingShim.flush(),e=et()}while(t||e)};var ot=i(81446);let at=!1;const st=V(h.H3);class nt extends st{static get is(){return"dom-repeat"}static get template(){return null}static get properties(){return{items:{type:Array},as:{type:String,value:"item"},indexAs:{type:String,value:"index"},itemsIndexAs:{type:String,value:"itemsIndex"},sort:{type:Function,observer:"__sortChanged"},filter:{type:Function,observer:"__filterChanged"},observe:{type:String,observer:"__observeChanged"},delay:Number,renderedItemCount:{type:Number,notify:!B.dJ,readOnly:!0},initialCount:{type:Number},targetFramerate:{type:Number,value:20},_targetFrameTime:{type:Number,computed:"__computeFrameTime(targetFramerate)"},notifyDomChange:{type:Boolean},reuseChunkedInstances:{type:Boolean}}}static get observers(){return["__itemsChanged(items.*)"]}constructor(){super(),this.__instances=[],this.__renderDebouncer=null,this.__itemsIdxToInstIdx={},this.__chunkCount=null,this.__renderStartTime=null,this.__itemsArrayChanged=!1,this.__shouldMeasureChunk=!1,this.__shouldContinueChunking=!1,this.__chunkingId=0,this.__sortFn=null,this.__filterFn=null,this.__observePaths=null,this.__ctor=null,this.__isDetached=!0,this.template=null,this._templateInfo}disconnectedCallback(){super.disconnectedCallback(),this.__isDetached=!0;for(let t=0;t<this.__instances.length;t++)this.__detachInstance(t);this.__chunkingId&&cancelAnimationFrame(this.__chunkingId)}connectedCallback(){if(super.connectedCallback(),function(){if(B.nL&&!B.my){if(!at){at=!0;const t=document.createElement("style");t.textContent="dom-bind,dom-if,dom-repeat{display:none;}",document.head.appendChild(t)}return!0}return!1}()||(this.style.display="none"),this.__isDetached){this.__isDetached=!1;let t=(0,L.r)((0,L.r)(this).parentNode);for(let e=0;e<this.__instances.length;e++)this.__attachInstance(e,t);this.__chunkingId&&this.__render()}}__ensureTemplatized(){if(!this.__ctor){const t=this;let e=this.template=t._templateInfo?t:this.querySelector("template");if(!e){let t=new MutationObserver((()=>{if(!this.querySelector("template"))throw new Error("dom-repeat requires a <template> child");t.disconnect(),this.__render()}));return t.observe(this,{childList:!0}),!1}let i={};i[this.as]=!0,i[this.indexAs]=!0,i[this.itemsIndexAs]=!0,this.__ctor=J(e,this,{mutableData:this.mutableData,parentModel:!0,instanceProps:i,forwardHostProp:function(t,e){let i=this.__instances;for(let o,a=0;a<i.length&&(o=i[a]);a++)o.forwardHostProp(t,e)},notifyInstanceProp:function(t,e,i){if((0,ot.wB)(this.as,e)){let o=t[this.itemsIndexAs];e==this.as&&(this.items[o]=i);let a=(0,ot.Iu)(this.as,`${JSCompiler_renameProperty("items",this)}.${o}`,e);this.notifyPath(a,i)}}})}return!0}__getMethodHost(){return this.__dataHost._methodHost||this.__dataHost}__functionFromPropertyValue(t){if("string"==typeof t){let e=t,i=this.__getMethodHost();return function(){return i[e].apply(i,arguments)}}return t}__sortChanged(t){this.__sortFn=this.__functionFromPropertyValue(t),this.items&&this.__debounceRender(this.__render)}__filterChanged(t){this.__filterFn=this.__functionFromPropertyValue(t),this.items&&this.__debounceRender(this.__render)}__computeFrameTime(t){return Math.ceil(1e3/t)}__observeChanged(){this.__observePaths=this.observe&&this.observe.replace(".*",".").split(" ")}__handleObservedPaths(t){if(this.__sortFn||this.__filterFn)if(t){if(this.__observePaths){let e=this.__observePaths;for(let i=0;i<e.length;i++)0===t.indexOf(e[i])&&this.__debounceRender(this.__render,this.delay)}}else this.__debounceRender(this.__render,this.delay)}__itemsChanged(t){this.items&&!Array.isArray(this.items)&&console.warn("dom-repeat expected array for `items`, found",this.items),this.__handleItemPath(t.path,t.value)||("items"===t.path&&(this.__itemsArrayChanged=!0),this.__debounceRender(this.__render))}__debounceRender(t,e=0){var i;this.__renderDebouncer=Z.debounce(this.__renderDebouncer,e>0?G.Wc.after(e):G.YA,t.bind(this)),i=this.__renderDebouncer,tt.add(i)}render(){this.__debounceRender(this.__render),it()}__render(){if(!this.__ensureTemplatized())return;let t=this.items||[];const e=this.__sortAndFilterItems(t),i=this.__calculateLimit(e.length);this.__updateInstances(t,i,e),this.initialCount&&(this.__shouldMeasureChunk||this.__shouldContinueChunking)&&(cancelAnimationFrame(this.__chunkingId),this.__chunkingId=requestAnimationFrame((()=>{this.__chunkingId=null,this.__continueChunking()}))),this._setRenderedItemCount(this.__instances.length),B.dJ&&!this.notifyDomChange||this.dispatchEvent(new CustomEvent("dom-change",{bubbles:!0,composed:!0}))}__sortAndFilterItems(t){let e=new Array(t.length);for(let i=0;i<t.length;i++)e[i]=i;return this.__filterFn&&(e=e.filter(((e,i,o)=>this.__filterFn(t[e],i,o)))),this.__sortFn&&e.sort(((e,i)=>this.__sortFn(t[e],t[i]))),e}__calculateLimit(t){let e=t;const i=this.__instances.length;if(this.initialCount){let o;!this.__chunkCount||this.__itemsArrayChanged&&!this.reuseChunkedInstances?(e=Math.min(t,this.initialCount),o=Math.max(e-i,0),this.__chunkCount=o||1):(o=Math.min(Math.max(t-i,0),this.__chunkCount),e=Math.min(i+o,t)),this.__shouldMeasureChunk=o===this.__chunkCount,this.__shouldContinueChunking=e<t,this.__renderStartTime=performance.now()}return this.__itemsArrayChanged=!1,e}__continueChunking(){if(this.__shouldMeasureChunk){const t=performance.now()-this.__renderStartTime,e=this._targetFrameTime/t;this.__chunkCount=Math.round(this.__chunkCount*e)||1}this.__shouldContinueChunking&&this.__debounceRender(this.__render)}__updateInstances(t,e,i){const o=this.__itemsIdxToInstIdx={};let a;for(a=0;a<e;a++){let e=this.__instances[a],s=i[a],n=t[s];o[s]=a,e?(e._setPendingProperty(this.as,n),e._setPendingProperty(this.indexAs,a),e._setPendingProperty(this.itemsIndexAs,s),e._flushProperties()):this.__insertInstance(n,a,s)}for(let t=this.__instances.length-1;t>=a;t--)this.__detachAndRemoveInstance(t)}__detachInstance(t){let e=this.__instances[t];const i=(0,L.r)(e.root);for(let t=0;t<e.children.length;t++){let o=e.children[t];i.appendChild(o)}return e}__attachInstance(t,e){let i=this.__instances[t];e.insertBefore(i.root,this)}__detachAndRemoveInstance(t){this.__detachInstance(t),this.__instances.splice(t,1)}__stampInstance(t,e,i){let o={};return o[this.as]=t,o[this.indexAs]=e,o[this.itemsIndexAs]=i,new this.__ctor(o)}__insertInstance(t,e,i){const o=this.__stampInstance(t,e,i);let a=this.__instances[e+1],s=a?a.children[0]:this;return(0,L.r)((0,L.r)(this).parentNode).insertBefore(o.root,s),this.__instances[e]=o,o}_showHideChildren(t){for(let e=0;e<this.__instances.length;e++)this.__instances[e]._showHideChildren(t)}__handleItemPath(t,e){let i=t.slice(6),o=i.indexOf("."),a=o<0?i:i.substring(0,o);if(a==parseInt(a,10)){let t=o<0?"":i.substring(o+1);this.__handleObservedPaths(t);let s=this.__itemsIdxToInstIdx[a],n=this.__instances[s];if(n){let i=this.as+(t?"."+t:"");n._setPendingPropertyOrPath(i,e,!1,!0),n._flushProperties()}return!0}}itemForElement(t){let e=this.modelForElement(t);return e&&e[this.as]}indexForElement(t){let e=this.modelForElement(t);return e&&e[this.indexAs]}modelForElement(t){return function(t,e){let i;for(;e;)if(i=e.__dataHost?e:e.__templatizeInstance){if(i.__dataHost==t)return i;e=i.__dataHost}else e=(0,L.r)(e).parentNode;return null}(this.template,t)}}customElements.define(nt.is,nt);var rt=i(21360),lt=i(99109);const ht=t=>class extends((0,rt.W)(t)){static get properties(){return{month:{type:Object,value:new Date,sync:!0},selectedDate:{type:Object,notify:!0,sync:!0},focusedDate:{type:Object},showWeekNumbers:{type:Boolean,value:!1},i18n:{type:Object},ignoreTaps:{type:Boolean},minDate:{type:Date,value:null,sync:!0},maxDate:{type:Date,value:null,sync:!0},disabled:{type:Boolean,reflectToAttribute:!0},_days:{type:Array},_weeks:{type:Array},_notTapping:{type:Boolean}}}static get observers(){return["__focusedDateChanged(focusedDate, _days)"]}get focusableDateElement(){return[...this.shadowRoot.querySelectorAll("[part~=date]")].find((t=>g(t.date,this.focusedDate)))}ready(){super.ready(),(0,lt.NH)(this.$.monthGrid,"tap",this._handleTap.bind(this))}_isDisabled(t,e,i){const o=new Date(0,0);o.setFullYear(t.getFullYear()),o.setMonth(t.getMonth()),o.setDate(1);const a=new Date(0,0);return a.setFullYear(t.getFullYear()),a.setMonth(t.getMonth()+1),a.setDate(0),!(e&&i&&e.getMonth()===i.getMonth()&&e.getMonth()===t.getMonth()&&i.getDate()-e.getDate()>=0||v(o,e,i)||v(a,e,i))}_getTitle(t,e){if(void 0!==t&&void 0!==e)return e.formatTitle(e.monthNames[t.getMonth()],t.getFullYear())}_onMonthGridTouchStart(){this._notTapping=!1,setTimeout((()=>{this._notTapping=!0}),300)}_dateAdd(t,e){t.setDate(t.getDate()+e)}_applyFirstDayOfWeek(t,e){if(void 0!==t&&void 0!==e)return t.slice(e).concat(t.slice(0,e))}_getWeekDayNames(t,e){if(void 0===t||void 0===e)return[];const{weekdays:i,weekdaysShort:o,firstDayOfWeek:a}=t,s=this._applyFirstDayOfWeek(o,a);return this._applyFirstDayOfWeek(i,a).map(((t,e)=>({weekDay:t,weekDayShort:s[e]})))}__focusedDateChanged(t,e){Array.isArray(e)&&e.some((e=>g(e,t)))?this.removeAttribute("aria-hidden"):this.setAttribute("aria-hidden","true")}_getDate(t){return t?t.getDate():""}_showWeekSeparator(t,e){return t&&e&&1===e.firstDayOfWeek}_isToday(t){return g(new Date,t)}_getDays(t,e){if(void 0===t||void 0===e)return[];const i=new Date(0,0);for(i.setFullYear(t.getFullYear()),i.setMonth(t.getMonth()),i.setDate(1);i.getDay()!==e.firstDayOfWeek;)this._dateAdd(i,-1);const o=[],a=i.getMonth(),s=t.getMonth();for(;i.getMonth()===s||i.getMonth()===a;)o.push(i.getMonth()===s?new Date(i.getTime()):null),this._dateAdd(i,1);return o}_getWeeks(t){return t.reduce(((t,e,i)=>(i%7==0&&t.push([]),t[t.length-1].push(e),t)),[])}_handleTap(t){this.ignoreTaps||this._notTapping||!t.target.date||t.target.hasAttribute("disabled")||(this.selectedDate=t.target.date,this.dispatchEvent(new CustomEvent("date-tap",{detail:{date:t.target.date},bubbles:!0,composed:!0})))}_preventDefault(t){t.preventDefault()}__getWeekNumber(t){return function(t){let e=t.getDay();0===e&&(e=7);const i=4-e,o=new Date(t.getTime()+24*i*3600*1e3),a=new Date(0,0);a.setFullYear(o.getFullYear());const s=o.getTime()-a.getTime(),n=Math.round(s/864e5);return Math.floor(n/7+1)}(t.reduce(((t,e)=>!t&&e?e:t)))}__getDayAriaLabel(t){if(!t)return"";let e=`${this._getDate(t)} ${this.i18n.monthNames[t.getMonth()]} ${t.getFullYear()}, ${this.i18n.weekdays[t.getDay()]}`;return this._isToday(t)&&(e+=`, ${this.i18n.today}`),e}},dt=m.iv`
762
762
  :host {
763
763
  display: block;
764
764
  }
@@ -856,7 +856,7 @@
856
856
  </template>
857
857
  </tbody>
858
858
  </table>
859
- `}static get is(){return"vaadin-month-calendar"}static get properties(){return{_days:{type:Array,computed:"_getDays(month, i18n, minDate, maxDate)"},_weeks:{type:Array,computed:"_getWeeks(_days)"},disabled:{type:Boolean,reflectToAttribute:!0,computed:"_isDisabled(month, minDate, maxDate)"}}}static get observers(){return["_showWeekNumbersChanged(showWeekNumbers, i18n)"]}_showWeekNumbersChanged(t,e){t&&e&&1===e.firstDayOfWeek?this.setAttribute("week-numbers",""):this.removeAttribute("week-numbers")}__getDatePart(t,e,i,o,a){const s=["date"];return this.__isDayDisabled(t,o,a)&&s.push("disabled"),this.__isDayFocused(t,e)&&s.push("focused"),this.__isDaySelected(t,i)&&s.push("selected"),this._isToday(t)&&s.push("today"),s.join(" ")}__isDayFocused(t,e){return g(t,e)}__isDaySelected(t,e){return g(t,e)}__getDayAriaSelected(t,e){if(this.__isDaySelected(t,e))return"true"}__isDayDisabled(t,e,i){return!v(t,e,i)}__getDayAriaDisabled(t,e,i){if(void 0!==t&&void 0!==e&&void 0!==i)return this.__isDayDisabled(t,e,i)?"true":void 0}__getDayTabindex(t,e){return this.__isDayFocused(t,e)?"0":"-1"}}(0,d.M)(ct);var ut=i(6155),_t=i(2223);class pt{constructor(t,e){this.query=t,this.callback=e,this._boundQueryHandler=this._queryHandler.bind(this)}hostConnected(){this._removeListener(),this._mediaQuery=window.matchMedia(this.query),this._addListener(),this._queryHandler(this._mediaQuery)}hostDisconnected(){this._removeListener()}_addListener(){this._mediaQuery&&this._mediaQuery.addListener(this._boundQueryHandler)}_removeListener(){this._mediaQuery&&this._mediaQuery.removeListener(this._boundQueryHandler),this._mediaQuery=null}_queryHandler(t){"function"==typeof this.callback&&this.callback(t.matches)}}var mt=i(9229);const ft=t=>class extends t{static get properties(){return{scrollDuration:{type:Number,value:300},selectedDate:{type:Object,value:null,sync:!0},focusedDate:{type:Object,notify:!0,observer:"_focusedDateChanged",sync:!0},_focusedMonthDate:Number,initialPosition:{type:Object,observer:"_initialPositionChanged"},_originDate:{type:Object,value:new Date},_visibleMonthIndex:Number,_desktopMode:{type:Boolean,observer:"_desktopModeChanged"},_desktopMediaQuery:{type:String,value:"(min-width: 375px)"},_translateX:{observer:"_translateXChanged"},_yearScrollerWidth:{value:50},i18n:{type:Object},showWeekNumbers:{type:Boolean,value:!1},_ignoreTaps:Boolean,_notTapping:Boolean,minDate:{type:Object,sync:!0},maxDate:{type:Object,sync:!0},label:String,_cancelButton:{type:Object},_todayButton:{type:Object},calendars:{type:Array,value:()=>[]},years:{type:Array,value:()=>[]}}}static get observers(){return["__updateCalendars(calendars, i18n, minDate, maxDate, selectedDate, focusedDate, showWeekNumbers, _ignoreTaps, _theme)","__updateCancelButton(_cancelButton, i18n)","__updateTodayButton(_todayButton, i18n, minDate, maxDate)","__updateYears(years, selectedDate, _theme)"]}get __useSubMonthScrolling(){return this._monthScroller.clientHeight<this._monthScroller.itemHeight+this._monthScroller.bufferOffset}get focusableDateElement(){return this.calendars.map((t=>t.focusableDateElement)).find(Boolean)}_addListeners(){(0,lt.BP)(this.$.scrollers,"pan-y"),(0,lt.NH)(this.$.scrollers,"track",this._track.bind(this)),(0,lt.NH)(this.shadowRoot.querySelector('[part="clear-button"]'),"tap",this._clear.bind(this)),(0,lt.NH)(this.shadowRoot.querySelector('[part="toggle-button"]'),"tap",this._cancel.bind(this)),(0,lt.NH)(this.shadowRoot.querySelector('[part="years-toggle-button"]'),"tap",this._toggleYearScroller.bind(this))}_initControllers(){this.addController(new pt(this._desktopMediaQuery,(t=>{this._desktopMode=t}))),this.addController(new mt.n(this,"today-button","vaadin-button",{observe:!1,initializer:t=>{t.setAttribute("theme","tertiary"),t.addEventListener("keydown",(t=>this.__onTodayButtonKeyDown(t))),(0,lt.NH)(t,"tap",this._onTodayTap.bind(this)),this._todayButton=t}})),this.addController(new mt.n(this,"cancel-button","vaadin-button",{observe:!1,initializer:t=>{t.setAttribute("theme","tertiary"),t.addEventListener("keydown",(t=>this.__onCancelButtonKeyDown(t))),(0,lt.NH)(t,"tap",this._cancel.bind(this)),this._cancelButton=t}})),this.__initMonthScroller(),this.__initYearScroller()}reset(){this._closeYearScroller(),this._toggleAnimateClass(!0)}focusCancel(){this._cancelButton.focus()}scrollToDate(t,e){const i=this.__useSubMonthScrolling?this._calculateWeekScrollOffset(t):0;this._scrollToPosition(this._differenceInMonths(t,this._originDate)+i,e),this._monthScroller.forceUpdate()}__initMonthScroller(){this.addController(new mt.n(this,"months","vaadin-date-picker-month-scroller",{observe:!1,initializer:t=>{t.addEventListener("custom-scroll",(()=>{this._onMonthScroll()})),t.addEventListener("touchstart",(()=>{this._onMonthScrollTouchStart()})),t.addEventListener("keydown",(t=>{this.__onMonthCalendarKeyDown(t)})),t.addEventListener("init-done",(()=>{const t=[...this.querySelectorAll("vaadin-month-calendar")];t.forEach((t=>{t.addEventListener("selected-date-changed",(t=>{this.selectedDate=t.detail.value}))})),this.calendars=t})),this._monthScroller=t}}))}__initYearScroller(){this.addController(new mt.n(this,"years","vaadin-date-picker-year-scroller",{observe:!1,initializer:t=>{t.setAttribute("aria-hidden","true"),(0,lt.NH)(t,"tap",(t=>{this._onYearTap(t)})),t.addEventListener("custom-scroll",(()=>{this._onYearScroll()})),t.addEventListener("touchstart",(()=>{this._onYearScrollTouchStart()})),t.addEventListener("init-done",(()=>{this.years=[...this.querySelectorAll("vaadin-date-picker-year")]})),this._yearScroller=t}}))}__updateCancelButton(t,e){t&&(t.textContent=e&&e.cancel)}__updateTodayButton(t,e,i,o){t&&(t.textContent=e&&e.today,t.disabled=!this._isTodayAllowed(i,o))}__updateCalendars(t,e,i,o,a,s,n,r,l){t&&t.length&&t.forEach((t=>{t.i18n=e,t.minDate=i,t.maxDate=o,t.focusedDate=s,t.selectedDate=a,t.showWeekNumbers=n,t.ignoreTaps=r,l?t.setAttribute("theme",l):t.removeAttribute("theme")}))}__updateYears(t,e,i){t&&t.length&&t.forEach((t=>{t.selectedDate=e,i?t.setAttribute("theme",i):t.removeAttribute("theme")}))}_selectDate(t){this.selectedDate=t,this.dispatchEvent(new CustomEvent("date-selected",{detail:{date:t},bubbles:!0,composed:!0}))}_desktopModeChanged(t){this.toggleAttribute("desktop",t)}_focusedDateChanged(t){this.revealDate(t)}revealDate(t,e=!0){if(!t)return;const i=this._differenceInMonths(t,this._originDate);if(this.__useSubMonthScrolling){const o=this._calculateWeekScrollOffset(t);return void this._scrollToPosition(i+o,e)}const o=this._monthScroller.position>i,a=Math.max(this._monthScroller.itemHeight,this._monthScroller.clientHeight-2*this._monthScroller.bufferOffset)/this._monthScroller.itemHeight,s=this._monthScroller.position+a-1<i;o?this._scrollToPosition(i,e):s&&this._scrollToPosition(i-a+1,e)}_calculateWeekScrollOffset(t){const e=new Date(0,0);e.setFullYear(t.getFullYear()),e.setMonth(t.getMonth()),e.setDate(1);let i=0;for(;e.getDate()<t.getDate();)e.setDate(e.getDate()+1),e.getDay()===this.i18n.firstDayOfWeek&&(i+=1);return i/6}_initialPositionChanged(t){this._monthScroller&&this._yearScroller&&(this._monthScroller.active=!0,this._yearScroller.active=!0),this.scrollToDate(t)}_repositionYearScroller(){const t=this._monthScroller.position;this._visibleMonthIndex=Math.floor(t),this._yearScroller.position=(t+this._originDate.getMonth())/12}_repositionMonthScroller(){this._monthScroller.position=12*this._yearScroller.position-this._originDate.getMonth(),this._visibleMonthIndex=Math.floor(this._monthScroller.position)}_onMonthScroll(){this._repositionYearScroller(),this._doIgnoreTaps()}_onYearScroll(){this._repositionMonthScroller(),this._doIgnoreTaps()}_onYearScrollTouchStart(){this._notTapping=!1,setTimeout((()=>{this._notTapping=!0}),300),this._repositionMonthScroller()}_onMonthScrollTouchStart(){this._repositionYearScroller()}_doIgnoreTaps(){this._ignoreTaps=!0,this._debouncer=S.dx.debounce(this._debouncer,x.Wc.after(300),(()=>{this._ignoreTaps=!1}))}_formatDisplayed(t,e,i){return t&&e&&"function"==typeof e.formatDate?e.formatDate(D(t)):i}_onTodayTap(){const t=new Date;Math.abs(this._monthScroller.position-this._differenceInMonths(t,this._originDate))<.001?(this._selectDate(t),this._close()):this._scrollToCurrentMonth()}_scrollToCurrentMonth(){this.focusedDate&&(this.focusedDate=new Date),this.scrollToDate(new Date,!0)}_onYearTap(t){if(!this._ignoreTaps&&!this._notTapping){const e=(t.detail.y-(this._yearScroller.getBoundingClientRect().top+this._yearScroller.clientHeight/2))/this._yearScroller.itemHeight;this._scrollToPosition(this._monthScroller.position+12*e,!0)}}_scrollToPosition(t,e){if(void 0!==this._targetPosition)return void(this._targetPosition=t);if(!e)return this._monthScroller.position=t,this._targetPosition=void 0,this._repositionYearScroller(),void this.__tryFocusDate();let i;this._targetPosition=t,this._revealPromise=new Promise((t=>{i=t}));let o=0;const a=this._monthScroller.position,s=t=>{o||(o=t);const e=t-o;if(e<this.scrollDuration){const t=(n=e,r=a,l=this._targetPosition-a,(n/=this.scrollDuration/2)<1?l/2*n*n+r:-l/2*((n-=1)*(n-2)-1)+r);this._monthScroller.position=t,window.requestAnimationFrame(s)}else this.dispatchEvent(new CustomEvent("scroll-animation-finished",{bubbles:!0,composed:!0,detail:{position:this._targetPosition,oldPosition:a}})),this._monthScroller.position=this._targetPosition,this._targetPosition=void 0,i(),this._revealPromise=void 0;var n,r,l;setTimeout(this._repositionYearScroller.bind(this),1)};window.requestAnimationFrame(s)}_limit(t,e){return Math.min(e.max,Math.max(e.min,t))}_handleTrack(t){if(Math.abs(t.detail.dx)<10||Math.abs(t.detail.ddy)>10)return;Math.abs(t.detail.ddx)>this._yearScrollerWidth/3&&this._toggleAnimateClass(!0);const e=this._translateX+t.detail.ddx;this._translateX=this._limit(e,{min:0,max:this._yearScrollerWidth})}_track(t){if(!this._desktopMode)switch(t.detail.state){case"start":this._toggleAnimateClass(!1);break;case"track":this._handleTrack(t);break;case"end":this._toggleAnimateClass(!0),this._translateX>=this._yearScrollerWidth/2?this._closeYearScroller():this._openYearScroller()}}_toggleAnimateClass(t){t?this.classList.add("animate"):this.classList.remove("animate")}_toggleYearScroller(){this._isYearScrollerVisible()?this._closeYearScroller():this._openYearScroller()}_openYearScroller(){this._translateX=0,this.setAttribute("years-visible","")}_closeYearScroller(){this.removeAttribute("years-visible"),this._translateX=this._yearScrollerWidth}_isYearScrollerVisible(){return this._translateX<this._yearScrollerWidth/2}_translateXChanged(t){this._desktopMode||(this._monthScroller.style.transform=`translateX(${t-this._yearScrollerWidth}px)`,this._yearScroller.style.transform=`translateX(${t}px)`)}_yearAfterXMonths(t){return w(t).getFullYear()}_differenceInMonths(t,e){return 12*(t.getFullYear()-e.getFullYear())-e.getMonth()+t.getMonth()}_clear(){this._selectDate("")}_close(){this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}_cancel(){this.focusedDate=this.selectedDate,this._close()}_preventDefault(t){t.preventDefault()}__toggleDate(t){g(t,this.selectedDate)?(this._clear(),this.focusedDate=t):this._selectDate(t)}__onMonthCalendarKeyDown(t){let e=!1;switch(t.key){case"ArrowDown":this._moveFocusByDays(7),e=!0;break;case"ArrowUp":this._moveFocusByDays(-7),e=!0;break;case"ArrowRight":this._moveFocusByDays(this.__isRTL?-1:1),e=!0;break;case"ArrowLeft":this._moveFocusByDays(this.__isRTL?1:-1),e=!0;break;case"Enter":this._selectDate(this.focusedDate),this._close(),e=!0;break;case" ":this.__toggleDate(this.focusedDate),e=!0;break;case"Home":this._moveFocusInsideMonth(this.focusedDate,"minDate"),e=!0;break;case"End":this._moveFocusInsideMonth(this.focusedDate,"maxDate"),e=!0;break;case"PageDown":this._moveFocusByMonths(t.shiftKey?12:1),e=!0;break;case"PageUp":this._moveFocusByMonths(t.shiftKey?-12:-1),e=!0;break;case"Tab":this._onTabKeyDown(t,"calendar")}e&&(t.preventDefault(),t.stopPropagation())}_onTabKeyDown(t,e){switch(t.stopPropagation(),e){case"calendar":t.shiftKey&&(t.preventDefault(),this.hasAttribute("fullscreen")?this.focusCancel():this.__focusInput());break;case"today":t.shiftKey&&(t.preventDefault(),this.focusDateElement());break;case"cancel":t.shiftKey||(t.preventDefault(),this.hasAttribute("fullscreen")?this.focusDateElement():this.__focusInput())}}__onTodayButtonKeyDown(t){"Tab"===t.key&&this._onTabKeyDown(t,"today")}__onCancelButtonKeyDown(t){"Tab"===t.key&&this._onTabKeyDown(t,"cancel")}__focusInput(){this.dispatchEvent(new CustomEvent("focus-input",{bubbles:!0,composed:!0}))}__tryFocusDate(){if(this.__pendingDateFocus){const t=this.focusableDateElement;t&&g(t.date,this.__pendingDateFocus)&&(delete this.__pendingDateFocus,t.focus())}}async focusDate(t,e){const i=t||this.selectedDate||this.initialPosition||new Date;this.focusedDate=i,e||(this._focusedMonthDate=i.getDate()),await this.focusDateElement(!1)}async focusDateElement(t=!0){this.__pendingDateFocus=this.focusedDate,this.calendars.length||await new Promise((t=>{(0,_t.T8)(this,(()=>{it(),t()}))})),t&&this.revealDate(this.focusedDate),this._revealPromise&&await this._revealPromise,this.__tryFocusDate()}_focusClosestDate(t){this.focusDate(b(t,[this.minDate,this.maxDate]))}_focusAllowedDate(t,e,i){this._dateAllowed(t)?this.focusDate(t,i):this._dateAllowed(this.focusedDate)?e>0?this.focusDate(this.maxDate):this.focusDate(this.minDate):this._focusClosestDate(this.focusedDate)}_getDateDiff(t,e){const i=new Date(0,0);return i.setFullYear(this.focusedDate.getFullYear()),i.setMonth(this.focusedDate.getMonth()+t),e&&i.setDate(this.focusedDate.getDate()+e),i}_moveFocusByDays(t){const e=this._getDateDiff(0,t);this._focusAllowedDate(e,t,!1)}_moveFocusByMonths(t){const e=this._getDateDiff(t),i=e.getMonth();this._focusedMonthDate||(this._focusedMonthDate=this.focusedDate.getDate()),e.setDate(this._focusedMonthDate),e.getMonth()!==i&&e.setDate(0),this._focusAllowedDate(e,t,!0)}_moveFocusInsideMonth(t,e){const i=new Date(0,0);i.setFullYear(t.getFullYear()),"minDate"===e?(i.setMonth(t.getMonth()),i.setDate(1)):(i.setMonth(t.getMonth()+1),i.setDate(0)),this._dateAllowed(i)?this.focusDate(i):this._dateAllowed(t)?this.focusDate(this[e]):this._focusClosestDate(t)}_dateAllowed(t,e=this.minDate,i=this.maxDate){return(!e||t>=e)&&(!i||t<=i)}_isTodayAllowed(t,e){const i=new Date,o=new Date(0,0);return o.setFullYear(i.getFullYear()),o.setMonth(i.getMonth()),o.setDate(i.getDate()),this._dateAllowed(o,t,e)}},yt=m.iv`
859
+ `}static get is(){return"vaadin-month-calendar"}static get properties(){return{_days:{type:Array,computed:"_getDays(month, i18n, minDate, maxDate)"},_weeks:{type:Array,computed:"_getWeeks(_days)"},disabled:{type:Boolean,reflectToAttribute:!0,computed:"_isDisabled(month, minDate, maxDate)"}}}static get observers(){return["_showWeekNumbersChanged(showWeekNumbers, i18n)"]}_showWeekNumbersChanged(t,e){t&&e&&1===e.firstDayOfWeek?this.setAttribute("week-numbers",""):this.removeAttribute("week-numbers")}__getDatePart(t,e,i,o,a){const s=["date"];return this.__isDayDisabled(t,o,a)&&s.push("disabled"),this.__isDayFocused(t,e)&&s.push("focused"),this.__isDaySelected(t,i)&&s.push("selected"),this._isToday(t)&&s.push("today"),s.join(" ")}__isDayFocused(t,e){return g(t,e)}__isDaySelected(t,e){return g(t,e)}__getDayAriaSelected(t,e){if(this.__isDaySelected(t,e))return"true"}__isDayDisabled(t,e,i){return!v(t,e,i)}__getDayAriaDisabled(t,e,i){if(void 0!==t&&void 0!==e&&void 0!==i)return this.__isDayDisabled(t,e,i)?"true":void 0}__getDayTabindex(t,e){return this.__isDayFocused(t,e)?"0":"-1"}}(0,d.M)(ct);var ut=i(16155),_t=i(52223);class pt{constructor(t,e){this.query=t,this.callback=e,this._boundQueryHandler=this._queryHandler.bind(this)}hostConnected(){this._removeListener(),this._mediaQuery=window.matchMedia(this.query),this._addListener(),this._queryHandler(this._mediaQuery)}hostDisconnected(){this._removeListener()}_addListener(){this._mediaQuery&&this._mediaQuery.addListener(this._boundQueryHandler)}_removeListener(){this._mediaQuery&&this._mediaQuery.removeListener(this._boundQueryHandler),this._mediaQuery=null}_queryHandler(t){"function"==typeof this.callback&&this.callback(t.matches)}}var mt=i(9229);const ft=t=>class extends t{static get properties(){return{scrollDuration:{type:Number,value:300},selectedDate:{type:Object,value:null,sync:!0},focusedDate:{type:Object,notify:!0,observer:"_focusedDateChanged",sync:!0},_focusedMonthDate:Number,initialPosition:{type:Object,observer:"_initialPositionChanged"},_originDate:{type:Object,value:new Date},_visibleMonthIndex:Number,_desktopMode:{type:Boolean,observer:"_desktopModeChanged"},_desktopMediaQuery:{type:String,value:"(min-width: 375px)"},_translateX:{observer:"_translateXChanged"},_yearScrollerWidth:{value:50},i18n:{type:Object},showWeekNumbers:{type:Boolean,value:!1},_ignoreTaps:Boolean,_notTapping:Boolean,minDate:{type:Object,sync:!0},maxDate:{type:Object,sync:!0},label:String,_cancelButton:{type:Object},_todayButton:{type:Object},calendars:{type:Array,value:()=>[]},years:{type:Array,value:()=>[]}}}static get observers(){return["__updateCalendars(calendars, i18n, minDate, maxDate, selectedDate, focusedDate, showWeekNumbers, _ignoreTaps, _theme)","__updateCancelButton(_cancelButton, i18n)","__updateTodayButton(_todayButton, i18n, minDate, maxDate)","__updateYears(years, selectedDate, _theme)"]}get __useSubMonthScrolling(){return this._monthScroller.clientHeight<this._monthScroller.itemHeight+this._monthScroller.bufferOffset}get focusableDateElement(){return this.calendars.map((t=>t.focusableDateElement)).find(Boolean)}_addListeners(){(0,lt.BP)(this.$.scrollers,"pan-y"),(0,lt.NH)(this.$.scrollers,"track",this._track.bind(this)),(0,lt.NH)(this.shadowRoot.querySelector('[part="clear-button"]'),"tap",this._clear.bind(this)),(0,lt.NH)(this.shadowRoot.querySelector('[part="toggle-button"]'),"tap",this._cancel.bind(this)),(0,lt.NH)(this.shadowRoot.querySelector('[part="years-toggle-button"]'),"tap",this._toggleYearScroller.bind(this))}_initControllers(){this.addController(new pt(this._desktopMediaQuery,(t=>{this._desktopMode=t}))),this.addController(new mt.n(this,"today-button","vaadin-button",{observe:!1,initializer:t=>{t.setAttribute("theme","tertiary"),t.addEventListener("keydown",(t=>this.__onTodayButtonKeyDown(t))),(0,lt.NH)(t,"tap",this._onTodayTap.bind(this)),this._todayButton=t}})),this.addController(new mt.n(this,"cancel-button","vaadin-button",{observe:!1,initializer:t=>{t.setAttribute("theme","tertiary"),t.addEventListener("keydown",(t=>this.__onCancelButtonKeyDown(t))),(0,lt.NH)(t,"tap",this._cancel.bind(this)),this._cancelButton=t}})),this.__initMonthScroller(),this.__initYearScroller()}reset(){this._closeYearScroller(),this._toggleAnimateClass(!0)}focusCancel(){this._cancelButton.focus()}scrollToDate(t,e){const i=this.__useSubMonthScrolling?this._calculateWeekScrollOffset(t):0;this._scrollToPosition(this._differenceInMonths(t,this._originDate)+i,e),this._monthScroller.forceUpdate()}__initMonthScroller(){this.addController(new mt.n(this,"months","vaadin-date-picker-month-scroller",{observe:!1,initializer:t=>{t.addEventListener("custom-scroll",(()=>{this._onMonthScroll()})),t.addEventListener("touchstart",(()=>{this._onMonthScrollTouchStart()})),t.addEventListener("keydown",(t=>{this.__onMonthCalendarKeyDown(t)})),t.addEventListener("init-done",(()=>{const t=[...this.querySelectorAll("vaadin-month-calendar")];t.forEach((t=>{t.addEventListener("selected-date-changed",(t=>{this.selectedDate=t.detail.value}))})),this.calendars=t})),this._monthScroller=t}}))}__initYearScroller(){this.addController(new mt.n(this,"years","vaadin-date-picker-year-scroller",{observe:!1,initializer:t=>{t.setAttribute("aria-hidden","true"),(0,lt.NH)(t,"tap",(t=>{this._onYearTap(t)})),t.addEventListener("custom-scroll",(()=>{this._onYearScroll()})),t.addEventListener("touchstart",(()=>{this._onYearScrollTouchStart()})),t.addEventListener("init-done",(()=>{this.years=[...this.querySelectorAll("vaadin-date-picker-year")]})),this._yearScroller=t}}))}__updateCancelButton(t,e){t&&(t.textContent=e&&e.cancel)}__updateTodayButton(t,e,i,o){t&&(t.textContent=e&&e.today,t.disabled=!this._isTodayAllowed(i,o))}__updateCalendars(t,e,i,o,a,s,n,r,l){t&&t.length&&t.forEach((t=>{t.i18n=e,t.minDate=i,t.maxDate=o,t.focusedDate=s,t.selectedDate=a,t.showWeekNumbers=n,t.ignoreTaps=r,l?t.setAttribute("theme",l):t.removeAttribute("theme")}))}__updateYears(t,e,i){t&&t.length&&t.forEach((t=>{t.selectedDate=e,i?t.setAttribute("theme",i):t.removeAttribute("theme")}))}_selectDate(t){this.selectedDate=t,this.dispatchEvent(new CustomEvent("date-selected",{detail:{date:t},bubbles:!0,composed:!0}))}_desktopModeChanged(t){this.toggleAttribute("desktop",t)}_focusedDateChanged(t){this.revealDate(t)}revealDate(t,e=!0){if(!t)return;const i=this._differenceInMonths(t,this._originDate);if(this.__useSubMonthScrolling){const o=this._calculateWeekScrollOffset(t);return void this._scrollToPosition(i+o,e)}const o=this._monthScroller.position>i,a=Math.max(this._monthScroller.itemHeight,this._monthScroller.clientHeight-2*this._monthScroller.bufferOffset)/this._monthScroller.itemHeight,s=this._monthScroller.position+a-1<i;o?this._scrollToPosition(i,e):s&&this._scrollToPosition(i-a+1,e)}_calculateWeekScrollOffset(t){const e=new Date(0,0);e.setFullYear(t.getFullYear()),e.setMonth(t.getMonth()),e.setDate(1);let i=0;for(;e.getDate()<t.getDate();)e.setDate(e.getDate()+1),e.getDay()===this.i18n.firstDayOfWeek&&(i+=1);return i/6}_initialPositionChanged(t){this._monthScroller&&this._yearScroller&&(this._monthScroller.active=!0,this._yearScroller.active=!0),this.scrollToDate(t)}_repositionYearScroller(){const t=this._monthScroller.position;this._visibleMonthIndex=Math.floor(t),this._yearScroller.position=(t+this._originDate.getMonth())/12}_repositionMonthScroller(){this._monthScroller.position=12*this._yearScroller.position-this._originDate.getMonth(),this._visibleMonthIndex=Math.floor(this._monthScroller.position)}_onMonthScroll(){this._repositionYearScroller(),this._doIgnoreTaps()}_onYearScroll(){this._repositionMonthScroller(),this._doIgnoreTaps()}_onYearScrollTouchStart(){this._notTapping=!1,setTimeout((()=>{this._notTapping=!0}),300),this._repositionMonthScroller()}_onMonthScrollTouchStart(){this._repositionYearScroller()}_doIgnoreTaps(){this._ignoreTaps=!0,this._debouncer=S.dx.debounce(this._debouncer,x.Wc.after(300),(()=>{this._ignoreTaps=!1}))}_formatDisplayed(t,e,i){return t&&e&&"function"==typeof e.formatDate?e.formatDate(D(t)):i}_onTodayTap(){const t=new Date;Math.abs(this._monthScroller.position-this._differenceInMonths(t,this._originDate))<.001?(this._selectDate(t),this._close()):this._scrollToCurrentMonth()}_scrollToCurrentMonth(){this.focusedDate&&(this.focusedDate=new Date),this.scrollToDate(new Date,!0)}_onYearTap(t){if(!this._ignoreTaps&&!this._notTapping){const e=(t.detail.y-(this._yearScroller.getBoundingClientRect().top+this._yearScroller.clientHeight/2))/this._yearScroller.itemHeight;this._scrollToPosition(this._monthScroller.position+12*e,!0)}}_scrollToPosition(t,e){if(void 0!==this._targetPosition)return void(this._targetPosition=t);if(!e)return this._monthScroller.position=t,this._targetPosition=void 0,this._repositionYearScroller(),void this.__tryFocusDate();let i;this._targetPosition=t,this._revealPromise=new Promise((t=>{i=t}));let o=0;const a=this._monthScroller.position,s=t=>{o||(o=t);const e=t-o;if(e<this.scrollDuration){const t=(n=e,r=a,l=this._targetPosition-a,(n/=this.scrollDuration/2)<1?l/2*n*n+r:-l/2*((n-=1)*(n-2)-1)+r);this._monthScroller.position=t,window.requestAnimationFrame(s)}else this.dispatchEvent(new CustomEvent("scroll-animation-finished",{bubbles:!0,composed:!0,detail:{position:this._targetPosition,oldPosition:a}})),this._monthScroller.position=this._targetPosition,this._targetPosition=void 0,i(),this._revealPromise=void 0;var n,r,l;setTimeout(this._repositionYearScroller.bind(this),1)};window.requestAnimationFrame(s)}_limit(t,e){return Math.min(e.max,Math.max(e.min,t))}_handleTrack(t){if(Math.abs(t.detail.dx)<10||Math.abs(t.detail.ddy)>10)return;Math.abs(t.detail.ddx)>this._yearScrollerWidth/3&&this._toggleAnimateClass(!0);const e=this._translateX+t.detail.ddx;this._translateX=this._limit(e,{min:0,max:this._yearScrollerWidth})}_track(t){if(!this._desktopMode)switch(t.detail.state){case"start":this._toggleAnimateClass(!1);break;case"track":this._handleTrack(t);break;case"end":this._toggleAnimateClass(!0),this._translateX>=this._yearScrollerWidth/2?this._closeYearScroller():this._openYearScroller()}}_toggleAnimateClass(t){t?this.classList.add("animate"):this.classList.remove("animate")}_toggleYearScroller(){this._isYearScrollerVisible()?this._closeYearScroller():this._openYearScroller()}_openYearScroller(){this._translateX=0,this.setAttribute("years-visible","")}_closeYearScroller(){this.removeAttribute("years-visible"),this._translateX=this._yearScrollerWidth}_isYearScrollerVisible(){return this._translateX<this._yearScrollerWidth/2}_translateXChanged(t){this._desktopMode||(this._monthScroller.style.transform=`translateX(${t-this._yearScrollerWidth}px)`,this._yearScroller.style.transform=`translateX(${t}px)`)}_yearAfterXMonths(t){return w(t).getFullYear()}_differenceInMonths(t,e){return 12*(t.getFullYear()-e.getFullYear())-e.getMonth()+t.getMonth()}_clear(){this._selectDate("")}_close(){this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}_cancel(){this.focusedDate=this.selectedDate,this._close()}_preventDefault(t){t.preventDefault()}__toggleDate(t){g(t,this.selectedDate)?(this._clear(),this.focusedDate=t):this._selectDate(t)}__onMonthCalendarKeyDown(t){let e=!1;switch(t.key){case"ArrowDown":this._moveFocusByDays(7),e=!0;break;case"ArrowUp":this._moveFocusByDays(-7),e=!0;break;case"ArrowRight":this._moveFocusByDays(this.__isRTL?-1:1),e=!0;break;case"ArrowLeft":this._moveFocusByDays(this.__isRTL?1:-1),e=!0;break;case"Enter":this._selectDate(this.focusedDate),this._close(),e=!0;break;case" ":this.__toggleDate(this.focusedDate),e=!0;break;case"Home":this._moveFocusInsideMonth(this.focusedDate,"minDate"),e=!0;break;case"End":this._moveFocusInsideMonth(this.focusedDate,"maxDate"),e=!0;break;case"PageDown":this._moveFocusByMonths(t.shiftKey?12:1),e=!0;break;case"PageUp":this._moveFocusByMonths(t.shiftKey?-12:-1),e=!0;break;case"Tab":this._onTabKeyDown(t,"calendar")}e&&(t.preventDefault(),t.stopPropagation())}_onTabKeyDown(t,e){switch(t.stopPropagation(),e){case"calendar":t.shiftKey&&(t.preventDefault(),this.hasAttribute("fullscreen")?this.focusCancel():this.__focusInput());break;case"today":t.shiftKey&&(t.preventDefault(),this.focusDateElement());break;case"cancel":t.shiftKey||(t.preventDefault(),this.hasAttribute("fullscreen")?this.focusDateElement():this.__focusInput())}}__onTodayButtonKeyDown(t){"Tab"===t.key&&this._onTabKeyDown(t,"today")}__onCancelButtonKeyDown(t){"Tab"===t.key&&this._onTabKeyDown(t,"cancel")}__focusInput(){this.dispatchEvent(new CustomEvent("focus-input",{bubbles:!0,composed:!0}))}__tryFocusDate(){if(this.__pendingDateFocus){const t=this.focusableDateElement;t&&g(t.date,this.__pendingDateFocus)&&(delete this.__pendingDateFocus,t.focus())}}async focusDate(t,e){const i=t||this.selectedDate||this.initialPosition||new Date;this.focusedDate=i,e||(this._focusedMonthDate=i.getDate()),await this.focusDateElement(!1)}async focusDateElement(t=!0){this.__pendingDateFocus=this.focusedDate,this.calendars.length||await new Promise((t=>{(0,_t.T8)(this,(()=>{it(),t()}))})),t&&this.revealDate(this.focusedDate),this._revealPromise&&await this._revealPromise,this.__tryFocusDate()}_focusClosestDate(t){this.focusDate(b(t,[this.minDate,this.maxDate]))}_focusAllowedDate(t,e,i){this._dateAllowed(t)?this.focusDate(t,i):this._dateAllowed(this.focusedDate)?e>0?this.focusDate(this.maxDate):this.focusDate(this.minDate):this._focusClosestDate(this.focusedDate)}_getDateDiff(t,e){const i=new Date(0,0);return i.setFullYear(this.focusedDate.getFullYear()),i.setMonth(this.focusedDate.getMonth()+t),e&&i.setDate(this.focusedDate.getDate()+e),i}_moveFocusByDays(t){const e=this._getDateDiff(0,t);this._focusAllowedDate(e,t,!1)}_moveFocusByMonths(t){const e=this._getDateDiff(t),i=e.getMonth();this._focusedMonthDate||(this._focusedMonthDate=this.focusedDate.getDate()),e.setDate(this._focusedMonthDate),e.getMonth()!==i&&e.setDate(0),this._focusAllowedDate(e,t,!0)}_moveFocusInsideMonth(t,e){const i=new Date(0,0);i.setFullYear(t.getFullYear()),"minDate"===e?(i.setMonth(t.getMonth()),i.setDate(1)):(i.setMonth(t.getMonth()+1),i.setDate(0)),this._dateAllowed(i)?this.focusDate(i):this._dateAllowed(t)?this.focusDate(this[e]):this._focusClosestDate(t)}_dateAllowed(t,e=this.minDate,i=this.maxDate){return(!e||t>=e)&&(!i||t<=i)}_isTodayAllowed(t,e){const i=new Date,o=new Date(0,0);return o.setFullYear(i.getFullYear()),o.setMonth(i.getMonth()),o.setDate(i.getDate()),this._dateAllowed(o,t,e)}},yt=m.iv`
860
860
  :host {
861
861
  display: flex;
862
862
  flex-direction: column;
@@ -936,7 +936,7 @@
936
936
  <slot name="today-button"></slot>
937
937
  <slot name="cancel-button"></slot>
938
938
  </div>
939
- `}static get is(){return"vaadin-date-picker-overlay-content"}ready(){super.ready(),this.setAttribute("role","dialog"),this._addListeners(),this._initControllers()}}(0,d.M)(gt);var vt=i(2521),bt=i(4463),Dt=i(3406),wt=i(3208),kt=i(6729),xt=i(2743),Ct=i(962),St=i(1370),Et=i(2628),Tt=i(9320),Mt=i(9091),Pt=i(9580);const At=t=>class extends((0,Tt.u)((0,ut.k)((0,St.B)((0,Mt.t)((0,Et.L)(t)))))){static get properties(){return{_selectedDate:{type:Object,sync:!0},_focusedDate:{type:Object,sync:!0},value:{type:String,notify:!0,value:"",sync:!0},initialPosition:String,opened:{type:Boolean,reflectToAttribute:!0,notify:!0,observer:"_openedChanged",sync:!0},autoOpenDisabled:Boolean,showWeekNumbers:{type:Boolean,value:!1,sync:!0},_fullscreen:{type:Boolean,value:!1,sync:!0},_fullscreenMediaQuery:{value:"(max-width: 420px), (max-height: 420px)"},i18n:{type:Object,sync:!0,value:()=>({monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],firstDayOfWeek:0,today:"Today",cancel:"Cancel",referenceDate:"",formatDate(t){const e=String(t.year).replace(/\d+/u,(t=>"0000".substr(t.length)+t));return[t.month+1,t.day,e].join("/")},parseDate(t){const e=t.split("/"),i=new Date;let o,a=i.getMonth(),s=i.getFullYear();if(3===e.length?(a=parseInt(e[0])-1,o=parseInt(e[1]),s=parseInt(e[2]),e[2].length<3&&s>=0&&(s=function(t,e,i=0,o=1){if(e>99)throw new Error("The provided year cannot have more than 2 digits.");if(e<0)throw new Error("The provided year cannot be negative.");let a=e+100*Math.floor(t.getFullYear()/100);return t<new Date(a-50,i,o)?a-=100:t>new Date(a+50,i,o)&&(a+=100),a}(this.referenceDate?k(this.referenceDate):new Date,s,a,o))):2===e.length?(a=parseInt(e[0])-1,o=parseInt(e[1])):1===e.length&&(o=parseInt(e[0])),void 0!==o)return{day:o,month:a,year:s}},formatTitle:(t,e)=>`${t} ${e}`})},min:{type:String,sync:!0},max:{type:String,sync:!0},_minDate:{type:Date,computed:"__computeMinOrMaxDate(min)",sync:!0},_maxDate:{type:Date,computed:"__computeMinOrMaxDate(max)",sync:!0},_noInput:{type:Boolean,computed:"_isNoInput(inputElement, _fullscreen, _ios, i18n, opened, autoOpenDisabled)"},_ios:{type:Boolean,value:C.gn},_focusOverlayOnOpen:Boolean,_overlayContent:{type:Object,sync:!0},_hasInputValue:{type:Boolean}}}static get observers(){return["_selectedDateChanged(_selectedDate, i18n)","_focusedDateChanged(_focusedDate, i18n)","__updateOverlayContent(_overlayContent, i18n, label, _minDate, _maxDate, _focusedDate, _selectedDate, showWeekNumbers)","__updateOverlayContentTheme(_overlayContent, _theme)","__updateOverlayContentFullScreen(_overlayContent, _fullscreen)"]}static get constraints(){return[...super.constraints,"min","max"]}constructor(){super(),this._boundOnClick=this._onClick.bind(this),this._boundOnScroll=this._onScroll.bind(this),this._boundOverlayRenderer=this._overlayRenderer.bind(this)}get _inputElementValue(){return super._inputElementValue}set _inputElementValue(t){super._inputElementValue=t,this._hasInputValue=!1}get clearElement(){return null}get _nativeInput(){return this.inputElement?this.inputElement.focusElement||this.inputElement:null}get __unparsableValue(){return!this._inputElementValue||this.__parseDate(this._inputElementValue)?"":this._inputElementValue}_onFocus(t){super._onFocus(t),this._noInput&&t.target.blur()}_onBlur(t){super._onBlur(t),this.opened||(this.__commitParsedOrFocusedDate(),document.hasFocus()&&this.validate())}ready(){super.ready(),this.addEventListener("click",this._boundOnClick),this.addController(new pt(this._fullscreenMediaQuery,(t=>{this._fullscreen=t}))),this.addController(new Pt.B(this));const t=this.$.overlay;this._overlayElement=t,t.renderer=this._boundOverlayRenderer,this.addEventListener("mousedown",(()=>this.__bringToFront())),this.addEventListener("touchstart",(()=>this.__bringToFront()))}disconnectedCallback(){super.disconnectedCallback(),this.opened=!1}open(){this.disabled||this.readonly||(this.opened=!0)}close(){this.$.overlay.close()}_overlayRenderer(t){if(t.firstChild)return;const e=document.createElement("vaadin-date-picker-overlay-content");t.appendChild(e),this._overlayContent=e,e.addEventListener("close",(()=>{this._close()})),e.addEventListener("focus-input",this._focusAndSelect.bind(this)),e.addEventListener("date-tap",(t=>{this.__commitDate(t.detail.date),this._close()})),e.addEventListener("date-selected",(t=>{this.__commitDate(t.detail.date)})),e.addEventListener("focusin",(()=>{this._keyboardActive&&this._setFocused(!0)})),e.addEventListener("focused-date-changed",(t=>{this._focusedDate=t.detail.value})),e.addEventListener("click",(t=>t.stopPropagation()))}__parseDate(t){if(!this.i18n.parseDate)return;let e=this.i18n.parseDate(t);return e&&(e=k(`${e.year}-${e.month+1}-${e.day}`)),e&&!isNaN(e.getTime())?e:void 0}__formatDate(t){if(this.i18n.formatDate)return this.i18n.formatDate(D(t))}checkValidity(){const t=this._inputElementValue,e=!t||!!this._selectedDate&&t===this.__formatDate(this._selectedDate),i=!this._selectedDate||v(this._selectedDate,this._minDate,this._maxDate);let o=!0;return this.inputElement&&(this.inputElement.checkValidity?o=this.inputElement.checkValidity():this.inputElement.validate&&(o=this.inputElement.validate())),e&&i&&o}_shouldSetFocus(t){return!this._shouldKeepFocusRing}_shouldRemoveFocus(t){return!this.opened}_setFocused(t){super._setFocused(t),this._shouldKeepFocusRing=t&&this._keyboardActive}__commitValueChange(){const t=this.__unparsableValue;this.__committedValue!==this.value?(this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))):this.__committedUnparsableValue!==t&&(this.validate(),this.dispatchEvent(new CustomEvent("unparsable-change"))),this.__committedValue=this.value,this.__committedUnparsableValue=t}__commitDate(t){this.__keepCommittedValue=!0,this._selectedDate=t,this.__keepCommittedValue=!1,this.__commitValueChange()}_close(){this._focus(),this.close()}__bringToFront(){requestAnimationFrame((()=>{this.$.overlay.bringToFront()}))}_isNoInput(t,e,i,o,a,s){return!t||e&&(!s||a)||i&&a||!o.parseDate}_formatISO(t){if(!(t instanceof Date))return"";const e=(t,e="00")=>(e+t).substr((e+t).length-e.length);let i="",o="0000",a=t.getFullYear();return a<0?(a=-a,i="-",o="000000"):t.getFullYear()>=1e4&&(i="+",o="000000"),[i+e(a,o),e(t.getMonth()+1),e(t.getDate())].join("-")}_inputElementChanged(t){super._inputElementChanged(t),t&&(t.autocomplete="off",t.setAttribute("role","combobox"),t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-expanded",!!this.opened),this._applyInputValue(this._selectedDate))}_openedChanged(t){this.inputElement&&this.inputElement.setAttribute("aria-expanded",t)}_selectedDateChanged(t,e){void 0!==t&&void 0!==e&&(this.__keepInputValue||this._applyInputValue(t),this.value=this._formatISO(t),this._ignoreFocusedDateChange=!0,this._focusedDate=t,this._ignoreFocusedDateChange=!1)}_focusedDateChanged(t,e){void 0!==t&&void 0!==e&&(this._ignoreFocusedDateChange||this._noInput||this._applyInputValue(t))}_valueChanged(t,e){const i=k(t);!t||i?(t?g(this._selectedDate,i)||(this._selectedDate=i,void 0!==e&&this.validate()):this._selectedDate=null,this.__keepCommittedValue||(this.__committedValue=this.value,this.__committedUnparsableValue=""),this._toggleHasValue(this._hasValue)):this.value=e}__updateOverlayContent(t,e,i,o,a,s,n,r){t&&(t.i18n=e,t.label=i,t.minDate=o,t.maxDate=a,t.focusedDate=s,t.selectedDate=n,t.showWeekNumbers=r)}__updateOverlayContentTheme(t,e){t&&(e?t.setAttribute("theme",e):t.removeAttribute("theme"))}__updateOverlayContentFullScreen(t,e){t&&t.toggleAttribute("fullscreen",e)}_onOverlayEscapePress(){this._focusedDate=this._selectedDate,this._close()}_onOverlayOpened(){const t=this._overlayContent;t.reset();const e=this._getInitialPosition();t.initialPosition=e;const i=t.focusedDate||e;t.scrollToDate(i),this._ignoreFocusedDateChange=!0,t.focusedDate=i,this._ignoreFocusedDateChange=!1,window.addEventListener("scroll",this._boundOnScroll,!0),this._focusOverlayOnOpen?(t.focusDateElement(),this._focusOverlayOnOpen=!1):this._focus();const o=this._nativeInput;this._noInput&&o&&(o.blur(),this._overlayContent.focusDateElement());const a=this._noInput?t:[o,t];this.__showOthers=(0,Ct.Ry)(a)}_getInitialPosition(){const t=k(this.initialPosition),e=this._selectedDate||this._overlayContent.initialPosition||t||new Date;return t||v(e,this._minDate,this._maxDate)?e:b(e,[this._minDate,this._maxDate])}__commitParsedOrFocusedDate(){if(this._ignoreFocusedDateChange=!0,this.i18n.parseDate){const t=this._inputElementValue||"",e=this.__parseDate(t);e?this.__commitDate(e):(this.__keepInputValue=!0,this.__commitDate(null),this.__keepInputValue=!1)}else this._focusedDate&&this.__commitDate(this._focusedDate);this._ignoreFocusedDateChange=!1}_onOverlayClosed(){this.__showOthers&&(this.__showOthers(),this.__showOthers=null),window.removeEventListener("scroll",this._boundOnScroll,!0),this.__commitParsedOrFocusedDate(),this._nativeInput&&this._nativeInput.selectionStart&&(this._nativeInput.selectionStart=this._nativeInput.selectionEnd),this.value||this._keyboardActive||this.validate()}_onScroll(t){t.target!==window&&this._overlayContent.contains(t.target)||this._overlayContent._repositionYearScroller()}_focus(){this._noInput||this.inputElement.focus()}_focusAndSelect(){this._focus(),this._setSelectionRange(0,this._inputElementValue.length)}_applyInputValue(t){this._inputElementValue=t?this.__formatDate(t):""}_setSelectionRange(t,e){this._nativeInput&&this._nativeInput.setSelectionRange&&this._nativeInput.setSelectionRange(t,e)}_onChange(t){t.stopPropagation()}_onClick(t){this._isClearButton(t)||this._onHostClick(t)}_onHostClick(t){this.autoOpenDisabled&&!this._noInput||(t.preventDefault(),this.open())}_onClearButtonClick(t){t.preventDefault(),this.__commitDate(null)}_onKeyDown(t){switch(super._onKeyDown(t),this._noInput&&-1===[9].indexOf(t.keyCode)&&t.preventDefault(),t.key){case"ArrowDown":case"ArrowUp":t.preventDefault(),this.opened?this._overlayContent.focusDateElement():(this._focusOverlayOnOpen=!0,this.open());break;case"Tab":this.opened&&(t.preventDefault(),t.stopPropagation(),this._setSelectionRange(0,0),t.shiftKey?this._overlayContent.focusCancel():this._overlayContent.focusDateElement())}}_onEnter(t){this.opened?this.close():this.__commitParsedOrFocusedDate()}_onEscape(t){if(!this.opened)return this.clearButtonVisible&&this.value?(t.stopPropagation(),void this._onClearButtonClick(t)):void(""===this.inputElement.value?this.__commitDate(null):this._applyInputValue(this._selectedDate))}_isClearButton(t){return t.composedPath()[0]===this.clearElement}_onInput(){if(this.opened||!this._inputElementValue||this.autoOpenDisabled||this.open(),this._inputElementValue){const t=this.__parseDate(this._inputElementValue);t&&(this._ignoreFocusedDateChange=!0,g(t,this._focusedDate)||(this._focusedDate=t),this._ignoreFocusedDateChange=!1)}}__computeMinOrMaxDate(t){return k(t)}},It=m.iv`
939
+ `}static get is(){return"vaadin-date-picker-overlay-content"}ready(){super.ready(),this.setAttribute("role","dialog"),this._addListeners(),this._initControllers()}}(0,d.M)(gt);var vt=i(12521),bt=i(34463),Dt=i(73406),wt=i(73208),kt=i(46729),xt=i(62743),Ct=i(80962),St=i(41370),Et=i(52628),Tt=i(39320),Mt=i(39091),Pt=i(29580);const At=t=>class extends((0,Tt.u)((0,ut.k)((0,St.B)((0,Mt.t)((0,Et.L)(t)))))){static get properties(){return{_selectedDate:{type:Object,sync:!0},_focusedDate:{type:Object,sync:!0},value:{type:String,notify:!0,value:"",sync:!0},initialPosition:String,opened:{type:Boolean,reflectToAttribute:!0,notify:!0,observer:"_openedChanged",sync:!0},autoOpenDisabled:Boolean,showWeekNumbers:{type:Boolean,value:!1,sync:!0},_fullscreen:{type:Boolean,value:!1,sync:!0},_fullscreenMediaQuery:{value:"(max-width: 420px), (max-height: 420px)"},i18n:{type:Object,sync:!0,value:()=>({monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],firstDayOfWeek:0,today:"Today",cancel:"Cancel",referenceDate:"",formatDate(t){const e=String(t.year).replace(/\d+/u,(t=>"0000".substr(t.length)+t));return[t.month+1,t.day,e].join("/")},parseDate(t){const e=t.split("/"),i=new Date;let o,a=i.getMonth(),s=i.getFullYear();if(3===e.length?(a=parseInt(e[0])-1,o=parseInt(e[1]),s=parseInt(e[2]),e[2].length<3&&s>=0&&(s=function(t,e,i=0,o=1){if(e>99)throw new Error("The provided year cannot have more than 2 digits.");if(e<0)throw new Error("The provided year cannot be negative.");let a=e+100*Math.floor(t.getFullYear()/100);return t<new Date(a-50,i,o)?a-=100:t>new Date(a+50,i,o)&&(a+=100),a}(this.referenceDate?k(this.referenceDate):new Date,s,a,o))):2===e.length?(a=parseInt(e[0])-1,o=parseInt(e[1])):1===e.length&&(o=parseInt(e[0])),void 0!==o)return{day:o,month:a,year:s}},formatTitle:(t,e)=>`${t} ${e}`})},min:{type:String,sync:!0},max:{type:String,sync:!0},_minDate:{type:Date,computed:"__computeMinOrMaxDate(min)",sync:!0},_maxDate:{type:Date,computed:"__computeMinOrMaxDate(max)",sync:!0},_noInput:{type:Boolean,computed:"_isNoInput(inputElement, _fullscreen, _ios, i18n, opened, autoOpenDisabled)"},_ios:{type:Boolean,value:C.gn},_focusOverlayOnOpen:Boolean,_overlayContent:{type:Object,sync:!0},_hasInputValue:{type:Boolean}}}static get observers(){return["_selectedDateChanged(_selectedDate, i18n)","_focusedDateChanged(_focusedDate, i18n)","__updateOverlayContent(_overlayContent, i18n, label, _minDate, _maxDate, _focusedDate, _selectedDate, showWeekNumbers)","__updateOverlayContentTheme(_overlayContent, _theme)","__updateOverlayContentFullScreen(_overlayContent, _fullscreen)"]}static get constraints(){return[...super.constraints,"min","max"]}constructor(){super(),this._boundOnClick=this._onClick.bind(this),this._boundOnScroll=this._onScroll.bind(this),this._boundOverlayRenderer=this._overlayRenderer.bind(this)}get _inputElementValue(){return super._inputElementValue}set _inputElementValue(t){super._inputElementValue=t,this._hasInputValue=!1}get clearElement(){return null}get _nativeInput(){return this.inputElement?this.inputElement.focusElement||this.inputElement:null}get __unparsableValue(){return!this._inputElementValue||this.__parseDate(this._inputElementValue)?"":this._inputElementValue}_onFocus(t){super._onFocus(t),this._noInput&&t.target.blur()}_onBlur(t){super._onBlur(t),this.opened||(this.__commitParsedOrFocusedDate(),document.hasFocus()&&this.validate())}ready(){super.ready(),this.addEventListener("click",this._boundOnClick),this.addController(new pt(this._fullscreenMediaQuery,(t=>{this._fullscreen=t}))),this.addController(new Pt.B(this));const t=this.$.overlay;this._overlayElement=t,t.renderer=this._boundOverlayRenderer,this.addEventListener("mousedown",(()=>this.__bringToFront())),this.addEventListener("touchstart",(()=>this.__bringToFront()))}disconnectedCallback(){super.disconnectedCallback(),this.opened=!1}open(){this.disabled||this.readonly||(this.opened=!0)}close(){this.$.overlay.close()}_overlayRenderer(t){if(t.firstChild)return;const e=document.createElement("vaadin-date-picker-overlay-content");t.appendChild(e),this._overlayContent=e,e.addEventListener("close",(()=>{this._close()})),e.addEventListener("focus-input",this._focusAndSelect.bind(this)),e.addEventListener("date-tap",(t=>{this.__commitDate(t.detail.date),this._close()})),e.addEventListener("date-selected",(t=>{this.__commitDate(t.detail.date)})),e.addEventListener("focusin",(()=>{this._keyboardActive&&this._setFocused(!0)})),e.addEventListener("focused-date-changed",(t=>{this._focusedDate=t.detail.value})),e.addEventListener("click",(t=>t.stopPropagation()))}__parseDate(t){if(!this.i18n.parseDate)return;let e=this.i18n.parseDate(t);return e&&(e=k(`${e.year}-${e.month+1}-${e.day}`)),e&&!isNaN(e.getTime())?e:void 0}__formatDate(t){if(this.i18n.formatDate)return this.i18n.formatDate(D(t))}checkValidity(){const t=this._inputElementValue,e=!t||!!this._selectedDate&&t===this.__formatDate(this._selectedDate),i=!this._selectedDate||v(this._selectedDate,this._minDate,this._maxDate);let o=!0;return this.inputElement&&(this.inputElement.checkValidity?o=this.inputElement.checkValidity():this.inputElement.validate&&(o=this.inputElement.validate())),e&&i&&o}_shouldSetFocus(t){return!this._shouldKeepFocusRing}_shouldRemoveFocus(t){return!this.opened}_setFocused(t){super._setFocused(t),this._shouldKeepFocusRing=t&&this._keyboardActive}__commitValueChange(){const t=this.__unparsableValue;this.__committedValue!==this.value?(this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))):this.__committedUnparsableValue!==t&&(this.validate(),this.dispatchEvent(new CustomEvent("unparsable-change"))),this.__committedValue=this.value,this.__committedUnparsableValue=t}__commitDate(t){this.__keepCommittedValue=!0,this._selectedDate=t,this.__keepCommittedValue=!1,this.__commitValueChange()}_close(){this._focus(),this.close()}__bringToFront(){requestAnimationFrame((()=>{this.$.overlay.bringToFront()}))}_isNoInput(t,e,i,o,a,s){return!t||e&&(!s||a)||i&&a||!o.parseDate}_formatISO(t){if(!(t instanceof Date))return"";const e=(t,e="00")=>(e+t).substr((e+t).length-e.length);let i="",o="0000",a=t.getFullYear();return a<0?(a=-a,i="-",o="000000"):t.getFullYear()>=1e4&&(i="+",o="000000"),[i+e(a,o),e(t.getMonth()+1),e(t.getDate())].join("-")}_inputElementChanged(t){super._inputElementChanged(t),t&&(t.autocomplete="off",t.setAttribute("role","combobox"),t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-expanded",!!this.opened),this._applyInputValue(this._selectedDate))}_openedChanged(t){this.inputElement&&this.inputElement.setAttribute("aria-expanded",t)}_selectedDateChanged(t,e){void 0!==t&&void 0!==e&&(this.__keepInputValue||this._applyInputValue(t),this.value=this._formatISO(t),this._ignoreFocusedDateChange=!0,this._focusedDate=t,this._ignoreFocusedDateChange=!1)}_focusedDateChanged(t,e){void 0!==t&&void 0!==e&&(this._ignoreFocusedDateChange||this._noInput||this._applyInputValue(t))}_valueChanged(t,e){const i=k(t);!t||i?(t?g(this._selectedDate,i)||(this._selectedDate=i,void 0!==e&&this.validate()):this._selectedDate=null,this.__keepCommittedValue||(this.__committedValue=this.value,this.__committedUnparsableValue=""),this._toggleHasValue(this._hasValue)):this.value=e}__updateOverlayContent(t,e,i,o,a,s,n,r){t&&(t.i18n=e,t.label=i,t.minDate=o,t.maxDate=a,t.focusedDate=s,t.selectedDate=n,t.showWeekNumbers=r)}__updateOverlayContentTheme(t,e){t&&(e?t.setAttribute("theme",e):t.removeAttribute("theme"))}__updateOverlayContentFullScreen(t,e){t&&t.toggleAttribute("fullscreen",e)}_onOverlayEscapePress(){this._focusedDate=this._selectedDate,this._close()}_onOverlayOpened(){const t=this._overlayContent;t.reset();const e=this._getInitialPosition();t.initialPosition=e;const i=t.focusedDate||e;t.scrollToDate(i),this._ignoreFocusedDateChange=!0,t.focusedDate=i,this._ignoreFocusedDateChange=!1,window.addEventListener("scroll",this._boundOnScroll,!0),this._focusOverlayOnOpen?(t.focusDateElement(),this._focusOverlayOnOpen=!1):this._focus();const o=this._nativeInput;this._noInput&&o&&(o.blur(),this._overlayContent.focusDateElement());const a=this._noInput?t:[o,t];this.__showOthers=(0,Ct.Ry)(a)}_getInitialPosition(){const t=k(this.initialPosition),e=this._selectedDate||this._overlayContent.initialPosition||t||new Date;return t||v(e,this._minDate,this._maxDate)?e:b(e,[this._minDate,this._maxDate])}__commitParsedOrFocusedDate(){if(this._ignoreFocusedDateChange=!0,this.i18n.parseDate){const t=this._inputElementValue||"",e=this.__parseDate(t);e?this.__commitDate(e):(this.__keepInputValue=!0,this.__commitDate(null),this.__keepInputValue=!1)}else this._focusedDate&&this.__commitDate(this._focusedDate);this._ignoreFocusedDateChange=!1}_onOverlayClosed(){this.__showOthers&&(this.__showOthers(),this.__showOthers=null),window.removeEventListener("scroll",this._boundOnScroll,!0),this.__commitParsedOrFocusedDate(),this._nativeInput&&this._nativeInput.selectionStart&&(this._nativeInput.selectionStart=this._nativeInput.selectionEnd),this.value||this._keyboardActive||this.validate()}_onScroll(t){t.target!==window&&this._overlayContent.contains(t.target)||this._overlayContent._repositionYearScroller()}_focus(){this._noInput||this.inputElement.focus()}_focusAndSelect(){this._focus(),this._setSelectionRange(0,this._inputElementValue.length)}_applyInputValue(t){this._inputElementValue=t?this.__formatDate(t):""}_setSelectionRange(t,e){this._nativeInput&&this._nativeInput.setSelectionRange&&this._nativeInput.setSelectionRange(t,e)}_onChange(t){t.stopPropagation()}_onClick(t){this._isClearButton(t)||this._onHostClick(t)}_onHostClick(t){this.autoOpenDisabled&&!this._noInput||(t.preventDefault(),this.open())}_onClearButtonClick(t){t.preventDefault(),this.__commitDate(null)}_onKeyDown(t){switch(super._onKeyDown(t),this._noInput&&-1===[9].indexOf(t.keyCode)&&t.preventDefault(),t.key){case"ArrowDown":case"ArrowUp":t.preventDefault(),this.opened?this._overlayContent.focusDateElement():(this._focusOverlayOnOpen=!0,this.open());break;case"Tab":this.opened&&(t.preventDefault(),t.stopPropagation(),this._setSelectionRange(0,0),t.shiftKey?this._overlayContent.focusCancel():this._overlayContent.focusDateElement())}}_onEnter(t){this.opened?this.close():this.__commitParsedOrFocusedDate()}_onEscape(t){if(!this.opened)return this.clearButtonVisible&&this.value?(t.stopPropagation(),void this._onClearButtonClick(t)):void(""===this.inputElement.value?this.__commitDate(null):this._applyInputValue(this._selectedDate))}_isClearButton(t){return t.composedPath()[0]===this.clearElement}_onInput(){if(this.opened||!this._inputElementValue||this.autoOpenDisabled||this.open(),this._inputElementValue){const t=this.__parseDate(this._inputElementValue);t&&(this._ignoreFocusedDateChange=!0,g(t,this._focusedDate)||(this._focusedDate=t),this._ignoreFocusedDateChange=!1)}}__computeMinOrMaxDate(t){return k(t)}},It=m.iv`
940
940
  :host([opened]) {
941
941
  pointer-events: auto;
942
942
  }
@@ -991,7 +991,7 @@
991
991
  ></vaadin-date-picker-overlay>
992
992
 
993
993
  <slot name="tooltip"></slot>
994
- `}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new wt.b(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new kt.v(this.inputElement,this._labelController)),this._tooltipController=new bt.f(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow((t=>!t.opened)),this.shadowRoot.querySelector('[part="toggle-button"]').addEventListener("mousedown",(t=>t.preventDefault())),this.$.overlay.addEventListener("vaadin-overlay-close",this._onVaadinOverlayClose.bind(this))}_onVaadinOverlayClose(t){t.detail.sourceEvent&&t.detail.sourceEvent.composedPath().includes(this)&&t.preventDefault()}_toggle(t){t.stopPropagation(),this.$.overlay.opened?this.close():this.open()}_openedChanged(t){super._openedChanged(t),this.$.overlay.positionTarget=this.shadowRoot.querySelector('[part="input-field"]'),this.$.overlay.noVerticalOverlap=!0}}(0,d.M)(Ot)},3208:(t,e,i)=>{i.d(e,{b:()=>a});var o=i(9229);class a extends o.n{constructor(t,e){super(t,"input","input",{initializer:(t,i)=>{i.value&&(t.value=i.value),i.type&&t.setAttribute("type",i.type),t.id=this.defaultId,"function"==typeof e&&e(t)},useUniqueId:!0})}}},9580:(t,e,i)=>{i.d(e,{B:()=>o});class o{constructor(t){this.host=t,t.addEventListener("opened-changed",(()=>{t.opened||this.__setVirtualKeyboardEnabled(!1)})),t.addEventListener("blur",(()=>this.__setVirtualKeyboardEnabled(!0))),t.addEventListener("touchstart",(()=>this.__setVirtualKeyboardEnabled(!0)))}__setVirtualKeyboardEnabled(t){this.host.inputElement&&(this.host.inputElement.inputMode=t?"":"none")}}},3373:(t,e,i)=>{i.d(e,{y:()=>r});var o=i(3726);const a={start:"top",end:"bottom"},s={start:"left",end:"right"},n=new ResizeObserver((t=>{setTimeout((()=>{t.forEach((t=>{t.target.__overlay&&t.target.__overlay._updatePosition()}))}))})),r=t=>class extends t{static get properties(){return{positionTarget:{type:Object,value:null,sync:!0},horizontalAlign:{type:String,value:"start",sync:!0},verticalAlign:{type:String,value:"top",sync:!0},noHorizontalOverlap:{type:Boolean,value:!1,sync:!0},noVerticalOverlap:{type:Boolean,value:!1,sync:!0},requiredVerticalSpace:{type:Number,value:0,sync:!0}}}static get observers(){return["__positionSettingsChanged(horizontalAlign, verticalAlign, noHorizontalOverlap, noVerticalOverlap, requiredVerticalSpace)","__overlayOpenedChanged(opened, positionTarget)"]}constructor(){super(),this.__onScroll=this.__onScroll.bind(this),this._updatePosition=this._updatePosition.bind(this)}connectedCallback(){super.connectedCallback(),this.opened&&this.__addUpdatePositionEventListeners()}disconnectedCallback(){super.disconnectedCallback(),this.__removeUpdatePositionEventListeners()}__addUpdatePositionEventListeners(){window.addEventListener("resize",this._updatePosition),this.__positionTargetAncestorRootNodes=(0,o.AD)(this.positionTarget),this.__positionTargetAncestorRootNodes.forEach((t=>{t.addEventListener("scroll",this.__onScroll,!0)}))}__removeUpdatePositionEventListeners(){window.removeEventListener("resize",this._updatePosition),this.__positionTargetAncestorRootNodes&&(this.__positionTargetAncestorRootNodes.forEach((t=>{t.removeEventListener("scroll",this.__onScroll,!0)})),this.__positionTargetAncestorRootNodes=null)}__overlayOpenedChanged(t,e){if(this.__removeUpdatePositionEventListeners(),e&&(e.__overlay=null,n.unobserve(e),t&&(this.__addUpdatePositionEventListeners(),e.__overlay=this,n.observe(e))),t){const t=getComputedStyle(this);this.__margins||(this.__margins={},["top","bottom","left","right"].forEach((e=>{this.__margins[e]=parseInt(t[e],10)}))),this.setAttribute("dir",t.direction),this._updatePosition(),requestAnimationFrame((()=>this._updatePosition()))}}__positionSettingsChanged(){this._updatePosition()}__onScroll(t){this.contains(t.target)||this._updatePosition()}_updatePosition(){if(!this.positionTarget||!this.opened)return;const t=this.positionTarget.getBoundingClientRect(),e=this.__shouldAlignStartVertically(t);this.style.justifyContent=e?"flex-start":"flex-end";const i=this.__isRTL,o=this.__shouldAlignStartHorizontally(t,i),n=!i&&o||i&&!o;this.style.alignItems=n?"flex-start":"flex-end";const r=this.getBoundingClientRect(),l=this.__calculatePositionInOneDimension(t,r,this.noVerticalOverlap,a,this,e),h=this.__calculatePositionInOneDimension(t,r,this.noHorizontalOverlap,s,this,o);Object.assign(this.style,l,h),this.toggleAttribute("bottom-aligned",!e),this.toggleAttribute("top-aligned",e),this.toggleAttribute("end-aligned",!n),this.toggleAttribute("start-aligned",n)}__shouldAlignStartHorizontally(t,e){const i=Math.max(this.__oldContentWidth||0,this.$.overlay.offsetWidth);this.__oldContentWidth=this.$.overlay.offsetWidth;const o=Math.min(window.innerWidth,document.documentElement.clientWidth),a=!e&&"start"===this.horizontalAlign||e&&"end"===this.horizontalAlign;return this.__shouldAlignStart(t,i,o,this.__margins,a,this.noHorizontalOverlap,s)}__shouldAlignStartVertically(t){const e=this.requiredVerticalSpace||Math.max(this.__oldContentHeight||0,this.$.overlay.offsetHeight);this.__oldContentHeight=this.$.overlay.offsetHeight;const i=Math.min(window.innerHeight,document.documentElement.clientHeight),o="top"===this.verticalAlign;return this.__shouldAlignStart(t,e,i,this.__margins,o,this.noVerticalOverlap,a)}__shouldAlignStart(t,e,i,o,a,s,n){const r=i-t[s?n.end:n.start]-o[n.end],l=t[s?n.start:n.end]-o[n.start],h=a?r:l;return a===(h>(a?l:r)||h>e)}__adjustBottomProperty(t,e,i){let o;if(t===e.end){if(e.end===a.end){const t=Math.min(window.innerHeight,document.documentElement.clientHeight);i>t&&this.__oldViewportHeight&&(o=i-(this.__oldViewportHeight-t)),this.__oldViewportHeight=t}if(e.end===s.end){const t=Math.min(window.innerWidth,document.documentElement.clientWidth);i>t&&this.__oldViewportWidth&&(o=i-(this.__oldViewportWidth-t)),this.__oldViewportWidth=t}}return o}__calculatePositionInOneDimension(t,e,i,o,a,s){const n=s?o.start:o.end,r=s?o.end:o.start,l=parseFloat(a.style[n]||getComputedStyle(a)[n]),h=this.__adjustBottomProperty(n,o,l),d=e[s?o.start:o.end]-t[i===s?o.end:o.start];return{[n]:h?`${h}px`:`${l+d*(s?-1:1)}px`,[r]:""}}}},6754:(t,e,i)=>{i.d(e,{L:()=>r,e:()=>s}),i(9416),i(9849);var o=i(6570),a=i(510);const s=o.iv`
994
+ `}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new wt.b(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new kt.v(this.inputElement,this._labelController)),this._tooltipController=new bt.f(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow((t=>!t.opened)),this.shadowRoot.querySelector('[part="toggle-button"]').addEventListener("mousedown",(t=>t.preventDefault())),this.$.overlay.addEventListener("vaadin-overlay-close",this._onVaadinOverlayClose.bind(this))}_onVaadinOverlayClose(t){t.detail.sourceEvent&&t.detail.sourceEvent.composedPath().includes(this)&&t.preventDefault()}_toggle(t){t.stopPropagation(),this.$.overlay.opened?this.close():this.open()}_openedChanged(t){super._openedChanged(t),this.$.overlay.positionTarget=this.shadowRoot.querySelector('[part="input-field"]'),this.$.overlay.noVerticalOverlap=!0}}(0,d.M)(Ot)},73208:(t,e,i)=>{i.d(e,{b:()=>a});var o=i(9229);class a extends o.n{constructor(t,e){super(t,"input","input",{initializer:(t,i)=>{i.value&&(t.value=i.value),i.type&&t.setAttribute("type",i.type),t.id=this.defaultId,"function"==typeof e&&e(t)},useUniqueId:!0})}}},29580:(t,e,i)=>{i.d(e,{B:()=>o});class o{constructor(t){this.host=t,t.addEventListener("opened-changed",(()=>{t.opened||this.__setVirtualKeyboardEnabled(!1)})),t.addEventListener("blur",(()=>this.__setVirtualKeyboardEnabled(!0))),t.addEventListener("touchstart",(()=>this.__setVirtualKeyboardEnabled(!0)))}__setVirtualKeyboardEnabled(t){this.host.inputElement&&(this.host.inputElement.inputMode=t?"":"none")}}},63373:(t,e,i)=>{i.d(e,{y:()=>r});var o=i(63726);const a={start:"top",end:"bottom"},s={start:"left",end:"right"},n=new ResizeObserver((t=>{setTimeout((()=>{t.forEach((t=>{t.target.__overlay&&t.target.__overlay._updatePosition()}))}))})),r=t=>class extends t{static get properties(){return{positionTarget:{type:Object,value:null,sync:!0},horizontalAlign:{type:String,value:"start",sync:!0},verticalAlign:{type:String,value:"top",sync:!0},noHorizontalOverlap:{type:Boolean,value:!1,sync:!0},noVerticalOverlap:{type:Boolean,value:!1,sync:!0},requiredVerticalSpace:{type:Number,value:0,sync:!0}}}static get observers(){return["__positionSettingsChanged(horizontalAlign, verticalAlign, noHorizontalOverlap, noVerticalOverlap, requiredVerticalSpace)","__overlayOpenedChanged(opened, positionTarget)"]}constructor(){super(),this.__onScroll=this.__onScroll.bind(this),this._updatePosition=this._updatePosition.bind(this)}connectedCallback(){super.connectedCallback(),this.opened&&this.__addUpdatePositionEventListeners()}disconnectedCallback(){super.disconnectedCallback(),this.__removeUpdatePositionEventListeners()}__addUpdatePositionEventListeners(){window.addEventListener("resize",this._updatePosition),this.__positionTargetAncestorRootNodes=(0,o.AD)(this.positionTarget),this.__positionTargetAncestorRootNodes.forEach((t=>{t.addEventListener("scroll",this.__onScroll,!0)}))}__removeUpdatePositionEventListeners(){window.removeEventListener("resize",this._updatePosition),this.__positionTargetAncestorRootNodes&&(this.__positionTargetAncestorRootNodes.forEach((t=>{t.removeEventListener("scroll",this.__onScroll,!0)})),this.__positionTargetAncestorRootNodes=null)}__overlayOpenedChanged(t,e){if(this.__removeUpdatePositionEventListeners(),e&&(e.__overlay=null,n.unobserve(e),t&&(this.__addUpdatePositionEventListeners(),e.__overlay=this,n.observe(e))),t){const t=getComputedStyle(this);this.__margins||(this.__margins={},["top","bottom","left","right"].forEach((e=>{this.__margins[e]=parseInt(t[e],10)}))),this.setAttribute("dir",t.direction),this._updatePosition(),requestAnimationFrame((()=>this._updatePosition()))}}__positionSettingsChanged(){this._updatePosition()}__onScroll(t){this.contains(t.target)||this._updatePosition()}_updatePosition(){if(!this.positionTarget||!this.opened)return;const t=this.positionTarget.getBoundingClientRect(),e=this.__shouldAlignStartVertically(t);this.style.justifyContent=e?"flex-start":"flex-end";const i=this.__isRTL,o=this.__shouldAlignStartHorizontally(t,i),n=!i&&o||i&&!o;this.style.alignItems=n?"flex-start":"flex-end";const r=this.getBoundingClientRect(),l=this.__calculatePositionInOneDimension(t,r,this.noVerticalOverlap,a,this,e),h=this.__calculatePositionInOneDimension(t,r,this.noHorizontalOverlap,s,this,o);Object.assign(this.style,l,h),this.toggleAttribute("bottom-aligned",!e),this.toggleAttribute("top-aligned",e),this.toggleAttribute("end-aligned",!n),this.toggleAttribute("start-aligned",n)}__shouldAlignStartHorizontally(t,e){const i=Math.max(this.__oldContentWidth||0,this.$.overlay.offsetWidth);this.__oldContentWidth=this.$.overlay.offsetWidth;const o=Math.min(window.innerWidth,document.documentElement.clientWidth),a=!e&&"start"===this.horizontalAlign||e&&"end"===this.horizontalAlign;return this.__shouldAlignStart(t,i,o,this.__margins,a,this.noHorizontalOverlap,s)}__shouldAlignStartVertically(t){const e=this.requiredVerticalSpace||Math.max(this.__oldContentHeight||0,this.$.overlay.offsetHeight);this.__oldContentHeight=this.$.overlay.offsetHeight;const i=Math.min(window.innerHeight,document.documentElement.clientHeight),o="top"===this.verticalAlign;return this.__shouldAlignStart(t,e,i,this.__margins,o,this.noVerticalOverlap,a)}__shouldAlignStart(t,e,i,o,a,s,n){const r=i-t[s?n.end:n.start]-o[n.end],l=t[s?n.start:n.end]-o[n.start],h=a?r:l;return a===(h>(a?l:r)||h>e)}__adjustBottomProperty(t,e,i){let o;if(t===e.end){if(e.end===a.end){const t=Math.min(window.innerHeight,document.documentElement.clientHeight);i>t&&this.__oldViewportHeight&&(o=i-(this.__oldViewportHeight-t)),this.__oldViewportHeight=t}if(e.end===s.end){const t=Math.min(window.innerWidth,document.documentElement.clientWidth);i>t&&this.__oldViewportWidth&&(o=i-(this.__oldViewportWidth-t)),this.__oldViewportWidth=t}}return o}__calculatePositionInOneDimension(t,e,i,o,a,s){const n=s?o.start:o.end,r=s?o.end:o.start,l=parseFloat(a.style[n]||getComputedStyle(a)[n]),h=this.__adjustBottomProperty(n,o,l),d=e[s?o.start:o.end]-t[i===s?o.end:o.start];return{[n]:h?`${h}px`:`${l+d*(s?-1:1)}px`,[r]:""}}}},96754:(t,e,i)=>{i.d(e,{L:()=>r,e:()=>s}),i(29416),i(29849);var o=i(46570),a=i(90510);const s=o.iv`
995
995
  :host([opening]),
996
996
  :host([closing]) {
997
997
  animation: 0.14s lumo-overlay-dummy-animation;
package/dist/umd/9314.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*! For license information please see 9314.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[9314],{3550:(e,t,o)=>{o.d(t,{GF:()=>l,GO:()=>u,Gf:()=>i,LQ:()=>s,Qw:()=>h});let r=!1;function i(){let e=document.activeElement||document.body;for(;e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function s(){return r}function n(e){const t=e.style;if("hidden"===t.visibility||"none"===t.display)return!0;const o=window.getComputedStyle(e);return"hidden"===o.visibility||"none"===o.display}function a(e,t){const o=Math.max(e.tabIndex,0),r=Math.max(t.tabIndex,0);return 0===o||0===r?r>o:o>r}function d(e){const t=e.length;if(t<2)return e;const o=Math.ceil(t/2);return function(e,t){const o=[];for(;e.length>0&&t.length>0;)a(e[0],t[0])?o.push(t.shift()):o.push(e.shift());return o.concat(e,t)}(d(e.slice(0,o)),d(e.slice(o)))}function l(e){return null===e.offsetParent&&0===e.clientWidth&&0===e.clientHeight||n(e)}function h(e){return e.getRootNode().activeElement===e}function c(e,t){if(e.nodeType!==Node.ELEMENT_NODE||n(e))return!1;const o=e,r=function(e){if(!function(e){return!e.matches('[tabindex="-1"]')&&(e.matches("input, select, textarea, button, object")?e.matches(":not([disabled])"):e.matches("a[href], area[href], iframe, [tabindex], [contentEditable]"))}(e))return-1;const t=e.getAttribute("tabindex")||0;return Number(t)}(o);let i=r>0;r>=0&&t.push(o);let s=[];return s="slot"===o.localName?o.assignedNodes({flatten:!0}):(o.shadowRoot||o).children,[...s].forEach((e=>{i=c(e,t)||i})),i}function u(e){const t=[];return c(e,t)?d(t):t}window.addEventListener("keydown",(()=>{r=!0}),{capture:!0}),window.addEventListener("mousedown",(()=>{r=!1}),{capture:!0})},1037:(e,t,o)=>{o.d(t,{Dt:()=>s,G6:()=>h,T:()=>c,gn:()=>l,i7:()=>n,vU:()=>a});const r=e=>e.test(navigator.userAgent),i=e=>e.test(navigator.platform),s=r(/Android/u),n=r(/Chrome/u)&&/Google Inc/u.test(navigator.vendor),a=r(/Firefox/u),d=i(/^iPad/u)||i(/^Mac/u)&&navigator.maxTouchPoints>1,l=i(/^iPhone/u)||d,h=r(/^((?!chrome|android).)*safari/iu),c=(()=>{try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}})()},6155:(e,t,o)=>{o.d(t,{k:()=>r});const r=(0,o(1014).o)((e=>"function"==typeof e.prototype.addController?e:class extends e{constructor(){super(),this.__controllers=new Set}connectedCallback(){super.connectedCallback(),this.__controllers.forEach((e=>{e.hostConnected&&e.hostConnected()}))}disconnectedCallback(){super.disconnectedCallback(),this.__controllers.forEach((e=>{e.hostDisconnected&&e.hostDisconnected()}))}addController(e){this.__controllers.add(e),void 0!==this.$&&this.isConnected&&e.hostConnected&&e.hostConnected()}removeController(e){this.__controllers.delete(e)}}))},2521:(e,t,o)=>{o.d(t,{S:()=>l});var r=o(9387),i=o(7913),s=o(6139),n=o(1914);let a;(0,r.xj)(!1),window.Vaadin||(window.Vaadin={}),window.Vaadin.registrations||(window.Vaadin.registrations=[]),window.Vaadin.developmentModeCallback||(window.Vaadin.developmentModeCallback={}),window.Vaadin.developmentModeCallback["vaadin-usage-statistics"]=function(){};const d=new Set,l=e=>class extends((0,n.U)(e)){static finalize(){super.finalize();const{is:e}=this;e&&!d.has(e)&&(window.Vaadin.registrations.push(this),d.add(e),window.Vaadin.developmentModeCallback&&(a=s.dx.debounce(a,i.t$,(()=>{window.Vaadin.developmentModeCallback["vaadin-usage-statistics"]()})),(0,s.Ex)(a)))}constructor(){super(),null===document.doctype&&console.warn('Vaadin components require the "standards mode" declaration. Please add <!DOCTYPE html> to the HTML document.')}}},262:(e,t,o)=>{function r(e){window.Vaadin&&window.Vaadin.templateRendererCallback?window.Vaadin.templateRendererCallback(e):e.querySelector("template")&&console.warn(`WARNING: <template> inside <${e.localName}> is no longer supported. Import @vaadin/polymer-legacy-adapter/template-renderer.js to enable compatibility.`)}o.d(t,{k:()=>r})},1940:(e,t,o)=>{o(6687),o(9416);var r=o(510),i=o(6570);const s=i.iv`
2
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[9314],{3550:(e,t,o)=>{o.d(t,{GF:()=>l,GO:()=>u,Gf:()=>i,LQ:()=>s,Qw:()=>h});let r=!1;function i(){let e=document.activeElement||document.body;for(;e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function s(){return r}function n(e){const t=e.style;if("hidden"===t.visibility||"none"===t.display)return!0;const o=window.getComputedStyle(e);return"hidden"===o.visibility||"none"===o.display}function a(e,t){const o=Math.max(e.tabIndex,0),r=Math.max(t.tabIndex,0);return 0===o||0===r?r>o:o>r}function d(e){const t=e.length;if(t<2)return e;const o=Math.ceil(t/2);return function(e,t){const o=[];for(;e.length>0&&t.length>0;)a(e[0],t[0])?o.push(t.shift()):o.push(e.shift());return o.concat(e,t)}(d(e.slice(0,o)),d(e.slice(o)))}function l(e){return null===e.offsetParent&&0===e.clientWidth&&0===e.clientHeight||n(e)}function h(e){return e.getRootNode().activeElement===e}function c(e,t){if(e.nodeType!==Node.ELEMENT_NODE||n(e))return!1;const o=e,r=function(e){if(!function(e){return!e.matches('[tabindex="-1"]')&&(e.matches("input, select, textarea, button, object")?e.matches(":not([disabled])"):e.matches("a[href], area[href], iframe, [tabindex], [contentEditable]"))}(e))return-1;const t=e.getAttribute("tabindex")||0;return Number(t)}(o);let i=r>0;r>=0&&t.push(o);let s=[];return s="slot"===o.localName?o.assignedNodes({flatten:!0}):(o.shadowRoot||o).children,[...s].forEach((e=>{i=c(e,t)||i})),i}function u(e){const t=[];return c(e,t)?d(t):t}window.addEventListener("keydown",(()=>{r=!0}),{capture:!0}),window.addEventListener("mousedown",(()=>{r=!1}),{capture:!0})},61037:(e,t,o)=>{o.d(t,{Dt:()=>s,G6:()=>h,T:()=>c,gn:()=>l,i7:()=>n,vU:()=>a});const r=e=>e.test(navigator.userAgent),i=e=>e.test(navigator.platform),s=r(/Android/u),n=r(/Chrome/u)&&/Google Inc/u.test(navigator.vendor),a=r(/Firefox/u),d=i(/^iPad/u)||i(/^Mac/u)&&navigator.maxTouchPoints>1,l=i(/^iPhone/u)||d,h=r(/^((?!chrome|android).)*safari/iu),c=(()=>{try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}})()},16155:(e,t,o)=>{o.d(t,{k:()=>r});const r=(0,o(91014).o)((e=>"function"==typeof e.prototype.addController?e:class extends e{constructor(){super(),this.__controllers=new Set}connectedCallback(){super.connectedCallback(),this.__controllers.forEach((e=>{e.hostConnected&&e.hostConnected()}))}disconnectedCallback(){super.disconnectedCallback(),this.__controllers.forEach((e=>{e.hostDisconnected&&e.hostDisconnected()}))}addController(e){this.__controllers.add(e),void 0!==this.$&&this.isConnected&&e.hostConnected&&e.hostConnected()}removeController(e){this.__controllers.delete(e)}}))},12521:(e,t,o)=>{o.d(t,{S:()=>l});var r=o(89387),i=o(87913),s=o(36139),n=o(51914);let a;(0,r.xj)(!1),window.Vaadin||(window.Vaadin={}),window.Vaadin.registrations||(window.Vaadin.registrations=[]),window.Vaadin.developmentModeCallback||(window.Vaadin.developmentModeCallback={}),window.Vaadin.developmentModeCallback["vaadin-usage-statistics"]=function(){};const d=new Set,l=e=>class extends((0,n.U)(e)){static finalize(){super.finalize();const{is:e}=this;e&&!d.has(e)&&(window.Vaadin.registrations.push(this),d.add(e),window.Vaadin.developmentModeCallback&&(a=s.dx.debounce(a,i.t$,(()=>{window.Vaadin.developmentModeCallback["vaadin-usage-statistics"]()})),(0,s.Ex)(a)))}constructor(){super(),null===document.doctype&&console.warn('Vaadin components require the "standards mode" declaration. Please add <!DOCTYPE html> to the HTML document.')}}},40262:(e,t,o)=>{function r(e){window.Vaadin&&window.Vaadin.templateRendererCallback?window.Vaadin.templateRendererCallback(e):e.querySelector("template")&&console.warn(`WARNING: <template> inside <${e.localName}> is no longer supported. Import @vaadin/polymer-legacy-adapter/template-renderer.js to enable compatibility.`)}o.d(t,{k:()=>r})},1940:(e,t,o)=>{o(26687),o(29416);var r=o(90510),i=o(46570);const s=i.iv`
3
3
  /* Optical centering */
4
4
  :host::before,
5
5
  :host::after {
@@ -97,7 +97,7 @@
97
97
  transform: scale(1.02);
98
98
  }
99
99
  }
100
- `;(0,i.hC)("vaadin-dialog-overlay",[r.I,s],{moduleId:"lumo-dialog"});var n=o(4241),a=o(2807),d=o(1914),l=o(6196),h=o(4457);const c=e=>class extends((0,h.F)(e)){static get properties(){return{headerTitle:{type:String},headerRenderer:{type:Object},footerRenderer:{type:Object}}}static get observers(){return["_headerFooterRendererChange(headerRenderer, footerRenderer, opened)","_headerTitleChanged(headerTitle, opened)"]}ready(){super.ready(),this.__resizeObserver=new ResizeObserver((()=>{this.__updateOverflow()})),this.__resizeObserver.observe(this.$.resizerContainer),this.$.content.addEventListener("scroll",(()=>{this.__updateOverflow()}))}__createContainer(e){const t=document.createElement("div");return t.setAttribute("slot",e),t}__clearContainer(e){e.innerHTML="",delete e._$litPart$}__initContainer(e,t){return e?this.__clearContainer(e):e=this.__createContainer(t),e}_headerFooterRendererChange(e,t,o){const r=this.__oldHeaderRenderer!==e;this.__oldHeaderRenderer=e;const i=this.__oldFooterRenderer!==t;this.__oldFooterRenderer=t;const s=this._oldOpenedFooterHeader!==o;this._oldOpenedFooterHeader=o,this.toggleAttribute("has-header",!!e),this.toggleAttribute("has-footer",!!t),r&&(e?this.headerContainer=this.__initContainer(this.headerContainer,"header-content"):this.headerContainer&&(this.headerContainer.remove(),this.headerContainer=null,this.__updateOverflow())),i&&(t?this.footerContainer=this.__initContainer(this.footerContainer,"footer"):this.footerContainer&&(this.footerContainer.remove(),this.footerContainer=null,this.__updateOverflow())),(e&&(r||s)||t&&(i||s))&&o&&this.requestContentUpdate()}_headerTitleChanged(e,t){this.toggleAttribute("has-title",!!e),t&&(e||this._oldHeaderTitle)&&this.requestContentUpdate(),this._oldHeaderTitle=e}_headerTitleRenderer(){this.headerTitle?(this.headerTitleElement||(this.headerTitleElement=document.createElement("h2"),this.headerTitleElement.setAttribute("slot","title"),this.headerTitleElement.classList.add("draggable")),this.appendChild(this.headerTitleElement),this.headerTitleElement.textContent=this.headerTitle):this.headerTitleElement&&(this.headerTitleElement.remove(),this.headerTitleElement=null)}requestContentUpdate(){super.requestContentUpdate(),this.headerContainer&&(this.headerContainer.parentElement||this.appendChild(this.headerContainer),this.headerRenderer&&this.headerRenderer.call(this.owner,this.headerContainer,this.owner)),this.footerContainer&&(this.footerContainer.parentElement||this.appendChild(this.footerContainer),this.footerRenderer&&this.footerRenderer.call(this.owner,this.footerContainer,this.owner)),this._headerTitleRenderer(),this.__updateOverflow()}setBounds(e){const t=this.$.overlay,o={...e};"absolute"!==t.style.position&&(t.style.position="absolute",this.setAttribute("has-bounds-set","")),Object.keys(o).forEach((e=>{"number"==typeof o[e]&&(o[e]=`${o[e]}px`)})),Object.assign(t.style,o)}getBounds(){const e=this.$.overlay.getBoundingClientRect(),t=this.getBoundingClientRect();return{top:e.top-t.top,left:e.left-t.left,width:e.width,height:e.height}}__updateOverflow(){let e="";if(this.hasAttribute("has-header")||this.hasAttribute("has-footer")||this.headerTitle){const t=this.$.content;t.scrollTop>0&&(e+=" top"),t.scrollTop<t.scrollHeight-t.clientHeight&&(e+=" bottom")}const t=e.trim();t.length>0&&this.getAttribute("overflow")!==t?this.setAttribute("overflow",t):0===t.length&&this.hasAttribute("overflow")&&this.removeAttribute("overflow")}};var u=o(235);const p=u.iv`
100
+ `;(0,i.hC)("vaadin-dialog-overlay",[r.I,s],{moduleId:"lumo-dialog"});var n=o(74241),a=o(52807),d=o(51914),l=o(6196),h=o(44457);const c=e=>class extends((0,h.F)(e)){static get properties(){return{headerTitle:{type:String},headerRenderer:{type:Object},footerRenderer:{type:Object}}}static get observers(){return["_headerFooterRendererChange(headerRenderer, footerRenderer, opened)","_headerTitleChanged(headerTitle, opened)"]}ready(){super.ready(),this.__resizeObserver=new ResizeObserver((()=>{this.__updateOverflow()})),this.__resizeObserver.observe(this.$.resizerContainer),this.$.content.addEventListener("scroll",(()=>{this.__updateOverflow()}))}__createContainer(e){const t=document.createElement("div");return t.setAttribute("slot",e),t}__clearContainer(e){e.innerHTML="",delete e._$litPart$}__initContainer(e,t){return e?this.__clearContainer(e):e=this.__createContainer(t),e}_headerFooterRendererChange(e,t,o){const r=this.__oldHeaderRenderer!==e;this.__oldHeaderRenderer=e;const i=this.__oldFooterRenderer!==t;this.__oldFooterRenderer=t;const s=this._oldOpenedFooterHeader!==o;this._oldOpenedFooterHeader=o,this.toggleAttribute("has-header",!!e),this.toggleAttribute("has-footer",!!t),r&&(e?this.headerContainer=this.__initContainer(this.headerContainer,"header-content"):this.headerContainer&&(this.headerContainer.remove(),this.headerContainer=null,this.__updateOverflow())),i&&(t?this.footerContainer=this.__initContainer(this.footerContainer,"footer"):this.footerContainer&&(this.footerContainer.remove(),this.footerContainer=null,this.__updateOverflow())),(e&&(r||s)||t&&(i||s))&&o&&this.requestContentUpdate()}_headerTitleChanged(e,t){this.toggleAttribute("has-title",!!e),t&&(e||this._oldHeaderTitle)&&this.requestContentUpdate(),this._oldHeaderTitle=e}_headerTitleRenderer(){this.headerTitle?(this.headerTitleElement||(this.headerTitleElement=document.createElement("h2"),this.headerTitleElement.setAttribute("slot","title"),this.headerTitleElement.classList.add("draggable")),this.appendChild(this.headerTitleElement),this.headerTitleElement.textContent=this.headerTitle):this.headerTitleElement&&(this.headerTitleElement.remove(),this.headerTitleElement=null)}requestContentUpdate(){super.requestContentUpdate(),this.headerContainer&&(this.headerContainer.parentElement||this.appendChild(this.headerContainer),this.headerRenderer&&this.headerRenderer.call(this.owner,this.headerContainer,this.owner)),this.footerContainer&&(this.footerContainer.parentElement||this.appendChild(this.footerContainer),this.footerRenderer&&this.footerRenderer.call(this.owner,this.footerContainer,this.owner)),this._headerTitleRenderer(),this.__updateOverflow()}setBounds(e){const t=this.$.overlay,o={...e};"absolute"!==t.style.position&&(t.style.position="absolute",this.setAttribute("has-bounds-set","")),Object.keys(o).forEach((e=>{"number"==typeof o[e]&&(o[e]=`${o[e]}px`)})),Object.assign(t.style,o)}getBounds(){const e=this.$.overlay.getBoundingClientRect(),t=this.getBoundingClientRect();return{top:e.top-t.top,left:e.left-t.left,width:e.width,height:e.height}}__updateOverflow(){let e="";if(this.hasAttribute("has-header")||this.hasAttribute("has-footer")||this.headerTitle){const t=this.$.content;t.scrollTop>0&&(e+=" top"),t.scrollTop<t.scrollHeight-t.clientHeight&&(e+=" bottom")}const t=e.trim();t.length>0&&this.getAttribute("overflow")!==t?this.setAttribute("overflow",t):0===t.length&&this.hasAttribute("overflow")&&this.removeAttribute("overflow")}};var u=o(9392);const p=u.iv`
101
101
  [part='header'],
102
102
  [part='header-content'],
103
103
  [part='footer'] {
@@ -280,7 +280,7 @@
280
280
  <footer part="footer"><slot name="footer"></slot></footer>
281
281
  </section>
282
282
  </div>
283
- `}}(0,a.M)(m);var g=o(2521),f=o(9320),w=o(262),b=o(1462);const y=e=>class extends e{static get properties(){return{opened:{type:Boolean,value:!1,notify:!0},noCloseOnOutsideClick:{type:Boolean,value:!1},noCloseOnEsc:{type:Boolean,value:!1},modeless:{type:Boolean,value:!1}}}ready(){super.ready();const e=this.$.overlay;e.addEventListener("vaadin-overlay-outside-click",this._handleOutsideClick.bind(this)),e.addEventListener("vaadin-overlay-escape-press",this._handleEscPress.bind(this)),this._overlayElement=e}connectedCallback(){super.connectedCallback(),this.__restoreOpened&&(this.opened=!0)}disconnectedCallback(){super.disconnectedCallback(),setTimeout((()=>{this.isConnected||(this.__restoreOpened=this.opened,this.opened=!1)}))}_onOverlayOpened(e){!1===e.detail.value&&(this.opened=!1)}_handleOutsideClick(e){this.noCloseOnOutsideClick&&e.preventDefault()}_handleEscPress(e){this.noCloseOnEsc&&e.preventDefault()}_bringOverlayToFront(){this.modeless&&this._overlayElement.bringToFront()}};var _=o(1037);function C(e){return e.touches?e.touches[0]:e}function z(e){return e.clientX>=0&&e.clientX<=window.innerWidth&&e.clientY>=0&&e.clientY<=window.innerHeight}const x=e=>class extends e{static get properties(){return{draggable:{type:Boolean,value:!1,reflectToAttribute:!0},_touchDevice:{type:Boolean,value:_.T},__dragHandleClassName:{type:String}}}async ready(){super.ready(),this._originalBounds={},this._originalMouseCoords={},this._startDrag=this._startDrag.bind(this),this._drag=this._drag.bind(this),this._stopDrag=this._stopDrag.bind(this),await new Promise(requestAnimationFrame),this.$.overlay.$.overlay.addEventListener("mousedown",this._startDrag),this.$.overlay.$.overlay.addEventListener("touchstart",this._startDrag)}_startDrag(e){if(!("touchstart"===e.type&&e.touches.length>1)&&this.draggable&&(0===e.button||e.touches)){const t=this.$.overlay.$.resizerContainer,o=e.target===t,r=e.offsetX>t.clientWidth||e.offsetY>t.clientHeight,i=e.target===this.$.overlay.$.content,s=e.composedPath().some(((e,t)=>{if(!e.classList)return!1;const o=e.classList.contains(this.__dragHandleClassName||"draggable"),r=e.classList.contains("draggable-leaf-only"),i=0===t;return r&&i||o&&(!r||i)}));if(o&&!r||i||s){s||e.preventDefault(),this._originalBounds=this.$.overlay.getBounds();const t=C(e);this._originalMouseCoords={top:t.pageY,left:t.pageX},window.addEventListener("mouseup",this._stopDrag),window.addEventListener("touchend",this._stopDrag),window.addEventListener("mousemove",this._drag),window.addEventListener("touchmove",this._drag),"absolute"!==this.$.overlay.$.overlay.style.position&&this.$.overlay.setBounds(this._originalBounds)}}}_drag(e){const t=C(e);if(z(t)){const e=this._originalBounds.top+(t.pageY-this._originalMouseCoords.top),o=this._originalBounds.left+(t.pageX-this._originalMouseCoords.left);this.$.overlay.setBounds({top:e,left:o})}}_stopDrag(){window.removeEventListener("mouseup",this._stopDrag),window.removeEventListener("touchend",this._stopDrag),window.removeEventListener("mousemove",this._drag),window.removeEventListener("touchmove",this._drag)}},E=e=>class extends e{static get properties(){return{renderer:{type:Object},headerTitle:String,headerRenderer:{type:Object},footerRenderer:{type:Object}}}requestContentUpdate(){this._overlayElement&&this._overlayElement.requestContentUpdate()}},k=e=>class extends e{static get properties(){return{resizable:{type:Boolean,value:!1,reflectToAttribute:!0}}}async ready(){super.ready(),this._originalBounds={},this._originalMouseCoords={},this._resizeListeners={start:{},resize:{},stop:{}},await new Promise(requestAnimationFrame),this._addResizeListeners()}_addResizeListeners(){["n","e","s","w","nw","ne","se","sw"].forEach((e=>{const t=document.createElement("div");this._resizeListeners.start[e]=t=>this._startResize(t,e),this._resizeListeners.resize[e]=t=>this._resize(t,e),this._resizeListeners.stop[e]=()=>this._stopResize(e),1===e.length&&t.classList.add("edge"),t.classList.add("resizer"),t.classList.add(e),t.addEventListener("mousedown",this._resizeListeners.start[e]),t.addEventListener("touchstart",this._resizeListeners.start[e]),this.$.overlay.$.resizerContainer.appendChild(t)}))}_startResize(e,t){if(!("touchstart"===e.type&&e.touches.length>1)&&(0===e.button||e.touches)){e.preventDefault(),this._originalBounds=this.$.overlay.getBounds();const o=C(e);this._originalMouseCoords={top:o.pageY,left:o.pageX},window.addEventListener("mousemove",this._resizeListeners.resize[t]),window.addEventListener("touchmove",this._resizeListeners.resize[t]),window.addEventListener("mouseup",this._resizeListeners.stop[t]),window.addEventListener("touchend",this._resizeListeners.stop[t]),"absolute"!==this.$.overlay.$.overlay.style.position&&this.$.overlay.setBounds(this._originalBounds)}}_resize(e,t){const o=C(e);if(z(o)){const e=40;t.split("").forEach((t=>{switch(t){case"n":{const t=this._originalBounds.height-(o.pageY-this._originalMouseCoords.top),r=this._originalBounds.top+(o.pageY-this._originalMouseCoords.top);t>e&&this.$.overlay.setBounds({top:r,height:t});break}case"e":{const t=this._originalBounds.width+(o.pageX-this._originalMouseCoords.left);t>e&&this.$.overlay.setBounds({width:t});break}case"s":{const t=this._originalBounds.height+(o.pageY-this._originalMouseCoords.top);t>e&&this.$.overlay.setBounds({height:t});break}case"w":{const t=this._originalBounds.width-(o.pageX-this._originalMouseCoords.left),r=this._originalBounds.left+(o.pageX-this._originalMouseCoords.left);t>e&&this.$.overlay.setBounds({left:r,width:t});break}}}))}}_stopResize(e){window.removeEventListener("mousemove",this._resizeListeners.resize[e]),window.removeEventListener("touchmove",this._resizeListeners.resize[e]),window.removeEventListener("mouseup",this._resizeListeners.stop[e]),window.removeEventListener("touchend",this._resizeListeners.stop[e]),this.dispatchEvent(new CustomEvent("resize",{detail:this._getResizeDimensions()}))}_getResizeDimensions(){const e=this.$.overlay.$.resizerContainer.scrollTop,{width:t,height:o}=getComputedStyle(this.$.overlay.$.overlay),r=this.$.overlay.$.content;r.setAttribute("style","position: absolute; top: 0; right: 0; bottom: 0; left: 0; box-sizing: content-box; height: auto;");const{width:i,height:s}=getComputedStyle(r);return r.removeAttribute("style"),this.$.overlay.$.resizerContainer.scrollTop=e,{width:t,height:o,contentWidth:i,contentHeight:s}}};class L extends(x(k(E(y((0,f.u)((0,b.I)((0,g.S)(n.H3)))))))){static get template(){return n.dy`
283
+ `}}(0,a.M)(m);var g=o(12521),f=o(39320),w=o(40262),b=o(61462);const y=e=>class extends e{static get properties(){return{opened:{type:Boolean,value:!1,notify:!0},noCloseOnOutsideClick:{type:Boolean,value:!1},noCloseOnEsc:{type:Boolean,value:!1},modeless:{type:Boolean,value:!1}}}ready(){super.ready();const e=this.$.overlay;e.addEventListener("vaadin-overlay-outside-click",this._handleOutsideClick.bind(this)),e.addEventListener("vaadin-overlay-escape-press",this._handleEscPress.bind(this)),this._overlayElement=e}connectedCallback(){super.connectedCallback(),this.__restoreOpened&&(this.opened=!0)}disconnectedCallback(){super.disconnectedCallback(),setTimeout((()=>{this.isConnected||(this.__restoreOpened=this.opened,this.opened=!1)}))}_onOverlayOpened(e){!1===e.detail.value&&(this.opened=!1)}_handleOutsideClick(e){this.noCloseOnOutsideClick&&e.preventDefault()}_handleEscPress(e){this.noCloseOnEsc&&e.preventDefault()}_bringOverlayToFront(){this.modeless&&this._overlayElement.bringToFront()}};var _=o(61037);function C(e){return e.touches?e.touches[0]:e}function z(e){return e.clientX>=0&&e.clientX<=window.innerWidth&&e.clientY>=0&&e.clientY<=window.innerHeight}const x=e=>class extends e{static get properties(){return{draggable:{type:Boolean,value:!1,reflectToAttribute:!0},_touchDevice:{type:Boolean,value:_.T},__dragHandleClassName:{type:String}}}async ready(){super.ready(),this._originalBounds={},this._originalMouseCoords={},this._startDrag=this._startDrag.bind(this),this._drag=this._drag.bind(this),this._stopDrag=this._stopDrag.bind(this),await new Promise(requestAnimationFrame),this.$.overlay.$.overlay.addEventListener("mousedown",this._startDrag),this.$.overlay.$.overlay.addEventListener("touchstart",this._startDrag)}_startDrag(e){if(!("touchstart"===e.type&&e.touches.length>1)&&this.draggable&&(0===e.button||e.touches)){const t=this.$.overlay.$.resizerContainer,o=e.target===t,r=e.offsetX>t.clientWidth||e.offsetY>t.clientHeight,i=e.target===this.$.overlay.$.content,s=e.composedPath().some(((e,t)=>{if(!e.classList)return!1;const o=e.classList.contains(this.__dragHandleClassName||"draggable"),r=e.classList.contains("draggable-leaf-only"),i=0===t;return r&&i||o&&(!r||i)}));if(o&&!r||i||s){s||e.preventDefault(),this._originalBounds=this.$.overlay.getBounds();const t=C(e);this._originalMouseCoords={top:t.pageY,left:t.pageX},window.addEventListener("mouseup",this._stopDrag),window.addEventListener("touchend",this._stopDrag),window.addEventListener("mousemove",this._drag),window.addEventListener("touchmove",this._drag),"absolute"!==this.$.overlay.$.overlay.style.position&&this.$.overlay.setBounds(this._originalBounds)}}}_drag(e){const t=C(e);if(z(t)){const e=this._originalBounds.top+(t.pageY-this._originalMouseCoords.top),o=this._originalBounds.left+(t.pageX-this._originalMouseCoords.left);this.$.overlay.setBounds({top:e,left:o})}}_stopDrag(){window.removeEventListener("mouseup",this._stopDrag),window.removeEventListener("touchend",this._stopDrag),window.removeEventListener("mousemove",this._drag),window.removeEventListener("touchmove",this._drag)}},E=e=>class extends e{static get properties(){return{renderer:{type:Object},headerTitle:String,headerRenderer:{type:Object},footerRenderer:{type:Object}}}requestContentUpdate(){this._overlayElement&&this._overlayElement.requestContentUpdate()}},k=e=>class extends e{static get properties(){return{resizable:{type:Boolean,value:!1,reflectToAttribute:!0}}}async ready(){super.ready(),this._originalBounds={},this._originalMouseCoords={},this._resizeListeners={start:{},resize:{},stop:{}},await new Promise(requestAnimationFrame),this._addResizeListeners()}_addResizeListeners(){["n","e","s","w","nw","ne","se","sw"].forEach((e=>{const t=document.createElement("div");this._resizeListeners.start[e]=t=>this._startResize(t,e),this._resizeListeners.resize[e]=t=>this._resize(t,e),this._resizeListeners.stop[e]=()=>this._stopResize(e),1===e.length&&t.classList.add("edge"),t.classList.add("resizer"),t.classList.add(e),t.addEventListener("mousedown",this._resizeListeners.start[e]),t.addEventListener("touchstart",this._resizeListeners.start[e]),this.$.overlay.$.resizerContainer.appendChild(t)}))}_startResize(e,t){if(!("touchstart"===e.type&&e.touches.length>1)&&(0===e.button||e.touches)){e.preventDefault(),this._originalBounds=this.$.overlay.getBounds();const o=C(e);this._originalMouseCoords={top:o.pageY,left:o.pageX},window.addEventListener("mousemove",this._resizeListeners.resize[t]),window.addEventListener("touchmove",this._resizeListeners.resize[t]),window.addEventListener("mouseup",this._resizeListeners.stop[t]),window.addEventListener("touchend",this._resizeListeners.stop[t]),"absolute"!==this.$.overlay.$.overlay.style.position&&this.$.overlay.setBounds(this._originalBounds)}}_resize(e,t){const o=C(e);if(z(o)){const e=40;t.split("").forEach((t=>{switch(t){case"n":{const t=this._originalBounds.height-(o.pageY-this._originalMouseCoords.top),r=this._originalBounds.top+(o.pageY-this._originalMouseCoords.top);t>e&&this.$.overlay.setBounds({top:r,height:t});break}case"e":{const t=this._originalBounds.width+(o.pageX-this._originalMouseCoords.left);t>e&&this.$.overlay.setBounds({width:t});break}case"s":{const t=this._originalBounds.height+(o.pageY-this._originalMouseCoords.top);t>e&&this.$.overlay.setBounds({height:t});break}case"w":{const t=this._originalBounds.width-(o.pageX-this._originalMouseCoords.left),r=this._originalBounds.left+(o.pageX-this._originalMouseCoords.left);t>e&&this.$.overlay.setBounds({left:r,width:t});break}}}))}}_stopResize(e){window.removeEventListener("mousemove",this._resizeListeners.resize[e]),window.removeEventListener("touchmove",this._resizeListeners.resize[e]),window.removeEventListener("mouseup",this._resizeListeners.stop[e]),window.removeEventListener("touchend",this._resizeListeners.stop[e]),this.dispatchEvent(new CustomEvent("resize",{detail:this._getResizeDimensions()}))}_getResizeDimensions(){const e=this.$.overlay.$.resizerContainer.scrollTop,{width:t,height:o}=getComputedStyle(this.$.overlay.$.overlay),r=this.$.overlay.$.content;r.setAttribute("style","position: absolute; top: 0; right: 0; bottom: 0; left: 0; box-sizing: content-box; height: auto;");const{width:i,height:s}=getComputedStyle(r);return r.removeAttribute("style"),this.$.overlay.$.resizerContainer.scrollTop=e,{width:t,height:o,contentWidth:i,contentHeight:s}}};class L extends(x(k(E(y((0,f.u)((0,b.I)((0,g.S)(n.H3)))))))){static get template(){return n.dy`
284
284
  <style>
285
285
  :host {
286
286
  display: none !important;
@@ -300,14 +300,14 @@
300
300
  restore-focus-on-close
301
301
  focus-trap
302
302
  ></vaadin-dialog-overlay>
303
- `}static get is(){return"vaadin-dialog"}static get properties(){return{ariaLabel:{type:String,value:""}}}static get observers(){return["_openedChanged(opened)","_ariaLabelChanged(ariaLabel, headerTitle)","_rendererChanged(renderer, headerRenderer, footerRenderer)"]}ready(){super.ready(),this._overlayElement.setAttribute("role","dialog"),(0,w.k)(this)}_rendererChanged(e,t,o){this.$.overlay.setProperties({owner:this,renderer:e,headerRenderer:t,footerRenderer:o})}_openedChanged(e){this.$.overlay.opened=e}_ariaLabelChanged(e,t){e||t?this.$.overlay.setAttribute("aria-label",e||t):this.$.overlay.removeAttribute("aria-label")}}(0,a.M)(L)},3423:(e,t,o)=>{o.d(t,{a:()=>h});var r=o(4241),i=o(2807),s=o(1914),n=o(262),a=o(6570),d=o(4457),l=o(6196);(0,a.hC)("vaadin-overlay",l.r,{moduleId:"vaadin-overlay-styles"});class h extends((0,d.F)((0,a.Tb)((0,s.U)(r.H3)))){static get template(){return r.dy`
303
+ `}static get is(){return"vaadin-dialog"}static get properties(){return{ariaLabel:{type:String,value:""}}}static get observers(){return["_openedChanged(opened)","_ariaLabelChanged(ariaLabel, headerTitle)","_rendererChanged(renderer, headerRenderer, footerRenderer)"]}ready(){super.ready(),this._overlayElement.setAttribute("role","dialog"),(0,w.k)(this)}_rendererChanged(e,t,o){this.$.overlay.setProperties({owner:this,renderer:e,headerRenderer:t,footerRenderer:o})}_openedChanged(e){this.$.overlay.opened=e}_ariaLabelChanged(e,t){e||t?this.$.overlay.setAttribute("aria-label",e||t):this.$.overlay.removeAttribute("aria-label")}}(0,a.M)(L)},13423:(e,t,o)=>{o.d(t,{a:()=>h});var r=o(74241),i=o(52807),s=o(51914),n=o(40262),a=o(46570),d=o(44457),l=o(6196);(0,a.hC)("vaadin-overlay",l.r,{moduleId:"vaadin-overlay-styles"});class h extends((0,d.F)((0,a.Tb)((0,s.U)(r.H3)))){static get template(){return r.dy`
304
304
  <div id="backdrop" part="backdrop" hidden$="[[!withBackdrop]]"></div>
305
305
  <div part="overlay" id="overlay" tabindex="0">
306
306
  <div part="content" id="content">
307
307
  <slot></slot>
308
308
  </div>
309
309
  </div>
310
- `}static get is(){return"vaadin-overlay"}ready(){super.ready(),(0,n.k)(this)}}(0,i.M)(h)},6687:(e,t,o)=>{var r=o(510);(0,o(6570).hC)("vaadin-overlay",r.I,{moduleId:"lumo-vaadin-overlay"}),o(3423)},4173:(e,t,o)=>{o(4407);var r=o(6570),i=o(2463);const s=r.iv`
310
+ `}static get is(){return"vaadin-overlay"}ready(){super.ready(),(0,n.k)(this)}}(0,i.M)(h)},26687:(e,t,o)=>{var r=o(90510);(0,o(46570).hC)("vaadin-overlay",r.I,{moduleId:"lumo-vaadin-overlay"}),o(13423)},34173:(e,t,o)=>{o(24407);var r=o(46570),i=o(32463);const s=r.iv`
311
311
  :host {
312
312
  /* prettier-ignore */
313
313
  --lumo-font-family: -apple-system, BlinkMacSystemFont, 'Roboto', 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';