UNPKG

bootstrap-vue-next

Version:

Seamless integration of Vue 3, Bootstrap 5, and TypeScript for modern, type-safe UI development

1 lines 152 kB
{"version":3,"file":"BAutocomplete-QBIaWPY1.mjs","names":["#t","useId","useId","useId"],"sources":["../../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/shared/ohash.D__AXeF1.mjs","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/shared/arrays.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useFilter.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useFormControl.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useTypeahead.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Collection/Collection.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Listbox/utils.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/RovingFocus/utils.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Listbox/ListboxRoot.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Listbox/ListboxContent.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Listbox/ListboxFilter.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Listbox/ListboxItem.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Listbox/ListboxItemIndicator.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxRoot.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxAnchor.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxContentImpl.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxContent.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxEmpty.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxGroup.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxInput.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxItem.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxItemIndicator.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxPortal.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxTrigger.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useNonce.js","../../../node_modules/.pnpm/reka-ui@2.9.2_vue@3.5.31_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxViewport.js","../src/components/BAutocomplete/BAutocomplete.vue","../src/components/BAutocomplete/BAutocomplete.vue"],"sourcesContent":["function serialize(o){return typeof o==\"string\"?`'${o}'`:new c().serialize(o)}const c=/*@__PURE__*/function(){class o{#t=new Map;compare(t,r){const e=typeof t,n=typeof r;return e===\"string\"&&n===\"string\"?t.localeCompare(r):e===\"number\"&&n===\"number\"?t-r:String.prototype.localeCompare.call(this.serialize(t,true),this.serialize(r,true))}serialize(t,r){if(t===null)return \"null\";switch(typeof t){case \"string\":return r?t:`'${t}'`;case \"bigint\":return `${t}n`;case \"object\":return this.$object(t);case \"function\":return this.$function(t)}return String(t)}serializeObject(t){const r=Object.prototype.toString.call(t);if(r!==\"[object Object]\")return this.serializeBuiltInType(r.length<10?`unknown:${r}`:r.slice(8,-1),t);const e=t.constructor,n=e===Object||e===void 0?\"\":e.name;if(n!==\"\"&&globalThis[n]===e)return this.serializeBuiltInType(n,t);if(typeof t.toJSON==\"function\"){const i=t.toJSON();return n+(i!==null&&typeof i==\"object\"?this.$object(i):`(${this.serialize(i)})`)}return this.serializeObjectEntries(n,Object.entries(t))}serializeBuiltInType(t,r){const e=this[\"$\"+t];if(e)return e.call(this,r);if(typeof r?.entries==\"function\")return this.serializeObjectEntries(t,r.entries());throw new Error(`Cannot serialize ${t}`)}serializeObjectEntries(t,r){const e=Array.from(r).sort((i,a)=>this.compare(i[0],a[0]));let n=`${t}{`;for(let i=0;i<e.length;i++){const[a,l]=e[i];n+=`${this.serialize(a,true)}:${this.serialize(l)}`,i<e.length-1&&(n+=\",\");}return n+\"}\"}$object(t){let r=this.#t.get(t);return r===void 0&&(this.#t.set(t,`#${this.#t.size}`),r=this.serializeObject(t),this.#t.set(t,r)),r}$function(t){const r=Function.prototype.toString.call(t);return r.slice(-15)===\"[native code] }\"?`${t.name||\"\"}()[native]`:`${t.name}(${t.length})${r.replace(/\\s*\\n\\s*/g,\"\")}`}$Array(t){let r=\"[\";for(let e=0;e<t.length;e++)r+=this.serialize(t[e]),e<t.length-1&&(r+=\",\");return r+\"]\"}$Date(t){try{return `Date(${t.toISOString()})`}catch{return \"Date(null)\"}}$ArrayBuffer(t){return `ArrayBuffer[${new Uint8Array(t).join(\",\")}]`}$Set(t){return `Set${this.$Array(Array.from(t).sort((r,e)=>this.compare(r,e)))}`}$Map(t){return this.serializeObjectEntries(\"Map\",t.entries())}}for(const s of [\"Error\",\"RegExp\",\"URL\"])o.prototype[\"$\"+s]=function(t){return `${s}(${t})`};for(const s of [\"Int8Array\",\"Uint8Array\",\"Uint8ClampedArray\",\"Int16Array\",\"Uint16Array\",\"Int32Array\",\"Uint32Array\",\"Float32Array\",\"Float64Array\"])o.prototype[\"$\"+s]=function(t){return `${s}[${t.join(\",\")}]`};for(const s of [\"BigInt64Array\",\"BigUint64Array\"])o.prototype[\"$\"+s]=function(t){return `${s}[${t.join(\"n,\")}${t.length>0?\"n\":\"\"}]`};return o}();\n\nfunction isEqual(object1, object2) {\n if (object1 === object2) {\n return true;\n }\n if (serialize(object1) === serialize(object2)) {\n return true;\n }\n return false;\n}\n\nexport { isEqual as i, serialize as s };\n","import { isEqual } from \"ohash\";\n\n//#region src/shared/arrays.ts\n/**\n* The function `areEqual` compares two arrays and returns true if they are equal in length and have\n* the same elements at corresponding indexes.\n* @param {any[]} arrayA - An array of any type of elements.\n* @param {any[]} arrayB - It looks like you haven't provided the value for `arrayB`. Could you please\n* provide the arrayB value so that I can assist you further?\n* @returns The function `areEqual` is returning a boolean value, either `true` if the two input arrays\n* `arrayA` and `arrayB` are equal, or `false` if they are not equal.\n*/\nfunction areEqual(arrayA, arrayB) {\n\tif (arrayA.length !== arrayB.length) return false;\n\tfor (let index = 0; index < arrayA.length; index++) if (arrayA[index] !== arrayB[index]) return false;\n\treturn true;\n}\n/**\n* The function `findValuesBetween` takes an array and two values, then returns a subarray containing\n* elements between the first occurrence of the start value and the first occurrence of the end value\n* in the array.\n* @param {T[]} array - The `array` parameter is an array of values of type `T`.\n* @param {T} start - The `start` parameter is the value that marks the beginning of the range you want\n* to find in the array.\n* @param {T} end - The `end` parameter in the `findValuesBetween` function represents the end value\n* that you want to find in the array. This function will return a subarray of values that are between\n* the `start` and `end` values in the original array.\n* @returns The `findValuesBetween` function returns an array of values from the input array that are\n* between the `start` and `end` values (inclusive). If either the `start` or `end` values are not\n* found in the input array, an empty array is returned.\n*/\nfunction findValuesBetween(array, start, end) {\n\tconst startIndex = array.findIndex((i) => isEqual(i, start));\n\tconst endIndex = array.findIndex((i) => isEqual(i, end));\n\tif (startIndex === -1 || endIndex === -1) return [];\n\tconst [minIndex, maxIndex] = [startIndex, endIndex].sort((a, b) => a - b);\n\treturn array.slice(minIndex, maxIndex + 1);\n}\n\n//#endregion\nexport { areEqual, findValuesBetween };\n//# sourceMappingURL=arrays.js.map","import { computed, unref } from \"vue\";\n\n//#region src/shared/useFilter.ts\n/**\n* Provides locale-aware string filtering functions.\n* Uses `Intl.Collator` for comparison to ensure proper Unicode handling.\n*\n* @param options - Optional collator options to customize comparison behavior.\n* See [Intl.CollatorOptions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) for details.\n* @returns An object with methods to check if a string starts with, ends with, or contains a substring.\n*\n* @example\n* const { startsWith, endsWith, contains } = useFilter();\n*\n* startsWith('hello', 'he'); // true\n* endsWith('hello', 'lo'); // true\n* contains('hello', 'ell'); // true\n*/\nfunction useFilter(options) {\n\tconst computedOptions = computed(() => unref(options));\n\tconst collator = computed(() => new Intl.Collator(\"en\", {\n\t\tusage: \"search\",\n\t\t...computedOptions.value\n\t}));\n\tconst startsWith = (string, substring) => {\n\t\tif (substring.length === 0) return true;\n\t\tstring = string.normalize(\"NFC\");\n\t\tsubstring = substring.normalize(\"NFC\");\n\t\treturn collator.value.compare(string.slice(0, substring.length), substring) === 0;\n\t};\n\tconst endsWith = (string, substring) => {\n\t\tif (substring.length === 0) return true;\n\t\tstring = string.normalize(\"NFC\");\n\t\tsubstring = substring.normalize(\"NFC\");\n\t\treturn collator.value.compare(string.slice(-substring.length), substring) === 0;\n\t};\n\tconst contains = (string, substring) => {\n\t\tif (substring.length === 0) return true;\n\t\tstring = string.normalize(\"NFC\");\n\t\tsubstring = substring.normalize(\"NFC\");\n\t\tlet scan = 0;\n\t\tconst sliceLen = substring.length;\n\t\tfor (; scan + sliceLen <= string.length; scan++) {\n\t\t\tconst slice = string.slice(scan, scan + sliceLen);\n\t\t\tif (collator.value.compare(substring, slice) === 0) return true;\n\t\t}\n\t\treturn false;\n\t};\n\treturn {\n\t\tstartsWith,\n\t\tendsWith,\n\t\tcontains\n\t};\n}\n\n//#endregion\nexport { useFilter };\n//# sourceMappingURL=useFilter.js.map","import { computed, toValue } from \"vue\";\nimport { unrefElement } from \"@vueuse/core\";\n\n//#region src/shared/useFormControl.ts\nfunction useFormControl(el) {\n\treturn computed(() => toValue(el) ? Boolean(unrefElement(el)?.closest(\"form\")) : true);\n}\n\n//#endregion\nexport { useFormControl };\n//# sourceMappingURL=useFormControl.js.map","import { getActiveElement } from \"./getActiveElement.js\";\nimport { refAutoReset } from \"@vueuse/shared\";\n\n//#region src/shared/useTypeahead.ts\nfunction useTypeahead(callback) {\n\tconst search = refAutoReset(\"\", 1e3);\n\tconst handleTypeaheadSearch = (key, items) => {\n\t\tsearch.value = search.value + key;\n\t\tif (callback) callback(key);\n\t\telse {\n\t\t\tconst currentItem = getActiveElement();\n\t\t\tconst itemsWithTextValue = items.map((item) => ({\n\t\t\t\t...item,\n\t\t\t\ttextValue: item.value?.textValue ?? item.ref.textContent?.trim() ?? \"\"\n\t\t\t}));\n\t\t\tconst currentMatch = itemsWithTextValue.find((item) => item.ref === currentItem);\n\t\t\tconst values = itemsWithTextValue.map((item) => item.textValue);\n\t\t\tconst nextMatch = getNextMatch(values, search.value, currentMatch?.textValue);\n\t\t\tconst newItem = itemsWithTextValue.find((item) => item.textValue === nextMatch);\n\t\t\tif (newItem) newItem.ref.focus();\n\t\t\treturn newItem?.ref;\n\t\t}\n\t};\n\tconst resetTypeahead = () => {\n\t\tsearch.value = \"\";\n\t};\n\treturn {\n\t\tsearch,\n\t\thandleTypeaheadSearch,\n\t\tresetTypeahead\n\t};\n}\n/**\n* Wraps an array around itself at a given start index\n* Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`\n*/\nfunction wrapArray(array, startIndex) {\n\treturn array.map((_, index) => array[(startIndex + index) % array.length]);\n}\n/**\n* This is the \"meat\" of the typeahead matching logic. It takes in all the values,\n* the search and the current match, and returns the next match (or `undefined`).\n*\n* We normalize the search because if a user has repeatedly pressed a character,\n* we want the exact same behavior as if we only had that one character\n* (ie. cycle through options starting with that character)\n*\n* We also reorder the values by wrapping the array around the current match.\n* This is so we always look forward from the current match, and picking the first\n* match will always be the correct one.\n*\n* Finally, if the normalized search is exactly one character, we exclude the\n* current match from the values because otherwise it would be the first to match always\n* and focus would never move. This is as opposed to the regular case, where we\n* don't want focus to move if the current match still matches.\n*/\nfunction getNextMatch(values, search, currentMatch) {\n\tconst isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);\n\tconst normalizedSearch = isRepeated ? search[0] : search;\n\tconst currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;\n\tlet wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0));\n\tconst excludeCurrentMatch = normalizedSearch.length === 1;\n\tif (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v) => v !== currentMatch);\n\tconst nextMatch = wrappedValues.find((value) => value.toLowerCase().startsWith(normalizedSearch.toLowerCase()));\n\treturn nextMatch !== currentMatch ? nextMatch : void 0;\n}\n\n//#endregion\nexport { getNextMatch, useTypeahead, wrapArray };\n//# sourceMappingURL=useTypeahead.js.map","import { Slot } from \"../Primitive/Slot.js\";\nimport { usePrimitiveElement } from \"../Primitive/usePrimitiveElement.js\";\nimport { computed, defineComponent, h, inject, markRaw, provide, ref, watch, watchEffect } from \"vue\";\n\n//#region src/Collection/Collection.ts\nconst ITEM_DATA_ATTR = \"data-reka-collection-item\";\nfunction useCollection(options = {}) {\n\tconst { key = \"\", isProvider = false } = options;\n\tconst injectionKey = `${key}CollectionProvider`;\n\tlet context;\n\tif (isProvider) {\n\t\tconst itemMap = ref(/* @__PURE__ */ new Map());\n\t\tconst collectionRef = ref();\n\t\tcontext = {\n\t\t\tcollectionRef,\n\t\t\titemMap\n\t\t};\n\t\tprovide(injectionKey, context);\n\t} else context = inject(injectionKey);\n\tconst getItems = (includeDisabledItem = false) => {\n\t\tconst collectionNode = context.collectionRef.value;\n\t\tif (!collectionNode) return [];\n\t\tconst orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));\n\t\tconst items = Array.from(context.itemMap.value.values());\n\t\tconst orderedItems = items.sort((a, b) => orderedNodes.indexOf(a.ref) - orderedNodes.indexOf(b.ref));\n\t\tif (includeDisabledItem) return orderedItems;\n\t\telse return orderedItems.filter((i) => i.ref.dataset.disabled !== \"\");\n\t};\n\tconst CollectionSlot = defineComponent({\n\t\tname: \"CollectionSlot\",\n\t\tinheritAttrs: false,\n\t\tsetup(_, { slots, attrs }) {\n\t\t\tconst { primitiveElement, currentElement } = usePrimitiveElement();\n\t\t\twatch(currentElement, () => {\n\t\t\t\tcontext.collectionRef.value = currentElement.value;\n\t\t\t});\n\t\t\treturn () => h(Slot, {\n\t\t\t\tref: primitiveElement,\n\t\t\t\t...attrs\n\t\t\t}, slots);\n\t\t}\n\t});\n\tconst CollectionItem = defineComponent({\n\t\tname: \"CollectionItem\",\n\t\tinheritAttrs: false,\n\t\tprops: { value: { validator: () => true } },\n\t\tsetup(props, { slots, attrs }) {\n\t\t\tconst { primitiveElement, currentElement } = usePrimitiveElement();\n\t\t\twatchEffect((cleanupFn) => {\n\t\t\t\tif (currentElement.value) {\n\t\t\t\t\tconst key$1 = markRaw(currentElement.value);\n\t\t\t\t\tcontext.itemMap.value.set(key$1, {\n\t\t\t\t\t\tref: currentElement.value,\n\t\t\t\t\t\tvalue: props.value\n\t\t\t\t\t});\n\t\t\t\t\tcleanupFn(() => context.itemMap.value.delete(key$1));\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn () => h(Slot, {\n\t\t\t\t...attrs,\n\t\t\t\t[ITEM_DATA_ATTR]: \"\",\n\t\t\t\tref: primitiveElement\n\t\t\t}, slots);\n\t\t}\n\t});\n\tconst reactiveItems = computed(() => Array.from(context.itemMap.value.values()));\n\tconst itemMapSize = computed(() => context.itemMap.value.size);\n\treturn {\n\t\tgetItems,\n\t\treactiveItems,\n\t\titemMapSize,\n\t\tCollectionSlot,\n\t\tCollectionItem\n\t};\n}\n\n//#endregion\nexport { useCollection };\n//# sourceMappingURL=Collection.js.map","import { isEqual } from \"ohash\";\n\n//#region src/Listbox/utils.ts\nfunction queryCheckedElement(parentEl) {\n\treturn parentEl?.querySelector(\"[data-state=checked]\");\n}\nfunction valueComparator(value, currentValue, comparator) {\n\tif (value === void 0) return false;\n\telse if (Array.isArray(value)) return value.some((val) => compare(val, currentValue, comparator));\n\telse return compare(value, currentValue, comparator);\n}\nfunction compare(value, currentValue, comparator) {\n\tif (value === void 0 || currentValue === void 0) return false;\n\tif (typeof value === \"string\") return value === currentValue;\n\tif (typeof comparator === \"function\") return comparator(value, currentValue);\n\tif (typeof comparator === \"string\") return value?.[comparator] === currentValue?.[comparator];\n\treturn isEqual(value, currentValue);\n}\n\n//#endregion\nexport { compare, queryCheckedElement, valueComparator };\n//# sourceMappingURL=utils.js.map","import { getActiveElement } from \"../shared/getActiveElement.js\";\n\n//#region src/RovingFocus/utils.ts\nconst ENTRY_FOCUS = \"rovingFocusGroup.onEntryFocus\";\nconst EVENT_OPTIONS = {\n\tbubbles: false,\n\tcancelable: true\n};\nconst MAP_KEY_TO_FOCUS_INTENT = {\n\tArrowLeft: \"prev\",\n\tArrowUp: \"prev\",\n\tArrowRight: \"next\",\n\tArrowDown: \"next\",\n\tPageUp: \"first\",\n\tHome: \"first\",\n\tPageDown: \"last\",\n\tEnd: \"last\"\n};\nfunction getDirectionAwareKey(key, dir) {\n\tif (dir !== \"rtl\") return key;\n\treturn key === \"ArrowLeft\" ? \"ArrowRight\" : key === \"ArrowRight\" ? \"ArrowLeft\" : key;\n}\nfunction getFocusIntent(event, orientation, dir) {\n\tconst key = getDirectionAwareKey(event.key, dir);\n\tif (orientation === \"vertical\" && [\"ArrowLeft\", \"ArrowRight\"].includes(key)) return void 0;\n\tif (orientation === \"horizontal\" && [\"ArrowUp\", \"ArrowDown\"].includes(key)) return void 0;\n\treturn MAP_KEY_TO_FOCUS_INTENT[key];\n}\nfunction focusFirst(candidates, preventScroll = false) {\n\tconst PREVIOUSLY_FOCUSED_ELEMENT = getActiveElement();\n\tfor (const candidate of candidates) {\n\t\tif (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n\t\tcandidate.focus({ preventScroll });\n\t\tif (getActiveElement() !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n\t}\n}\n/**\n* Wraps an array around itself at a given start index\n* Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`\n*/\nfunction wrapArray(array, startIndex) {\n\treturn array.map((_, index) => array[(startIndex + index) % array.length]);\n}\n\n//#endregion\nexport { ENTRY_FOCUS, EVENT_OPTIONS, MAP_KEY_TO_FOCUS_INTENT, focusFirst, getFocusIntent, wrapArray };\n//# sourceMappingURL=utils.js.map","import { findValuesBetween } from \"../shared/arrays.js\";\nimport { createContext } from \"../shared/createContext.js\";\nimport { useDirection } from \"../shared/useDirection.js\";\nimport { useFormControl } from \"../shared/useFormControl.js\";\nimport { useKbd } from \"../shared/useKbd.js\";\nimport { useTypeahead } from \"../shared/useTypeahead.js\";\nimport { Primitive } from \"../Primitive/Primitive.js\";\nimport { usePrimitiveElement } from \"../Primitive/usePrimitiveElement.js\";\nimport { useCollection } from \"../Collection/Collection.js\";\nimport { VisuallyHiddenInput_default } from \"../VisuallyHidden/VisuallyHiddenInput.js\";\nimport { compare } from \"./utils.js\";\nimport { getFocusIntent } from \"../RovingFocus/utils.js\";\nimport { createBlock, createCommentVNode, defineComponent, nextTick, openBlock, ref, renderSlot, toRefs, unref, watch, withCtx } from \"vue\";\nimport { createEventHook, useVModel } from \"@vueuse/core\";\n\n//#region src/Listbox/ListboxRoot.vue?vue&type=script&setup=true&lang.ts\nconst [injectListboxRootContext, provideListboxRootContext] = createContext(\"ListboxRoot\");\nvar ListboxRoot_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({\n\t__name: \"ListboxRoot\",\n\tprops: {\n\t\tmodelValue: {\n\t\t\ttype: null,\n\t\t\trequired: false\n\t\t},\n\t\tdefaultValue: {\n\t\t\ttype: null,\n\t\t\trequired: false\n\t\t},\n\t\tmultiple: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\torientation: {\n\t\t\ttype: String,\n\t\t\trequired: false,\n\t\t\tdefault: \"vertical\"\n\t\t},\n\t\tdir: {\n\t\t\ttype: String,\n\t\t\trequired: false\n\t\t},\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tselectionBehavior: {\n\t\t\ttype: String,\n\t\t\trequired: false,\n\t\t\tdefault: \"toggle\"\n\t\t},\n\t\thighlightOnHover: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tby: {\n\t\t\ttype: [String, Function],\n\t\t\trequired: false\n\t\t},\n\t\tasChild: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tas: {\n\t\t\ttype: null,\n\t\t\trequired: false\n\t\t},\n\t\tname: {\n\t\t\ttype: String,\n\t\t\trequired: false\n\t\t},\n\t\trequired: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t}\n\t},\n\temits: [\n\t\t\"update:modelValue\",\n\t\t\"highlight\",\n\t\t\"entryFocus\",\n\t\t\"leave\"\n\t],\n\tsetup(__props, { expose: __expose, emit: __emit }) {\n\t\tconst props = __props;\n\t\tconst emits = __emit;\n\t\tconst { multiple, highlightOnHover, orientation, disabled, selectionBehavior, dir: propDir } = toRefs(props);\n\t\tconst { getItems } = useCollection({ isProvider: true });\n\t\tconst { handleTypeaheadSearch } = useTypeahead();\n\t\tconst { primitiveElement, currentElement } = usePrimitiveElement();\n\t\tconst kbd = useKbd();\n\t\tconst dir = useDirection(propDir);\n\t\tconst isFormControl = useFormControl(currentElement);\n\t\tconst firstValue = ref();\n\t\tconst isUserAction = ref(false);\n\t\tconst focusable = ref(true);\n\t\tconst modelValue = useVModel(props, \"modelValue\", emits, {\n\t\t\tdefaultValue: props.defaultValue ?? (multiple.value ? [] : void 0),\n\t\t\tpassive: props.modelValue === void 0,\n\t\t\tdeep: true\n\t\t});\n\t\tfunction onValueChange(val) {\n\t\t\tisUserAction.value = true;\n\t\t\tif (props.multiple) {\n\t\t\t\tconst modelArray = Array.isArray(modelValue.value) ? [...modelValue.value] : [];\n\t\t\t\tconst index = modelArray.findIndex((i) => compare(i, val, props.by));\n\t\t\t\tif (props.selectionBehavior === \"toggle\") {\n\t\t\t\t\tindex === -1 ? modelArray.push(val) : modelArray.splice(index, 1);\n\t\t\t\t\tmodelValue.value = modelArray;\n\t\t\t\t} else {\n\t\t\t\t\tmodelValue.value = [val];\n\t\t\t\t\tfirstValue.value = val;\n\t\t\t\t}\n\t\t\t} else if (props.selectionBehavior === \"toggle\") if (compare(modelValue.value, val, props.by)) modelValue.value = void 0;\n\t\t\telse modelValue.value = val;\n\t\t\telse modelValue.value = val;\n\t\t\tsetTimeout(() => {\n\t\t\t\tisUserAction.value = false;\n\t\t\t}, 1);\n\t\t}\n\t\tconst highlightedElement = ref(null);\n\t\tconst previousElement = ref(null);\n\t\tconst isVirtual = ref(false);\n\t\tconst isComposing = ref(false);\n\t\tconst virtualFocusHook = createEventHook();\n\t\tconst virtualKeydownHook = createEventHook();\n\t\tconst virtualHighlightHook = createEventHook();\n\t\tfunction getCollectionItem() {\n\t\t\treturn getItems().map((i) => i.ref).filter((i) => i.dataset.disabled !== \"\");\n\t\t}\n\t\tfunction changeHighlight(el, scrollIntoView = true) {\n\t\t\tif (!el) return;\n\t\t\thighlightedElement.value = el;\n\t\t\tif (focusable.value) highlightedElement.value.focus();\n\t\t\tif (scrollIntoView) highlightedElement.value.scrollIntoView({ block: \"nearest\" });\n\t\t\tconst highlightedItem = getItems().find((i) => i.ref === el);\n\t\t\temits(\"highlight\", highlightedItem);\n\t\t}\n\t\tfunction highlightItem(value) {\n\t\t\tif (isVirtual.value) virtualHighlightHook.trigger(value);\n\t\t\telse {\n\t\t\t\tconst item = getItems().find((i) => compare(i.value, value, props.by));\n\t\t\t\tif (item) {\n\t\t\t\t\thighlightedElement.value = item.ref;\n\t\t\t\t\tchangeHighlight(item.ref);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfunction onKeydownEnter(event) {\n\t\t\tif (highlightedElement.value && highlightedElement.value.isConnected) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tif (!isComposing.value) highlightedElement.value.click();\n\t\t\t}\n\t\t}\n\t\tfunction onKeydownTypeAhead(event) {\n\t\t\tif (!focusable.value) return;\n\t\t\tisUserAction.value = true;\n\t\t\tif (isVirtual.value) virtualKeydownHook.trigger(event);\n\t\t\telse {\n\t\t\t\tconst isMetaKey = event.altKey || event.ctrlKey || event.metaKey;\n\t\t\t\tif (isMetaKey && event.key === \"a\" && multiple.value) {\n\t\t\t\t\tconst collection = getItems();\n\t\t\t\t\tconst values = collection.map((i) => i.value);\n\t\t\t\t\tmodelValue.value = [...values];\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tchangeHighlight(collection[collection.length - 1].ref);\n\t\t\t\t} else if (!isMetaKey) {\n\t\t\t\t\tconst el = handleTypeaheadSearch(event.key, getItems());\n\t\t\t\t\tif (el) changeHighlight(el);\n\t\t\t\t}\n\t\t\t}\n\t\t\tsetTimeout(() => {\n\t\t\t\tisUserAction.value = false;\n\t\t\t}, 1);\n\t\t}\n\t\tfunction onCompositionStart() {\n\t\t\tisComposing.value = true;\n\t\t}\n\t\tfunction onCompositionEnd() {\n\t\t\tnextTick(() => {\n\t\t\t\tisComposing.value = false;\n\t\t\t});\n\t\t}\n\t\tfunction highlightFirstItem() {\n\t\t\tnextTick(() => {\n\t\t\t\tconst event = new KeyboardEvent(\"keydown\", { key: \"PageUp\" });\n\t\t\t\tonKeydownNavigation(event);\n\t\t\t});\n\t\t}\n\t\tfunction onLeave(event) {\n\t\t\tconst el = highlightedElement.value;\n\t\t\tif (el?.isConnected) previousElement.value = el;\n\t\t\thighlightedElement.value = null;\n\t\t\temits(\"leave\", event);\n\t\t}\n\t\tfunction onEnter(event) {\n\t\t\tconst entryFocusEvent = new CustomEvent(\"listbox.entryFocus\", {\n\t\t\t\tbubbles: false,\n\t\t\t\tcancelable: true\n\t\t\t});\n\t\t\tevent.currentTarget?.dispatchEvent(entryFocusEvent);\n\t\t\temits(\"entryFocus\", entryFocusEvent);\n\t\t\tif (entryFocusEvent.defaultPrevented) return;\n\t\t\tif (previousElement.value) changeHighlight(previousElement.value);\n\t\t\telse {\n\t\t\t\tconst el = getCollectionItem()?.[0];\n\t\t\t\tchangeHighlight(el);\n\t\t\t}\n\t\t}\n\t\tfunction onKeydownNavigation(event) {\n\t\t\tconst intent = getFocusIntent(event, orientation.value, dir.value);\n\t\t\tif (!intent) return;\n\t\t\tlet collection = getCollectionItem();\n\t\t\tif (highlightedElement.value) {\n\t\t\t\tif (intent === \"last\") collection.reverse();\n\t\t\t\telse if (intent === \"prev\" || intent === \"next\") {\n\t\t\t\t\tif (intent === \"prev\") collection.reverse();\n\t\t\t\t\tconst currentIndex = collection.indexOf(highlightedElement.value);\n\t\t\t\t\tcollection = collection.slice(currentIndex + 1);\n\t\t\t\t}\n\t\t\t\thandleMultipleReplace(event, collection[0]);\n\t\t\t}\n\t\t\tif (collection.length) {\n\t\t\t\tconst index = !highlightedElement.value && intent === \"prev\" ? collection.length - 1 : 0;\n\t\t\t\tchangeHighlight(collection[index]);\n\t\t\t}\n\t\t\tif (isVirtual.value) return virtualKeydownHook.trigger(event);\n\t\t}\n\t\tfunction handleMultipleReplace(event, targetEl) {\n\t\t\tif (isVirtual.value || props.selectionBehavior !== \"replace\" || !multiple.value || !Array.isArray(modelValue.value)) return;\n\t\t\tconst isMetaKey = event.altKey || event.ctrlKey || event.metaKey;\n\t\t\tif (isMetaKey && !event.shiftKey) return;\n\t\t\tif (event.shiftKey) {\n\t\t\t\tconst collection = getItems().filter((i) => i.ref.dataset.disabled !== \"\");\n\t\t\t\tlet lastValue = collection.find((i) => i.ref === targetEl)?.value;\n\t\t\t\tif (event.key === kbd.END) lastValue = collection[collection.length - 1].value;\n\t\t\t\telse if (event.key === kbd.HOME) lastValue = collection[0].value;\n\t\t\t\tif (!lastValue || !firstValue.value) return;\n\t\t\t\tconst values = findValuesBetween(collection.map((i) => i.value), firstValue.value, lastValue);\n\t\t\t\tmodelValue.value = values;\n\t\t\t}\n\t\t}\n\t\tasync function highlightSelected(event) {\n\t\t\tawait nextTick();\n\t\t\tif (isVirtual.value) virtualFocusHook.trigger(event);\n\t\t\telse {\n\t\t\t\tconst collection = getCollectionItem();\n\t\t\t\tconst item = collection.find((i) => i.dataset.state === \"checked\");\n\t\t\t\tif (item) changeHighlight(item);\n\t\t\t\telse if (collection.length) changeHighlight(collection[0]);\n\t\t\t}\n\t\t}\n\t\twatch(modelValue, () => {\n\t\t\tif (!isUserAction.value) nextTick(() => {\n\t\t\t\thighlightSelected();\n\t\t\t});\n\t\t}, {\n\t\t\timmediate: true,\n\t\t\tdeep: true\n\t\t});\n\t\t__expose({\n\t\t\thighlightedElement,\n\t\t\thighlightItem,\n\t\t\thighlightFirstItem,\n\t\t\thighlightSelected,\n\t\t\tgetItems\n\t\t});\n\t\tprovideListboxRootContext({\n\t\t\tmodelValue,\n\t\t\tonValueChange,\n\t\t\tmultiple,\n\t\t\torientation,\n\t\t\tdir,\n\t\t\tdisabled,\n\t\t\thighlightOnHover,\n\t\t\thighlightedElement,\n\t\t\tisVirtual,\n\t\t\tvirtualFocusHook,\n\t\t\tvirtualKeydownHook,\n\t\t\tvirtualHighlightHook,\n\t\t\tby: props.by,\n\t\t\tfirstValue,\n\t\t\tselectionBehavior,\n\t\t\tfocusable,\n\t\t\tonLeave,\n\t\t\tonEnter,\n\t\t\tchangeHighlight,\n\t\t\tonKeydownEnter,\n\t\t\tonKeydownNavigation,\n\t\t\tonKeydownTypeAhead,\n\t\t\tonCompositionStart,\n\t\t\tonCompositionEnd,\n\t\t\thighlightFirstItem\n\t\t});\n\t\treturn (_ctx, _cache) => {\n\t\t\treturn openBlock(), createBlock(unref(Primitive), {\n\t\t\t\tref_key: \"primitiveElement\",\n\t\t\t\tref: primitiveElement,\n\t\t\t\tas: _ctx.as,\n\t\t\t\t\"as-child\": _ctx.asChild,\n\t\t\t\tdir: unref(dir),\n\t\t\t\t\"data-disabled\": unref(disabled) ? \"\" : void 0,\n\t\t\t\tonPointerleave: onLeave,\n\t\t\t\tonFocusout: _cache[0] || (_cache[0] = async (event) => {\n\t\t\t\t\tconst target = event.relatedTarget || event.target;\n\t\t\t\t\tawait nextTick();\n\t\t\t\t\tif (highlightedElement.value && unref(currentElement) && !unref(currentElement).contains(target)) onLeave(event);\n\t\t\t\t})\n\t\t\t}, {\n\t\t\t\tdefault: withCtx(() => [renderSlot(_ctx.$slots, \"default\", { modelValue: unref(modelValue) }), unref(isFormControl) && _ctx.name ? (openBlock(), createBlock(unref(VisuallyHiddenInput_default), {\n\t\t\t\t\tkey: 0,\n\t\t\t\t\tname: _ctx.name,\n\t\t\t\t\tvalue: unref(modelValue),\n\t\t\t\t\tdisabled: unref(disabled),\n\t\t\t\t\trequired: _ctx.required\n\t\t\t\t}, null, 8, [\n\t\t\t\t\t\"name\",\n\t\t\t\t\t\"value\",\n\t\t\t\t\t\"disabled\",\n\t\t\t\t\t\"required\"\n\t\t\t\t])) : createCommentVNode(\"v-if\", true)]),\n\t\t\t\t_: 3\n\t\t\t}, 8, [\n\t\t\t\t\"as\",\n\t\t\t\t\"as-child\",\n\t\t\t\t\"dir\",\n\t\t\t\t\"data-disabled\"\n\t\t\t]);\n\t\t};\n\t}\n});\n\n//#endregion\n//#region src/Listbox/ListboxRoot.vue\nvar ListboxRoot_default = ListboxRoot_vue_vue_type_script_setup_true_lang_default;\n\n//#endregion\nexport { ListboxRoot_default, injectListboxRootContext };\n//# sourceMappingURL=ListboxRoot.js.map","import { Primitive } from \"../Primitive/Primitive.js\";\nimport { useCollection } from \"../Collection/Collection.js\";\nimport { injectListboxRootContext } from \"./ListboxRoot.js\";\nimport { createBlock, createVNode, defineComponent, openBlock, renderSlot, unref, withCtx, withKeys, withModifiers } from \"vue\";\nimport { refAutoReset } from \"@vueuse/shared\";\n\n//#region src/Listbox/ListboxContent.vue?vue&type=script&setup=true&lang.ts\nvar ListboxContent_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({\n\t__name: \"ListboxContent\",\n\tprops: {\n\t\tasChild: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tas: {\n\t\t\ttype: null,\n\t\t\trequired: false\n\t\t}\n\t},\n\tsetup(__props) {\n\t\tconst { CollectionSlot } = useCollection();\n\t\tconst rootContext = injectListboxRootContext();\n\t\tconst isClickFocus = refAutoReset(false, 10);\n\t\treturn (_ctx, _cache) => {\n\t\t\treturn openBlock(), createBlock(unref(CollectionSlot), null, {\n\t\t\t\tdefault: withCtx(() => [createVNode(unref(Primitive), {\n\t\t\t\t\trole: \"listbox\",\n\t\t\t\t\tas: _ctx.as,\n\t\t\t\t\t\"as-child\": _ctx.asChild,\n\t\t\t\t\ttabindex: unref(rootContext).focusable.value ? unref(rootContext).highlightedElement.value ? \"-1\" : \"0\" : \"-1\",\n\t\t\t\t\t\"aria-orientation\": unref(rootContext).orientation.value,\n\t\t\t\t\t\"aria-multiselectable\": !!unref(rootContext).multiple.value,\n\t\t\t\t\t\"data-orientation\": unref(rootContext).orientation.value,\n\t\t\t\t\tonMousedown: _cache[0] || (_cache[0] = withModifiers(($event) => isClickFocus.value = true, [\"left\"])),\n\t\t\t\t\tonFocus: _cache[1] || (_cache[1] = (ev) => {\n\t\t\t\t\t\tif (unref(isClickFocus)) return;\n\t\t\t\t\t\tunref(rootContext).onEnter(ev);\n\t\t\t\t\t}),\n\t\t\t\t\tonKeydown: [\n\t\t\t\t\t\t_cache[2] || (_cache[2] = withKeys((event) => {\n\t\t\t\t\t\t\tif (unref(rootContext).orientation.value === \"vertical\" && (event.key === \"ArrowLeft\" || event.key === \"ArrowRight\") || unref(rootContext).orientation.value === \"horizontal\" && (event.key === \"ArrowUp\" || event.key === \"ArrowDown\")) return;\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tunref(rootContext).focusable.value && unref(rootContext).onKeydownNavigation(event);\n\t\t\t\t\t\t}, [\n\t\t\t\t\t\t\t\"down\",\n\t\t\t\t\t\t\t\"up\",\n\t\t\t\t\t\t\t\"left\",\n\t\t\t\t\t\t\t\"right\",\n\t\t\t\t\t\t\t\"home\",\n\t\t\t\t\t\t\t\"end\"\n\t\t\t\t\t\t])),\n\t\t\t\t\t\twithKeys(unref(rootContext).onKeydownEnter, [\"enter\"]),\n\t\t\t\t\t\tunref(rootContext).onKeydownTypeAhead\n\t\t\t\t\t]\n\t\t\t\t}, {\n\t\t\t\t\tdefault: withCtx(() => [renderSlot(_ctx.$slots, \"default\")]),\n\t\t\t\t\t_: 3\n\t\t\t\t}, 8, [\n\t\t\t\t\t\"as\",\n\t\t\t\t\t\"as-child\",\n\t\t\t\t\t\"tabindex\",\n\t\t\t\t\t\"aria-orientation\",\n\t\t\t\t\t\"aria-multiselectable\",\n\t\t\t\t\t\"data-orientation\",\n\t\t\t\t\t\"onKeydown\"\n\t\t\t\t])]),\n\t\t\t\t_: 3\n\t\t\t});\n\t\t};\n\t}\n});\n\n//#endregion\n//#region src/Listbox/ListboxContent.vue\nvar ListboxContent_default = ListboxContent_vue_vue_type_script_setup_true_lang_default;\n\n//#endregion\nexport { ListboxContent_default };\n//# sourceMappingURL=ListboxContent.js.map","import { Primitive } from \"../Primitive/Primitive.js\";\nimport { usePrimitiveElement } from \"../Primitive/usePrimitiveElement.js\";\nimport { injectListboxRootContext } from \"./ListboxRoot.js\";\nimport { computed, createBlock, defineComponent, onMounted, onUnmounted, openBlock, ref, renderSlot, unref, watchSyncEffect, withCtx, withKeys, withModifiers } from \"vue\";\nimport { useVModel } from \"@vueuse/core\";\n\n//#region src/Listbox/ListboxFilter.vue?vue&type=script&setup=true&lang.ts\nvar ListboxFilter_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({\n\t__name: \"ListboxFilter\",\n\tprops: {\n\t\tmodelValue: {\n\t\t\ttype: String,\n\t\t\trequired: false\n\t\t},\n\t\tautoFocus: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tasChild: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tas: {\n\t\t\ttype: null,\n\t\t\trequired: false,\n\t\t\tdefault: \"input\"\n\t\t}\n\t},\n\temits: [\"update:modelValue\"],\n\tsetup(__props, { emit: __emit }) {\n\t\tconst props = __props;\n\t\tconst emits = __emit;\n\t\tconst modelValue = useVModel(props, \"modelValue\", emits, {\n\t\t\tdefaultValue: \"\",\n\t\t\tpassive: props.modelValue === void 0\n\t\t});\n\t\tconst rootContext = injectListboxRootContext();\n\t\tconst { primitiveElement, currentElement } = usePrimitiveElement();\n\t\tconst disabled = computed(() => props.disabled || rootContext.disabled.value || false);\n\t\tconst activedescendant = ref();\n\t\twatchSyncEffect(() => activedescendant.value = rootContext.highlightedElement.value?.id);\n\t\tonMounted(() => {\n\t\t\trootContext.focusable.value = false;\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (props.autoFocus) currentElement.value?.focus();\n\t\t\t}, 1);\n\t\t});\n\t\tonUnmounted(() => {\n\t\t\trootContext.focusable.value = true;\n\t\t});\n\t\treturn (_ctx, _cache) => {\n\t\t\treturn openBlock(), createBlock(unref(Primitive), {\n\t\t\t\tref_key: \"primitiveElement\",\n\t\t\t\tref: primitiveElement,\n\t\t\t\tas: _ctx.as,\n\t\t\t\t\"as-child\": _ctx.asChild,\n\t\t\t\tvalue: unref(modelValue),\n\t\t\t\tdisabled: disabled.value ? \"\" : void 0,\n\t\t\t\t\"data-disabled\": disabled.value ? \"\" : void 0,\n\t\t\t\t\"aria-disabled\": disabled.value ?? void 0,\n\t\t\t\t\"aria-activedescendant\": activedescendant.value,\n\t\t\t\ttype: \"text\",\n\t\t\t\tonKeydown: [withKeys(withModifiers(unref(rootContext).onKeydownNavigation, [\"prevent\"]), [\n\t\t\t\t\t\"down\",\n\t\t\t\t\t\"up\",\n\t\t\t\t\t\"home\",\n\t\t\t\t\t\"end\"\n\t\t\t\t]), withKeys(unref(rootContext).onKeydownEnter, [\"enter\"])],\n\t\t\t\tonInput: _cache[0] || (_cache[0] = (event) => {\n\t\t\t\t\tmodelValue.value = event.target.value;\n\t\t\t\t\tunref(rootContext).highlightFirstItem();\n\t\t\t\t}),\n\t\t\t\tonCompositionstart: unref(rootContext).onCompositionStart,\n\t\t\t\tonCompositionend: unref(rootContext).onCompositionEnd\n\t\t\t}, {\n\t\t\t\tdefault: withCtx(() => [renderSlot(_ctx.$slots, \"default\", { modelValue: unref(modelValue) })]),\n\t\t\t\t_: 3\n\t\t\t}, 8, [\n\t\t\t\t\"as\",\n\t\t\t\t\"as-child\",\n\t\t\t\t\"value\",\n\t\t\t\t\"disabled\",\n\t\t\t\t\"data-disabled\",\n\t\t\t\t\"aria-disabled\",\n\t\t\t\t\"aria-activedescendant\",\n\t\t\t\t\"onKeydown\",\n\t\t\t\t\"onCompositionstart\",\n\t\t\t\t\"onCompositionend\"\n\t\t\t]);\n\t\t};\n\t}\n});\n\n//#endregion\n//#region src/Listbox/ListboxFilter.vue\nvar ListboxFilter_default = ListboxFilter_vue_vue_type_script_setup_true_lang_default;\n\n//#endregion\nexport { ListboxFilter_default };\n//# sourceMappingURL=ListboxFilter.js.map","import { createContext } from \"../shared/createContext.js\";\nimport { handleAndDispatchCustomEvent } from \"../shared/handleAndDispatchCustomEvent.js\";\nimport { useForwardExpose } from \"../shared/useForwardExpose.js\";\nimport { useId } from \"../shared/useId.js\";\nimport { Primitive } from \"../Primitive/Primitive.js\";\nimport { useCollection } from \"../Collection/Collection.js\";\nimport { valueComparator } from \"./utils.js\";\nimport { injectListboxRootContext } from \"./ListboxRoot.js\";\nimport { computed, createBlock, createVNode, defineComponent, mergeProps, openBlock, renderSlot, unref, withCtx, withKeys, withMemo, withModifiers } from \"vue\";\n\n//#region src/Listbox/ListboxItem.vue?vue&type=script&setup=true&lang.ts\nconst LISTBOX_SELECT = \"listbox.select\";\nconst [injectListboxItemContext, provideListboxItemContext] = createContext(\"ListboxItem\");\nvar ListboxItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({\n\t__name: \"ListboxItem\",\n\tprops: {\n\t\tvalue: {\n\t\t\ttype: null,\n\t\t\trequired: true\n\t\t},\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tasChild: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tas: {\n\t\t\ttype: null,\n\t\t\trequired: false,\n\t\t\tdefault: \"div\"\n\t\t}\n\t},\n\temits: [\"select\"],\n\tsetup(__props, { emit: __emit }) {\n\t\tconst props = __props;\n\t\tconst emits = __emit;\n\t\tconst id = useId(void 0, \"reka-listbox-item\");\n\t\tconst { CollectionItem } = useCollection();\n\t\tconst { forwardRef, currentElement } = useForwardExpose();\n\t\tconst rootContext = injectListboxRootContext();\n\t\tconst isHighlighted = computed(() => currentElement.value === rootContext.highlightedElement.value);\n\t\tconst isSelected = computed(() => valueComparator(rootContext.modelValue.value, props.value, rootContext.by));\n\t\tconst disabled = computed(() => rootContext.disabled.value || props.disabled);\n\t\tasync function handleSelect(ev) {\n\t\t\temits(\"select\", ev);\n\t\t\tif (ev?.defaultPrevented) return;\n\t\t\tif (!disabled.value && ev) {\n\t\t\t\trootContext.onValueChange(props.value);\n\t\t\t\trootContext.changeHighlight(currentElement.value);\n\t\t\t}\n\t\t}\n\t\tfunction handleSelectCustomEvent(ev) {\n\t\t\tconst eventDetail = {\n\t\t\t\toriginalEvent: ev,\n\t\t\t\tvalue: props.value\n\t\t\t};\n\t\t\thandleAndDispatchCustomEvent(LISTBOX_SELECT, handleSelect, eventDetail);\n\t\t}\n\t\tprovideListboxItemContext({ isSelected });\n\t\treturn (_ctx, _cache) => {\n\t\t\treturn openBlock(), createBlock(unref(CollectionItem), { value: _ctx.value }, {\n\t\t\t\tdefault: withCtx(() => [withMemo([isHighlighted.value, isSelected.value], () => createVNode(unref(Primitive), mergeProps({ id: unref(id) }, _ctx.$attrs, {\n\t\t\t\t\tref: unref(forwardRef),\n\t\t\t\t\trole: \"option\",\n\t\t\t\t\ttabindex: unref(rootContext).focusable.value ? isHighlighted.value ? \"0\" : \"-1\" : -1,\n\t\t\t\t\t\"aria-selected\": isSelected.value,\n\t\t\t\t\tas: _ctx.as,\n\t\t\t\t\t\"as-child\": _ctx.asChild,\n\t\t\t\t\tdisabled: disabled.value ? \"\" : void 0,\n\t\t\t\t\t\"data-disabled\": disabled.value ? \"\" : void 0,\n\t\t\t\t\t\"data-highlighted\": isHighlighted.value ? \"\" : void 0,\n\t\t\t\t\t\"data-state\": isSelected.value ? \"checked\" : \"unchecked\",\n\t\t\t\t\tonClick: handleSelectCustomEvent,\n\t\t\t\t\tonKeydown: withKeys(withModifiers(handleSelectCustomEvent, [\"prevent\"]), [\"space\"]),\n\t\t\t\t\tonPointermove: _cache[0] || (_cache[0] = () => {\n\t\t\t\t\t\tif (unref(rootContext).highlightedElement.value === unref(currentElement)) return;\n\t\t\t\t\t\tif (unref(rootContext).highlightOnHover.value && !unref(rootContext).focusable.value) unref(rootContext).changeHighlight(unref(currentElement), false);\n\t\t\t\t\t})\n\t\t\t\t}), {\n\t\t\t\t\tdefault: withCtx(() => [renderSlot(_ctx.$slots, \"default\")]),\n\t\t\t\t\t_: 3\n\t\t\t\t}, 16, [\n\t\t\t\t\t\"id\",\n\t\t\t\t\t\"tabindex\",\n\t\t\t\t\t\"aria-selected\",\n\t\t\t\t\t\"as\",\n\t\t\t\t\t\"as-child\",\n\t\t\t\t\t\"disabled\",\n\t\t\t\t\t\"data-disabled\",\n\t\t\t\t\t\"data-highlighted\",\n\t\t\t\t\t\"data-state\",\n\t\t\t\t\t\"onKeydown\"\n\t\t\t\t]), _cache, 1)]),\n\t\t\t\t_: 3\n\t\t\t}, 8, [\"value\"]);\n\t\t};\n\t}\n});\n\n//#endregion\n//#region src/Listbox/ListboxItem.vue\nvar ListboxItem_default = ListboxItem_vue_vue_type_script_setup_true_lang_default;\n\n//#endregion\nexport { ListboxItem_default, injectListboxItemContext };\n//# sourceMappingURL=ListboxItem.js.map","import { useForwardExpose } from \"../shared/useForwardExpose.js\";\nimport { Primitive } from \"../Primitive/Primitive.js\";\nimport { injectListboxItemContext } from \"./ListboxItem.js\";\nimport { createBlock, createCommentVNode, defineComponent, mergeProps, openBlock, renderSlot, unref, withCtx } from \"vue\";\n\n//#region src/Listbox/ListboxItemIndicator.vue?vue&type=script&setup=true&lang.ts\nvar ListboxItemIndicator_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({\n\t__name: \"ListboxItemIndicator\",\n\tprops: {\n\t\tasChild: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tas: {\n\t\t\ttype: null,\n\t\t\trequired: false,\n\t\t\tdefault: \"span\"\n\t\t}\n\t},\n\tsetup(__props) {\n\t\tconst props = __props;\n\t\tuseForwardExpose();\n\t\tconst itemContext = injectListboxItemContext();\n\t\treturn (_ctx, _cache) => {\n\t\t\treturn unref(itemContext).isSelected.value ? (openBlock(), createBlock(unref(Primitive), mergeProps({\n\t\t\t\tkey: 0,\n\t\t\t\t\"aria-hidden\": \"true\"\n\t\t\t}, props), {\n\t\t\t\tdefault: withCtx(() => [renderSlot(_ctx.$slots, \"default\")]),\n\t\t\t\t_: 3\n\t\t\t}, 16)) : createCommentVNode(\"v-if\", true);\n\t\t};\n\t}\n});\n\n//#endregion\n//#region src/Listbox/ListboxItemIndicator.vue\nvar ListboxItemIndicator_default = ListboxItemIndicator_vue_vue_type_script_setup_true_lang_default;\n\n//#endregion\nexport { ListboxItemIndicator_default };\n//# sourceMappingURL=ListboxItemIndicator.js.map","import { createContext } from \"../shared/createContext.js\";\nimport { useDirection } from \"../shared/useDirection.js\";\nimport { useFilter } from \"../shared/useFilter.js\";\nimport { usePrimitiveElement } from \"../Primitive/usePrimitiveElement.js\";\nimport { ListboxRoot_default } from \"../Listbox/ListboxRoot.js\";\nimport { PopperRoot_default } from \"../Popper/PopperRoot.js\";\nimport { computed, createBlock, createVNode, defineComponent, getCurrentInstance, isRef, mergeProps, nextTick, onMounted, openBlock, ref, renderSlot, toRefs, unref, withCtx } from \"vue\";\nimport { createEventHook, useVModel } from \"@vueuse/core\";\n\n//#region src/Combobox/ComboboxRoot.vue?vue&type=script&setup=true&lang.ts\nconst [injectComboboxRootContext, provideComboboxRootContext] = createContext(\"ComboboxRoot\");\nvar ComboboxRoot_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({\n\t__name: \"ComboboxRoot\",\n\tprops: {\n\t\topen: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false,\n\t\t\tdefault: void 0\n\t\t},\n\t\tdefaultOpen: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tresetSearchTermOnBlur: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false,\n\t\t\tdefault: true\n\t\t},\n\t\tresetSearchTermOnSelect: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false,\n\t\t\tdefault: true\n\t\t},\n\t\topenOnFocus: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false,\n\t\t\tdefault: false\n\t\t},\n\t\topenOnClick: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false,\n\t\t\tdefault: false\n\t\t},\n\t\tignoreFilter: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tresetModelValueOnClear: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false,\n\t\t\tdefault: false\n\t\t},\n\t\tmodelValue: {\n\t\t\ttype: null,\n\t\t\trequired: false\n\t\t},\n\t\tdefaultValue: {\n\t\t\ttype: null,\n\t\t\trequired: false\n\t\t},\n\t\tmultiple: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tdir: {\n\t\t\ttype: String,\n\t\t\trequired: false\n\t\t},\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\thighlightOnHover: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false,\n\t\t\tdefault: true\n\t\t},\n\t\tby: {\n\t\t\ttype: [String, Function],\n\t\t\trequired: false\n\t\t},\n\t\tasChild: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tas: {\n\t\t\ttype: null,\n\t\t\trequired: false\n\t\t},\n\t\tname: {\n\t\t\ttype: String,\n\t\t\trequired: false\n\t\t},\n\t\trequired: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t}\n\t},\n\temits: [\n\t\t\"update:modelValue\",\n\t\t\"highlight\",\n\t\t\"update:open\"\n\t],\n\tsetup(__props, { expose: __expose, emit: __emit }) {\n\t\tconst props = __props;\n\t\tconst emits = __emit;\n\t\tconst { primitiveElement, currentElement: parentElement } = usePrimitiveElement();\n\t\tconst { multiple, disabled, ignoreFilter, resetSearchTermOnSelect, openOnFocus, openOnClick, dir: propDir, resetModelValueOnClear, highlightOnHover } = toRefs(props);\n\t\tconst dir = useDirection(propDir);\n\t\tconst modelValue = useVModel(props, \"modelValue\", emits, {\n\t\t\tdefaultValue: props.defaultValue ?? (multiple.value ? [] : void 0),\n\t\t\tpassive: props.modelValue === void 0,\n\t\t\tdeep: true\n\t\t});\n\t\tconst open = useVModel(props, \"open\", emits, {\n\t\t\tdefaultValue: props.defaultOpen,\n\t\t\tpassive: props.open === void 0\n\t\t});\n\t\tasync function onOpenChange(val) {\n\t\t\topen.value = val;\n\t\t\tfilterSearch.value = \"\";\n\t\t\tif (val) {\n\t\t\t\tawait nextTick();\n\t\t\t\tprimitiveElement.value?.highlightSelected();\n\t\t\t\tisUserInputted.value = true;\n\t\t\t\tinputElement.value?.focus();\n\t\t\t} else {\n\t\t\t\tisUserInputted.value = false;\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tif (!val && props.resetSearchTermOnBlur) resetSearchTerm.trigger();\n\t\t\t\t}, 1);\n\t\t\t}\n\t\t}\n\t\tconst resetSearchTerm = createEventHook();\n\t\tconst isUserInputted = ref(false);\n\t\tconst isVirtual = ref(false);\n\t\tconst inputElement = ref();\n\t\tconst triggerElement = ref();\n\t\tconst highlightedElement = computed(() => primitiveElement.value?.highlightedElement ?? void 0);\n\t\tconst allItems = ref(/* @__PURE__ */ new Map());\n\t\tconst allGroups = ref(/* @__PURE__ */ new Map());\n\t\tconst { contains } = useFilter({ sensitivity: \"base\" });\n\t\tconst filterSearch = ref(\"\");\n\t\tconst filterState = computed((oldValue) => {\n\t\t\tif (!filterSearch.value || props.ignoreFilter || isVirtual.value) return {\n\t\t\t\tcount: allItems.value.size,\n\t\t\t\titems: oldValue?.items ?? /* @__PURE__ */ new Map(),\n\t\t\t\tgroups: oldValue?.groups ?? new Set(allGroups.value.keys())\n\t\t\t};\n\t\t\tlet itemCount = 0;\n\t\t\tconst filteredItems = /* @__PURE__ */ new Map();\n\t\t\tconst filteredGroups = /* @__PURE__ */ new Set();\n\t\t\tfor (const [id, value] of allItems.value) {\n\t\t\t\tconst score = contains(value, filterSearch.value);\n\t\t\t\tfilteredItems.set(id, score ? 1 : 0);\n\t\t\t\tif (score) itemCount++;\n\t\t\t}\n\t\t\tfor (const [groupId, group] of allGroups.value) for (const itemId of group) if (filteredItems.get(itemId) > 0) {\n\t\t\t\tfilteredGroups.add(groupId);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tcount: itemCount,\n\t\t\t\titems: filteredItems,\n\t\t\t\tgroups: filteredGroups\n\t\t\t};\n\t\t});\n\t\tconst inst = getCurrentInstance();\n\t\tonMounted(() => {\n\t\t\tif (inst?.expose