// ==UserScript== // @name bilibili 页面净化大师 // @namespace http://tampermonkey.net/ // @version 4.1.1 // @author festoney8 // @description 净化 B站/哔哩哔哩 页面,支持「精简功能、播放器净化、过滤视频、过滤评论、全站黑白名单」,提供 300+ 功能,定制自己的 B 站 // @license MIT // @icon https://www.bilibili.com/favicon.ico // @homepage https://github.com/festoney8/bilibili-cleaner // @supportURL https://github.com/festoney8/bilibili-cleaner // @match *://*.bilibili.com/* // @exclude *://message.bilibili.com/pages/nav/header_sync // @exclude *://message.bilibili.com/pages/nav/index_new_pc_sync // @exclude *://data.bilibili.com/* // @exclude *://cm.bilibili.com/* // @exclude *://link.bilibili.com/* // @exclude *://passport.bilibili.com/* // @exclude *://api.bilibili.com/* // @exclude *://api.*.bilibili.com/* // @exclude *://*.chat.bilibili.com/* // @exclude *://member.bilibili.com/* // @exclude *://www.bilibili.com/correspond/* // @exclude *://live.bilibili.com/p/html/* // @exclude *://live.bilibili.com/live-room-play-game-together // @exclude *://www.bilibili.com/blackboard/comment-detail.html* // @exclude *://www.bilibili.com/blackboard/newplayer.html* // @require https://registry.npmmirror.com/vue/3.5.13/files/dist/vue.global.prod.js // @grant GM_getValue // @grant GM_registerMenuCommand // @grant GM_setValue // @grant unsafeWindow // @run-at document-start // @downloadURL none // ==/UserScript== (function (e$1) { 'use strict'; function _interopNamespaceDefault(e) { const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } }); if (e) { for (const k in e) { if (k !== 'default') { const d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: () => e[k] }); } } } n.default = e; return Object.freeze(n); } const e$1__namespace = /*#__PURE__*/_interopNamespaceDefault(e$1); var __defProp = Object.defineProperty; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); var _GM_getValue = /* @__PURE__ */ (() => typeof GM_getValue != "undefined" ? GM_getValue : void 0)(); var _GM_registerMenuCommand = /* @__PURE__ */ (() => typeof GM_registerMenuCommand != "undefined" ? GM_registerMenuCommand : void 0)(); var _GM_setValue = /* @__PURE__ */ (() => typeof GM_setValue != "undefined" ? GM_setValue : void 0)(); var _unsafeWindow = /* @__PURE__ */ (() => typeof unsafeWindow != "undefined" ? unsafeWindow : void 0)(); var isVue2 = false; /*! * pinia v2.3.0 * (c) 2024 Eduardo San Martin Morote * @license MIT */ let activePinia; const setActivePinia = (pinia) => activePinia = pinia; const piniaSymbol = ( /* istanbul ignore next */ Symbol() ); function isPlainObject(o2) { return o2 && typeof o2 === "object" && Object.prototype.toString.call(o2) === "[object Object]" && typeof o2.toJSON !== "function"; } var MutationType; (function(MutationType2) { MutationType2["direct"] = "direct"; MutationType2["patchObject"] = "patch object"; MutationType2["patchFunction"] = "patch function"; })(MutationType || (MutationType = {})); function createPinia() { const scope = e$1.effectScope(true); const state = scope.run(() => e$1.ref({})); let _p = []; let toBeInstalled = []; const pinia = e$1.markRaw({ install(app) { setActivePinia(pinia); { pinia._a = app; app.provide(piniaSymbol, pinia); app.config.globalProperties.$pinia = pinia; toBeInstalled.forEach((plugin) => _p.push(plugin)); toBeInstalled = []; } }, use(plugin) { if (!this._a && !isVue2) { toBeInstalled.push(plugin); } else { _p.push(plugin); } return this; }, _p, // it's actually undefined here // @ts-expect-error _a: null, _e: scope, _s: /* @__PURE__ */ new Map(), state }); return pinia; } const noop$1 = () => { }; function addSubscription(subscriptions, callback, detached, onCleanup = noop$1) { subscriptions.push(callback); const removeSubscription = () => { const idx = subscriptions.indexOf(callback); if (idx > -1) { subscriptions.splice(idx, 1); onCleanup(); } }; if (!detached && e$1.getCurrentScope()) { e$1.onScopeDispose(removeSubscription); } return removeSubscription; } function triggerSubscriptions(subscriptions, ...args) { subscriptions.slice().forEach((callback) => { callback(...args); }); } const fallbackRunWithContext = (fn2) => fn2(); const ACTION_MARKER = Symbol(); const ACTION_NAME = Symbol(); function mergeReactiveObjects(target, patchToApply) { if (target instanceof Map && patchToApply instanceof Map) { patchToApply.forEach((value, key) => target.set(key, value)); } else if (target instanceof Set && patchToApply instanceof Set) { patchToApply.forEach(target.add, target); } for (const key in patchToApply) { if (!patchToApply.hasOwnProperty(key)) continue; const subPatch = patchToApply[key]; const targetValue = target[key]; if (isPlainObject(targetValue) && isPlainObject(subPatch) && target.hasOwnProperty(key) && !e$1.isRef(subPatch) && !e$1.isReactive(subPatch)) { target[key] = mergeReactiveObjects(targetValue, subPatch); } else { target[key] = subPatch; } } return target; } const skipHydrateSymbol = ( /* istanbul ignore next */ Symbol() ); function shouldHydrate(obj) { return !isPlainObject(obj) || !obj.hasOwnProperty(skipHydrateSymbol); } const { assign } = Object; function isComputed(o2) { return !!(e$1.isRef(o2) && o2.effect); } function createOptionsStore(id, options, pinia, hot) { const { state, actions, getters } = options; const initialState = pinia.state.value[id]; let store; function setup() { if (!initialState && true) { { pinia.state.value[id] = state ? state() : {}; } } const localState = e$1.toRefs(pinia.state.value[id]); return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => { computedGetters[name] = e$1.markRaw(e$1.computed(() => { setActivePinia(pinia); const store2 = pinia._s.get(id); return getters[name].call(store2, store2); })); return computedGetters; }, {})); } store = createSetupStore(id, setup, options, pinia, hot, true); return store; } function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) { let scope; const optionsForPlugin = assign({ actions: {} }, options); const $subscribeOptions = { deep: true }; let isListening; let isSyncListening; let subscriptions = []; let actionSubscriptions = []; let debuggerEvents; const initialState = pinia.state.value[$id]; if (!isOptionsStore && !initialState && true) { { pinia.state.value[$id] = {}; } } e$1.ref({}); let activeListener; function $patch(partialStateOrMutator) { let subscriptionMutation; isListening = isSyncListening = false; if (typeof partialStateOrMutator === "function") { partialStateOrMutator(pinia.state.value[$id]); subscriptionMutation = { type: MutationType.patchFunction, storeId: $id, events: debuggerEvents }; } else { mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator); subscriptionMutation = { type: MutationType.patchObject, payload: partialStateOrMutator, storeId: $id, events: debuggerEvents }; } const myListenerId = activeListener = Symbol(); e$1.nextTick().then(() => { if (activeListener === myListenerId) { isListening = true; } }); isSyncListening = true; triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]); } const $reset = isOptionsStore ? function $reset2() { const { state } = options; const newState = state ? state() : {}; this.$patch(($state) => { assign($state, newState); }); } : ( /* istanbul ignore next */ noop$1 ); function $dispose() { scope.stop(); subscriptions = []; actionSubscriptions = []; pinia._s.delete($id); } const action = (fn2, name = "") => { if (ACTION_MARKER in fn2) { fn2[ACTION_NAME] = name; return fn2; } const wrappedAction = function() { setActivePinia(pinia); const args = Array.from(arguments); const afterCallbackList = []; const onErrorCallbackList = []; function after(callback) { afterCallbackList.push(callback); } function onError(callback) { onErrorCallbackList.push(callback); } triggerSubscriptions(actionSubscriptions, { args, name: wrappedAction[ACTION_NAME], store, after, onError }); let ret; try { ret = fn2.apply(this && this.$id === $id ? this : store, args); } catch (error2) { triggerSubscriptions(onErrorCallbackList, error2); throw error2; } if (ret instanceof Promise) { return ret.then((value) => { triggerSubscriptions(afterCallbackList, value); return value; }).catch((error2) => { triggerSubscriptions(onErrorCallbackList, error2); return Promise.reject(error2); }); } triggerSubscriptions(afterCallbackList, ret); return ret; }; wrappedAction[ACTION_MARKER] = true; wrappedAction[ACTION_NAME] = name; return wrappedAction; }; const partialStore = { _p: pinia, // _s: scope, $id, $onAction: addSubscription.bind(null, actionSubscriptions), $patch, $reset, $subscribe(callback, options2 = {}) { const removeSubscription = addSubscription(subscriptions, callback, options2.detached, () => stopWatcher()); const stopWatcher = scope.run(() => e$1.watch(() => pinia.state.value[$id], (state) => { if (options2.flush === "sync" ? isSyncListening : isListening) { callback({ storeId: $id, type: MutationType.direct, events: debuggerEvents }, state); } }, assign({}, $subscribeOptions, options2))); return removeSubscription; }, $dispose }; const store = e$1.reactive(partialStore); pinia._s.set($id, store); const runWithContext = pinia._a && pinia._a.runWithContext || fallbackRunWithContext; const setupStore = runWithContext(() => pinia._e.run(() => (scope = e$1.effectScope()).run(() => setup({ action })))); for (const key in setupStore) { const prop = setupStore[key]; if (e$1.isRef(prop) && !isComputed(prop) || e$1.isReactive(prop)) { if (!isOptionsStore) { if (initialState && shouldHydrate(prop)) { if (e$1.isRef(prop)) { prop.value = initialState[key]; } else { mergeReactiveObjects(prop, initialState[key]); } } { pinia.state.value[$id][key] = prop; } } } else if (typeof prop === "function") { const actionValue = action(prop, key); { setupStore[key] = actionValue; } optionsForPlugin.actions[key] = prop; } else ; } { assign(store, setupStore); assign(e$1.toRaw(store), setupStore); } Object.defineProperty(store, "$state", { get: () => pinia.state.value[$id], set: (state) => { $patch(($state) => { assign($state, state); }); } }); pinia._p.forEach((extender) => { { assign(store, scope.run(() => extender({ store, app: pinia._a, pinia, options: optionsForPlugin }))); } }); if (initialState && isOptionsStore && options.hydrate) { options.hydrate(store.$state, initialState); } isListening = true; isSyncListening = true; return store; } /*! #__NO_SIDE_EFFECTS__ */ // @__NO_SIDE_EFFECTS__ function defineStore(idOrOptions, setup, setupOptions) { let id; let options; const isSetupStore = typeof setup === "function"; if (typeof idOrOptions === "string") { id = idOrOptions; options = isSetupStore ? setupOptions : setup; } else { options = idOrOptions; id = idOrOptions.id; } function useStore(pinia, hot) { const hasContext = e$1.hasInjectionContext(); pinia = // in test mode, ignore the argument provided as we can always retrieve a // pinia instance with getActivePinia() pinia || (hasContext ? e$1.inject(piniaSymbol, null) : null); if (pinia) setActivePinia(pinia); pinia = activePinia; if (!pinia._s.has(id)) { if (isSetupStore) { createSetupStore(id, setup, options, pinia); } else { createOptionsStore(id, options, pinia); } } const store = pinia._s.get(id); return store; } useStore.$id = id; return useStore; } function d$2(u2, e2, r2) { let i2 = e$1.ref(r2 == null ? void 0 : r2.value), f2 = e$1.computed(() => u2.value !== void 0); return [e$1.computed(() => f2.value ? u2.value : i2.value), function(t2) { return f2.value || (i2.value = t2), e2 == null ? void 0 : e2(t2); }]; } var r$2; let n$3 = Symbol("headlessui.useid"), o$4 = 0; const i$4 = (r$2 = e$1__namespace.useId) != null ? r$2 : function() { return e$1__namespace.inject(n$3, () => `${++o$4}`)(); }; function o$3(e2) { var l2; if (e2 == null || e2.value == null) return null; let n2 = (l2 = e2.value.$el) != null ? l2 : e2.value; return n2 instanceof Node ? n2 : null; } function u$5(r2, n2, ...a2) { if (r2 in n2) { let e2 = n2[r2]; return typeof e2 == "function" ? e2(...a2) : e2; } let t2 = new Error(`Tried to handle "${r2}" but there is no handler defined. Only defined handlers are: ${Object.keys(n2).map((e2) => `"${e2}"`).join(", ")}.`); throw Error.captureStackTrace && Error.captureStackTrace(t2, u$5), t2; } var i$3 = Object.defineProperty; var d$1 = (t2, e2, r2) => e2 in t2 ? i$3(t2, e2, { enumerable: true, configurable: true, writable: true, value: r2 }) : t2[e2] = r2; var n$2 = (t2, e2, r2) => (d$1(t2, typeof e2 != "symbol" ? e2 + "" : e2, r2), r2); let s$1 = class s { constructor() { n$2(this, "current", this.detect()); n$2(this, "currentId", 0); } set(e2) { this.current !== e2 && (this.currentId = 0, this.current = e2); } reset() { this.set(this.detect()); } nextId() { return ++this.currentId; } get isServer() { return this.current === "server"; } get isClient() { return this.current === "client"; } detect() { return typeof window == "undefined" || typeof document == "undefined" ? "server" : "client"; } }; let c$2 = new s$1(); function i$2(r2) { if (c$2.isServer) return null; if (r2 instanceof Node) return r2.ownerDocument; if (r2 != null && r2.hasOwnProperty("value")) { let n2 = o$3(r2); if (n2) return n2.ownerDocument; } return document; } let c$1 = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((e2) => `${e2}:not([tabindex='-1'])`).join(","); var N$2 = ((n2) => (n2[n2.First = 1] = "First", n2[n2.Previous = 2] = "Previous", n2[n2.Next = 4] = "Next", n2[n2.Last = 8] = "Last", n2[n2.WrapAround = 16] = "WrapAround", n2[n2.NoScroll = 32] = "NoScroll", n2))(N$2 || {}), T$2 = ((o2) => (o2[o2.Error = 0] = "Error", o2[o2.Overflow = 1] = "Overflow", o2[o2.Success = 2] = "Success", o2[o2.Underflow = 3] = "Underflow", o2))(T$2 || {}), F = ((t2) => (t2[t2.Previous = -1] = "Previous", t2[t2.Next = 1] = "Next", t2))(F || {}); var h = ((t2) => (t2[t2.Strict = 0] = "Strict", t2[t2.Loose = 1] = "Loose", t2))(h || {}); function w$3(e2, r2 = 0) { var t2; return e2 === ((t2 = i$2(e2)) == null ? void 0 : t2.body) ? false : u$5(r2, { [0]() { return e2.matches(c$1); }, [1]() { let l2 = e2; for (; l2 !== null; ) { if (l2.matches(c$1)) return true; l2 = l2.parentElement; } return false; } }); } var y$1 = ((t2) => (t2[t2.Keyboard = 0] = "Keyboard", t2[t2.Mouse = 1] = "Mouse", t2))(y$1 || {}); typeof window != "undefined" && typeof document != "undefined" && (document.addEventListener("keydown", (e2) => { e2.metaKey || e2.altKey || e2.ctrlKey || (document.documentElement.dataset.headlessuiFocusVisible = ""); }, true), document.addEventListener("click", (e2) => { e2.detail === 1 ? delete document.documentElement.dataset.headlessuiFocusVisible : e2.detail === 0 && (document.documentElement.dataset.headlessuiFocusVisible = ""); }, true)); function O$1(e2, r2 = (t2) => t2) { return e2.slice().sort((t2, l2) => { let o2 = r2(t2), i2 = r2(l2); if (o2 === null || i2 === null) return 0; let n2 = o2.compareDocumentPosition(i2); return n2 & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : n2 & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0; }); } function t$1() { return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0; } function i$1() { return /Android/gi.test(window.navigator.userAgent); } function n$1() { return t$1() || i$1(); } function u$4(e2, t2, n2) { c$2.isServer || e$1.watchEffect((o2) => { document.addEventListener(e2, t2, n2), o2(() => document.removeEventListener(e2, t2, n2)); }); } function w$2(e2, n2, t2) { c$2.isServer || e$1.watchEffect((o2) => { window.addEventListener(e2, n2, t2), o2(() => window.removeEventListener(e2, n2, t2)); }); } function w$1(f2, m, l2 = e$1.computed(() => true)) { function a2(e2, r2) { if (!l2.value || e2.defaultPrevented) return; let t2 = r2(e2); if (t2 === null || !t2.getRootNode().contains(t2)) return; let c2 = function o2(n2) { return typeof n2 == "function" ? o2(n2()) : Array.isArray(n2) || n2 instanceof Set ? n2 : [n2]; }(f2); for (let o2 of c2) { if (o2 === null) continue; let n2 = o2 instanceof HTMLElement ? o2 : o$3(o2); if (n2 != null && n2.contains(t2) || e2.composed && e2.composedPath().includes(n2)) return; } return !w$3(t2, h.Loose) && t2.tabIndex !== -1 && e2.preventDefault(), m(e2, t2); } let u2 = e$1.ref(null); u$4("pointerdown", (e2) => { var r2, t2; l2.value && (u2.value = ((t2 = (r2 = e2.composedPath) == null ? void 0 : r2.call(e2)) == null ? void 0 : t2[0]) || e2.target); }, true), u$4("mousedown", (e2) => { var r2, t2; l2.value && (u2.value = ((t2 = (r2 = e2.composedPath) == null ? void 0 : r2.call(e2)) == null ? void 0 : t2[0]) || e2.target); }, true), u$4("click", (e2) => { n$1() || u2.value && (a2(e2, () => u2.value), u2.value = null); }, true), u$4("touchend", (e2) => a2(e2, () => e2.target instanceof HTMLElement ? e2.target : null), true), w$2("blur", (e2) => a2(e2, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), true); } function r$1(t2, e2) { if (t2) return t2; let n2 = e2 != null ? e2 : "button"; if (typeof n2 == "string" && n2.toLowerCase() === "button") return "button"; } function s2(t2, e2) { let n2 = e$1.ref(r$1(t2.value.type, t2.value.as)); return e$1.onMounted(() => { n2.value = r$1(t2.value.type, t2.value.as); }), e$1.watchEffect(() => { var u2; n2.value || o$3(e2) && o$3(e2) instanceof HTMLButtonElement && !((u2 = o$3(e2)) != null && u2.hasAttribute("type")) && (n2.value = "button"); }), n2; } function r(e2) { return [e2.screenX, e2.screenY]; } function u$3() { let e2 = e$1.ref([-1, -1]); return { wasMoved(n2) { let t2 = r(n2); return e2.value[0] === t2[0] && e2.value[1] === t2[1] ? false : (e2.value = t2, true); }, update(n2) { e2.value = r(n2); } }; } var N$1 = ((o2) => (o2[o2.None = 0] = "None", o2[o2.RenderStrategy = 1] = "RenderStrategy", o2[o2.Static = 2] = "Static", o2))(N$1 || {}), S = ((e2) => (e2[e2.Unmount = 0] = "Unmount", e2[e2.Hidden = 1] = "Hidden", e2))(S || {}); function A$1({ visible: r2 = true, features: t2 = 0, ourProps: e2, theirProps: o2, ...i2 }) { var a2; let n2 = j(o2, e2), l2 = Object.assign(i2, { props: n2 }); if (r2 || t2 & 2 && n2.static) return y(l2); if (t2 & 1) { let d2 = (a2 = n2.unmount) == null || a2 ? 0 : 1; return u$5(d2, { [0]() { return null; }, [1]() { return y({ ...i2, props: { ...n2, hidden: true, style: { display: "none" } } }); } }); } return y(l2); } function y({ props: r2, attrs: t2, slots: e2, slot: o2, name: i2 }) { var m, h2; let { as: n2, ...l2 } = T$1(r2, ["unmount", "static"]), a2 = (m = e2.default) == null ? void 0 : m.call(e2, o2), d2 = {}; if (o2) { let u2 = false, c2 = []; for (let [p2, f2] of Object.entries(o2)) typeof f2 == "boolean" && (u2 = true), f2 === true && c2.push(p2); u2 && (d2["data-headlessui-state"] = c2.join(" ")); } if (n2 === "template") { if (a2 = b(a2 != null ? a2 : []), Object.keys(l2).length > 0 || Object.keys(t2).length > 0) { let [u2, ...c2] = a2 != null ? a2 : []; if (!v(u2) || c2.length > 0) throw new Error(['Passing props on "template"!', "", `The current component <${i2} /> is rendering a "template".`, "However we need to passthrough the following props:", Object.keys(l2).concat(Object.keys(t2)).map((s3) => s3.trim()).filter((s3, g2, R) => R.indexOf(s3) === g2).sort((s3, g2) => s3.localeCompare(g2)).map((s3) => ` - ${s3}`).join(` `), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".', "Render a single element as the child so that we can forward the props onto that element."].map((s3) => ` - ${s3}`).join(` `)].join(` `)); let p2 = j((h2 = u2.props) != null ? h2 : {}, l2, d2), f2 = e$1.cloneVNode(u2, p2, true); for (let s3 in p2) s3.startsWith("on") && (f2.props || (f2.props = {}), f2.props[s3] = p2[s3]); return f2; } return Array.isArray(a2) && a2.length === 1 ? a2[0] : a2; } return e$1.h(n2, Object.assign({}, l2, d2), { default: () => a2 }); } function b(r2) { return r2.flatMap((t2) => t2.type === e$1.Fragment ? b(t2.children) : [t2]); } function j(...r2) { if (r2.length === 0) return {}; if (r2.length === 1) return r2[0]; let t2 = {}, e2 = {}; for (let i2 of r2) for (let n2 in i2) n2.startsWith("on") && typeof i2[n2] == "function" ? (e2[n2] != null || (e2[n2] = []), e2[n2].push(i2[n2])) : t2[n2] = i2[n2]; if (t2.disabled || t2["aria-disabled"]) return Object.assign(t2, Object.fromEntries(Object.keys(e2).map((i2) => [i2, void 0]))); for (let i2 in e2) Object.assign(t2, { [i2](n2, ...l2) { let a2 = e2[i2]; for (let d2 of a2) { if (n2 instanceof Event && n2.defaultPrevented) return; d2(n2, ...l2); } } }); return t2; } function E$1(r2) { let t2 = Object.assign({}, r2); for (let e2 in t2) t2[e2] === void 0 && delete t2[e2]; return t2; } function T$1(r2, t2 = []) { let e2 = Object.assign({}, r2); for (let o2 of t2) o2 in e2 && delete e2[o2]; return e2; } function v(r2) { return r2 == null ? false : typeof r2.type == "string" || typeof r2.type == "object" || typeof r2.type == "function"; } var u$2 = ((e2) => (e2[e2.None = 1] = "None", e2[e2.Focusable = 2] = "Focusable", e2[e2.Hidden = 4] = "Hidden", e2))(u$2 || {}); let f$2 = e$1.defineComponent({ name: "Hidden", props: { as: { type: [Object, String], default: "div" }, features: { type: Number, default: 1 } }, setup(t2, { slots: n2, attrs: i2 }) { return () => { var r2; let { features: e2, ...d2 } = t2, o2 = { "aria-hidden": (e2 & 2) === 2 ? true : (r2 = d2["aria-hidden"]) != null ? r2 : void 0, hidden: (e2 & 4) === 4 ? true : void 0, style: { position: "fixed", top: 1, left: 1, width: 1, height: 0, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0", ...(e2 & 4) === 4 && (e2 & 2) !== 2 && { display: "none" } } }; return A$1({ ourProps: o2, theirProps: d2, slot: {}, attrs: i2, slots: n2, name: "Hidden" }); }; } }); let n = Symbol("Context"); var i = ((e2) => (e2[e2.Open = 1] = "Open", e2[e2.Closed = 2] = "Closed", e2[e2.Closing = 4] = "Closing", e2[e2.Opening = 8] = "Opening", e2))(i || {}); function l() { return e$1.inject(n, null); } function t(o2) { e$1.provide(n, o2); } var o$2 = ((r2) => (r2.Space = " ", r2.Enter = "Enter", r2.Escape = "Escape", r2.Backspace = "Backspace", r2.Delete = "Delete", r2.ArrowLeft = "ArrowLeft", r2.ArrowUp = "ArrowUp", r2.ArrowRight = "ArrowRight", r2.ArrowDown = "ArrowDown", r2.Home = "Home", r2.End = "End", r2.PageUp = "PageUp", r2.PageDown = "PageDown", r2.Tab = "Tab", r2))(o$2 || {}); function u$1(l2) { throw new Error("Unexpected object: " + l2); } var c = ((i2) => (i2[i2.First = 0] = "First", i2[i2.Previous = 1] = "Previous", i2[i2.Next = 2] = "Next", i2[i2.Last = 3] = "Last", i2[i2.Specific = 4] = "Specific", i2[i2.Nothing = 5] = "Nothing", i2))(c || {}); function f$1(l2, n2) { let t2 = n2.resolveItems(); if (t2.length <= 0) return null; let r2 = n2.resolveActiveIndex(), s3 = r2 != null ? r2 : -1; switch (l2.focus) { case 0: { for (let e2 = 0; e2 < t2.length; ++e2) if (!n2.resolveDisabled(t2[e2], e2, t2)) return e2; return r2; } case 1: { s3 === -1 && (s3 = t2.length); for (let e2 = s3 - 1; e2 >= 0; --e2) if (!n2.resolveDisabled(t2[e2], e2, t2)) return e2; return r2; } case 2: { for (let e2 = s3 + 1; e2 < t2.length; ++e2) if (!n2.resolveDisabled(t2[e2], e2, t2)) return e2; return r2; } case 3: { for (let e2 = t2.length - 1; e2 >= 0; --e2) if (!n2.resolveDisabled(t2[e2], e2, t2)) return e2; return r2; } case 4: { for (let e2 = 0; e2 < t2.length; ++e2) if (n2.resolveId(t2[e2], e2, t2) === l2.id) return e2; return r2; } case 5: return null; default: u$1(l2); } } function e(i2 = {}, s3 = null, t2 = []) { for (let [r2, n2] of Object.entries(i2)) o$1(t2, f(s3, r2), n2); return t2; } function f(i2, s3) { return i2 ? i2 + "[" + s3 + "]" : s3; } function o$1(i2, s3, t2) { if (Array.isArray(t2)) for (let [r2, n2] of t2.entries()) o$1(i2, f(s3, r2.toString()), n2); else t2 instanceof Date ? i2.push([s3, t2.toISOString()]) : typeof t2 == "boolean" ? i2.push([s3, t2 ? "1" : "0"]) : typeof t2 == "string" ? i2.push([s3, t2]) : typeof t2 == "number" ? i2.push([s3, `${t2}`]) : t2 == null ? i2.push([s3, ""]) : e(t2, s3, i2); } function p$1(i2) { var t2, r2; let s3 = (t2 = i2 == null ? void 0 : i2.form) != null ? t2 : i2.closest("form"); if (s3) { for (let n2 of s3.elements) if (n2 !== i2 && (n2.tagName === "INPUT" && n2.type === "submit" || n2.tagName === "BUTTON" && n2.type === "submit" || n2.nodeName === "INPUT" && n2.type === "image")) { n2.click(); return; } (r2 = s3.requestSubmit) == null || r2.call(s3); } } let u = Symbol("DescriptionContext"); function w() { let t2 = e$1.inject(u, null); if (t2 === null) throw new Error("Missing parent"); return t2; } function k$1({ slot: t2 = e$1.ref({}), name: o2 = "Description", props: s3 = {} } = {}) { let e2 = e$1.ref([]); function r2(n2) { return e2.value.push(n2), () => { let i2 = e2.value.indexOf(n2); i2 !== -1 && e2.value.splice(i2, 1); }; } return e$1.provide(u, { register: r2, slot: t2, name: o2, props: s3 }), e$1.computed(() => e2.value.length > 0 ? e2.value.join(" ") : void 0); } e$1.defineComponent({ name: "Description", props: { as: { type: [Object, String], default: "p" }, id: { type: String, default: null } }, setup(t2, { attrs: o2, slots: s3 }) { var n2; let e2 = (n2 = t2.id) != null ? n2 : `headlessui-description-${i$4()}`, r2 = w(); return e$1.onMounted(() => e$1.onUnmounted(r2.register(e2))), () => { let { name: i2 = "Description", slot: l2 = e$1.ref({}), props: d2 = {} } = r2, { ...c2 } = t2, f2 = { ...Object.entries(d2).reduce((a2, [g2, m]) => Object.assign(a2, { [g2]: e$1.unref(m) }), {}), id: e2 }; return A$1({ ourProps: f2, theirProps: c2, slot: l2.value, attrs: o2, slots: s3, name: i2 }); }; } }); var $$1 = ((o2) => (o2[o2.Open = 0] = "Open", o2[o2.Closed = 1] = "Closed", o2))($$1 || {}); let T = Symbol("DisclosureContext"); function O(t2) { let r2 = e$1.inject(T, null); if (r2 === null) { let o2 = new Error(`<${t2} /> is missing a parent component.`); throw Error.captureStackTrace && Error.captureStackTrace(o2, O), o2; } return r2; } let k = Symbol("DisclosurePanelContext"); function U() { return e$1.inject(k, null); } let N = e$1.defineComponent({ name: "Disclosure", props: { as: { type: [Object, String], default: "template" }, defaultOpen: { type: [Boolean], default: false } }, setup(t$12, { slots: r2, attrs: o2 }) { let s3 = e$1.ref(t$12.defaultOpen ? 0 : 1), e2 = e$1.ref(null), i$12 = e$1.ref(null), n2 = { buttonId: e$1.ref(`headlessui-disclosure-button-${i$4()}`), panelId: e$1.ref(`headlessui-disclosure-panel-${i$4()}`), disclosureState: s3, panel: e2, button: i$12, toggleDisclosure() { s3.value = u$5(s3.value, { [0]: 1, [1]: 0 }); }, closeDisclosure() { s3.value !== 1 && (s3.value = 1); }, close(l2) { n2.closeDisclosure(); let a2 = (() => l2 ? l2 instanceof HTMLElement ? l2 : l2.value instanceof HTMLElement ? o$3(l2) : o$3(n2.button) : o$3(n2.button))(); a2 == null || a2.focus(); } }; return e$1.provide(T, n2), t(e$1.computed(() => u$5(s3.value, { [0]: i.Open, [1]: i.Closed }))), () => { let { defaultOpen: l2, ...a2 } = t$12, c2 = { open: s3.value === 0, close: n2.close }; return A$1({ theirProps: a2, ourProps: {}, slot: c2, slots: r2, attrs: o2, name: "Disclosure" }); }; } }), Q = e$1.defineComponent({ name: "DisclosureButton", props: { as: { type: [Object, String], default: "button" }, disabled: { type: [Boolean], default: false }, id: { type: String, default: null } }, setup(t2, { attrs: r2, slots: o2, expose: s$12 }) { let e2 = O("DisclosureButton"), i2 = U(), n2 = e$1.computed(() => i2 === null ? false : i2.value === e2.panelId.value); e$1.onMounted(() => { n2.value || t2.id !== null && (e2.buttonId.value = t2.id); }), e$1.onUnmounted(() => { n2.value || (e2.buttonId.value = null); }); let l2 = e$1.ref(null); s$12({ el: l2, $el: l2 }), n2.value || e$1.watchEffect(() => { e2.button.value = l2.value; }); let a2 = s2(e$1.computed(() => ({ as: t2.as, type: r2.type })), l2); function c2() { var u2; t2.disabled || (n2.value ? (e2.toggleDisclosure(), (u2 = o$3(e2.button)) == null || u2.focus()) : e2.toggleDisclosure()); } function D(u2) { var S2; if (!t2.disabled) if (n2.value) switch (u2.key) { case o$2.Space: case o$2.Enter: u2.preventDefault(), u2.stopPropagation(), e2.toggleDisclosure(), (S2 = o$3(e2.button)) == null || S2.focus(); break; } else switch (u2.key) { case o$2.Space: case o$2.Enter: u2.preventDefault(), u2.stopPropagation(), e2.toggleDisclosure(); break; } } function v2(u2) { switch (u2.key) { case o$2.Space: u2.preventDefault(); break; } } return () => { var C2; let u2 = { open: e2.disclosureState.value === 0 }, { id: S2, ...K2 } = t2, M = n2.value ? { ref: l2, type: a2.value, onClick: c2, onKeydown: D } : { id: (C2 = e2.buttonId.value) != null ? C2 : S2, ref: l2, type: a2.value, "aria-expanded": e2.disclosureState.value === 0, "aria-controls": e2.disclosureState.value === 0 || o$3(e2.panel) ? e2.panelId.value : void 0, disabled: t2.disabled ? true : void 0, onClick: c2, onKeydown: D, onKeyup: v2 }; return A$1({ ourProps: M, theirProps: K2, slot: u2, attrs: r2, slots: o2, name: "DisclosureButton" }); }; } }), V = e$1.defineComponent({ name: "DisclosurePanel", props: { as: { type: [Object, String], default: "div" }, static: { type: Boolean, default: false }, unmount: { type: Boolean, default: true }, id: { type: String, default: null } }, setup(t2, { attrs: r2, slots: o2, expose: s3 }) { let e2 = O("DisclosurePanel"); e$1.onMounted(() => { t2.id !== null && (e2.panelId.value = t2.id); }), e$1.onUnmounted(() => { e2.panelId.value = null; }), s3({ el: e2.panel, $el: e2.panel }), e$1.provide(k, e2.panelId); let i$12 = l(), n2 = e$1.computed(() => i$12 !== null ? (i$12.value & i.Open) === i.Open : e2.disclosureState.value === 0); return () => { var v2; let l2 = { open: e2.disclosureState.value === 0, close: e2.close }, { id: a2, ...c2 } = t2, D = { id: (v2 = e2.panelId.value) != null ? v2 : a2, ref: e2.panel }; return A$1({ ourProps: D, theirProps: c2, slot: l2, attrs: r2, slots: o2, features: N$1.RenderStrategy | N$1.Static, visible: n2.value, name: "DisclosurePanel" }); }; } }); let a$1 = /([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g; function o(e2) { var r2, i2; let n2 = (r2 = e2.innerText) != null ? r2 : "", t2 = e2.cloneNode(true); if (!(t2 instanceof HTMLElement)) return n2; let u2 = false; for (let f2 of t2.querySelectorAll('[hidden],[aria-hidden],[role="img"]')) f2.remove(), u2 = true; let l2 = u2 ? (i2 = t2.innerText) != null ? i2 : "" : n2; return a$1.test(l2) && (l2 = l2.replace(a$1, "")), l2; } function g(e2) { let n2 = e2.getAttribute("aria-label"); if (typeof n2 == "string") return n2.trim(); let t2 = e2.getAttribute("aria-labelledby"); if (t2) { let u2 = t2.split(" ").map((l2) => { let r2 = document.getElementById(l2); if (r2) { let i2 = r2.getAttribute("aria-label"); return typeof i2 == "string" ? i2.trim() : o(r2).trim(); } return null; }).filter(Boolean); if (u2.length > 0) return u2.join(", "); } return o(e2).trim(); } function p(a2) { let t2 = e$1.ref(""), r2 = e$1.ref(""); return () => { let e2 = o$3(a2); if (!e2) return ""; let l2 = e2.innerText; if (t2.value === l2) return r2.value; let u2 = g(e2).trim().toLowerCase(); return t2.value = l2, r2.value = u2, u2; }; } function pe(o2, b2) { return o2 === b2; } var ce = ((r2) => (r2[r2.Open = 0] = "Open", r2[r2.Closed = 1] = "Closed", r2))(ce || {}), ve = ((r2) => (r2[r2.Single = 0] = "Single", r2[r2.Multi = 1] = "Multi", r2))(ve || {}), be = ((r2) => (r2[r2.Pointer = 0] = "Pointer", r2[r2.Other = 1] = "Other", r2))(be || {}); function me(o2) { requestAnimationFrame(() => requestAnimationFrame(o2)); } let $ = Symbol("ListboxContext"); function A(o2) { let b2 = e$1.inject($, null); if (b2 === null) { let r2 = new Error(`<${o2} /> is missing a parent component.`); throw Error.captureStackTrace && Error.captureStackTrace(r2, A), r2; } return b2; } let Ie = e$1.defineComponent({ name: "Listbox", emits: { "update:modelValue": (o2) => true }, props: { as: { type: [Object, String], default: "template" }, disabled: { type: [Boolean], default: false }, by: { type: [String, Function], default: () => pe }, horizontal: { type: [Boolean], default: false }, modelValue: { type: [Object, String, Number, Boolean], default: void 0 }, defaultValue: { type: [Object, String, Number, Boolean], default: void 0 }, form: { type: String, optional: true }, name: { type: String, optional: true }, multiple: { type: [Boolean], default: false } }, inheritAttrs: false, setup(o2, { slots: b2, attrs: r2, emit: w2 }) { let n2 = e$1.ref(1), e$12 = e$1.ref(null), f2 = e$1.ref(null), v2 = e$1.ref(null), s3 = e$1.ref([]), m = e$1.ref(""), p2 = e$1.ref(null), a2 = e$1.ref(1); function u2(t2 = (i2) => i2) { let i2 = p2.value !== null ? s3.value[p2.value] : null, l2 = O$1(t2(s3.value.slice()), (O2) => o$3(O2.dataRef.domRef)), d2 = i2 ? l2.indexOf(i2) : null; return d2 === -1 && (d2 = null), { options: l2, activeOptionIndex: d2 }; } let D = e$1.computed(() => o2.multiple ? 1 : 0), [y2, L] = d$2(e$1.computed(() => o2.modelValue), (t2) => w2("update:modelValue", t2), e$1.computed(() => o2.defaultValue)), M = e$1.computed(() => y2.value === void 0 ? u$5(D.value, { [1]: [], [0]: void 0 }) : y2.value), k2 = { listboxState: n2, value: M, mode: D, compare(t2, i2) { if (typeof o2.by == "string") { let l2 = o2.by; return (t2 == null ? void 0 : t2[l2]) === (i2 == null ? void 0 : i2[l2]); } return o2.by(t2, i2); }, orientation: e$1.computed(() => o2.horizontal ? "horizontal" : "vertical"), labelRef: e$12, buttonRef: f2, optionsRef: v2, disabled: e$1.computed(() => o2.disabled), options: s3, searchQuery: m, activeOptionIndex: p2, activationTrigger: a2, closeListbox() { o2.disabled || n2.value !== 1 && (n2.value = 1, p2.value = null); }, openListbox() { o2.disabled || n2.value !== 0 && (n2.value = 0); }, goToOption(t2, i2, l2) { if (o2.disabled || n2.value === 1) return; let d2 = u2(), O2 = f$1(t2 === c.Specific ? { focus: c.Specific, id: i2 } : { focus: t2 }, { resolveItems: () => d2.options, resolveActiveIndex: () => d2.activeOptionIndex, resolveId: (h2) => h2.id, resolveDisabled: (h2) => h2.dataRef.disabled }); m.value = "", p2.value = O2, a2.value = l2 != null ? l2 : 1, s3.value = d2.options; }, search(t2) { if (o2.disabled || n2.value === 1) return; let l2 = m.value !== "" ? 0 : 1; m.value += t2.toLowerCase(); let O2 = (p2.value !== null ? s3.value.slice(p2.value + l2).concat(s3.value.slice(0, p2.value + l2)) : s3.value).find((I) => I.dataRef.textValue.startsWith(m.value) && !I.dataRef.disabled), h2 = O2 ? s3.value.indexOf(O2) : -1; h2 === -1 || h2 === p2.value || (p2.value = h2, a2.value = 1); }, clearSearch() { o2.disabled || n2.value !== 1 && m.value !== "" && (m.value = ""); }, registerOption(t2, i2) { let l2 = u2((d2) => [...d2, { id: t2, dataRef: i2 }]); s3.value = l2.options, p2.value = l2.activeOptionIndex; }, unregisterOption(t2) { let i2 = u2((l2) => { let d2 = l2.findIndex((O2) => O2.id === t2); return d2 !== -1 && l2.splice(d2, 1), l2; }); s3.value = i2.options, p2.value = i2.activeOptionIndex, a2.value = 1; }, theirOnChange(t2) { o2.disabled || L(t2); }, select(t2) { o2.disabled || L(u$5(D.value, { [0]: () => t2, [1]: () => { let i2 = e$1.toRaw(k2.value.value).slice(), l2 = e$1.toRaw(t2), d2 = i2.findIndex((O2) => k2.compare(l2, e$1.toRaw(O2))); return d2 === -1 ? i2.push(l2) : i2.splice(d2, 1), i2; } })); } }; w$1([f2, v2], (t2, i2) => { var l2; k2.closeListbox(), w$3(i2, h.Loose) || (t2.preventDefault(), (l2 = o$3(f2)) == null || l2.focus()); }, e$1.computed(() => n2.value === 0)), e$1.provide($, k2), t(e$1.computed(() => u$5(n2.value, { [0]: i.Open, [1]: i.Closed }))); let C2 = e$1.computed(() => { var t2; return (t2 = o$3(f2)) == null ? void 0 : t2.closest("form"); }); return e$1.onMounted(() => { e$1.watch([C2], () => { if (!C2.value || o2.defaultValue === void 0) return; function t2() { k2.theirOnChange(o2.defaultValue); } return C2.value.addEventListener("reset", t2), () => { var i2; (i2 = C2.value) == null || i2.removeEventListener("reset", t2); }; }, { immediate: true }); }), () => { let { name: t2, modelValue: i2, disabled: l2, form: d2, ...O2 } = o2, h2 = { open: n2.value === 0, disabled: l2, value: M.value }; return e$1.h(e$1.Fragment, [...t2 != null && M.value != null ? e({ [t2]: M.value }).map(([I, Q2]) => e$1.h(f$2, E$1({ features: u$2.Hidden, key: I, as: "input", type: "hidden", hidden: true, readOnly: true, form: d2, disabled: l2, name: I, value: Q2 }))) : [], A$1({ ourProps: {}, theirProps: { ...r2, ...T$1(O2, ["defaultValue", "onUpdate:modelValue", "horizontal", "multiple", "by"]) }, slot: h2, slots: b2, attrs: r2, name: "Listbox" })]); }; } }); e$1.defineComponent({ name: "ListboxLabel", props: { as: { type: [Object, String], default: "label" }, id: { type: String, default: null } }, setup(o2, { attrs: b2, slots: r2 }) { var f2; let w2 = (f2 = o2.id) != null ? f2 : `headlessui-listbox-label-${i$4()}`, n2 = A("ListboxLabel"); function e2() { var v2; (v2 = o$3(n2.buttonRef)) == null || v2.focus({ preventScroll: true }); } return () => { let v2 = { open: n2.listboxState.value === 0, disabled: n2.disabled.value }, { ...s3 } = o2, m = { id: w2, ref: n2.labelRef, onClick: e2 }; return A$1({ ourProps: m, theirProps: s3, slot: v2, attrs: b2, slots: r2, name: "ListboxLabel" }); }; } }); let je = e$1.defineComponent({ name: "ListboxButton", props: { as: { type: [Object, String], default: "button" }, id: { type: String, default: null } }, setup(o2, { attrs: b2, slots: r2, expose: w2 }) { var p2; let n2 = (p2 = o2.id) != null ? p2 : `headlessui-listbox-button-${i$4()}`, e2 = A("ListboxButton"); w2({ el: e2.buttonRef, $el: e2.buttonRef }); function f2(a2) { switch (a2.key) { case o$2.Space: case o$2.Enter: case o$2.ArrowDown: a2.preventDefault(), e2.openListbox(), e$1.nextTick(() => { var u2; (u2 = o$3(e2.optionsRef)) == null || u2.focus({ preventScroll: true }), e2.value.value || e2.goToOption(c.First); }); break; case o$2.ArrowUp: a2.preventDefault(), e2.openListbox(), e$1.nextTick(() => { var u2; (u2 = o$3(e2.optionsRef)) == null || u2.focus({ preventScroll: true }), e2.value.value || e2.goToOption(c.Last); }); break; } } function v2(a2) { switch (a2.key) { case o$2.Space: a2.preventDefault(); break; } } function s$12(a2) { e2.disabled.value || (e2.listboxState.value === 0 ? (e2.closeListbox(), e$1.nextTick(() => { var u2; return (u2 = o$3(e2.buttonRef)) == null ? void 0 : u2.focus({ preventScroll: true }); })) : (a2.preventDefault(), e2.openListbox(), me(() => { var u2; return (u2 = o$3(e2.optionsRef)) == null ? void 0 : u2.focus({ preventScroll: true }); }))); } let m = s2(e$1.computed(() => ({ as: o2.as, type: b2.type })), e2.buttonRef); return () => { var y2, L; let a2 = { open: e2.listboxState.value === 0, disabled: e2.disabled.value, value: e2.value.value }, { ...u2 } = o2, D = { ref: e2.buttonRef, id: n2, type: m.value, "aria-haspopup": "listbox", "aria-controls": (y2 = o$3(e2.optionsRef)) == null ? void 0 : y2.id, "aria-expanded": e2.listboxState.value === 0, "aria-labelledby": e2.labelRef.value ? [(L = o$3(e2.labelRef)) == null ? void 0 : L.id, n2].join(" ") : void 0, disabled: e2.disabled.value === true ? true : void 0, onKeydown: f2, onKeyup: v2, onClick: s$12 }; return A$1({ ourProps: D, theirProps: u2, slot: a2, attrs: b2, slots: r2, name: "ListboxButton" }); }; } }), Ae = e$1.defineComponent({ name: "ListboxOptions", props: { as: { type: [Object, String], default: "ul" }, static: { type: Boolean, default: false }, unmount: { type: Boolean, default: true }, id: { type: String, default: null } }, setup(o2, { attrs: b2, slots: r2, expose: w2 }) { var p2; let n2 = (p2 = o2.id) != null ? p2 : `headlessui-listbox-options-${i$4()}`, e2 = A("ListboxOptions"), f2 = e$1.ref(null); w2({ el: e2.optionsRef, $el: e2.optionsRef }); function v2(a2) { switch (f2.value && clearTimeout(f2.value), a2.key) { case o$2.Space: if (e2.searchQuery.value !== "") return a2.preventDefault(), a2.stopPropagation(), e2.search(a2.key); case o$2.Enter: if (a2.preventDefault(), a2.stopPropagation(), e2.activeOptionIndex.value !== null) { let u2 = e2.options.value[e2.activeOptionIndex.value]; e2.select(u2.dataRef.value); } e2.mode.value === 0 && (e2.closeListbox(), e$1.nextTick(() => { var u2; return (u2 = o$3(e2.buttonRef)) == null ? void 0 : u2.focus({ preventScroll: true }); })); break; case u$5(e2.orientation.value, { vertical: o$2.ArrowDown, horizontal: o$2.ArrowRight }): return a2.preventDefault(), a2.stopPropagation(), e2.goToOption(c.Next); case u$5(e2.orientation.value, { vertical: o$2.ArrowUp, horizontal: o$2.ArrowLeft }): return a2.preventDefault(), a2.stopPropagation(), e2.goToOption(c.Previous); case o$2.Home: case o$2.PageUp: return a2.preventDefault(), a2.stopPropagation(), e2.goToOption(c.First); case o$2.End: case o$2.PageDown: return a2.preventDefault(), a2.stopPropagation(), e2.goToOption(c.Last); case o$2.Escape: a2.preventDefault(), a2.stopPropagation(), e2.closeListbox(), e$1.nextTick(() => { var u2; return (u2 = o$3(e2.buttonRef)) == null ? void 0 : u2.focus({ preventScroll: true }); }); break; case o$2.Tab: a2.preventDefault(), a2.stopPropagation(); break; default: a2.key.length === 1 && (e2.search(a2.key), f2.value = setTimeout(() => e2.clearSearch(), 350)); break; } } let s3 = l(), m = e$1.computed(() => s3 !== null ? (s3.value & i.Open) === i.Open : e2.listboxState.value === 0); return () => { var y2, L; let a2 = { open: e2.listboxState.value === 0 }, { ...u2 } = o2, D = { "aria-activedescendant": e2.activeOptionIndex.value === null || (y2 = e2.options.value[e2.activeOptionIndex.value]) == null ? void 0 : y2.id, "aria-multiselectable": e2.mode.value === 1 ? true : void 0, "aria-labelledby": (L = o$3(e2.buttonRef)) == null ? void 0 : L.id, "aria-orientation": e2.orientation.value, id: n2, onKeydown: v2, role: "listbox", tabIndex: 0, ref: e2.optionsRef }; return A$1({ ourProps: D, theirProps: u2, slot: a2, attrs: b2, slots: r2, features: N$1.RenderStrategy | N$1.Static, visible: m.value, name: "ListboxOptions" }); }; } }), Fe = e$1.defineComponent({ name: "ListboxOption", props: { as: { type: [Object, String], default: "li" }, value: { type: [Object, String, Number, Boolean] }, disabled: { type: Boolean, default: false }, id: { type: String, default: null } }, setup(o2, { slots: b2, attrs: r2, expose: w2 }) { var C2; let n2 = (C2 = o2.id) != null ? C2 : `headlessui-listbox-option-${i$4()}`, e2 = A("ListboxOption"), f2 = e$1.ref(null); w2({ el: f2, $el: f2 }); let v2 = e$1.computed(() => e2.activeOptionIndex.value !== null ? e2.options.value[e2.activeOptionIndex.value].id === n2 : false), s3 = e$1.computed(() => u$5(e2.mode.value, { [0]: () => e2.compare(e$1.toRaw(e2.value.value), e$1.toRaw(o2.value)), [1]: () => e$1.toRaw(e2.value.value).some((t2) => e2.compare(e$1.toRaw(t2), e$1.toRaw(o2.value))) })), m = e$1.computed(() => u$5(e2.mode.value, { [1]: () => { var i2; let t2 = e$1.toRaw(e2.value.value); return ((i2 = e2.options.value.find((l2) => t2.some((d2) => e2.compare(e$1.toRaw(d2), e$1.toRaw(l2.dataRef.value))))) == null ? void 0 : i2.id) === n2; }, [0]: () => s3.value })), p$12 = p(f2), a2 = e$1.computed(() => ({ disabled: o2.disabled, value: o2.value, get textValue() { return p$12(); }, domRef: f2 })); e$1.onMounted(() => e2.registerOption(n2, a2)), e$1.onUnmounted(() => e2.unregisterOption(n2)), e$1.onMounted(() => { e$1.watch([e2.listboxState, s3], () => { e2.listboxState.value === 0 && s3.value && u$5(e2.mode.value, { [1]: () => { m.value && e2.goToOption(c.Specific, n2); }, [0]: () => { e2.goToOption(c.Specific, n2); } }); }, { immediate: true }); }), e$1.watchEffect(() => { e2.listboxState.value === 0 && v2.value && e2.activationTrigger.value !== 0 && e$1.nextTick(() => { var t2, i2; return (i2 = (t2 = o$3(f2)) == null ? void 0 : t2.scrollIntoView) == null ? void 0 : i2.call(t2, { block: "nearest" }); }); }); function u2(t2) { if (o2.disabled) return t2.preventDefault(); e2.select(o2.value), e2.mode.value === 0 && (e2.closeListbox(), e$1.nextTick(() => { var i2; return (i2 = o$3(e2.buttonRef)) == null ? void 0 : i2.focus({ preventScroll: true }); })); } function D() { if (o2.disabled) return e2.goToOption(c.Nothing); e2.goToOption(c.Specific, n2); } let y2 = u$3(); function L(t2) { y2.update(t2); } function M(t2) { y2.wasMoved(t2) && (o2.disabled || v2.value || e2.goToOption(c.Specific, n2, 0)); } function k2(t2) { y2.wasMoved(t2) && (o2.disabled || v2.value && e2.goToOption(c.Nothing)); } return () => { let { disabled: t2 } = o2, i2 = { active: v2.value, selected: s3.value, disabled: t2 }, { value: l2, disabled: d2, ...O2 } = o2, h2 = { id: n2, ref: f2, role: "option", tabIndex: t2 === true ? void 0 : -1, "aria-disabled": t2 === true ? true : void 0, "aria-selected": s3.value, disabled: void 0, onClick: u2, onFocus: D, onPointerenter: L, onMouseenter: L, onPointermove: M, onMousemove: M, onPointerleave: k2, onMouseleave: k2 }; return A$1({ ourProps: h2, theirProps: O2, slot: i2, attrs: r2, slots: b2, name: "ListboxOption" }); }; } }); let a = Symbol("LabelContext"); function d() { let t2 = e$1.inject(a, null); if (t2 === null) { let n2 = new Error("You used a