@timlassiter11/yatl 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,15 @@
1
- "use strict";var yatl=(()=>{var Se=Object.defineProperty;var ht=Object.getOwnPropertyDescriptor;var oi=Object.getOwnPropertyNames;var li=Object.prototype.hasOwnProperty;var Fe=(s,t)=>()=>(s&&(t=s(s=0)),t);var dt=(s,t)=>{for(var e in t)Se(s,e,{get:t[e],enumerable:!0})},ai=(s,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of oi(t))!li.call(s,r)&&r!==e&&Se(s,r,{get:()=>t[r],enumerable:!(i=ht(t,r))||i.enumerable});return s};var ci=s=>ai(Se({},"__esModule",{value:!0}),s),_=(s,t,e,i)=>{for(var r=i>1?void 0:i?ht(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&Se(t,e,r),r};var ye,Bt=Fe(()=>{"use strict";ye=class{constructor(t){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,t?.roundAverageSize===!0&&(this._roundAverageSize=!0)}set(t,e){let i=this._map.get(t)||0;this._map.set(t,e),this.totalSize+=e-i}get averageSize(){if(this._map.size>0){let t=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(t):t}return 0}getSize(t){return this._map.get(t)}clear(){this._map.clear(),this.totalSize=0}}});function st(s){return s==="horizontal"?"width":"height"}var Ve,Kt=Fe(()=>{"use strict";Ve=class{_getDefaultConfig(){return{direction:"vertical"}}constructor(t,e){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=t,Promise.resolve().then(()=>this.config=e||this._getDefaultConfig())}set config(t){Object.assign(this,Object.assign({},this._getDefaultConfig(),t))}get config(){return{direction:this.direction}}get items(){return this._items}set items(t){this._setItems(t)}_setItems(t){t!==this._items&&(this._items=t,this._scheduleReflow())}get direction(){return this._direction}set direction(t){t=t==="horizontal"?t:"vertical",t!==this._direction&&(this._direction=t,this._sizeDim=t==="horizontal"?"width":"height",this._secondarySizeDim=t==="horizontal"?"height":"width",this._positionDim=t==="horizontal"?"left":"top",this._secondaryPositionDim=t==="horizontal"?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(t){let{_viewDim1:e,_viewDim2:i}=this;Object.assign(this._viewportSize,t),i!==this._viewDim2?this._scheduleLayoutUpdate():e!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(t){Object.assign(this._latestCoords,t);let e=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim],Math.abs(e-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(t=!1){(t||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(t){this._pin=t,this._triggerReflow()}get pin(){if(this._pin!==null){let{index:t,block:e}=this._pin;return{index:Math.max(0,Math.min(t,this.items.length-1)),block:e}}return null}_clampScrollPosition(t){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(t,this.totalScrollSize[st(this.direction)]-this._viewDim1))}unpin(){this._pin!==null&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then(()=>this.reflowIfNeeded())}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(this.pin!==null){let t=this._scrollPosition,{index:e,block:i}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:e,block:i||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=t-this._scrollPosition}}_calculateScrollIntoViewPosition(t){let{block:e}=t,i=Math.min(this.items.length,Math.max(0,t.index)),r=this._getItemPosition(i)[this._positionDim],n=r;if(e!=="start"){let o=this._getItemSize(i)[this._sizeDim];if(e==="center")n=r-.5*this._viewDim1+.5*o;else{let l=r-this._viewDim1+o;if(e==="end")n=l;else{let a=this._scrollPosition;n=Math.abs(a-r)<Math.abs(a-l)?r:l}}}return n+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(n)}getScrollIntoViewCoordinates(t){return{[this._positionDim]:this._calculateScrollIntoViewPosition(t)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){let t=new Map;if(this._first!==-1&&this._last!==-1)for(let i=this._first;i<=this._last;i++)t.set(i,this._getItemPosition(i));let e={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:t};this._scrollError&&(e.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(e)}get _num(){return this._first===-1||this._last===-1?0:this._last-this._first+1}_checkThresholds(){if(this._viewDim1===0&&this._num>0||this._pin!==null)this._scheduleReflow();else{let t=Math.max(0,this._scrollPosition-this._overhang),e=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>t||this._physicalMax<e?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(t){if(this._first===-1||this._last===-1)return;let e=this._first;for(;e<this._last&&Math.round(this._getItemPosition(e)[this._positionDim]+this._getItemSize(e)[this._sizeDim])<=Math.round(this._scrollPosition);)e++;let i=this._last;for(;i>this._first&&Math.round(this._getItemPosition(i)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)i--;(e!==this._firstVisible||i!==this._lastVisible)&&(this._firstVisible=e,this._lastVisible=i,t&&t.emit&&this._sendVisibilityChangedMessage())}}});var Qt={};dt(Qt,{FlowLayout:()=>Le,flow:()=>Ii});function Wt(s){return s==="horizontal"?"marginLeft":"marginTop"}function Oi(s){return s==="horizontal"?"marginRight":"marginBottom"}function ki(s){return s==="horizontal"?"xOffset":"yOffset"}function Ni(s,t){let e=[s,t].sort();return e[1]<=0?Math.min(...e):e[0]>=0?Math.max(...e):e[0]+e[1]}var Ii,nt,Le,Yt=Fe(()=>{"use strict";Bt();Kt();Ii=s=>Object.assign({type:Le},s);nt=class{constructor(){this._childSizeCache=new ye,this._marginSizeCache=new ye,this._metricsCache=new Map}update(t,e){let i=new Set;Object.keys(t).forEach(r=>{let n=Number(r);this._metricsCache.set(n,t[n]),this._childSizeCache.set(n,t[n][st(e)]),i.add(n),i.add(n+1)});for(let r of i){let n=this._metricsCache.get(r)?.[Wt(e)]||0,o=this._metricsCache.get(r-1)?.[Oi(e)]||0;this._marginSizeCache.set(r,Ni(n,o))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(t,e){return this._metricsCache.get(t)?.[Wt(e)]||0}getChildSize(t){return this._childSizeCache.getSize(t)}getMarginSize(t){return this._marginSizeCache.getSize(t)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}},Le=class extends Ve{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new nt,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(t){this._metricsCache.update(t,this.direction),this._scheduleReflow()}_getPhysicalItem(t){return this._newPhysicalItems.get(t)??this._physicalItems.get(t)}_getSize(t){return this._getPhysicalItem(t)&&this._metricsCache.getChildSize(t)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(t){let e=this._metricsCache;if(this._first===-1||this._last===-1)return e.averageMarginSize+t*(e.averageMarginSize+this._getAverageSize());if(t<this._first){let i=this._first-t;return this._getPhysicalItem(this._first).pos-(e.getMarginSize(this._first-1)||e.averageMarginSize)-(i*e.averageChildSize+(i-1)*e.averageMarginSize)}else{let i=t-this._last;return this._getPhysicalItem(this._last).pos+(e.getChildSize(this._last)||e.averageChildSize)+(e.getMarginSize(this._last)||e.averageMarginSize)+i*(e.averageChildSize+e.averageMarginSize)}}_getPosition(t){let e=this._getPhysicalItem(t),{averageMarginSize:i}=this._metricsCache;return t===0?this._metricsCache.getMarginSize(0)??i:e?e.pos:this._estimatePosition(t)}_calculateAnchor(t,e){return t<=0?0:e>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((t+e)/2/this._delta)))}_getAnchor(t,e){if(this._physicalItems.size===0)return this._calculateAnchor(t,e);if(this._first<0)return this._calculateAnchor(t,e);if(this._last<0)return this._calculateAnchor(t,e);let i=this._getPhysicalItem(this._first),r=this._getPhysicalItem(this._last),n=i.pos;if(r.pos+this._metricsCache.getChildSize(this._last)<t)return this._calculateAnchor(t,e);if(n>e)return this._calculateAnchor(t,e);let a=this._firstVisible-1,c=-1/0;for(;c<t;)c=this._getPhysicalItem(++a).pos+this._metricsCache.getChildSize(a);return a}_getActiveItems(){this._viewDim1===0||this.items.length===0?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;let t=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=t,this._stable=!0}_getItems(){let t=this._newPhysicalItems;this._stable=!0;let e,i;if(this.pin!==null){let{index:c}=this.pin;this._anchorIdx=c,this._anchorPos=this._getPosition(c)}if(e=this._scrollPosition-this._overhang,i=this._scrollPosition+this._viewDim1+this._overhang,i<0||e>this._scrollSize){this._clearItems();return}(this._anchorIdx===null||this._anchorPos===null)&&(this._anchorIdx=this._getAnchor(e,i),this._anchorPos=this._getPosition(this._anchorIdx));let r=this._getSize(this._anchorIdx);r===void 0&&(this._stable=!1,r=this._getAverageSize());let n=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,o=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;this._anchorIdx===0&&(this._anchorPos=n),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-o-r);let l=0;for(this._anchorPos+r+o<e&&(l=e-(this._anchorPos+r+o)),this._anchorPos-n>i&&(l=i-(this._anchorPos-n)),l&&(this._scrollPosition-=l,e-=l,i-=l,this._scrollError+=l),t.set(this._anchorIdx,{pos:this._anchorPos,size:r}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-n,this._physicalMax=this._anchorPos+r+o;this._physicalMin>e&&this._first>0;){let c=this._getSize(--this._first);c===void 0&&(this._stable=!1,c=this._getAverageSize());let d=this._metricsCache.getMarginSize(this._first);d===void 0&&(this._stable=!1,d=this._metricsCache.averageMarginSize),this._physicalMin-=c;let h=this._physicalMin;if(t.set(this._first,{pos:h,size:c}),this._physicalMin-=d,this._stable===!1&&this._estimate===!1)break}for(;this._physicalMax<i&&this._last<this.items.length-1;){let c=this._getSize(++this._last);c===void 0&&(this._stable=!1,c=this._getAverageSize());let d=this._metricsCache.getMarginSize(this._last);d===void 0&&(this._stable=!1,d=this._metricsCache.averageMarginSize);let h=this._physicalMax;if(t.set(this._last,{pos:h,size:c}),this._physicalMax+=c+d,!this._stable&&!this._estimate)break}let a=this._calculateError();a&&(this._physicalMin-=a,this._physicalMax-=a,this._anchorPos-=a,this._scrollPosition-=a,t.forEach(c=>c.pos-=a),this._scrollError+=a),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=t)}_calculateError(){return this._first===0?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){let{_first:t,_last:e}=this;super._reflow(),(this._first===-1&&this._last==-1||this._first===t&&this._last===e)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){let{averageMarginSize:t}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(t+this._getAverageSize())+t)}get _delta(){let{averageMarginSize:t}=this._metricsCache;return this._getAverageSize()+t}_getItemPosition(t){return{[this._positionDim]:this._getPosition(t),[this._secondaryPositionDim]:0,[ki(this.direction)]:-(this._metricsCache.getLeadingMarginValue(t,this.direction)??this._metricsCache.averageMarginSize)}}_getItemSize(t){return{[this._sizeDim]:this._getSize(t)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}});var Hi={};dt(Hi,{TypedEventTarget:()=>le,YatlColumnReorderEvent:()=>te,YatlColumnReorderRequest:()=>ee,YatlColumnResizeEvent:()=>Z,YatlColumnSortEvent:()=>X,YatlColumnSortRequest:()=>G,YatlColumnToggleEvent:()=>J,YatlEvent:()=>v,YatlRowClickEvent:()=>W,YatlRowSelectEvent:()=>Y,YatlRowSelectRequest:()=>Q,YatlTable:()=>f,YatlTableController:()=>we,YatlTableSearchEvent:()=>ie,YatlTableStateChangeEvent:()=>se,YatlTableViewChangeEvent:()=>re,createRegexTokenizer:()=>pt,createState:()=>O,findColumn:()=>hi,getColumnStateChanges:()=>ne,getNestedValue:()=>S,isDisplayColumn:()=>M,isInternalColumn:()=>di,isRowIdType:()=>oe,isRowSelectionMethod:()=>qe,setNestedValue:()=>ui,whitespaceTokenizer:()=>Be});var v=class extends Event{constructor(t,e={}){super(t,{bubbles:!0,composed:!0,cancelable:!1,...e})}},W=class s extends v{constructor(e,i,r,n,o){super(s.EVENT_NAME);this.row=e;this.rowId=i;this.index=r;this.field=n;this.originalEvent=o}static{this.EVENT_NAME="yatl-row-click"}clone(){return new s(this.row,this.rowId,this.index,this.field,this.originalEvent)}},Q=class s extends v{constructor(e,i,r){super(s.EVENT_NAME,{cancelable:!0});this.rowId=e;this.selected=i;this.currentlySelectedRows=r}static{this.EVENT_NAME="yatl-row-select-request"}clone(){return new s(this.rowId,this.selected,this.currentlySelectedRows)}},Y=class s extends v{constructor(e,i){super(s.EVENT_NAME);this.selectedIds=e;this.previouslySelectedRows=i}static{this.EVENT_NAME="yatl-row-select"}clone(){return new s(this.selectedIds,this.previouslySelectedRows)}},G=class s extends v{constructor(e,i,r){super(s.EVENT_NAME,{cancelable:!0});this.field=e;this.order=i;this.multisort=r}static{this.EVENT_NAME="yatl-column-sort-request"}clone(){return new s(this.field,this.order,this.multisort)}},X=class s extends v{constructor(e,i,r){super(s.EVENT_NAME);this.field=e;this.order=i;this.multisort=r}static{this.EVENT_NAME="yatl-column-sort"}clone(){return new s(this.field,this.order,this.multisort)}},J=class s extends v{constructor(e,i){super(s.EVENT_NAME);this.field=e;this.visible=i}static{this.EVENT_NAME="yatl-column-toggle"}clone(){return new s(this.field,this.visible)}},Z=class s extends v{constructor(e,i){super(s.EVENT_NAME);this.field=e;this.width=i}static{this.EVENT_NAME="yatl-column-resize"}clone(){return new s(this.field,this.width)}},ee=class s extends v{constructor(e,i,r){super(s.EVENT_NAME,{cancelable:!0});this.movedColumn=e;this.originalIndex=i;this.newIndex=r}static{this.EVENT_NAME="yatl-column-reorder-request"}clone(){return new s(this.movedColumn,this.originalIndex,this.newIndex)}},te=class s extends v{constructor(e){super(s.EVENT_NAME);this.order=e}static{this.EVENT_NAME="yatl-column-reorder"}clone(){return new s(this.order)}},ie=class s extends v{constructor(e){super(s.EVENT_NAME);this.query=e}static{this.EVENT_NAME="yatl-table-search"}clone(){return new s(this.query)}},re=class s extends v{constructor(e){super(s.EVENT_NAME);this.data=e}static{this.EVENT_NAME="yatl-table-view-change"}clone(){return new s(this.data)}},se=class s extends v{constructor(e,i){super(s.EVENT_NAME);this.state=e;this.triggers=i}static{this.EVENT_NAME="yatl-table-state-change"}clone(){return new s(this.state,this.triggers)}};function hi(s,t){return s.find(e=>e.field===t)}function di(s){return s?.role==="internal"}function M(s){return s?.role!=="internal"}function O(s,t){return{field:s,visible:t?.visible??!0,width:t?.width??null,sort:t?.sort?{...t.sort}:null}}function ne(s,t){if(s&&s.field!==t.field)throw Error(`attempting to compare states for different fields: ${s.field}, ${t.field}`);let e=[];return s?.visible!==t.visible&&e.push("visible"),s?.width!==t.width&&e.push("width"),(s?.sort!==t.sort||s.sort?.order!==t.sort?.order||s.sort?.priority!==t.sort?.priority)&&e.push("sort"),e}function oe(s){return typeof s=="string"||typeof s=="number"}function qe(s){return s===null||s==="multi"||s==="single"}function ut(s,t){return s in t}function S(s,t){let e=t.split("."),i=s;for(let r of e)if(i&&ut(r,i))i=i[r];else return;return i}function ui(s,t,e){let i=t.split("."),r=i.at(-1);if(!r)throw new Error("Cannot set nested value with empty path");let n=s;for(let o of i.slice(0,-1))if(ut(o,n))n=n[o];else{let l={};Object.assign(n,{[o]:l}),n=l}Object.assign(n,{[r]:e})}var pt=(s="\\S+")=>{let t=new RegExp(`"[^"]*"|${s}`,"g");return e=>(e.match(t)||[]).map(r=>(r=r.toLocaleLowerCase().trim(),r.startsWith('"')&&r.endsWith('"')?{value:r.slice(1,-1),quoted:!0}:{value:r,quoted:!1}))},Be=pt();var le=class extends EventTarget{addEventListener(t,e,i){super.addEventListener(t,e,i)}removeEventListener(t,e,i){super.removeEventListener(t,e,i)}dispatchEvent(t){return super.dispatchEvent(t)}};var Ce=globalThis,Ee=Ce.ShadowRoot&&(Ce.ShadyCSS===void 0||Ce.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ke=Symbol(),ft=new WeakMap,ae=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==Ke)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(Ee&&t===void 0){let i=e!==void 0&&e.length===1;i&&(t=ft.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&ft.set(e,t))}return t}toString(){return this.cssText}},mt=s=>new ae(typeof s=="string"?s:s+"",void 0,Ke),We=(s,...t)=>{let e=s.length===1?s[0]:t.reduce((i,r,n)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+s[n+1],s[0]);return new ae(e,s,Ke)},_t=(s,t)=>{if(Ee)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let i=document.createElement("style"),r=Ce.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},Qe=Ee?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(let i of t.cssRules)e+=i.cssText;return mt(e)})(s):s;var{is:pi,defineProperty:fi,getOwnPropertyDescriptor:mi,getOwnPropertyNames:_i,getOwnPropertySymbols:gi,getPrototypeOf:bi}=Object,Te=globalThis,gt=Te.trustedTypes,yi=gt?gt.emptyScript:"",vi=Te.reactiveElementPolyfillSupport,ce=(s,t)=>s,he={toAttribute(s,t){switch(t){case Boolean:s=s?yi:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},xe=(s,t)=>!pi(s,t),bt={attribute:!0,type:String,converter:he,reflect:!1,useDefault:!1,hasChanged:xe};Symbol.metadata??=Symbol("metadata"),Te.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=bt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let i=Symbol(),r=this.getPropertyDescriptor(t,i,e);r!==void 0&&fi(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){let{get:r,set:n}=mi(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get:r,set(o){let l=r?.call(this);n?.call(this,o),this.requestUpdate(t,l,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??bt}static _$Ei(){if(this.hasOwnProperty(ce("elementProperties")))return;let t=bi(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(ce("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ce("properties"))){let e=this.properties,i=[..._i(e),...gi(e)];for(let r of i)this.createProperty(r,e[r])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[i,r]of e)this.elementProperties.set(i,r)}this._$Eh=new Map;for(let[e,i]of this.elementProperties){let r=this._$Eu(e,i);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let r of i)e.unshift(Qe(r))}else t!==void 0&&e.push(Qe(t));return e}static _$Eu(t,e){let i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return _t(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){let i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(r!==void 0&&i.reflect===!0){let n=(i.converter?.toAttribute!==void 0?i.converter:he).toAttribute(e,i.type);this._$Em=t,n==null?this.removeAttribute(r):this.setAttribute(r,n),this._$Em=null}}_$AK(t,e){let i=this.constructor,r=i._$Eh.get(t);if(r!==void 0&&this._$Em!==r){let n=i.getPropertyOptions(r),o=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:he;this._$Em=r;let l=o.fromAttribute(e,n.type);this[r]=l??this._$Ej?.get(r)??l,this._$Em=null}}requestUpdate(t,e,i,r=!1,n){if(t!==void 0){let o=this.constructor;if(r===!1&&(n=this[t]),i??=o.getPropertyOptions(t),!((i.hasChanged??xe)(n,e)||i.useDefault&&i.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,i))))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:r,wrapped:n},o){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??e??this[t]),n!==!0||o!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),r===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[r,n]of this._$Ep)this[r]=n;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[r,n]of i){let{wrapped:o}=n,l=this[r];o!==!0||this._$AL.has(r)||l===void 0||this.C(r,void 0,n,l)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(e)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[ce("elementProperties")]=new Map,$[ce("finalized")]=new Map,vi?.({ReactiveElement:$}),(Te.reactiveElementVersions??=[]).push("2.1.2");var Ge=globalThis,yt=s=>s,Re=Ge.trustedTypes,vt=Re?Re.createPolicy("lit-html",{createHTML:s=>s}):void 0,Xe="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,Je="?"+A,wi=`<${Je}>`,D=document,ue=()=>D.createComment(""),pe=s=>s===null||typeof s!="object"&&typeof s!="function",Ze=Array.isArray,xt=s=>Ze(s)||typeof s?.[Symbol.iterator]=="function",Ye=`[
1
+ "use strict";var yatl=(()=>{var Se=Object.defineProperty;var ht=Object.getOwnPropertyDescriptor;var ni=Object.getOwnPropertyNames;var li=Object.prototype.hasOwnProperty;var Fe=(s,t)=>()=>(s&&(t=s(s=0)),t);var dt=(s,t)=>{for(var e in t)Se(s,e,{get:t[e],enumerable:!0})},ai=(s,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ni(t))!li.call(s,r)&&r!==e&&Se(s,r,{get:()=>t[r],enumerable:!(i=ht(t,r))||i.enumerable});return s};var ci=s=>ai(Se({},"__esModule",{value:!0}),s),_=(s,t,e,i)=>{for(var r=i>1?void 0:i?ht(t,e):t,o=s.length-1,n;o>=0;o--)(n=s[o])&&(r=(i?n(t,e,r):n(r))||r);return i&&r&&Se(t,e,r),r};var ye,Bt=Fe(()=>{"use strict";ye=class{constructor(t){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,t?.roundAverageSize===!0&&(this._roundAverageSize=!0)}set(t,e){let i=this._map.get(t)||0;this._map.set(t,e),this.totalSize+=e-i}get averageSize(){if(this._map.size>0){let t=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(t):t}return 0}getSize(t){return this._map.get(t)}clear(){this._map.clear(),this.totalSize=0}}});function st(s){return s==="horizontal"?"width":"height"}var Ve,Kt=Fe(()=>{"use strict";Ve=class{_getDefaultConfig(){return{direction:"vertical"}}constructor(t,e){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=t,Promise.resolve().then(()=>this.config=e||this._getDefaultConfig())}set config(t){Object.assign(this,Object.assign({},this._getDefaultConfig(),t))}get config(){return{direction:this.direction}}get items(){return this._items}set items(t){this._setItems(t)}_setItems(t){t!==this._items&&(this._items=t,this._scheduleReflow())}get direction(){return this._direction}set direction(t){t=t==="horizontal"?t:"vertical",t!==this._direction&&(this._direction=t,this._sizeDim=t==="horizontal"?"width":"height",this._secondarySizeDim=t==="horizontal"?"height":"width",this._positionDim=t==="horizontal"?"left":"top",this._secondaryPositionDim=t==="horizontal"?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(t){let{_viewDim1:e,_viewDim2:i}=this;Object.assign(this._viewportSize,t),i!==this._viewDim2?this._scheduleLayoutUpdate():e!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(t){Object.assign(this._latestCoords,t);let e=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim],Math.abs(e-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(t=!1){(t||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(t){this._pin=t,this._triggerReflow()}get pin(){if(this._pin!==null){let{index:t,block:e}=this._pin;return{index:Math.max(0,Math.min(t,this.items.length-1)),block:e}}return null}_clampScrollPosition(t){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(t,this.totalScrollSize[st(this.direction)]-this._viewDim1))}unpin(){this._pin!==null&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then(()=>this.reflowIfNeeded())}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(this.pin!==null){let t=this._scrollPosition,{index:e,block:i}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:e,block:i||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=t-this._scrollPosition}}_calculateScrollIntoViewPosition(t){let{block:e}=t,i=Math.min(this.items.length,Math.max(0,t.index)),r=this._getItemPosition(i)[this._positionDim],o=r;if(e!=="start"){let n=this._getItemSize(i)[this._sizeDim];if(e==="center")o=r-.5*this._viewDim1+.5*n;else{let l=r-this._viewDim1+n;if(e==="end")o=l;else{let a=this._scrollPosition;o=Math.abs(a-r)<Math.abs(a-l)?r:l}}}return o+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(o)}getScrollIntoViewCoordinates(t){return{[this._positionDim]:this._calculateScrollIntoViewPosition(t)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){let t=new Map;if(this._first!==-1&&this._last!==-1)for(let i=this._first;i<=this._last;i++)t.set(i,this._getItemPosition(i));let e={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:t};this._scrollError&&(e.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(e)}get _num(){return this._first===-1||this._last===-1?0:this._last-this._first+1}_checkThresholds(){if(this._viewDim1===0&&this._num>0||this._pin!==null)this._scheduleReflow();else{let t=Math.max(0,this._scrollPosition-this._overhang),e=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>t||this._physicalMax<e?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(t){if(this._first===-1||this._last===-1)return;let e=this._first;for(;e<this._last&&Math.round(this._getItemPosition(e)[this._positionDim]+this._getItemSize(e)[this._sizeDim])<=Math.round(this._scrollPosition);)e++;let i=this._last;for(;i>this._first&&Math.round(this._getItemPosition(i)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)i--;(e!==this._firstVisible||i!==this._lastVisible)&&(this._firstVisible=e,this._lastVisible=i,t&&t.emit&&this._sendVisibilityChangedMessage())}}});var Qt={};dt(Qt,{FlowLayout:()=>Le,flow:()=>Ii});function Wt(s){return s==="horizontal"?"marginLeft":"marginTop"}function Oi(s){return s==="horizontal"?"marginRight":"marginBottom"}function ki(s){return s==="horizontal"?"xOffset":"yOffset"}function Ni(s,t){let e=[s,t].sort();return e[1]<=0?Math.min(...e):e[0]>=0?Math.max(...e):e[0]+e[1]}var Ii,ot,Le,Yt=Fe(()=>{"use strict";Bt();Kt();Ii=s=>Object.assign({type:Le},s);ot=class{constructor(){this._childSizeCache=new ye,this._marginSizeCache=new ye,this._metricsCache=new Map}update(t,e){let i=new Set;Object.keys(t).forEach(r=>{let o=Number(r);this._metricsCache.set(o,t[o]),this._childSizeCache.set(o,t[o][st(e)]),i.add(o),i.add(o+1)});for(let r of i){let o=this._metricsCache.get(r)?.[Wt(e)]||0,n=this._metricsCache.get(r-1)?.[Oi(e)]||0;this._marginSizeCache.set(r,Ni(o,n))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(t,e){return this._metricsCache.get(t)?.[Wt(e)]||0}getChildSize(t){return this._childSizeCache.getSize(t)}getMarginSize(t){return this._marginSizeCache.getSize(t)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}},Le=class extends Ve{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new ot,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(t){this._metricsCache.update(t,this.direction),this._scheduleReflow()}_getPhysicalItem(t){return this._newPhysicalItems.get(t)??this._physicalItems.get(t)}_getSize(t){return this._getPhysicalItem(t)&&this._metricsCache.getChildSize(t)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(t){let e=this._metricsCache;if(this._first===-1||this._last===-1)return e.averageMarginSize+t*(e.averageMarginSize+this._getAverageSize());if(t<this._first){let i=this._first-t;return this._getPhysicalItem(this._first).pos-(e.getMarginSize(this._first-1)||e.averageMarginSize)-(i*e.averageChildSize+(i-1)*e.averageMarginSize)}else{let i=t-this._last;return this._getPhysicalItem(this._last).pos+(e.getChildSize(this._last)||e.averageChildSize)+(e.getMarginSize(this._last)||e.averageMarginSize)+i*(e.averageChildSize+e.averageMarginSize)}}_getPosition(t){let e=this._getPhysicalItem(t),{averageMarginSize:i}=this._metricsCache;return t===0?this._metricsCache.getMarginSize(0)??i:e?e.pos:this._estimatePosition(t)}_calculateAnchor(t,e){return t<=0?0:e>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((t+e)/2/this._delta)))}_getAnchor(t,e){if(this._physicalItems.size===0)return this._calculateAnchor(t,e);if(this._first<0)return this._calculateAnchor(t,e);if(this._last<0)return this._calculateAnchor(t,e);let i=this._getPhysicalItem(this._first),r=this._getPhysicalItem(this._last),o=i.pos;if(r.pos+this._metricsCache.getChildSize(this._last)<t)return this._calculateAnchor(t,e);if(o>e)return this._calculateAnchor(t,e);let a=this._firstVisible-1,c=-1/0;for(;c<t;)c=this._getPhysicalItem(++a).pos+this._metricsCache.getChildSize(a);return a}_getActiveItems(){this._viewDim1===0||this.items.length===0?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;let t=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=t,this._stable=!0}_getItems(){let t=this._newPhysicalItems;this._stable=!0;let e,i;if(this.pin!==null){let{index:c}=this.pin;this._anchorIdx=c,this._anchorPos=this._getPosition(c)}if(e=this._scrollPosition-this._overhang,i=this._scrollPosition+this._viewDim1+this._overhang,i<0||e>this._scrollSize){this._clearItems();return}(this._anchorIdx===null||this._anchorPos===null)&&(this._anchorIdx=this._getAnchor(e,i),this._anchorPos=this._getPosition(this._anchorIdx));let r=this._getSize(this._anchorIdx);r===void 0&&(this._stable=!1,r=this._getAverageSize());let o=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,n=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;this._anchorIdx===0&&(this._anchorPos=o),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-n-r);let l=0;for(this._anchorPos+r+n<e&&(l=e-(this._anchorPos+r+n)),this._anchorPos-o>i&&(l=i-(this._anchorPos-o)),l&&(this._scrollPosition-=l,e-=l,i-=l,this._scrollError+=l),t.set(this._anchorIdx,{pos:this._anchorPos,size:r}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-o,this._physicalMax=this._anchorPos+r+n;this._physicalMin>e&&this._first>0;){let c=this._getSize(--this._first);c===void 0&&(this._stable=!1,c=this._getAverageSize());let d=this._metricsCache.getMarginSize(this._first);d===void 0&&(this._stable=!1,d=this._metricsCache.averageMarginSize),this._physicalMin-=c;let h=this._physicalMin;if(t.set(this._first,{pos:h,size:c}),this._physicalMin-=d,this._stable===!1&&this._estimate===!1)break}for(;this._physicalMax<i&&this._last<this.items.length-1;){let c=this._getSize(++this._last);c===void 0&&(this._stable=!1,c=this._getAverageSize());let d=this._metricsCache.getMarginSize(this._last);d===void 0&&(this._stable=!1,d=this._metricsCache.averageMarginSize);let h=this._physicalMax;if(t.set(this._last,{pos:h,size:c}),this._physicalMax+=c+d,!this._stable&&!this._estimate)break}let a=this._calculateError();a&&(this._physicalMin-=a,this._physicalMax-=a,this._anchorPos-=a,this._scrollPosition-=a,t.forEach(c=>c.pos-=a),this._scrollError+=a),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=t)}_calculateError(){return this._first===0?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){let{_first:t,_last:e}=this;super._reflow(),(this._first===-1&&this._last==-1||this._first===t&&this._last===e)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){let{averageMarginSize:t}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(t+this._getAverageSize())+t)}get _delta(){let{averageMarginSize:t}=this._metricsCache;return this._getAverageSize()+t}_getItemPosition(t){return{[this._positionDim]:this._getPosition(t),[this._secondaryPositionDim]:0,[ki(this.direction)]:-(this._metricsCache.getLeadingMarginValue(t,this.direction)??this._metricsCache.averageMarginSize)}}_getItemSize(t){return{[this._sizeDim]:this._getSize(t)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}});var Hi={};dt(Hi,{TypedEventTarget:()=>le,YatlColumnReorderEvent:()=>te,YatlColumnReorderRequest:()=>ee,YatlColumnResizeEvent:()=>Z,YatlColumnSortEvent:()=>X,YatlColumnSortRequest:()=>G,YatlColumnToggleEvent:()=>J,YatlEvent:()=>v,YatlRowClickEvent:()=>W,YatlRowSelectEvent:()=>Y,YatlRowSelectRequest:()=>Q,YatlTable:()=>f,YatlTableController:()=>we,YatlTableSearchEvent:()=>ie,YatlTableStateChangeEvent:()=>se,YatlTableViewChangeEvent:()=>re,createRegexTokenizer:()=>pt,createState:()=>O,findColumn:()=>hi,getColumnStateChanges:()=>oe,getNestedValue:()=>S,isDisplayColumn:()=>M,isInternalColumn:()=>di,isRowIdType:()=>ne,isRowSelectionMethod:()=>qe,setNestedValue:()=>ui,whitespaceTokenizer:()=>Be});var v=class extends Event{constructor(t,e={}){super(t,{bubbles:!0,composed:!0,cancelable:!1,...e})}},W=class s extends v{constructor(e,i,r,o,n){super(s.EVENT_NAME);this.row=e;this.rowId=i;this.index=r;this.field=o;this.originalEvent=n}static{this.EVENT_NAME="yatl-row-click"}clone(){return new s(this.row,this.rowId,this.index,this.field,this.originalEvent)}},Q=class s extends v{constructor(e,i,r){super(s.EVENT_NAME,{cancelable:!0});this.rowId=e;this.selected=i;this.currentlySelectedRows=r}static{this.EVENT_NAME="yatl-row-select-request"}clone(){return new s(this.rowId,this.selected,this.currentlySelectedRows)}},Y=class s extends v{constructor(e,i){super(s.EVENT_NAME);this.selectedIds=e;this.previouslySelectedRows=i}static{this.EVENT_NAME="yatl-row-select"}clone(){return new s(this.selectedIds,this.previouslySelectedRows)}},G=class s extends v{constructor(e,i,r){super(s.EVENT_NAME,{cancelable:!0});this.field=e;this.order=i;this.multisort=r}static{this.EVENT_NAME="yatl-column-sort-request"}clone(){return new s(this.field,this.order,this.multisort)}},X=class s extends v{constructor(e,i,r){super(s.EVENT_NAME);this.field=e;this.order=i;this.multisort=r}static{this.EVENT_NAME="yatl-column-sort"}clone(){return new s(this.field,this.order,this.multisort)}},J=class s extends v{constructor(e,i){super(s.EVENT_NAME);this.field=e;this.visible=i}static{this.EVENT_NAME="yatl-column-toggle"}clone(){return new s(this.field,this.visible)}},Z=class s extends v{constructor(e,i){super(s.EVENT_NAME);this.field=e;this.width=i}static{this.EVENT_NAME="yatl-column-resize"}clone(){return new s(this.field,this.width)}},ee=class s extends v{constructor(e,i,r){super(s.EVENT_NAME,{cancelable:!0});this.movedColumn=e;this.originalIndex=i;this.newIndex=r}static{this.EVENT_NAME="yatl-column-reorder-request"}clone(){return new s(this.movedColumn,this.originalIndex,this.newIndex)}},te=class s extends v{constructor(e){super(s.EVENT_NAME);this.order=e}static{this.EVENT_NAME="yatl-column-reorder"}clone(){return new s(this.order)}},ie=class s extends v{constructor(e){super(s.EVENT_NAME);this.query=e}static{this.EVENT_NAME="yatl-table-search"}clone(){return new s(this.query)}},re=class s extends v{constructor(e){super(s.EVENT_NAME);this.data=e}static{this.EVENT_NAME="yatl-table-view-change"}clone(){return new s(this.data)}},se=class s extends v{constructor(e,i){super(s.EVENT_NAME);this.state=e;this.triggers=i}static{this.EVENT_NAME="yatl-table-state-change"}clone(){return new s(this.state,this.triggers)}};function hi(s,t){return s.find(e=>e.field===t)}function di(s){return s?.role==="internal"}function M(s){return s?.role!=="internal"}function O(s,t){return{field:s,visible:t?.visible??!0,width:t?.width??null,sort:t?.sort?{...t.sort}:null}}function oe(s,t){if(s&&s.field!==t.field)throw Error(`attempting to compare states for different fields: ${s.field}, ${t.field}`);let e=[];return s?.visible!==t.visible&&e.push("visible"),s?.width!==t.width&&e.push("width"),(s?.sort!==t.sort||s.sort?.order!==t.sort?.order||s.sort?.priority!==t.sort?.priority)&&e.push("sort"),e}function ne(s){return typeof s=="string"||typeof s=="number"}function qe(s){return s===null||s==="multi"||s==="single"}function ut(s,t){return s in t}function S(s,t){let e=t.split("."),i=s;for(let r of e)if(i&&ut(r,i))i=i[r];else return;return i}function ui(s,t,e){let i=t.split("."),r=i.at(-1);if(!r)throw new Error("Cannot set nested value with empty path");let o=s;for(let n of i.slice(0,-1))if(ut(n,o))o=o[n];else{let l={};Object.assign(o,{[n]:l}),o=l}Object.assign(o,{[r]:e})}var pt=(s="\\S+")=>{let t=new RegExp(`"[^"]*"|${s}`,"g");return e=>(e.match(t)||[]).map(r=>(r=r.toLocaleLowerCase().trim(),r.startsWith('"')&&r.endsWith('"')?{value:r.slice(1,-1),quoted:!0}:{value:r,quoted:!1}))},Be=pt();var le=class extends EventTarget{addEventListener(t,e,i){super.addEventListener(t,e,i)}removeEventListener(t,e,i){super.removeEventListener(t,e,i)}dispatchEvent(t){return super.dispatchEvent(t)}};var Ce=globalThis,Ee=Ce.ShadowRoot&&(Ce.ShadyCSS===void 0||Ce.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ke=Symbol(),ft=new WeakMap,ae=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==Ke)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(Ee&&t===void 0){let i=e!==void 0&&e.length===1;i&&(t=ft.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&ft.set(e,t))}return t}toString(){return this.cssText}},mt=s=>new ae(typeof s=="string"?s:s+"",void 0,Ke),We=(s,...t)=>{let e=s.length===1?s[0]:t.reduce((i,r,o)=>i+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+s[o+1],s[0]);return new ae(e,s,Ke)},_t=(s,t)=>{if(Ee)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let i=document.createElement("style"),r=Ce.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},Qe=Ee?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(let i of t.cssRules)e+=i.cssText;return mt(e)})(s):s;var{is:pi,defineProperty:fi,getOwnPropertyDescriptor:mi,getOwnPropertyNames:_i,getOwnPropertySymbols:gi,getPrototypeOf:bi}=Object,Te=globalThis,gt=Te.trustedTypes,yi=gt?gt.emptyScript:"",vi=Te.reactiveElementPolyfillSupport,ce=(s,t)=>s,he={toAttribute(s,t){switch(t){case Boolean:s=s?yi:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},xe=(s,t)=>!pi(s,t),bt={attribute:!0,type:String,converter:he,reflect:!1,useDefault:!1,hasChanged:xe};Symbol.metadata??=Symbol("metadata"),Te.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=bt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let i=Symbol(),r=this.getPropertyDescriptor(t,i,e);r!==void 0&&fi(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){let{get:r,set:o}=mi(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get:r,set(n){let l=r?.call(this);o?.call(this,n),this.requestUpdate(t,l,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??bt}static _$Ei(){if(this.hasOwnProperty(ce("elementProperties")))return;let t=bi(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(ce("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ce("properties"))){let e=this.properties,i=[..._i(e),...gi(e)];for(let r of i)this.createProperty(r,e[r])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[i,r]of e)this.elementProperties.set(i,r)}this._$Eh=new Map;for(let[e,i]of this.elementProperties){let r=this._$Eu(e,i);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let r of i)e.unshift(Qe(r))}else t!==void 0&&e.push(Qe(t));return e}static _$Eu(t,e){let i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return _t(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){let i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(r!==void 0&&i.reflect===!0){let o=(i.converter?.toAttribute!==void 0?i.converter:he).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){let i=this.constructor,r=i._$Eh.get(t);if(r!==void 0&&this._$Em!==r){let o=i.getPropertyOptions(r),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:he;this._$Em=r;let l=n.fromAttribute(e,o.type);this[r]=l??this._$Ej?.get(r)??l,this._$Em=null}}requestUpdate(t,e,i,r=!1,o){if(t!==void 0){let n=this.constructor;if(r===!1&&(o=this[t]),i??=n.getPropertyOptions(t),!((i.hasChanged??xe)(o,e)||i.useDefault&&i.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,i))))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:r,wrapped:o},n){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),o!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),r===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[r,o]of i){let{wrapped:n}=o,l=this[r];n!==!0||this._$AL.has(r)||l===void 0||this.C(r,void 0,o,l)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(e)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[ce("elementProperties")]=new Map,$[ce("finalized")]=new Map,vi?.({ReactiveElement:$}),(Te.reactiveElementVersions??=[]).push("2.1.2");var Ge=globalThis,yt=s=>s,Re=Ge.trustedTypes,vt=Re?Re.createPolicy("lit-html",{createHTML:s=>s}):void 0,Xe="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,Je="?"+A,wi=`<${Je}>`,D=document,ue=()=>D.createComment(""),pe=s=>s===null||typeof s!="object"&&typeof s!="function",Ze=Array.isArray,xt=s=>Ze(s)||typeof s?.[Symbol.iterator]=="function",Ye=`[
2
2
  \f\r]`,de=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,wt=/-->/g,St=/>/g,N=RegExp(`>|${Ye}(?:([^\\s"'>=/]+)(${Ye}*=${Ye}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Ct=/'/g,Et=/"/g,Rt=/^(?:script|style|textarea|title)$/i,et=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),g=et(1),Zi=et(2),er=et(3),w=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),Tt=new WeakMap,P=D.createTreeWalker(D,129);function Mt(s,t){if(!Ze(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return vt!==void 0?vt.createHTML(t):t}var $t=(s,t)=>{let e=s.length-1,i=[],r,n=t===2?"<svg>":t===3?"<math>":"",o=de;for(let l=0;l<e;l++){let a=s[l],c,d,h=-1,u=0;for(;u<a.length&&(o.lastIndex=u,d=o.exec(a),d!==null);)u=o.lastIndex,o===de?d[1]==="!--"?o=wt:d[1]!==void 0?o=St:d[2]!==void 0?(Rt.test(d[2])&&(r=RegExp("</"+d[2],"g")),o=N):d[3]!==void 0&&(o=N):o===N?d[0]===">"?(o=r??de,h=-1):d[1]===void 0?h=-2:(h=o.lastIndex-d[2].length,c=d[1],o=d[3]===void 0?N:d[3]==='"'?Et:Ct):o===Et||o===Ct?o=N:o===wt||o===St?o=de:(o=N,r=void 0);let m=o===N&&s[l+1].startsWith("/>")?" ":"";n+=o===de?a+wi:h>=0?(i.push(c),a.slice(0,h)+Xe+a.slice(h)+A+m):a+A+(h===-2?l:m)}return[Mt(s,n+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},fe=class s{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let n=0,o=0,l=t.length-1,a=this.parts,[c,d]=$t(t,e);if(this.el=s.createElement(c,i),P.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(r=P.nextNode())!==null&&a.length<l;){if(r.nodeType===1){if(r.hasAttributes())for(let h of r.getAttributeNames())if(h.endsWith(Xe)){let u=d[o++],m=r.getAttribute(h).split(A),y=/([.?@])?(.*)/.exec(u);a.push({type:1,index:n,name:y[2],strings:m,ctor:y[1]==="."?$e:y[1]==="?"?Ae:y[1]==="@"?ze:L}),r.removeAttribute(h)}else h.startsWith(A)&&(a.push({type:6,index:n}),r.removeAttribute(h));if(Rt.test(r.tagName)){let h=r.textContent.split(A),u=h.length-1;if(u>0){r.textContent=Re?Re.emptyScript:"";for(let m=0;m<u;m++)r.append(h[m],ue()),P.nextNode(),a.push({type:2,index:++n});r.append(h[u],ue())}}}else if(r.nodeType===8)if(r.data===Je)a.push({type:2,index:n});else{let h=-1;for(;(h=r.data.indexOf(A,h+1))!==-1;)a.push({type:7,index:n}),h+=A.length-1}n++}}static createElement(t,e){let i=D.createElement("template");return i.innerHTML=t,i}};function V(s,t,e=s,i){if(t===w)return t;let r=i!==void 0?e._$Co?.[i]:e._$Cl,n=pe(t)?void 0:t._$litDirective$;return r?.constructor!==n&&(r?._$AO?.(!1),n===void 0?r=void 0:(r=new n(s),r._$AT(s,e,i)),i!==void 0?(e._$Co??=[])[i]=r:e._$Cl=r),r!==void 0&&(t=V(s,r._$AS(s,t.values),r,i)),t}var Me=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:i}=this._$AD,r=(t?.creationScope??D).importNode(e,!0);P.currentNode=r;let n=P.nextNode(),o=0,l=0,a=i[0];for(;a!==void 0;){if(o===a.index){let c;a.type===2?c=new j(n,n.nextSibling,this,t):a.type===1?c=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(c=new Ie(n,this,t)),this._$AV.push(c),a=i[++l]}o!==a?.index&&(n=P.nextNode(),o++)}return P.currentNode=D,r}p(t){let e=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}},j=class s{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=b,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=V(this,t,e),pe(t)?t===b||t==null||t===""?(this._$AH!==b&&this._$AR(),this._$AH=b):t!==this._$AH&&t!==w&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):xt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==b&&pe(this._$AH)?this._$AA.nextSibling.data=t:this.T(D.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=fe.createElement(Mt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(e);else{let n=new Me(r,this),o=n.u(this.options);n.p(e),this.T(o),this._$AH=n}}_$AC(t){let e=Tt.get(t.strings);return e===void 0&&Tt.set(t.strings,e=new fe(t)),e}k(t){Ze(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,i,r=0;for(let n of t)r===e.length?e.push(i=new s(this.O(ue()),this.O(ue()),this,this.options)):i=e[r],i._$AI(n),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let i=yt(t).nextSibling;yt(t).remove(),t=i}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},L=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,r,n){this.type=1,this._$AH=b,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=b}_$AI(t,e=this,i,r){let n=this.strings,o=!1;if(n===void 0)t=V(this,t,e,0),o=!pe(t)||t!==this._$AH&&t!==w,o&&(this._$AH=t);else{let l=t,a,c;for(t=n[0],a=0;a<n.length-1;a++)c=V(this,l[i+a],e,a),c===w&&(c=this._$AH[a]),o||=!pe(c)||c!==this._$AH[a],c===b?t=b:t!==b&&(t+=(c??"")+n[a+1]),this._$AH[a]=c}o&&!r&&this.j(t)}j(t){t===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},$e=class extends L{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===b?void 0:t}},Ae=class extends L{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==b)}},ze=class extends L{constructor(t,e,i,r,n){super(t,e,i,r,n),this.type=5}_$AI(t,e=this){if((t=V(this,t,e,0)??b)===w)return;let i=this._$AH,r=t===b&&i!==b||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==b&&(i===b||r);r&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},Ie=class{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){V(this,t)}},At={M:Xe,P:A,A:Je,C:1,L:$t,R:Me,D:xt,V,I:j,H:L,N:Ae,U:ze,B:$e,F:Ie},Si=Ge.litHtmlPolyfillSupport;Si?.(fe,j),(Ge.litHtmlVersions??=[]).push("3.3.2");var zt=(s,t,e)=>{let i=e?.renderBefore??t,r=i._$litPart$;if(r===void 0){let n=e?.renderBefore??null;i._$litPart$=r=new j(t.insertBefore(ue(),n),n,void 0,e??{})}return r._$AI(s),r};var tt=globalThis,E=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=zt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return w}};E._$litElement$=!0,E.finalized=!0,tt.litElementHydrateSupport?.({LitElement:E});var Ci=tt.litElementPolyfillSupport;Ci?.({LitElement:E});(tt.litElementVersions??=[]).push("4.2.2");function It(s,t){if(!s||!t||t.length===0)return s;let e=[...t].sort((l,a)=>l[0]-a[0]),i=[],r=e[0];for(let l=1;l<e.length;l++){let a=e[l];a[0]<r[1]?r[1]=Math.max(r[1],a[1]):(i.push(r),r=a)}i.push(r);let n=[],o=0;for(let[l,a]of i){let c=Math.max(0,Math.min(l,s.length)),d=Math.max(0,Math.min(a,s.length));c>o&&n.push(s.slice(o,c)),n.push(g`<mark class="highlight">${s.slice(c,d)}</mark>`),o=d}return o<s.length&&n.push(s.slice(o)),g`${n}`}var Ot=s=>s.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase());var kt=s=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(s,t)}):customElements.define(s,t)};var Ei={attribute:!0,type:String,converter:he,reflect:!1,hasChanged:xe},Ti=(s=Ei,t,e)=>{let{kind:i,metadata:r}=e,n=globalThis.litPropertyMetadata.get(r);if(n===void 0&&globalThis.litPropertyMetadata.set(r,n=new Map),i==="setter"&&((s=Object.create(s)).wrapped=!0),n.set(e.name,s),i==="accessor"){let{name:o}=e;return{set(l){let a=t.get.call(this);t.set.call(this,l),this.requestUpdate(o,a,s,!0,l)},init(l){return l!==void 0&&this.C(o,void 0,s,l),l}}}if(i==="setter"){let{name:o}=e;return function(l){let a=this[o];t.call(this,l),this.requestUpdate(o,a,s,!0,l)}}throw Error("Unsupported decorator location: "+i)};function p(s){return(t,e)=>typeof e=="object"?Ti(s,t,e):((i,r,n)=>{let o=r.hasOwnProperty(n);return r.constructor.createProperty(n,i),o?Object.getOwnPropertyDescriptor(r,n):void 0})(s,t,e)}function Nt(s){return p({...s,state:!0,attribute:!1})}var U=(s,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(s,t,e),e);function it(s,t){return(e,i,r)=>{let n=o=>o.renderRoot?.querySelector(s)??null;if(t){let{get:o,set:l}=typeof i=="object"?e:r??(()=>{let a=Symbol();return{get(){return this[a]},set(c){this[a]=c}}})();return U(e,i,{get(){let a=o.call(this);return a===void 0&&(a=n(this),(a!==null||this.hasUpdated)&&l.call(this,a)),a}})}return U(e,i,{get(){return n(this)}})}}var x={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},z=s=>(...t)=>({_$litDirective$:s,values:t}),T=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var me=z(class extends T{constructor(s){if(super(s),s.type!==x.ATTRIBUTE||s.name!=="class"||s.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter(t=>s[t]).join(" ")+" "}update(s,[t]){if(this.st===void 0){this.st=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(i=>i!=="")));for(let i in t)t[i]&&!this.nt?.has(i)&&this.st.add(i);return this.render(t)}let e=s.element.classList;for(let i of this.st)i in t||(e.remove(i),this.st.delete(i));for(let i in t){let r=!!t[i];r===this.st.has(i)||this.nt?.has(i)||(r?(e.add(i),this.st.add(i)):(e.remove(i),this.st.delete(i)))}return w}});var _e=s=>s??b;var{I:xi}=At,Pt=s=>s;var Vt=s=>s.strings===void 0,Dt=()=>document.createComment(""),H=(s,t,e)=>{let i=s._$AA.parentNode,r=t===void 0?s._$AB:t._$AA;if(e===void 0){let n=i.insertBefore(Dt(),r),o=i.insertBefore(Dt(),r);e=new xi(n,o,s,s.options)}else{let n=e._$AB.nextSibling,o=e._$AM,l=o!==s;if(l){let a;e._$AQ?.(s),e._$AM=s,e._$AP!==void 0&&(a=s._$AU)!==o._$AU&&e._$AP(a)}if(n!==r||l){let a=e._$AA;for(;a!==n;){let c=Pt(a).nextSibling;Pt(i).insertBefore(a,r),a=c}}}return e},k=(s,t,e=s)=>(s._$AI(t,e),s),Ri={},Lt=(s,t=Ri)=>s._$AH=t,Ut=s=>s._$AH,Oe=s=>{s._$AR(),s._$AA.remove()};var jt=(s,t,e)=>{let i=new Map;for(let r=t;r<=e;r++)i.set(s[r],r);return i},ke=z(class extends T{constructor(s){if(super(s),s.type!==x.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,t,e){let i;e===void 0?e=t:t!==void 0&&(i=t);let r=[],n=[],o=0;for(let l of s)r[o]=i?i(l,o):o,n[o]=e(l,o),o++;return{values:n,keys:r}}render(s,t,e){return this.dt(s,t,e).values}update(s,[t,e,i]){let r=Ut(s),{values:n,keys:o}=this.dt(t,e,i);if(!Array.isArray(r))return this.ut=o,n;let l=this.ut??=[],a=[],c,d,h=0,u=r.length-1,m=0,y=n.length-1;for(;h<=u&&m<=y;)if(r[h]===null)h++;else if(r[u]===null)u--;else if(l[h]===o[m])a[m]=k(r[h],n[m]),h++,m++;else if(l[u]===o[y])a[y]=k(r[u],n[y]),u--,y--;else if(l[h]===o[y])a[y]=k(r[h],n[y]),H(s,a[y+1],r[h]),h++,y--;else if(l[u]===o[m])a[m]=k(r[u],n[m]),H(s,r[h],r[u]),u--,m++;else if(c===void 0&&(c=jt(o,m,y),d=jt(l,h,u)),c.has(l[h]))if(c.has(l[u])){let C=d.get(o[m]),K=C!==void 0?r[C]:null;if(K===null){let R=H(s,r[h]);k(R,n[m]),a[m]=R}else a[m]=k(K,n[m]),H(s,r[h],K),r[C]=null;m++}else Oe(r[u]),u--;else Oe(r[h]),h++;for(;m<=y;){let C=H(s,a[y+1]);k(C,n[m]),a[m++]=C}for(;h<=u;){let C=r[h++];C!==null&&Oe(C)}return this.ut=o,Lt(s,a),w}});var Ht="important",Mi=" !"+Ht,Ft=z(class extends T{constructor(s){if(super(s),s.type!==x.ATTRIBUTE||s.name!=="style"||s.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce((t,e)=>{let i=s[e];return i==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(s,[t]){let{style:e}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let i of this.ft)t[i]==null&&(this.ft.delete(i),i.includes("-")?e.removeProperty(i):e[i]=null);for(let i in t){let r=t[i];if(r!=null){this.ft.add(i);let n=typeof r=="string"&&r.endsWith(Mi);i.includes("-")||n?e.setProperty(i,n?r.slice(0,-11):r,n?Ht:""):e[i]=r}}return w}});function F(s,t,e,i){var r=arguments.length,n=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,t,e,i);else for(var l=s.length-1;l>=0;l--)(o=s[l])&&(n=(r<3?o(n):r>3?o(t,e,n):o(t,e))||n);return r>3&&n&&Object.defineProperty(t,e,n),n}var ge=(s,t)=>{let e=s._$AN;if(e===void 0)return!1;for(let i of e)i._$AO?.(t,!1),ge(i,t);return!0},Ne=s=>{let t,e;do{if((t=s._$AM)===void 0)break;e=t._$AN,e.delete(s),s=t}while(e?.size===0)},qt=s=>{for(let t;t=s._$AM;s=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(s))break;e.add(s),zi(t)}};function $i(s){this._$AN!==void 0?(Ne(this),this._$AM=s,qt(this)):this._$AM=s}function Ai(s,t=!1,e=0){let i=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(t)if(Array.isArray(i))for(let n=e;n<i.length;n++)ge(i[n],!1),Ne(i[n]);else i!=null&&(ge(i,!1),Ne(i));else ge(this,s)}var zi=s=>{s.type==x.CHILD&&(s._$AP??=Ai,s._$AQ??=$i)},Pe=class extends T{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),qt(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(ge(this,t),Ne(this))}setValue(t){if(Vt(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};var q=class s extends Event{constructor(t){super(s.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}};q.eventName="rangeChanged";var B=class s extends Event{constructor(t){super(s.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}};B.eventName="visibilityChanged";var be=class s extends Event{constructor(){super(s.eventName,{bubbles:!1})}};be.eventName="unpinned";var rt=class{constructor(t){this._element=null;let e=t??window;this._node=e,t&&(this._element=t)}get element(){return this._element||document.scrollingElement||document.documentElement}get scrollTop(){return this.element.scrollTop||window.scrollY}get scrollLeft(){return this.element.scrollLeft||window.scrollX}get scrollHeight(){return this.element.scrollHeight}get scrollWidth(){return this.element.scrollWidth}get viewportHeight(){return this._element?this._element.getBoundingClientRect().height:window.innerHeight}get viewportWidth(){return this._element?this._element.getBoundingClientRect().width:window.innerWidth}get maxScrollTop(){return this.scrollHeight-this.viewportHeight}get maxScrollLeft(){return this.scrollWidth-this.viewportWidth}},De=class extends rt{constructor(t,e){super(e),this._clients=new Set,this._retarget=null,this._end=null,this.__destination=null,this.correctingScrollError=!1,this._checkForArrival=this._checkForArrival.bind(this),this._updateManagedScrollTo=this._updateManagedScrollTo.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollBy=this.scrollBy.bind(this);let i=this._node;this._originalScrollTo=i.scrollTo,this._originalScrollBy=i.scrollBy,this._originalScroll=i.scroll,this._attach(t)}get _destination(){return this.__destination}get scrolling(){return this._destination!==null}scrollTo(t,e){let i=typeof t=="number"&&typeof e=="number"?{left:t,top:e}:t;this._scrollTo(i)}scrollBy(t,e){let i=typeof t=="number"&&typeof e=="number"?{left:t,top:e}:t;i.top!==void 0&&(i.top+=this.scrollTop),i.left!==void 0&&(i.left+=this.scrollLeft),this._scrollTo(i)}_nativeScrollTo(t){this._originalScrollTo.bind(this._element||window)(t)}_scrollTo(t,e=null,i=null){this._end!==null&&this._end(),t.behavior==="smooth"?(this._setDestination(t),this._retarget=e,this._end=i):this._resetScrollState(),this._nativeScrollTo(t)}_setDestination(t){let{top:e,left:i}=t;return e=e===void 0?void 0:Math.max(0,Math.min(e,this.maxScrollTop)),i=i===void 0?void 0:Math.max(0,Math.min(i,this.maxScrollLeft)),this._destination!==null&&i===this._destination.left&&e===this._destination.top?!1:(this.__destination={top:e,left:i,behavior:"smooth"},!0)}_resetScrollState(){this.__destination=null,this._retarget=null,this._end=null}_updateManagedScrollTo(t){this._destination&&this._setDestination(t)&&this._nativeScrollTo(this._destination)}managedScrollTo(t,e,i){return this._scrollTo(t,e,i),this._updateManagedScrollTo}correctScrollError(t){this.correctingScrollError=!0,requestAnimationFrame(()=>requestAnimationFrame(()=>this.correctingScrollError=!1)),this._nativeScrollTo(t),this._retarget&&this._setDestination(this._retarget()),this._destination&&this._nativeScrollTo(this._destination)}_checkForArrival(){if(this._destination!==null){let{scrollTop:t,scrollLeft:e}=this,{top:i,left:r}=this._destination;i=Math.min(i||0,this.maxScrollTop),r=Math.min(r||0,this.maxScrollLeft);let n=Math.abs(i-t),o=Math.abs(r-e);n<1&&o<1&&(this._end&&this._end(),this._resetScrollState())}}detach(t){return this._clients.delete(t),this._clients.size===0&&(this._node.scrollTo=this._originalScrollTo,this._node.scrollBy=this._originalScrollBy,this._node.scroll=this._originalScroll,this._node.removeEventListener("scroll",this._checkForArrival)),null}_attach(t){this._clients.add(t),this._clients.size===1&&(this._node.scrollTo=this.scrollTo,this._node.scrollBy=this.scrollBy,this._node.scroll=this.scrollTo,this._node.addEventListener("scroll",this._checkForArrival))}};var Gt=typeof window<"u"?window.ResizeObserver:void 0;var ve=Symbol("virtualizerRef"),Ue="virtualizer-sizer",Xt,He=class{constructor(t){if(this._benchmarkStart=null,this._layout=null,this._clippingAncestors=[],this._scrollSize=null,this._scrollError=null,this._childrenPos=null,this._childMeasurements=null,this._toBeMeasured=new Map,this._rangeChanged=!0,this._itemsChanged=!0,this._visibilityChanged=!0,this._scrollerController=null,this._isScroller=!1,this._sizer=null,this._hostElementRO=null,this._childrenRO=null,this._mutationObserver=null,this._scrollEventListeners=[],this._scrollEventListenerOptions={passive:!0},this._loadListener=this._childLoaded.bind(this),this._scrollIntoViewTarget=null,this._updateScrollIntoViewCoordinates=null,this._items=[],this._first=-1,this._last=-1,this._firstVisible=-1,this._lastVisible=-1,this._scheduled=new WeakSet,this._measureCallback=null,this._measureChildOverride=null,this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null,this._layoutInitialized=null,this._connected=!1,!t)throw new Error("Virtualizer constructor requires a configuration object");if(t.hostElement)this._init(t);else throw new Error('Virtualizer configuration requires the "hostElement" property')}set items(t){Array.isArray(t)&&t!==this._items&&(this._itemsChanged=!0,this._items=t,this._schedule(this._updateLayout))}_init(t){this._isScroller=!!t.scroller,this._initHostElement(t);let e=t.layout||{};this._layoutInitialized=this._initLayout(e)}_initObservers(){this._mutationObserver=new MutationObserver(this._finishDOMUpdate.bind(this)),this._hostElementRO=new Gt(()=>this._hostElementSizeChanged()),this._childrenRO=new Gt(this._childrenSizeChanged.bind(this))}_initHostElement(t){let e=this._hostElement=t.hostElement;this._applyVirtualizerStyles(),e[ve]=this}connected(){this._initObservers();let t=this._isScroller;this._clippingAncestors=Vi(this._hostElement,t),this._scrollerController=new De(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach(t=>{t.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(t),this._hostElementRO.observe(t)}),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach(t=>this._childrenRO.observe(t)),this._scrollEventListeners.forEach(t=>t.addEventListener("scroll",this,this._scrollEventListenerOptions))}disconnected(){this._scrollEventListeners.forEach(t=>t.removeEventListener("scroll",this,this._scrollEventListenerOptions)),this._scrollEventListeners=[],this._clippingAncestors=[],this._scrollerController?.detach(this),this._scrollerController=null,this._mutationObserver?.disconnect(),this._mutationObserver=null,this._hostElementRO?.disconnect(),this._hostElementRO=null,this._childrenRO?.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){let e=this._hostElement.style;e.display=e.display||"block",e.position=e.position||"relative",e.contain=e.contain||"size layout",this._isScroller&&(e.overflow=e.overflow||"auto",e.minHeight=e.minHeight||"150px")}_getSizer(){let t=this._hostElement;if(!this._sizer){let e=t.querySelector(`[${Ue}]`);e||(e=document.createElement("div"),e.setAttribute(Ue,""),t.appendChild(e)),Object.assign(e.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),e.textContent="&nbsp;",e.setAttribute(Ue,""),this._sizer=e}return this._sizer}async updateLayoutConfig(t){await this._layoutInitialized;let e=t.type||Xt;if(typeof e=="function"&&this._layout instanceof e){let i={...t};return delete i.type,this._layout.config=i,!0}return!1}async _initLayout(t){let e,i;if(typeof t.type=="function"){i=t.type;let r={...t};delete r.type,e=r}else e=t;i===void 0&&(Xt=i=(await Promise.resolve().then(()=>(Yt(),Qt))).FlowLayout),this._layout=new i(r=>this._handleLayoutMessage(r),e),this._layout.measureChildren&&typeof this._layout.updateItemSizes=="function"&&(typeof this._layout.measureChildren=="function"&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){this._benchmarkStart===null&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(this._benchmarkStart!==null){let t=window.performance.now(),e=t-this._benchmarkStart,r=performance.getEntriesByName("uv-virtualizing","measure").filter(n=>n.startTime>=this._benchmarkStart&&n.startTime<t).reduce((n,o)=>n+o.duration,0);return this._benchmarkStart=null,{timeElapsed:e,virtualizationTime:r}}return null}_measureChildren(){let t={},e=this._children,i=this._measureChildOverride||this._measureChild;for(let r=0;r<e.length;r++){let n=e[r],o=this._first+r;(this._itemsChanged||this._toBeMeasured.has(n))&&(t[o]=i.call(this,n,this._items[o]))}this._childMeasurements=t,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(t){let{width:e,height:i}=t.getBoundingClientRect();return Object.assign({width:e,height:i},Pi(t))}async _schedule(t){this._scheduled.has(t)||(this._scheduled.add(t),await Promise.resolve(),this._scheduled.delete(t),t.call(this))}async _updateDOM(t){this._scrollSize=t.scrollSize,this._adjustRange(t.range),this._childrenPos=t.childPositions,this._scrollError=t.scrollError||null;let{_rangeChanged:e,_itemsChanged:i}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(e||i)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach(t=>this._childrenRO.observe(t)),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),this._childMeasurements!==null&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(t){console.warn("Error measuring performance data: ",t)}window.performance.mark("uv-start")}this._scrollerController.correctingScrollError===!1&&this._layout?.unpin(),this._schedule(this._updateLayout)}handleEvent(t){t.type==="scroll"?(t.currentTarget===window||this._clippingAncestors.includes(t.currentTarget))&&this._handleScrollEvent():console.warn("event not handled",t)}_handleLayoutMessage(t){t.type==="stateChanged"?this._updateDOM(t):t.type==="visibilityChanged"?(this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._notifyVisibility()):t.type==="unpinned"&&this._hostElement.dispatchEvent(new be)}get _children(){let t=[],e=this._hostElement.firstElementChild;for(;e;)e.hasAttribute(Ue)||t.push(e),e=e.nextElementSibling;return t}_updateView(){let t=this._hostElement,e=this._scrollerController?.element,i=this._layout;if(t&&e&&i){let r,n,o,l,a=t.getBoundingClientRect();r=0,n=0,o=window.innerHeight,l=window.innerWidth;let c=this._clippingAncestors.map(R=>R.getBoundingClientRect());c.unshift(a);for(let R of c)r=Math.max(r,R.top),n=Math.max(n,R.left),o=Math.min(o,R.bottom),l=Math.min(l,R.right);let d=e.getBoundingClientRect(),h={left:a.left-d.left,top:a.top-d.top},u={width:e.scrollWidth,height:e.scrollHeight},m=r-a.top+t.scrollTop,y=n-a.left+t.scrollLeft,C=Math.max(0,o-r),K=Math.max(0,l-n);i.viewportSize={width:K,height:C},i.viewportScroll={top:m,left:y},i.totalScrollSize=u,i.offsetWithinScroller=h}}_sizeHostElement(t){let i=t&&t.width!==null?Math.min(82e5,t.width):0,r=t&&t.height!==null?Math.min(82e5,t.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${i}px, ${r}px)`;else{let n=this._hostElement.style;n.minWidth=i?`${i}px`:"100%",n.minHeight=r?`${r}px`:"100%"}}_positionChildren(t){t&&t.forEach(({top:e,left:i,width:r,height:n,xOffset:o,yOffset:l},a)=>{let c=this._children[a-this._first];c&&(c.style.position="absolute",c.style.boxSizing="border-box",c.style.transform=`translate(${i}px, ${e}px)`,r!==void 0&&(c.style.width=r+"px"),n!==void 0&&(c.style.height=n+"px"),c.style.left=o===void 0?null:o+"px",c.style.top=l===void 0?null:l+"px")})}async _adjustRange(t){let{_first:e,_last:i,_firstVisible:r,_lastVisible:n}=this;this._first=t.first,this._last=t.last,this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==e||this._last!==i,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==r||this._lastVisible!==n}_correctScrollError(){if(this._scrollError){let{scrollTop:t,scrollLeft:e}=this._scrollerController,{top:i,left:r}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:t-i,left:e-r})}}element(t){return t===1/0&&(t=this._items.length-1),this._items?.[t]===void 0?void 0:{scrollIntoView:(e={})=>this._scrollElementIntoView({...e,index:t})}}_scrollElementIntoView(t){if(t.index>=this._first&&t.index<=this._last)this._children[t.index-this._first].scrollIntoView(t);else if(t.index=Math.min(t.index,this._items.length-1),t.behavior==="smooth"){let e=this._layout.getScrollIntoViewCoordinates(t),{behavior:i}=t;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(e,{behavior:i}),()=>this._layout.getScrollIntoViewCoordinates(t),()=>this._scrollIntoViewTarget=null),this._scrollIntoViewTarget=t}else this._layout.pin=t}_checkScrollIntoViewTarget(t){let{index:e}=this._scrollIntoViewTarget||{};e&&t?.has(e)&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new q({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new B({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise((t,e)=>{this._layoutCompleteResolver=t,this._layoutCompleteRejecter=e})),this._layoutCompletePromise}_rejectLayoutCompletePromise(t){this._layoutCompleteRejecter!==null&&this._layoutCompleteRejecter(t),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&this._pendingLayoutComplete===null&&(this._pendingLayoutComplete=requestAnimationFrame(()=>requestAnimationFrame(()=>this._resolveLayoutCompletePromise())))}_resolveLayoutCompletePromise(){this._layoutCompleteResolver!==null&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(t){if(this._layout?.measureChildren){for(let e of t)this._toBeMeasured.set(e.target,e.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}};function Pi(s){let t=window.getComputedStyle(s);return{marginTop:je(t.marginTop),marginRight:je(t.marginRight),marginBottom:je(t.marginBottom),marginLeft:je(t.marginLeft)}}function je(s){let t=s?parseFloat(s):NaN;return Number.isNaN(t)?0:t}function Jt(s){if(s.assignedSlot!==null)return s.assignedSlot;if(s.parentElement!==null)return s.parentElement;let t=s.parentNode;return t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host||null}function Di(s,t=!1){let e=[],i=t?s:Jt(s);for(;i!==null;)e.push(i),i=Jt(i);return e}function Vi(s,t=!1){let e=!1;return Di(s,t).filter(i=>{if(e)return!1;let r=getComputedStyle(i);return e=r.position==="fixed",r.overflow!=="visible"})}var lt=s=>s,at=(s,t)=>g`${t}: ${JSON.stringify(s,null,2)}`,ot=class extends Pe{constructor(t){if(super(t),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(e,i)=>at(e,i+this._first),this._keyFunction=(e,i)=>lt(e,i+this._first),this._items=[],t.type!==x.CHILD)throw new Error("The virtualize directive can only be used in child expressions")}render(t){t&&this._setFunctions(t);let e=[];if(this._first>=0&&this._last>=this._first)for(let i=this._first;i<=this._last;i++)e.push(this._items[i]);return ke(e,this._keyFunction,this._renderItem)}update(t,[e]){this._setFunctions(e);let i=this._items!==e.items;return this._items=e.items||[],this._virtualizer?this._updateVirtualizerConfig(t,e):this._initialize(t,e),i?w:this.render()}async _updateVirtualizerConfig(t,e){if(!await this._virtualizer.updateLayoutConfig(e.layout||{})){let r=t.parentNode;this._makeVirtualizer(r,e)}this._virtualizer.items=this._items}_setFunctions(t){let{renderItem:e,keyFunction:i}=t;e&&(this._renderItem=(r,n)=>e(r,n+this._first)),i&&(this._keyFunction=(r,n)=>i(r,n+this._first))}_makeVirtualizer(t,e){this._virtualizer&&this._virtualizer.disconnected();let{layout:i,scroller:r,items:n}=e;this._virtualizer=new He({hostElement:t,layout:i,scroller:r}),this._virtualizer.items=n,this._virtualizer.connected()}_initialize(t,e){let i=t.parentNode;i&&i.nodeType===1&&(i.addEventListener("rangeChanged",r=>{this._first=r.first,this._last=r.last,this.setValue(this.render())}),this._makeVirtualizer(i,e))}disconnected(){this._virtualizer?.disconnected()}reconnected(){this._virtualizer?.connected()}},Zt=z(ot);var I=class extends E{constructor(){super(...arguments),this.items=[],this.renderItem=at,this.keyFunction=lt,this.layout={},this.scroller=!1}createRenderRoot(){return this}render(){let{items:t,renderItem:e,keyFunction:i,layout:r,scroller:n}=this;return g`${Zt({items:t,renderItem:e,keyFunction:i,layout:r,scroller:n})}`}element(t){return this[ve]?.element(t)}get layoutComplete(){return this[ve]?.layoutComplete}scrollToIndex(t,e="start"){this.element(t)?.scrollIntoView({block:e})}};F([p({attribute:!1})],I.prototype,"items",void 0);F([p()],I.prototype,"renderItem",void 0);F([p()],I.prototype,"keyFunction",void 0);F([p({attribute:!1})],I.prototype,"layout",void 0);F([p({reflect:!0,type:Boolean})],I.prototype,"scroller",void 0);customElements.define("lit-virtualizer",I);function ei(s){return typeof s=="string"||typeof s=="number"||typeof s=="bigint"?s:typeof s=="boolean"?Number(s):s instanceof Date?s.getTime():String(s)}function ti(s,t){let e=Array.from(new Set(s)),i=new Intl.Collator(t,{numeric:!0,sensitivity:"base"});e.sort(([n,o],[l,a])=>{if(o==null&&a==null)return 0;if(o==null)return-1;if(o==null)return 1;let c=ei(o),d=ei(a);return typeof c=="string"&&typeof d=="string"?i.compare(String(c),String(d)):c<d?-1:d<c?1:0});let r=new Map;return e.forEach(([n,o],l)=>r.set(n,l)),r}var Li=1e3,ii={storage:"local",saveColumnSortOrders:!0,saveColumnVisibility:!0,saveColumnWidths:!0,saveColumnOrder:!0,saveSelectedRows:!0},ct={EXACT:100,PREFIX:50,SUBSTRING:10},we=class extends le{constructor(e,i){super();this.hosts=new Set;this._enableSearchTokenization=!1;this._enableSearchScoring=!1;this._columns=[];this._columnDefinitionMap=new Map;this._columnStateMap=new Map;this._rowSelectionMethod=null;this._selectedRowIds=new Set;this._storageOptions=null;this._rowIdCallback=(e,i)=>"id"in e&&oe(e.id)?e.id:"key"in e&&oe(e.key)?e.key:"_id"in e&&oe(e._id)?e._id:(Ui(),i);this._data=[];this._filteredData=[];this._dataUpdateTimestamp=null;this._searchQuery="";this._searchTokenizer=Be;this._filters=null;this.hasRestoredState=!1;this.saveTimer=0;this.filterDirty=!1;this.sortDirty=!1;this.rowMetadata=new WeakMap;this.idToRowMap=new Map;this.queryTokens=null;e&&this.attach(e),i&&(i.enableSearchScoring!==void 0&&(this.enableSearchScoring=i.enableSearchScoring),i.enableSearchTokenization!==void 0&&(this.enableSearchTokenization=i.enableSearchTokenization),i.searchTokenizer!==void 0&&(this.searchTokenizer=i.searchTokenizer),i.rowIdCallback!==void 0&&(this.rowIdCallback=i.rowIdCallback),i.rowSelectionMethod!==void 0&&(this.rowSelectionMethod=i.rowSelectionMethod),i.storageOptions!==void 0&&(this.storageOptions=i.storageOptions),i.columns!==void 0&&(this.columns=i.columns),i.data!==void 0&&(this.data=i.data))}get enableSearchTokenization(){return this._enableSearchTokenization}set enableSearchTokenization(e){this._enableSearchTokenization!==e&&(this._enableSearchTokenization=e,this.updateInternalQuery(),this.filterDirty=!0,this.requestUpdate("enableSearchTokenization"))}get enableSearchScoring(){return this._enableSearchScoring}set enableSearchScoring(e){this._enableSearchScoring!==e&&(this._enableSearchScoring=e,this.filterDirty=!0,this.requestUpdate("enableSearchScoring"))}get columns(){return[...this._columns]}set columns(e){this._columns=[...e],this.filterDirty=!0,this._columnDefinitionMap=new Map;for(let i of e)this._columnDefinitionMap.set(i.field,i);this.requestUpdate("columns")}get displayColumns(){return this.columns.filter(M)}get columnStates(){return this.columns.map(e=>{let i=this.getColumnState(e.field);return O(e.field,i)})}set columnStates(e){let i=!1;for(let r of e){let n=this.getColumnState(r.field),o=ne(n,r);if(o.length){i=!0,o.includes("sort")&&(this.sortDirty=!0);let l=O(r.field,r);this._columnStateMap.set(r.field,l)}}i&&this.requestUpdate("columnStates")}get searchQuery(){return this._searchQuery}set searchQuery(e){this._searchQuery!==e&&(this._searchQuery=e,this.updateInternalQuery(),this.filterDirty=!0,this.requestUpdate("searchQuery"))}get searchTokenizer(){return this._searchTokenizer}set searchTokenizer(e){this._searchTokenizer!==e&&(this._searchTokenizer=e,this.filterDirty=!0,this.requestUpdate("searchTokenizer"))}get filters(){return this._filters}set filters(e){this._filters!==e&&(this._filters=e,this.filterDirty=!0,this.requestUpdate("filters"))}get rowSelectionMethod(){return this._rowSelectionMethod}set rowSelectionMethod(e){this._rowSelectionMethod===e||!qe(e)||(this._rowSelectionMethod=e,this.requestUpdate("rowSelectionMethod"))}get selectedRowIds(){let e=[...this._selectedRowIds];return this.rowSelectionMethod==="single"?e=e.slice(0,1):this.rowSelectionMethod||(e=[]),e}set selectedRowIds(e){e.length===this._selectedRowIds.size&&e.every(i=>this._selectedRowIds.has(i))||(this._selectedRowIds=new Set(e),this.requestUpdate("selectedRowIds"))}get storageOptions(){return this._storageOptions?{...this._storageOptions}:null}set storageOptions(e){this._storageOptions!==e&&(this._storageOptions=e?{...e}:null,this.hasRestoredState||(this.loadStateFromStorage(),this.requestUpdate("storageOptions")))}get rowIdCallback(){return this._rowIdCallback}set rowIdCallback(e){if(this._rowIdCallback!==e){this._rowIdCallback=e;for(let i=0;i<this.data.length;++i){let r=this.data[i];this.rowMetadata.get(r).id=this._rowIdCallback(r,i)}this.requestUpdate("rowIdCallback")}}get data(){return[...this._data]}set data(e){this._data=[...e],this.createMetadata(),this._dataUpdateTimestamp=new Date,this.filterDirty=!0,this.requestUpdate("data")}get filteredData(){return this.filterDirty?this.filterRows():this.sortDirty&&this.sortRows(),this.filterDirty=!1,this.sortDirty=!1,[...this._filteredData]}get dataUpdateTimestamp(){return this._dataUpdateTimestamp}attach(e){this.hosts.add(e),e.addController(this),e.requestUpdate()}detach(e){e.removeController(this),this.hosts.delete(e)}getColumn(e){return this._columnDefinitionMap.get(e)}getDisplayColumn(e){let i=this._columnDefinitionMap.get(e);if(M(i))return i}getTableState(){return{searchQuery:this.searchQuery,selectedRows:this.selectedRowIds,columns:this.columnStates.map(e=>{let i=this.getColumnState(e.field);return O(e.field,i)})}}updateTableState(e){if("searchQuery"in e&&e.searchQuery!==void 0&&(this.searchQuery=e.searchQuery),"selectedRows"in e&&e.selectedRows&&(this.selectedRowIds=e.selectedRows),"columns"in e&&e.columns!==void 0)for(let i of e.columns)this.updateColumnState(i.field,i);this.requestUpdate()}getColumnState(e){let i=this._columnStateMap.get(e);if(!i){let r=O(e);return this._columnStateMap.set(e,r),r}return O(e,i)}updateColumnState(e,i){let r=this._columnStateMap.get(e),n=O(e,{...r,...i});this.columnStates=[n]}search(e){this.searchQuery=e,this.dispatchEvent(new ie(e))}getColumnFilterValues(e,i=!1){let r=this.getDisplayColumn(e),n=new Map;for(let o of this.filteredData){let l=S(o,e);if(r?.valueFormatter&&(l=r.valueFormatter(l,o)),l!=null||i){let a=n.get(l)??0;n.set(l,a+1)}}return n}sort(e,i,r=!0){let n=this.getColumnState(e);if(n===void 0)throw new Error(`Cannot get options for non-existent column "${e}"`);if(i===n?.sort?.order)return;if(i&&!n.sort){let a=[...this._columnStateMap.values()].map(h=>h.sort?.priority).filter(h=>h!==void 0),c=this.columns.length+1,d=Math.min(c,...a)-1;n.sort={order:i,priority:d}}else i&&n.sort?n.sort.order=i:n.sort=null;let o=[n];if(r){for(let a of this.columns)if(a.field!==e){let c=this.getColumnState(a.field);c.sort=null,o.push(c)}}this.columnStates=o;let l=new X(e,i,!r);this.dispatchEvent(l)}toggleColumnVisibility(e,i){let r=this.getColumnState(e),n=i!==void 0?i:!r.visible;if(n===r.visible)return;r.visible=n,this.columnStates=[r];let o=new J(e,n);this.dispatchEvent(o)}showColumn(e){this.toggleColumnVisibility(e,!0)}hideColumn(e){this.toggleColumnVisibility(e,!1)}moveColumn(e,i){let r=this.displayColumns,n=r.findIndex(l=>l.field===e),o=typeof i=="number"?i:r.findIndex(l=>l.field===i);if(n>-1&&o>-1){let[l]=r.splice(n,1);r.splice(o,0,l),this.columns=r;let a=new te(r.map(c=>c.field));this.dispatchEvent(a)}}resizeColumn(e,i){let r=this.getColumnState(e);r.width=i,this.updateColumnState(e,r),this.dispatchEvent(new Z(e,i))}isRowSelected(e){let i=this.getRowId(e);return this.selectedRowIds.includes(i)}toggleRowSelection(e,i){let r=this.getRowId(e),n=this.isRowSelected(e),o=i!==void 0?i:n;if(o===n)return;let l;o?l=this.rowSelectionMethod==="single"?[r]:[...this.selectedRowIds,r]:l=this.selectedRowIds.filter(d=>d!==r);let a=this.selectedRowIds;this.selectedRowIds=l;let c=new Y(l,a);this.dispatchEvent(c)}selectRow(e){this.toggleRowSelection(e,!0)}deselectRow(e){this.toggleRowSelection(e,!1)}selectAll(){if(this.rowSelectionMethod==="single")return;let e=this.filteredData.map(i=>this.getRowId(i));this.selectedRowIds=e}deselectAll(){this.selectedRowIds=[]}export(e={includeAllRows:!1,includeHiddenColumns:!1,includeInternalColumns:!1}){let i=e.includeAllRows?this.data:this.filteredData,r=e.includeInternalColumns?this.columns:this.displayColumns,n=r.filter(a=>e.includeHiddenColumns?!0:this.getColumnState(a.field).visible).map(a=>M(a)?a.title:a.field).join(","),o=i.map(a=>{let c=[];for(let d of r){let h=this.getColumnState(d.field),u=S(a,d.field);(e.includeHiddenColumns||h.visible)&&(M(d)&&typeof d.valueFormatter=="function"&&(u=d.valueFormatter(u,a)),u=String(u).replace('"','""'),c.push(`"${u}"`))}return c.join(",")}).join(`
4
- `),l=n+`
5
- `+o;return new Blob([l],{type:"text/csv;charset=utf-8,"})}getRow(e){return this.idToRowMap.get(e)}findRow(e,i){return this.data.find(r=>S(r,e)===i)}findRowIndex(e,i){let r=this.findRow(e,i);return r?this.rowMetadata.get(r).index:-1}updateRow(e,i){let r=this.idToRowMap.get(e);r&&(Object.assign(r,i),this.requestUpdate("data"))}updateRowAtIndex(e,i){let r=this.data[e];r&&(Object.assign(r,i),this.requestUpdate("data"))}deleteRow(...e){for(let i of e){let r=this.idToRowMap.get(i);if(r){let n=this.rowMetadata.get(r);this.deleteRowAtIndex(n.index)}}}deleteRowAtIndex(...e){let i=new Set(this.selectedRowIds);for(let r of e){let n=this.data[r];if(n){let o=this.rowMetadata.get(n);this.idToRowMap.delete(o.id),this.rowMetadata.delete(n),i.delete(o.id),this.data=this.data.toSpliced(r,1)}}this.selectedRowIds=[...i]}getRowId(e){let i=this.rowMetadata.get(e);if(!i)throw new Error("The provided row does not exist in the current dataset");return i.id}getRowIndex(e){let i=this.rowMetadata.get(e);if(!i)throw new Error("The provided row does not exist in the current dataset");return i.index}getRowHighlightIndicies(e){let i=this.rowMetadata.get(e);if(!i)throw new Error("The provided row does not exist in the current dataset");return i.highlightIndices}hostConnected(){}hostDisconnected(){}hostUpdate(){}hostUpdated(){}requestUpdate(...e){let i=["columns","columnStates","searchQuery","selectedRowIds"],r=e.filter(n=>i.includes(n));r.length&&(this.scheduleSave(),this.dispatchEvent(new se(this.getTableState(),r)));for(let n of this.hosts)n.requestUpdate()}calculateSearchScore(e,i){let r={score:0,ranges:[]};if(!e||!i)return r;let n=0,o=0;if(i===e)o=ct.EXACT,n=e.length,r.ranges.push([0,i.length]);else if(i.startsWith(e))o=ct.PREFIX,n=e.length,r.ranges.push([0,e.length]);else{let c=i.indexOf(e);if(c!==-1){o=ct.SUBSTRING,n=e.length;let d=c;for(;d!==-1;)r.ranges.push([d,d+e.length]),d=i.indexOf(e,d+1)}else return r}let a=1/(1+(i.length-e.length));return r.score=n*o*a,r}searchField(e,i,r){let n={score:0,ranges:[]},o=l=>{let a=i.indexOf(l);for(;a!==-1;)n.ranges.push([a,a+l.length]),a=i.indexOf(l,a+1)};if(e.quoted||!r){if(!this.enableSearchScoring)i.includes(e.value)&&(n.score=1,o(e.value));else{let l=this.calculateSearchScore(e.value,i);n.score=l.score,n.ranges=l.ranges}return n}if(!this.enableSearchScoring)return r.some(a=>a.includes(e.value))&&(n.score=1,o(e.value)),n;for(let l of r){let a=this.calculateSearchScore(e.value,l);a.score>0&&(n.score+=a.score,o(e.value))}return n}filterField(e,i,r=null){return Array.isArray(i)?i.length===0?!0:i.some(n=>this.filterField(e,n,r)):Array.isArray(e)?e.length===0?!1:e.some(n=>this.filterField(n,i,r)):typeof r=="function"?r(e,i):i instanceof RegExp?i.test(String(e)):i===e}filterRow(e,i){if(!this.filters)return!0;if(typeof this.filters=="function")return this.filters(e,i);for(let r in this.filters){let n=S(this.filters,r),o=S(e,r);if(typeof n=="function"){if(!n(o))return!1}else if(n!==void 0){let l=this.getColumn(r),a=l?l.filter:void 0;if(!this.filterField(o,n,a))return!1}}return!0}filterRows(){let i=[...this.columns].filter(r=>r.searchable).map(r=>r.field);this._filteredData=this.data.filter((r,n)=>{let o=this.rowMetadata.get(r);if(o.searchScore=0,o.highlightIndices={},!this.filterRow(r,n))return!1;if(!this.queryTokens)return!0;for(let l of i){let a=S(r,l),c=o.searchValues[l],d=o.searchTokens[l];if(typeof a!="string"||typeof c!="string")continue;let h={score:0,ranges:[]};for(let u of this.queryTokens){let m=this.searchField(u,c,d);h.score+=m.score,h.ranges.push(...m.ranges)}h.score>0&&(o.searchScore+=h.score,o.highlightIndices[l]=h.ranges)}return o.searchScore>0}),this.filterDirty=!1,this.sortRows(),this.dispatchEvent(new re(this.data))}compareRows(e,i,r){let n,o,l=this.getColumnState(r);if(!l.sort)return 0;let a=this.rowMetadata.get(e),c=this.rowMetadata.get(i);return l.sort?.order==="asc"?(n=a.sortValues[r],o=c.sortValues[r]):(n=c.sortValues[r],o=a.sortValues[r]),n??=Number.MIN_SAFE_INTEGER,o??=Number.MIN_SAFE_INTEGER,n<o?-1:n>o?1:0}sortRows(){if(this.filterDirty){this.filterRows();return}let e=[...this._columnStateMap.values()].filter(i=>i.visible&&i.sort).sort((i,r)=>r.sort.priority-i.sort.priority);this._filteredData=this._filteredData.toSorted((i,r)=>{let n=this.rowMetadata.get(i),o=this.rowMetadata.get(r);if(this.enableSearchScoring&&this.queryTokens){let l=n.searchScore||0,a=o.searchScore||0;if(l>a)return-1;if(l<a)return 1}for(let l of e){let a=this.compareRows(i,r,l.field);if(a!==0)return a}return n.index-o.index}),this.sortDirty=!1}createMetadata(){this.idToRowMap=new Map,this.rowMetadata=new WeakMap;let e=new Map;for(let r of this.columns){let n=this.data.map(o=>{let l=S(o,r.field),a=r.sorter?.(l)??l;return[l,a]});e.set(r.field,ti(n))}let i=0;for(let r of this.data){let n=this._rowIdCallback(r,i);(n==null||this.idToRowMap.has(n))&&(ji(i,n,r),n=`__yatl_fallback_id_${i}`),this.idToRowMap.set(n,r);let o={id:n,index:i++,searchTokens:{},searchValues:{},sortValues:{},selected:!1};this.rowMetadata.set(r,o);for(let l of this.columns){let a=S(r,l.field),c=e.get(l.field);if(o.sortValues[l.field]=c.get(a)??null,typeof a=="string"&&(o.searchValues[l.field]=a.toLocaleLowerCase()),l.searchable&&l.tokenize&&a){let d=l.searchTokenizer??this.searchTokenizer;o.searchTokens[l.field]=d(String(a)).map(h=>h.value)}}}}updateInternalQuery(){if(this.searchQuery.length===0){this.queryTokens=null;return}this.queryTokens=[{value:this.searchQuery.toLocaleLowerCase(),quoted:!0}],this.enableSearchTokenization&&this.queryTokens.push(...this.searchTokenizer(this.searchQuery))}scheduleSave(){window.clearTimeout(this.saveTimer),this.saveTimer=window.setTimeout(()=>{this.saveStateToStorage()},Li)}saveStateToStorage(){if(!this.storageOptions)return;let e={...ii,...this.storageOptions},i={columns:[]},r=this.getTableState();e.saveSearchQuery&&(i.searchQuery=r.searchQuery),e.saveSelectedRows&&(i.selectedRows=r.selectedRows);for(let o of r.columns){let l={field:o.field};e.saveColumnSortOrders&&(l.sort=o.sort),e.saveColumnVisibility&&(l.visible=o.visible),e.saveColumnWidths&&(l.width=o.width),i.columns?.push(l)}let n=e.storage==="session"?sessionStorage:localStorage;try{n.setItem(e.key,JSON.stringify(i))}catch(o){console.warn("Failed to save table state",o)}}loadStateFromStorage(){if(!this.storageOptions)return;let e={...ii,...this.storageOptions},i=localStorage.getItem(e.key);if(i)try{let r=JSON.parse(i),n={};if(e.saveSearchQuery&&(n.searchQuery=r.searchQuery),e.saveSelectedRows&&(n.selectedRows=r.selectedRows),r.columns){n.columns=[];for(let o of r.columns){let l={field:o.field};e.saveColumnVisibility&&(l.visible=o.visible),e.saveColumnWidths&&(l.width=o.width),e.saveColumnSortOrders&&(l.sort=o.sort),n.columns.push(l)}}this.updateTableState(n),this.hasRestoredState=!0}catch(r){console.error("Failed to restore DataTable state:",r)}}},ri=!1;function Ui(){ri||(ri=!0,console.warn(`[yatl-table] Data rows are missing a unique 'id' or 'key' property.
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Ct=/'/g,Et=/"/g,Rt=/^(?:script|style|textarea|title)$/i,et=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),g=et(1),Zi=et(2),er=et(3),w=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),Tt=new WeakMap,P=D.createTreeWalker(D,129);function Mt(s,t){if(!Ze(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return vt!==void 0?vt.createHTML(t):t}var $t=(s,t)=>{let e=s.length-1,i=[],r,o=t===2?"<svg>":t===3?"<math>":"",n=de;for(let l=0;l<e;l++){let a=s[l],c,d,h=-1,u=0;for(;u<a.length&&(n.lastIndex=u,d=n.exec(a),d!==null);)u=n.lastIndex,n===de?d[1]==="!--"?n=wt:d[1]!==void 0?n=St:d[2]!==void 0?(Rt.test(d[2])&&(r=RegExp("</"+d[2],"g")),n=N):d[3]!==void 0&&(n=N):n===N?d[0]===">"?(n=r??de,h=-1):d[1]===void 0?h=-2:(h=n.lastIndex-d[2].length,c=d[1],n=d[3]===void 0?N:d[3]==='"'?Et:Ct):n===Et||n===Ct?n=N:n===wt||n===St?n=de:(n=N,r=void 0);let m=n===N&&s[l+1].startsWith("/>")?" ":"";o+=n===de?a+wi:h>=0?(i.push(c),a.slice(0,h)+Xe+a.slice(h)+A+m):a+A+(h===-2?l:m)}return[Mt(s,o+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},fe=class s{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let o=0,n=0,l=t.length-1,a=this.parts,[c,d]=$t(t,e);if(this.el=s.createElement(c,i),P.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(r=P.nextNode())!==null&&a.length<l;){if(r.nodeType===1){if(r.hasAttributes())for(let h of r.getAttributeNames())if(h.endsWith(Xe)){let u=d[n++],m=r.getAttribute(h).split(A),y=/([.?@])?(.*)/.exec(u);a.push({type:1,index:o,name:y[2],strings:m,ctor:y[1]==="."?$e:y[1]==="?"?Ae:y[1]==="@"?ze:L}),r.removeAttribute(h)}else h.startsWith(A)&&(a.push({type:6,index:o}),r.removeAttribute(h));if(Rt.test(r.tagName)){let h=r.textContent.split(A),u=h.length-1;if(u>0){r.textContent=Re?Re.emptyScript:"";for(let m=0;m<u;m++)r.append(h[m],ue()),P.nextNode(),a.push({type:2,index:++o});r.append(h[u],ue())}}}else if(r.nodeType===8)if(r.data===Je)a.push({type:2,index:o});else{let h=-1;for(;(h=r.data.indexOf(A,h+1))!==-1;)a.push({type:7,index:o}),h+=A.length-1}o++}}static createElement(t,e){let i=D.createElement("template");return i.innerHTML=t,i}};function V(s,t,e=s,i){if(t===w)return t;let r=i!==void 0?e._$Co?.[i]:e._$Cl,o=pe(t)?void 0:t._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),o===void 0?r=void 0:(r=new o(s),r._$AT(s,e,i)),i!==void 0?(e._$Co??=[])[i]=r:e._$Cl=r),r!==void 0&&(t=V(s,r._$AS(s,t.values),r,i)),t}var Me=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:i}=this._$AD,r=(t?.creationScope??D).importNode(e,!0);P.currentNode=r;let o=P.nextNode(),n=0,l=0,a=i[0];for(;a!==void 0;){if(n===a.index){let c;a.type===2?c=new j(o,o.nextSibling,this,t):a.type===1?c=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(c=new Ie(o,this,t)),this._$AV.push(c),a=i[++l]}n!==a?.index&&(o=P.nextNode(),n++)}return P.currentNode=D,r}p(t){let e=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}},j=class s{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=b,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=V(this,t,e),pe(t)?t===b||t==null||t===""?(this._$AH!==b&&this._$AR(),this._$AH=b):t!==this._$AH&&t!==w&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):xt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==b&&pe(this._$AH)?this._$AA.nextSibling.data=t:this.T(D.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=fe.createElement(Mt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(e);else{let o=new Me(r,this),n=o.u(this.options);o.p(e),this.T(n),this._$AH=o}}_$AC(t){let e=Tt.get(t.strings);return e===void 0&&Tt.set(t.strings,e=new fe(t)),e}k(t){Ze(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,i,r=0;for(let o of t)r===e.length?e.push(i=new s(this.O(ue()),this.O(ue()),this,this.options)):i=e[r],i._$AI(o),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let i=yt(t).nextSibling;yt(t).remove(),t=i}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},L=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,r,o){this.type=1,this._$AH=b,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=b}_$AI(t,e=this,i,r){let o=this.strings,n=!1;if(o===void 0)t=V(this,t,e,0),n=!pe(t)||t!==this._$AH&&t!==w,n&&(this._$AH=t);else{let l=t,a,c;for(t=o[0],a=0;a<o.length-1;a++)c=V(this,l[i+a],e,a),c===w&&(c=this._$AH[a]),n||=!pe(c)||c!==this._$AH[a],c===b?t=b:t!==b&&(t+=(c??"")+o[a+1]),this._$AH[a]=c}n&&!r&&this.j(t)}j(t){t===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},$e=class extends L{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===b?void 0:t}},Ae=class extends L{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==b)}},ze=class extends L{constructor(t,e,i,r,o){super(t,e,i,r,o),this.type=5}_$AI(t,e=this){if((t=V(this,t,e,0)??b)===w)return;let i=this._$AH,r=t===b&&i!==b||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==b&&(i===b||r);r&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},Ie=class{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){V(this,t)}},At={M:Xe,P:A,A:Je,C:1,L:$t,R:Me,D:xt,V,I:j,H:L,N:Ae,U:ze,B:$e,F:Ie},Si=Ge.litHtmlPolyfillSupport;Si?.(fe,j),(Ge.litHtmlVersions??=[]).push("3.3.2");var zt=(s,t,e)=>{let i=e?.renderBefore??t,r=i._$litPart$;if(r===void 0){let o=e?.renderBefore??null;i._$litPart$=r=new j(t.insertBefore(ue(),o),o,void 0,e??{})}return r._$AI(s),r};var tt=globalThis,E=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=zt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return w}};E._$litElement$=!0,E.finalized=!0,tt.litElementHydrateSupport?.({LitElement:E});var Ci=tt.litElementPolyfillSupport;Ci?.({LitElement:E});(tt.litElementVersions??=[]).push("4.2.2");function It(s,t){if(!s||!t||t.length===0)return s;let e=[...t].sort((l,a)=>l[0]-a[0]),i=[],r=e[0];for(let l=1;l<e.length;l++){let a=e[l];a[0]<r[1]?r[1]=Math.max(r[1],a[1]):(i.push(r),r=a)}i.push(r);let o=[],n=0;for(let[l,a]of i){let c=Math.max(0,Math.min(l,s.length)),d=Math.max(0,Math.min(a,s.length));c>n&&o.push(s.slice(n,c)),o.push(g`<mark class="highlight">${s.slice(c,d)}</mark>`),n=d}return n<s.length&&o.push(s.slice(n)),g`${o}`}var Ot=s=>s.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase());var kt=s=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(s,t)}):customElements.define(s,t)};var Ei={attribute:!0,type:String,converter:he,reflect:!1,hasChanged:xe},Ti=(s=Ei,t,e)=>{let{kind:i,metadata:r}=e,o=globalThis.litPropertyMetadata.get(r);if(o===void 0&&globalThis.litPropertyMetadata.set(r,o=new Map),i==="setter"&&((s=Object.create(s)).wrapped=!0),o.set(e.name,s),i==="accessor"){let{name:n}=e;return{set(l){let a=t.get.call(this);t.set.call(this,l),this.requestUpdate(n,a,s,!0,l)},init(l){return l!==void 0&&this.C(n,void 0,s,l),l}}}if(i==="setter"){let{name:n}=e;return function(l){let a=this[n];t.call(this,l),this.requestUpdate(n,a,s,!0,l)}}throw Error("Unsupported decorator location: "+i)};function p(s){return(t,e)=>typeof e=="object"?Ti(s,t,e):((i,r,o)=>{let n=r.hasOwnProperty(o);return r.constructor.createProperty(o,i),n?Object.getOwnPropertyDescriptor(r,o):void 0})(s,t,e)}function Nt(s){return p({...s,state:!0,attribute:!1})}var U=(s,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(s,t,e),e);function it(s,t){return(e,i,r)=>{let o=n=>n.renderRoot?.querySelector(s)??null;if(t){let{get:n,set:l}=typeof i=="object"?e:r??(()=>{let a=Symbol();return{get(){return this[a]},set(c){this[a]=c}}})();return U(e,i,{get(){let a=n.call(this);return a===void 0&&(a=o(this),(a!==null||this.hasUpdated)&&l.call(this,a)),a}})}return U(e,i,{get(){return o(this)}})}}var x={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},z=s=>(...t)=>({_$litDirective$:s,values:t}),T=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var me=z(class extends T{constructor(s){if(super(s),s.type!==x.ATTRIBUTE||s.name!=="class"||s.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter(t=>s[t]).join(" ")+" "}update(s,[t]){if(this.st===void 0){this.st=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(i=>i!=="")));for(let i in t)t[i]&&!this.nt?.has(i)&&this.st.add(i);return this.render(t)}let e=s.element.classList;for(let i of this.st)i in t||(e.remove(i),this.st.delete(i));for(let i in t){let r=!!t[i];r===this.st.has(i)||this.nt?.has(i)||(r?(e.add(i),this.st.add(i)):(e.remove(i),this.st.delete(i)))}return w}});var _e=s=>s??b;var{I:xi}=At,Pt=s=>s;var Vt=s=>s.strings===void 0,Dt=()=>document.createComment(""),H=(s,t,e)=>{let i=s._$AA.parentNode,r=t===void 0?s._$AB:t._$AA;if(e===void 0){let o=i.insertBefore(Dt(),r),n=i.insertBefore(Dt(),r);e=new xi(o,n,s,s.options)}else{let o=e._$AB.nextSibling,n=e._$AM,l=n!==s;if(l){let a;e._$AQ?.(s),e._$AM=s,e._$AP!==void 0&&(a=s._$AU)!==n._$AU&&e._$AP(a)}if(o!==r||l){let a=e._$AA;for(;a!==o;){let c=Pt(a).nextSibling;Pt(i).insertBefore(a,r),a=c}}}return e},k=(s,t,e=s)=>(s._$AI(t,e),s),Ri={},Lt=(s,t=Ri)=>s._$AH=t,Ut=s=>s._$AH,Oe=s=>{s._$AR(),s._$AA.remove()};var jt=(s,t,e)=>{let i=new Map;for(let r=t;r<=e;r++)i.set(s[r],r);return i},ke=z(class extends T{constructor(s){if(super(s),s.type!==x.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,t,e){let i;e===void 0?e=t:t!==void 0&&(i=t);let r=[],o=[],n=0;for(let l of s)r[n]=i?i(l,n):n,o[n]=e(l,n),n++;return{values:o,keys:r}}render(s,t,e){return this.dt(s,t,e).values}update(s,[t,e,i]){let r=Ut(s),{values:o,keys:n}=this.dt(t,e,i);if(!Array.isArray(r))return this.ut=n,o;let l=this.ut??=[],a=[],c,d,h=0,u=r.length-1,m=0,y=o.length-1;for(;h<=u&&m<=y;)if(r[h]===null)h++;else if(r[u]===null)u--;else if(l[h]===n[m])a[m]=k(r[h],o[m]),h++,m++;else if(l[u]===n[y])a[y]=k(r[u],o[y]),u--,y--;else if(l[h]===n[y])a[y]=k(r[h],o[y]),H(s,a[y+1],r[h]),h++,y--;else if(l[u]===n[m])a[m]=k(r[u],o[m]),H(s,r[h],r[u]),u--,m++;else if(c===void 0&&(c=jt(n,m,y),d=jt(l,h,u)),c.has(l[h]))if(c.has(l[u])){let C=d.get(n[m]),K=C!==void 0?r[C]:null;if(K===null){let R=H(s,r[h]);k(R,o[m]),a[m]=R}else a[m]=k(K,o[m]),H(s,r[h],K),r[C]=null;m++}else Oe(r[u]),u--;else Oe(r[h]),h++;for(;m<=y;){let C=H(s,a[y+1]);k(C,o[m]),a[m++]=C}for(;h<=u;){let C=r[h++];C!==null&&Oe(C)}return this.ut=n,Lt(s,a),w}});var Ht="important",Mi=" !"+Ht,Ft=z(class extends T{constructor(s){if(super(s),s.type!==x.ATTRIBUTE||s.name!=="style"||s.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce((t,e)=>{let i=s[e];return i==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(s,[t]){let{style:e}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let i of this.ft)t[i]==null&&(this.ft.delete(i),i.includes("-")?e.removeProperty(i):e[i]=null);for(let i in t){let r=t[i];if(r!=null){this.ft.add(i);let o=typeof r=="string"&&r.endsWith(Mi);i.includes("-")||o?e.setProperty(i,o?r.slice(0,-11):r,o?Ht:""):e[i]=r}}return w}});function F(s,t,e,i){var r=arguments.length,o=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,i);else for(var l=s.length-1;l>=0;l--)(n=s[l])&&(o=(r<3?n(o):r>3?n(t,e,o):n(t,e))||o);return r>3&&o&&Object.defineProperty(t,e,o),o}var ge=(s,t)=>{let e=s._$AN;if(e===void 0)return!1;for(let i of e)i._$AO?.(t,!1),ge(i,t);return!0},Ne=s=>{let t,e;do{if((t=s._$AM)===void 0)break;e=t._$AN,e.delete(s),s=t}while(e?.size===0)},qt=s=>{for(let t;t=s._$AM;s=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(s))break;e.add(s),zi(t)}};function $i(s){this._$AN!==void 0?(Ne(this),this._$AM=s,qt(this)):this._$AM=s}function Ai(s,t=!1,e=0){let i=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(t)if(Array.isArray(i))for(let o=e;o<i.length;o++)ge(i[o],!1),Ne(i[o]);else i!=null&&(ge(i,!1),Ne(i));else ge(this,s)}var zi=s=>{s.type==x.CHILD&&(s._$AP??=Ai,s._$AQ??=$i)},Pe=class extends T{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),qt(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(ge(this,t),Ne(this))}setValue(t){if(Vt(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};var q=class s extends Event{constructor(t){super(s.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}};q.eventName="rangeChanged";var B=class s extends Event{constructor(t){super(s.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}};B.eventName="visibilityChanged";var be=class s extends Event{constructor(){super(s.eventName,{bubbles:!1})}};be.eventName="unpinned";var rt=class{constructor(t){this._element=null;let e=t??window;this._node=e,t&&(this._element=t)}get element(){return this._element||document.scrollingElement||document.documentElement}get scrollTop(){return this.element.scrollTop||window.scrollY}get scrollLeft(){return this.element.scrollLeft||window.scrollX}get scrollHeight(){return this.element.scrollHeight}get scrollWidth(){return this.element.scrollWidth}get viewportHeight(){return this._element?this._element.getBoundingClientRect().height:window.innerHeight}get viewportWidth(){return this._element?this._element.getBoundingClientRect().width:window.innerWidth}get maxScrollTop(){return this.scrollHeight-this.viewportHeight}get maxScrollLeft(){return this.scrollWidth-this.viewportWidth}},De=class extends rt{constructor(t,e){super(e),this._clients=new Set,this._retarget=null,this._end=null,this.__destination=null,this.correctingScrollError=!1,this._checkForArrival=this._checkForArrival.bind(this),this._updateManagedScrollTo=this._updateManagedScrollTo.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollBy=this.scrollBy.bind(this);let i=this._node;this._originalScrollTo=i.scrollTo,this._originalScrollBy=i.scrollBy,this._originalScroll=i.scroll,this._attach(t)}get _destination(){return this.__destination}get scrolling(){return this._destination!==null}scrollTo(t,e){let i=typeof t=="number"&&typeof e=="number"?{left:t,top:e}:t;this._scrollTo(i)}scrollBy(t,e){let i=typeof t=="number"&&typeof e=="number"?{left:t,top:e}:t;i.top!==void 0&&(i.top+=this.scrollTop),i.left!==void 0&&(i.left+=this.scrollLeft),this._scrollTo(i)}_nativeScrollTo(t){this._originalScrollTo.bind(this._element||window)(t)}_scrollTo(t,e=null,i=null){this._end!==null&&this._end(),t.behavior==="smooth"?(this._setDestination(t),this._retarget=e,this._end=i):this._resetScrollState(),this._nativeScrollTo(t)}_setDestination(t){let{top:e,left:i}=t;return e=e===void 0?void 0:Math.max(0,Math.min(e,this.maxScrollTop)),i=i===void 0?void 0:Math.max(0,Math.min(i,this.maxScrollLeft)),this._destination!==null&&i===this._destination.left&&e===this._destination.top?!1:(this.__destination={top:e,left:i,behavior:"smooth"},!0)}_resetScrollState(){this.__destination=null,this._retarget=null,this._end=null}_updateManagedScrollTo(t){this._destination&&this._setDestination(t)&&this._nativeScrollTo(this._destination)}managedScrollTo(t,e,i){return this._scrollTo(t,e,i),this._updateManagedScrollTo}correctScrollError(t){this.correctingScrollError=!0,requestAnimationFrame(()=>requestAnimationFrame(()=>this.correctingScrollError=!1)),this._nativeScrollTo(t),this._retarget&&this._setDestination(this._retarget()),this._destination&&this._nativeScrollTo(this._destination)}_checkForArrival(){if(this._destination!==null){let{scrollTop:t,scrollLeft:e}=this,{top:i,left:r}=this._destination;i=Math.min(i||0,this.maxScrollTop),r=Math.min(r||0,this.maxScrollLeft);let o=Math.abs(i-t),n=Math.abs(r-e);o<1&&n<1&&(this._end&&this._end(),this._resetScrollState())}}detach(t){return this._clients.delete(t),this._clients.size===0&&(this._node.scrollTo=this._originalScrollTo,this._node.scrollBy=this._originalScrollBy,this._node.scroll=this._originalScroll,this._node.removeEventListener("scroll",this._checkForArrival)),null}_attach(t){this._clients.add(t),this._clients.size===1&&(this._node.scrollTo=this.scrollTo,this._node.scrollBy=this.scrollBy,this._node.scroll=this.scrollTo,this._node.addEventListener("scroll",this._checkForArrival))}};var Gt=typeof window<"u"?window.ResizeObserver:void 0;var ve=Symbol("virtualizerRef"),Ue="virtualizer-sizer",Xt,He=class{constructor(t){if(this._benchmarkStart=null,this._layout=null,this._clippingAncestors=[],this._scrollSize=null,this._scrollError=null,this._childrenPos=null,this._childMeasurements=null,this._toBeMeasured=new Map,this._rangeChanged=!0,this._itemsChanged=!0,this._visibilityChanged=!0,this._scrollerController=null,this._isScroller=!1,this._sizer=null,this._hostElementRO=null,this._childrenRO=null,this._mutationObserver=null,this._scrollEventListeners=[],this._scrollEventListenerOptions={passive:!0},this._loadListener=this._childLoaded.bind(this),this._scrollIntoViewTarget=null,this._updateScrollIntoViewCoordinates=null,this._items=[],this._first=-1,this._last=-1,this._firstVisible=-1,this._lastVisible=-1,this._scheduled=new WeakSet,this._measureCallback=null,this._measureChildOverride=null,this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null,this._layoutInitialized=null,this._connected=!1,!t)throw new Error("Virtualizer constructor requires a configuration object");if(t.hostElement)this._init(t);else throw new Error('Virtualizer configuration requires the "hostElement" property')}set items(t){Array.isArray(t)&&t!==this._items&&(this._itemsChanged=!0,this._items=t,this._schedule(this._updateLayout))}_init(t){this._isScroller=!!t.scroller,this._initHostElement(t);let e=t.layout||{};this._layoutInitialized=this._initLayout(e)}_initObservers(){this._mutationObserver=new MutationObserver(this._finishDOMUpdate.bind(this)),this._hostElementRO=new Gt(()=>this._hostElementSizeChanged()),this._childrenRO=new Gt(this._childrenSizeChanged.bind(this))}_initHostElement(t){let e=this._hostElement=t.hostElement;this._applyVirtualizerStyles(),e[ve]=this}connected(){this._initObservers();let t=this._isScroller;this._clippingAncestors=Vi(this._hostElement,t),this._scrollerController=new De(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach(t=>{t.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(t),this._hostElementRO.observe(t)}),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach(t=>this._childrenRO.observe(t)),this._scrollEventListeners.forEach(t=>t.addEventListener("scroll",this,this._scrollEventListenerOptions))}disconnected(){this._scrollEventListeners.forEach(t=>t.removeEventListener("scroll",this,this._scrollEventListenerOptions)),this._scrollEventListeners=[],this._clippingAncestors=[],this._scrollerController?.detach(this),this._scrollerController=null,this._mutationObserver?.disconnect(),this._mutationObserver=null,this._hostElementRO?.disconnect(),this._hostElementRO=null,this._childrenRO?.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){let e=this._hostElement.style;e.display=e.display||"block",e.position=e.position||"relative",e.contain=e.contain||"size layout",this._isScroller&&(e.overflow=e.overflow||"auto",e.minHeight=e.minHeight||"150px")}_getSizer(){let t=this._hostElement;if(!this._sizer){let e=t.querySelector(`[${Ue}]`);e||(e=document.createElement("div"),e.setAttribute(Ue,""),t.appendChild(e)),Object.assign(e.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),e.textContent="&nbsp;",e.setAttribute(Ue,""),this._sizer=e}return this._sizer}async updateLayoutConfig(t){await this._layoutInitialized;let e=t.type||Xt;if(typeof e=="function"&&this._layout instanceof e){let i={...t};return delete i.type,this._layout.config=i,!0}return!1}async _initLayout(t){let e,i;if(typeof t.type=="function"){i=t.type;let r={...t};delete r.type,e=r}else e=t;i===void 0&&(Xt=i=(await Promise.resolve().then(()=>(Yt(),Qt))).FlowLayout),this._layout=new i(r=>this._handleLayoutMessage(r),e),this._layout.measureChildren&&typeof this._layout.updateItemSizes=="function"&&(typeof this._layout.measureChildren=="function"&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){this._benchmarkStart===null&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(this._benchmarkStart!==null){let t=window.performance.now(),e=t-this._benchmarkStart,r=performance.getEntriesByName("uv-virtualizing","measure").filter(o=>o.startTime>=this._benchmarkStart&&o.startTime<t).reduce((o,n)=>o+n.duration,0);return this._benchmarkStart=null,{timeElapsed:e,virtualizationTime:r}}return null}_measureChildren(){let t={},e=this._children,i=this._measureChildOverride||this._measureChild;for(let r=0;r<e.length;r++){let o=e[r],n=this._first+r;(this._itemsChanged||this._toBeMeasured.has(o))&&(t[n]=i.call(this,o,this._items[n]))}this._childMeasurements=t,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(t){let{width:e,height:i}=t.getBoundingClientRect();return Object.assign({width:e,height:i},Pi(t))}async _schedule(t){this._scheduled.has(t)||(this._scheduled.add(t),await Promise.resolve(),this._scheduled.delete(t),t.call(this))}async _updateDOM(t){this._scrollSize=t.scrollSize,this._adjustRange(t.range),this._childrenPos=t.childPositions,this._scrollError=t.scrollError||null;let{_rangeChanged:e,_itemsChanged:i}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(e||i)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach(t=>this._childrenRO.observe(t)),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),this._childMeasurements!==null&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(t){console.warn("Error measuring performance data: ",t)}window.performance.mark("uv-start")}this._scrollerController.correctingScrollError===!1&&this._layout?.unpin(),this._schedule(this._updateLayout)}handleEvent(t){t.type==="scroll"?(t.currentTarget===window||this._clippingAncestors.includes(t.currentTarget))&&this._handleScrollEvent():console.warn("event not handled",t)}_handleLayoutMessage(t){t.type==="stateChanged"?this._updateDOM(t):t.type==="visibilityChanged"?(this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._notifyVisibility()):t.type==="unpinned"&&this._hostElement.dispatchEvent(new be)}get _children(){let t=[],e=this._hostElement.firstElementChild;for(;e;)e.hasAttribute(Ue)||t.push(e),e=e.nextElementSibling;return t}_updateView(){let t=this._hostElement,e=this._scrollerController?.element,i=this._layout;if(t&&e&&i){let r,o,n,l,a=t.getBoundingClientRect();r=0,o=0,n=window.innerHeight,l=window.innerWidth;let c=this._clippingAncestors.map(R=>R.getBoundingClientRect());c.unshift(a);for(let R of c)r=Math.max(r,R.top),o=Math.max(o,R.left),n=Math.min(n,R.bottom),l=Math.min(l,R.right);let d=e.getBoundingClientRect(),h={left:a.left-d.left,top:a.top-d.top},u={width:e.scrollWidth,height:e.scrollHeight},m=r-a.top+t.scrollTop,y=o-a.left+t.scrollLeft,C=Math.max(0,n-r),K=Math.max(0,l-o);i.viewportSize={width:K,height:C},i.viewportScroll={top:m,left:y},i.totalScrollSize=u,i.offsetWithinScroller=h}}_sizeHostElement(t){let i=t&&t.width!==null?Math.min(82e5,t.width):0,r=t&&t.height!==null?Math.min(82e5,t.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${i}px, ${r}px)`;else{let o=this._hostElement.style;o.minWidth=i?`${i}px`:"100%",o.minHeight=r?`${r}px`:"100%"}}_positionChildren(t){t&&t.forEach(({top:e,left:i,width:r,height:o,xOffset:n,yOffset:l},a)=>{let c=this._children[a-this._first];c&&(c.style.position="absolute",c.style.boxSizing="border-box",c.style.transform=`translate(${i}px, ${e}px)`,r!==void 0&&(c.style.width=r+"px"),o!==void 0&&(c.style.height=o+"px"),c.style.left=n===void 0?null:n+"px",c.style.top=l===void 0?null:l+"px")})}async _adjustRange(t){let{_first:e,_last:i,_firstVisible:r,_lastVisible:o}=this;this._first=t.first,this._last=t.last,this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==e||this._last!==i,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==r||this._lastVisible!==o}_correctScrollError(){if(this._scrollError){let{scrollTop:t,scrollLeft:e}=this._scrollerController,{top:i,left:r}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:t-i,left:e-r})}}element(t){return t===1/0&&(t=this._items.length-1),this._items?.[t]===void 0?void 0:{scrollIntoView:(e={})=>this._scrollElementIntoView({...e,index:t})}}_scrollElementIntoView(t){if(t.index>=this._first&&t.index<=this._last)this._children[t.index-this._first].scrollIntoView(t);else if(t.index=Math.min(t.index,this._items.length-1),t.behavior==="smooth"){let e=this._layout.getScrollIntoViewCoordinates(t),{behavior:i}=t;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(e,{behavior:i}),()=>this._layout.getScrollIntoViewCoordinates(t),()=>this._scrollIntoViewTarget=null),this._scrollIntoViewTarget=t}else this._layout.pin=t}_checkScrollIntoViewTarget(t){let{index:e}=this._scrollIntoViewTarget||{};e&&t?.has(e)&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new q({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new B({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise((t,e)=>{this._layoutCompleteResolver=t,this._layoutCompleteRejecter=e})),this._layoutCompletePromise}_rejectLayoutCompletePromise(t){this._layoutCompleteRejecter!==null&&this._layoutCompleteRejecter(t),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&this._pendingLayoutComplete===null&&(this._pendingLayoutComplete=requestAnimationFrame(()=>requestAnimationFrame(()=>this._resolveLayoutCompletePromise())))}_resolveLayoutCompletePromise(){this._layoutCompleteResolver!==null&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(t){if(this._layout?.measureChildren){for(let e of t)this._toBeMeasured.set(e.target,e.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}};function Pi(s){let t=window.getComputedStyle(s);return{marginTop:je(t.marginTop),marginRight:je(t.marginRight),marginBottom:je(t.marginBottom),marginLeft:je(t.marginLeft)}}function je(s){let t=s?parseFloat(s):NaN;return Number.isNaN(t)?0:t}function Jt(s){if(s.assignedSlot!==null)return s.assignedSlot;if(s.parentElement!==null)return s.parentElement;let t=s.parentNode;return t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host||null}function Di(s,t=!1){let e=[],i=t?s:Jt(s);for(;i!==null;)e.push(i),i=Jt(i);return e}function Vi(s,t=!1){let e=!1;return Di(s,t).filter(i=>{if(e)return!1;let r=getComputedStyle(i);return e=r.position==="fixed",r.overflow!=="visible"})}var lt=s=>s,at=(s,t)=>g`${t}: ${JSON.stringify(s,null,2)}`,nt=class extends Pe{constructor(t){if(super(t),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(e,i)=>at(e,i+this._first),this._keyFunction=(e,i)=>lt(e,i+this._first),this._items=[],t.type!==x.CHILD)throw new Error("The virtualize directive can only be used in child expressions")}render(t){t&&this._setFunctions(t);let e=[];if(this._first>=0&&this._last>=this._first)for(let i=this._first;i<=this._last;i++)e.push(this._items[i]);return ke(e,this._keyFunction,this._renderItem)}update(t,[e]){this._setFunctions(e);let i=this._items!==e.items;return this._items=e.items||[],this._virtualizer?this._updateVirtualizerConfig(t,e):this._initialize(t,e),i?w:this.render()}async _updateVirtualizerConfig(t,e){if(!await this._virtualizer.updateLayoutConfig(e.layout||{})){let r=t.parentNode;this._makeVirtualizer(r,e)}this._virtualizer.items=this._items}_setFunctions(t){let{renderItem:e,keyFunction:i}=t;e&&(this._renderItem=(r,o)=>e(r,o+this._first)),i&&(this._keyFunction=(r,o)=>i(r,o+this._first))}_makeVirtualizer(t,e){this._virtualizer&&this._virtualizer.disconnected();let{layout:i,scroller:r,items:o}=e;this._virtualizer=new He({hostElement:t,layout:i,scroller:r}),this._virtualizer.items=o,this._virtualizer.connected()}_initialize(t,e){let i=t.parentNode;i&&i.nodeType===1&&(i.addEventListener("rangeChanged",r=>{this._first=r.first,this._last=r.last,this.setValue(this.render())}),this._makeVirtualizer(i,e))}disconnected(){this._virtualizer?.disconnected()}reconnected(){this._virtualizer?.connected()}},Zt=z(nt);var I=class extends E{constructor(){super(...arguments),this.items=[],this.renderItem=at,this.keyFunction=lt,this.layout={},this.scroller=!1}createRenderRoot(){return this}render(){let{items:t,renderItem:e,keyFunction:i,layout:r,scroller:o}=this;return g`${Zt({items:t,renderItem:e,keyFunction:i,layout:r,scroller:o})}`}element(t){return this[ve]?.element(t)}get layoutComplete(){return this[ve]?.layoutComplete}scrollToIndex(t,e="start"){this.element(t)?.scrollIntoView({block:e})}};F([p({attribute:!1})],I.prototype,"items",void 0);F([p()],I.prototype,"renderItem",void 0);F([p()],I.prototype,"keyFunction",void 0);F([p({attribute:!1})],I.prototype,"layout",void 0);F([p({reflect:!0,type:Boolean})],I.prototype,"scroller",void 0);customElements.define("lit-virtualizer",I);function ei(s){return typeof s=="string"||typeof s=="number"||typeof s=="bigint"?s:typeof s=="boolean"?Number(s):s instanceof Date?s.getTime():String(s)}function ti(s,t){let e=Array.from(new Set(s)),i=new Intl.Collator(t,{numeric:!0,sensitivity:"base"});e.sort(([o,n],[l,a])=>{if(n==null&&a==null)return 0;if(n==null)return-1;if(n==null)return 1;let c=ei(n),d=ei(a);return typeof c=="string"&&typeof d=="string"?i.compare(String(c),String(d)):c<d?-1:d<c?1:0});let r=new Map;return e.forEach(([o,n],l)=>r.set(o,l)),r}var Li=1e3,ii={storage:"local",saveColumnSortOrders:!0,saveColumnVisibility:!0,saveColumnWidths:!0,saveColumnOrder:!0,saveSelectedRows:!0},ct={EXACT:100,PREFIX:50,SUBSTRING:10},we=class extends le{constructor(e,i){super();this.hosts=new Set;this._enableSearchTokenization=!1;this._enableSearchScoring=!1;this._columns=[];this._columnDefinitionMap=new Map;this._columnStateMap=new Map;this._rowSelectionMethod=null;this._selectedRowIds=new Set;this._storageOptions=null;this._rowIdCallback=(e,i)=>"id"in e&&ne(e.id)?e.id:"key"in e&&ne(e.key)?e.key:"_id"in e&&ne(e._id)?e._id:(Ui(),i);this._data=[];this._filteredData=[];this._dataUpdateTimestamp=null;this._searchQuery="";this._searchTokenizer=Be;this._filters=null;this.hasRestoredState=!1;this.saveTimer=0;this.filterDirty=!1;this.sortDirty=!1;this.rowMetadata=new WeakMap;this.idToRowMap=new Map;this.queryTokens=null;e&&this.attach(e),i&&(i.enableSearchScoring!==void 0&&(this.enableSearchScoring=i.enableSearchScoring),i.enableSearchTokenization!==void 0&&(this.enableSearchTokenization=i.enableSearchTokenization),i.searchTokenizer!==void 0&&(this.searchTokenizer=i.searchTokenizer),i.rowIdCallback!==void 0&&(this.rowIdCallback=i.rowIdCallback),i.rowSelectionMethod!==void 0&&(this.rowSelectionMethod=i.rowSelectionMethod),i.storageOptions!==void 0&&(this.storageOptions=i.storageOptions),i.columns!==void 0&&(this.columns=i.columns),i.data!==void 0&&(this.data=i.data))}get enableSearchTokenization(){return this._enableSearchTokenization}set enableSearchTokenization(e){this._enableSearchTokenization!==e&&(this._enableSearchTokenization=e,this.updateInternalQuery(),this.filterDirty=!0,this.requestUpdate("enableSearchTokenization"))}get enableSearchScoring(){return this._enableSearchScoring}set enableSearchScoring(e){this._enableSearchScoring!==e&&(this._enableSearchScoring=e,this.filterDirty=!0,this.requestUpdate("enableSearchScoring"))}get columns(){return[...this._columns]}set columns(e){this._columns=[...e],this.filterDirty=!0,this._columnDefinitionMap=new Map;for(let i of e)this._columnDefinitionMap.set(i.field,i);this.requestUpdate("columns")}get displayColumns(){return this.columns.filter(M)}get columnStates(){return this.columns.map(e=>{let i=this.getColumnState(e.field);return O(e.field,i)})}set columnStates(e){let i=!1;for(let r of e){let o=this.getColumnState(r.field),n=oe(o,r);if(n.length){i=!0,n.includes("sort")&&(this.sortDirty=!0);let l=O(r.field,r);this._columnStateMap.set(r.field,l)}}i&&this.requestUpdate("columnStates")}get searchQuery(){return this._searchQuery}set searchQuery(e){this._searchQuery!==e&&(this._searchQuery=e,this.updateInternalQuery(),this.filterDirty=!0,this.requestUpdate("searchQuery"))}get searchTokenizer(){return this._searchTokenizer}set searchTokenizer(e){this._searchTokenizer!==e&&(this._searchTokenizer=e,this.filterDirty=!0,this.requestUpdate("searchTokenizer"))}get filters(){return this._filters}set filters(e){this._filters!==e&&(this._filters=e,this.filterDirty=!0,this.requestUpdate("filters"))}get rowSelectionMethod(){return this._rowSelectionMethod}set rowSelectionMethod(e){this._rowSelectionMethod===e||!qe(e)||(this._rowSelectionMethod=e,this.requestUpdate("rowSelectionMethod"))}get selectedRowIds(){let e=[...this._selectedRowIds];return this.rowSelectionMethod==="single"?e=e.slice(0,1):this.rowSelectionMethod||(e=[]),e}set selectedRowIds(e){e.length===this._selectedRowIds.size&&e.every(i=>this._selectedRowIds.has(i))||(this._selectedRowIds=new Set(e),this.requestUpdate("selectedRowIds"))}get storageOptions(){return this._storageOptions?{...this._storageOptions}:null}set storageOptions(e){this._storageOptions!==e&&(this._storageOptions=e?{...e}:null,this.hasRestoredState||(this.loadStateFromStorage(),this.requestUpdate("storageOptions")))}get rowIdCallback(){return this._rowIdCallback}set rowIdCallback(e){if(this._rowIdCallback!==e){this._rowIdCallback=e;for(let i=0;i<this.data.length;++i){let r=this.data[i];this.rowMetadata.get(r).id=this._rowIdCallback(r,i)}this.requestUpdate("rowIdCallback")}}get data(){return[...this._data]}set data(e){this._data=[...e],this.createMetadata(),this._dataUpdateTimestamp=new Date,this.filterDirty=!0,this.requestUpdate("data")}get filteredData(){return this.filterDirty?this.filterRows():this.sortDirty&&this.sortRows(),this.filterDirty=!1,this.sortDirty=!1,[...this._filteredData]}get dataUpdateTimestamp(){return this._dataUpdateTimestamp}attach(e){this.hosts.add(e),e.addController(this),e.requestUpdate()}detach(e){e.removeController(this),this.hosts.delete(e)}getColumn(e){return this._columnDefinitionMap.get(e)}getDisplayColumn(e){let i=this._columnDefinitionMap.get(e);if(M(i))return i}getTableState(){return{searchQuery:this.searchQuery,selectedRows:this.selectedRowIds,columns:this.columnStates.map(e=>{let i=this.getColumnState(e.field);return O(e.field,i)})}}updateTableState(e){if("searchQuery"in e&&e.searchQuery!==void 0&&(this.searchQuery=e.searchQuery),"selectedRows"in e&&e.selectedRows&&(this.selectedRowIds=e.selectedRows),"columns"in e&&e.columns!==void 0)for(let i of e.columns)this.updateColumnState(i.field,i);this.requestUpdate()}getColumnState(e){let i=this._columnStateMap.get(e);if(!i){let r=O(e);return this._columnStateMap.set(e,r),r}return O(e,i)}updateColumnState(e,i){let r=this._columnStateMap.get(e),o=O(e,{...r,...i});this.columnStates=[o]}search(e){this.searchQuery=e,this.dispatchEvent(new ie(e))}getColumnFilterValues(e,i=!1){let r=this.getDisplayColumn(e),o=new Map;for(let n of this.filteredData){let l=S(n,e);if(r?.valueFormatter&&(l=r.valueFormatter(l,n)),l!=null||i){let a=o.get(l)??0;o.set(l,a+1)}}return o}sort(e,i,r=!0){let o=this.getColumnState(e);if(o===void 0)throw new Error(`Cannot get options for non-existent column "${e}"`);if(i===o?.sort?.order)return;if(i&&!o.sort){let a=[...this._columnStateMap.values()].map(h=>h.sort?.priority).filter(h=>h!==void 0),c=this.columns.length+1,d=Math.min(c,...a)-1;o.sort={order:i,priority:d}}else i&&o.sort?o.sort.order=i:o.sort=null;let n=[o];if(r){for(let a of this.columns)if(a.field!==e){let c=this.getColumnState(a.field);c.sort=null,n.push(c)}}this.columnStates=n;let l=new X(e,i,!r);this.dispatchEvent(l)}toggleColumnVisibility(e,i){let r=this.getColumnState(e),o=i!==void 0?i:!r.visible;if(o===r.visible)return;r.visible=o,this.columnStates=[r];let n=new J(e,o);this.dispatchEvent(n)}showColumn(e){this.toggleColumnVisibility(e,!0)}hideColumn(e){this.toggleColumnVisibility(e,!1)}moveColumn(e,i){let r=this.displayColumns,o=r.findIndex(l=>l.field===e),n=typeof i=="number"?i:r.findIndex(l=>l.field===i);if(o>-1&&n>-1){let[l]=r.splice(o,1);r.splice(n,0,l),this.columns=r;let a=new te(r.map(c=>c.field));this.dispatchEvent(a)}}resizeColumn(e,i){let r=this.getColumnState(e);r.width=i,this.updateColumnState(e,r),this.dispatchEvent(new Z(e,i))}isRowSelected(e){let i=this.getRowId(e);return this.selectedRowIds.includes(i)}toggleRowSelection(e,i){let r=this.getRowId(e),o=this.isRowSelected(e),n=i!==void 0?i:o;if(n===o)return;let l;n?l=this.rowSelectionMethod==="single"?[r]:[...this.selectedRowIds,r]:l=this.selectedRowIds.filter(d=>d!==r);let a=this.selectedRowIds;this.selectedRowIds=l;let c=new Y(l,a);this.dispatchEvent(c)}selectRow(e){this.toggleRowSelection(e,!0)}deselectRow(e){this.toggleRowSelection(e,!1)}selectAll(){if(this.rowSelectionMethod==="single")return;let e=this.filteredData.map(i=>this.getRowId(i));this.selectedRowIds=e}deselectAll(){this.selectedRowIds=[]}export(e={includeAllRows:!1,includeHiddenColumns:!1,includeInternalColumns:!1}){let i=e.includeAllRows?this.data:this.filteredData,r=e.includeInternalColumns?this.columns:this.displayColumns,o=r.filter(a=>e.includeHiddenColumns?!0:this.getColumnState(a.field).visible).map(a=>M(a)?a.title:a.field).join(","),n=i.map(a=>{let c=[];for(let d of r){let h=this.getColumnState(d.field),u=S(a,d.field);(e.includeHiddenColumns||h.visible)&&(M(d)&&typeof d.valueFormatter=="function"&&(u=d.valueFormatter(u,a)),u=String(u).replace('"','""'),c.push(`"${u}"`))}return c.join(",")}).join(`
4
+ `),l=o+`
5
+ `+n;return new Blob([l],{type:"text/csv;charset=utf-8,"})}getRow(e){return this.idToRowMap.get(e)}findRow(e,i){return this.data.find(r=>S(r,e)===i)}findRowIndex(e,i){let r=this.findRow(e,i);return r?this.rowMetadata.get(r).index:-1}updateRow(e,i){let r=this.idToRowMap.get(e);r&&(Object.assign(r,i),this.requestUpdate("data"))}updateRowAtIndex(e,i){let r=this.data[e];r&&(Object.assign(r,i),this.requestUpdate("data"))}deleteRow(...e){for(let i of e){let r=this.idToRowMap.get(i);if(r){let o=this.rowMetadata.get(r);this.deleteRowAtIndex(o.index)}}}deleteRowAtIndex(...e){let i=new Set(this.selectedRowIds);for(let r of e){let o=this.data[r];if(o){let n=this.rowMetadata.get(o);this.idToRowMap.delete(n.id),this.rowMetadata.delete(o),i.delete(n.id),this.data=this.data.toSpliced(r,1)}}this.selectedRowIds=[...i]}getRowId(e){let i=this.rowMetadata.get(e);if(!i)throw new Error("The provided row does not exist in the current dataset");return i.id}getRowIndex(e){let i=this.rowMetadata.get(e);if(!i)throw new Error("The provided row does not exist in the current dataset");return i.index}getRowHighlightIndicies(e){let i=this.rowMetadata.get(e);if(!i)throw new Error("The provided row does not exist in the current dataset");return i.highlightIndices}hostConnected(){}hostDisconnected(){}hostUpdate(){}hostUpdated(){}requestUpdate(...e){let i=["columns","columnStates","searchQuery","selectedRowIds"],r=e.filter(o=>i.includes(o));r.length&&(this.scheduleSave(),this.dispatchEvent(new se(this.getTableState(),r)));for(let o of this.hosts)o.requestUpdate()}calculateSearchScore(e,i){let r={score:0,ranges:[]};if(!e||!i)return r;let o=0,n=0;if(i===e)n=ct.EXACT,o=e.length,r.ranges.push([0,i.length]);else if(i.startsWith(e))n=ct.PREFIX,o=e.length,r.ranges.push([0,e.length]);else{let c=i.indexOf(e);if(c!==-1){n=ct.SUBSTRING,o=e.length;let d=c;for(;d!==-1;)r.ranges.push([d,d+e.length]),d=i.indexOf(e,d+1)}else return r}let a=1/(1+(i.length-e.length));return r.score=o*n*a,r}searchField(e,i,r){let o={score:0,ranges:[]},n=l=>{let a=i.indexOf(l);for(;a!==-1;)o.ranges.push([a,a+l.length]),a=i.indexOf(l,a+1)};if(e.quoted||!r){if(!this.enableSearchScoring)i.includes(e.value)&&(o.score=1,n(e.value));else{let l=this.calculateSearchScore(e.value,i);o.score=l.score,o.ranges=l.ranges}return o}if(!this.enableSearchScoring)return r.some(a=>a.includes(e.value))&&(o.score=1,n(e.value)),o;for(let l of r){let a=this.calculateSearchScore(e.value,l);a.score>0&&(o.score+=a.score,n(e.value))}return o}filterField(e,i,r=null){return Array.isArray(i)?i.length===0?!0:i.some(o=>this.filterField(e,o,r)):Array.isArray(e)?e.length===0?!1:e.some(o=>this.filterField(o,i,r)):typeof r=="function"?r(e,i):i instanceof RegExp?i.test(String(e)):i===e}filterRow(e,i){if(!this.filters)return!0;if(typeof this.filters=="function")return this.filters(e,i);for(let r in this.filters){let o=S(this.filters,r),n=S(e,r);if(typeof o=="function"){if(!o(n))return!1}else if(o!==void 0){let l=this.getColumn(r),a=l?l.filter:void 0;if(!this.filterField(n,o,a))return!1}}return!0}filterRows(){let i=[...this.columns].filter(r=>r.searchable).map(r=>r.field);this._filteredData=this.data.filter((r,o)=>{let n=this.rowMetadata.get(r);if(n.searchScore=0,n.highlightIndices={},!this.filterRow(r,o))return!1;if(!this.queryTokens)return!0;for(let l of i){let a=S(r,l),c=n.searchValues[l],d=n.searchTokens[l];if(typeof a!="string"||typeof c!="string")continue;let h={score:0,ranges:[]};for(let u of this.queryTokens){let m=this.searchField(u,c,d);h.score+=m.score,h.ranges.push(...m.ranges)}h.score>0&&(n.searchScore+=h.score,n.highlightIndices[l]=h.ranges)}return n.searchScore>0}),this.filterDirty=!1,this.sortRows(),this.dispatchEvent(new re(this.data))}compareRows(e,i,r){let o,n,l=this.getColumnState(r);if(!l.sort)return 0;let a=this.rowMetadata.get(e),c=this.rowMetadata.get(i);return l.sort?.order==="asc"?(o=a.sortValues[r],n=c.sortValues[r]):(o=c.sortValues[r],n=a.sortValues[r]),o??=Number.MIN_SAFE_INTEGER,n??=Number.MIN_SAFE_INTEGER,o<n?-1:o>n?1:0}sortRows(){if(this.filterDirty){this.filterRows();return}let e=[...this._columnStateMap.values()].filter(i=>i.visible&&i.sort).sort((i,r)=>r.sort.priority-i.sort.priority);this._filteredData=this._filteredData.toSorted((i,r)=>{let o=this.rowMetadata.get(i),n=this.rowMetadata.get(r);if(this.enableSearchScoring&&this.queryTokens){let l=o.searchScore||0,a=n.searchScore||0;if(l>a)return-1;if(l<a)return 1}for(let l of e){let a=this.compareRows(i,r,l.field);if(a!==0)return a}return o.index-n.index}),this.sortDirty=!1}createMetadata(){this.idToRowMap=new Map,this.rowMetadata=new WeakMap;let e=new Map;for(let r of this.columns){let o=this.data.map(n=>{let l=S(n,r.field),a=r.sorter?.(l)??l;return[l,a]});e.set(r.field,ti(o))}let i=0;for(let r of this.data){let o=this._rowIdCallback(r,i);(o==null||this.idToRowMap.has(o))&&(ji(i,o,r),o=`__yatl_fallback_id_${i}`),this.idToRowMap.set(o,r);let n={id:o,index:i++,searchTokens:{},searchValues:{},sortValues:{},selected:!1};this.rowMetadata.set(r,n);for(let l of this.columns){let a=S(r,l.field),c=e.get(l.field);if(n.sortValues[l.field]=c.get(a)??null,typeof a=="string"&&(n.searchValues[l.field]=a.toLocaleLowerCase()),l.searchable&&l.tokenize&&a){let d=l.searchTokenizer??this.searchTokenizer;n.searchTokens[l.field]=d(String(a)).map(h=>h.value)}}}}updateInternalQuery(){if(this.searchQuery.length===0){this.queryTokens=null;return}this.queryTokens=[{value:this.searchQuery.toLocaleLowerCase(),quoted:!0}],this.enableSearchTokenization&&this.queryTokens.push(...this.searchTokenizer(this.searchQuery))}scheduleSave(){window.clearTimeout(this.saveTimer),this.saveTimer=window.setTimeout(()=>{this.saveStateToStorage()},Li)}saveStateToStorage(){if(!this.storageOptions)return;let e={...ii,...this.storageOptions},i={columns:[]},r=this.getTableState();e.saveSearchQuery&&(i.searchQuery=r.searchQuery),e.saveSelectedRows&&(i.selectedRows=r.selectedRows);for(let n of r.columns){let l={field:n.field};e.saveColumnSortOrders&&(l.sort=n.sort),e.saveColumnVisibility&&(l.visible=n.visible),e.saveColumnWidths&&(l.width=n.width),i.columns?.push(l)}let o=e.storage==="session"?sessionStorage:localStorage;try{o.setItem(e.key,JSON.stringify(i))}catch(n){console.warn("Failed to save table state",n)}}loadStateFromStorage(){if(!this.storageOptions)return;let e={...ii,...this.storageOptions},i=localStorage.getItem(e.key);if(i)try{let r=JSON.parse(i),o={};if(e.saveSearchQuery&&(o.searchQuery=r.searchQuery),e.saveSelectedRows&&(o.selectedRows=r.selectedRows),r.columns){o.columns=[];for(let n of r.columns){let l={field:n.field};e.saveColumnVisibility&&(l.visible=n.visible),e.saveColumnWidths&&(l.width=n.width),e.saveColumnSortOrders&&(l.sort=n.sort),o.columns.push(l)}}this.updateTableState(o),this.hasRestoredState=!0}catch(r){console.error("Failed to restore DataTable state:",r)}}},ri=!1;function Ui(){ri||(ri=!0,console.warn(`[yatl-table] Data rows are missing a unique 'id' or 'key' property.
6
6
  Falling back to array index.
7
7
  Selection and sorting may behave unexpectedly.
8
8
  Please provide a unique ID via the 'rowIdCallback' property.
9
9
  `))}var si=!1;function ji(s,t,e){si||(si=!0,console.warn(`[yatl-table] rowIdCallback returned non-unique id (${t}) for data at index ${s}.
10
10
  Falling back to array index.
11
11
  Selection and sorting may behave unexpectedly.
12
- `),console.debug(e))}var ni=We`
12
+ `),console.debug(e))}var oi=We`
13
13
  @layer base, striped, hover, selected;
14
14
 
15
15
  :host {
@@ -99,10 +99,15 @@
99
99
  .row {
100
100
  position: relative;
101
101
  background-color: var(--table-row-bg);
102
- border-bottom: 1px solid var(--table-border-color);
102
+ /** Use box-shadow to mimic borders. It works better when virtualized */
103
+ box-shadow: inset 0 -1px 0 0 var(--table-border-color);
103
104
  transition: background-color 50ms;
104
105
  }
105
106
 
107
+ .row-number-cell {
108
+ box-shadow: inset 0 -1px 0 0 var(--table-border-color);
109
+ }
110
+
106
111
  .row.header-row {
107
112
  background-color: var(--table-header-bg);
108
113
  border-bottom: 1px solid var(--table-border-color);
@@ -115,7 +120,7 @@
115
120
  }
116
121
 
117
122
  .row:last-child {
118
- border-bottom: none;
123
+ box-shadow: none;
119
124
  }
120
125
 
121
126
  .table:not(.resizing) .row {
@@ -161,7 +166,7 @@
161
166
  }
162
167
 
163
168
  @layer striped {
164
- :host([striped]) .body .row:nth-child(even) {
169
+ :host([striped]) .row-even {
165
170
  background-color: var(--table-row-stripe-bg);
166
171
  }
167
172
  }
@@ -384,7 +389,7 @@
384
389
  white-space: nowrap;
385
390
  overflow: hidden;
386
391
  }
387
- `;var f=class extends E{constructor(){super(...arguments);this.resizeState=null;this.dragColumn=null;this.useYatlUi=!1;this._controller=new we(this);this.striped=!0;this.sortable=!0;this.resizable=!0;this.enableVirtualScroll=!1;this.enableSearchHighlight=!0;this.enableColumnReorder=!0;this.enableRowNumberColumn=!0;this.enableFooter=!0;this.nullValuePlaceholder="-";this.emptyMessage="No records to display";this.noResultsMessage="No matching records found";this.rowParts=null;this.eventNames=["yatl-column-reorder","yatl-column-resize","yatl-column-sort","yatl-column-toggle","yatl-row-select","yatl-table-search","yatl-table-state-change","yatl-table-view-change"];this.redispatchControllerEvent=e=>{e instanceof v&&this.dispatchEvent(e.clone())};this.handleHeaderClicked=(e,i)=>{if(!e.currentTarget.classList.contains("sortable")||this.resizeState)return;let n=e.shiftKey,o=this.getColumnState(i.field),l=null;o?.sort?o.sort.order==="asc"&&(l="desc"):l="asc";let a=new G(i.field,l,n);this.dispatchEvent(a)&&this.sort(i.field,l,!n)};this.handleCellClick=(e,i,r)=>{if(window.getSelection()?.toString())return;let n=this.controller.getRowId(i),o=this.controller.getRowIndex(i);this.dispatchEvent(new W(i,n,o,r,e))};this.handleResizeMouseMove=e=>{this.resizeState?.active&&requestAnimationFrame(()=>{if(!this.resizeState?.active)return;let i=e.pageX-this.resizeState.startX,r=Math.max(50,this.resizeState.startWidth+i);this.resizeState.currentWidths[this.resizeState.columnIndex]=`${r}px`,this.tableElement.style.setProperty("--grid-template",this.resizeState.currentWidths.join(" "))})};this.handleResizeMouseUp=e=>{if(window.removeEventListener("mousemove",this.handleResizeMouseMove),window.removeEventListener("mouseup",this.handleResizeMouseUp),this.tableElement.classList.remove("resizing"),this.resizeState?.active){e.preventDefault(),e.stopPropagation();let i=parseFloat(this.resizeState.currentWidths[this.resizeState.columnIndex]);this.resizeColumn(this.resizeState.columnField,i)}setTimeout(()=>{this.resizeState=null})};this.handleDragColumnStart=(e,i)=>{if(e.target?.classList.contains("resizer")){e.preventDefault();return}e.dataTransfer&&(e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",i),this.dragColumn=i)};this.handleDragColumnEnter=e=>{e.currentTarget.querySelector(".drop-indicator")?.classList.add("active")};this.handleDragColumnLeave=e=>{let i=e.currentTarget,r=e.relatedTarget;i.contains(r)||i.querySelector(".drop-indicator")?.classList.remove("active")};this.handleDragColumnOver=e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="move")};this.handleDragColumnDrop=(e,i)=>{if(!this.dragColumn||this.dragColumn===i)return;e.preventDefault(),e.stopPropagation();let r=this.displayColumns,n=r.findIndex(a=>a.field===this.dragColumn),o=r.findIndex(a=>a.field===i),l=new ee(this.dragColumn,n,o);this.dispatchEvent(l)&&this.moveColumn(this.dragColumn,i)};this.handleDragColumnEnd=()=>{this.dragColumn=null,this.tableElement.querySelectorAll(".drop-indicator.active").forEach(e=>e.classList.remove("active"))};this.handleRowSelectionClicked=(e,i)=>{e.stopPropagation();let r=e.currentTarget,n=r.checked,o=this.controller.getRowId(i),l=this.selectedRowIds,a=new Q(o,n,l);if(!this.dispatchEvent(a)){r.checked=!n;return}this.toggleRowSelection(i,n)}}get controller(){return this._controller}set controller(e){if(this._controller===e)return;let i=this._controller;this.isConnected&&(this.removeControllerListeners(i),this.addControllerListeners(e)),i.detach(this),e.attach(this),this._controller=e,this.requestUpdate("controller",i)}get enableSearchTokenization(){return this.controller.enableSearchTokenization}set enableSearchTokenization(e){let i=this.enableSearchTokenization;i!==e&&(this.controller.enableSearchTokenization=e,this.requestUpdate("enableSearchTokenization",i))}get enableSearchScoring(){return this.controller.enableSearchScoring}set enableSearchScoring(e){let i=this.enableSearchScoring;i!==e&&(this.controller.enableSearchScoring=e,this.requestUpdate("enableSearchScoring",i))}get columns(){return this.controller.columns}set columns(e){let i=this.columns;if(i!==e){for(let r of e)M(r)&&r.title===void 0&&(r.title=Ot(r.field));this.controller.columns=e,this.requestUpdate("columns",i)}}get displayColumns(){return this.controller.displayColumns}get columnStates(){return this.controller.columnStates}set columnStates(e){let i=this.columnStates,r=!1;for(let n of e){let o=this.getColumnState(n.field);if(ne(o,n).length){r=!0;break}}r&&(this.controller.columnStates=e,this.requestUpdate("columnStates",i))}get searchQuery(){return this.controller.searchQuery}set searchQuery(e){let i=this.searchQuery;i!==e&&(this.controller.searchQuery=e,this.requestUpdate("searchQuery",i))}get searchTokenizer(){return this.controller.searchTokenizer}set searchTokenizer(e){let i=this.searchTokenizer;i!==e&&(this.controller.searchTokenizer=e,this.requestUpdate("searchTokenizer",i))}get filters(){return this.controller.filters}set filters(e){let i=this.filters;i!==e&&(this.controller.filters=e,this.requestUpdate("filters",i))}get rowSelectionMethod(){return this.controller.rowSelectionMethod}set rowSelectionMethod(e){let i=this.rowSelectionMethod;i!==e&&(this.controller.rowSelectionMethod=e,this.requestUpdate("rowSelectionMethod",i))}get selectedRowIds(){return this.controller.selectedRowIds}set selectedRowIds(e){let i=new Set(this.selectedRowIds);i.size===e.length&&e.every(r=>i.has(r))||(this.controller.selectedRowIds=e,this.requestUpdate("selectedRows",[...i]))}get storageOptions(){return this.controller.storageOptions}set storageOptions(e){let i=this.storageOptions;this.controller.storageOptions=e,this.requestUpdate("storageOptions",i)}get rowIdCallback(){return this.controller.rowIdCallback}set rowIdCallback(e){let i=this.rowIdCallback;i!==e&&(this.controller.rowIdCallback=e,this.requestUpdate("rowIdCallback",i))}get data(){return this.controller.data}set data(e){let i=this.data;this.controller.data=e,this.requestUpdate("data",i)}get filteredData(){return this.controller.filteredData}get dataUpdateTimestamp(){return this.controller.dataUpdateTimestamp}getColumn(e){return this.controller.getColumn(e)}getDisplayColumn(e){let i=this.getColumn(e);if(i&&M(i))return i}getTableState(){return this.controller.getTableState()}updateTableState(e){return this.controller.updateTableState(e)}getColumnState(e){return this.controller.getColumnState(e)}updateColumnState(e,i){return this.controller.updateColumnState(e,i)}sort(e,i,r=!0){return this.controller.sort(e,i,r)}toggleColumnVisibility(e,i){return this.controller.toggleColumnVisibility(e,i)}showColumn(e){return this.controller.showColumn(e)}hideColumn(e){return this.controller.hideColumn(e)}moveColumn(e,i){return this.controller.moveColumn(e,i)}resizeColumn(e,i){return this.controller.resizeColumn(e,i)}isRowSelected(e){return this.controller.isRowSelected(e)}toggleRowSelection(e,i){return this.controller.toggleRowSelection(e,i)}selectRow(e){return this.controller.selectRow(e)}deselectRow(e){return this.controller.deselectRow(e)}selectAll(){return this.controller.selectAll()}deselectAll(){return this.controller.deselectAll()}export(e,i={includeAllRows:!1,includeHiddenColumns:!1,includeInternalColumns:!1}){let r=this.controller.export(i),n=document.createElement("a");n.style.display="none",n.href=URL.createObjectURL(r),n.download=`${e}.csv`,document.body.append(n),n.click(),n.remove()}scrollToRow(e){let i=this.data.findIndex(r=>r===e);if(typeof i=="number")return this.scrollToOriginalIndex(i);throw new Error("Row not in table")}scrollToOriginalIndex(e){let i=this.data[e];if(i){let r=this.filteredData.indexOf(i);if(r>=0)return this.scrollToFilteredIndex(r);throw new Error("Cannot scroll to filtered out row")}else throw new RangeError(`Row index ${e} out of range`)}async scrollToFilteredIndex(e){if(!this.filteredData[e])throw new RangeError(`Row index ${e} out of range`);await this.updateComplete,this.virtualizer?this.virtualizer.element(e)?.scrollIntoView({block:"start",behavior:"instant"}):this.tableElement.querySelector(`.row[data-filtered-index="${e}"]`)?.scrollIntoView({block:"start",behavior:"smooth"})}async scrollToPx(e){await this.updateComplete,this.virtualizer?this.virtualizer.scrollTop=e:this.tableElement.scrollTop=e}getRow(e){return this.controller.getRow(e)}findRow(e,i){return this.controller.findRow(e,i)}findRowIndex(e,i){return this.controller.findRowIndex(e,i)}updateRow(e,i){return this.controller.updateRow(e,i)}updateRowAtIndex(e,i){return this.controller.updateRowAtIndex(e,i)}deleteRow(...e){return this.controller.deleteRow(...e)}deleteRowAtIndex(e){return this.controller.deleteRowAtIndex(e)}renderColumnSortIcon(e,i){return e.sortable??this.sortable?g`<div
392
+ `;var f=class extends E{constructor(){super(...arguments);this.resizeState=null;this.dragColumn=null;this.useYatlUi=!1;this._controller=new we(this);this.striped=!0;this.sortable=!0;this.resizable=!0;this.enableVirtualScroll=!1;this.enableSearchHighlight=!0;this.enableColumnReorder=!0;this.enableRowNumberColumn=!0;this.enableFooter=!0;this.nullValuePlaceholder="-";this.emptyMessage="No records to display";this.noResultsMessage="No matching records found";this.rowParts=null;this.eventNames=["yatl-column-reorder","yatl-column-resize","yatl-column-sort","yatl-column-toggle","yatl-row-select","yatl-table-search","yatl-table-state-change","yatl-table-view-change"];this.redispatchControllerEvent=e=>{e instanceof v&&this.dispatchEvent(e.clone())};this.handleHeaderClicked=(e,i)=>{if(!e.currentTarget.classList.contains("sortable")||this.resizeState)return;let o=e.shiftKey,n=this.getColumnState(i.field),l=null;n?.sort?n.sort.order==="asc"&&(l="desc"):l="asc";let a=new G(i.field,l,o);this.dispatchEvent(a)&&this.sort(i.field,l,!o)};this.handleCellClick=(e,i,r)=>{if(window.getSelection()?.toString())return;let o=this.controller.getRowId(i),n=this.controller.getRowIndex(i);this.dispatchEvent(new W(i,o,n,r,e))};this.handleResizeMouseMove=e=>{this.resizeState?.active&&requestAnimationFrame(()=>{if(!this.resizeState?.active)return;let i=e.pageX-this.resizeState.startX,r=Math.max(50,this.resizeState.startWidth+i);this.resizeState.currentWidths[this.resizeState.columnIndex]=`${r}px`,this.tableElement.style.setProperty("--grid-template",this.resizeState.currentWidths.join(" "))})};this.handleResizeMouseUp=e=>{if(window.removeEventListener("mousemove",this.handleResizeMouseMove),window.removeEventListener("mouseup",this.handleResizeMouseUp),this.tableElement.classList.remove("resizing"),this.resizeState?.active){e.preventDefault(),e.stopPropagation();let i=parseFloat(this.resizeState.currentWidths[this.resizeState.columnIndex]);this.resizeColumn(this.resizeState.columnField,i)}setTimeout(()=>{this.resizeState=null})};this.handleDragColumnStart=(e,i)=>{if(e.target?.classList.contains("resizer")){e.preventDefault();return}e.dataTransfer&&(e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",i),this.dragColumn=i)};this.handleDragColumnEnter=e=>{e.currentTarget.querySelector(".drop-indicator")?.classList.add("active")};this.handleDragColumnLeave=e=>{let i=e.currentTarget,r=e.relatedTarget;i.contains(r)||i.querySelector(".drop-indicator")?.classList.remove("active")};this.handleDragColumnOver=e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="move")};this.handleDragColumnDrop=(e,i)=>{if(!this.dragColumn||this.dragColumn===i)return;e.preventDefault(),e.stopPropagation();let r=this.displayColumns,o=r.findIndex(a=>a.field===this.dragColumn),n=r.findIndex(a=>a.field===i),l=new ee(this.dragColumn,o,n);this.dispatchEvent(l)&&this.moveColumn(this.dragColumn,i)};this.handleDragColumnEnd=()=>{this.dragColumn=null,this.tableElement.querySelectorAll(".drop-indicator.active").forEach(e=>e.classList.remove("active"))};this.handleRowSelectionClicked=(e,i)=>{e.stopPropagation();let r=e.currentTarget,o=r.checked,n=this.controller.getRowId(i),l=this.selectedRowIds,a=new Q(n,o,l);if(!this.dispatchEvent(a)){r.checked=!o;return}this.toggleRowSelection(i,o)}}get controller(){return this._controller}set controller(e){if(this._controller===e)return;let i=this._controller;this.isConnected&&(this.removeControllerListeners(i),this.addControllerListeners(e)),i.detach(this),e.attach(this),this._controller=e,this.requestUpdate("controller",i)}get enableSearchTokenization(){return this.controller.enableSearchTokenization}set enableSearchTokenization(e){let i=this.enableSearchTokenization;i!==e&&(this.controller.enableSearchTokenization=e,this.requestUpdate("enableSearchTokenization",i))}get enableSearchScoring(){return this.controller.enableSearchScoring}set enableSearchScoring(e){let i=this.enableSearchScoring;i!==e&&(this.controller.enableSearchScoring=e,this.requestUpdate("enableSearchScoring",i))}get columns(){return this.controller.columns}set columns(e){let i=this.columns;if(i!==e){for(let r of e)M(r)&&r.title===void 0&&(r.title=Ot(r.field));this.controller.columns=e,this.requestUpdate("columns",i)}}get displayColumns(){return this.controller.displayColumns}get columnStates(){return this.controller.columnStates}set columnStates(e){let i=this.columnStates,r=!1;for(let o of e){let n=this.getColumnState(o.field);if(oe(n,o).length){r=!0;break}}r&&(this.controller.columnStates=e,this.requestUpdate("columnStates",i))}get searchQuery(){return this.controller.searchQuery}set searchQuery(e){let i=this.searchQuery;i!==e&&(this.controller.searchQuery=e,this.requestUpdate("searchQuery",i))}get searchTokenizer(){return this.controller.searchTokenizer}set searchTokenizer(e){let i=this.searchTokenizer;i!==e&&(this.controller.searchTokenizer=e,this.requestUpdate("searchTokenizer",i))}get filters(){return this.controller.filters}set filters(e){let i=this.filters;i!==e&&(this.controller.filters=e,this.requestUpdate("filters",i))}get rowSelectionMethod(){return this.controller.rowSelectionMethod}set rowSelectionMethod(e){let i=this.rowSelectionMethod;i!==e&&(this.controller.rowSelectionMethod=e,this.requestUpdate("rowSelectionMethod",i))}get selectedRowIds(){return this.controller.selectedRowIds}set selectedRowIds(e){let i=new Set(this.selectedRowIds);i.size===e.length&&e.every(r=>i.has(r))||(this.controller.selectedRowIds=e,this.requestUpdate("selectedRows",[...i]))}get storageOptions(){return this.controller.storageOptions}set storageOptions(e){let i=this.storageOptions;this.controller.storageOptions=e,this.requestUpdate("storageOptions",i)}get rowIdCallback(){return this.controller.rowIdCallback}set rowIdCallback(e){let i=this.rowIdCallback;i!==e&&(this.controller.rowIdCallback=e,this.requestUpdate("rowIdCallback",i))}get data(){return this.controller.data}set data(e){let i=this.data;this.controller.data=e,this.requestUpdate("data",i)}get filteredData(){return this.controller.filteredData}get dataUpdateTimestamp(){return this.controller.dataUpdateTimestamp}getColumn(e){return this.controller.getColumn(e)}getDisplayColumn(e){let i=this.getColumn(e);if(i&&M(i))return i}getTableState(){return this.controller.getTableState()}updateTableState(e){return this.controller.updateTableState(e)}getColumnState(e){return this.controller.getColumnState(e)}updateColumnState(e,i){return this.controller.updateColumnState(e,i)}sort(e,i,r=!0){return this.controller.sort(e,i,r)}toggleColumnVisibility(e,i){return this.controller.toggleColumnVisibility(e,i)}showColumn(e){return this.controller.showColumn(e)}hideColumn(e){return this.controller.hideColumn(e)}moveColumn(e,i){return this.controller.moveColumn(e,i)}resizeColumn(e,i){return this.controller.resizeColumn(e,i)}isRowSelected(e){return this.controller.isRowSelected(e)}toggleRowSelection(e,i){return this.controller.toggleRowSelection(e,i)}selectRow(e){return this.controller.selectRow(e)}deselectRow(e){return this.controller.deselectRow(e)}selectAll(){return this.controller.selectAll()}deselectAll(){return this.controller.deselectAll()}export(e,i={includeAllRows:!1,includeHiddenColumns:!1,includeInternalColumns:!1}){let r=this.controller.export(i),o=document.createElement("a");o.style.display="none",o.href=URL.createObjectURL(r),o.download=`${e}.csv`,document.body.append(o),o.click(),o.remove()}scrollToRow(e){let i=this.data.findIndex(r=>r===e);if(typeof i=="number")return this.scrollToOriginalIndex(i);throw new Error("Row not in table")}scrollToOriginalIndex(e){let i=this.data[e];if(i){let r=this.filteredData.indexOf(i);if(r>=0)return this.scrollToFilteredIndex(r);throw new Error("Cannot scroll to filtered out row")}else throw new RangeError(`Row index ${e} out of range`)}async scrollToFilteredIndex(e){if(!this.filteredData[e])throw new RangeError(`Row index ${e} out of range`);await this.updateComplete,this.virtualizer?this.virtualizer.element(e)?.scrollIntoView({block:"start",behavior:"instant"}):this.tableElement.querySelector(`.row[data-filtered-index="${e}"]`)?.scrollIntoView({block:"start",behavior:"smooth"})}async scrollToPx(e){await this.updateComplete,this.virtualizer?this.virtualizer.scrollTop=e:this.tableElement.scrollTop=e}getRow(e){return this.controller.getRow(e)}findRow(e,i){return this.controller.findRow(e,i)}findRowIndex(e,i){return this.controller.findRowIndex(e,i)}updateRow(e,i){return this.controller.updateRow(e,i)}updateRowAtIndex(e,i){return this.controller.updateRowAtIndex(e,i)}deleteRow(...e){return this.controller.deleteRow(...e)}deleteRowAtIndex(e){return this.controller.deleteRowAtIndex(e)}renderColumnSortIcon(e,i){return e.sortable??this.sortable?g`<div
388
393
  part="header-sort-icon"
389
394
  class=${me({"sort-icon":!0,ascending:i.sort?.order==="asc",descending:i.sort?.order==="desc"})}
390
395
  ></div>`:b}renderColumnResizer(e,i){return e.resizable??this.resizable?g`
@@ -394,11 +399,11 @@
394
399
  @click=${r=>r.stopPropagation()}
395
400
  @mousedown=${r=>this.handleResizeMouseDown(r,e.field)}
396
401
  ></div>
397
- `:b}renderHeaderCell(e){if(!e)return b;let i=this.getColumnState(e.field),r=e.title??e.field,n="none";i.sort?.order==="asc"&&(n="ascending"),i.sort?.order==="desc"&&(n="descending");let o=i.visible?"columnheader":void 0,l=i.visible?!1:void 0,a={cell:!0,sortable:e.sortable??this.sortable};return this.renderCellWrapper(g`
402
+ `:b}renderHeaderCell(e){if(!e)return b;let i=this.getColumnState(e.field),r=e.title??e.field,o="none";i.sort?.order==="asc"&&(o="ascending"),i.sort?.order==="desc"&&(o="descending");let n=i.visible?"columnheader":void 0,l=i.visible?!1:void 0,a={cell:!0,sortable:e.sortable??this.sortable};return this.renderCellWrapper(g`
398
403
  <div
399
- role=${_e(o)}
404
+ role=${_e(n)}
400
405
  aria-hidden=${_e(l)}
401
- aria-sort=${n}
406
+ aria-sort=${o}
402
407
  aria-label=${r}
403
408
  part="cell header-cell"
404
409
  class=${me(a)}
@@ -428,14 +433,14 @@
428
433
  ${this.displayColumns.map(i=>this.renderHeaderCell(i))}
429
434
  </div>
430
435
  </div>
431
- `}renderCellContents(e,i,r){if(i.cellRenderer)return i.cellRenderer(e,i.field,r);if(e==null)return this.nullValuePlaceholder;let n=this.controller.getRowHighlightIndicies(r);return this.enableSearchHighlight&&n?It(String(e),n[i.field]):e}renderCell(e,i){let r=S(i,e.field),n=e.cellParts?.call(this,r,e.field,i);return Array.isArray(n)&&(n=n.join(" ")),typeof e.valueFormatter=="function"&&(r=e.valueFormatter(r,i)),this.renderCellWrapper(g`
436
+ `}renderCellContents(e,i,r){if(i.cellRenderer)return i.cellRenderer(e,i.field,r);if(e==null)return this.nullValuePlaceholder;let o=this.controller.getRowHighlightIndicies(r);return this.enableSearchHighlight&&o?It(String(e),o[i.field]):e}renderCell(e,i){let r=S(i,e.field),o=e.cellParts?.call(this,r,e.field,i);return Array.isArray(o)&&(o=o.join(" ")),typeof e.valueFormatter=="function"&&(r=e.valueFormatter(r,i)),this.renderCellWrapper(g`
432
437
  <div
433
438
  role="cell"
434
- part="cell body-cell cell-${e.field} ${n}"
439
+ part="cell body-cell cell-${e.field} ${o}"
435
440
  data-field=${e.field}
436
441
  class="cell"
437
442
  title=${_e(r?String(r):void 0)}
438
- @click=${o=>this.handleCellClick(o,i,e.field)}
443
+ @click=${n=>this.handleCellClick(n,i,e.field)}
439
444
  >
440
445
  <span class="truncate">
441
446
  ${this.renderCellContents(r,e,i)}
@@ -462,13 +467,13 @@
462
467
  <div part="cell body-cell" class="cell body-cell">
463
468
  <div part="row-number-cell" class="row-number-cell">${e}</div>
464
469
  </div>
465
- `)}renderRow(e,i){let r=this.isRowSelected(e),n=this.rowParts?.(e)??"";Array.isArray(n)&&(n=n.join(" "));let o={row:!0,selected:r},l=i+1;return g`
470
+ `)}renderRow(e,i){let r=this.isRowSelected(e),o=this.rowParts?.(e)??"";Array.isArray(o)&&(o=o.join(" "));let n={row:!0,selected:r,"row-even":i%2===0,"row-odd":i%2!==0},l=i+1;return g`
466
471
  <div
467
472
  role="row"
468
473
  aria-rowindex=${l}
469
474
  aria-selected=${r?"true":"false"}
470
- part=${"row "+n}
471
- class=${me(o)}
475
+ part=${"row "+o}
476
+ class=${me(n)}
472
477
  >
473
478
  ${this.renderRowNumberCell(l)}
474
479
  ${this.renderRowSelectorCell(e,r)}
@@ -488,7 +493,7 @@
488
493
  ${ke(this.filteredData,e=>this.controller.getRowId(e),(e,i)=>this.renderRow(e,i))}
489
494
  `:g`
490
495
  <div part="message" class="message">No visible columns.</div>
491
- `}renderFooter(){if(!this.enableFooter)return b;let e=this.data.length,i=this.filteredData.length,r=new Intl.NumberFormat(void 0),n=r.format(e),o=r.format(i),l=e!==i?`Showing ${o} of ${n} records`:`Total records: ${n}`,a=Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"}),c=this.dataUpdateTimestamp?a.format(this.dataUpdateTimestamp):"Never";return g`
496
+ `}renderFooter(){if(!this.enableFooter)return b;let e=this.data.length,i=this.filteredData.length,r=new Intl.NumberFormat(void 0),o=r.format(e),n=r.format(i),l=e!==i?`Showing ${n} of ${o} records`:`Total records: ${o}`,a=Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"}),c=this.dataUpdateTimestamp?a.format(this.dataUpdateTimestamp):"Never";return g`
492
497
  <div part="footer" class="footer">
493
498
  <slot name="footer">
494
499
  <span part="row-count">${l}</span>
@@ -512,7 +517,7 @@
512
517
  </div>
513
518
  ${this.renderFooter()}
514
519
  </div>
515
- `}renderCellWrapper(e){return g` <div class="cell-wrapper">${e}</div> `}connectedCallback(){super.connectedCallback(),this.addControllerListeners(this.controller),this.useYatlUi||customElements.whenDefined("yatl-checkbox").then(()=>{this.useYatlUi=!0})}disconnectedCallback(){super.disconnectedCallback(),this.removeControllerListeners(this.controller),window.addEventListener("mousemove",this.handleResizeMouseMove),window.addEventListener("mouseup",this.handleResizeMouseUp)}addControllerListeners(e){for(let i of this.eventNames)e.addEventListener(i,this.redispatchControllerEvent)}removeControllerListeners(e){for(let i of this.eventNames)e.removeEventListener(i,this.redispatchControllerEvent)}hasVisibleColumn(){return this.displayColumns.map(e=>this.getColumnState(e.field)).filter(e=>e.visible).length>0}getGridWidths(){let e=[];this.enableRowNumberColumn?e.push("var(--yatl-row-number-column-width, 48px)"):e.push("0"),this.rowSelectionMethod?e.push("var(--yatl-row-selector-column-width, 48px)"):e.push("0");for(let i of this.displayColumns){let r=this.getColumnState(i.field),n=r.width!=null;r.visible?n?e.push(`${r.width}px`):e.push("minmax(0, 1fr)"):n?e.push("0px"):e.push("minmax(0, 0fr)")}return e}handleResizeMouseDown(e,i){e.preventDefault(),e.stopPropagation();let n=e.target.closest(".cell");if(!n)return;let o=this.displayColumns.findIndex(a=>a.field===i);if(o<0)return;this.tableElement.classList.add("resizing"),this.tableElement.querySelectorAll(".header .cell").forEach(a=>{let c=a.dataset.field;if(c){let d=this.getColumnState(c);d.width=a.getBoundingClientRect().width,this.updateColumnState(c,d)}});let l=this.getGridWidths();this.resizeState={active:!0,startX:e.pageX,startWidth:n.getBoundingClientRect().width,columnIndex:o+2,columnField:i,currentWidths:l},this.tableElement.style.setProperty("--grid-template",l.join(" ")),window.addEventListener("mousemove",this.handleResizeMouseMove),window.addEventListener("mouseup",this.handleResizeMouseUp)}};f.styles=[ni],_([it(".table")],f.prototype,"tableElement",2),_([it("lit-virtualizer")],f.prototype,"virtualizer",2),_([Nt()],f.prototype,"useYatlUi",2),_([p({attribute:!1})],f.prototype,"controller",1),_([p({type:Boolean,reflect:!0})],f.prototype,"striped",2),_([p({type:Boolean,attribute:"sortable"})],f.prototype,"sortable",2),_([p({type:Boolean,attribute:"resizable"})],f.prototype,"resizable",2),_([p({type:Boolean,attribute:"enable-virtual-scroll"})],f.prototype,"enableVirtualScroll",2),_([p({type:Boolean,attribute:"enable-search-highlight"})],f.prototype,"enableSearchHighlight",2),_([p({type:Boolean,attribute:"enable-search-tokenization"})],f.prototype,"enableSearchTokenization",1),_([p({type:Boolean,attribute:"enable-search-scoring"})],f.prototype,"enableSearchScoring",1),_([p({type:Boolean,attribute:"enable-column-reorder"})],f.prototype,"enableColumnReorder",2),_([p({type:Boolean})],f.prototype,"enableRowNumberColumn",2),_([p({type:Boolean,attribute:"enable-footer"})],f.prototype,"enableFooter",2),_([p({type:String,attribute:"null-value-placeholder"})],f.prototype,"nullValuePlaceholder",2),_([p({type:String,attribute:"empty-message"})],f.prototype,"emptyMessage",2),_([p({type:String,attribute:"no-results-message"})],f.prototype,"noResultsMessage",2),_([p({attribute:!1})],f.prototype,"columns",1),_([p({attribute:!1})],f.prototype,"columnStates",1),_([p({type:String,attribute:"search-query"})],f.prototype,"searchQuery",1),_([p({attribute:!1})],f.prototype,"searchTokenizer",1),_([p({attribute:!1})],f.prototype,"filters",1),_([p({attribute:!1})],f.prototype,"rowParts",2),_([p({type:String})],f.prototype,"rowSelectionMethod",1),_([p({attribute:!1})],f.prototype,"selectedRowIds",1),_([p({type:Object,attribute:"storage-options"})],f.prototype,"storageOptions",1),_([p({attribute:!1})],f.prototype,"rowIdCallback",1),_([p({attribute:!1})],f.prototype,"data",1),f=_([kt("yatl-table")],f);return ci(Hi);})();
520
+ `}renderCellWrapper(e){return g` <div class="cell-wrapper">${e}</div> `}connectedCallback(){super.connectedCallback(),this.addControllerListeners(this.controller),this.useYatlUi||customElements.whenDefined("yatl-checkbox").then(()=>{this.useYatlUi=!0})}disconnectedCallback(){super.disconnectedCallback(),this.removeControllerListeners(this.controller),window.addEventListener("mousemove",this.handleResizeMouseMove),window.addEventListener("mouseup",this.handleResizeMouseUp)}addControllerListeners(e){for(let i of this.eventNames)e.addEventListener(i,this.redispatchControllerEvent)}removeControllerListeners(e){for(let i of this.eventNames)e.removeEventListener(i,this.redispatchControllerEvent)}hasVisibleColumn(){return this.displayColumns.map(e=>this.getColumnState(e.field)).filter(e=>e.visible).length>0}getGridWidths(){let e=[];this.enableRowNumberColumn?e.push("var(--yatl-row-number-column-width, 48px)"):e.push("0"),this.rowSelectionMethod?e.push("var(--yatl-row-selector-column-width, 48px)"):e.push("0");for(let i of this.displayColumns){let r=this.getColumnState(i.field),o=r.width!=null;r.visible?o?e.push(`${r.width}px`):e.push("minmax(0, 1fr)"):o?e.push("0px"):e.push("minmax(0, 0fr)")}return e}handleResizeMouseDown(e,i){e.preventDefault(),e.stopPropagation();let o=e.target.closest(".cell");if(!o)return;let n=this.displayColumns.findIndex(a=>a.field===i);if(n<0)return;this.tableElement.classList.add("resizing"),this.tableElement.querySelectorAll(".header .cell").forEach(a=>{let c=a.dataset.field;if(c){let d=this.getColumnState(c);d.width=a.getBoundingClientRect().width,this.updateColumnState(c,d)}});let l=this.getGridWidths();this.resizeState={active:!0,startX:e.pageX,startWidth:o.getBoundingClientRect().width,columnIndex:n+2,columnField:i,currentWidths:l},this.tableElement.style.setProperty("--grid-template",l.join(" ")),window.addEventListener("mousemove",this.handleResizeMouseMove),window.addEventListener("mouseup",this.handleResizeMouseUp)}};f.styles=[oi],_([it(".table")],f.prototype,"tableElement",2),_([it("lit-virtualizer")],f.prototype,"virtualizer",2),_([Nt()],f.prototype,"useYatlUi",2),_([p({attribute:!1})],f.prototype,"controller",1),_([p({type:Boolean,reflect:!0})],f.prototype,"striped",2),_([p({type:Boolean,attribute:"sortable"})],f.prototype,"sortable",2),_([p({type:Boolean,attribute:"resizable"})],f.prototype,"resizable",2),_([p({type:Boolean,attribute:"enable-virtual-scroll"})],f.prototype,"enableVirtualScroll",2),_([p({type:Boolean,attribute:"enable-search-highlight"})],f.prototype,"enableSearchHighlight",2),_([p({type:Boolean,attribute:"enable-search-tokenization"})],f.prototype,"enableSearchTokenization",1),_([p({type:Boolean,attribute:"enable-search-scoring"})],f.prototype,"enableSearchScoring",1),_([p({type:Boolean,attribute:"enable-column-reorder"})],f.prototype,"enableColumnReorder",2),_([p({type:Boolean,attribute:"enable-row-number-column"})],f.prototype,"enableRowNumberColumn",2),_([p({type:Boolean,attribute:"enable-footer"})],f.prototype,"enableFooter",2),_([p({type:String,attribute:"null-value-placeholder"})],f.prototype,"nullValuePlaceholder",2),_([p({type:String,attribute:"empty-message"})],f.prototype,"emptyMessage",2),_([p({type:String,attribute:"no-results-message"})],f.prototype,"noResultsMessage",2),_([p({attribute:!1})],f.prototype,"columns",1),_([p({attribute:!1})],f.prototype,"columnStates",1),_([p({type:String,attribute:"search-query"})],f.prototype,"searchQuery",1),_([p({attribute:!1})],f.prototype,"searchTokenizer",1),_([p({attribute:!1})],f.prototype,"filters",1),_([p({attribute:!1})],f.prototype,"rowParts",2),_([p({type:String})],f.prototype,"rowSelectionMethod",1),_([p({attribute:!1})],f.prototype,"selectedRowIds",1),_([p({type:Object,attribute:"storage-options"})],f.prototype,"storageOptions",1),_([p({attribute:!1})],f.prototype,"rowIdCallback",1),_([p({attribute:!1})],f.prototype,"data",1),f=_([kt("yatl-table")],f);return ci(Hi);})();
516
521
  /*! Bundled license information:
517
522
 
518
523
  @lit-labs/virtualizer/layouts/shared/SizeCache.js: