1var bt=Object.defineProperty;var vt=(r,s,e)=>s in r?bt(r,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[s]=e;var T=(r,s,e)=>vt(r,typeof s!="symbol"?s+"":s,e);import{p as ze,I as yt}from"./flow-component-renderer-D27yBGd1.js";import{o as Ke,q as je,D as E,N as B,v as H,Q as de,P as N,R as he,U as Ct,V as xt,i as me,W as $e,X as Ye,F as wt,h as X,Y as At,Z as It,_ as Q,$ as Qe,a0 as Et,a1 as $,C as Re,a2 as St,a3 as Xe,a4 as zt,a5 as Rt,a6 as Tt,a7 as Te,a8 as ge,a9 as Ze,aa as Je,ab as kt,ac as Ie,e as Ot,E as ke,ad as Pt,ae,af as Ft,ag as et,ah as Dt,ai as Mt,n as Lt,aj as $t,T as tt,ak as Bt,d as Ht,al as Nt,am as Vt,y as Be,j as Gt,an as Wt}from"./chunk-f7a69a4d1223482fa23ca562f5998949f1da189613abd1fcc56565b4c486605a-CrVZe_6c.js";import{d as V,i as O,r as P,T as re,a as qt,e as Ut,b as Kt,t as J,c as _e,E as jt,B as Yt,x as Qt}from"./indexhtml-Dpv2DOmv.js";import{D as Xt,I as Zt,F as Jt,a as ei,L as ti}from"./labelled-input-controller-CNeutd-O.js";import{D as we}from"./dom-if-B8CcW7aj.js";/** 2 * @license 3 * Copyright (c) 2023 - 2024 Vaadin Ltd. 4 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 5 */function Oe(r,s){return r.split(".").reduce((e,t)=>e?e[t]:void 0,s)}/** 6 * @license 7 * Copyright (c) 2016 - 2024 Vaadin Ltd. 8 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 9 */function ie(r){return r.__cells||Array.from(r.querySelectorAll('[part~="cell"]:not([part~="details-cell"])'))}function k(r,s){[...r.children].forEach(s)}function se(r,s){ie(r).forEach(s),r.__detailsCell&&s(r.__detailsCell)}function it(r,s,e){let t=1;r.forEach(i=>{t%10===0&&(t+=1),i._order=e+t*s,t+=1})}function Ce(r,s,e){switch(typeof e){case"boolean":r.toggleAttribute(s,e);break;case"string":r.setAttribute(s,e);break;default:r.removeAttribute(s);break}}function K(r,s,e){s||s===""?Ke(r,"part",e):je(r,"part",e)}function q(r,s,e){r.forEach(t=>{K(t,e,s)})}function ee(r,s){const e=ie(r);Object.entries(s).forEach(([t,i])=>{Ce(r,t,i);const o=`${t}-row`;K(r,i,o),q(e,`${o}-cell`,i)})}function He(r,s){const e=ie(r);Object.entries(s).forEach(([t,i])=>{const o=r.getAttribute(t);if(Ce(r,t,i),o){const n=`${t}-${o}-row`;K(r,!1,n),q(e,`${n}-cell`,!1)}if(i){const n=`${t}-${i}-row`;K(r,i,n),q(e,`${n}-cell`,i)}})}function Y(r,s,e,t,i){Ce(r,s,e),i&&K(r,!1,i),K(r,e,t||`${s}-cell`)}class U{constructor(s,e){this.__host=s,this.__callback=e,this.__currentSlots=[],this.__onMutation=this.__onMutation.bind(this),this.__observer=new MutationObserver(this.__onMutation),this.__observer.observe(s,{childList:!0}),this.__initialCallDebouncer=E.debounce(this.__initialCallDebouncer,B,()=>this.__onMutation())}disconnect(){this.__observer.disconnect(),this.__initialCallDebouncer.cancel(),this.__toggleSlotChangeListeners(!1)}flush(){this.__onMutation()}__toggleSlotChangeListeners(s){this.__currentSlots.forEach(e=>{s?e.addEventListener("slotchange",this.__onMutation):e.removeEventListener("slotchange",this.__onMutation)})}__onMutation(){const s=!this.__currentColumns;this.__currentColumns||(this.__currentColumns=[]);const e=U.getColumns(this.__host),t=e.filter(a=>!this.__currentColumns.includes(a)),i=this.__currentColumns.filter(a=>!e.includes(a)),o=this.__currentColumns.some((a,c)=>a!==e[c]);this.__currentColumns=e,this.__toggleSlotChangeListeners(!1),this.__currentSlots=[...this.__host.children].filter(a=>a instanceof HTMLSlotElement),this.__toggleSlotChangeListeners(!0),(s||t.length||i.length||o)&&this.__callback(t,i)}static __isColumnElement(s){return s.nodeType===Node.ELEMENT_NODE&&/\bcolumn\b/u.test(s.localName)}static getColumns(s){const e=[],t=s._isColumnElement||U.__isColumnElement;return[...s.children].forEach(i=>{t(i)?e.push(i):i instanceof HTMLSlotElement&&[...i.assignedElements({flatten:!0})].filter(o=>t(o)).forEach(o=>e.push(o))}),e}}/** 10 * @license 11 * Copyright (c) 2016 - 2024 Vaadin Ltd. 12 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 13 */const st=r=>class extends r{static get properties(){return{resizable:{type:Boolean,sync:!0,value(){if(this.localName==="vaadin-grid-column-group")return;const e=this.parentNode;return e&&e.localName==="vaadin-grid-column-group"&&e.resizable||!1}},frozen:{type:Boolean,value:!1,sync:!0},frozenToEnd:{type:Boolean,value:!1,sync:!0},rowHeader:{type:Boolean,value:!1,sync:!0},hidden:{type:Boolean,value:!1,sync:!0},header:{type:String,sync:!0},textAlign:{type:String,sync:!0},headerPartName:{type:String,sync:!0},footerPartName:{type:String,sync:!0},_lastFrozen:{type:Boolean,value:!1,sync:!0},_bodyContentHidden:{type:Boolean,value:!1,sync:!0},_firstFrozenToEnd:{type:Boolean,value:!1,sync:!0},_order:{type:Number,sync:!0},_reorderStatus:{type:Boolean,sync:!0},_emptyCells:Array,_headerCell:Object,_footerCell:Object,_grid:Object,__initialized:{type:Boolean,value:!0},headerRenderer:{type:Function,sync:!0},_headerRenderer:{type:Function,computed:"_computeHeaderRenderer(headerRenderer, header, __initialized)",sync:!0},footerRenderer:{type:Function,sync:!0},_footerRenderer:{type:Function,computed:"_computeFooterRenderer(footerRenderer, __initialized)",sync:!0},__gridColumnElement:{type:Boolean,value:!0}}}static get observers(){return["_widthChanged(width, _headerCell, _footerCell, _cells)","_frozenChanged(frozen, _headerCell, _footerCell, _cells)","_frozenToEndChanged(frozenToEnd, _headerCell, _footerCell, _cells)","_flexGrowChanged(flexGrow, _headerCell, _footerCell, _cells)","_textAlignChanged(textAlign, _cells, _headerCell, _footerCell)","_orderChanged(_order, _headerCell, _footerCell, _cells)","_lastFrozenChanged(_lastFrozen)","_firstFrozenToEndChanged(_firstFrozenToEnd)","_onRendererOrBindingChanged(_renderer, _cells, _bodyContentHidden, path)","_onHeaderRendererOrBindingChanged(_headerRenderer, _headerCell, path, header)","_onFooterRendererOrBindingChanged(_footerRenderer, _footerCell)","_resizableChanged(resizable, _headerCell)","_reorderStatusChanged(_reorderStatus, _headerCell, _footerCell, _cells)","_hiddenChanged(hidden, _headerCell, _footerCell, _cells)","_rowHeaderChanged(rowHeader, _cells)","__headerFooterPartNameChanged(_headerCell, _footerCell, headerPartName, footerPartName)"]}get _grid(){return this._gridValue||(this._gridValue=this._findHostGrid()),this._gridValue}get _allCells(){return[].concat(this._cells||[]).concat(this._emptyCells||[]).concat(this._headerCell).concat(this._footerCell).filter(e=>e)}connectedCallback(){super.connectedCallback(),requestAnimationFrame(()=>
13{this._grid&&this._allCells.forEach(e=>{e._content.parentNode||this._grid.appendChild(e._content)})})}disconnectedCallback(){super.disconnectedCallback(),requestAnimationFrame(()=>{this._grid||this._allCells.forEach(e=>{e._content.parentNode&&e._content.parentNode.removeChild(e._content)})}),this._gridValue=void 0}ready(){super.ready(),ze(this)}_findHostGrid(){let e=this;for(;e&&!/^vaadin.*grid(-pro)?$/u.test(e.localName);)e=e.assignedSlot?e.assignedSlot.parentNode:e.parentNode;return e||void 0}_renderHeaderAndFooter(){this._renderHeaderCellContent(this._headerRenderer,this._headerCell),this._renderFooterCellContent(this._footerRenderer,this._footerCell)}_flexGrowChanged(e){this.parentElement&&this.parentElement._columnPropChanged&&this.parentElement._columnPropChanged("flexGrow"),this._allCells.forEach(t=>{t.style.flexGrow=e})}_orderChanged(e){this._allCells.forEach(t=>{t.style.order=e})}_widthChanged(e){this.parentElement&&this.parentElement._columnPropChanged&&this.parentElement._columnPropChanged("width"),this._allCells.forEach(t=>{t.style.width=e})}_frozenChanged(e){this.parentElement&&this.parentElement._columnPropChanged&&this.parentElement._columnPropChanged("frozen",e),this._allCells.forEach(t=>{Y(t,"frozen",e)}),this._grid&&this._grid._frozenCellsChanged&&this._grid._frozenCellsChanged()}_frozenToEndChanged(e){this.parentElement&&this.parentElement._columnPropChanged&&this.parentElement._columnPropChanged("frozenToEnd",e),this._allCells.forEach(t=>{this._grid&&t.parentElement===this._grid.$.sizer||Y(t,"frozen-to-end",e)}),this._grid&&this._grid._frozenCellsChanged&&this._grid._frozenCellsChanged()}_lastFrozenChanged(e){this._allCells.forEach(t=>{Y(t,"last-frozen",e)}),this.parentElement&&this.parentElement._columnPropChanged&&(this.parentElement._lastFrozen=e)}_firstFrozenToEndChanged(e){this._allCells.forEach(t=>{this._grid&&t.parentElement===this._grid.$.sizer||Y(t,"first-frozen-to-end",e)}),this.parentElement&&this.parentElement._columnPropChanged&&(this.parentElement._firstFrozenToEnd=e)}_rowHeaderChanged(e,t){t&&t.forEach(i=>{i.setAttribute("role",e?"rowheader":"gridcell")})}_generateHeader(e){return e.substr(e.lastIndexOf(".")+1).replace(/([A-Z])/gu,"-$1").toLowerCase().replace(/-/gu," ").replace(/^./u,t=>t.toUpperCase())}_reorderStatusChanged(e){const t=this.__previousReorderStatus,i=t?`reorder-${t}-cell`:"",o=`reorder-${e}-cell`;this._allCells.forEach(n=>{Y(n,"reorder-status",e,o,i)}),this.__previousReorderStatus=e}_resizableChanged(e,t){e===void 0||t===void 0||t&&[t].concat(this._emptyCells).forEach(i=>{if(i){const o=i.querySelector('[part~="resize-handle"]');if(o&&i.removeChild(o),e){const n=document.createElement("div");n.setAttribute("part","resize-handle"),i.appendChild(n)}}})}_textAlignChanged(e){if(e===void 0||this._grid===void 0)return;if(["start","end","center"].indexOf(e)===-1){console.warn('textAlign can only be set as "start", "end" or "center"');return}let t;getComputedStyle(this._grid).direction==="ltr"?e==="start"?t="left":e==="end"&&(t="right"):e==="start"?t="right":e==="end"&&(t="left"),this._allCells.forEach(i=>{i._content.style.textAlign=e,getComputedStyle(i._content).textAlign!==e&&(i._content.style.textAlign=t)})}_hiddenChanged(e){this.parentElement&&this.parentElement._columnPropChanged&&this.parentElement._columnPropChanged("hidden",e),!!e!=!!this._previousHidden&&this._grid&&(e===!0&&this._allCells.forEach(t=>{t._content.parentNode&&t._content.parentNode.removeChild(t._content)}),this._grid._debouncerHiddenChanged=E.debounce(this._grid._debouncerHiddenChanged,H,()=>{this._grid&&this._grid._renderColumnTree&&this._grid._renderColumnTree(this._grid._columnTree)}),this._grid._debounceUpdateFrozenColumn&&this._grid._debounceUpdateFrozenColumn(),this._grid._resetKeyboardNavigation&&this._grid._resetKeyboardNavigation()),this._previousHidden=e}_runRenderer(e,t,i){const o=i&&i.item&&!t.parentElement.hidden;if(!(o||e===this._headerRenderer||e===this._footerRenderer))return;const a=[t._content,this];o&&a.push(i),e.apply(this,a)}__renderCellsContent(e,t){this.hidden||!this._grid||t.forEach(i=>
13{if(!i.parentElement)return;const o=this._grid.__getRowModel(i.parentElement);e&&(i._renderer!==e&&this._clearCellContent(i),i._renderer=e,this._runRenderer(e,i,o))})}_clearCellContent(e){e._content.innerHTML="",delete e._content._$litPart$}_renderHeaderCellContent(e,t){!t||!e||(this.__renderCellsContent(e,[t]),this._grid&&t.parentElement&&this._grid.__debounceUpdateHeaderFooterRowVisibility(t.parentElement))}_onHeaderRendererOrBindingChanged(e,t,...i){this._renderHeaderCellContent(e,t)}__headerFooterPartNameChanged(e,t,i,o){[{cell:e,partName:i},{cell:t,partName:o}].forEach(({cell:n,partName:a})=>{if(n){const c=n.__customParts||[];n.part.remove(...c),n.__customParts=a?a.trim().split(" "):[],n.part.add(...n.__customParts)}})}_renderBodyCellsContent(e,t){!t||!e||this.__renderCellsContent(e,t)}_onRendererOrBindingChanged(e,t,...i){this._renderBodyCellsContent(e,t)}_renderFooterCellContent(e,t){!t||!e||(this.__renderCellsContent(e,[t]),this._grid&&t.parentElement&&this._grid.__debounceUpdateHeaderFooterRowVisibility(t.parentElement))}_onFooterRendererOrBindingChanged(e,t){this._renderFooterCellContent(e,t)}__setTextContent(e,t){e.textContent!==t&&(e.textContent=t)}__textHeaderRenderer(){this.__setTextContent(this._headerCell._content,this.header)}_defaultHeaderRenderer(){this.path&&this.__setTextContent(this._headerCell._content,this._generateHeader(this.path))}_defaultRenderer(e,t,{item:i}){this.path&&this.__setTextContent(e,Oe(this.path,i))}_defaultFooterRenderer(){}_computeHeaderRenderer(e,t){return e||(t!=null?this.__textHeaderRenderer:this._defaultHeaderRenderer)}_computeRenderer(e){return e||this._defaultRenderer}_computeFooterRenderer(e){return e||this._defaultFooterRenderer}},ii=r=>class extends st(de(r)){static get properties(){return{width:{type:String,value:"100px",sync:!0},flexGrow:{type:Number,value:1,sync:!0},renderer:{type:Function,sync:!0},_renderer:{type:Function,computed:"_computeRenderer(renderer, __initialized)",sync:!0},path:{type:String,sync:!0},autoWidth:{type:Boolean,value:!1},_focusButtonMode:{type:Boolean,value:!1},_cells:{type:Array,sync:!0}}}};/** 14 * @license 15 * Copyright (c) 2016 - 2024 Vaadin Ltd. 16 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 17 */class rt extends ii(N){static get is(){return"vaadin-grid-column"}}V(rt);/** 18 * @license 19 * Copyright (c) 2016 - 2024 Vaadin Ltd. 20 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 21 */const si=r=>class extends r{static get properties(){return{width:{type:String,value:"58px",sync:!0},autoWidth:{type:Boolean,value:!0},flexGrow:{type:Number,value:0,sync:!0},selectAll:{type:Boolean,value:!1,notify:!0,sync:!0},autoSelect:{type:Boolean,value:!1,sync:!0},dragSelect:{type:Boolean,value:!1,sync:!0},_indeterminate:{type:Boolean,sync:!0},_selectAllHidden:Boolean}}static get observers(){return["_onHeaderRendererOrBindingChanged(_headerRenderer, _headerCell, path, header, selectAll, _indeterminate, _selectAllHidden)"]}_defaultHeaderRenderer(e,t){let i=e.firstElementChild;i||(i=document.createElement("vaadin-checkbox"),i.setAttribute("aria-label","Select All"),i.classList.add("vaadin-grid-select-all-checkbox"),e.appendChild(i),i.addEventListener("checked-changed",this.__onSelectAllCheckedChanged.bind(this)));const o=this.__isChecked(this.selectAll,this._indeterminate);i.__rendererChecked=o,i.checked=o,i.hidden=this._selectAllHidden,i.indeterminate=this._indeterminate}_defaultRenderer(e,t,{item:i,selected:o}){let n=e.firstElementChild;n||(n=document.createElement("vaadin-checkbox"),n.setAttribute("aria-label","Select Row"),e.appendChild(n),n.addEventListener("checked-changed",this.__onSelectRowCheckedChanged.bind(this)),he(e,"track",this.__onCellTrack.bind(this)),e.addEventListener("mousedown",this.__onCellMouseDown.bind(this)),e.addEventListener("click",this.__onCellClick.bind(this))),n.__item=i,n.__rendererChecked=o,n.checked=o}__onSelectAllCheckedChanged(e){e.target.checked!==e.target.__rendererChecked&&(this._indeterminate||e.target.checked?this._selectAll():this._deselectAll())}__onSelectRowCheckedChanged(e){e.target.checked!==e.target.__rendererChecked&&(e.target.checked?this._selectItem(e.target.__item):this._deselectItem(e.target.__item))}__onCellTrack(e){if(this.dragSelect)if(this.__dragCurrentY=e.detail.y,this.__dragDy=e.detail.dy,e.detail.state==="start"){const i=this._grid._getRenderedRows().find(o=>o.contains(e.currentTarget.assignedSlot));this.__selectOnDrag=!this._grid._isSelected(i._item),this.__dragStartIndex=i.index,this.__dragStartItem=i._item,this.__dragAutoScroller()}else e.detail.state==="end"&&(this.__dragStartItem&&this.__toggleItem(this.__dragStartItem,this.__selectOnDrag),setTimeout(()=>{this.__dragStartIndex=void 0}))}__onCellMouseDown(e){this.dragSelect&&e.preventDefault()}__onCellClick(e){this.__dragStartIndex!==void 0&&e.preventDefault()}_onCellKeyDown(e){const t=e.composedPath()[0];if(e.keyCode===32&&(t===this._headerCell||this._cells.includes(t)&&!this.autoSelect)){const i=t._content.firstElementChild;i.checked=!i.checked}}__dragAutoScroller(){if(this.__dragStartIndex===void 0)return;const e=this._grid._getRenderedRows(),t=e.find(c=>{const p=c.getBoundingClientRect();return this.__dragCurrentY>=p.top&&this.__dragCurrentY<=p.bottom});let i=t?t.index:void 0;const o=this.__getScrollableArea();this.__dragCurrentY<o.top?i=this._grid._firstVisibleIndex:this.__dragCurrentY>o.bottom&&(i=this._grid._lastVisibleIndex),i!==void 0&&e.forEach(c=>{(i>this.__dragStartIndex&&c.index>=this.__dragStartIndex&&c.index<=i||i<this.__dragStartIndex&&c.index<=this.__dragStartIndex&&c.index>=i)&&(this.__toggleItem(c._item,this.__selectOnDrag),this.__dragStartItem=void 0)});const n=o.height*.15,a=10;if(this.__dragDy<0&&this.__dragCurrentY<o.top+n){const c=o.top+n-this.__dragCurrentY,p=Math.min(1,c/n);this._grid.$.table.scrollTop-=p*a}if(this.__dragDy>0&&this.__dragCurrentY>o.bottom-n){const c=this.__dragCurrentY-(o.bottom-n),p=Math.min(1,c/n);this._grid.$.table.scrollTop+=p*a}setTimeout(()=>this.__dragAutoScroller(),10)}__getScrollableArea(){const e=this._grid.$.table.getBoundingClientRect(),t=this._grid.$.header.getBoundingClientRect(),i=this._grid.$.footer.getBoundingClientRect();return{top:e.top+t.height,bottom:e.bottom-i.height,left:e.left,right:e.right,height:e.height-t.height-i.height,width:e.width}}_selectAll(){}_deselectAll(){}_selectItem(e){}_deselectItem(e){}__toggleItem(e,t){t!==this._grid._isSelected(e)&&(t?this._selectItem(e):this._deselectItem(e))}__isChecked(e,t){return t||e}};class Ee extends si(rt){static get is(){return"vaadin-grid-flow-selection-column"}static get properties(){return{autoWidth:{type:Boolean,value:!0},width:{type:String,value:"56px"}}}_defaultHeaderRenderer(s,e){super._defaultHeaderRenderer(s,e);const t=s.firstElementChild;t&&(t.id="selectAllCheckbox")}
21_selectAll(){this.selectAll=!0,this.$server.selectAll()}_deselectAll(){this.selectAll=!1,this.$server.deselectAll()}_selectItem(s){this._grid.$connector.doSelection([s],!0)}_deselectItem(s){this._grid.$connector.doDeselection([s],!0),this.selectAll=!1}}customElements.define(Ee.is,Ee);const ot=O` 22 :host { 23 display: flex; 24 align-items: center; 25 box-sizing: border-box; 26 font-family: var(--lumo-font-family); 27 font-size: var(--lumo-font-size-m); 28 line-height: var(--lumo-line-height-xs); 29 padding: 0.5em calc(var(--lumo-space-l) + var(--lumo-border-radius-m) / 4) 0.5em 30 var(--_lumo-list-box-item-padding-left, calc(var(--lumo-border-radius-m) / 4)); 31 min-height: var(--lumo-size-m); 32 outline: none; 33 border-radius: var(--lumo-border-radius-m); 34 cursor: var(--lumo-clickable-cursor); 35 -webkit-font-smoothing: antialiased; 36 -moz-osx-font-smoothing: grayscale; 37 -webkit-tap-highlight-color: var(--lumo-primary-color-10pct); 38 --_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct)); 39 --_focus-ring-width: var(--vaadin-focus-ring-width, 2px); 40 --_selection-color-text: var(--vaadin-selection-color-text, var(--lumo-primary-text-color)); 41 } 42 43 /* Checkmark */ 44 [part='checkmark']::before { 45 display: var(--_lumo-item-selected-icon-display, none); 46 content: var(--lumo-icons-checkmark); 47 font-family: lumo-icons; 48 font-size: var(--lumo-icon-size-m); 49 line-height: 1; 50 font-weight: normal; 51 width: 1em; 52 height: 1em; 53 margin: calc((1 - var(--lumo-line-height-xs)) * var(--lumo-font-size-m) / 2) 0; 54 color: var(--_selection-color-text); 55 flex: none; 56 opacity: 0; 57 transition: 58 transform 0.2s cubic-bezier(0.12, 0.32, 0.54, 2), 59 opacity 0.1s; 60 } 61 62 :host([selected]) [part='checkmark']::before { 63 opacity: 1; 64 } 65 66 :host([active]:not([selected])) [part='checkmark']::before { 67 transform: scale(0.8); 68 opacity: 0; 69 transition-duration: 0s; 70 } 71 72 [part='content'] { 73 flex: auto; 74 } 75 76 /* Disabled */ 77 :host([disabled]) { 78 color: var(--lumo-disabled-text-color); 79 cursor: default; 80 pointer-events: none; 81 } 82 83 /* TODO a workaround until we have "focus-follows-mouse". After that, use the hover style for focus-ring as well */ 84 @media (any-hover: hover) { 85 :host(:hover:not([disabled])) { 86 background-color: var(--lumo-primary-color-10pct); 87 } 88 } 89 90 :host([focus-ring]:not([disabled])) { 91 box-shadow: inset 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color); 92 } 93 94 /* RTL specific styles */ 95 :host([dir='rtl']) { 96 padding-left: calc(var(--lumo-space-l) + var(--lumo-border-radius-m) / 4); 97 padding-right: var(--_lumo-list-box-item-padding-left, calc(var(--lumo-border-radius-m) / 4)); 98 } 99 100 /* Slotted icons */ 101 :host ::slotted(vaadin-icon) { 102 width: var(--lumo-icon-size-m); 103 height: var(--lumo-icon-size-m); 104 } 105`;P("vaadin-item",ot,{moduleId:"lumo-item"});const ri=O` 106 /* :hover needed to workaround https://github.com/vaadin/web-components/issues/3133 */ 107 :host(:hover) { 108 user-select: none; 109 -ms-user-select: none; 110 -webkit-user-select: none; 111 } 112 113 :host([role='menuitem'][menu-item-checked]) [part='checkmark']::before { 114 opacity: 1; 115 } 116 117 :host([aria-haspopup='true'])::after { 118 font-family: lumo-icons; 119 font-size: var(--lumo-icon-size-xs); 120 content: var(--lumo-icons-angle-right); 121 color: var(--lumo-tertiary-text-color); 122 } 123 124 :host(:not([dir='rtl'])[aria-haspopup='true'])::after { 125 margin-right: calc(var(--lumo-space-m) * -1); 126 padding-left: var(--lumo-space-m); 127 } 128 129 :host([expanded]) { 130 background-color: var(--lumo-primary-color-10pct); 131 } 132 133 /* RTL styles */ 134 :host([dir='rtl'][aria-haspopup='true'])::after { 135 content: var(--lumo-icons-angle-left); 136 margin-left: calc(var(--lumo-space-m) * -1); 137 padding-right: var(--lumo-space-m); 138 } 139`;P("vaadin-context-menu-item",[ot,ri],{moduleId:"lumo-context-menu-item"});const nt=O` 140 :host { 141 -webkit-tap-highlight-color: transparent; 142 --_lumo-item-selected-icon-display: var(--_lumo-list-box-item-selected-icon-display, block); 143 } 144 145 /* Dividers */ 146 [part='items'] ::slotted(hr) { 147 height: 1px; 148 border: 0; 149 padding: 0; 150 margin: var(--lumo-space-s) var(--lumo-border-radius-m); 151 background-color: var(--lumo-contrast-10pct); 152 } 153`;P("vaadin-list-box",nt,{moduleId:"lumo-list-box"});const oi=O` 154 :host { 155 --_lumo-list-box-item-selected-icon-display: block; 156 } 157 158 /* Normal item */ 159 [part='items'] ::slotted([role='menuitem']) { 160 -webkit-tap-highlight-color: var(--lumo-primary-color-10pct); 161 cursor: default; 162 outline: none; 163 border-radius: var(--lumo-border-radius-m); 164 padding-left: calc(var(--lumo-border-radius-m) / 4); 165 padding-right: calc(var(--lumo-space-l) + var(--lumo-border-radius-m) / 4); 166 } 167 168 /* Hovered item */ 169 /* TODO a workaround until we have "focus-follows-mouse". After that, use the hover style for focus-ring as well */ 170 [part='items'] ::slotted([role='menuitem']:hover:not([disabled])), 171 [part='items'] ::slotted([role='menuitem'][expanded]:not([disabled])) { 172 background-color: var(--lumo-primary-color-10pct); 173 } 174 175 /* RTL styles */ 176 :host([dir='rtl']) [part='items'] ::slotted([role='menuitem']) { 177 padding-left: calc(var(--lumo-space-l) + var(--lumo-border-radius-m) / 4); 178 padding-right: calc(var(--lumo-border-radius-m) / 4); 179 } 180 181 /* Focused item */ 182 @media (pointer: coarse) { 183 [part='items'] ::slotted([role='menuitem']:hover:not([expanded]):not
183([disabled])) { 184 background-color: transparent; 185 } 186 } 187`;P("vaadin-context-menu-list-box",[nt,oi],{moduleId:"lumo-context-menu-list-box"});/** 188 * @license 189 * Copyright (c) 2017 - 2024 Vaadin Ltd. 190 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 191 */const at=O` 192 :host([opening]), 193 :host([closing]) { 194 animation: 0.14s lumo-overlay-dummy-animation; 195 } 196 197 [part='overlay'] { 198 will-change: opacity, transform; 199 } 200 201 :host([opening]) [part='overlay'] { 202 animation: 0.1s lumo-menu-overlay-enter ease-out both; 203 } 204 205 @keyframes lumo-menu-overlay-enter { 206 0% { 207 opacity: 0; 208 transform: translateY(-4px); 209 } 210 } 211 212 :host([closing]) [part='overlay'] { 213 animation: 0.1s lumo-menu-overlay-exit both; 214 } 215 216 @keyframes lumo-menu-overlay-exit { 217 100% { 218 opacity: 0; 219 } 220 } 221`;P("",at,{moduleId:"lumo-menu-overlay-core"});const ni=O` 222 /* Small viewport (bottom sheet) styles */ 223 /* Use direct media queries instead of the state attributes ([phone] and [fullscreen]) provided by the elements */ 224 @media (max-width: 450px), (max-height: 450px) { 225 :host { 226 top: 0 !important; 227 right: 0 !important; 228 bottom: var(--vaadin-overlay-viewport-bottom, 0) !important; 229 left: 0 !important; 230 align-items: stretch !important; 231 justify-content: flex-end !important; 232 } 233 234 [part='overlay'] { 235 max-height: 50vh; 236 width: 100vw; 237 border-radius: 0; 238 box-shadow: var(--lumo-box-shadow-xl); 239 } 240 241 /* The content part scrolls instead of the overlay part, because of the gradient fade-out */ 242 [part='content'] { 243 padding: 30px var(--lumo-space-m); 244 max-height: inherit; 245 box-sizing: border-box; 246 -webkit-overflow-scrolling: touch; 247 overflow: auto; 248 -webkit-mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent); 249 mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent); 250 } 251 252 [part='backdrop'] { 253 display: block; 254 } 255 256 /* Animations */ 257 258 :host([opening]) [part='overlay'] { 259 animation: 0.2s lumo-mobile-menu-overlay-enter cubic-bezier(0.215, 0.61, 0.355, 1) both; 260 } 261 262 :host([closing]), 263 :host([closing]) [part='backdrop'] { 264 animation-delay: 0.14s; 265 } 266 267 :host([closing]) [part='overlay'] { 268 animation: 0.14s 0.14s lumo-mobile-menu-overlay-exit cubic-bezier(0.55, 0.055, 0.675, 0.19) both; 269 } 270 } 271 272 @keyframes lumo-mobile-menu-overlay-enter { 273 0% { 274 transform: translateY(150%); 275 } 276 } 277 278 @keyframes lumo-mobile-menu-overlay-exit { 279 100% { 280 transform: translateY(150%); 281 } 282 } 283`,lt=[Ct,at,ni];P("",lt,{moduleId:"lumo-menu-overlay"});const ai=O` 284 :host([phone]) { 285 /* stylelint-disable declaration-block-no-redundant-longhand-properties */ 286 top: 0 !important; 287 right: 0 !important; 288 bottom: var(--vaadin-overlay-viewport-bottom) !important; 289 left: 0 !important; 290 /* stylelint-enable declaration-block-no-redundant-longhand-properties */ 291 align-items: stretch; 292 justify-content: flex-end; 293 } 294 295 /* TODO These style overrides should not be needed. 296 We should instead offer a way to have non-selectable items inside the context menu. */ 297 298 :host { 299 --_lumo-list-box-item-selected-icon-display: none; 300 --_lumo-list-box-item-padding-left: calc(var(--lumo-space-m) + var(--lumo-border-radius-m) / 4); 301 } 302 303 [part='overlay'] { 304 outline: none; 305 } 306`;P("vaadin-context-menu-overlay",[lt,ai],{moduleId:"lumo-context-menu-overlay"});/** 307 * @license 308 * Copyright (c) 2016 - 2024 Vaadin Ltd. 309 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 310 */xt({name:"vaadin-contextmenu",deps:["touchstart","touchmove","touchend","contextmenu"],flow:{start:["touchstart","contextmenu"],end:["contextmenu"]},emits:["vaadin-contextmenu"],info:{sourceEvent:null},reset(){this.info.sourceEvent=null,this._cancelTimer(),this.info.touchJob=null,this.info.touchStartCoords=null},_cancelTimer(){this._timerId&&(clearTimeout(this._timerId),delete this._fired)},_setSourceEvent(r){this.info.sourceEvent=r;const s=r.composedPath();
310this.info.sourceEvent.__composedPath=s},touchstart(r){this._setSourceEvent(r),this.info.touchStartCoords={x:r.changedTouches[0].clientX,y:r.changedTouches[0].clientY};const s=r.composedPath()[0]||r.target;this._timerId=setTimeout(()=>{const e=r.changedTouches[0];r.shiftKey||(me&&(this._fired=!0,this.fire(s,e.clientX,e.clientY)),$e("tap"))},500)},touchmove(r){const e=this.info.touchStartCoords;(Math.abs(e.x-r.changedTouches[0].clientX)>15||Math.abs(e.y-r.changedTouches[0].clientY)>15)&&this._cancelTimer()},touchend(r){this._fired&&r.preventDefault(),this._cancelTimer()},contextmenu(r){r.shiftKey||(this._setSourceEvent(r),this.fire(r.target,r.clientX,r.clientY),$e("tap"))},fire(r,s,e){const t=this.info.sourceEvent,i=new Event("vaadin-contextmenu",{bubbles:!0,cancelable:!0,composed:!0});i.detail={x:s,y:e,sourceEvent:t},r.dispatchEvent(i),i.defaultPrevented&&t&&t.preventDefault&&t.preventDefault()}});/** 311 * @license 312 * Copyright (c) 2017 - 2024 Vaadin Ltd. 313 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 314 */const li=r=>class extends Ye(wt(r)){static get properties(){return{_hasVaadinItemMixin:{value:!0},selected:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_selectedChanged"},_value:String}}get _activeKeys(){return["Enter"," "]}get value(){return this._value!==void 0?this._value:this.textContent.trim()}set value(e){this._value=e}ready(){super.ready();const e=this.getAttribute("value");e!==null&&(this.value=e)}focus(){this.disabled||(super.focus(),this._setFocused(!0))}_shouldSetActive(e){return!this.disabled&&!(e.type==="keydown"&&e.defaultPrevented)}_selectedChanged(e){this.setAttribute("aria-selected",e)}_disabledChanged(e){super._disabledChanged(e),e&&(this.selected=!1,this.blur())}_onKeyDown(e){super._onKeyDown(e),this._activeKeys.includes(e.key)&&!e.defaultPrevented&&(e.preventDefault(),this.click())}};/** 315 * @license 316 * Copyright (c) 2016 - 2024 Vaadin Ltd. 317 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 318 */class di extends li(re(de(N))){static get is(){return"vaadin-context-menu-item"}static get template(){return X` 319 <style> 320 :host { 321 display: inline-block; 322 } 323 324 :host([hidden]) { 325 display: none !important; 326 } 327 </style> 328 <span part="checkmark" aria-hidden="true"></span> 329 <div part="content"> 330 <slot></slot> 331 </div> 332 `}ready(){super.ready(),this.setAttribute("role","menuitem")}}V(di);/** 333 * @license 334 * Copyright (c) 2021 - 2024 Vaadin Ltd. 335 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 336 */function Se(r,s){const{scrollLeft:e}=r;return s!=="rtl"?e:r.scrollWidth-r.clientWidth+e}function hi(r,s,e){s!=="rtl"?r.scrollLeft=e:r.scrollLeft=r.clientWidth-r.scrollWidth+e}/** 337 * @license 338 * Copyright (c) 2022 - 2024 Vaadin Ltd. 339 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 340 */const ci=r=>class extends At(r){get focused(){return(this._getItems()||[]).find(It)}get _vertical(){return!0}focus(){const e=this._getItems();if(Array.isArray(e)){const t=this._getAvailableIndex(e,0,null,i=>!Q(i));t>=0&&this._focus(t)}}_getItems(){return Array.from(this.children)}_onKeyDown(e){if(super._onKeyDown(e),e.metaKey||e.ctrlKey)return;const{key:t}=e,i=this._getItems()||[],o=i.indexOf(this.focused);let n,a;const p=!this._vertical&&this.getAttribute("dir")==="rtl"?-1:1;this.__isPrevKey(t)?(a=-p,n=o-p):this.__isNextKey(t)?(a=p,n=o+p):t==="Home"?(a=1,n=0):t==="End"&&(a=-1,n=i.length-1),n=this._getAvailableIndex(i,n,a,_=>!Q(_)),n>=0&&(e.preventDefault(),this._focus(n,!0))}__isPrevKey(e){return this._vertical?e==="ArrowUp":e==="ArrowLeft"}__isNextKey(e){return this._vertical?e==="ArrowDown":e==="ArrowRight"}_focus(e,t=!1){const i=this._getItems();this._focusItem(i[e],t)}_focusItem(e){e&&(e.focus(),e.setAttribute("focus-ring",""))}_getAvailableIndex(e,t,i,o){const n=e.length;let a=t;for(let c=0;typeof a=="number"&&c<n;c+=1,a+=i||1){a<0?a=n-1:a>=n&&(a=0);const p=e[a];if(!p.hasAttribute("disabled")&&this.__isMatchingItem(p,o))return a}return-1}__isMatchingItem(e,t){return typeof t=="function"?t(e):!0}};/** 341 * @license 342 * Copyright (c) 2017 - 2024 Vaadin Ltd. 343 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 344 */const ui=r=>class extends ci(r){static get properties(){return{disabled:{type:Boolean,value:!1,reflectToAttribute:!0},selected:{type:Number,reflectToAttribute:!0,notify:!0},orientation:{type:String,reflectToAttribute:!0,value:""},items:{type:Array,readOnly:!0,notify:!0},_searchBuf:{type:String,value:""}}}static get observers(){return["_enhanceItems(items, orientation, selected, disabled)"]}get _isRTL(){return!this._vertical&&this.getAttribute("dir")==="rtl"}get _scrollerElement(){return console.warn(`Please implement the '_scrollerElement' property in <${this.localName}>`),this}get _vertical(){return this.orientation!=="horizontal"}focus(){this._observer&&this._observer.flush();const e=Array.isArray(this.items)?this.items:[],t=this._getAvailableIndex(e,0,null,i=>i.tabIndex===0&&!Q(i));t>=0?this._focus(t):super.focus()}ready(){super.ready(),this.addEventListener("click",t=>this._onClick(t));const e=this.shadowRoot.querySelector("slot:not([name])");this._observer=new Qe(e,()=>{this._setItems(this._filterItems(Et(this)))})}_getItems(){return this.items}_enhanceItems(e,t,i,o){if(!o&&e){this.setAttribute("aria-orientation",t||"vertical"),e.forEach(a=>{t?a.setAttribute("orientation",t):a.removeAttribute("orientation")}),this._setFocusable(i<0||!i?0:i);const n=e[i];e.forEach(a=>{a.selected=a===n}),n&&!n.disabled&&this._scrollToItem(i)}}_filterItems(e){return e.filter(t=>t._hasVaadinItemMixin)}_onClick(e){if(e.metaKey||e.shiftKey||e.ctrlKey||e.defaultPrevented)return;const t=this._filterItems(e.composedPath())[0];let i;t&&!t.disabled&&(i=this.items.indexOf(t))>=0&&(this.selected=i)}_searchKey(e,t){this._searchReset=E.debounce(this._searchReset,$.after(500),()=>{this._searchBuf=""}),this._searchBuf+=t.toLowerCase(),this.items.some(o=>this.__isMatchingKey(o))||(this._searchBuf=t.toLowerCase());const i=this._searchBuf.length===1?e+1:e;return this._getAvailableIndex(this.items,i,1,o=>this.__isMatchingKey(o)&&getComputedStyle(o).display!=="none")}__isMatchingKey(e){return e.textContent.replace(/[^\p{L}\p{Nd}]/gu,"").toLowerCase().startsWith(this._searchBuf)}_onKeyDown(e){if(e.metaKey||e.ctrlKey)return;const t=e.key,i=this.items.indexOf(this.focused);if(/[\p{L}\p{Nd}]/u.test(t)&&t.length===1){const o=this._searchKey(i,t);o>=0&&this._focus(o);return}super._onKeyDown(e)}_isItemHidden(e){return getComputedStyle(e).display==="none"}_setFocusable(e){e=this._getAvailableIndex(this.items,e,1);const t=this.items[e];
344this.items.forEach(i=>{i.tabIndex=i===t?0:-1})}_focus(e){this.items.forEach((t,i)=>{t.focused=i===e}),this._setFocusable(e),this._scrollToItem(e),super._focus(e)}_scrollToItem(e){const t=this.items[e];if(!t)return;const i=this._vertical?["top","bottom"]:this._isRTL?["right","left"]:["left","right"],o=this._scrollerElement.getBoundingClientRect(),n=(this.items[e+1]||t).getBoundingClientRect(),a=(this.items[e-1]||t).getBoundingClientRect();let c=0;!this._isRTL&&n[i[1]]>=o[i[1]]||this._isRTL&&n[i[1]]<=o[i[1]]?c=n[i[1]]-o[i[1]]:(!this._isRTL&&a[i[0]]<=o[i[0]]||this._isRTL&&a[i[0]]>=o[i[0]])&&(c=a[i[0]]-o[i[0]]),this._scroll(c)}_scroll(e){if(this._vertical)this._scrollerElement.scrollTop+=e;else{const t=this.getAttribute("dir")||"ltr",i=Se(this._scrollerElement,t)+e;hi(this._scrollerElement,t,i)}}};/** 345 * @license 346 * Copyright (c) 2016 - 2024 Vaadin Ltd. 347 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 348 */class _i extends ui(re(de(Re(N)))){static get is(){return"vaadin-context-menu-list-box"}static get template(){return X` 349 <style> 350 :host { 351 display: flex; 352 } 353 354 :host([hidden]) { 355 display: none !important; 356 } 357 358 [part='items'] { 359 height: 100%; 360 width: 100%; 361 overflow-y: auto; 362 -webkit-overflow-scrolling: touch; 363 } 364 </style> 365 <div part="items"> 366 <slot></slot> 367 </div> 368 `}static get properties(){return{orientation:{readOnly:!0}}}get _scrollerElement(){return this.shadowRoot.querySelector('[part="items"]')}ready(){super.ready(),this.setAttribute("role","menu")}}V(_i);/** 369 * @license 370 * Copyright (c) 2016 - 2024 Vaadin Ltd. 371 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 372 */const fi=r=>class extends St(zt(r)){static get properties(){return{parentOverlay:{type:Object,readOnly:!0},_theme:{type:String,readOnly:!0,sync:!0}}}static get observers(){return["_themeChanged(_theme)"]}ready(){super.ready(),this.restoreFocusOnClose=!0,this.addEventListener("keydown",e=>{if(!e.defaultPrevented&&e.composedPath()[0]===this.$.overlay&&[38,40].indexOf(e.keyCode)>-1){const t=this.getFirstChild();t&&Array.isArray(t.items)&&t.items.length&&(e.preventDefault(),e.keyCode===38?t.items[t.items.length-1].focus():t.focus())}})}getFirstChild(){return this.querySelector(":not(style):not(slot)")}_themeChanged(){this.close()}getBoundaries(){const e=this.getBoundingClientRect(),t=this.$.overlay.getBoundingClientRect();let i=e.bottom-t.height;const o=this.parentOverlay;if(o&&o.hasAttribute("bottom-aligned")){const n=getComputedStyle(o);i=i-parseFloat(n.bottom)-parseFloat(n.height)}return{xMax:e.right-t.width,xMin:e.left+t.width,yMax:i}}_updatePosition(){if(super._updatePosition(),this.positionTarget&&this.parentOverlay){const e=this.$.content,t=getComputedStyle(e);!!this.style.left?this.style.left=`${parseFloat(this.style.left)+parseFloat(t.paddingLeft)}px`:this.style.right=`${parseFloat(this.style.right)+parseFloat(t.paddingRight)}px`,!!this.style.bottom?this.style.bottom=`${parseFloat(this.style.bottom)-parseFloat(t.paddingBottom)}px`:this.style.top=`${parseFloat(this.style.top)-parseFloat(t.paddingTop)}px`}}_shouldRestoreFocus(){return this.parentOverlay?!1:super._shouldRestoreFocus()}_deepContains(e){let t=Xe(this.localName,e);for(;t;){if(t===this)return!0;t=t.parentOverlay}return!1}};/** 373 * @license 374 * Copyright (c) 2016 - 2024 Vaadin Ltd. 375 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 376 */const pi=O` 377 :host { 378 align-items: flex-start; 379 justify-content: flex-start; 380 } 381 382 :host([right-aligned]), 383 :host([end-aligned]) { 384 align-items: flex-end; 385 } 386 387 :host([bottom-aligned]) { 388 justify-content: flex-end; 389 } 390 391 [part='overlay'] { 392 background-color: #fff; 393 } 394 395 @media (forced-colors: active) { 396 [part='overlay'] { 397 outline: 3px solid !important; 398 } 399 } 400`;/** 401 * @license 402 * Copyright (c) 2016 - 2024 Vaadin Ltd. 403 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 404 */P("vaadin-context-menu-overlay",[Rt,pi],{moduleId:"vaadin-context-menu-overlay-styles"});class mi extends fi(Tt(de(re(N)))){static get is(){return"vaadin-context-menu-overlay"}static get template(){return X` 405 <div id="backdrop" part="backdrop" hidden$="[[!withBackdrop]]"></div> 406 <div part="overlay" id="overlay" tabindex="0"> 407 <div part="content" id="content"> 408 <slot></slot> 409 </div> 410 </div> 411 `}}V(mi);/** 412 * @license 413 * Copyright (c) 2021 - 2024 Vaadin Ltd. 414 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 415 */class gi{constructor(s,e){this.query=s,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(s){typeof this.callback=="function"&&this.callback(s.matches)}}/** 416 * @license 417 * Copyright (c) 2016 - 2024 Vaadin Ltd. 418 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 419 */const bi=r=>class extends r{static get properties(){return{items:{type:Array,sync:!0}}}constructor(){super(),this.__itemsOutsideClickListener=e=>{this._shouldCloseOnOutsideClick(e)&&this.dispatchEvent(new CustomEvent("items-outside-click"))},this.addEventListener("items-outside-click",()=>{this.items&&this.close()})}get _tagNamePrefix(){return"vaadin-context-menu"}connectedCallback(){super.connectedCallback(),document.documentElement.addEventListener("click",this.__itemsOutsideClickListener)}disconnectedCallback(){super.disconnectedCallback(),document.documentElement.removeEventListener("click",this.__itemsOutsideClickListener)}_shouldCloseOnOutsideClick(e){return!e.composedPath().some(t=>t.localName===`${this._tagNamePrefix}-overlay`)}__forwardFocus(){const e=this._overlayElement,t=e.getFirstChild();if(e.parentOverlay){const i=e.parentOverlay.querySelector("[expanded]");
419i&&i.hasAttribute("focused")&&t?t.focus():e.$.overlay.focus()}else t&&t.focus()}__openSubMenu(e,t,i){e.items=t._item.children,e.listenOn=t,e.overlayClass=i;const o=this._overlayElement,n=e._overlayElement;n.positionTarget=t,n.noHorizontalOverlap=!0,n._setParentOverlay(o),o.hasAttribute("theme")?e.setAttribute("theme",o.getAttribute("theme")):e.removeAttribute("theme");const a=n.$.content;a.style.minWidth="",t.dispatchEvent(new CustomEvent("opensubmenu",{detail:{children:t._item.children}}))}__createComponent(e){let t;return e.component instanceof HTMLElement?t=e.component:t=document.createElement(e.component||`${this._tagNamePrefix}-item`),t._hasVaadinItemMixin&&(t.setAttribute("role","menuitem"),t.tabIndex=-1),t.localName==="hr"?t.setAttribute("role","separator"):t.setAttribute("aria-haspopup","false"),this._setMenuItemTheme(t,e,this._theme),t._item=e,e.text&&(t.textContent=e.text),e.className&&t.setAttribute("class",e.className),this.__toggleMenuComponentAttribute(t,"menu-item-checked",e.checked),this.__toggleMenuComponentAttribute(t,"disabled",e.disabled),e.children&&e.children.length&&(this.__updateExpanded(t,!1),t.setAttribute("aria-haspopup","true")),t}__initListBox(){const e=document.createElement(`${this._tagNamePrefix}-list-box`);return this._theme&&e.setAttribute("theme",this._theme),e.addEventListener("selected-changed",t=>{const{value:i}=t.detail;if(typeof i=="number"){const o=e.items[i]._item;e.selected=null,o.children||this.dispatchEvent(new CustomEvent("item-selected",{detail:{value:o}}))}}),e}__initOverlay(){const e=this._overlayElement;e.$.backdrop.addEventListener("click",()=>{this.close()}),e.addEventListener(Te?"click":"mouseover",t=>{this.__showSubMenu(t)}),e.addEventListener("keydown",t=>{const{key:i}=t,o=this.__isRTL,n=i==="ArrowRight",a=i==="ArrowLeft";!o&&n||o&&a||i==="Enter"||i===" "?this.__showSubMenu(t):!o&&a||o&&n||i==="Escape"?(i==="Escape"&&t.stopPropagation(),this.close(),this.listenOn.focus()):i==="Tab"&&this.dispatchEvent(new CustomEvent("close-all-menus"))})}__initSubMenu(){const e=document.createElement(this.constructor.is);return e._modeless=!0,e.openOn="opensubmenu",e.setAttribute("hidden",""),this.addEventListener("opened-changed",t=>{t.detail.value||this._subMenu.close()}),e.addEventListener("close-all-menus",()=>{this.dispatchEvent(new CustomEvent("close-all-menus"))}),e.addEventListener("item-selected",t=>{const{detail:i}=t;this.dispatchEvent(new CustomEvent("item-selected",{detail:i}))}),this.addEventListener("close-all-menus",()=>{this._overlayElement.close()}),this.addEventListener("item-selected",t=>{const i=t.target,o=t.detail.value,n=i.items.indexOf(o);o.keepOpen&&n>-1?(i._overlayElement.requestContentUpdate(),i._listBox._observer.flush(),i._listBox.children[n].focus()):o.keepOpen||this.close()}),e.addEventListener("opened-changed",t=>{if(!t.detail.value){const i=this._listBox.querySelector("[expanded]");i&&this.__updateExpanded(i,!1)}}),e}__showSubMenu(e,t=e.composedPath().find(i=>i.localName===`${this._tagNamePrefix}-item`)){if(!this.__openListenerActive)return;if(this._overlayElement.hasAttribute("opening")){requestAnimationFrame(()=>{this.__showSubMenu(e,t)});return}const i=this._subMenu;if(t){const{children:o}=t._item,n=i._overlayElement.getFirstChild(),a=n&&n.focused;if(i.items!==o&&i.close(),!this.opened)return;if(o&&o.length){this.__updateExpanded(t,!0);const{overlayClass:c}=this;this.__openSubMenu(i,t,c)}else a?i.listenOn.focus():this._listBox.focused||this._overlayElement.$.overlay.focus()}}__itemsRenderer(e,t,{detail:i}){this.__initMenu(e,t);const o=e.querySelector(this.constructor.is);o.closeOn=t.closeOn;const n=e.querySelector(`${this._tagNamePrefix}-list-box`);n.innerHTML="",[...i.children||t.items].forEach(a=>{const c=this.__createComponent(a);n.appendChild(c)})}_setMenuItemTheme(e,t,i){let o=e.getAttribute("theme")||i;t.theme!=null&&(o=Array.isArray(t.theme)?t.theme.join(" "):t.theme),this.__updateTheme(e,o)}__toggleMenuComponentAttribute(e,t,i){i?(e.setAttribute(t,""),e[`__has-${t}`]=!0):e[`__has-${t}`]&&(e.removeAttribute(t),e[`__has-${t}`]=!1)}__initMenu(e,t){if(e.firstElementChild)this.__updateTheme(this._listBox,this._theme);else{this.__initOverlay();const i=this.__initListBox();this._listBox=i,e.appendChild(i);const o=this.__initSubMenu();this._subMenu=o,e.appendChild(o),requestAnimationFrame(()=>{this.__openListenerActive=!0})}}__updateExpanded(e,t){e.setAttribute("aria-expanded",t.toString()),e.toggleAttribute("expanded",t)}__updateTheme(e,t){t?e.setAttribute("theme",t):e.removeAttribute("theme")}};/** 420 * @license 421 * Copyright (c) 2016 - 2024 Vaadin Ltd. 422 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 423 */const vi=r=>class extends bi(r){static get properties(){return{selector:{type:String},opened:{type:Boolean,value:!1,notify:!0,readOnly:!0},openOn:{type:String,value:"vaadin-contextmenu",sync:!0},listenOn:{type:Object,sync:!0,value(){return this}},closeOn:{type:String,value:"click",observer:"_closeOnChanged",sync:!0},renderer:{type:Function,sync:!0},_modeless:{type:Boolean,sync:!0},_context:{type:Object,sync:!0}
423,_phone:{type:Boolean},_fullscreen:{type:Boolean},_fullscreenMediaQuery:{type:String,value:"(max-width: 450px), (max-height: 450px)"}}}static get observers(){return["_openedChanged(opened)","_targetOrOpenOnChanged(listenOn, openOn)","_rendererChanged(renderer, items)","_fullscreenChanged(_fullscreen)","_overlayContextChanged(_overlayElement, _context)","_overlayModelessChanged(_overlayElement, _modeless)","_overlayPhoneChanged(_overlayElement, _phone)","_overlayThemeChanged(_overlayElement, _theme)"]}constructor(){super(),this._createOverlay(),this._boundOpen=this.open.bind(this),this._boundClose=this.close.bind(this),this._boundPreventDefault=this._preventDefault.bind(this),this._boundOnGlobalContextMenu=this._onGlobalContextMenu.bind(this)}connectedCallback(){super.connectedCallback(),this.__boundOnScroll=this.__onScroll.bind(this),window.addEventListener("scroll",this.__boundOnScroll,!0),this.__restoreOpened&&this._setOpened(!0)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("scroll",this.__boundOnScroll,!0),this.__restoreOpened=this.opened,this.close()}ready(){super.ready(),this.addController(new gi(this._fullscreenMediaQuery,e=>{this._fullscreen=e}))}_createOverlay(){const e=document.createElement(`${this._tagNamePrefix}-overlay`);e.owner=this,e.addEventListener("opened-changed",t=>{this._onOverlayOpened(t)}),e.addEventListener("vaadin-overlay-open",t=>{this._onVaadinOverlayOpen(t)}),this._overlayElement=e}_onOverlayOpened(e){const t=e.detail.value;this._setOpened(t),t&&this.__alignOverlayPosition()}_onVaadinOverlayOpen(){this.__alignOverlayPosition(),this._overlayElement.style.opacity="",this.__forwardFocus()}_overlayContextChanged(e,t){e&&(e.model=t)}_overlayModelessChanged(e,t){e&&(e.modeless=t)}_overlayPhoneChanged(e,t){e&&(e.toggleAttribute("phone",t),e.withBackdrop=t)}_overlayThemeChanged(e,t){e&&(t?e.setAttribute("theme",t):e.removeAttribute("theme"))}_targetOrOpenOnChanged(e,t){this._oldListenOn&&this._oldOpenOn&&(this._unlisten(this._oldListenOn,this._oldOpenOn,this._boundOpen),this._oldListenOn.style.webkitTouchCallout="",this._oldListenOn.style.webkitUserSelect="",this._oldListenOn.style.userSelect="",this._oldListenOn=null,this._oldOpenOn=null),e&&t&&(this._listen(e,t,this._boundOpen),this._oldListenOn=e,this._oldOpenOn=t)}_fullscreenChanged(e){this._phone=e}_setListenOnUserSelect(e){this.listenOn.style.webkitTouchCallout=e,this.listenOn.style.webkitUserSelect=e,this.listenOn.style.userSelect=e,document.getSelection().removeAllRanges()}_closeOnChanged(e,t){const i="vaadin-overlay-outside-click",o=this._overlayElement;t&&this._unlisten(o,t,this._boundClose),e?(this._listen(o,e,this._boundClose),o.removeEventListener(i,this._boundPreventDefault)):o.addEventListener(i,this._boundPreventDefault)}_preventDefault(e){e.preventDefault()}_openedChanged(e){e?(document.documentElement.addEventListener("contextmenu",this._boundOnGlobalContextMenu,!0),this._setListenOnUserSelect("none")):(document.documentElement.removeEventListener("contextmenu",this._boundOnGlobalContextMenu,!0),this._setListenOnUserSelect("")),this._overlayElement.opened=e}requestContentUpdate(){!this._overlayElement||!this.renderer||this._overlayElement.requestContentUpdate()}_rendererChanged(e,t){if(t){if(e)throw new Error("The items API cannot be used together with a renderer");this.closeOn==="click"&&(this.closeOn=""),e=this.__itemsRenderer}this._overlayElement.renderer=e}close(){this._setOpened(!1)}_contextTarget(e){if(this.selector){const t=this.listenOn.querySelectorAll(this.selector);return Array.prototype.filter.call(t,i=>e.composedPath().indexOf(i)>-1)[0]}return e.target}open(e){e&&!this.opened&&(this._context={detail:e.detail,target:this._contextTarget(e)},this._context.target&&(e.preventDefault(),e.stopPropagation(),this.__x=this._getEventCoordinate(e,"x"),this.__pageXOffset=window.pageXOffset,this.__y=this._getEventCoordinate(e,"y"),this.__pageYOffset=window.pageYOffset,this._overlayElement.style.opacity="0",this._setOpened(!0)))}__onScroll(){if(!this.opened)return;const e=window.pageYOffset-this.__pageYOffset,t=window.pageXOffset-this.__pageXOffset;this.__adjustPosition("left",-t),this.__adjustPosition("right",t),this.__adjustPosition("top",-e),this.__adjustPosition("bottom",e),this.__pageYOffset+=e,this.__pageXOffset+=t}__adjustPosition(e,t){const o=this._overlayElement.style;o[e]=`${(parseInt(o[e])||0)+t}px`}__alignOverlayPosition(){const e=this._overlayElement;if(e.positionTarget)return;const t=e.style;
423["top","right","bottom","left"].forEach(g=>t.removeProperty(g)),["right-aligned","end-aligned","bottom-aligned"].forEach(g=>e.removeAttribute(g));const{xMax:i,xMin:o,yMax:n}=e.getBoundaries(),a=this.__x,c=this.__y,p=document.documentElement.clientWidth,_=document.documentElement.clientHeight;this.__isRTL?a>p/2||a>o?t.right=`${Math.max(0,p-a)}px`:(t.left=`${a}px`,this._setEndAligned(e)):a<p/2||a<i?t.left=`${a}px`:(t.right=`${Math.max(0,p-a)}px`,this._setEndAligned(e)),c<_/2||c<n?t.top=`${c}px`:(t.bottom=`${Math.max(0,_-c)}px`,e.setAttribute("bottom-aligned",""))}_setEndAligned(e){e.setAttribute("end-aligned",""),this.__isRTL||e.setAttribute("right-aligned","")}_getEventCoordinate(e,t){if(e.detail instanceof Object){if(e.detail[t])return e.detail[t];if(e.detail.sourceEvent)return this._getEventCoordinate(e.detail.sourceEvent,t)}else{const i=`client${t.toUpperCase()}`,o=e.changedTouches?e.changedTouches[0][i]:e[i];if(o===0){const n=e.target.getBoundingClientRect();return t==="x"?n.left:n.top+n.height}return o}}_listen(e,t,i){ge[t]?he(e,t,i):e.addEventListener(t,i)}_unlisten(e,t,i){ge[t]?Ze(e,t,i):e.removeEventListener(t,i)}__createMouseEvent(e,t,i){return new MouseEvent(e,{bubbles:!0,composed:!0,cancelable:!0,clientX:t,clientY:i})}__focusClosestFocusable(e){let t=e;for(;t;){if(t instanceof HTMLElement&&Je(t)){t.focus();return}t=t.parentNode||t.host}}__contextMenuAt(e,t){const i=kt(e,t);i&&queueMicrotask(()=>{i.dispatchEvent(this.__createMouseEvent("mousedown",e,t)),i.dispatchEvent(this.__createMouseEvent("mouseup",e,t)),this.__focusClosestFocusable(i),i.dispatchEvent(this.__createMouseEvent("contextmenu",e,t))})}_onGlobalContextMenu(e){e.shiftKey||(Ie||me||(e.stopPropagation(),this._overlayElement.__focusRestorationController.focusNode=null,this._overlayElement.addEventListener("vaadin-overlay-closed",()=>this.__contextMenuAt(e.clientX,e.clientY),{once:!0})),e.preventDefault(),this.close())}};/** 424 * @license 425 * Copyright (c) 2016 - 2024 Vaadin Ltd. 426 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 427 */class yi extends vi(Ot(Re(ke(qt(N))))){static get template(){return X` 428 <style> 429 :host { 430 display: block; 431 } 432 433 :host([hidden]) { 434 display: none !important; 435 } 436 </style> 437 438 <slot id="slot"></slot> 439 `}static get is(){return"vaadin-context-menu"}ready(){super.ready(),ze(this)}_attachDom(s){const e=this.attachShadow({mode:"open"});return e.appendChild(s),e.appendChild(this._overlayElement),e}}V(yi);function Ci(r,s){try{return window.Vaadin.Flow.clients[r].getByNodeId(s)}catch(e){console.error("Could not get node %s from app %s",s,r),console.error(e)}}function xi(r,s){r.$connector||(r.$connector={generateItems(e){const t=Pe(s,e);r.items=t}})}function Pe(r,s){const e=Ci(r,s);if(e)return Array.from(e.children).map(t=>{const i={component:t,checked:t._checked,keepOpen:t._keepOpen,className:t.className,theme:t.__theme};return t._hasVaadinItemMixin&&t._containerNodeId&&(i.children=Pe(r,t._containerNodeId)),t._item=i,i})}function wi(r,s){r._item&&(r._item.checked=s,r._item.keepOpen&&r.toggleAttribute("menu-item-checked",s))}function Ai(r,s){r._item&&(r._item.keepOpen=s)}function Ii(r,s){r._item&&(r._item.theme=s)}window.Vaadin.Flow.contextMenuConnector={initLazy:xi,generateItemsTree:Pe,setChecked:wi,setKeepOpen:Ai,setTheme:Ii};function Ei(r){r.$contextMenuTargetConnector||(r.$contextMenuTargetConnector={openOnHandler(s){if(r.preventContextMenu&&r.preventContextMenu(s))return;s.preventDefault(),s.stopPropagation(),this.$contextMenuTargetConnector.openEvent=s;let e={};r.getContextMenuBeforeOpenDetail&&(e=r.getContextMenuBeforeOpenDetail(s)),r.dispatchEvent(new CustomEvent("vaadin-context-menu-before-open",{detail:e}))},updateOpenOn(s){this.removeListener(),this.openOnEventType=s,customElements.whenDefined("vaadin-context-menu").then(()=>{ge[s]?he(r,s,this.openOnHandler):r.addEventListener(s,this.openOnHandler)})},removeListener(){this.openOnEventType&&(ge[this.openOnEventType]?Ze(r,this.openOnEventType,this.openOnHandler):r.removeEventListener(this.openOnEventType,this.openOnHandler))},openMenu(s){s.open(this.openEvent)},removeConnector(){this.removeListener(),r.$contextMenuTargetConnector=void 0}})}window.Vaadin.Flow.contextMenuTargetConnector={init:Ei};P("vaadin-grid",O` 440 :host { 441 font-family: var(--lumo-font-family); 442 font-size: var(--lumo-font-size-m); 443 line-height: var(--lumo-line-height-s); 444 color: var(--lumo-body-text-color); 445 background-color: var(--lumo-base-color); 446 box-sizing: border-box; 447 -webkit-text-size-adjust: 100%; 448 -webkit-tap-highlight-color: transparent; 449 -webkit-font-smoothing: antialiased; 450 -moz-osx-font-smoothing: grayscale; 451 --_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct)); 452 --_focus-ring-width: var(--vaadin-focus-ring-width, 2px); 453 /* For internal use only */ 454 --_lumo-grid-border-color: var(--lumo-contrast-20pct); 455 --_lumo-grid-secondary-border-color: var(--lumo-contrast-10pct); 456 --_lumo-grid-border-width: 1px; 457 --_lumo-grid-selected-row-color: var(--lumo-primary-color-10pct); 458 } 459 460 /* No (outer) border */ 461 462 :host(:not([theme~='no-border'])) { 463 border: var(--_lumo-grid-border-width) solid var(--_lumo-grid-border-color); 464 } 465 466 :host([disabled]) { 467 opacity: 0.7; 468 } 469 470 /* Cell styles */ 471 472 [part~='cell'] { 473 min-height: var(--lumo-size-m); 474 background-color: var(--vaadin-grid-cell-background, var(--lumo-base-color)); 475 cursor: default; 476 --_cell-padding: var(--vaadin-grid-cell-padding, var(--_cell-default-padding)); 477 --_cell-default-padding: var(--lumo-space-xs) var(--lumo-space-m); 478 } 479 480 [part~='cell'] ::slotted(vaadin-grid-cell-content) { 481 cursor: inherit; 482 padding: var(--_cell-padding); 483 } 484 485 /* Apply row borders by default and introduce the "no-row-borders" variant */ 486 :host(:not([theme~='no-row-borders'])) [part~='cell']:not([part~='details-cell']) { 487 border-top: var(--_lumo-grid-border-width) solid var(--_lumo-grid-secondary-border-color); 488 } 489 490 /* Hide first body row top border */ 491 :host(:not([theme~='no-row-borders'])) [part~='first-row'] [part~='cell']:not([part~='details-cell']) { 492 border-top: 0; 493 min-height: calc(var(--lumo-size-m) - var(--_lumo-grid-border-width)); 494 } 495 496 /* Focus-ring */ 497 498 [part~='row'] { 499 position: relative; 500 } 501 502 [part~='row']:focus, 503 [part~='focused-cell']:focus { 504 outline: none; 505 } 506 507 :host([navigating]) [part~='row']:focus::before, 508 :host([navigating]) [part~='focused-cell']:focus::before { 509 content: ''; 510 position: absolute; 511 inset: 0; 512 pointer-events: none; 513 box-shadow: inset 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color); 514 } 515 516 :host([navigating]) [part~='row']:focus::before {
517 transform: translateX(calc(-1 * var(--_grid-horizontal-scroll-position))); 518 z-index: 3; 519 } 520 521 /* Empty state */ 522 [part~='empty-state'] { 523 padding: var(--lumo-space-m); 524 color: var(--lumo-secondary-text-color); 525 } 526 527 /* Drag and Drop styles */ 528 :host([dragover])::after { 529 content: ''; 530 position: absolute; 531 z-index: 100; 532 inset: 0; 533 pointer-events: none; 534 box-shadow: inset 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color); 535 } 536 537 [part~='row'][dragover] { 538 z-index: 100 !important; 539 } 540 541 [part~='row'][dragover] [part~='cell'] { 542 overflow: visible; 543 } 544 545 [part~='row'][dragover] [part~='cell']::after { 546 content: ''; 547 position: absolute; 548 inset: 0; 549 height: calc(var(--_lumo-grid-border-width) + 2px); 550 pointer-events: none; 551 background: var(--lumo-primary-color-50pct); 552 } 553 554 [part~='row'][dragover] [part~='cell'][last-frozen]::after { 555 right: -1px; 556 } 557 558 :host([theme~='no-row-borders']) [dragover] [part~='cell']::after { 559 height: 2px; 560 } 561 562 [part~='row'][dragover='below'] [part~='cell']::after { 563 top: 100%; 564 bottom: auto; 565 margin-top: -1px; 566 } 567 568 :host([all-rows-visible]) [part~='last-row'][dragover='below'] [part~='cell']::after { 569 height: 1px; 570 } 571 572 [part~='row'][dragover='above'] [part~='cell']::after { 573 top: auto; 574 bottom: 100%; 575 margin-bottom: -1px; 576 } 577 578 [part~='row'][details-opened][dragover='below'] [part~='cell']:not([part~='details-cell'])::after, 579 [part~='row'][details-opened][dragover='above'] [part~='details-cell']::after { 580 display: none; 581 } 582 583 [part~='row'][dragover][dragover='on-top'] [part~='cell']::after { 584 height: 100%; 585 opacity: 0.5; 586 } 587 588 [part~='row'][dragstart] [part~='cell'] { 589 border: none !important; 590 box-shadow: none !important; 591 } 592 593 [part~='row'][dragstart] [part~='cell'][last-column] { 594 border-radius: 0 var(--lumo-border-radius-s) var(--lumo-border-radius-s) 0; 595 } 596 597 [part~='row'][dragstart] [part~='cell'][first-column] { 598 border-radius: var(--lumo-border-radius-s) 0 0 var(--lumo-border-radius-s); 599 } 600 601 #scroller [part~='row'][dragstart]:not([dragstart=''])::after { 602 display: block; 603 position: absolute; 604 left: var(--_grid-drag-start-x); 605 top: var(--_grid-drag-start-y); 606 z-index: 100; 607 content: attr(dragstart); 608 align-items: center; 609 justify-content: center; 610 box-sizing: border-box; 611 padding: calc(var(--lumo-space-xs) * 0.8); 612 color: var(--lumo-error-contrast-color); 613 background-color: var(--lumo-error-color); 614 border-radius: var(--lumo-border-radius-m); 615 font-family: var(--lumo-font-family); 616 font-size: var(--lumo-font-size-xxs); 617 line-height: 1; 618 font-weight: 500; 619 text-transform: initial; 620 letter-spacing: initial; 621 min-width: calc(var(--lumo-size-s) * 0.7); 622 text-align: center; 623 } 624 625 /* Headers and footers */ 626 627 [part~='header-cell'], 628 [part~='footer-cell'], 629 [part~='reorder-ghost'] { 630 font-size: var(--lumo-font-size-s); 631 font-weight: 500; 632 } 633 634 [part~='footer-cell'] { 635 font-weight: 400; 636 } 637 638 [part~='row']:only-child [part~='header-cell'] { 639 min-height: var(--lumo-size-xl); 640 } 641 642 /* Header borders */ 643 644 /* Hide first header row top border */ 645 :host(:not([theme~='no-row-borders'])) [part~='row']:first-child [part~='header-cell'] { 646 border-top: 0; 647 } 648 649 /* Hide header row top border if previous row is hidden */ 650 [part~='row'][hidden] + [part~='row'] [part~='header-cell'] { 651 border-top: 0; 652 } 653 654 [part~='row']:last-child [part~='header-cell'] { 655 border-bottom: var(--_lumo-grid-border-width) solid transparent; 656 } 657 658 :host(:not([theme~='no-row-borders'])) [part~='row']:last-child [part~='header-cell'] { 659 border-bottom-color: var(--_lumo-grid-secondary-border-color); 660 } 661 662 /* Overflow uses a stronger border color */ 663 :host([overflow~='top']) [part~='row']:last-child [part~='header-cell'] { 664 border-bottom-color: var(--_lumo-grid-border-color); 665 } 666 667 /* Footer borders */ 668 669 [part~='row']:first-child [part~='footer-cell'] { 670 border-top: var(--_lumo-grid-border-width) solid transparent; 671 } 672 673 :host(:not([theme~='no-row-borders'])) [part~='row']:first-child [part~='footer-cell'] { 674 border-top-color: var(--_lumo-grid-secondary-border-color); 675 } 676 677 /* Overflow uses a stronger border color */ 678 :host([overflow~='bottom']) [part~='row']:first-child [part~='footer-cell'] { 679 border-top-color: var(--_lumo-grid-border-color); 680 } 681 682 /* Column reordering */ 683 684 :host([reordering]) [part~='cell'] { 685 background: linear-gradient(var(--lumo-shade-20pct), var(--lumo-shade-20pct)) var(--lumo-base-color); 686 } 687 688 :host([reordering]) [part~='cell'][reorder-status='allowed'] { 689 background: var(--lumo-base-color); 690 } 691 692 :host([reordering]) [part~='cell'][reorder-status='dragging'] { 693 background: linear-gradient(var(--lumo-contrast-5pct), var(--lumo-contrast-5pct)) var(--lumo-base-color); 694 } 695 696 [part~='reorder-ghost'] { 697 opacity: 0.85;
698 box-shadow: var(--lumo-box-shadow-s); 699 /* TODO Use the same styles as for the cell element (reorder-ghost copies styles from the cell element) */ 700 padding: var(--lumo-space-s) var(--lumo-space-m) !important; 701 } 702 703 /* Column resizing */ 704 705 [part='resize-handle'] { 706 --_resize-handle-width: 3px; 707 width: var(--_resize-handle-width); 708 background-color: var(--lumo-primary-color-50pct); 709 opacity: 0; 710 transition: opacity 0.2s; 711 } 712 713 [part='resize-handle']::before { 714 transform: translateX(calc(-50% + var(--_resize-handle-width) / 2)); 715 width: var(--lumo-size-s); 716 } 717 718 :host(:not([reordering])) *:not([column-resizing]) [part~='cell']:hover [part='resize-handle'], 719 [part='resize-handle']:active { 720 opacity: 1; 721 transition-delay: 0.15s; 722 } 723 724 /* Column borders */ 725 726 :host([theme~='column-borders']) [part~='cell']:not([last-column]):not([part~='details-cell']) { 727 border-right: var(--_lumo-grid-border-width) solid var(--_lumo-grid-secondary-border-color); 728 } 729 730 /* Frozen columns */ 731 732 [last-frozen] { 733 border-right: var(--_lumo-grid-border-width) solid transparent; 734 overflow: hidden; 735 } 736 737 :host([overflow~='start']) [part~='cell'][last-frozen]:not([part~='details-cell']) { 738 border-right-color: var(--_lumo-grid-border-color); 739 } 740 741 [first-frozen-to-end] { 742 border-left: var(--_lumo-grid-border-width) solid transparent; 743 } 744 745 :host([overflow~='end']) [part~='cell'][first-frozen-to-end]:not([part~='details-cell']) { 746 border-left-color: var(--_lumo-grid-border-color); 747 } 748 749 /* Row stripes */ 750 751 :host([theme~='row-stripes']) [part~='even-row'] [part~='body-cell'], 752 :host([theme~='row-stripes']) [part~='even-row'] [part~='details-cell'] { 753 background-image: linear-gradient(var(--lumo-contrast-5pct), var(--lumo-contrast-5pct)); 754 background-repeat: repeat-x; 755 } 756 757 /* Selected row */ 758 759 /* Raise the selected rows above unselected rows (so that box-shadow can cover unselected rows) */ 760 :host(:not([reordering])) [part~='row'][selected] { 761 z-index: 1; 762 } 763 764 :host(:not([reordering])) [part~='row'][selected] [part~='body-cell']:not([part~='details-cell']) { 765 background-image: linear-gradient(var(--_lumo-grid-selected-row-color), var(--_lumo-grid-selected-row-color)); 766 background-repeat: repeat; 767 } 768 769 /* Cover the border of an unselected row */ 770 :host(:not([theme~='no-row-borders'])) [part~='row'][selected] [part~='cell']:not([part~='details-cell']) { 771 box-shadow: 0 var(--_lumo-grid-border-width) 0 0 var(--_lumo-grid-selected-row-color); 772 } 773 774 /* Compact */ 775 776 :host([theme~='compact']) [part~='row']:only-child [part~='header-cell'] { 777 min-height: var(--lumo-size-m); 778 } 779 780 :host([theme~='compact']) [part~='cell'] { 781 min-height: var(--lumo-size-s); 782 --_cell-default-padding: var(--lumo-space-xs) var(--lumo-space-s); 783 } 784 785 :host([theme~='compact']) [part~='first-row'] [part~='cell']:not([part~='details-cell']) { 786 min-height: calc(var(--lumo-size-s) - var(--_lumo-grid-border-width)); 787 } 788 789 :host([theme~='compact']) [part~='empty-state'] { 790 padding: var(--lumo-space-s); 791 } 792 793 /* Wrap cell contents */ 794 795 :host([theme~='wrap-cell-content']) [part~='cell'] ::slotted(vaadin-grid-cell-content) { 796 white-space: normal; 797 } 798 799 /* RTL specific styles */ 800 801 :host([dir='rtl']) [part~='row'][dragstart] [part~='cell'][last-column] { 802 border-radius: var(--lumo-border-radius-s) 0 0 var(--lumo-border-radius-s); 803 } 804 805 :host([dir='rtl']) [part~='row'][dragstart] [part~='cell'][first-column] { 806 border-radius: 0 var(--lumo-border-radius-s) var(--lumo-border-radius-s) 0; 807 } 808 809 :host([dir='rtl'][theme~='column-borders']) [part~='cell']:not([last-column]):not([part~='details-cell']) { 810 border-right: none; 811 border-left: var(--_lumo-grid-border-width) solid var(--_lumo-grid-secondary-border-color); 812 } 813 814 :host([dir='rtl']) [last-frozen] { 815 border-right: none; 816 border-left: var(--_lumo-grid-border-width) solid transparent; 817 } 818 819 :host([dir='rtl']) [first-frozen-to-end] { 820 border-left: none; 821 border-right: var(--_lumo-grid-border-width) solid transparent; 822 } 823 824 :host([dir='rtl'][overflow~='start']) [part~='cell'][last-frozen]:not([part~='details-cell']) { 825 border-left-color: var(--_lumo-grid-border-color); 826 } 827 828 :host([dir='rtl'][overflow~='end']) [part~='cell'][first-frozen-to-end]:not([part~='details-cell']) { 829 border-right-color: var(--_lumo-grid-border-color); 830 } 831 `,{moduleId:"lumo-grid"});/** 832 * @license 833 * Copyright (c) 2016 The Polymer Project Authors. All rights reserved. 834 * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 835 * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 836 * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 837 * Code distributed by Google as part of the polymer project is also 838 * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 839 */const Ne=navigator.userAgent.match(/iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/u),Si=Ne&&Ne[1]>=8,Ve=3,zi={_ratio:.5,_scrollerPaddingTop:0,_scrollPosition:0,_physicalSize:0,_physicalAverage:0,_physicalAverageCount:0,_physicalTop:0,_virtualCount:0,_estScrollHeight:0,_scrollHeight:0,_viewportHe
vendor: 8,581 bytes, lines 839-843
839ight:0,_viewportWidth:0,_physicalItems:null,_physicalSizes:null,_firstVisibleIndexVal:null,_lastVisibleIndexVal:null,_maxPages:2,_templateCost:0,get _physicalBottom(){return this._physicalTop+this._physicalSize},get _scrollBottom(){return this._scrollPosition+this._viewportHeight},get _virtualEnd(){return this._virtualStart+this._physicalCount-1},get _hiddenContentSize(){return this._physicalSize-this._viewportHeight},get _maxScrollTop(){return this._estScrollHeight-this._viewportHeight+this._scrollOffset},get _maxVirtualStart(){const r=this._virtualCount;return Math.max(0,r-this._physicalCount)},get _virtualStart(){return this._virtualStartVal||0},set _virtualStart(r){r=this._clamp(r,0,this._maxVirtualStart),this._virtualStartVal=r},get _physicalStart(){return this._physicalStartVal||0},set _physicalStart(r){r%=this._physicalCount,r<0&&(r=this._physicalCount+r),this._physicalStartVal=r},get _physicalEnd(){return(this._physicalStart+this._physicalCount-1)%this._physicalCount},get _physicalCount(){return this._physicalCountVal||0},set _physicalCount(r){this._physicalCountVal=r},get _optPhysicalSize(){return this._viewportHeight===0?1/0:this._viewportHeight*this._maxPages},get _isVisible(){return!!(this.offsetWidth||this.offsetHeight)},get firstVisibleIndex(){let r=this._firstVisibleIndexVal;if(r==null){let s=this._physicalTop+this._scrollOffset;r=this._iterateItems((e,t)=>{if(s+=this._getPhysicalSizeIncrement(e),s>this._scrollPosition)return t})||0,this._firstVisibleIndexVal=r}return r},get lastVisibleIndex(){let r=this._lastVisibleIndexVal;if(r==null){let s=this._physicalTop+this._scrollOffset;this._iterateItems((e,t)=>{s<this._scrollBottom&&(r=t),s+=this._getPhysicalSizeIncrement(e)}),this._lastVisibleIndexVal=r}return r},get _scrollOffset(){return this._scrollerPaddingTop+this.scrollOffset},_scrollHandler(){const r=Math.max(0,Math.min(this._maxScrollTop,this._scrollTop));let s=r-this._scrollPosition;const e=s>=0;if(this._scrollPosition=r,this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null,Math.abs(s)>this._physicalSize&&this._physicalSize>0){s-=this._scrollOffset;const t=Math.round(s/this._physicalAverage);this._virtualStart+=t,this._physicalStart+=t,this._physicalTop=Math.min(Math.floor(this._virtualStart)*this._physicalAverage,this._scrollPosition),this._update()}else if(this._physicalCount>0){const t=this._getReusables(e);e?(this._physicalTop=t.physicalTop,this._virtualStart+=t.indexes.length,this._physicalStart+=t.indexes.length):(this._virtualStart-=t.indexes.length,this._physicalStart-=t.indexes.length),this._update(t.indexes,e?null:t.indexes),this._debounce("_increasePoolIfNeeded",this._increasePoolIfNeeded.bind(this,0),B)}},_getReusables(r){let s,e,t;const i=[],o=this._hiddenContentSize*this._ratio,n=this._virtualStart,a=this._virtualEnd,c=this._physicalCount;let p=this._physicalTop+this._scrollOffset;const _=this._physicalBottom+this._scrollOffset,g=this._scrollPosition,f=this._scrollBottom;for(r?(s=this._physicalStart,e=g-p):(s=this._physicalEnd,e=_-f);t=this._getPhysicalSizeIncrement(s),e-=t,!(i.length>=c||e<=o);)if(r){if(a+i.length+1>=this._virtualCount||p+t>=g-this._scrollOffset)break;i.push(s),p+=t,s=(s+1)%c}else{if(n-i.length<=0||p+this._physicalSize-t<=f)break;i.push(s),p-=t,s=s===0?c-1:s-1}return{indexes:i,physicalTop:p-this._scrollOffset}},_update(r,s){if(!(r&&r.length===0||this._physicalCount===0)){if(this._assignModels(r),this._updateMetrics(r),s)for(;s.length;){const e=s.pop();this._physicalTop-=this._getPhysicalSizeIncrement(e)}this._positionItems(),this._updateScrollerSize()}},_isClientFull(){return this._scrollBottom!==0&&this._physicalBottom-1>=this._scrollBottom&&this._physicalTop<=this._scrollPosition},_increasePoolIfNeeded(r){const e=this._clamp(this._physicalCount+r,Ve,this._virtualCount-this._virtualStart)-this._physicalCount;let t=Math.round(this._physicalCount*.5);if(!(e<0)){if(e>0){const i=window.performance.now();[].push.apply(this._physicalItems,this._createPool(e));for(let o=0;o<e;o++)this._physicalSizes.push(0);this._physicalCount+=e,this._physicalStart>this._physicalEnd&&this._isIndexRendered(this._focusedVirtualIndex)&&this._getPhysicalIndex(this._focusedVirtualIndex)<this._physicalEnd&&(this._physicalStart+=e),this._update(),this._templateCost=(window.performance.now()-i)/e,t=Math.round(this._physicalCount*.5)}this._virtualEnd>=this._virtualCount-1||t===0||(this._isClientFull()?this._physicalSize<this._optPhysicalSize&&this._debounce("_increasePoolIfNeeded",this._increasePoolIfNeeded.bind(this,this._clamp(Math.round(50/this._templateCost),1,t)),Pt):this._debounce("_increasePoolIfNeeded",this._increasePoolIfNeeded.bind(this,t),B))}},_render(){if(!(!this.isAttached||!this._isVisible))if(this._physicalCount!==0){const r=this._getReusables(!0);this._physicalTop=r.physicalTop,this._virtualStart+=r.indexes.length,this._physicalStart+=r.indexes.length,this._update(r.indexes),this._update(),this._increasePoolIfNeeded(0)}else this._virtualCount>0&&(this.updateViewportBoundaries(),this._increasePoolIfNeeded(Ve))},_itemsChanged(r){r.path==="items"&&(this._virtualStart=0,this._physicalTop=0,this._virtualCount=this.items?this.items.length:0,this._physicalIndexForKey={},this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null,this._physicalItems||(this._physicalItems=[]),this._physicalSizes||(this._physicalSizes=[]),this._physicalStart=0,this._scrollTop>this._scrollOffset&&this._resetScrollPosition(0),this._debounce("_render",this._render,H))},_iterateItems(r,s){let e,t,i,o;if(arguments.length===2&&s){for(o=0;o<s.length;o++)if(e=s[o],t=this._computeVidx(e),(i=r.call(this,e,t))!=null)return i}else{for(e=this._physicalStart,t=this._virtualStart;e<this._physicalCount;e++,t++)if((i=r.call(this,e,t))!=null)return i;for(e=0;e<this._physicalStart;e++,t++)if((i=r.call(this,e,t))!=null)return i}},_computeVidx(r){return r>=this._physicalStart?this._virtualStart+(r-this._physicalStart):this._virtualStart+(this._physicalCount-this._physicalStart)+r},_positionItems(){this._adjustScrollPosition();let r=this._physicalTop;this._iterateItems(s=>{this.translate3d(0,`${r}px`,0,this._physicalItems[s]),r+=this._physicalSizes[s]})},_getPhysicalSizeIncrement(r){return this._physicalSizes[r]},_adjustScrollPosition(){const r=this._virtualStart===0?this._physicalTop:Math.min(this._scrollPosition+this._physicalTop,0);if(r!==0){this._physicalTop-=r;const s=this._scrollPosition;!Si&&s>0&&this._resetScrollPosition(s-r)}},_resetScrollPosition(r){this.scrollTarget&&r>=0&&(this._scrollTop=r,this._scrollPosition=this._scrollTop)},_updateScrollerSize(r){const s=this._physicalBottom+Math.max(this._virtualCount-this._physicalCount-this._virtualStart,0)*this._physicalAverage;this._estScrollHeight=s,(r||this._scrollHeight===0||this._scrollPosition>=s-this._physicalSize||Math.abs(s-this._scrollHeight)>=this._viewportHeight)&&(this.$.items.style.height=`${s}px`,this._scrollHeight=s)},scrollToIndex(r){if(typeof r!="number"||r<0||r>this.items.length-1||(ae(),this._physicalCount===0))return;r=this._clamp(r,0,this._virtualCount-1),(!this._isIndexRendered(r)||r>=this._maxVirtualStart)&&(this._virtualStart=r-1),this._assignModels(),this._updateMetrics(),this._physicalTop=this._virtualStart*this._physicalAverage;let s=this._physicalStart,e=this._virtualStart,t=0;const i=this._hiddenContentSize;for(;e<r&&t<=i;)t+=this._getPhysicalSizeIncrement(s),s=(s+1)%this._physicalCount,e+=1;this._updateScrollerSize(!0),this._positionItems(),this._resetScrollPosition(this._physicalTop+this._scrollOffset+t),this._increasePoolIfNeeded(0),this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null},_resetAverage(){this._physicalAverage=0,this._physicalAverageCount=0},_resizeHandler(){this._debounce("_render",()=>{this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null,this._isVisible?(this.updateViewportBoundaries(),this.toggleScrollListener(!0),this._resetAverage(),this._render()):this.toggleScrollListener(!1)},H)},_isIndexRendered(r){return r>=this._virtualStart&&r<=this._virtualEnd},_getPhysicalIndex(r){return(this._physicalStart+(r-this._virtualStart))%this._physicalCount},_clamp(r,s,e){return Math.min(e,Math.max(s,r))},_debounce(r,s,e){this._debouncers||(this._debouncers={}),this._debouncers[r]=E.debounce(this._debouncers[r],e,s.bind(this)),Ft(this._debouncers[r])}};/** 840 * @license 841 * Copyright (c) 2021 - 2024 Vaadin Ltd. 842 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 843 */const Ri=1e5,Ae=1e3;class dt{constructor({createElements:s,updateElement:e,scrollTarget:t,scrollC
843ontainer:i,elementsContainer:o,reorderElements:n}){this.isAttached=!0,this._vidxOffset=0,this.createElements=s,this.updateElement=e,this.scrollTarget=t,this.scrollContainer=i,this.elementsContainer=o||i,this.reorderElements=n,this._maxPages=1.3,this.__placeholderHeight=200,this.__elementHeightQueue=Array(10),this.timeouts={SCROLL_REORDER:500,IGNORE_WHEEL:500,FIX_INVALID_ITEM_POSITIONING:100},this.__resizeObserver=new ResizeObserver(()=>this._resizeHandler()),getComputedStyle(this.scrollTarget).overflow==="visible"&&(this.scrollTarget.style.overflow="auto"),getComputedStyle(this.scrollContainer).position==="static"&&(this.scrollContainer.style.position="relative"),this.__resizeObserver.observe(this.scrollTarget),this.scrollTarget.addEventListener("scroll",()=>this._scrollHandler()),this._scrollLineHeight=this._getScrollLineHeight(),this.scrollTarget.addEventListener("wheel",a=>this.__onWheel(a)),this.scrollTarget.addEventListener("virtualizer-element-focused",a=>this.__onElementFocused(a)),this.elementsContainer.addEventListener("focusin",()=>{this.scrollTarget.dispatchEvent(new CustomEvent("virtualizer-element-focused",{detail:{element:this.__getFocusedElement()}}))}),this.reorderElements&&(this.scrollTarget.addEventListener("mousedown",()=>{this.__mouseDown=!0}),this.scrollTarget.addEventListener("mouseup",()=>{this.__mouseDown=!1,this.__pendingReorder&&this.__reorderElements()}))}get scrollOffset(){return 0}get adjustedFirstVisibleIndex(){return this.firstVisibleIndex+this._vidxOffset}get adjustedLastVisibleIndex(){return this.lastVisibleIndex+this._vidxOffset}get _maxVirtualIndexOffset(){return this.size-this._virtualCount}__hasPlaceholders(){return this.__getVisibleElements().some(s=>s.__virtualizerPlaceholder)}scrollToIndex(s){if(typeof s!="number"||isNaN(s)||this.size===0||!this.scrollTarget.offsetHeight)return;delete this.__pendingScrollToIndex,this._physicalCount<=3&&this.flush(),s=this._clamp(s,0,this.size-1);const e=this.__getVisibleElements().length;let t=Math.floor(s/this.size*this._virtualCount);this._virtualCount-t<e?(t=this._virtualCount-(this.size-s),this._vidxOffset=this._maxVirtualIndexOffset):t<e?s<Ae?(t=s,this._vidxOffset=0):(t=Ae,this._vidxOffset=s-t):this._vidxOffset=s-t,this.__skipNextVirtualIndexAdjust=!0,super.scrollToIndex(t),this.adjustedFirstVisibleIndex!==s&&this._scrollTop<this._maxScrollTop&&!this.grid&&(this._scrollTop-=this.__getIndexScrollOffset(s)||0),this._scrollHandler(),this.__hasPlaceholders()&&(this.__pendingScrollToIndex=s)}flush(){this.scrollTarget.offsetHeight!==0&&(this._resizeHandler(),ae(),this._scrollHandler(),this.__fixInvalidItemPositioningDebouncer&&this.__fixInvalidItemPositioningDebouncer.flush(),this.__scrollReorderDebouncer&&this.__scrollReorderDebouncer.flush(),this.__debouncerWheelAnimationFrame&&this.__debouncerWheelAnimationFrame.flush())}update(s=0,e=this.size-1){const t=[];this.__getVisibleElements().forEach(i=>{i.__virtualIndex>=s&&i.__virtualIndex<=e&&(this.__updateElement(i,i.__virtualIndex,!0),t.push(i))}),this.__afterElementsUpdated(t)}_updateMetrics(s){ae();let e=0,t=0;const i=this._physicalAverageCount,o=this._physicalAverage;this._iterateItems((n,a)=>{t+=this._physicalSizes[n],this._physicalSizes[n]=Math.ceil(this.__getBorderBoxHeight(this._physicalItems[n])),e+=this._physicalSizes[n],this._physicalAverageCount+=this._physicalSizes[n]?1:0},s),this._physicalSize=this._physicalSize+e-t,this._physicalAverageCount!==i&&(this._physicalAverage=Math.round((o*i+e)/this._physicalAverageCount))}__getBorderBoxHeight(s){const e=getComputedStyle(s),t=parseFloat(e.height)||0;if(e.boxSizing==="border-box")return t;const i=parseFloat(e.paddingBottom)||0,o=parseFloat(e.paddingTop)||0,n=parseFloat(e.borderBottomWidth)||0,a=parseFloat(e.borderTopWidth)||0;return t+i+o+n+a}__updateElement(s,e,t){s.__virtualizerPlaceholder&&(s.style.paddingTop="",s.style.opacity="",s.__virtualizerPlaceholder=!1),!this.__preventElementUpdates&&(s.__lastUpdatedIndex!==e||t)&&(this.updateElement(s,e),s.__lastUpdatedIndex=e)}__afterElementsUpdated(s){s.forEach(e=>{const t=e.offsetHeight;if(t===0)e.style.paddingTop=`${this.__placeholderHeight}px`,e.style.opacity="0",e.__virtualizerPlaceholder=!0,this.__placeholderClearDebouncer=E.debounce(this.__placeholderClearDebouncer,H,()=>this._resizeHandler());else{this.__elementHeightQueue.push(t),this.__elementHeightQueue.shift();const i=this.__elementHeightQueue.filter(o=>o!==void 0);this.__placeholderHeight=Math.round(i.reduce((o,n)=>o+n,0)/i.length)}}),this.__pendingScrollToIndex!==void 0&&!this.__hasPlaceholders()&&this.scrollToIndex(this.__pendingScrollToIndex)}__getIndexScrollOffset(s){const e=this.__getVisibleElements().find(t=>t.__virtualIndex===s);return e?this.scrollTarget.getBoundingClientRect().top-e.getBoundingClientRect().top:void 0}get size(){return this.__size}set size(s){if(s===this.size)return;this.__fixInvalidItemPositioningDebouncer&&this.__fixInvalidItemPositioningDebouncer.cancel(),this._debouncers&&this._debouncers._increasePoolIfNeeded&&this._debouncers._increasePoolIfNeeded.cancel(),this.__preventElementUpdates=!0;let e,t;if(s>0&&(e=this.adjustedFirstVisibleIndex,t=this.__getIndexScrollOffset(e)),this.__size=s,this._itemsChanged({path:"items"}),ae(),s>0){e=Math.min(e,s-1),this.scrollToIndex(e);const i=this.__getIndexScrollOffset(e);t!==void 0&&i!==void 0&&(this._scrollTop+=t-i)}this.__preventElementUpdates=!1,this._isVisible||this._assignModels(),this.elementsContainer.children.length||requestAnimationFrame(()=>this._resizeHandler()),this._resizeHandler(),ae(),this._debounce("_update",this._update,B)}get _scrollTop(){return this.scrollTarget.scrollTop}set _scrollTop(s){this.scrollTarget.scrollTop=s}get items(){return{length:Math.min(this.size,Ri)}}get offsetHeight(){return this.scrollTarget.offsetHeight}get $(){return{items:this.scrollContainer}}
843updateViewportBoundaries(){const s=window.getComputedStyle(this.scrollTarget);this._scrollerPaddingTop=this.scrollTarget===this?0:parseInt(s["padding-top"],10),this._isRTL=s.direction==="rtl",this._viewportWidth=this.elementsContainer.offsetWidth,this._viewportHeight=this.scrollTarget.offsetHeight,this._scrollPageHeight=this._viewportHeight-this._scrollLineHeight,this.grid&&this._updateGridMetrics()}setAttribute(){}_createPool(s){const e=this.createElements(s),t=document.createDocumentFragment();return e.forEach(i=>{i.style.position="absolute",t.appendChild(i),this.__resizeObserver.observe(i)}),this.elementsContainer.appendChild(t),e}_assignModels(s){const e=[];this._iterateItems((t,i)=>{const o=this._physicalItems[t];o.hidden=i>=this.size,o.hidden?delete o.__lastUpdatedIndex:(o.__virtualIndex=i+(this._vidxOffset||0),this.__updateElement(o,o.__virtualIndex),e.push(o))},s),this.__afterElementsUpdated(e)}_isClientFull(){return setTimeout(()=>{this.__clientFull=!0}),this.__clientFull||super._isClientFull()}translate3d(s,e,t,i){i.style.transform=`translateY(${e})`}toggleScrollListener(){}__getFocusedElement(s=this.__getVisibleElements()){return s.find(e=>e.contains(this.elementsContainer.getRootNode().activeElement)||e.contains(this.scrollTarget.getRootNode().activeElement))}__nextFocusableSiblingMissing(s,e){return e.indexOf(s)===e.length-1&&this.size>s.__virtualIndex+1}__previousFocusableSiblingMissing(s,e){return e.indexOf(s)===0&&s.__virtualIndex>0}__onElementFocused(s){if(!this.reorderElements)return;const e=s.detail.element;if(!e)return;const t=this.__getVisibleElements();(this.__previousFocusableSiblingMissing(e,t)||this.__nextFocusableSiblingMissing(e,t))&&this.flush();const i=this.__getVisibleElements();this.__nextFocusableSiblingMissing(e,i)?(this._scrollTop+=Math.ceil(e.getBoundingClientRect().bottom)-Math.floor(this.scrollTarget.getBoundingClientRect().bottom-1),this.flush()):this.__previousFocusableSiblingMissing(e,i)&&(this._scrollTop-=Math.ceil(this.scrollTarget.getBoundingClientRect().top+1)-Math.floor(e.getBoundingClientRect().top),this.flush())}_scrollHandler(){if(this.scrollTarget.offsetHeight===0)return;this._adjustVirtualIndexOffset(this._scrollTop-(this.__previousScrollTop||0));const s=this.scrollTarget.scrollTop-this._scrollPosition;if(super._scrollHandler(),this._physicalCount!==0){const e=s>=0,t=this._getReusables(!e);t.indexes.length&&(this._physicalTop=t.physicalTop,e?(this._virtualStart-=t.indexes.length,this._physicalStart-=t.indexes.length):(this._virtualStart+=t.indexes.length,this._physicalStart+=t.indexes.length),this._resizeHandler())}s&&(this.__fixInvalidItemPositioningDebouncer=E.debounce(this.__fixInvalidItemPositioningDebouncer,$.after(this.timeouts.FIX_INVALID_ITEM_POSITIONING),()=>this.__fixInvalidItemPositioning())),this.reorderElements&&(this.__scrollReorderDebouncer=E.debounce(this.__scrollReorderDebouncer,$.after(this.timeouts.SCROLL_REORDER),()=>this.__reorderElements())),this.__previousScrollTop=this._scrollTop,this._scrollTop===0&&this.firstVisibleIndex!==0&&Math.abs(s)>0&&this.scrollToIndex(0)}__fixInvalidItemPositioning(){if(!this.scrollTarget.isConnected)return;const s=this._physicalTop>this._scrollTop,e=this._physicalBottom<this._scrollBottom,t=this.adjustedFirstVisibleIndex===0,i=this.adjustedLastVisibleIndex===this.size-1;if(s&&!t||e&&!i){const o=e,n=this._ratio;this._ratio=0,this._scrollPosition=this._scrollTop+(o?-1:1),this._scrollHandler(),this._ratio=n}}__onWheel(s){if(s.ctrlKey||this._hasScrolledAncestor(s.target,s.deltaX,s.deltaY))return;let e=s.deltaY;if(s.deltaMode===WheelEvent.DOM_DELTA_LINE?e*=this._scrollLineHeight:s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._scrollPageHeight),this._deltaYAcc||(this._deltaYAcc=0),this._wheelAnimationFrame){this._deltaYAcc+=e,s.preventDefault();return}e+=this._deltaYAcc,this._deltaYAcc=0,this._wheelAnimationFrame=!0,this.__debouncerWheelAnimationFrame=E.debounce(this.__debouncerWheelAnimationFrame,H,()=>{this._wheelAnimationFrame=!1});const t=Math.abs(s.deltaX)+Math.abs(e);this._canScroll(this.scrollTarget,s.deltaX,e)?(s.preventDefault(),this.scrollTarget.scrollTop+=e,this.scrollTarget.scrollLeft+=s.deltaX,this._hasResidualMomentum=!0,this._ignoreNewWheel=!0,this._debouncerIgnoreNewWheel=E.debounce(this._debouncerIgnoreNewWheel,$.after(this.timeouts.IGNORE_WHEEL),()=>{this._ignoreNewWheel=!1})):this._hasResidualMomentum&&t<=this._previousMomentum||this._ignoreNewWheel?s.preventDefault():t>this._previousMomentum&&(this._hasResidualMomentum=!1),this._previousMomentum=t}_hasScrolledAncestor(s,e,t){if(s===this.scrollTarget||s===this.scrollTarget.getRootNode().host)return!1;if(this._canScroll(s,e,t)&&["auto","scroll"].indexOf(getComputedStyle(s).overflow)!==-1)return!0;
843if(s!==this&&s.parentElement)return this._hasScrolledAncestor(s.parentElement,e,t)}_canScroll(s,e,t){return t>0&&s.scrollTop<s.scrollHeight-s.offsetHeight||t<0&&s.scrollTop>0||e>0&&s.scrollLeft<s.scrollWidth-s.offsetWidth||e<0&&s.scrollLeft>0}_increasePoolIfNeeded(s){if(this._physicalCount>2&&s){const t=Math.ceil(this._optPhysicalSize/this._physicalAverage)-this._physicalCount;super._increasePoolIfNeeded(Math.max(s,Math.min(100,t)))}else super._increasePoolIfNeeded(s)}get _optPhysicalSize(){const s=super._optPhysicalSize;return s<=0||this.__hasPlaceholders()?s:s+this.__getItemHeightBuffer()}__getItemHeightBuffer(){if(this._physicalCount===0)return 0;const s=Math.ceil(this._viewportHeight*(this._maxPages-1)/2),e=Math.max(...this._physicalSizes);return e>Math.min(...this._physicalSizes)?Math.max(0,e-s):0}_getScrollLineHeight(){const s=document.createElement("div");s.style.fontSize="initial",s.style.display="none",document.body.appendChild(s);const e=window.getComputedStyle(s).fontSize;return document.body.removeChild(s),e?window.parseInt(e):void 0}__getVisibleElements(){return Array.from(this.elementsContainer.children).filter(s=>!s.hidden)}__reorderElements(){if(this.__mouseDown){this.__pendingReorder=!0;return}this.__pendingReorder=!1;const s=this._virtualStart+(this._vidxOffset||0),e=this.__getVisibleElements(),t=this.__getFocusedElement(e)||e[0];if(!t)return;const i=t.__virtualIndex-s,o=e.indexOf(t)-i;if(o>0)for(let n=0;n<o;n++)this.elementsContainer.appendChild(e[n]);else if(o<0)for(let n=e.length+o;n<e.length;n++)this.elementsContainer.insertBefore(e[n],e[0]);if(et){const{transform:n}=this.scrollTarget.style;this.scrollTarget.style.transform="translateZ(0)",setTimeout(()=>{this.scrollTarget.style.transform=n})}}_adjustVirtualIndexOffset(s){const e=this._maxVirtualIndexOffset;if(this._virtualCount>=this.size)this._vidxOffset=0;else if(this.__skipNextVirtualIndexAdjust)this.__skipNextVirtualIndexAdjust=!1;else if(Math.abs(s)>1e4){const t=this._scrollTop/(this.scrollTarget.scrollHeight-this.scrollTarget.clientHeight);this._vidxOffset=Math.round(t*e)}else{const t=this._vidxOffset,i=Ae,o=100;this._scrollTop===0?(this._vidxOffset=0,t!==this._vidxOffset&&super.scrollToIndex(0)):this.firstVisibleIndex<i&&this._vidxOffset>0&&(this._vidxOffset-=Math.min(this._vidxOffset,o),super.scrollToIndex(this.firstVisibleIndex+(t-this._vidxOffset))),this._scrollTop>=this._maxScrollTop&&this._maxScrollTop>0?(this._vidxOffset=e,t!==this._vidxOffset&&super.scrollToIndex(this._virtualCount-1)):this.firstVisibleIndex>this._virtualCount-i&&this._vidxOffset<e&&(this._vidxOffset+=Math.min(e-this._vidxOffset,o),super.scrollToIndex(this.firstVisibleIndex-(this._vidxOffset-t)))}}}Object.setPrototypeOf(dt.prototype,zi);class Ti{constructor(s){this.__adapter=new dt(s)}get firstVisibleIndex(){return this.__adapter.adjustedFirstVisibleIndex}get lastVisibleIndex(){return this.__adapter.adjustedLastVisibleIndex}get size(){return this.__adapter.size}set size(s){this.__adapter.size=s}scrollToIndex(s){this.__adapter.scrollToIndex(s)}update(s=0,e=this.size-1){this.__adapter.update(s,e)}flush(){this.__adapter.flush()}}/** 844 * @license 845 * Copyright (c) 2016 - 2024 Vaadin Ltd. 846 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 847 */const ki=r=>class extends r{static get observers(){return["_a11yUpdateGridSize(size, _columnTree)"]}_a11yGetHeaderRowCount(e){return e.filter(t=>t.some(i=>i.headerRenderer||i.path&&i.header!==null||i.header)).length}_a11yGetFooterRowCount(e){return e.filter(t=>t.some(i=>i.headerRenderer)).length}_a11yUpdateGridSize(e,t){if(e===void 0||t===void 0)return;const i=t[t.length-1];this.$.table.setAttribute("aria-rowcount",e+this._a11yGetHeaderRowCount(t)+this._a11yGetFooterRowCount(t)),this.$.table.setAttribute("aria-colcount",i&&i.length||0),this._a11yUpdateHeaderRows(),this._a11yUpdateFooterRows()}_a11yUpdateHeaderRows(){k(this.$.header,(e,t)=>{e.setAttribute("aria-rowindex",t+1)})}_a11yUpdateFooterRows(){k(this.$.footer,(e,t)=>{e.setAttribute("aria-rowindex",this._a11yGetHeaderRowCount(this._columnTree)+this.size+t+1)})}_a11yUpdateRowRowindex(e,t){e.setAttribute("aria-rowindex",t+this._a11yGetHeaderRowCount(this._columnTree)+1)}_a11yUpdateRowSelected(e,t){e.setAttribute("aria-selected",!!t),se(e,i=>{i.setAttribute("aria-selected",!!t)})}_a11yUpdateRowExpanded(e){this.__isRowExpandable(e)?e.setAttribute("aria-expanded","fal
847se"):this.__isRowCollapsible(e)?e.setAttribute("aria-expanded","true"):e.removeAttribute("aria-expanded")}_a11yUpdateRowLevel(e,t){t>0||this.__isRowCollapsible(e)||this.__isRowExpandable(e)?e.setAttribute("aria-level",t+1):e.removeAttribute("aria-level")}_a11ySetRowDetailsCell(e,t){se(e,i=>{i!==t&&i.setAttribute("aria-controls",t.id)})}_a11yUpdateCellColspan(e,t){e.setAttribute("aria-colspan",Number(t))}_a11yUpdateSorters(){Array.from(this.querySelectorAll("vaadin-grid-sorter")).forEach(e=>{let t=e.parentNode;for(;t&&t.localName!=="vaadin-grid-cell-content";)t=t.parentNode;t&&t.assignedSlot&&t.assignedSlot.parentNode.setAttribute("aria-sort",{asc:"ascending",desc:"descending"}[String(e.direction)]||"none")})}};/** 848 * @license 849 * Copyright (c) 2016 - 2024 Vaadin Ltd. 850 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 851 */const ht=r=>r.offsetParent&&!r.part.contains("body-cell")&&Je(r)&&getComputedStyle(r).visibility!=="hidden",Oi=r=>class extends r{static get properties(){return{activeItem:{type:Object,notify:!0,value:null,sync:!0}}}ready(){super.ready(),this.$.scroller.addEventListener("click",this._onClick.bind(this)),this.addEventListener("cell-activate",this._activateItem.bind(this)),this.addEventListener("row-activate",this._activateItem.bind(this))}_activateItem(e){const t=e.detail.model,i=t?t.item:null;i&&(this.activeItem=this._itemsEqual(this.activeItem,i)?null:i)}_shouldPreventCellActivationOnClick(e){const{cell:t}=this._getGridEventLocation(e);return e.defaultPrevented||!t||t.getAttribute("part").includes("details-cell")||t===this.$.emptystatecell||t._content.contains(this.getRootNode().activeElement)||this._isFocusable(e.target)||e.target instanceof HTMLLabelElement}_onClick(e){if(this._shouldPreventCellActivationOnClick(e))return;const{cell:t}=this._getGridEventLocation(e);t&&this.dispatchEvent(new CustomEvent("cell-activate",{detail:{model:this.__getRowModel(t.parentElement)}}))}_isFocusable(e){return ht(e)}};function te(r,s){return r.split(".").reduce((e,t)=>e[t],s)}function Ge(r,s,e){if(e.length===0)return!1;let t=!0;return r.forEach(({path:i})=>{if(!i||i.indexOf(".")===-1)return;const o=i.replace(/\.[^.]*$/u,"");te(o,e[0])===void 0&&(console.warn(`Path "${i}" used for ${s} does not exist in all of the items, ${s} is disabled.`),t=!1)}),t}function be(r){return[void 0,null].indexOf(r)>=0?"":isNaN(r)?r.toString():r}function We(r,s){return r=be(r),s=be(s),r<s?-1:r>s?1:0}function Pi(r,s){return r.sort((e,t)=>s.map(i=>i.direction==="asc"?We(te(i.path,e),te(i.path,t)):i.direction==="desc"?We(te(i.path,t),te(i.path,e)):0).reduce((i,o)=>i!==0?i:o,0))}function Fi(r,s){return r.filter(e=>s.every(t=>{const i=be(te(t.path,e)),o=be(t.value).toString().toLowerCase();return i.toString().toLowerCase().includes(o)}))}const Di=r=>(s,e)=>{let t=r?[...r]:[];s.filters&&Ge(s.filters,"filtering",t)&&(t=Fi(t,s.filters)),Array.isArray(s.sortOrders)&&s.sortOrders.length&&Ge(s.sortOrders,"sorting",t)&&(t=Pi(t,s.sortOrders));const i=Math.min(t.length,s.pageSize),o=s.page*i,n=o+i,a=t.slice(o,n);e(a,t.length)};/** 852 * @license 853 * Copyright (c) 2016 - 2024 Vaadin Ltd. 854 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 855 */const Mi=r=>class extends r{static get properties(){return{items:{type:Array,sync:!0}}}static get observers(){return["__dataProviderOrItemsChanged(dataProvider, items, isAttached, items.*)"]}__setArrayDataProvider(e){const t=Di(this.items);t.__items=e,this._arrayDataProvider=t,this.size=e.length,this.dataProvider=t}_onDataProviderPageReceived(){super._onDataProviderPageReceived(),this._arrayDataProvider&&(this.size=this._flatSize)}__dataProviderOrItemsChanged(e,t,i){i&&(this._arrayDataProvider?e!==this._arrayDataProvider?(this._arrayDataProvider=void 0,this.items=void 0):t?this._arrayDataProvider.__items===t?this.clearCache():this.__setArrayDataProvider(t):(this._arrayDataProvider=void 0,this.dataProvider=void 0,this.size=0,this.clearCache()):t&&this.__setArrayDataProvider(t))}};/** 856 * @license 857 * Copyright (c) 2016 - 2024 Vaadin Ltd. 858 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 859 */const Li=r=>class extends r{static get properties(){return{columnReorderingAllowed:{type:Boolean,value:!1},_orderBaseScope:{type:Number,value:1e7}}}static get observers(){return["_updateOrders(_columnTree)"]}ready(){super.ready(),he(this,"track",this._onTrackEvent),this._reorderGhost=this.shadowRoot.querySelector('[part="reorder-ghost"]'),this.addEventListener("touchstart",this._onTouchStart.bind(this)),this.addEventListener("touchmove",this._onTouchMove.bind(this)),this.addEventListener("touchend",this._onTouchEnd.bind(this)),this.addEventListener("contextmenu",this._onContextMenu.bind(this))}_onContextMenu(e){this.hasAttribute("reordering")&&(e.preventDefault(),Te||this._onTrackEnd())}_onTouchStart(e){this._startTouchReorderTimeout=setTimeout(()=>
859{this._onTrackStart({detail:{x:e.touches[0].clientX,y:e.touches[0].clientY}})},100)}_onTouchMove(e){this._draggedColumn&&e.preventDefault(),clearTimeout(this._startTouchReorderTimeout)}_onTouchEnd(){clearTimeout(this._startTouchReorderTimeout),this._onTrackEnd()}_onTrackEvent(e){if(e.detail.state==="start"){const t=e.composedPath(),i=t[t.indexOf(this.$.header)-2];if(!i||!i._content||i._content.contains(this.getRootNode().activeElement)||this.$.scroller.hasAttribute("column-resizing"))return;this._touchDevice||this._onTrackStart(e)}else e.detail.state==="track"?this._onTrack(e):e.detail.state==="end"&&this._onTrackEnd(e)}_onTrackStart(e){if(!this.columnReorderingAllowed)return;const t=e.composedPath&&e.composedPath();if(t&&t.some(o=>o.hasAttribute&&o.hasAttribute("draggable")))return;const i=this._cellFromPoint(e.detail.x,e.detail.y);if(!(!i||!i.getAttribute("part").includes("header-cell"))){for(this.toggleAttribute("reordering",!0),this._draggedColumn=i._column;this._draggedColumn.parentElement.childElementCount===1;)this._draggedColumn=this._draggedColumn.parentElement;this._setSiblingsReorderStatus(this._draggedColumn,"allowed"),this._draggedColumn._reorderStatus="dragging",this._updateGhost(i),this._reorderGhost.style.visibility="visible",this._updateGhostPosition(e.detail.x,this._touchDevice?e.detail.y-50:e.detail.y),this._autoScroller()}}_onTrack(e){if(!this._draggedColumn)return;const t=this._cellFromPoint(e.detail.x,e.detail.y);if(!t)return;const i=this._getTargetColumn(t,this._draggedColumn);if(this._isSwapAllowed(this._draggedColumn,i)&&this._isSwappableByPosition(i,e.detail.x)){const o=this._columnTree.findIndex(_=>_.includes(i)),n=this._getColumnsInOrder(o),a=n.indexOf(this._draggedColumn),c=n.indexOf(i),p=a<c?1:-1;for(let _=a;_!==c;_+=p)this._swapColumnOrders(this._draggedColumn,n[_+p])}this._updateGhostPosition(e.detail.x,this._touchDevice?e.detail.y-50:e.detail.y),this._lastDragClientX=e.detail.x}_onTrackEnd(){this._draggedColumn&&(this.toggleAttribute("reordering",!1),this._draggedColumn._reorderStatus="",this._setSiblingsReorderStatus(this._draggedColumn,""),this._draggedColumn=null,this._lastDragClientX=null,this._reorderGhost.style.visibility="hidden",this.dispatchEvent(new CustomEvent("column-reorder",{detail:{columns:this._getColumnsInOrder()}})))}_getColumnsInOrder(e=this._columnTree.length-1){return this._columnTree[e].filter(t=>!t.hidden).sort((t,i)=>t._order-i._order)}_cellFromPoint(e=0,t=0){this._draggedColumn||this.$.scroller.toggleAttribute("no-content-pointer-events",!0);const i=this.shadowRoot.elementFromPoint(e,t);return this.$.scroller.toggleAttribute("no-content-pointer-events",!1),this._getCellFromElement(i)}_getCellFromElement(e){if(e){if(e._column)return e;const{parentElement:t}=e;if(t&&t._focusButton===e)return t}return null}_updateGhostPosition(e,t){const i=this._reorderGhost.getBoundingClientRect(),o=e-i.width/2,n=t-i.height/2,a=parseInt(this._reorderGhost._left||0),c=parseInt(this._reorderGhost._top||0);this._reorderGhost._left=a-(i.left-o),this._reorderGhost._top=c-(i.top-n),this._reorderGhost.style.transform=`translate(${this._reorderGhost._left}px, ${this._reorderGhost._top}px)`}_updateGhost(e){const t=this._reorderGhost;t.textContent=e._content.innerText;const i=window.getComputedStyle(e);return["boxSizing","display","width","height","background","alignItems","padding","border","flex-direction","overflow"].forEach(o=>{t.style[o]=i[o]}),t}_updateOrders(e){e!==void 0&&(e[0].forEach(t=>{t._order=0}),it(e[0],this._orderBaseScope,0))}_setSiblingsReorderStatus(e,t){k(e.parentNode,i=>{/column/u.test(i.localName)&&this._isSwapAllowed(i,e)&&(i._reorderStatus=t)})}_autoScroller(){if(this._lastDragClientX){const e=this._lastDragClientX-this.getBoundingClientRect().right+50,t=this.getBoundingClientRect().left-this._lastDragClientX+50;e>0?this.$.table.scrollLeft+=e/10:t>0&&(this.$.table.scrollLeft-=t/10)}this._draggedColumn&&setTimeout(()=>this._autoScroller(),10)}_isSwapAllowed(e,t){if(e&&t){const i=e!==t,o=e.parentElement===t.parentElement,n=e.frozen&&t.frozen||e.frozenToEnd&&t.frozenToEnd||
859!e.frozen&&!e.frozenToEnd&&!t.frozen&&!t.frozenToEnd;return i&&o&&n}}_isSwappableByPosition(e,t){const i=Array.from(this.$.header.querySelectorAll('tr:not([hidden]) [part~="cell"]')).find(a=>e.contains(a._column)),o=this.$.header.querySelector("tr:not([hidden]) [reorder-status=dragging]").getBoundingClientRect(),n=i.getBoundingClientRect();return n.left>o.left?t>n.right-o.width:t<n.left+o.width}_swapColumnOrders(e,t){[e._order,t._order]=[t._order,e._order],this._debounceUpdateFrozenColumn(),this._updateFirstAndLastColumn()}_getTargetColumn(e,t){if(e&&t){let i=e._column;for(;i.parentElement!==t.parentElement&&i!==this;)i=i.parentElement;return i.parentElement===t.parentElement?i:e._column}}};/** 860 * @license 861 * Copyright (c) 2016 - 2024 Vaadin Ltd. 862 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 863 */const $i=r=>class extends r{ready(){super.ready();const e=this.$.scroller;he(e,"track",this._onHeaderTrack.bind(this)),e.addEventListener("touchmove",t=>e.hasAttribute("column-resizing")&&t.preventDefault()),e.addEventListener("contextmenu",t=>t.target.getAttribute("part")==="resize-handle"&&t.preventDefault()),e.addEventListener("mousedown",t=>t.target.getAttribute("part")==="resize-handle"&&t.preventDefault())}_onHeaderTrack(e){const t=e.target;if(t.getAttribute("part")==="resize-handle"){let o=t.parentElement._column;for(this.$.scroller.toggleAttribute("column-resizing",!0);o.localName==="vaadin-grid-column-group";)o=o._childColumns.slice(0).sort((g,f)=>g._order-f._order).filter(g=>!g.hidden).pop();const n=this.__isRTL,a=e.detail.x,c=Array.from(this.$.header.querySelectorAll('[part~="row"]:last-child [part~="cell"]')),p=c.find(g=>g._column===o);if(p.offsetWidth){const g=getComputedStyle(p._content),f=10+parseInt(g.paddingLeft)+parseInt(g.paddingRight)+parseInt(g.borderLeftWidth)+parseInt(g.borderRightWidth)+parseInt(g.marginLeft)+parseInt(g.marginRight);let y;const w=p.offsetWidth,S=p.getBoundingClientRect();p.hasAttribute("frozen-to-end")?y=w+(n?a-S.right:S.left-a):y=w+(n?S.left-a:a-S.right),o.width=`${Math.max(f,y)}px`,o.flexGrow=0}c.sort((g,f)=>g._column._order-f._column._order).forEach((g,f,y)=>{f<y.indexOf(p)&&(g._column.width=`${g.offsetWidth}px`,g._column.flexGrow=0)});const _=this._frozenToEndCells[0];if(_&&this.$.table.scrollWidth>this.$.table.offsetWidth){const g=_.getBoundingClientRect(),f=a-(n?g.right:g.left);(n&&f<=0||!n&&f>=0)&&(this.$.table.scrollLeft+=f)}e.detail.state==="end"&&(this.$.scroller.toggleAttribute("column-resizing",!1),this.dispatchEvent(new CustomEvent("column-resize",{detail:{resizedColumn:o}}))),this._resizeHandler()}}};/** 864 * @license 865 * Copyright (c) 2021 - 2024 Vaadin Ltd. 866 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 867 */function ve(r,s,e=0){let t=s;for(const i of r.subCaches){const o=i.parentCacheIndex;if(t<=o)break;if(t<=o+i.flatSize)return ve(i,t-o-1,e+1);t-=i.flatSize}return{cache:r,item:r.items[t],index:t,page:Math.floor(t/r.pageSize),level:e}}function ct({getItemId:r},s,e,t=0,i=0){for(let o=0;o<s.items.length;o++){const n=s.items[o];if(n&&r(n)===r(e))return{cache:s,level:t,item:n,index:o,page:Math.floor(o/s.pageSize),subCache:s.getSubCache(o),flatIndex:i+s.getFlatIndex(o)}}for(const o of s.subCaches){const n=i+s.getFlatIndex(o.parentCacheIndex),a=ct({getItemId:r},o,e,t+1,n+1);if(a)return a}}function ut(r,[s,...e],t=0){s===1/0&&(s=r.size-1);const i=r.getFlatIndex(s),o=r.getSubCache(s);return o&&o.flatSize>0&&e.length?ut(o,e,t+i+1):t+i}/** 868 * @license 869 * Copyright (c) 2021 - 2024 Vaadin Ltd. 870 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 871 */class Fe{constructor(s,e,t,i,o){T(this,"context");T(this,"pageSize");T(this,"items",[]);T(this,"pendingRequests",{});T(this,"__subCacheByIndex",{});T(this,"__size",0);T(this,"__flatSize",0);this.context=s,this.pageSize=e,this.size=t,this.parentCache=i,this.parentCacheIndex=o,this.__flatSize=t||0}get parentItem(){return this.parentCache&&this.parentCache.items[this.parentCacheIndex]}get subCaches(){return Object.values(this.__subCacheByIndex)}get isLoading(){return Object.keys(this.pendingRequests).length>0?!0:this.subCaches.some(s=>s.isLoading)}get flatSize(){return this.__flatSize}get effectiveSize(){return console.warn("<vaadin-grid> The `effectiveSize` property of ItemCache is deprecated and will be removed in Vaadin 25."),this.flatSize}get size(){return this.__size}set size(s){var t;if(this.__size!==s){if(this.__size=s,this.context.placeholder!==void 0){this.items.length=s||0;for(let i=0;i<s;i++)(t=this.items)[i]||(t[i]=this.context.placeholder)}
871Object.keys(this.pendingRequests).forEach(i=>{parseInt(i)*this.pageSize>=this.size&&delete this.pendingRequests[i]})}}recalculateFlatSize(){this.__flatSize=!this.parentItem||this.context.isExpanded(this.parentItem)?this.size+this.subCaches.reduce((s,e)=>(e.recalculateFlatSize(),s+e.flatSize),0):0}setPage(s,e){const t=s*this.pageSize;e.forEach((i,o)=>{const n=t+o;(this.size===void 0||n<this.size)&&(this.items[n]=i)})}getSubCache(s){return this.__subCacheByIndex[s]}removeSubCache(s){delete this.__subCacheByIndex[s]}removeSubCaches(){this.__subCacheByIndex={}}createSubCache(s){const e=new Fe(this.context,this.pageSize,0,this,s);return this.__subCacheByIndex[s]=e,e}getFlatIndex(s){const e=Math.max(0,Math.min(this.size-1,s));return this.subCaches.reduce((t,i)=>{const o=i.parentCacheIndex;return e>o?t+i.flatSize:t},e)}getItemForIndex(s){console.warn("<vaadin-grid> The `getItemForIndex` method of ItemCache is deprecated and will be removed in Vaadin 25.");const{item:e}=ve(this,s);return e}getCacheAndIndex(s){console.warn("<vaadin-grid> The `getCacheAndIndex` method of ItemCache is deprecated and will be removed in Vaadin 25.");const{cache:e,index:t}=ve(this,s);return{cache:e,scaledIndex:t}}updateSize(){console.warn("<vaadin-grid> The `updateSize` method of ItemCache is deprecated and will be removed in Vaadin 25."),this.recalculateFlatSize()}ensureSubCacheForScaledIndex(s){if(console.warn("<vaadin-grid> The `ensureSubCacheForScaledIndex` method of ItemCache is deprecated and will be removed in Vaadin 25."),!this.getSubCache(s)){const e=this.createSubCache(s);this.context.__controller.__loadCachePage(e,0)}}get grid(){return console.warn("<vaadin-grid> The `grid` property of ItemCache is deprecated and will be removed in Vaadin 25."),this.context.__controller.host}get itemCaches(){return console.warn("<vaadin-grid> The `itemCaches` property of ItemCache is deprecated and will be removed in Vaadin 25."),this.__subCacheByIndex}}/** 872 * @license 873 * Copyright (c) 2021 - 2024 Vaadin Ltd. 874 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 875 */class Bi extends EventTarget{constructor(e,{size:t,pageSize:i,isExpanded:o,getItemId:n,isPlaceholder:a,placeholder:c,dataProvider:p,dataProviderParams:_}){super();T(this,"host");T(this,"dataProvider");T(this,"dataProviderParams");T(this,"pageSize");T(this,"isExpanded");T(this,"getItemId");T(this,"rootCache");T(this,"placeholder");T(this,"isPlaceholder");this.host=e,this.pageSize=i,this.getItemId=n,this.isExpanded=o,this.placeholder=c,this.isPlaceholder=a,this.dataProvider=p,this.dataProviderParams=_,this.rootCache=this.__createRootCache(t)}get flatSize(){return this.rootCache.flatSize}get __cacheContext(){return{isExpanded:this.isExpanded,placeholder:this.placeholder,__controller:this}}isLoading(){return this.rootCache.isLoading}setPageSize(e){this.pageSize=e,this.clearCache()}setDataProvider(e){this.dataProvider=e,this.clearCache()}recalculateFlatSize(){this.rootCache.recalculateFlatSize()}clearCache(){this.rootCache=this.__createRootCache(this.rootCache.size)}getFlatIndexContext(e){return ve(this.rootCache,e)}getItemContext(e){return ct({getItemId:this.getItemId},this.rootCache,e)}getFlatIndexByPath(e){return ut(this.rootCache,e)}ensureFlatIndexLoaded(e){const{cache:t,page:i,item:o}=this.getFlatIndexContext(e);this.__isItemLoaded(o)||this.__loadCachePage(t,i)}ensureFlatIndexHierarchy(e){const{cache:t,item:i,index:o}=this.getFlatIndexContext(e);if(this.__isItemLoaded(i)&&this.isExpanded(i)&&!t.getSubCache(o)){const n=t.createSubCache(o);this.__loadCachePage(n,0)}}loadFirstPage(){this.__loadCachePage(this.rootCache,0)}__createRootCache(e){return new Fe(this.__cacheContext,this.pageSize,e)}__loadCachePage(e,t){if(!this.dataProvider||e.pendingRequests[t])return;let i={page:t,pageSize:this.pageSize,parentItem:e.parentItem};this.dataProviderParams&&(i={...i,...this.dataProviderParams()});const o=(n,a)=>{e.pendingRequests[t]===o&&(a!==void 0?e.size=a:i.parentItem&&(e.size=n.length),e.setPage(t,n),this.recalculateFlatSize(),this.dispatchEvent(new CustomEvent("page-received")),delete e.pendingRequests[t],this.dispatchEvent(new CustomEvent("page-loaded")))};
875e.pendingRequests[t]=o,this.dispatchEvent(new CustomEvent("page-requested")),this.dataProvider(i,o)}__isItemLoaded(e){return this.isPlaceholder?!this.isPlaceholder(e):this.placeholder?e!==this.placeholder:!!e}}/** 876 * @license 877 * Copyright (c) 2016 - 2024 Vaadin Ltd. 878 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 879 */const Hi=r=>class extends r{static get properties(){return{size:{type:Number,notify:!0,sync:!0},_flatSize:{type:Number,sync:!0},pageSize:{type:Number,value:50,observer:"_pageSizeChanged",sync:!0},dataProvider:{type:Object,notify:!0,observer:"_dataProviderChanged",sync:!0},loading:{type:Boolean,notify:!0,readOnly:!0,reflectToAttribute:!0},_hasData:{type:Boolean,value:!1,sync:!0},itemHasChildrenPath:{type:String,value:"children",observer:"__itemHasChildrenPathChanged",sync:!0},itemIdPath:{type:String,value:null,sync:!0},expandedItems:{type:Object,notify:!0,value:()=>[],sync:!0},__expandedKeys:{type:Object,computed:"__computeExpandedKeys(itemIdPath, expandedItems)"}}}static get observers(){return["_sizeChanged(size)","_expandedItemsChanged(expandedItems)"]}constructor(){super(),this._dataProviderController=new Bi(this,{size:this.size||0,pageSize:this.pageSize,getItemId:this.getItemId.bind(this),isExpanded:this._isExpanded.bind(this),dataProvider:this.dataProvider?this.dataProvider.bind(this):null,dataProviderParams:()=>({sortOrders:this._mapSorters(),filters:this._mapFilters()})}),this._dataProviderController.addEventListener("page-requested",this._onDataProviderPageRequested.bind(this)),this._dataProviderController.addEventListener("page-received",this._onDataProviderPageReceived.bind(this)),this._dataProviderController.addEventListener("page-loaded",this._onDataProviderPageLoaded.bind(this))}get _cache(){return console.warn("<vaadin-grid> The `_cache` property is deprecated and will be removed in Vaadin 25."),this._dataProviderController.rootCache}get _effectiveSize(){return console.warn("<vaadin-grid> The `_effectiveSize` property is deprecated and will be removed in Vaadin 25."),this._flatSize}_sizeChanged(e){this._dataProviderController.rootCache.size=e,this._dataProviderController.recalculateFlatSize(),this._flatSize=this._dataProviderController.flatSize}__itemHasChildrenPathChanged(e,t){!t&&e==="children"||this.requestContentUpdate()}_getItem(e,t){t.index=e;const{item:i}=this._dataProviderController.getFlatIndexContext(e);i?(this.__updateLoading(t,!1),this._updateItem(t,i),this._isExpanded(i)&&this._dataProviderController.ensureFlatIndexHierarchy(e)):(this.__updateLoading(t,!0),this._dataProviderController.ensureFlatIndexLoaded(e))}__updateLoading(e,t){const i=ie(e);Ce(e,"loading",t),q(i,"loading-row-cell",t),t&&(this._generateCellClassNames(e),this._generateCellPartNames(e))}getItemId(e){return this.itemIdPath?Oe(this.itemIdPath,e):e}_isExpanded(e){return this.__expandedKeys&&this.__expandedKeys.has(this.getItemId(e))}_expandedItemsChanged(){this._dataProviderController.recalculateFlatSize(),this._flatSize=this._dataProviderController.flatSize,this.__updateVisibleRows()}__computeExpandedKeys(e,t){const i=t||[],o=new Set;return i.forEach(n=>{o.add(this.getItemId(n))}),o}expandItem(e){this._isExpanded(e)||(this.expandedItems=[...this.expandedItems,e])}collapseItem(e){this._isExpanded(e)&&(this.expandedItems=this.expandedItems.filter(t=>!this._itemsEqual(t,e)))}_getIndexLevel(e=0){const{level:t}=this._dataProviderController.getFlatIndexContext(e);return t}_loadPage(e,t){console.warn("<vaadin-grid> The `_loadPage` method is deprecated and will be removed in Vaadin 25."),this._dataProviderController.__loadCachePage(t,e)}_onDataProviderPageRequested(){this._setLoading(!0)}_onDataProviderPageReceived(){this._flatSize!==this._dataProviderController.flatSize&&(this._shouldUpdateAllRenderedRowsAfterPageLoad=!0,this._flatSize=this._dataProviderController.flatSize),this._getRenderedRows().forEach(e=>{this._dataProviderController.ensureFlatIndexHierarchy(e.index)}),this._hasData=!0}_onDataProviderPageLoaded(){this._debouncerApplyCachedData=E.debounce(this._debouncerApplyCachedData,$.after(0),()=>
879{this._setLoading(!1);const e=this._shouldUpdateAllRenderedRowsAfterPageLoad;this._shouldUpdateAllRenderedRowsAfterPageLoad=!1,this._getRenderedRows().forEach(t=>{const{item:i}=this._dataProviderController.getFlatIndexContext(t.index);(i||e)&&this._getItem(t.index,t)}),this.__scrollToPendingIndexes(),this.__dispatchPendingBodyCellFocus()}),this._dataProviderController.isLoading()||this._debouncerApplyCachedData.flush()}__debounceClearCache(){this.__clearCacheDebouncer=E.debounce(this.__clearCacheDebouncer,B,()=>this.clearCache())}clearCache(){this._dataProviderController.clearCache(),this._dataProviderController.rootCache.size=this.size,this._dataProviderController.recalculateFlatSize(),this._hasData=!1,this.__updateVisibleRows(),(!this.__virtualizer||!this.__virtualizer.size)&&this._dataProviderController.loadFirstPage()}_pageSizeChanged(e,t){this._dataProviderController.setPageSize(e),t!==void 0&&e!==t&&this.clearCache()}_checkSize(){this.size===void 0&&this._flatSize===0&&console.warn("The <vaadin-grid> needs the total number of items in order to display rows, which you can specify either by setting the `size` property, or by providing it to the second argument of the `dataProvider` function `callback` call.")}_dataProviderChanged(e,t){this._dataProviderController.setDataProvider(e?e.bind(this):null),t!==void 0&&this.clearCache(),this._ensureFirstPageLoaded(),this._debouncerCheckSize=E.debounce(this._debouncerCheckSize,$.after(2e3),this._checkSize.bind(this))}_ensureFirstPageLoaded(){this._hasData||this._dataProviderController.loadFirstPage()}_itemsEqual(e,t){return this.getItemId(e)===this.getItemId(t)}_getItemIndexInArray(e,t){let i=-1;return t.forEach((o,n)=>{this._itemsEqual(o,e)&&(i=n)}),i}scrollToIndex(...e){let t;for(;t!==(t=this._dataProviderController.getFlatIndexByPath(e));)this._scrollToFlatIndex(t);(this._dataProviderController.isLoading()||!this.clientHeight)&&(this.__pendingScrollToIndexes=e)}__scrollToPendingIndexes(){if(this.__pendingScrollToIndexes&&this.$.items.children.length){const e=this.__pendingScrollToIndexes;delete this.__pendingScrollToIndexes,this.scrollToIndex(...e)}}};/** 880 * @license 881 * Copyright (c) 2016 - 2024 Vaadin Ltd. 882 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 883 */const ne={BETWEEN:"between",ON_TOP:"on-top",ON_TOP_OR_BETWEEN:"on-top-or-between",ON_GRID:"on-grid"},W={ON_TOP:"on-top",ABOVE:"above",BELOW:"below",EMPTY:"empty"},Ni=!("draggable"in document.createElement("div")),Vi=r=>class extends r{static get properties(){return{dropMode:{type:String,sync:!0},rowsDraggable:{type:Boolean,sync:!0},dragFilter:{type:Function,sync:!0},dropFilter:{type:Function,sync:!0},__dndAutoScrollThreshold:{value:50},__draggedItems:{value:()=>[]}}}static get observers(){return["_dragDropAccessChanged(rowsDraggable, dropMode, dragFilter, dropFilter, loading)"]}constructor(){super(),this.__onDocumentDragStart=this.__onDocumentDragStart.bind(this)}ready(){super.ready(),this.$.table.addEventListener("dragstart",this._onDragStart.bind(this)),this.$.table.addEventListener("dragend",this._onDragEnd.bind(this)),this.$.table.addEventListener("dragover",this._onDragOver.bind(this)),this.$.table.addEventListener("dragleave",this._onDragLeave.bind(this)),this.$.table.addEventListener("drop",this._onDrop.bind(this)),this.$.table.addEventListener("dragenter",e=>{this.dropMode&&(e.preventDefault(),e.stopPropagation())})}connectedCallback(){super.connectedCallback(),document.addEventListener("dragstart",this.__onDocumentDragStart,{capture:!0})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("dragstart",this.__onDocumentDragStart,{capture:!0})}_onDragStart(e){if(this.rowsDraggable){let t=e.target;if(t.localName==="vaadin-grid-cell-content"&&(t=t.assignedSlot.parentNode.parentNode),t.parentNode!==this.$.items)return;if(e.stopPropagation(),this.toggleAttribute("dragging-rows",!0),this._safari){const a=t.style.transform;t.style.top=/translateY\((.*)\)/u.exec(a)[1],t.style.transform="none",requestAnimationFrame(()=>{t.style.top="",t.style.transform=a})}const i=t.getBoundingClientRect();Ni?e.dataTransfer.setDragImage(t):e.dataTransfer.setDragImage(t,e.clientX-i.left,e.clientY-i.top);let o=[t];this._isSelected(t._item)&&(o=this.__getViewportRows().filter(a=>this._isSelected(a._item)).filter(a=>!this.dragFilter||this.dragFilter(this.__getRowModel(a)))),this.__draggedItems=o.map(a=>a._item),e.dataTransfer.setData("text",this.__formatDefaultTransferData(o)),ee(t,{dragstart:o.length>1?`${o.length}`:""}),this.style.setProperty("--_grid-drag-start-x",`${e.clientX-i.left+20}px`),this.style.setProperty("--_grid-drag-start-y",`${e.clientY-i.top+10}px`),requestAnimationFrame(()=>{ee(t,{dragstart:!1}),this.style.setProperty("--_grid-drag-start-x",""),this.style.setProperty("--_grid-drag-start-y",""),this.requestContentUpdate()});const n=new CustomEvent("grid-dragstart",{detail:{draggedItems:[...this.__draggedItems],setDragData:(a,c)=>e.dataTransfer.setData(a,c),setDraggedItemsCount:a=>t.setAttribute("dragstart",a)}});n.originalEvent=e,this.dispatchEvent(n)}}_onDragEnd(e){this.toggleAttribute("dragging-rows",!1),e.stopPropagation();const t=new CustomEvent("grid-dragend");t.originalEvent=e,this.dispatchEvent(t),this.__draggedItems=[],this.requestContentUpdate()}_onDragLeave(e){e.stopPropagation(),this._clearDragStyles()}_onDragOver(e){if(this.dropMode){if(this._dropLocation=void 0,this._dragOverItem=void 0,this.__dndAutoScroll(e.clientY)){this._clearDragStyles();return}let t=e.composedPath().find(i=>i.localName==="tr");if(!this._flatSize||this.dropMode===ne.ON_GRID)this._dropLocation=W.EMPTY;else if(!t||t.parentNode!==this.$.items){if(t)return;if(this.dropMode===ne.BETWEEN||this.dropMode===ne.ON_TOP_OR_BETWEEN)t=Array.from(this.$.items.children).filter(i=>!i.hidden).pop(),this._dropLocation=W.BELOW;else return}else{const i=t.getBoundingClientRect();if(this._dropLocation=W.ON_TOP,this.dropMode===ne.BETWEEN){const o=e.clientY-i.top<i.bottom-e.clientY;this._dropLocation=o?W.ABOVE:W.BELOW}else this.dropMode===ne.ON_TOP_OR_BETWEEN&&(e.clientY-i.top<i.height/3?this._dropLocation=W.ABOVE:e.clientY-i.top>i.height/3*2&&(this._dropLocation=W.BELOW))}if(t&&t.hasAttribute("drop-disabled")){this._dropLocation=void 0;return}e.stopPropagation(),e.preventDefault(),this._dropLocation===W.EMPTY?this.toggleAttribute("dragover",!0):t?(this._dragOverItem=t._item,t.getAttribute("dragover")!==this._dropLocation&&He(t,{dragover:this._dropLocation})):this._clearDragStyles()}}__onDocumentDragStart(e){e.target.contains(this)&&this.$.table.scrollHeight>2e4&&(this.$.scroller.style.display="none",requestAnimationFrame(()=>{this.$.scroller.style.display=""}))}__dndAutoScroll(e){if(this.__dndAutoScrolling)return!0;const t=this.$.header.getBoundingClientRect().bottom,i=this.$.footer.getBoundingClientRect().top,o=t-e+this.__dndAutoScrollThreshold,n=e-i+this.__dndAutoScrollThreshold;let a=0;if(n>0?a=n*2:o>0&&(a=-o*2),a){const c=this.$.table.scrollTop;if(this.$.table.scrollTop+=a,c!==this.$.table.scrollTop)return this.__dndAutoScrolling=!0,setTimeout(()=>{this.__dndAutoScrolling=!1},20),!0}}__getViewportRows(){const e=this.$.header.getBoundingClientRect().bottom,t=this.$.footer.getBoundingClientRect().top;return Array.from(this.$.items.children).filter(i=>{const o=i.getBoundingClientRect();return o.bottom>e&&o.top<t})}_clearDragStyles(){this.removeAttribute("dragover"),k(this.$.items,e=>{He(e,{dragover:null})})}__updateDragSourceParts(e,t){ee(e,{"drag-source":this.__draggedItems.includes(t.item)})}_onDrop(e){if(this.dropMode){e.stopPropagation(),e.preventDefault();const t=e.dataTransfer.types&&Array.from(e.dataTransfer.types).map(o=>({type:o,data:e.dataTransfer.getData(o)}));this._clearDragStyles();const i=new CustomEvent("grid-drop",{bubbles:e.bubbles,cancelable:e.cancelable,detail
883:{dropTargetItem:this._dragOverItem,dropLocation:this._dropLocation,dragData:t}});i.originalEvent=e,this.dispatchEvent(i)}}__formatDefaultTransferData(e){return e.map(t=>Array.from(t.children).filter(i=>!i.hidden&&i.getAttribute("part").indexOf("details-cell")===-1).sort((i,o)=>i._column._order>o._column._order?1:-1).map(i=>i._content.textContent.trim()).filter(i=>i).join(" ")).join(` 884`)}_dragDropAccessChanged(){this.filterDragAndDrop()}filterDragAndDrop(){k(this.$.items,e=>{e.hidden||this._filterDragAndDrop(e,this.__getRowModel(e))})}_filterDragAndDrop(e,t){const i=this.loading||e.hasAttribute("loading"),o=!this.rowsDraggable||i||this.dragFilter&&!this.dragFilter(t),n=!this.dropMode||i||this.dropFilter&&!this.dropFilter(t);se(e,a=>{o?a._content.removeAttribute("draggable"):a._content.setAttribute("draggable",!0)}),ee(e,{"drag-disabled":!!o,"drop-disabled":!!n})}};/** 885 * @license 886 * Copyright (c) 2016 - 2024 Vaadin Ltd. 887 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 888 */function _t(r,s){if(!r||!s||r.length!==s.length)return!1;for(let e=0,t=r.length;e<t;e++)if(r[e]instanceof Array&&s[e]instanceof Array){if(!_t(r[e],s[e]))return!1}else if(r[e]!==s[e])return!1;return!0}const Gi=r=>class extends r{static get properties(){return{_columnTree:Object}}ready(){super.ready(),this._addNodeObserver()}_hasColumnGroups(e){return e.some(t=>t.localName==="vaadin-grid-column-group")}_getChildColumns(e){return U.getColumns(e)}_flattenColumnGroups(e){return e.map(t=>t.localName==="vaadin-grid-column-group"?this._getChildColumns(t):[t]).reduce((t,i)=>t.concat(i),[])}_getColumnTree(){const e=U.getColumns(this),t=[e];let i=e;for(;this._hasColumnGroups(i);)i=this._flattenColumnGroups(i),t.push(i);return t}_debounceUpdateColumnTree(){this.__updateColumnTreeDebouncer=E.debounce(this.__updateColumnTreeDebouncer,B,()=>this._updateColumnTree())}_updateColumnTree(){const e=this._getColumnTree();_t(e,this._columnTree)||(e.forEach(t=>{t.forEach(i=>{i.performUpdate&&i.performUpdate()})}),this._columnTree=e)}_addNodeObserver(){this._observer=new U(this,(e,t)=>{const i=t.flatMap(n=>n._allCells),o=n=>i.filter(a=>a&&a._content.contains(n)).length;this.__removeSorters(this._sorters.filter(o)),this.__removeFilters(this._filters.filter(o)),this._debounceUpdateColumnTree(),this._debouncerCheckImports=E.debounce(this._debouncerCheckImports,$.after(2e3),this._checkImports.bind(this)),this._ensureFirstPageLoaded()})}_checkImports(){["vaadin-grid-column-group","vaadin-grid-filter","vaadin-grid-filter-column","vaadin-grid-tree-toggle","vaadin-grid-selection-column","vaadin-grid-sort-column","vaadin-grid-sorter"].forEach(e=>{this.querySelector(e)&&!customElements.get(e)&&console.warn(`Make sure you have imported the required module for <${e}> element.`)})}_updateFirstAndLastColumn(){Array.from(this.shadowRoot.querySelectorAll("tr")).forEach(e=>this._updateFirstAndLastColumnForRow(e))}_updateFirstAndLastColumnForRow(e){Array.from(e.querySelectorAll('[part~="cell"]:not([part~="details-cell"])')).sort((t,i)=>t._column._order-i._column._order).forEach((t,i,o)=>{Y(t,"first-column",i===0),Y(t,"last-column",i===o.length-1)})}_isColumnElement(e){return e.nodeType===Node.ELEMENT_NODE&&/\bcolumn\b/u.test(e.localName)}};/** 889 * @license 890 * Copyright (c) 2016 - 2024 Vaadin Ltd. 891 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 892 */const Wi=r=>class extends r{getEventContext(e){const t={},{cell:i}=this._getGridEventLocation(e);return i&&(t.section=["body","header","footer","details"].find(o=>i.getAttribute("part").indexOf(o)>-1),i._column&&(t.column=i._column),(t.section==="body"||t.section==="details")&&Object.assign(t,this.__getRowModel(i.parentElement))),t}};/** 893 * @license 894 * Copyright (c) 2016 - 2024 Vaadin Ltd. 895 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 896 */const qi=r=>class extends r{static get properties(){return{_filters:{type:Array,value:()=>[]}}}constructor(){super(),this._filterChanged=this._filterChanged.bind(this),this.addEventListener("filter-changed",this._filterChanged)}_filterChanged(e){e.stopPropagation(),this.__addFilter(e.target),this.__applyFilters()}__removeFilters(e){e.length!==0&&(this._filters=this._filters.filter(t=>e.indexOf(t)<0),this.__applyFilters())}__addFilter(e){this._filters.indexOf(e)===-1&&this._filters.push(e)}__applyFilters(){this.dataProvider&&this.isAttached&&this.clearCache()}_mapFilters(){return this._filters.map(e=>({path:e.path,value:e.value}))}};/** 897 * @license 898 * Copyright (c) 2016 - 2024 Vaadin Ltd. 899 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 900 */function fe(r){return r instanceof HTMLTableRowElement}function pe(r){return r instanceof HTMLTableCellElement}function j(r){return r.matches('[part~="details-cell"]')}const Ui=r=>class extends r{static get properties(){return{_headerFocusable:{type:Object,observer:"_focusableChanged",sync:!0},_itemsFocusable:{type:Object,observer:"_focusableChanged",sync:!0},_footerFocusable:{type:Object,observer:"_focusableChanged",sync:!0},_navigatingIsHidden:Boolean,_focusedItemIndex:{type:Number,value:0},_focusedColumnOrder:Number,_focusedCell:{type:Object,observer:"_focusedCellChanged",sync:!0},interacting:{type:Boolean,value:!1,reflectToAttribute:!0,readOnly:!0,observer:"_interactingChanged"}}}get __rowFocusMode(){return[this._headerFocusable,this._itemsFocusable,this._footerFocusable].some(fe)}set __rowFocusMode(e){["_itemsFocusable","_footerFocusable","_headerFocusable"].forEach(t=>{const i=this[t];if(e){const o=i&&i.parentElement;pe(i)?this[t]=o:pe(o)&&(this[t]=o.parentElement)}else if(!e&&fe(i)){const o=i.firstElementChild;this[t]=o._focusButton||o}})}get _visibleItemsCount(){return this._lastVisibleIndex-this._firstVisibleIndex-1}ready(){super.ready(),!(this._ios||this._android)&&(this.addEventListener("keydown",this._onKeyDown),this.addEventListener("keyup",this._onKeyUp),this.addEventListener("focusin",this._onFocusIn),this.addEventListener("focusout",this._onFocusOut),this.$.table.addEventListener("focusin",this._onContentFocusIn.bind(this)),this.addEventListener("mousedown",()=>{this.toggleAttribute("navigating",!1),this._isMousedown=!0,this._focusedColumnOrder=void 0}),this.addEventListener("mouseup",()=>{this._isMousedown=!1}))}_focusableChanged(e,t){t&&t.setAttribute("tabindex","-1"),e&&this._updateGridSectionFocusTarget(e)}
900_focusedCellChanged(e,t){t&&je(t,"part","focused-cell"),e&&Ke(e,"part","focused-cell")}_interactingChanged(){this._updateGridSectionFocusTarget(this._headerFocusable),this._updateGridSectionFocusTarget(this._itemsFocusable),this._updateGridSectionFocusTarget(this._footerFocusable)}__updateItemsFocusable(){if(!this._itemsFocusable)return;const e=this.shadowRoot.activeElement===this._itemsFocusable;this._getRenderedRows().forEach(t=>{if(t.index===this._focusedItemIndex)if(this.__rowFocusMode)this._itemsFocusable=t;else{let i=this._itemsFocusable.parentElement,o=this._itemsFocusable;if(i){pe(i)&&(o=i,i=i.parentElement);const n=[...i.children].indexOf(o);this._itemsFocusable=this.__getFocusable(t,t.children[n])}}}),e&&this._itemsFocusable.focus()}_onKeyDown(e){const t=e.key;let i;switch(t){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"PageUp":case"PageDown":case"Home":case"End":i="Navigation";break;case"Enter":case"Escape":case"F2":i="Interaction";break;case"Tab":i="Tab";break;case" ":i="Space";break}this._detectInteracting(e),this.interacting&&i!=="Interaction"&&(i=void 0),i&&this[`_on${i}KeyDown`](e,t)}__ensureFlatIndexInViewport(e){[...this.$.items.children].find(i=>i.index===e)?this.__scrollIntoViewport(e):this._scrollToFlatIndex(e)}__isRowExpandable(e){if(this.itemHasChildrenPath){const t=e._item;return!!(t&&Oe(this.itemHasChildrenPath,t)&&!this._isExpanded(t))}}__isRowCollapsible(e){return this._isExpanded(e._item)}_onNavigationKeyDown(e,t){e.preventDefault();const i=this.__isRTL,o=e.composedPath().find(fe),n=e.composedPath().find(pe);let a=0,c=0;switch(t){case"ArrowRight":a=i?-1:1;break;case"ArrowLeft":a=i?1:-1;break;case"Home":this.__rowFocusMode||e.ctrlKey?c=-1/0:a=-1/0;break;case"End":this.__rowFocusMode||e.ctrlKey?c=1/0:a=1/0;break;case"ArrowDown":c=1;break;case"ArrowUp":c=-1;break;case"PageDown":if(this.$.items.contains(o)){const g=this.__getIndexInGroup(o,this._focusedItemIndex);this._scrollToFlatIndex(g)}c=this._visibleItemsCount;break;case"PageUp":c=-this._visibleItemsCount;break}if(this.__rowFocusMode&&!o||!this.__rowFocusMode&&!n)return;const p=i?"ArrowLeft":"ArrowRight",_=i?"ArrowRight":"ArrowLeft";if(t===p){if(this.__rowFocusMode){if(this.__isRowExpandable(o)){this.expandItem(o._item);return}this.__rowFocusMode=!1,this._onCellNavigation(o.firstElementChild,0,0);return}}else if(t===_)if(this.__rowFocusMode){if(this.__isRowCollapsible(o)){this.collapseItem(o._item);return}}else{const g=[...o.children].sort((f,y)=>f._order-y._order);if(n===g[0]||j(n)){this.__rowFocusMode=!0,this._onRowNavigation(o,0);return}}this.__rowFocusMode?this._onRowNavigation(o,c):this._onCellNavigation(n,a,c)}_onRowNavigation(e,t){const{dstRow:i}=this.__navigateRows(t,e);i&&i.focus()}__getIndexInGroup(e,t){const i=e.parentNode;return i===this.$.items?t!==void 0?t:e.index:[...i.children].indexOf(e)}__navigateRows(e,t,i){const o=this.__getIndexInGroup(t,this._focusedItemIndex),n=t.parentNode,a=(n===this.$.items?this._flatSize:n.children.length)-1;let c=Math.max(0,Math.min(o+e,a));if(n!==this.$.items){if(c>o)for(;c<a&&n.children[c].hidden;)c+=1;else if(c<o)for(;c>0&&n.children[c].hidden;)c-=1;return this.toggleAttribute("navigating",!0),{dstRow:n.children[c]}}let p=!1;if(i){const _=j(i);if(n===this.$.items){const g=t._item,{item:f}=this._dataProviderController.getFlatIndexContext(c);_?p=e===0:p=e===1&&this._isDetailsOpened(g)||e===-1&&c!==o&&this._isDetailsOpened(f),p!==_&&(e===1&&p||e===-1&&!p)&&(c=o)}}return this.__ensureFlatIndexInViewport(c),this._focusedItemIndex=c,this.toggleAttribute("navigating",!0),{dstRow:[...n.children].find(_=>
900!_.hidden&&_.index===c),dstIsRowDetails:p}}_onCellNavigation(e,t,i){const o=e.parentNode,{dstRow:n,dstIsRowDetails:a}=this.__navigateRows(i,o,e);if(!n)return;let c=[...o.children].indexOf(e);this.$.items.contains(e)&&(c=[...this.$.sizer.children].findIndex(f=>f._column===e._column));const p=j(e),_=o.parentNode,g=this.__getIndexInGroup(o,this._focusedItemIndex);if(this._focusedColumnOrder===void 0&&(p?this._focusedColumnOrder=0:this._focusedColumnOrder=this._getColumns(_,g).filter(f=>!f.hidden)[c]._order),a)[...n.children].find(j).focus();else{const f=this.__getIndexInGroup(n,this._focusedItemIndex),y=this._getColumns(_,f).filter(z=>!z.hidden),w=y.map(z=>z._order).sort((z,D)=>z-D),S=w.length-1,A=w.indexOf(w.slice(0).sort((z,D)=>Math.abs(z-this._focusedColumnOrder)-Math.abs(D-this._focusedColumnOrder))[0]),R=i===0&&p?A:Math.max(0,Math.min(A+t,S));R!==A&&(this._focusedColumnOrder=void 0);const Z=y.reduce((z,D,ce)=>(z[D._order]=ce,z),{})[w[R]];let G;if(this.$.items.contains(e)){const z=this.$.sizer.children[Z];this._lazyColumns&&(this.__isColumnInViewport(z._column)||z.scrollIntoView(),this.__updateColumnsBodyContentHidden(),this.__updateHorizontalScrollPosition()),G=[...n.children].find(D=>D._column===z._column),this._scrollHorizontallyToCell(G)}else G=n.children[Z],this._scrollHorizontallyToCell(G);G.focus()}}_onInteractionKeyDown(e,t){const i=e.composedPath()[0],o=i.localName==="input"&&!/^(button|checkbox|color|file|image|radio|range|reset|submit)$/iu.test(i.type);let n;switch(t){case"Enter":n=this.interacting?!o:!0;break;case"Escape":n=!1;break;case"F2":n=!this.interacting;break}const{cell:a}=this._getGridEventLocation(e);if(this.interacting!==n&&a!==null)if(n){const c=a._content.querySelector("[focus-target]")||[...a._content.querySelectorAll("*")].find(p=>this._isFocusable(p));c&&(e.preventDefault(),c.focus(),this._setInteracting(!0),this.toggleAttribute("navigating",!1))}else e.preventDefault(),this._focusedColumnOrder=void 0,a.focus(),this._setInteracting(!1),this.toggleAttribute("navigating",!0);t==="Escape"&&this._hideTooltip(!0)}_predictFocusStepTarget(e,t){const i=[this.$.table,this._headerFocusable,this.__emptyState?this.$.emptystatecell:this._itemsFocusable,this._footerFocusable,this.$.focusexit];let o=i.indexOf(e);for(o+=t;o>=0&&o<=i.length-1;){let a=i[o];if(a&&!this.__rowFocusMode&&(a=i[o].parentNode),!a||a.hidden)o+=t;else break}let n=i[o];if(n&&!this.__isHorizontallyInViewport(n)){const a=this._getColumnsInOrder().find(c=>this.__isColumnInViewport(c));if(a)if(n===this._headerFocusable)n=a._headerCell;else if(n===this._itemsFocusable){const c=n._column._cells.indexOf(n);n=a._cells[c]}else n===this._footerFocusable&&(n=a._footerCell)}return n}_onTabKeyDown(e){const t=this._predictFocusStepTarget(e.composedPath()[0],e.shiftKey?-1:1);t&&(e.stopPropagation(),t===this.$.table?this.$.table.focus():t===this.$.focu
900sexit?this.$.focusexit.focus():t===this._itemsFocusable?(this.__ensureFlatIndexInViewport(this._focusedItemIndex),this.__updateItemsFocusable(),e.preventDefault(),this._itemsFocusable.focus()):(e.preventDefault(),t.focus()),this.toggleAttribute("navigating",!0))}_onSpaceKeyDown(e){e.preventDefault();const t=e.composedPath()[0],i=fe(t);(i||!t._content||!t._content.firstElementChild)&&this.dispatchEvent(new CustomEvent(i?"row-activate":"cell-activate",{detail:{model:this.__getRowModel(i?t:t.parentElement)}}))}_onKeyUp(e){if(!/^( |SpaceBar)$/u.test(e.key)||this.interacting)return;e.preventDefault();const t=e.composedPath()[0];if(t._content&&t._content.firstElementChild){const i=this.hasAttribute("navigating");t._content.firstElementChild.dispatchEvent(new MouseEvent("click",{shiftKey:e.shiftKey,bubbles:!0,composed:!0,cancelable:!0})),this.toggleAttribute("navigating",i)}}_onFocusIn(e){this._isMousedown||this.toggleAttribute("navigating",!0);const t=e.composedPath()[0];t===this.$.table||t===this.$.focusexit?(this._isMousedown||this._predictFocusStepTarget(t,t===this.$.table?1:-1).focus(),this._setInteracting(!1)):this._detectInteracting(e)}_onFocusOut(e){this.toggleAttribute("navigating",!1),this._detectInteracting(e),this._hideTooltip(),this._focusedCell=null}_onContentFocusIn(e){const{section:t,cell:i,row:o}=this._getGridEventLocation(e);if(!(!i&&!this.__rowFocusMode)&&(this._detectInteracting(e),t&&(i||o)))if(this._activeRowGroup=t,t===this.$.header?this._headerFocusable=this.__getFocusable(o,i):t===this.$.items?(this._itemsFocusable=this.__getFocusable(o,i),this._focusedItemIndex=o.index):t===this.$.footer&&(this._footerFocusable=this.__getFocusable(o,i)),i){const n=this.getEventContext(e);this.__pendingBodyCellFocus=this.loading&&n.section==="body",!this.__pendingBodyCellFocus&&i!==this.$.emptystatecell&&i.dispatchEvent(new CustomEvent("cell-focus",{bubbles:!0,composed:!0,detail:{context:n}})),this._focusedCell=i._focusButton||i,Dt()&&e.target===i&&this._showTooltip(e)}else this._focusedCell=null}__dispatchPendingBodyCellFocus(){this.__pendingBodyCellFocus&&this.shadowRoot.activeElement===this._itemsFocusable&&this._itemsFocusable.dispatchEvent(new Event("focusin",{bubbles:!0,composed:!0}))}__getFocusable(e,t){return this.__rowFocusMode?e:t._focusButton||t}_detectInteracting(e){const t=e.composedPath().some(i=>i.localName==="slot"&&this.shadowRoot.contains(i));this._setInteracting(t),this.__updateHorizontalScrollPosition()}_updateGridSectionFocusTarget(e){if(!e)return;const t=this._getGridSectionFromFocusTarget(e),i=this.interacting&&t===this._activeRowGroup;e.tabIndex=i?-1:0}_preventScrollerRotatingCellFocus(){this._activeRowGroup===this.$.items&&(this.__preventScrollerRotatingCellFocusDebouncer=E.debounce(this.__preventScrollerRotatingCellFocusDebouncer,H,()=>{const e=this._activeRowGroup===this.$.items;this._getRenderedRows().some(i=>i.index===this._focusedItemIndex)?(this.__updateItemsFocusable(),e&&!this.__rowFocusMode&&(this._focusedCell=this._itemsFocusable),this._navigatingIsHidden&&(this.toggleAttribute("navigating",!0),this._navigatingIsHidden=!1)):e&&(this._focusedCell=null,this.hasAttribute("navigating")&&(this._navigatingIsHidden=!0,this.toggleAttribute("navigating",!1)))}))}_getColumns(e,t){let i=this._columnTree.length-1;return e===this.$.header?i=t:e===this.$.footer&&(i=this._columnTree.length-1-t),this._columnTree[i]}__isValidFocusable(e){return this.$.table.contains(e)&&e.offsetHeight}_resetKeyboardNavigation(){if(!this.$&&this.performUpdate&&this.performUpdate(),["header","footer"].forEach(e=>{if(!this.__isValidFocusable(this[`_${e}Focusable`])){const t=[...this.$[e].children].find(o=>o.offsetHeight),i=t?[...t.children].find(o=>!o.hidden):null;t&&i&&(this[`_${e}Focusable`]=this.__getFocusable(t,i))}}),!this.__isValidFocusable(this._itemsFocusable)&&this.$.items.firstElementChild){const e=this.__getFirstVisibleItem(),t=e?[...e.children].find(i=>!i.hidden):null;t&&e&&(this._focusedColumnOrder=void 0,this._itemsFocusable=this.__getFocusable(e,t))}else this.__updateItemsFocusable()}_scrollHorizontallyToCell(e){if(e.hasAttribute("frozen")||e.hasAttribute("frozen-to-end")||j(e))return;const t=e.getBoundingClientRect(),i=e.parentNode,o=Array.from(i.children).indexOf(e),n=this.$.table.getBoundingClientRect();let a=n.left,c=n.right;for(let p=o-1;p>=0;p--){const _=i.children[p];if(!(_.hasAttribute("hidden")||j(_))&&(_.hasAttribute("frozen")||_.hasAttribute("frozen-to-end"))){a=_.getBoundingClientRect().right;break}}for(let p=o+1;p<i.children.length;p++){const _=i.children[p];if(!(_.hasAttribute("hidden")||j(_))&&(_.hasAttribute("frozen")||_.hasAttribute("frozen-to-end"))){c=_.getBoundingClientRect().left;break}}t.left<a&&(this.$.table.scrollLeft+=Math.round(t.left-a)),t.right>c&&(this.$.table.scrollLeft+=Math.round(t.right-c))}_getGridEventLocation(e){const t=e.__composedPath||e.composedPath(),i=t.indexOf(this.$.table),o=i>
900=1?t[i-1]:null,n=i>=2?t[i-2]:null,a=i>=3?t[i-3]:null;return{section:o,row:n,cell:a}}_getGridSectionFromFocusTarget(e){return e===this._headerFocusable?this.$.header:e===this._itemsFocusable?this.$.items:e===this._footerFocusable?this.$.footer:null}};/** 901 * @license 902 * Copyright (c) 2016 - 2024 Vaadin Ltd. 903 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 904 */const Ki=r=>class extends r{static get properties(){return{detailsOpenedItems:{type:Array,value:()=>[],sync:!0},rowDetailsRenderer:{type:Function,sync:!0},_detailsCells:{type:Array}}}static get observers(){return["_detailsOpenedItemsChanged(detailsOpenedItems, rowDetailsRenderer)","_rowDetailsRendererChanged(rowDetailsRenderer)"]}ready(){super.ready(),this._detailsCellResizeObserver=new ResizeObserver(e=>{e.forEach(({target:t})=>{this._updateDetailsCellHeight(t.parentElement)}),this.__virtualizer.__adapter._resizeHandler()})}_rowDetailsRendererChanged(e){e&&this._columnTree&&k(this.$.items,t=>{if(!t.querySelector("[part~=details-cell]")){this._updateRow(t,this._columnTree[this._columnTree.length-1]);const i=this._isDetailsOpened(t._item);this._toggleDetailsCell(t,i)}})}_detailsOpenedItemsChanged(e,t){k(this.$.items,i=>{if(i.hasAttribute("details-opened")){this._updateItem(i,i._item);return}t&&this._isDetailsOpened(i._item)&&this._updateItem(i,i._item)})}_configureDetailsCell(e){e.setAttribute("part","cell details-cell"),e.toggleAttribute("frozen",!0),this._detailsCellResizeObserver.observe(e)}_toggleDetailsCell(e,t){const i=e.querySelector('[part~="details-cell"]');i&&(i.hidden=!t,!i.hidden&&this.rowDetailsRenderer&&(i._renderer=this.rowDetailsRenderer))}_updateDetailsCellHeight(e){const t=e.querySelector('[part~="details-cell"]');t&&(this.__updateDetailsRowPadding(e,t),requestAnimationFrame(()=>this.__updateDetailsRowPadding(e,t)))}__updateDetailsRowPadding(e,t){t.hidden?e.style.removeProperty("padding-bottom"):e.style.setProperty("padding-bottom",`${t.offsetHeight}px`)}_updateDetailsCellHeights(){k(this.$.items,e=>{this._updateDetailsCellHeight(e)})}_isDetailsOpened(e){return this.detailsOpenedItems&&this._getItemIndexInArray(e,this.detailsOpenedItems)!==-1}openItemDetails(e){this._isDetailsOpened(e)||(this.detailsOpenedItems=[...this.detailsOpenedItems,e])}closeItemDetails(e){this._isDetailsOpened(e)&&(this.detailsOpenedItems=this.detailsOpenedItems.filter(t=>!this._itemsEqual(t,e)))}};/** 905 * @license 906 * Copyright (c) 2016 - 2024 Vaadin Ltd. 907 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 908 */const qe={SCROLLING:500,UPDATE_CONTENT_VISIBILITY:100},ji=r=>class extends Mt(r){static get properties(){return{columnRendering:{type:String,value:"eager",sync:!0},_frozenCells:{type:Array,value:()=>[]},_frozenToEndCells:{type:Array,value:()=>[]},_rowWithFocusedElement:Element}}static get observers(){return["__columnRenderingChanged(_columnTree, columnRendering)"]}get _scrollLeft(){return this.$.table.scrollLeft}get _scrollTop(){return this.$.table.scrollTop}set _scrollTop(e){this.$.table.scrollTop=e}get _lazyColumns(){return this.columnRendering==="lazy"}ready(){super.ready(),this.scrollTarget=this.$.table,this.$.items.addEventListener("focusin",e=>{const t=e.composedPath().indexOf(this.$.items);this._rowWithFocusedElement=e.composedPath()[t-1],this._rowWithFocusedElement&&(this._isMousedown||this.__scrollIntoViewport(this._rowWithFocusedElement.index),this.$.table.contains(e.relatedTarget)||this.$.table.dispatchEvent(new CustomEvent("virtualizer-element-focused",{detail:{element:this._rowWithFocusedElement}})))}),this.$.items.addEventListener("focusout",()=>{this._rowWithFocusedElement=void 0}),this.$.table.addEventListener("scroll",()=>this._afterScroll())}_onResize(){if(this._updateOverflow(),this.__updateHorizontalScrollPosition(),this._firefox){const e=!Q(this);e&&this.__previousVisible===!1&&(this._scrollTop=this.__memorizedScrollTop||0),this.__previousVisible=e}}_scrollToFlatIndex(e){e=Math.min(this._flatSize-1,Math.max(0,e)),this.__virtualizer.scrollToIndex(e),this.__scrollIntoViewport(e)}__scrollIntoViewport(e){const t=[...this.$.items.children].find(i=>i.index===e);if(t){const i=t.getBoundingClientRect(),o=this.$.footer.getBoundingClientRect().top,n=this.$.header.getBoundingClientRect().bottom;i.bottom>o?this.$.table.scrollTop+=i.bottom-o:i.top<n&&(this.$.table.scrollTop-=n-i.top)}}_scheduleScrolling(){this._scrollingFrame||(this._scrollingFrame=requestAnimationFrame(()=>this.$.scroller.toggleAttribute("scrolling",!0))),this._debounceScrolling=E.debounce(this._debounceScrolling,$.after(qe.SCROLLING),()=>{cancelAnimationFrame(this._scrollingFrame),delete this._scrollingFrame,this.$.scroller.toggleAttribute("scrolling",!1)})}_afterScroll(){this.__updateHorizontalScrollPosition(),this.hasAttribute("reordering")||this._scheduleScrolling(),this.hasAttribute("navigating")||this._hideTooltip(!0),this._updateOverflow(),this._debounceColumnContentVisibility=E.debounce(this._debounceColumnContentVisibility,$.after(qe.UPDATE_CONTENT_VISIBILITY),()=>{this._lazyColumns&&this.__cachedScrollLeft!==this._scrollLeft&&(this.__cachedScrollLeft=this._scrollLeft,this.__updateColumnsBodyContentHidden())}),this._firefox&&!Q(this)&&this.__previousVisible!==!1&&(this.__memorizedScrollTop=this._scrollTop)}__updateColumnsBodyContentHidden(){if(!this._columnTree||!this._areSizerCellsAssigned())return;const e=this._getColumnsInOrder();let t=!1;if(e.forEach(i=>
908{const o=this._lazyColumns&&!this.__isColumnInViewport(i);i._bodyContentHidden!==o&&(t=!0,i._cells.forEach(n=>{if(n!==i._sizerCell){if(o)n.remove();else if(n.__parentRow){const a=[...n.__parentRow.children].find(c=>e.indexOf(c._column)>e.indexOf(i));n.__parentRow.insertBefore(n,a)}}})),i._bodyContentHidden=o}),t&&this._frozenCellsChanged(),this._lazyColumns){const i=[...e].reverse().find(a=>a.frozen),o=this.__getColumnEnd(i),n=e.find(a=>!a.frozen&&!a._bodyContentHidden);this.__lazyColumnsStart=this.__getColumnStart(n)-o,this.$.items.style.setProperty("--_grid-lazy-columns-start",`${this.__lazyColumnsStart}px`),this._resetKeyboardNavigation()}}__getColumnEnd(e){return e?e._sizerCell.offsetLeft+(this.__isRTL?0:e._sizerCell.offsetWidth):this.__isRTL?this.$.table.clientWidth:0}__getColumnStart(e){return e?e._sizerCell.offsetLeft+(this.__isRTL?e._sizerCell.offsetWidth:0):this.__isRTL?this.$.table.clientWidth:0}__isColumnInViewport(e){return e.frozen||e.frozenToEnd?!0:this.__isHorizontallyInViewport(e._sizerCell)}__isHorizontallyInViewport(e){return e.offsetLeft+e.offsetWidth>=this._scrollLeft&&e.offsetLeft<=this._scrollLeft+this.clientWidth}__columnRenderingChanged(e,t){t==="eager"?this.$.scroller.removeAttribute("column-rendering"):this.$.scroller.setAttribute("column-rendering",t),this.__updateColumnsBodyContentHidden()}_updateOverflow(){this._debounceOverflow=E.debounce(this._debounceOverflow,H,()=>{this.__doUpdateOverflow()})}__doUpdateOverflow(){let e="";const t=this.$.table;t.scrollTop<t.scrollHeight-t.clientHeight&&(e+=" bottom"),t.scrollTop>0&&(e+=" top");const i=Se(t,this.getAttribute("dir"));i>0&&(e+=" start"),i<t.scrollWidth-t.clientWidth&&(e+=" end"),this.__isRTL&&(e=e.replace(/start|end/giu,n=>n==="start"?"end":"start")),t.scrollLeft<t.scrollWidth-t.clientWidth&&(e+=" right"),t.scrollLeft>0&&(e+=" left");const o=e.trim();o.length>0&&this.getAttribute("overflow")!==o?this.setAttribute("overflow",o):o.length===0&&this.hasAttribute("overflow")&&this.removeAttribute("overflow")}_frozenCellsChanged(){this._debouncerCacheElements=E.debounce(this._debouncerCacheElements,B,()=>{Array.from(this.shadowRoot.querySelectorAll('[part~="cell"]')).forEach(e=>{e.style.transform=""}),this._frozenCells=Array.prototype.slice.call(this.$.table.querySelectorAll("[frozen]")),this._frozenToEndCells=Array.prototype.slice.call(this.$.table.querySelectorAll("[frozen-to-end]")),this.__updateHorizontalScrollPosition()}),this._debounceUpdateFrozenColumn()}_debounceUpdateFrozenColumn(){this.__debounceUpdateFrozenColumn=E.debounce(this.__debounceUpdateFrozenColumn,B,()=>this._updateFrozenColumn())}_updateFrozenColumn(){if(!this._columnTree)return;const e=this._columnTree[this._columnTree.length-1].slice(0);e.sort((o,n)=>o._order-n._order);let t,i;for(let o=0;o<e.length;o++){const n=e[o];n._lastFrozen=!1,n._firstFrozenToEnd=!1,i===void 0&&n.frozenToEnd&&!n.hidden&&(i=o),n.frozen&&!n.hidden&&(t=o)}t!==void 0&&(e[t]._lastFrozen=!0),i!==void 0&&(e[i]._firstFrozenToEnd=!0),this.__updateColumnsBodyContentHidden()}__updateHorizontalScrollPosition(){if(!this._columnTree)return;const e=this.$.table.scrollWidth,t=this.$.table.clientWidth,i=Math.max(0,this.$.table.scrollLeft),o=Se(this.$.table,this.getAttribute("dir")),n=`translate(${-i}px, 0)`;this.$.header.style.transform=n,this.$.footer.style.transform=n,this.$.items.style.transform=n;const a=this.__isRTL?o+t-e:i,c=`translate(${a}px, 0)`;this._frozenCells.forEach(f=>{f.style.transform=c});const p=this.__isRTL?o:i+t-e,_=`translate(${p}px, 0)`;let g=_;if(this._lazyColumns&&this._areSizerCellsAssigned()){const f=this._getColumnsInOrder(),y=[...f].reverse().find(L=>!L.frozenToEnd&&!L._bodyContentHidden),w=this.__getColumnEnd(y),S=f.find(L=>L.frozenToEnd),A=this.__getColumnStart(S);g=`translate(${p+(A-w)+this.__lazyColumnsStart}px, 0)`}this._frozenToEndCells.forEach(f=>{this.$.items.contains(f)?f.style.transform=g:f.style.transform=_}),this.hasAttribute("navigating")&&this.__rowFocusMode&&this.$.table.style.setProperty("--_grid-horizontal-scroll-position",`${-a}px`)}_areSizerCellsAssigned(){return this._getColumnsInOrder().every(e=>e._sizerCell)}};/** 909 * @license 910 * Copyright (c) 2016 - 2024 Vaadin Ltd. 911 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 912 */const Yi=r=>class extends r{static get properties(){return{selectedItems:{type:Object,notify:!0,value:()=>[],sync:!0},__selectedKeys:{type:Object,computed:"__computeSelectedKeys(itemIdPath, selectedItems)"}}}static get observers(){return["__selectedItemsChanged(itemIdPath, selectedItems)"]}_isSelected(e){return this.__selectedKeys.has(this.getItemId(e))}selectItem(e){this._isSelected(e)||(this.selectedItems=[...this.selectedItems,e])}deselectItem(e){this._isSelected(e)&&(this.selectedItems=this.selectedItems.filter(t=>!this._itemsEqual(t,e)))}_toggleItem(e){this._isSelected(e)?this.deselectItem(e):this.selectItem(e)}__selectedItemsChanged(){this.requestContentUpdate()}__computeSelectedKeys(e,t){const i=t||[],o=new Set;
912return i.forEach(n=>{o.add(this.getItemId(n))}),o}};/** 913 * @license 914 * Copyright (c) 2016 - 2024 Vaadin Ltd. 915 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 916 */let Ue="prepend";const Qi=r=>class extends r{static get properties(){return{multiSort:{type:Boolean,value:!1},multiSortPriority:{type:String,value:()=>Ue},multiSortOnShiftClick:{type:Boolean,value:!1},_sorters:{type:Array,value:()=>[]},_previousSorters:{type:Array,value:()=>[]}}}static setDefaultMultiSortPriority(e){Ue=["append","prepend"].includes(e)?e:"prepend"}ready(){super.ready(),this.addEventListener("sorter-changed",this._onSorterChanged)}_onSorterChanged(e){const t=e.target;e.stopPropagation(),t._grid=this,this.__updateSorter(t,e.detail.shiftClick,e.detail.fromSorterClick),this.__applySorters()}__removeSorters(e){e.length!==0&&(this._sorters=this._sorters.filter(t=>!e.includes(t)),this.__applySorters())}__updateSortOrders(){this._sorters.forEach(t=>{t._order=null});const e=this._getActiveSorters();e.length>1&&e.forEach((t,i)=>{t._order=i})}__updateSorter(e,t,i){if(!e.direction&&!this._sorters.includes(e))return;e._order=null;const o=this._sorters.filter(n=>n!==e);this.multiSort&&(!this.multiSortOnShiftClick||!i)||this.multiSortOnShiftClick&&t?this.multiSortPriority==="append"?this._sorters=[...o,e]:this._sorters=[e,...o]:(e.direction||this.multiSortOnShiftClick)&&(this._sorters=e.direction?[e]:[],o.forEach(n=>{n._order=null,n.direction=null}))}__applySorters(){this.__updateSortOrders(),this.dataProvider&&this.isAttached&&JSON.stringify(this._previousSorters)!==JSON.stringify(this._mapSorters())&&this.__debounceClearCache(),this._a11yUpdateSorters(),this._previousSorters=this._mapSorters()}_getActiveSorters(){return this._sorters.filter(e=>e.direction&&e.isConnected)}_mapSorters(){return this._getActiveSorters().map(e=>({path:e.path,direction:e.direction}))}};/** 917 * @license 918 * Copyright (c) 2016 - 2024 Vaadin Ltd. 919 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 920 */const Xi=r=>class extends r{static get properties(){return{cellClassNameGenerator:{type:Function,sync:!0},cellPartNameGenerator:{type:Function,sync:!0}}}static get observers(){return["__cellClassNameGeneratorChanged(cellClassNameGenerator)","__cellPartNameGeneratorChanged(cellPartNameGenerator)"]}__cellClassNameGeneratorChanged(){this.generateCellClassNames()}__cellPartNameGeneratorChanged(){this.generateCellPartNames()}generateCellClassNames(){k(this.$.items,e=>{e.hidden||this._generateCellClassNames(e,this.__getRowModel(e))})}generateCellPartNames(){k(this.$.items,e=>{e.hidden||this._generateCellPartNames(e,this.__getRowModel(e))})}_generateCellClassNames(e,t){se(e,i=>{if(i.__generatedClasses&&i.__generatedClasses.forEach(o=>i.classList.remove(o)),this.cellClassNameGenerator&&!e.hasAttribute("loading")){const o=this.cellClassNameGenerator(i._column,t);i.__generatedClasses=o&&o.split(" ").filter(n=>n.length>0),i.__generatedClasses&&i.__generatedClasses.forEach(n=>i.classList.add(n))}})}_generateCellPartNames(e,t){se(e,i=>{if(i.__generatedParts&&i.__generatedParts.forEach(o=>{K(i,null,o)}),this.cellPartNameGenerator&&!e.hasAttribute("loading")){const o=this.cellPartNameGenerator(i._column,t);i.__generatedParts=o&&o.split(" ").filter(n=>n.length>0),i.__generatedParts&&i.__generatedParts.forEach(n=>{K(i,!0,n)})}})}};/** 921 * @license 922 * Copyright (c) 2016 - 2024 Vaadin Ltd. 923 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 924 */const Zi=r=>class extends Mi(Hi(Gi(Oi(ji(Yi(Qi(Ki(Ui(ki(qi(Li($i(Wi(Vi(Xi(Lt(r))))))))))))))))){static get observers(){return["_columnTreeChanged(_columnTree)","_flatSizeChanged(_flatSize, __virtualizer, _hasData, _columnTree)"]}static get properties(){return{_safari:{type:Boolean,value:et},_ios:{type:Boolean,value:me},_firefox:{type:Boolean,value:$t},_android:{type:Boolean,value:Ie},_touchDevice:{type:Boolean,value:Te},allRowsVisible:{type:Boolean,value:!1,reflectToAttribute:!0},__pendingRecalculateColumnWidths:{type:Boolean,value:!0},isAttached:{value:!1},__gridElement:{type:Boolean,value:!0},__hasEmptyStateContent:{type:Boolean,value:!1},__emptyState:{type:Boolean,computed:"__computeEmptyState(_flatSize, __hasEmptyStateContent)"}}}constructor(){super(),this.addEventListener("animationend",this._onAnimationEnd)}get _firstVisibleIndex(){const s=this.__getFirstVisibleItem();return s?s.index:void 0}get _lastVisibleIndex(){const s=this.__getLastVisibleItem();return s?s.index:void 0}connectedCallback(){super.connectedCallback(),this.isAttached=!0,this.recalculateColumnWidths()}disconnectedCallback(){super.disconnectedCallback(),this.isAttached=!1,this._hideTooltip(!0)}__getFirstVisibleItem(){return this._getRenderedRows().find(s=>this._isInViewport(s))}__getLastVisibleItem(){return this._getRenderedRows().reverse().find(s=>this._isInViewport(s))}_isInViewport(s){const e=this.$.table.getBoundingClientRect(),t=s.getBoundingClientRect(),i=this.$.header.getBoundingClientRect().height,o=this.$.footer.getBoundingClientRect().height;return t.bottom>e.top+i&&t.top<e.bottom-o}_getRenderedRows(){return Array.from(this.$.items.children).filter(s=>!s.hidden).sort((s,e)=>s.index-e.index)}_getRowContainingNode(s){const e=Xe("vaadin-grid-cell-content",s);return e?e.assignedSlot.parentElement.parentElement:void 0}_isItemAssignedToRow(s,e){const t=this.__getRowModel(e);return this.getItemId(s)===this.getItemId(t.item)}ready(){super.ready(),this.__virtualizer=new Ti({createElements:this._createScrollerRows.bind(this),updateElement:this._updateScrollerItem.bind(this),scrollContainer:this.$.items,scrollTarget:this.$.table,reorderElements:!0}),new ResizeObserver(()=>setTimeout(()=>{this.__updateColumnsBodyContentHidden(),this.__tryToRecalculateColumnWidthsIfPending()})).observe(this.$.table),ze(this),this._tooltipController=new tt(this),this.addController(this._tooltipController),this._tooltipController.setManual(!0),this.__emptyStateContentObserver=new Qe(this.$.emptystateslot,({currentNodes:s})=>{this.$.emptystatecell._content=s[0],this.__hasEmptyStateContent=!!this.$.emptystatecell._content})}__getBodyCellCoordinates(s){if(this.$.items.contains(s)&&s.localName==="td")return{item:s.parentElement._item,column:s._column}}__focusBodyCell({item:s,column:e}){const t=this._getRenderedRows().find(o=>o._item===s),i=t&&[...t.children].find(o=>o._column===e);i&&i.focus()}_focusFirstVisibleRow(){const s=this.__getFirstVisibleItem();this.__rowFocusMode=!0,s.focus()}_flatSizeChanged(s,e,t,i){if(e&&t&&i){const o=this.shadowRoot.activeElement,n=this.__getBodyCellCoordinates(o),a=e.size||0;e.size=s,e.update(a-1,a-1),s<a&&e.update(s-1,s-1),n&&o.parentElement.hidden&&this.__focusBodyCell(n),this._resetKeyboardNavigation()}}__getIntrinsicWidth(s){return this.__intrinsicWidthCache.has(s)||this.__calculateAndCacheIntrinsicWidths([s]),this.__intrinsicWidthCache.get(s)}__getDistributedWidth(s,e){if(s==null||s===this)return 0;const t=Math.max(this.__getIntrinsicWidth(s),this.__getDistributedWidth((s.assignedSlot||s).parentElement,s));if(!e)return t;const i=s,o=t,n=i._visibleChildColumns.map(_=>this.__getIntrinsicWidth(_)).reduce((_,g)=>_+g,0),a=Math.max(0,o-n),p=this.__getIntrinsicWidth(e)/n*a;return this.__getIntrinsicWidth(e)+p}_recalculateColumnWidths(s){this.__virtualizer.flush(),[...this.$.header.children,...this.$.footer.children].forEac
924h(i=>{i.__debounceUpdateHeaderFooterRowVisibility&&i.__debounceUpdateHeaderFooterRowVisibility.flush()}),this._debouncerHiddenChanged&&this._debouncerHiddenChanged.flush(),this.__intrinsicWidthCache=new Map;const e=this._firstVisibleIndex,t=this._lastVisibleIndex;this.__viewportRowsCache=this._getRenderedRows().filter(i=>i.index>=e&&i.index<=t),this.__calculateAndCacheIntrinsicWidths(s),s.forEach(i=>{i.width=`${this.__getDistributedWidth(i)}px`})}__setVisibleCellContentAutoWidth(s,e){s._allCells.filter(t=>this.$.items.contains(t)?this.__viewportRowsCache.includes(t.parentElement):!0).forEach(t=>{t.__measuringAutoWidth=e,t.__measuringAutoWidth?(t.__originalWidth=t.style.width,t.style.width="auto",t.style.position="absolute"):(t.style.width=t.__originalWidth,delete t.__originalWidth,t.style.position="")}),e?this.$.scroller.setAttribute("measuring-auto-width",""):this.$.scroller.removeAttribute("measuring-auto-width")}__getAutoWidthCellsMaxWidth(s){return s._allCells.reduce((e,t)=>t.__measuringAutoWidth?Math.max(e,t.offsetWidth+1):e,0)}__calculateAndCacheIntrinsicWidths(s){s.forEach(e=>this.__setVisibleCellContentAutoWidth(e,!0)),s.forEach(e=>{const t=this.__getAutoWidthCellsMaxWidth(e);this.__intrinsicWidthCache.set(e,t)}),s.forEach(e=>this.__setVisibleCellContentAutoWidth(e,!1))}recalculateColumnWidths(){if(!this._columnTree)return;if(Q(this)||this._dataProviderController.isLoading()){this.__pendingRecalculateColumnWidths=!0;return}const s=this._getColumns().filter(t=>!t.hidden&&t.autoWidth),e=s.filter(t=>!customElements.get(t.localName));e.length?Promise.all(e.map(t=>customElements.whenDefined(t.localName))).then(()=>{this._recalculateColumnWidths(s)}):this._recalculateColumnWidths(s)}__tryToRecalculateColumnWidthsIfPending(){if(!this.__pendingRecalculateColumnWidths||Q(this)||this._dataProviderController.isLoading()||[...this.$.items.children].some(t=>t.index===void 0))return;[...this.$.items.children].some(t=>t.clientHeight>0)&&(this.__pendingRecalculateColumnWidths=!1,this.recalculateColumnWidths())}_onDataProviderPageLoaded(){super._onDataProviderPageLoaded(),this.__tryToRecalculateColumnWidthsIfPending()}_createScrollerRows(s){const e=[];for(let t=0;t<s;t++){const i=document.createElement("tr");i.setAttribute("part","row body-row"),i.setAttribute("role","row"),i.setAttribute("tabindex","-1"),this._columnTree&&this._updateRow(i,this._columnTree[this._columnTree.length-1],"body",!1,!0),e.push(i)}return this._columnTree&&this._columnTree[this._columnTree.length-1].forEach(t=>{t.isConnected&&t._cells&&(t._cells=[...t._cells])}),this.__afterCreateScrollerRowsDebouncer=E.debounce(this.__afterCreateScrollerRowsDebouncer,H,()=>{this._afterScroll(),this.__tryToRecalculateColumnWidthsIfPending()}),e}_createCell(s,e){const i=`vaadin-grid-cell-content-${this._contentIndex=this._contentIndex+1||0}`,o=document.createElement("vaadin-grid-cell-content");o.setAttribute("slot",i);const n=document.createElement(s);n.id=i.replace("-content-","-"),n.setAttribute("role",s==="td"?"gridcell":"columnheader"),!Ie&&!me&&(n.addEventListener("mouseenter",c=>{this.$.scroller.hasAttribute("scrolling")||this._showTooltip(c)}),n.addEventListener("mouseleave",()=>{this._hideTooltip()}),n.addEventListener("mousedown",()=>{this._hideTooltip(!0)}));const a=document.createElement("slot");if(a.setAttribute("name",i),e&&e._focusButtonMode){const c=document.createElement("div");c.setAttribute("role","button"),c.setAttribute("tabindex","-1"),n.appendChild(c),n._focusButton=c,n.focus=function(p){n._focusButton.focus(p)},c.appendChild(a)}else n.setAttribute("tabindex","-1"),n.appendChild(a);return n._content=o,o.addEventListener("mousedown",()=>{if(Bt){const c=p=>{const _=o.contains(this.getRootNode().activeElement),g=p.composedPath().includes(o);!_&&g&&n.focus({preventScroll:!0}),document.removeEventListener("mouseup",c,!0)};document.addEventListener("mouseup",c,!0)}else setTimeout(()=>{o.contains(this.getRootNode().activeElement)||n.focus({preventScroll:!0})})}),n}_updateRow(s,e,t="body",i=!1,o=!1){const n=document.createDocumentFragment();se(s,a=>{a._vacant=!0}),s.innerHTML="",t==="body"&&(s.__cells=[],s.__detailsCell=null),e.filter(a=>
924!a.hidden).forEach((a,c,p)=>{let _;if(t==="body"){a._cells||(a._cells=[]),_=a._cells.find(f=>f._vacant),_||(_=this._createCell("td",a),a._onCellKeyDown&&_.addEventListener("keydown",a._onCellKeyDown.bind(a)),a._cells.push(_)),_.setAttribute("part","cell body-cell"),_.__parentRow=s,s.__cells.push(_);const g=s===this.$.sizer;if((!a._bodyContentHidden||g)&&s.appendChild(_),g&&(a._sizerCell=_),c===p.length-1&&this.rowDetailsRenderer){this._detailsCells||(this._detailsCells=[]);const f=this._detailsCells.find(y=>y._vacant)||this._createCell("td");this._detailsCells.indexOf(f)===-1&&this._detailsCells.push(f),f._content.parentElement||n.appendChild(f._content),this._configureDetailsCell(f),s.appendChild(f),s.__detailsCell=f,this._a11ySetRowDetailsCell(s,f),f._vacant=!1}o||(a._cells=[...a._cells])}else{const g=t==="header"?"th":"td";i||a.localName==="vaadin-grid-column-group"?(_=a[`_${t}Cell`],_||(_=this._createCell(g),a._onCellKeyDown&&_.addEventListener("keydown",a._onCellKeyDown.bind(a))),_._column=a,s.appendChild(_),a[`_${t}Cell`]=_):(a._emptyCells||(a._emptyCells=[]),_=a._emptyCells.find(f=>f._vacant)||this._createCell(g),_._column=a,s.appendChild(_),a._emptyCells.indexOf(_)===-1&&a._emptyCells.push(_)),_.part.add("cell",`${t}-cell`)}_._content.parentElement||n.appendChild(_._content),_._vacant=!1,_._column=a}),t!=="body"&&this.__debounceUpdateHeaderFooterRowVisibility(s),this.appendChild(n),this._frozenCellsChanged(),this._updateFirstAndLastColumnForRow(s)}__debounceUpdateHeaderFooterRowVisibility(s){s.__debounceUpdateHeaderFooterRowVisibility=E.debounce(s.__debounceUpdateHeaderFooterRowVisibility,B,()=>this.__updateHeaderFooterRowVisibility(s))}__updateHeaderFooterRowVisibility(s){if(!s)return;const e=Array.from(s.children).filter(t=>{const i=t._column;if(i._emptyCells&&i._emptyCells.indexOf(t)>-1)return!1;if(s.parentElement===this.$.header){if(i.headerRenderer)return!0;if(i.header===null)return!1;if(i.path||i.header!==void 0)return!0}else if(i.footerRenderer)return!0;return!1});s.hidden!==!e.length&&(s.hidden=!e.length),this._resetKeyboardNavigation()}_updateScrollerItem(s,e){this._preventScrollerRotatingCellFocus(s,e),this._columnTree&&(this._updateRowOrderParts(s,e),this._a11yUpdateRowRowindex(s,e),this._getItem(e,s))}_columnTreeChanged(s){this._renderColumnTree(s),this.recalculateColumnWidths(),this.__updateColumnsBodyContentHidden()}_updateRowOrderParts(s,e=s.index){ee(s,{first:e===0,last:e===this._flatSize-1,odd:e%2!==0,even:e%2===0})}_updateRowStateParts(s,{expanded:e,selected:t,detailsOpened:i}){ee(s,{expanded:e,collapsed:this.__isRowExpandable(s),selected:t,"details-opened":i})}__computeEmptyState(s,e){return s===0&&e}_renderColumnTree(s){for(k(this.$.items,e=>{this._updateRow(e,s[s.length-1],"body",!1,!0);const t=this.__getRowModel(e);this._updateRowOrderParts(e),this._updateRowStateParts(e,t),this._filterDragAndDrop(e,t)});this.$.header.children.length<s.length;){const e=document.createElement("tr");e.setAttribute("part","row"),e.setAttribute("role","row"),e.setAttribute("tabindex","-1"),this.$.header.appendChild(e);const t=document.createElement("tr");t.setAttribute("part","row"),t.setAttribute("role","row"),t.setAttribute("tabindex","-1"),this.$.footer.appendChild(t)}for(;this.$.header.children.length>s.length;)this.$.header.removeChild(this.$.header.firstElementChild),this.$.footer.removeChild(this.$.footer.firstElementChild);k(this.$.header,(e,t,i)=>{this._updateRow(e,s[t],"header",t===s.length-1);const o=ie(e);q(o,"first-header-row-cell",t===0),q(o,"last-header-row-cell",t===i.length-1)}),k(this.$.footer,(e,t,i)=>{this._updateRow(e,s[s.length-1-t],"footer",t===0);const o=ie(e);q(o,"first-footer-row-cell",t===0),q(o,"last-footer-row-cell",t===i.length-1)}),this._updateRow(this.$.sizer,s[s.length-1]),this._resizeHandler(),this._frozenCellsChanged(),this._updateFirstAndLastColumn(),this._resetKeyboardNavigation(),this._a11yUpdateHeaderRows(),this._a11yUpdateFooterRows(),this.generateCellClassNames(),this.generateCellPartNames(),this.__updateHeaderAndFooter()}_updateItem(s,e){s._item=e;const t=this.__getRowModel(s);this._toggleDetailsCell(s,t.detailsOpened),this._a11yUpdateRowLevel(s,t.level),this._a11yUpdateRowSelected(s,t.selected),this._updateRowStateParts(s,t),this._generateCellClassNames(s,t),this._generateCellPartNames(s,t),this._filterDragAndDrop(s,t),this.__updateDragSourceParts(s,t),k(s,i=>
924{if(!(i._column&&!i._column.isConnected)&&i._renderer){const o=i._column||this;i._renderer.call(o,i._content,o,t)}}),this._updateDetailsCellHeight(s),this._a11yUpdateRowExpanded(s,t.expanded)}_resizeHandler(){this._updateDetailsCellHeights(),this.__updateHorizontalScrollPosition()}_onAnimationEnd(s){s.animationName.indexOf("vaadin-grid-appear")===0&&(s.stopPropagation(),this.__tryToRecalculateColumnWidthsIfPending(),this._resetKeyboardNavigation(),requestAnimationFrame(()=>{this.__scrollToPendingIndexes()}))}__getRowModel(s){return{index:s.index,item:s._item,level:this._getIndexLevel(s.index),expanded:this._isExpanded(s._item),selected:this._isSelected(s._item),detailsOpened:!!this.rowDetailsRenderer&&this._isDetailsOpened(s._item)}}_showTooltip(s){const e=this._tooltipController.node;if(e&&e.isConnected){const t=s.target;if(!this.__isCellFullyVisible(t))return;this._tooltipController.setTarget(t),this._tooltipController.setContext(this.getEventContext(s)),e._stateController.open({focus:s.type==="focusin",hover:s.type==="mouseenter"})}}__isCellFullyVisible(s){if(s.hasAttribute("frozen")||s.hasAttribute("frozen-to-end"))return!0;let{left:e,right:t}=this.getBoundingClientRect();const i=[...s.parentNode.children].find(a=>a.hasAttribute("last-frozen"));if(i){const a=i.getBoundingClientRect();e=this.__isRTL?e:a.right,t=this.__isRTL?a.left:t}const o=[...s.parentNode.children].find(a=>a.hasAttribute("first-frozen-to-end"));if(o){const a=o.getBoundingClientRect();e=this.__isRTL?a.right:e,t=this.__isRTL?t:a.left}const n=s.getBoundingClientRect();return n.left>=e&&n.right<=t}_hideTooltip(s){const e=this._tooltipController&&this._tooltipController.node;e&&e._stateController.close(s)}requestContentUpdate(){this.__updateHeaderAndFooter(),this.__updateVisibleRows()}__updateHeaderAndFooter(){(this._columnTree||[]).forEach(s=>{s.forEach(e=>{e._renderHeaderAndFooter&&e._renderHeaderAndFooter()})})}__updateVisibleRows(s,e){this.__virtualizer&&this.__virtualizer.update(s,e)}};/** 925 * @license 926 * Copyright (c) 2016 - 2024 Vaadin Ltd. 927 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 928 */const Ji=O` 929 @keyframes vaadin-grid-appear { 930 to { 931 opacity: 1; 932 } 933 } 934 935 :host { 936 display: flex; 937 flex-direction: column; 938 animation: 1ms vaadin-grid-appear; 939 height: 400px; 940 flex: 1 1 auto; 941 align-self: stretch; 942 position: relative; 943 } 944 945 :host([hidden]) { 946 display: none !important; 947 } 948 949 :host([disabled]) { 950 pointer-events: none; 951 } 952 953 #scroller { 954 display: flex; 955 flex-direction: column; 956 min-height: 100%; 957 transform: translateY(0); 958 width: auto; 959 height: auto; 960 position: absolute; 961 inset: 0; 962 } 963 964 :host([all-rows-visible]) { 965 height: auto; 966 align-self: flex-start; 967 flex-grow: 0; 968 width: 100%; 969 } 970 971 :host([all-rows-visible]) #scroller { 972 width: 100%; 973 height: 100%; 974 position: relative; 975 } 976 977 :host([all-rows-visible]) #items { 978 min-height: 1px; 979 } 980 981 #table { 982 display: flex; 983 flex-direction: column; 984 width: 100%; 985 height: 100%; 986 overflow: auto; 987 position: relative; 988 outline: none; 989 /* Workaround for a Desktop Safari bug: new stacking context here prevents the scrollbar from getting hidden */ 990 z-index: 0; 991 } 992 993 #header, 994 #footer { 995 display: block; 996 position: -webkit-sticky; 997 position: sticky; 998 left: 0; 999 overflow: visible; 1000 width: 100%; 1001 z-index: 1; 1002 } 1003 1004 #header { 1005 top: 0; 1006 } 1007 1008 th { 1009 text-align: inherit; 1010 } 1011 1012 /* Safari doesn't work with "inherit" */ 1013 [safari] th { 1014 text-align: initial; 1015 } 1016 1017 #footer { 1018 bottom: 0; 1019 } 1020 1021 #items { 1022 flex-grow: 1; 1023 flex-shrink: 0; 1024 display: block; 1025 position: -webkit-sticky; 1026 position: sticky; 1027 width: 100%; 1028 left: 0; 1029 overflow: visible; 1030 } 1031 1032 [part~='row'] { 1033 display: flex; 1034 width: 100%; 1035 box-sizing: border-box; 1036 margin: 0; 1037 } 1038 1039 [part~='row'][loading] [part~='body-cell'] ::slotted(vaadin-grid-cell-content) { 1040 visibility: hidden; 1041 } 1042 1043 [column-rendering='lazy'] [part~='body-cell']:not([frozen]):not([frozen-to-end]) { 1044 transform: translateX(var(--_grid-lazy-columns-start)); 1045 } 1046 1047 #items [part~='row'] { 1048 position: absolute; 1049 } 1050 1051 #items [part~='row']:empty { 1052 height: 100%; 1053 } 1054 1055 [part~='cell']:not([part~='details-cell']) { 1056 flex-shrink: 0; 1057 flex-grow: 1; 1058 box-sizing: border-box; 1059 display: flex; 1060 width: 100%; 1061 position: relative;
1062 align-items: center; 1063 padding: 0; 1064 white-space: nowrap; 1065 } 1066 1067 [part~='cell'] { 1068 outline: none; 1069 } 1070 1071 [part~='cell'] > [tabindex] { 1072 display: flex; 1073 align-items: inherit; 1074 outline: none; 1075 position: absolute; 1076 inset: 0; 1077 } 1078 1079 /* Switch the focusButtonMode wrapping element to "position: static" temporarily 1080 when measuring real width of the cells in the auto-width columns. */ 1081 [measuring-auto-width] [part~='cell'] > [tabindex] { 1082 position: static; 1083 } 1084 1085 [part~='details-cell'] { 1086 position: absolute; 1087 bottom: 0; 1088 width: 100%; 1089 box-sizing: border-box; 1090 padding: 0; 1091 } 1092 1093 [part~='cell'] ::slotted(vaadin-grid-cell-content) { 1094 display: block; 1095 width: 100%; 1096 box-sizing: border-box; 1097 overflow: hidden; 1098 text-overflow: ellipsis; 1099 } 1100 1101 [hidden] { 1102 display: none !important; 1103 } 1104 1105 [frozen], 1106 [frozen-to-end] { 1107 z-index: 2; 1108 will-change: transform; 1109 } 1110 1111 [no-scrollbars][safari] #table, 1112 [no-scrollbars][firefox] #table { 1113 overflow: hidden; 1114 } 1115 1116 /* Empty state */ 1117 1118 #scroller:not([empty-state]) #emptystatebody, 1119 #scroller[empty-state] #items { 1120 display: none; 1121 } 1122 1123 #emptystatebody { 1124 display: flex; 1125 position: sticky; 1126 inset: 0; 1127 flex: 1; 1128 overflow: hidden; 1129 } 1130 1131 #emptystaterow { 1132 display: flex; 1133 flex: 1; 1134 } 1135 1136 #emptystatecell { 1137 display: block; 1138 flex: 1; 1139 overflow: auto; 1140 } 1141 1142 /* Reordering styles */ 1143 :host([reordering]) [part~='cell'] ::slotted(vaadin-grid-cell-content), 1144 :host([reordering]) [part~='resize-handle'], 1145 #scroller[no-content-pointer-events] [part~='cell'] ::slotted(vaadin-grid-cell-content) { 1146 pointer-events: none; 1147 } 1148 1149 [part~='reorder-ghost'] { 1150 visibility: hidden; 1151 position: fixed; 1152 pointer-events: none; 1153 opacity: 0.5; 1154 1155 /* Prevent overflowing the grid in Firefox */ 1156 top: 0; 1157 left: 0; 1158 } 1159 1160 :host([reordering]) { 1161 -moz-user-select: none; 1162 -webkit-user-select: none; 1163 user-select: none; 1164 } 1165 1166 /* Resizing styles */ 1167 [part~='resize-handle'] { 1168 position: absolute; 1169 top: 0; 1170 right: 0; 1171 height: 100%; 1172 cursor: col-resize; 1173 z-index: 1; 1174 } 1175 1176 [part~='resize-handle']::before { 1177 position: absolute; 1178 content: ''; 1179 height: 100%; 1180 width: 35px; 1181 transform: translateX(-50%); 1182 } 1183 1184 [last-column] [part~='resize-handle']::before, 1185 [last-frozen] [part~='resize-handle']::before { 1186 width: 18px; 1187 transform: none; 1188 right: 0; 1189 } 1190 1191 [frozen-to-end] [part~='resize-handle'] { 1192 left: 0; 1193 right: auto; 1194 } 1195 1196 [frozen-to-end] [part~='resize-handle']::before { 1197 left: 0; 1198 right: auto; 1199 } 1200 1201 [first-frozen-to-end] [part~='resize-handle']::before { 1202 width: 18px; 1203 transform: none; 1204 } 1205 1206 [first-frozen-to-end] { 1207 margin-inline-start: auto; 1208 } 1209 1210 /* Hide resize handle if scrolled to end */ 1211 :host(:not([overflow~='end'])) [first-frozen-to-end] [part~='resize-handle'] { 1212 display: none; 1213 } 1214 1215 #scroller[column-resizing] { 1216 -ms-user-select: none; 1217 -moz-user-select: none; 1218 -webkit-user-select: none; 1219 user-select: none; 1220 } 1221 1222 /* Sizer styles */ 1223 #sizer { 1224 display: flex; 1225 position: absolute; 1226 visibility: hidden; 1227 } 1228 1229 #sizer [part~='details-cell'] { 1230 display: none !important; 1231 } 1232 1233 #sizer [part~='cell'][hidden] { 1234 display: none !important; 1235 } 1236 1237 #sizer [part~='cell'] { 1238 display: block; 1239 flex-shrink: 0; 1240 line-height: 0; 1241 height: 0 !important; 1242 min-height: 0 !important; 1243 max-height: 0 !important; 1244 padding: 0 !important; 1245 border: none !important; 1246 } 1247 1248 #sizer [part~='cell']::before { 1249 content: '-'; 1250 } 1251 1252 #sizer [part~='cell'] ::slotted(vaadin-grid-cell-content) { 1253 display: none !important; 1254 } 1255 1256 /* RTL specific styles */ 1257 1258 :host([dir='rtl']) #items, 1259 :host([dir='rtl']) #header, 1260 :host([dir='rtl']) #footer { 1261 left: auto; 1262 } 1263 1264 :host([dir='rtl']) [part~='reorder-ghost'] { 1265 left: auto; 1266 right: 0; 1267 } 1268 1269 :host([dir='rtl']) [part~='resize-handle'] { 1270 left: 0; 1271 right: auto; 1272 } 1273 1274 :host([dir='rtl']) [part~='resize-handle']::before { 1275 transform: translateX(50%); 1276 } 1277 1278 :host([dir='rtl']) [last-column] [part~='resize-handle']::before, 1279 :host([dir='rtl']) [last-frozen] [part~='resize-handle']::before { 1280 left: 0; 1281 right: auto; 1282 } 1283 1284 :host([dir='rtl']) [frozen-to-end] [part~='resize-handle'] { 1285 right: 0; 1286 left: auto; 1287 } 1288 1289 :host([dir='rtl']) [frozen-to-end] [part~='resize-handle']::before { 1290 right: 0; 1291 left: auto; 1292 } 1293 1294 @media (forced-colors: active) { 1295 [part~='selected-row'] [part~='first-column-cell']::after { 1296 content: ''; 1297 position: absolute; 1298 top: 0; 1299 left: 0; 1300 bottom: 0; 1301 border: 2px solid; 1302 } 1303 1304 [part~='focused-cell']::before { 1305 outline: 2px solid !important; 1306 outline-offset: -1px; 1307 } 1308 } 1309`;/** 1310 * @license 1311 * Copyright (c) 2016 - 2024 Vaadin Ltd. 1312 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 1313 */P("vaadin-grid",Ji,{moduleId:"vaadin-grid-styles"});class le extends Zi(ke(re(Re(N)))){static get template(){return X` 1314 <div 1315 id="scroller" 1316 safari$="[[_safari]]" 1317 ios$="[[_ios]]" 1318 loading$="[[loading]]" 1319 column-reordering-allowed$="[[columnReorderingAllowed]]" 1320 empty-state$="[[__emptyState]]" 1321 > 1322 <table id="table" role="treegrid" aria-multiselectable="true" tabindex="0"> 1323 <caption id="sizer" part="row"></caption> 1324 <thead id="header" role="rowgroup"></thead> 1325 <tbody id="items" role="rowgroup"></tbody> 1326 <tbody id="emptystatebody"> 1327 <tr id="emptystaterow"> 1328 <td part="empty-state" id="emptystatecell" tabindex="0"> 1329 <slot name="empty-state" id="emptystateslot"></slot> 1330 </td> 1331 </tr> 1332 </tbody> 1333 <tfoot id="footer" role="rowgroup"></tfoot> 1334 </table> 1335 1336 <div part="reorder-ghost"></div> 1337 </div> 1338 1339 <slot name="tooltip"></slot> 1340 1341 <div id="focusexit" tabindex="0"></div> 1342 `}static get is(){return"vaadin-grid"}}V(le);P("vaadin-grid-sorter",O` 1343 :host { 1344 justify-content: flex-start; 1345 align-items: baseline; 1346 -webkit-user-select: none; 1347 -moz-user-select: none; 1348 user-select: none; 1349 cursor: var(--lumo-clickable-cursor); 1350 } 1351 1352 [part='content'] { 1353 display: inline-block; 1354 overflow: hidden; 1355 text-overflow: ellipsis; 1356 } 1357 1358 [part='indicators'] { 1359 margin-left: var(--lumo-space-s); 1360 } 1361 1362 [part='indicators']::before { 1363 transform: scale(0.8); 1364 } 1365 1366 :host(:not([direction]):not(:hover)) [part='indicators'] { 1367 color: var(--lumo-tertiary-text-color); 1368 } 1369 1370 :host([direction]) { 1371 color: var(--vaadin-selection-color-text, var(--lumo-primary-text-color)); 1372 } 1373 1374 [part='order'] { 1375 font-size: var(--lumo-font-size-xxs); 1376 line-height: 1; 1377 } 1378 1379 /* RTL specific styles */ 1380 1381 :host([dir='rtl']) [part='indicators'] { 1382 margin-right: var(--lumo-space-s); 1383 margin-left: 0; 1384 } 1385 `,{moduleId:"lumo-grid-sorter"});/** 1386 * @license 1387 * Copyright (c) 2016 - 2024 Vaadin Ltd. 1388 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 1389 */const ft=document.createElement("template");ft.innerHTML=` 1390 <style> 1391 @font-face { 1392 font-family: 'vaadin-grid-sorter-icons'; 1393 src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAQwAA0AAAAABuwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAEFAAAABkAAAAcfep+mUdERUYAAAP4AAAAHAAAAB4AJwAOT1MvMgAAAZgAAAA/AAAAYA8TBPpjbWFwAAAB7AAAAFUAAAFeF1fZ4mdhc3AAAAPwAAAACAAAAAgAAAAQZ2x
13935ZgAAAlgAAABcAAAAnMvguMloZWFkAAABMAAAAC8AAAA2C5Ap72hoZWEAAAFgAAAAHQAAACQGbQPHaG10eAAAAdgAAAAUAAAAHAoAAABsb2NhAAACRAAAABIAAAASAIwAYG1heHAAAAGAAAAAFgAAACAACwAKbmFtZQAAArQAAAECAAACZxWCgKhwb3N0AAADuAAAADUAAABZCrApUXicY2BkYGAA4rDECVrx/DZfGbhZGEDgyqNPOxH0/wNMq5kPALkcDEwgUQBWRA0dAHicY2BkYGA+8P8AAwMLAwgwrWZgZEAFbABY4QM8AAAAeJxjYGRgYOAAQiYGEICQSAAAAi8AFgAAeJxjYGY6yziBgZWBgWkm0xkGBoZ+CM34msGYkZMBFTAKoAkwODAwvmRiPvD/AIMDMxCD1CDJKjAwAgBktQsXAHicY2GAAMZQCM0EwqshbAALxAEKeJxjYGBgZoBgGQZGBhCIAPIYwXwWBhsgzcXAwcAEhIwMCi+Z/v/9/x+sSuElA4T9/4k4K1gHFwMMMILMY2QDYmaoABOQYGJABUA7WBiGNwAAJd4NIQAAAAAAAAAACAAIABAAGAAmAEAATgAAeJyNjLENgDAMBP9tIURJwQCMQccSZgk2i5fIYBDAidJjycXr7x5EPwE2wY8si7jmyBNXGo/bNBerxJNrpxhbO3/fEFpx8ZICpV+ghxJ74fAMe+h7Ox14AbrsHB14nK2QQWrDMBRER4mTkhQK3ZRQKOgCNk7oGQqhhEIX2WSlWEI1BAlkJ5CDdNsj5Ey9Rncdi38ES+jzNJo/HwTgATcoDEthhY3wBHc4CE+pfwsX5F/hGe7Vo/AcK/UhvMSz+mGXKhZU6pww8ISz3oWn1BvhgnwTnuEJf8Jz1OpFeIlX9YULDLdFi4ASHolkSR0iuYdjLak1vAequBhj21D61Nqyi6l3qWybGPjySbPHGScGJl6dP58MYcQRI0bts7mjebBqrFENH7t3qWtj0OuqHnXcW7b0HOTZFnKryRGW2hFX1m0O2vEM3opNMfTau+CS6Z3Vx6veNnEXY6jwDxhsc2gAAHicY2BiwA84GBgYmRiYGJkZmBlZGFkZ2djScyoLMgzZS/MyDQwMwLSrpYEBlIbxjQDrzgsuAAAAAAEAAf//AA94nGNgZGBg4AFiMSBmYmAEQnYgZgHzGAAD6wA2eJxjYGBgZACCKyoz1cD0o087YTQATOcIewAAAA==) format('woff'); 1394 font-weight: normal; 1395 font-style: normal; 1396 } 1397 </style> 1398`;document.head.appendChild(ft.content);P("vaadin-grid-sorter",O` 1399 :host { 1400 display: inline-flex; 1401 cursor: pointer; 1402 max-width: 100%; 1403 } 1404 1405 [part='content'] { 1406 flex: 1 1 auto; 1407 } 1408 1409 [part='indicators'] { 1410 position: relative; 1411 align-self: center; 1412 flex: none; 1413 } 1414 1415 [part='order'] { 1416 display: inline; 1417 vertical-align: super; 1418 } 1419 1420 [part='indicators']::before { 1421 font-family: 'vaadin-grid-sorter-icons'; 1422 display: inline-block; 1423 } 1424 1425 :host(:not([direction])) [part='indicators']::before { 1426 content: '\\e901'; 1427 } 1428 1429 :host([direction='asc']) [part='indicators']::before { 1430 content: '\\e900'; 1431 } 1432 1433 :host([direction='desc']) [part='indicators']::before { 1434 content: '\\e902'; 1435 } 1436 `,{moduleId:"vaadin-grid-sorter-styles"});const es=r=>class extends r{static get properties(){return{path:String,direction:{type:String,reflectToAttribute:!0,notify:!0,value:null,sync:!0},_order:{type:Number,value:null,sync:!0}}}static get observers(){return["_pathOrDirectionChanged(path, direction)"]}ready(){super.ready(),this.addEventListener("click",this._onClick.bind(this))}connectedCallback(){super.connectedCallback(),this._grid?this._grid.__applySorters():this.__dispatchSorterChangedEvenIfPossible()}disconnectedCallback(){super.disconnectedCallback(),!this.parentNode&&this._grid?this._grid.__removeSorters([this]):this._grid&&this._grid.__applySorters()}_pathOrDirectionChanged(){this.__dispatchSorterChangedEvenIfPossible()}__dispatchSorterChangedEvenIfPossible(){this.path===void 0||this.direction===void 0||!this.isConnected||(this.dispatchEvent(new CustomEvent("sorter-changed",{detail:{shiftClick:!!this._shiftClick,fromSorterClick:!!this._fromSorterClick},bubbles:!0,composed:!0})),this._fromSorterClick=!1,this._shiftClick=!1)}_getDisplayOrder(e){return e===null?"":e+1}_onClick(e){if(e.defaultPrevented)return;const t=this.getRootNode().activeElement;this!==t&&this.contains(t)||(e.preventDefault(),this._shiftClick=e.shiftKey,this._fromSorterClick=!0,this.direction==="asc"?this.direction="desc":this.direction==="desc"?this.direction=null:this.direction="asc")}};/** 1437 * @license 1438 * Copyright (c) 2016 - 2024 Vaadin Ltd. 1439 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 1440 */class ts extends es(re(de(N))){static get template(){return X` 1441 <div part="content"> 1442 <slot></slot> 1443 </div> 1444 <div part="indicators"> 1445 <span part="order">[[_getDisplayOrder(_order)]]</span> 1446 </div> 1447 `}static get is(){return"vaadin-grid-sorter"}}V(ts);P("vaadin-checkbox",O` 1448 :host { 1449 color: var(--vaadin-checkbox-label-color, var(--lumo-body-text-color)); 1450 font-size: var(--vaadin-checkbox-label-font-size, var(--lumo-font-size-m)); 1451 font-family: var(--lumo-font-family); 1452 line-height: var(--lumo-line-height-s); 1453 -webkit-font-smoothing: antialiased; 1454 -moz-osx-font-smoothing: grayscale; 1455 -webkit-tap-highlight-color: transparent; 1456 -webkit-user-select: none; 1457 -moz-user-select: none; 1458 user-select: none; 1459 cursor: default; 1460 outline: none; 1461 --_checkbox-size: var(--vaadin-checkbox-size, calc(var(--lumo-size-m) / 2)); 1462 --_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct)); 1463 --_focus-ring-width: var(--vaadin-focus-ring-width, 2px); 1464 --_selection-color: var(--vaadin-selection-color, var(--lumo-primary-color));
1465 --_invalid-background: var(--vaadin-input-field-invalid-background, var(--lumo-error-color-10pct)); 1466 --_disabled-checkmark-color: var(--vaadin-checkbox-disabled-checkmark-color, var(--lumo-contrast-30pct)); 1467 } 1468 1469 [part='label'] { 1470 display: flex; 1471 position: relative; 1472 max-width: max-content; 1473 } 1474 1475 :host([has-label]) ::slotted(label) { 1476 padding: var( 1477 --vaadin-checkbox-label-padding, 1478 var(--lumo-space-xs) var(--lumo-space-s) var(--lumo-space-xs) var(--lumo-space-xs) 1479 ); 1480 } 1481 1482 :host([dir='rtl'][has-label]) ::slotted(label) { 1483 padding: var(--lumo-space-xs) var(--lumo-space-xs) var(--lumo-space-xs) var(--lumo-space-s); 1484 } 1485 1486 :host([has-label][required]) ::slotted(label) { 1487 padding-inline-end: var(--lumo-space-m); 1488 } 1489 1490 [part='checkbox'] { 1491 width: var(--_checkbox-size); 1492 height: var(--_checkbox-size); 1493 margin: var(--lumo-space-xs); 1494 position: relative; 1495 border-radius: var(--vaadin-checkbox-border-radius, var(--lumo-border-radius-s)); 1496 background: var(--vaadin-checkbox-background, var(--lumo-contrast-20pct)); 1497 transition: 1498 transform 0.2s cubic-bezier(0.12, 0.32, 0.54, 2), 1499 background-color 0.15s; 1500 cursor: var(--lumo-clickable-cursor); 1501 /* Default field border color */ 1502 --_input-border-color: var(--vaadin-input-field-border-color, var(--lumo-contrast-50pct)); 1503 } 1504 1505 :host([indeterminate]), 1506 :host([checked]) { 1507 --vaadin-input-field-border-color: transparent; 1508 } 1509 1510 :host([indeterminate]) [part='checkbox'], 1511 :host([checked]) [part='checkbox'] { 1512 background-color: var(--_selection-color); 1513 } 1514 1515 /* Checkmark */ 1516 [part='checkbox']::after { 1517 pointer-events: none; 1518 font-family: 'lumo-icons'; 1519 content: var(--vaadin-checkbox-checkmark-char, var(--lumo-icons-checkmark)); 1520 color: var(--vaadin-checkbox-checkmark-color, var(--lumo-primary-contrast-color)); 1521 font-size: var(--vaadin-checkbox-checkmark-size, calc(var(--_checkbox-size) + 2px)); 1522 line-height: 1; 1523 position: absolute; 1524 top: -1px; 1525 left: -1px; 1526 contain: content; 1527 opacity: 0; 1528 } 1529 1530 :host([checked]) [part='checkbox']::after { 1531 opacity: 1; 1532 } 1533
1534 :host([readonly]:not([checked]):not([indeterminate])) { 1535 color: var(--lumo-secondary-text-color); 1536 } 1537 1538 :host([readonly]:not([checked]):not([indeterminate])) [part='checkbox'] { 1539 background: transparent; 1540 box-shadow: none; 1541 } 1542 1543 :host([readonly]:not([checked]):not([indeterminate])) [part='checkbox']::after { 1544 content: ''; 1545 box-sizing: border-box; 1546 width: 100%; 1547 height: 100%; 1548 border-radius: inherit; 1549 top: 0; 1550 left: 0; 1551 opacity: 1; 1552 border: var(--vaadin-input-field-readonly-border, 1px dashed var(--lumo-contrast-50pct)); 1553 } 1554 1555 /* Indeterminate checkmark */ 1556 :host([indeterminate]) [part='checkbox']::after { 1557 content: var(--vaadin-checkbox-checkmark-char-indeterminate, ''); 1558 opacity: 1; 1559 top: 45%; 1560 height: 10%; 1561 left: 22%; 1562 right: 22%; 1563 width: auto; 1564 border: 0; 1565 background-color: var(--lumo-primary-contrast-color); 1566 } 1567 1568 /* Focus ring */ 1569 :host([focus-ring]) [part='checkbox'] { 1570 box-shadow: 1571 0 0 0 1px var(--lumo-base-color), 1572 0 0 0 calc(var(--_focus-ring-width) + 1px) var(--_focus-ring-color), 1573 inset 0 0 0 var(--_input-border-width, 0) var(--_input-border-color); 1574 } 1575
1576 :host([focus-ring][readonly]:not([checked]):not([indeterminate])) [part='checkbox'] { 1577 box-shadow: 1578 0 0 0 1px var(--lumo-base-color), 1579 0 0 0 calc(var(--_focus-ring-width) + 1px) var(--_focus-ring-color); 1580 } 1581 1582 /* Disabled */ 1583 :host([disabled]) { 1584 pointer-events: none; 1585 --vaadin-input-field-border-color: var(--lumo-contrast-20pct); 1586 } 1587 1588 :host([disabled]) ::slotted(label) { 1589 color: inherit; 1590 } 1591 1592 :host([disabled]) [part='checkbox'] { 1593 background-color: var(--vaadin-checkbox-disabled-background, var(--lumo-contrast-10pct)); 1594 } 1595 1596 :host([disabled]) [part='checkbox']::after { 1597 color: var(--_disabled-checkmark-color); 1598 } 1599 1600 :host([disabled]) [part='label'], 1601 :host([disabled]) [part='helper-text'] { 1602 color: var(--lumo-disabled-text-color); 1603 -webkit-text-fill-color: var(--lumo-disabled-text-color); 1604 } 1605 1606 :host([indeterminate][disabled]) [part='checkbox']::after { 1607 background-color: var(--_disabled-checkmark-color); 1608 } 1609 1610 :host([readonly][checked]:not([disabled])) [part='checkbox'], 1611 :host([readonly][indeterminate]:not([disabled])) [part='checkbox'] { 1612 background-color: var(--vaadin-checkbox-readonly-checked-background, var(--lumo-contrast-70pct)); 1613 } 1614 1615 /* Used for activation "halo" */ 1616 [part='checkbox']::before { 1617 pointer-events: none; 1618 color: transparent; 1619 width: 100%; 1620 height: 100%; 1621 line-height: var(--_checkbox-size); 1622 border-radius: inherit; 1623 background-color: inherit; 1624 transform: scale(1.4); 1625 opacity: 0; 1626 transition: 1627 transform 0.1s, 1628 opacity 0.8s; 1629 } 1630 1631 /* Hover */
1632 :host(:not([checked]):not([indeterminate]):not([disabled]):not([readonly]):not([invalid]):hover) [part='checkbox'] { 1633 background: var(--vaadin-checkbox-background-hover, var(--lumo-contrast-30pct)); 1634 } 1635 1636 /* Disable hover for touch devices */ 1637 @media (pointer: coarse) { 1638 /* prettier-ignore */ 1639 :host(:not([checked]):not([indeterminate]):not([disabled]):not([readonly]):not([invalid]):hover) [part='checkbox'] { 1640 background: var(--vaadin-checkbox-background, var(--lumo-contrast-20pct)); 1641 } 1642 } 1643 1644 /* Active */ 1645 :host([active]) [part='checkbox'] { 1646 transform: scale(0.9); 1647 transition-duration: 0.05s; 1648 } 1649 1650 :host([active][checked]) [part='checkbox'] { 1651 transform: scale(1.1); 1652 } 1653 1654 :host([active]:not([checked])) [part='checkbox']::before { 1655 transition-duration: 0.01s, 0.01s; 1656 transform: scale(0); 1657 opacity: 0.4; 1658 } 1659 1660 /* Required */ 1661 :host([required]) [part='required-indicator'] { 1662 position: absolute; 1663 top: var(--lumo-space-xs); 1664 right: var(--lumo-space-xs); 1665 } 1666 1667 :host([required][dir='rtl']) [part='required-indicator'] { 1668 right: auto; 1669 left: var(--lumo-space-xs); 1670 } 1671 1672 :host([required]) [part='required-indicator']::after { 1673 content: var(--lumo-required-field-indicator, '\\2022'); 1674 transition: opacity 0.2s; 1675 color: var(--lumo-required-field-indicator-color, var(--lumo-primary-text-color)); 1676 width: 1em; 1677 text-align: center; 1678 } 1679 1680 :host(:not([has-label])) [part='required-indicator'] { 1681 display: none; 1682 } 1683 1684 /* Invalid */ 1685 :host([invalid]) { 1686 --vaadin-input-field-border-color: var(--lumo-error-color); 1687 } 1688 1689 :host([invalid]) [part='checkbox'] { 1690 background: var(--_invalid-background); 1691 background-image: linear-gradient(var(--_invalid-background) 0%, var(--_invalid-background) 100%); 1692 } 1693 1694 :host([invalid]:hover) [part='checkbox'] { 1695 background-image: linear-gradient(var(--_invalid-background) 0%, var(--_invalid-background) 100%), 1696 linear-gradient(var(--_invalid-background) 0%, var(--_invalid-background) 100%); 1697 } 1698 1699 :host([invalid][focus-ring]) { 1700 --_focus-ring-color: var(--lumo-error-color-50pct); 1701 } 1702 1703 :host([invalid]) [part='required-indicator']::after { 1704 color: var(--lumo-required-field-indicator-color, var(--lumo-error-text-color)); 1705 } 1706 1707 /* Error message */ 1708 [part='error-message'] { 1709 font-size: var(--vaadin-input-field-error-font-size, var(--lumo-font-size-xs)); 1710 line-height: var(--lumo-line-height-xs); 1711 font-weight: var(--vaadin-input-field-error-font-weight, 400); 1712 color: var(--vaadin-input-field-error-color, var(--lumo-error-text-color)); 1713 will-change: max-height; 1714 transition: 0.4s max-height; 1715 max-height: 5em; 1716 padding-inline-start: var(--lumo-space-xs); 1717 } 1718 1719 :host([has-error-message]) [part='error-message']::after, 1720 :host([has-helper]) [part='helper-text']::after { 1721 content: ''; 1722 display: block; 1723 height: 0.4em; 1724 } 1725 1726 :host(:not([invalid])) [part='error-message'] { 1727 max-height: 0; 1728 overflow: hidden; 1729 } 1730 1731 /* Helper */ 1732 [part='helper-text'] { 1733 display: block; 1734 color: var(--vaadin-input-field-helper-color, var(--lumo-secondary-text-color)); 1735 font-size: var(--vaadin-input-field-helper-font-size, var(--lumo-font-size-xs)); 1736 line-height: var(--lumo-line-height-xs); 1737 font-weight: var(--vaadin-input-field-helper-font-weight, 400); 1738 margin-left: calc(var(--lumo-border-radius-m) / 4); 1739 transition: color 0.2s; 1740 padding-inline-start: var(--lumo-space-xs); 1741 } 1742 1743 :host(:hover:not([readonly])) [part='helper-text'] { 1744 color: var(--lumo-body-text-color); 1745 } 1746 1747 :host([has-error-message]) ::slotted(label), 1748 :host([has-helper]) ::slotted(label) { 1749 padding-bottom: 0; 1750 } 1751 `,{moduleId:"lumo-checkbox"});/** 1752 * @license 1753 * Copyright (c) 2021 - 2024 Vaadin Ltd. 1754 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 1755 */const is=Ht(r=>class extends Xt(Nt(Zt(r))){static get properties(){return{checked:{type:Boolean,value:!1,notify:!0,reflectToAttribute:!0}}}static get delegateProps(){return[...super.delegateProps,"checked"]}_onChange(e){const t=e.target;this._toggleChecked(t.checked)}_toggleChecked(e){this.checked=e}});/** 1756 * @license 1757 * Copyright (c) 2017 - 2024 Vaadin Ltd. 1758 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 1759 */const ss=r=>class extends Jt(is(ei(Ye(r)))){static get properties(){return{indeterminate:{type:Boolean,notify:!0,value:!1,reflectToAttribute:!0},name:{type:String,value:""},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},tabindex:{type:Number,value:0,reflectToAttribute:!0}}}static get observers(){return["__readonlyChanged(readonly, inputElement)"]}static get delegateProps(){return[...super.delegateProps,"indeterminate"]}static get delegateAttrs(){return[...super.delegateAttrs,"name","invali
1759d","required"]}constructor(){super(),this._setType("checkbox"),this._boundOnInputClick=this._onInputClick.bind(this),this.value="on"}ready(){super.ready(),this.addController(new yt(this,e=>{this._setInputElement(e),this._setFocusElement(e),this.stateTarget=e,this.ariaTarget=e})),this.addController(new ti(this.inputElement,this._labelController)),this._createMethodObserver("_checkedChanged(checked)")}_shouldSetActive(e){return this.readonly||e.target.localName==="a"||e.target===this._helperNode||e.target===this._errorNode?!1:super._shouldSetActive(e)}_addInputListeners(e){super._addInputListeners(e),e.addEventListener("click",this._boundOnInputClick)}_removeInputListeners(e){super._removeInputListeners(e),e.removeEventListener("click",this._boundOnInputClick)}_onInputClick(e){this.readonly&&e.preventDefault()}__readonlyChanged(e,t){t&&(e?t.setAttribute("aria-readonly","true"):t.removeAttribute("aria-readonly"))}_toggleChecked(e){this.indeterminate&&(this.indeterminate=!1),super._toggleChecked(e)}checkValidity(){return!this.required||!!this.checked}_setFocused(e){super._setFocused(e),!e&&document.hasFocus()&&this.validate()}_checkedChanged(e){(e||this.__oldChecked)&&this.validate(),this.__oldChecked=e}_requiredChanged(e){super._requiredChanged(e),e===!1&&this.validate()}_onRequiredIndicatorClick(){this._labelNode.click()}};/** 1760 * @license 1761 * Copyright (c) 2017 - 2024 Vaadin Ltd. 1762 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 1763 */const rs=O` 1764 :host { 1765 display: inline-block; 1766 } 1767 1768 :host([hidden]) { 1769 display: none !important; 1770 } 1771 1772 :host([disabled]) { 1773 -webkit-tap-highlight-color: transparent; 1774 } 1775 1776 .vaadin-checkbox-container { 1777 display: grid; 1778 grid-template-columns: auto 1fr; 1779 align-items: baseline; 1780 } 1781 1782 [part='checkbox'], 1783 ::slotted(input), 1784 [part='label'] { 1785 grid-row: 1; 1786 } 1787 1788 [part='checkbox'], 1789 ::slotted(input) { 1790 grid-column: 1; 1791 } 1792 1793 [part='helper-text'], 1794 [part='error-message'] { 1795 grid-column: 2; 1796 } 1797 1798 :host(:not([has-helper])) [part='helper-text'], 1799 :host(:not([has-error-message])) [part='error-message'] { 1800 display: none; 1801 } 1802 1803 [part='checkbox'] { 1804 width: var(--vaadin-checkbox-size, 1em); 1805 height: var(--vaadin-checkbox-size, 1em); 1806 --_input-border-width: var(--vaadin-input-field-border-width, 0); 1807 --_input-border-color: var(--vaadin-input-field-border-color, transparent); 1808 box-shadow: inset 0 0 0 var(--_input-border-width, 0) var(--_input-border-color); 1809 } 1810 1811 [part='checkbox']::before { 1812 display: block; 1813 content: '\\202F'; 1814 line-height: var(--vaadin-checkbox-size, 1em); 1815 contain: paint; 1816 } 1817 1818 /* visually hidden */ 1819 ::slotted(input) { 1820 opacity: 0; 1821 cursor: inherit; 1822 margin: 0; 1823 align-self: stretch; 1824 -webkit-appearance: none; 1825 width: initial; 1826 height: initial; 1827 } 1828 1829 @media (forced-colors: active) { 1830 [part='checkbox'] { 1831 outline: 1px solid; 1832 outline-offset: -1px; 1833 } 1834 1835 :host([disabled]) [part='checkbox'], 1836 :host([disabled]) [part='checkbox']::after { 1837 outline-color: GrayText; 1838 } 1839 1840 :host(:is([checked], [indeterminate])) [part='checkbox']::after { 1841 outline: 1px solid; 1842 outline-offset: -1px; 1843 border-radius: inherit; 1844 } 1845 1846 :host([focused]) [part='checkbox'], 1847 :host([focused]) [part='checkbox']::after { 1848 outline-width: 2px; 1849 } 1850 } 1851`;/** 1852 * @license 1853 * Copyright (c) 2017 - 2024 Vaadin Ltd. 1854 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 1855 */P("vaadin-checkbox",rs,{moduleId:"vaadin-checkbox-styles"});class os extends ss(ke(re(N))){static get is(){return"vaadin-checkbox"}static get template(){return X` 1856 <div class="vaadin-checkbox-container"> 1857 <div part="checkbox" aria-hidden="true"></div> 1858 <slot name="input"></slot> 1859 <div part="label"> 1860 <slot name="label"></slot> 1861 <div part="required-indicator" on-click="_onRequiredIndicatorClick"></div> 1862 </div> 1863 <div part="helper-text"> 1864 <slot name="helper"></slot> 1865 </div> 1866 <div part="error-message"> 1867 <slot name="error-message"></slot> 1868 </div> 1869 </div> 1870 <slot name="tooltip"></slot> 1871 `}ready(){super.ready(),this._tooltipController=new tt(this),this._tooltipController.setAriaTarget(this.inputElement),this.addController(this._tooltipController)}}V(os);window.Vaadin.Flow.gridConnector={};window.Vaadin.Flow.gridConnector.initLazy=r=>{if(r.$connector)return;const s=r._dataProviderController;s.ensureFlatIndexHierarchyOriginal=s.ensureFlatIndexHierarchy,s.ensureFlatIndexHierarchy=function(l){const{item:d}=this.getFlatIndexContext(l);if(!d||!this.isExpanded(d))return;r.$connector.hasCacheForParentKey(r.getItemId(d))?this.ensureFlatIndexHierarchyOriginal(l):r.$connector.beforeEnsureFlatIndexHierarchy(l,d)},s.isLoadingOriginal=s.isLoading,s.isLoading=function(){return r.$connector.hasEnsureSubCacheQueue()||this.isLoadingOriginal()},s.getItemSubCache=function(l){var d;return(d=this.getItemContext(l))==null?void 0:d.subCache};let e={};const t=50,i=20;let o=[],n,a=[],c;const p=150;
1871let _,g={};const f="null";g[f]=[0,0];let y=null,w=null;const S=["SINGLE","NONE","MULTI"];let A={},R="SINGLE",L=!1;r.size=0,r.itemIdPath="key";function Z(l){return{[r.itemIdPath]:l}}r.$connector={},r.$connector.hasCacheForParentKey=l=>{var d;return((d=e[l])==null?void 0:d.size)!==void 0},r.$connector.hasEnsureSubCacheQueue=()=>a.length>0,r.$connector.hasParentRequestQueue=()=>o.length>0,r.$connector.hasRootRequestQueue=()=>{const{pendingRequests:l}=s.rootCache;return Object.keys(l).length>0||!!(_!=null&&_.isActive())},r.$connector.beforeEnsureFlatIndexHierarchy=function(l,d){a.push({flatIndex:l,itemkey:r.getItemId(d)}),c=we.debounce(c,Vt,()=>{for(;a.length;)r.$connector.flushEnsureSubCache()})},r.$connector.doSelection=function(l,d){R==="NONE"||!l.length||d&&r.hasAttribute("disabled")||(R==="SINGLE"&&(A={}),l.forEach(h=>{h&&(A[h.key]=h,h.selected=!0,d&&r.$server.select(h.key));const u=!r.activeItem||!h||h.key!=r.activeItem.key;!d&&R==="SINGLE"&&u&&(r.activeItem=h)}),r.selectedItems=Object.values(A))},r.$connector.doDeselection=function(l,d){if(R==="NONE"||!l.length||d&&r.hasAttribute("disabled"))return;const h=r.selectedItems.slice();for(;l.length;){const u=l.shift();for(let m=0;m<h.length;m++){const b=h[m];if((u==null?void 0:u.key)===b.key){h.splice(m,1);break}}u&&(delete A[u.key],delete u.selected,d&&r.$server.deselect(u.key))}r.selectedItems=h},r.__activeItemChanged=function(l,d){R=="SINGLE"&&(l?A[l.key]||r.$connector.doSelection([l],!0):d&&A[d.key]&&(r.__deselectDisallowed?r.activeItem=d:r.$connector.doDeselection([d],!0)))},r._createPropertyObserver("activeItem","__activeItemChanged",!0),r.__activeItemChangedDetails=function(l,d){r.__disallowDetailsOnClick||l==null&&d===void 0||(l&&!l.detailsOpened?r.$server.setDetailsVisible(l.key):r.$server.setDetailsVisible(null))},r._createPropertyObserver("activeItem","__activeItemChangedDetails",!0),r.$connector._getSameLevelPage=function(l,d,h){if((d.parentItem?r.getItemId(d.parentItem):f)===l)return Math.floor(h/r.pageSize);const{parentCache:m,parentCacheIndex:b}=d;return m?this._getSameLevelPage(l,m,b):null},r.$connector.flushEnsureSubCache=function(){const l=a.shift();return l?(s.ensureFlatIndexHierarchyOriginal(l.flatIndex),!0):!1},r.$connector.debounceRootRequest=function(l){const d=r._hasData?p:0;_=we.debounce(_,Be.after(d),()=>{r.$connector.fetchPage((h,u)=>r.$server.setRequestedRange(h,u),l,f)})},r.$connector.flushParentRequests=function(){const l=[];o.splice(0,i).forEach(({parentKey:d,page:h})=>{r.$connector.fetchPage((u,m)=>l.push({parentKey:d,firstIndex:u,size:m}),h,d)}),l.length&&r.$server.setParentRequestedRanges(l)},r.$connector.debounceParentRequest=function(l,d){o=o.filter(h=>h.parentKey!==l),o.push({parentKey:l,page:d}),n=we.debounce(n,Be.after(t),()=>{for(;o.length;)r.$connector.flushParentRequests()})},r.$connector.fetchPage=function(l,d,h){h===f&&(d=Math.min(d,Math.floor((r.size-1)/r.pageSize)));const u=r._getRenderedRows();let m=u.length>0?u[0].index:0,b=u.length>0?u[u.length-1].index:0,v=b-m,C=Math.max(0,m-v),I=Math.min(b+v,r._flatSize),x=[null,null];for(let M=C;M<=I;M++){const{cache:mt,index:gt}=s.getFlatIndexContext(M),oe=r.$connector._getSameLevelPage(h,mt,gt);oe!==null&&(x[0]=Math.min(x[0]??oe,oe),x[1]=Math.max(x[1]??oe,oe))}(x.some(M=>M===null)||d<x[0]||d>x[1])&&(x=[d,d]);let F=g[h]||[-1,-1];if(F[0]!=x[0]||F[1]!=x[1]){g[h]=x;let M=x[1]-x[0]+1;l(x[0]*r.pageSize,M*r.pageSize)}},r.dataProvider=function(l,d){var u,m;if(l.pageSize!=r.pageSize)throw"Invalid pageSize";let h=l.page;if(l.parentItem){let b=r.getItemId(l.parentItem);const v=s.getItemSubCache(l.parentItem);(u=e[b])!=null&&u[h]&&v?(a=[],d(e[b][h],e[b].size)):r.$connector.debounceParentRequest(b,h)}else{if(r.size===0){d([],0);return}(m=e[f])!=null&&m[h]?d(e[f][h]):r.$connector.debounceRootRequest(h)}},r.$connector.setSorterDirections=function(l){L=!0,setTimeout(()=>{try{const d=Array.from(r.querySelectorAll("vaadin-grid-sorter"));r._sorters.forEach(h=>{d.includes(h)||d.push(h)}),d.forEach(h=>{h.direction=null}),r.multiSortPriority!=="append"&&(l=l.reverse()),l.forEach(({column:h,direction:u})=>{d.forEach(m=>{m.getAttribute("path")===h&&(m.direction=u)})}),r.__applySorters()}finally{L=!1}})},r._updateItem=function(l,d){le.prototype._updateItem.call(r,l,d),l.hidden||Array.from(l.children).forEac
1871h(h=>{var u,m;Array.from(((m=(u=h==null?void 0:h._content)==null?void 0:u.__templateInstance)==null?void 0:m.children)||[]).forEach(b=>{b._attachRenderedComponentIfAble&&b._attachRenderedComponentIfAble(),Array.from((b==null?void 0:b.children)||[]).forEach(v=>{v._attachRenderedComponentIfAble&&v._attachRenderedComponentIfAble()})})}),R===S[1]&&(l.removeAttribute("aria-selected"),Array.from(l.children).forEach(h=>h.removeAttribute("aria-selected")))};const G=function(l,d){if(l==null||r.$server.updateExpandedState==null)return;let h=r.getItemId(l);r.$server.updateExpandedState(h,d)};r.expandItem=function(l){G(l,!0),le.prototype.expandItem.call(r,l)},r.collapseItem=function(l){G(l,!1),le.prototype.collapseItem.call(r,l)};const z=function(l){if(!l||!Array.isArray(l))throw"Attempted to call itemsUpdated with an invalid value: "+JSON.stringify(l);let d=Array.from(r.detailsOpenedItems),h=!1;for(let u=0;u<l.length;++u){const m=l[u];m&&(m.detailsOpened?r._getItemIndexInArray(m,d)<0&&d.push(m):r._getItemIndexInArray(m,d)>=0&&d.splice(r._getItemIndexInArray(m,d),1),A[m.key]&&(A[m.key]=m,m.selected=!0,h=!0))}r.detailsOpenedItems=d,h&&r.selectedItems.splice(0,r.selectedItems.length,...Object.values(A))},D=function(l,d=f){const h=e[d][l],u=Z(d);let m=d===f?s.rootCache:s.getItemSubCache(u);return m&&!m.pendingRequests[l]&&m.setPage(l,h||Array.from({length:r.pageSize})),h},ce=function(){xe(),r.__updateVisibleRows()},xe=function(){s.recalculateFlatSize(),r._flatSize=s.flatSize},ue=function(l){if(!l||!r.$||r.$.items.childElementCount===0)return;const d=l.map(u=>u.key),h=r._getRenderedRows().filter(u=>u._item&&d.includes(u._item.key)).map(u=>u.index);h.length>0&&r.__updateVisibleRows(h[0],h[h.length-1])};r.$connector.set=function(l,d,h){if(l%r.pageSize!=0)throw"Got new data to index "+l+" which is not aligned with the page size of "+r.pageSize;let u=h||f;const m=l/r.pageSize,b=Math.ceil(d.length/r.pageSize);u===f&&(w=[m,m+b-1]);for(let v=0;v<b;v++){let C=m+v,I=d.slice(v*r.pageSize,(v+1)*r.pageSize);e[u]||(e[u]={}),e[u][C]=I,r.$connector.doSelection(I.filter(F=>F.selected)),r.$connector.doDeselection(I.filter(F=>!F.selected&&A[F.key]));const x=D(C,u);x&&(z(x),ue(x))}};const De=function(l){let d=l.parentUniqueKey||f;if(e[d]){for(let h in e[d])for(let u in e[d][h])if(r.getItemId(e[d][h][u])===r.getItemId(l))return{page:h,index:u,parentKey:d}}return null};r.$connector.updateHierarchicalData=function(l){let d=[];for(let u=0;u<l.length;u++){let m=De(l[u]);if(m){e[m.parentKey][m.page][m.index]=l[u];let b=m.parentKey+":"+m.page;d[b]||(d[b]={parentKey:m.parentKey,page:m.page})}}let h=Object.keys(d);for(let u=0;u<h.length;u++){let m=d[h[u]];const b=D(m.page,m.parentKey);b&&(z(b),ue(b))}},r.$connector.updateFlatData=function(l){for(let d=0;d<l.length;d++){let h=De(l[d]);if(h){e[h.parentKey][h.page][h.index]=l[d];const u=parseInt(h.page)*r.pageSize+parseInt(h.index),{rootCache:m}=s;m.items[u]&&(m.items[u]=l[d])}}z(l),ue(l)},r.$connector.clearExpanded=function(){r.expandedItems=[],a=[],o=[]};const pt=function(){const l=g[f];if(!l||!y)return;const d=y[1]-y[0]+1,h=Array.from({length:d},(u,m)=>y[0]+m);if(w){const[u,m]=w;for(let b=u;b<=m;b++){const v=h.indexOf(b);v>=0&&h.splice(v,1)}}h.some(u=>u>=l[0]&&u<=l[1])&&(l[0]=-1,l[1]=-1)};r.$connector.clear=function(l,d,h){let u=h||f;if(!e[u]||Object.keys(e[u]).length===0)return;if(l%r.pageSize!=0)throw"Got cleared data for index "+l+" which is not aligned with the page size of "+r.pageSize;let m=Math.floor(l/r.pageSize),b=Math.ceil(d/r.pageSize);u===f&&(y=[m,m+b-1]);for(let I=0;I<b;I++){let x=m+I,F=e[u][x];r.$connector.doDeselection(F.filter(M=>A[M.key])),F.forEach(M=>r.closeItemDetails(M)),delete e[u][x],D(x,h),ue(F)}let v=s.rootCache;if(h){const I=Z(u);v=s.getItemSubCache(I)}const C=l+b*r.pageSize;for(let I=l;I<C;I++)delete v.items[I],v.removeSubCache(I);xe()},r.$connector.reset=function(){r.size=0,e={},s.rootCache.items=[],g={}
1871,c&&c.cancel(),n&&n.cancel(),_&&_.cancel(),c=void 0,n=void 0,a=[],o=[],ce()},r.$connector.updateSize=l=>r.size=l,r.$connector.updateUniqueItemIdPath=l=>r.itemIdPath=l,r.$connector.expandItems=function(l){let d=Array.from(r.expandedItems);l.filter(h=>!r._isExpanded(h)).forEach(h=>d.push(h)),r.expandedItems=d},r.$connector.collapseItems=function(l){let d=Array.from(r.expandedItems);l.forEach(h=>{let u=r._getItemIndexInArray(h,d);u>=0&&d.splice(u,1)}),r.expandedItems=d,l.forEach(h=>r.$connector.removeFromQueue(h))},r.$connector.removeFromQueue=function(l){const d=s.getItemSubCache(l);Object.values((d==null?void 0:d.pendingRequests)||{}).forEach(u=>u([]));const h=r.getItemId(l);a=a.filter(u=>u.itemkey!==h),o=o.filter(u=>u.parentKey!==h)},r.$connector.confirmParent=function(l,d,h){e[d]||(e[d]={});const u=e[d].size!==h;e[d].size=h,h===0&&(e[d][0]=[]);const m=Z(d),b=s.getItemSubCache(m);if(b){const{pendingRequests:v}=b;Object.entries(v).forEach(([C,I])=>{let x=g[d]||[0,0];if(e[d]&&e[d][C]||C<x[0]||C>x[1]){let F=e[d][C]||new Array(h);I(F,h)}else I&&h===0&&I([],h)}),u&&Object.keys(v).length===0&&(b.size=h,xe())}r.$server.confirmParentUpdate(l,d)},r.$connector.confirm=function(l){const{pendingRequests:d}=s.rootCache;Object.entries(d).forEach(([h,u])=>{var C;const m=g[f]||[0,0],b=r.size?Math.ceil(r.size/r.pageSize)-1:0,v=Math.min(m[1],b);(C=e[f])!=null&&C[h]?u(e[f][h]):h<m[0]||+h>v?(u(new Array(r.pageSize)),r.requestContentUpdate()):u&&r.size===0&&u([])}),pt(),w=null,y=null,r.$server.confirmUpdate(l)},r.$connector.ensureHierarchy=function(){for(let l in e)l!==f&&delete e[l];g={},s.rootCache.removeSubCaches(),ce()},r.$connector.setSelectionMode=function(l){if((typeof l=="string"||l instanceof String)&&S.indexOf(l)>=0)R=l,A={},r.selectedItems=[],r.$connector.updateMultiSelectable();else throw"Attempted to set an invalid selection mode"},r.$connector.updateMultiSelectable=function(){r.$&&(R===S[0]?r.$.table.setAttribute("aria-multiselectable",!1):R===S[1]?r.$.table.removeAttribute("aria-multiselectable"):r.$.table.setAttribute("aria-multiselectable",!0))},r._createPropertyObserver("isAttached",()=>r.$connector.updateMultiSelectable());const Me=l=>d=>{l&&(l(d),l=null)};r.$connector.setHeaderRenderer=function(l,d){const{content:h,showSorter:u,sorterPath:m}=d;if(h===null){l.headerRenderer=null;return}l.headerRenderer=Me(b=>{b.innerHTML="";let v=b;if(u){const C=document.createElement("vaadin-grid-sorter");C.setAttribute("path",m);const I=h instanceof Node?h.textContent:h;I&&C.setAttribute("aria-label",`Sort by ${I}`),b.appendChild(C),v=C}h instanceof Node?v.appendChild(h):v.textContent=h})},r._getActiveSorters=function(){return this._sorters.filter(l=>l.direction)},r.__applySorters=()=>{const l=r._mapSorters(),d=JSON.stringify(r._previousSorters)!==JSON.stringify(l);r._previousSorters=l,le.prototype.__applySorters.call(r),d&&!L&&r.$server.sortersChanged(l)},r.$connector.setFooterRenderer=function(l,d){const{content:h}=d;if(h===null){l.footerRenderer=null;return}l.footerRenderer=Me(u=>{u.innerHTML="",h instanceof Node?u.appendChild(h):u.textContent=h})},r.addEventListener("vaadin-context-menu-before-open",function(l){const{key:d,columnId:h}=l.detail;r.$server.updateContextMenuTargetItem(d,h)}),r.getContextMenuBeforeOpenDetail=function(l){var b,v;const d=l.detail.sourceEvent||l,h=r.getEventContext(d),u=((b=h.item)==null?void 0:b.key)||"",m=((v=h.column)==null?void 0:v.id)||"";return{key:u,columnId:m}},r.preventContextMenu=function(l){const d=l.type==="click",{column:h}=r.getEventContext(l);return d&&h instanceof Ee},r.addEventListener("click",l=>Le(l,"item-click")),r.addEventListener("dblclick",l=>Le(l,"item-double-click")),r.addEventListener("column-resize",l=>{r._getColumnsInOrder().filter(h=>!h.hidden).forEach(h=>{h.dispatchEvent(new CustomEvent("column-drag-resize"))}),r.dispatchEvent(new CustomEvent("column-drag-resize",{detail:{resizedColumnKey:l.detail.resizedColumn._flowId}}))}),r.addEventListener("column-reorder",l=>{const d=r._columnTree.slice(0).pop().filter(h=>h._flowId).sort((h,u)=>h._order-u._order).map(h=>h._flowId);r.dispatchEvent(new CustomEvent("column-reorder-all-columns",{detail:{columns:d}}))}),r.addEventListener("cell-focus",l=>
1871{const d=r.getEventContext(l);["header","body","footer"].indexOf(d.section)!==-1&&r.dispatchEvent(new CustomEvent("grid-cell-focus",{detail:{itemKey:d.item?d.item.key:null,internalColumnId:d.column?d.column._flowId:null,section:d.section}}))});function Le(l,d){if(l.defaultPrevented)return;const h=l.composedPath(),u=h.findIndex(C=>C.localName==="td"||C.localName==="th");if(h.slice(0,u).some(C=>ht(C)||C instanceof HTMLLabelElement))return;const b=r.getEventContext(l),v=b.section;b.item&&v!=="details"&&(l.itemKey=b.item.key,b.column&&(l.internalColumnId=b.column._flowId),r.dispatchEvent(new CustomEvent(d,{detail:l})))}r.cellClassNameGenerator=function(l,d){const h=d.item.style;if(h)return(h.row||"")+" "+(l&&h[l._flowId]||"")},r.cellPartNameGenerator=function(l,d){const h=d.item.part;if(h)return(h.row||"")+" "+(l&&h[l._flowId]||"")},r.dropFilter=l=>l.item&&!l.item.dropDisabled,r.dragFilter=l=>l.item&&!l.item.dragDisabled,r.addEventListener("grid-dragstart",l=>{r._isSelected(l.detail.draggedItems[0])?(r.__selectionDragData?Object.keys(r.__selectionDragData).forEach(d=>{l.detail.setDragData(d,r.__selectionDragData[d])}):(r.__dragDataTypes||[]).forEach(d=>{l.detail.setDragData(d,l.detail.draggedItems.map(h=>h.dragData[d]).join(` 1872`))}),r.__selectionDraggedItemsCount>1&&l.detail.setDraggedItemsCount(r.__selectionDraggedItemsCount)):(r.__dragDataTypes||[]).forEach(d=>{l.detail.setDragData(d,l.detail.draggedItems[0].dragData[d])})})};/** 1873 * @license 1874 * Copyright (c) 2016 - 2024 Vaadin Ltd. 1875 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 1876 */const ns=r=>class extends st(r){static get properties(){return{_childColumns:{value(){return this._getChildColumns(this)}},flexGrow:{type:Number,readOnly:!0,sync:!0},width:{type:String,readOnly:!0},_visibleChildColumns:Array,_colSpan:Number,_rootColumns:Array}}static get observers(){return["_groupFrozenChanged(frozen, _rootColumns)","_groupFrozenToEndChanged(frozenToEnd, _rootColumns)","_groupHiddenChanged(hidden)","_colSpanChanged(_colSpan, _headerCell, _footerCell)","_groupOrderChanged(_order, _rootColumns)","_groupReorderStatusChanged(_reorderStatus, _rootColumns)","_groupResizableChanged(resizable, _rootColumns)"]}connectedCallback(){super.connectedCallback(),this._addNodeObserver(),this._updateFlexAndWidth()}disconnectedCallback(){super.disconnectedCallback(),this._observer&&this._observer.disconnect()}_columnPropChanged(s,e){s==="hidden"&&(this._preventHiddenSynchronization=!0,this._updateVisibleChildColumns(this._childColumns),this._preventHiddenSynchronization=!1),/flexGrow|width|hidden|_childColumns/u.test(s)&&this._updateFlexAndWidth(),s==="frozen"&&!this.frozen&&(this.frozen=e),s==="lastFrozen"&&!this._lastFrozen&&(this._lastFrozen=e),s==="frozenToEnd"&&!this.frozenToEnd&&(this.frozenToEnd=e),s==="firstFrozenToEnd"&&!this._firstFrozenToEnd&&(this._firstFrozenToEnd=e)}_groupOrderChanged(s,e){if(e){const t=e.slice(0);if(!s){t.forEach(a=>{a._order=0});return}const i=/(0+)$/u.exec(s).pop().length,o=~~(Math.log(e.length)/Math.LN10)+1,n=10**(i-o);t[0]&&t[0]._order&&t.sort((a,c)=>a._order-c._order),it(t,n,s)}}_groupReorderStatusChanged(s,e){s===void 0||e===void 0||e.forEach(t=>{t._reorderStatus=s})}_groupResizableChanged(s,e){s===void 0||e===void 0||e.forEach(t=>{t.resizable=s})}_updateVisibleChildColumns(s){this._visibleChildColumns=Array.prototype.filter.call(s,e=>!e.hidden),this._colSpan=this._visibleChildColumns.length,this._updateAutoHidden()}_updateFlexAndWidth(){if(this._visibleChildColumns){if(this._visibleChildColumns.length>0){const s=this._visibleChildColumns.reduce((e,t)=>(e+=` + ${(t.width||"0px").replace("calc","")}`,e),"").substring(3);this._setWidth(`calc(${s})`)}else this._setWidth("0px");this._setFlexGrow(Array.prototype.reduce.call(this._visibleChildColumns,(s,e)=>s+e.flexGrow,0))}}__scheduleAutoFreezeWarning(s,e){if(this._grid){const t=e.replace(/([A-Z])/gu,"-$1").toLowerCase(),i=s[0][e]||s[0].hasAttribute(t);s.every(n=>(n[e]||n.hasAttribute(t))===i)||(this._grid.__autoFreezeWarningDebouncer=E.debounce(this._grid.__autoFreezeWarningDebouncer,H,()=>{console.warn(`WARNING: Joining ${e} and non-${e} Grid columns inside the same column group! This will automatically freeze all the joined columns to avoid rendering issues. If this was intentional, consider marking each joined column explicitly as ${e}. Otherwise, exclude the ${e} columns from the joined group.`)}))}}_groupFrozenChanged(s,e){e===void 0||s===void 0||s!==!1&&(this.__scheduleAutoFreezeWarning(e,"frozen"),Array.from(e).forEach(t=>{t.frozen=s}))}_groupFrozenToEndChanged(s,e){e===void 0||s===void 0||s!==!1&&(this.__scheduleAutoFreezeWarning(e,"frozenToEnd"),Array.from(e).forEach(t=>{t.frozenToEnd=s}))}_groupHiddenChanged(s){(s||this.__groupHiddenInitialized)&&this._synchronizeHidden(),this.__groupHiddenInitialized=!0}_updateAutoHidden(){const s=this._autoHidden;this._autoHidden=(this._visibleChildColumns||[]).length===0,(s||this._autoHidden
1876)&&(this.hidden=this._autoHidden)}_synchronizeHidden(){this._childColumns&&!this._preventHiddenSynchronization&&this._childColumns.forEach(s=>{s.hidden=this.hidden})}_colSpanChanged(s,e,t){e&&(e.setAttribute("colspan",s),this._grid&&this._grid._a11yUpdateCellColspan(e,s)),t&&(t.setAttribute("colspan",s),this._grid&&this._grid._a11yUpdateCellColspan(t,s))}_getChildColumns(s){return U.getColumns(s)}_addNodeObserver(){this._observer=new U(this,()=>{this._preventHiddenSynchronization=!0,this._rootColumns=this._getChildColumns(this),this._childColumns=this._rootColumns,this._updateVisibleChildColumns(this._childColumns),this._preventHiddenSynchronization=!1,this._grid&&this._grid._debounceUpdateColumnTree&&this._grid._debounceUpdateColumnTree()}),this._observer.flush()}_isColumnElement(s){return s.nodeType===Node.ELEMENT_NODE&&/\bcolumn\b/u.test(s.localName)}};/** 1877 * @license 1878 * Copyright (c) 2016 - 2024 Vaadin Ltd. 1879 * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ 1880 */class as extends ns(N){static get is(){return"vaadin-grid-column-group"}}V(as);/** 1881 * @license 1882 * Copyright 2020 Google LLC 1883 * SPDX-License-Identifier: BSD-3-Clause 1884 */const ls=Ut(class extends Kt{constructor(r){if(super(r),r.type!==J.PROPERTY&&r.type!==J.ATTRIBUTE&&r.type!==J.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Gt(r))throw Error("`live` bindings can only contain a single expression")}render(r){return r}update(r,[s]){if(s===_e||s===jt)return s;const e=r.element,t=r.name;if(r.type===J.PROPERTY){if(s===e[t])return _e}else if(r.type===J.BOOLEAN_ATTRIBUTE){if(!!s===e.hasAttribute(t))return _e}else if(r.type===J.ATTRIBUTE&&e.getAttribute(t)===s+"")return _e;return Wt(r),s}}),ye=window;ye.Vaadin=ye.Vaadin||{};ye.Vaadin.setLitRenderer=(r,s,e,t,i,o,n)=>{const a=f=>i.map(y=>(...w)=>{f!==void 0&&t(y,f,w[0]instanceof Event?[]:[...w])}),c=["html","root","live","appId","itemKey","model","item","index",...i,`return html\`${e}\``],p=new Function(...c),_=(f,y,w)=>{const{item:S,index:A}=y;Yt(p(Qt,f,ls,n,w,y,S,A,...a(w)),f)},g=(f,y,w)=>{const{item:S}=w;f.__litRenderer!==g&&(f.innerHTML="",delete f._$litPart$,f.__litRenderer=g);const A={};for(const R in S)R.startsWith(o)&&(A[R.replace(o,"")]=S[R]);_(f,{...w,item:A},S.key)};g.__rendererId=o,r[s]=g};ye.Vaadin.unsetLitRenderer=(r,s,e)=>{var t;((t=r[s])==null?void 0:t.__rendererId)===e&&(r[s]=void 0)};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.