import { _ as QueryBuilderDndProps, a as DndAdapterInlineCombinatorDnDParams, c as DndAdapterRuleGroupDnDParams, d as DndProp, f as DragPreviewState, g as QueryBuilderDndContextProps, h as OnRuleDropCallback, i as DndAdapter, l as isDndAdapter, m as OnDragMoveCallback, n as AdapterUseRuleDnDResult, o as DndAdapterProviderProps, p as DragTargetPosition, r as AdapterUseRuleGroupDnDResult, s as DndAdapterRuleDnDParams, t as AdapterUseInlineCombinatorDnDResult, u as CustomCanDropParams, v as RuleDropInfo, y as UseReactDnD } from "./adapter-yV-BV3RZ.js";
import { n as createDndKitAdapter, t as DndKitExports } from "./dnd-kit-B9zlr1ox.js";
import { n as createPragmaticDndAdapter, t as PragmaticDndExports } from "./pragmatic-dnd-dZQTdq6C.js";
import { t as createReactDnDAdapter } from "./react-dnd-BPbtowfo.js";
import * as React from "react";
import { Context } from "react";
import { DndDropTargetType, DraggedItem, DropEffect, InlineCombinatorProps, Path, RuleGroupProps, RuleGroupTypeAny, RuleProps } from "react-querybuilder";

//#region src/DragPreviewContext.d.ts
/**
* Context value for the drag preview state during update-while-dragging.
*
* @group DnD
*/
interface DragPreviewContextValue {
  /** Current drag preview state, or `null` when not actively dragging. */
  dragPreviewState: DragPreviewState | null;
  /**
  * Update the preview position. Called by adapter hooks when the cursor
  * enters a new quadrant of a rule or group.
  */
  updatePreviewPosition: (targetPath: Path, targetType: DndDropTargetType, quadrant: "upper" | "lower") => void;
  /**
  * Commit the current shadow query as the real query and clear preview state.
  * Called on drop.
  */
  commitDrag: () => void;
  /**
  * Discard the shadow query and revert to the original query.
  * Called on cancel.
  */
  cancelDrag: () => void;
}
/** @group Components */
declare const DragPreviewContext: Context<DragPreviewContextValue>;
//#endregion
//#region src/flipAnimation.d.ts
interface FlipAnimator {
  /** Capture the "first" positions of all matching elements. */
  captureFirst: (container: HTMLElement) => void;
  /**
  * Measure "last" positions, compute deltas, and animate.
  * Call this in `useLayoutEffect` after React has committed the new DOM.
  */
  playLast: (container: HTMLElement) => void;
}
/**
* Creates a FLIP animator that tracks elements matching the given CSS selector
* within a container. Elements are identified by their `data-rule-id` or `data-testid`
* attribute.
*/
declare const createFlipAnimator: (selector: string) => FlipAnimator;
//#endregion
//#region src/InlineCombinatorDnD.d.ts
/**
* The drag-and-drop-enabled inline combinator component.
*
* @group Components
*/
declare const InlineCombinatorDnD: ({
  component: CombinatorSelectorComponent,
  ...props
}: InlineCombinatorProps) => React.JSX.Element;
//#endregion
//#region src/quadrantDetection.d.ts
/**
* Determines whether the cursor is in the upper quadrant (top 25%),
* lower quadrant (bottom 25%), or middle zone (center 50%) of an element.
*
* Returns `null` when the cursor is in the middle zone, indicating
* no positional change should occur.
*/
declare const getQuadrant: (element: HTMLElement, clientY: number) => "upper" | "lower" | null;
//#endregion
//#region src/QueryBuilderDnD.d.ts
/**
* Context provider to enable drag-and-drop. If the application already implements
* `react-dnd`, use {@link QueryBuilderDndWithoutProvider} instead.
*
* @group Components
*/
declare const QueryBuilderDnD: (props: QueryBuilderDndProps) => React.JSX.Element;
/**
* Context provider to enable drag-and-drop. Only use this provider if the application
* already implements `react-dnd`, otherwise use {@link QueryBuilderDnD}.
*
* @group Components
*/
declare const QueryBuilderDndWithoutProvider: (props: QueryBuilderDndProps) => React.JSX.Element;
/**
* @group Hooks
* @deprecated Use `createReactDnDAdapter` instead. This hook is kept for backward compatibility.
*/
declare const useReactDnD: (dndParam?: DndProp) => UseReactDnD | null;
//#endregion
//#region src/RuleDnD.d.ts
/**
* Rule component for drag-and-drop. Renders the provided rule component
* ({@link react-querybuilder!Rule Rule} by default), but forwards the
* drag-and-drop context.
*
* @group Components
*/
declare const RuleDnD: (props: RuleProps) => React.JSX.Element;
//#endregion
//#region src/RuleGroupDnD.d.ts
/**
* Rule group component for drag-and-drop. Renders the provided rule group component
* ({@link react-querybuilder!RuleGroup RuleGroup} by default), but forwards the drag-and-drop
* context so that child rules and groups will render within the appropriate drag-and-drop wrappers.
*
* @group Components
*/
declare const RuleGroupDnD: (props: RuleGroupProps) => React.JSX.Element;
//#endregion
//#region src/shadowQuery.d.ts
/**
* Computes the destination path for a quadrant-based drag target.
*
* - **Rule, upper quadrant**: Insert before the target rule.
* - **Rule, lower quadrant**: Insert after the target rule.
* - **RuleGroup header**: Insert as first child of the group (position 0).
*/
declare const computeDestinationFromQuadrant: (targetPath: Path, targetType: DndDropTargetType, quadrant: "upper" | "lower") => Path;
/**
* Computes a shadow query given the current drag state and target position.
*
* Uses the existing `move()` and `group()` utilities from `@react-querybuilder/core`
* to produce an immutable preview of the query with the dragged item at its
* prospective position.
*
* @returns The shadow query and the path where the dragged item now lives,
*          or `null` if the move would be a no-op.
*/
declare const computeShadowQuery: ({
  originalQuery,
  draggedPath,
  targetPath,
  targetType,
  quadrant,
  dropEffect,
  groupItems
}: {
  originalQuery: RuleGroupTypeAny;
  draggedItem: DraggedItem;
  draggedPath: Path;
  targetPath: Path;
  targetType: DndDropTargetType;
  quadrant: "upper" | "lower";
  dropEffect: DropEffect;
  groupItems: boolean;
}) => {
  shadowQuery: RuleGroupTypeAny;
  previewPath: Path;
} | null;
//#endregion
//#region src/useShadowQuery.d.ts
/**
* Hook for consuming the shadow query during an active drag with
* `updateWhileDragging` enabled.
*
* @returns The shadow query if a drag is in progress, otherwise `undefined`.
*
* @group Hooks
*/
declare const useShadowQuery: () => RuleGroupTypeAny | undefined;
//#endregion
export { AdapterUseInlineCombinatorDnDResult, type AdapterUseInlineCombinatorDnDResult as UseInlineCombinatorDnDResult, AdapterUseRuleDnDResult, type AdapterUseRuleDnDResult as UseRuleDnDResult, AdapterUseRuleGroupDnDResult, type AdapterUseRuleGroupDnDResult as UseRuleGroupDnDResult, CustomCanDropParams, DndAdapter, DndAdapterInlineCombinatorDnDParams, DndAdapterProviderProps, DndAdapterRuleDnDParams, DndAdapterRuleGroupDnDParams, type DndKitExports, DndProp, DragPreviewContext, DragPreviewContextValue, DragPreviewState, DragTargetPosition, FlipAnimator, InlineCombinatorDnD, OnDragMoveCallback, OnRuleDropCallback, type PragmaticDndExports, QueryBuilderDnD, QueryBuilderDndContextProps, QueryBuilderDndProps, QueryBuilderDndWithoutProvider, RuleDnD, RuleDropInfo, RuleGroupDnD, UseReactDnD, computeDestinationFromQuadrant, computeShadowQuery, createDndKitAdapter, createFlipAnimator, createPragmaticDndAdapter, createReactDnDAdapter, getQuadrant, isDndAdapter, useReactDnD, useShadowQuery };
//# sourceMappingURL=react-querybuilder_dnd.legacy-esm.d.ts.map