import { audit as e } from "../internal/controllers/audit.controller.js";
import { appendRootNodeStyle as t } from "../internal/utils/dom.js";
import { keyNavigationList as n } from "../internal/controllers/keynav-list.controller.js";
import { attachInternals as r } from "../internal/utils/a11y.js";
import { useStyles as i } from "../internal/styles/index.js";
import { __decorate as a } from "../_virtual/_@oxc-project_runtime@0.130.0/helpers/decorate.js";
import o from "./menu.js";
import s from "./menu.global.js";
import { LitElement as c, html as l } from "lit";
import { queryAssignedElements as u } from "lit/decorators/query-assigned-elements.js";
//#region src/menu/menu.ts
var d = class extends c {
	static {
		this.styles = i([o]);
	}
	static {
		this.metadata = {
			tag: "nve-menu",
			version: "0.2.3",
			children: ["nve-menu-item", "nve-divider"]
		};
	}
	static {
		this.elementDefinitions = {};
	}
	get keynavListConfig() {
		return {
			layout: "vertical",
			items: this.items
		};
	}
	#e = null;
	#t = () => {
		this.#e === null && (this.#e = requestAnimationFrame(() => {
			this.#e = null;
			let e = this.shadowRoot?.querySelector("[internal-host]");
			if (!e) return;
			let { scrollTop: t, scrollHeight: n, clientHeight: r } = e;
			this.dispatchEvent(new CustomEvent("scroll", {
				bubbles: !0,
				composed: !0,
				detail: {
					scrollTop: t,
					scrollHeight: n,
					clientHeight: r
				}
			}));
		}));
	};
	render() {
		return l`<div internal-host><slot></slot></div>`;
	}
	async firstUpdated() {
		await this.updateComplete, this.shadowRoot?.querySelector("[internal-host]")?.addEventListener("scroll", this.#t, { passive: !0 });
	}
	connectedCallback() {
		super.connectedCallback(), r(this), this._internals.role = "menu", t(this, s);
	}
};
a([u()], d.prototype, "items", void 0), d = a([e(), n()], d);
//#endregion
export { d as Menu };

//# sourceMappingURL=menu2.js.map