"use client";
'use strict';

var ME2CUF3F = require('./ME2CUF3F.cjs');
var BCALMBPZ = require('./BCALMBPZ.cjs');
var PBFD2E7P = require('./PBFD2E7P.cjs');
var _3YLGPPWQ = require('./3YLGPPWQ.cjs');

// src/hovercard/hovercard-store.ts
function createHovercardStore(props = {}) {
  var _a;
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
  const popover = ME2CUF3F.createPopoverStore(_3YLGPPWQ.__spreadProps(_3YLGPPWQ.__spreadValues({}, props), {
    placement: PBFD2E7P.defaultValue(
      props.placement,
      syncState == null ? void 0 : syncState.placement,
      "bottom"
    )
  }));
  const timeout = PBFD2E7P.defaultValue(props.timeout, syncState == null ? void 0 : syncState.timeout, 500);
  const initialState = _3YLGPPWQ.__spreadProps(_3YLGPPWQ.__spreadValues({}, popover.getState()), {
    timeout,
    showTimeout: PBFD2E7P.defaultValue(props.showTimeout, syncState == null ? void 0 : syncState.showTimeout),
    hideTimeout: PBFD2E7P.defaultValue(props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout),
    autoFocusOnShow: PBFD2E7P.defaultValue(syncState == null ? void 0 : syncState.autoFocusOnShow, false)
  });
  const hovercard = BCALMBPZ.createStore(initialState, popover, props.store);
  return _3YLGPPWQ.__spreadProps(_3YLGPPWQ.__spreadValues(_3YLGPPWQ.__spreadValues({}, popover), hovercard), {
    setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value)
  });
}

exports.createHovercardStore = createHovercardStore;
//# sourceMappingURL=JTLIIJ4U.cjs.map
