/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
import{__decorate as t}from"../../tslib/tslib.es6.js";import{html as e,LitElement as r}from"../../lit/index.js";import{property as i}from"../../lit/decorators/property.js";import{virtualize as o,virtualizerRef as l,defaultRenderItem as s,defaultKeyFunction as n}from"./virtualize.js";export class LitVirtualizer extends r{constructor(){super(...arguments),this.items=[],this.renderItem=s,this.keyFunction=n,this.layout={},this.scroller=!1}createRenderRoot(){return this}render(){const{items:t,renderItem:r,keyFunction:i,layout:l,scroller:s}=this;return e`${o({items:t,renderItem:r,keyFunction:i,layout:l,scroller:s})}`}element(t){return this[l]?.element(t)}get layoutComplete(){return this[l]?.layoutComplete}scrollToIndex(t,e="start"){this.element(t)?.scrollIntoView({block:e})}}t([i({attribute:!1})],LitVirtualizer.prototype,"items",void 0),t([i()],LitVirtualizer.prototype,"renderItem",void 0),t([i()],LitVirtualizer.prototype,"keyFunction",void 0),t([i({attribute:!1})],LitVirtualizer.prototype,"layout",void 0),t([i({reflect:!0,type:Boolean})],LitVirtualizer.prototype,"scroller",void 0);