{"version":3,"names":["dynamic","createMemo","omit","composeRefs","userRef","mergeRootProps","resolveClassStyle","useComboboxRootContext","ComboboxBackdrop","props","root","state","open","transitionStatus","internal","role","hidden","mounted","style","data-open","undefined","data-closed","data-starting-style","data-ending-style","userClassStyle","userProps","merged","Tag","as"],"sources":["combobox-backdrop.tsx"],"sourcesContent":["import type { JSX, ValidComponent } from \"@solidjs/web\";\nimport { dynamic } from \"@solidjs/web\";\nimport { createMemo, omit } from \"solid-js\";\nimport { composeRefs, userRef } from \"../../internals/compose-refs\";\nimport { mergeRootProps } from \"../../internals/merge-root-props\";\nimport { resolveClassStyle } from \"../../internals/resolve-class-style\";\nimport type { BaseUIComponentProps } from \"../../internals/types\";\nimport type { TransitionStatus } from \"../../internals/use-transition-status/use-transition-status\";\nimport { useComboboxRootContext } from \"../root/combobox-root-context\";\n\nexport interface ComboboxBackdropState {\n\topen: boolean;\n\ttransitionStatus: TransitionStatus;\n}\n\nexport interface ComboboxBackdropProps\n\textends BaseUIComponentProps<\"div\", ComboboxBackdropState> {\n\tas?: ValidComponent;\n}\n\n/**\n * An overlay displayed beneath the popup. Renders a `<div>` element.\n */\nexport function ComboboxBackdrop(props: ComboboxBackdropProps): JSX.Element {\n\tconst root = useComboboxRootContext();\n\n\tconst state = createMemo<ComboboxBackdropState>(() => ({\n\t\topen: root.open(),\n\t\ttransitionStatus: root.transitionStatus(),\n\t}));\n\n\tconst internal = {\n\t\trole: \"presentation\" as const,\n\t\tget hidden() {\n\t\t\treturn !root.mounted();\n\t\t},\n\t\tstyle: {\n\t\t\t\"user-select\": \"none\",\n\t\t\t\"-webkit-user-select\": \"none\",\n\t\t} as JSX.CSSProperties,\n\t\tget \"data-open\"() {\n\t\t\treturn state().open ? \"\" : undefined;\n\t\t},\n\t\tget \"data-closed\"() {\n\t\t\treturn state().open ? undefined : \"\";\n\t\t},\n\t\tget \"data-starting-style\"() {\n\t\t\treturn state().transitionStatus === \"starting\" ? \"\" : undefined;\n\t\t},\n\t\tget \"data-ending-style\"() {\n\t\t\treturn state().transitionStatus === \"ending\" ? \"\" : undefined;\n\t\t},\n\t};\n\n\tconst userClassStyle = resolveClassStyle(props, () => state());\n\tconst userProps = omit(props, \"as\", \"class\", \"style\", \"attrs\");\n\n\tlet merged: Record<string, unknown> = mergeRootProps(\n\t\tinternal,\n\t\tuserClassStyle,\n\t);\n\tmerged = mergeRootProps(merged, userProps);\n\n\tconst Tag = dynamic(() => props.as ?? \"div\");\n\treturn <Tag {...merged} ref={composeRefs(userRef(props))} />;\n}\n"],"mappings":"AACA,SAASA,OAAO,QAAQ,cAAc;AACtC,SAASC,UAAU,EAAEC,IAAI,QAAQ,UAAU;AAC3C,SAASC,WAAW,EAAEC,OAAO,QAAQ,8BAA8B;AACnE,SAASC,cAAc,QAAQ,kCAAkC;AACjE,SAASC,iBAAiB,QAAQ,qCAAqC;AAGvE,SAASC,sBAAsB,QAAQ,+BAA+B;AAYtE;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAACC,KAA4B,EAAe;EAC3E,MAAMC,IAAI,GAAGH,sBAAsB,CAAC,CAAC;EAErC,MAAMI,KAAK,GAAGV,UAAU,CAAwB,OAAO;IACtDW,IAAI,EAAEF,IAAI,CAACE,IAAI,CAAC,CAAC;IACjBC,gBAAgB,EAAEH,IAAI,CAACG,gBAAgB,CAAC;EACzC,CAAC,CAAC,CAAC;EAEH,MAAMC,QAAQ,GAAG;IAChBC,IAAI,EAAE,cAAuB;IAC7B,IAAIC,MAAMA,CAAA,EAAG;MACZ,OAAO,CAACN,IAAI,CAACO,OAAO,CAAC,CAAC;IACvB,CAAC;IACDC,KAAK,EAAE;MACN,aAAa,EAAE,MAAM;MACrB,qBAAqB,EAAE;IACxB,CAAsB;IACtB,IAAI,WAAWC,CAAA,EAAG;MACjB,OAAOR,KAAK,CAAC,CAAC,CAACC,IAAI,GAAG,EAAE,GAAGQ,SAAS;IACrC,CAAC;IACD,IAAI,aAAaC,CAAA,EAAG;MACnB,OAAOV,KAA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