import { getEmptyRootContext as i } from "../../floating-ui-react/utils/getEmptyRootContext.js";
import { EMPTY_OBJECT as n } from "../../../../../../../@base-ui_utils@0.2.4_@types_react@18.3.27_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/empty.js";
import { createSelector as t } from "../../../../../../../@base-ui_utils@0.2.4_@types_react@18.3.27_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/store/createSelector.js";
function l() {
  return {
    open: !1,
    mounted: !1,
    transitionStatus: "idle",
    floatingRootContext: i(),
    preventUnmountingOnClose: !1,
    payload: void 0,
    activeTriggerId: null,
    activeTriggerElement: null,
    popupElement: null,
    positionerElement: null,
    activeTriggerProps: n,
    inactiveTriggerProps: n,
    popupProps: n
  };
}
const a = {
  open: t((e) => e.open),
  mounted: t((e) => e.mounted),
  transitionStatus: t((e) => e.transitionStatus),
  floatingRootContext: t((e) => e.floatingRootContext),
  preventUnmountingOnClose: t((e) => e.preventUnmountingOnClose),
  payload: t((e) => e.payload),
  activeTriggerId: t((e) => e.activeTriggerId),
  activeTriggerElement: t((e) => e.mounted ? e.activeTriggerElement : null),
  /**
   * Whether the trigger with the given ID was used to open the popup.
   */
  isTriggerActive: t((e, o) => o !== void 0 && e.activeTriggerId === o),
  /**
   * Whether the popup is open and was activated by a trigger with the given ID.
   */
  isOpenedByTrigger: t((e, o) => o !== void 0 && e.activeTriggerId === o && e.open),
  /**
   * Whether the popup is mounted and was activated by a trigger with the given ID.
   */
  isMountedByTrigger: t((e, o) => o !== void 0 && e.activeTriggerId === o && e.mounted),
  triggerProps: t((e, o) => o ? e.activeTriggerProps : e.inactiveTriggerProps),
  popupProps: t((e) => e.popupProps),
  popupElement: t((e) => e.popupElement),
  positionerElement: t((e) => e.positionerElement)
};
export {
  l as createInitialPopupStoreState,
  a as popupStoreSelectors
};
