{"version":3,"names":["createContext","useContext","AutocompleteRootContext","useAutocompleteRootContext","optional","ctx","Error"],"sources":["autocomplete-root-context.ts"],"sourcesContent":["import { type Accessor, createContext, useContext } from \"solid-js\";\nimport type { AutocompleteMode } from \"./autocomplete-root\";\n\n/**\n * Autocomplete-specific context layered on top of the combobox root\n * context. Carries bits that combobox doesn't know about — currently\n * just the `mode`, which drives `aria-autocomplete` on the input and\n * the `data-*` attributes on the input-group.\n *\n * The bulk of shared state (open, inputValue, indices, refs, etc.)\n * still flows through `ComboboxRootContext` so that every\n * combobox-provided sub-part (Portal, Positioner, Popup, List, etc.)\n * works against an autocomplete root without rewiring.\n */\nexport interface AutocompleteRootContextValue {\n\tmode: Accessor<AutocompleteMode>;\n}\n\nexport const AutocompleteRootContext =\n\tcreateContext<AutocompleteRootContextValue | null>(null);\n\nexport function useAutocompleteRootContext(): AutocompleteRootContextValue;\nexport function useAutocompleteRootContext(\n\toptional: true,\n): AutocompleteRootContextValue | null;\nexport function useAutocompleteRootContext(\n\toptional?: boolean,\n): AutocompleteRootContextValue | null {\n\tconst ctx = useContext(AutocompleteRootContext);\n\tif (ctx == null && !optional) {\n\t\tthrow new Error(\n\t\t\t\"Base UI: AutocompleteRootContext is missing. Autocomplete parts must be placed within <Autocomplete.Root>.\",\n\t\t);\n\t}\n\treturn ctx;\n}\n"],"mappings":"AAAA,SAAwBA,aAAa,EAAEC,UAAU,QAAQ,UAAU;;AAGnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,OAAO,MAAMC,uBAAuB,GACnCF,aAAa,CAAsC,IAAI,CAAC;AAMzD,OAAO,SAASG,0BAA0BA,CACzCC,QAAkB,EACoB;EACtC,MAAMC,GAAG,GAAGJ,UAAU,CAACC,uBAAuB,CAAC;EAC/C,IAAIG,GAAG,IAAI,IAAI,IAAI,CAACD,QAAQ,EAAE;IAC7B,MAAM,IAAIE,KAAK,CACd,4GACD,CAAC;EACF;EACA,OAAOD,GAAG;AACX","ignoreList":[]}