homeassistant/custom_components/hacs/hacs_frontend_experimental/frontend_latest/4093.EiHf5nQ3ivs.js

3 lines
13 KiB
JavaScript
Raw Normal View History

2025-01-10 21:08:35 -08:00
/*! For license information please see 4093.EiHf5nQ3ivs.js.LICENSE.txt */
export const id=4093;export const ids=[4093];export const modules={64093:(i,t,s)=>{s.r(t),s.d(t,{FlowLayout:()=>_,flow:()=>r});class e{constructor(i){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,!0===(null==i?void 0:i.roundAverageSize)&&(this._roundAverageSize=!0)}set(i,t){const s=this._map.get(i)||0;this._map.set(i,t),this.totalSize+=t-s}get averageSize(){if(this._map.size>0){const i=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(i):i}return 0}getSize(i){return this._map.get(i)}clear(){this._map.clear(),this.totalSize=0}}var h=s(15723);const r=i=>Object.assign({type:_},i);function a(i){return"horizontal"===i?"marginLeft":"marginTop"}function o(i){return"horizontal"===i?"marginRight":"marginBottom"}function n(i,t){const s=[i,t].sort();return s[1]<=0?Math.min(...s):s[0]>=0?Math.max(...s):s[0]+s[1]}class l{constructor(){this._childSizeCache=new e,this._marginSizeCache=new e,this._metricsCache=new Map}update(i,t){const s=new Set;Object.keys(i).forEach((e=>{const r=Number(e);this._metricsCache.set(r,i[r]),this._childSizeCache.set(r,i[r][(0,h.qF)(t)]),s.add(r),s.add(r+1)}));for(const i of s){var e,r;const s=(null===(e=this._metricsCache.get(i))||void 0===e?void 0:e[a(t)])||0,h=(null===(r=this._metricsCache.get(i-1))||void 0===r?void 0:r[o(t)])||0;this._marginSizeCache.set(i,n(s,h))}}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(i,t){var s;return(null===(s=this._metricsCache.get(i))||void 0===s?void 0:s[a(t)])||0}getChildSize(i){return this._childSizeCache.getSize(i)}getMarginSize(i){return this._marginSizeCache.getSize(i)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}}class _ extends h.IE{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new l,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(i){this._metricsCache.update(i,this.direction),this._scheduleReflow()}_getPhysicalItem(i){var t;return null!==(t=this._newPhysicalItems.get(i))&&void 0!==t?t:this._physicalItems.get(i)}_getSize(i){return this._getPhysicalItem(i)&&this._metricsCache.getChildSize(i)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(i){const t=this._metricsCache;if(-1===this._first||-1===this._last)return t.averageMarginSize+i*(t.averageMarginSize+this._getAverageSize());if(i<this._first){const s=this._first-i;return this._getPhysicalItem(this._first).pos-(t.getMarginSize(this._first-1)||t.averageMarginSize)-(s*t.averageChildSize+(s-1)*t.averageMarginSize)}{const s=i-this._last;return this._getPhysicalItem(this._last).pos+(t.getChildSize(this._last)||t.averageChildSize)+(t.getMarginSize(this._last)||t.averageMarginSize)+s*(t.averageChildSize+t.averageMarginSize)}}_getPosition(i){var t;const s=this._getPhysicalItem(i),{averageMarginSize:e}=this._metricsCache;return 0===i?null!==(t=this._metricsCache.getMarginSize(0))&&void 0!==t?t:e:s?s.pos:this._estimatePosition(i)}_calculateAnchor(i,t){return i<=0?0:t>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((i+t)/2/this._delta)))}_getAnchor(i,t){if(0===this._physicalItems.size)return this._calculateAnchor(i,t);if(this._first<0)return this._calculateAnchor(i,t);if(this._last<0)return this._calculateAnchor(i,t);const s=this._getPhysicalItem(this._first),e=this._getPhysicalItem(this._last),h=s.pos;if(e.pos+this._metricsCache.getChildSize(this._last)<i)return this._calculateAnchor(i,t);if(h>t)return this._calculateAnchor(i,t);let r=this._firstVisible-1,a=-1/0;for(;a<i;){a=this._getPhysicalItem(++r).pos+this._metricsCache.getChildSize(r)}return r}_getActiveItems(){0===this._viewDim1||0=
//# sourceMappingURL=4093.EiHf5nQ3ivs.js.map