'use client'; import { jsx as _jsx } from "react/jsx-runtime"; import { useEffect, useContext } from 'react'; import { addBasePath } from './add-base-path'; import { useIntersection } from './use-intersection'; import { useMergedRef } from './use-merged-ref'; import { AppRouterContext } from '../shared/lib/app-router-context.shared-runtime'; import { PrefetchKind } from './components/router-reducer/router-reducer-types'; import { RouterContext } from '../shared/lib/router-context.shared-runtime'; const DISALLOWED_FORM_PROPS = [ 'method', 'encType', 'target' ]; export default function Form(param) { let { replace, scroll, prefetch: prefetchProp, ref: externalRef, ...props } = param; const router = useAppOrPagesRouter(); const actionProp = props.action; const isNavigatingForm = typeof actionProp === 'string'; // Validate `action` if (process.env.NODE_ENV === 'development') { if (isNavigatingForm) { checkActionUrl(actionProp, 'action'); } } // Validate `prefetch` if (process.env.NODE_ENV === 'development') { if (!(prefetchProp === undefined || prefetchProp === false || prefetchProp === null)) { console.error('The `prefetch` prop of