'use strict';
import { c } from 'react/compiler-runtime';
import { jsx } from 'react/jsx-runtime';
import { createContext, useState, useContext } from 'react';

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", {
  value,
  configurable: true
});
const initialSearchDialogState = {
  searchDialogOpen: false
};
const SearchDialogContext = createContext(initialSearchDialogState);
function SearchDialogProvider(t0) {
  const $ = c(4);
  const {
    children
  } = t0;
  const [searchDialogOpen, setSearchDialogOpen] = useState(false);
  let t1;
  if ($[0] !== children || $[1] !== searchDialogOpen) {
    let t2;
    if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
      t2 = () => setSearchDialogOpen(true);
      $[3] = t2;
    } else {
      t2 = $[3];
    }
    const contextValue = {
      searchDialogOpen,
      setSearchDialogOpen,
      openDialog: __name(t2, "openDialog")
    };
    t1 = jsx(SearchDialogContext.Provider, {
      value: contextValue,
      children
    });
    $[0] = children;
    $[1] = searchDialogOpen;
    $[2] = t1;
  } else {
    t1 = $[2];
  }
  return t1;
}
__name(SearchDialogProvider, "SearchDialogProvider");
function useSearchDialog() {
  return useContext(SearchDialogContext);
}
__name(useSearchDialog, "useSearchDialog");

export { SearchDialogContext, SearchDialogProvider, useSearchDialog };
