import { useNavigate as c, useLocation as u } from "../../shop-minis-react/node_modules/.pnpm/react-router@7.7.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-router/dist/development/chunk-EF7DTUVF.js";
import { DATA_NAVIGATION_TYPE_ATTRIBUTE as r } from "../../types/index.js";
function l() {
  const e = c(), o = u();
  return (t, i) => {
    if (typeof t == "number") {
      if (document.startViewTransition)
        document.startViewTransition(() => {
          e(t);
        }).finished.then(() => {
          document.documentElement.removeAttribute(
            r
          );
        }).catch((n) => {
          console.error("View transition error:", n);
        });
      else
        return e(t);
      return;
    }
    const a = t === o.pathname;
    if (document.startViewTransition)
      document.startViewTransition(() => {
        e(t, {
          preventScrollReset: !0,
          replace: a,
          ...i
        });
      }).finished.then(() => {
        document.documentElement.removeAttribute(
          r
        );
      }).catch((n) => {
        console.error("View transition error:", n);
      });
    else
      return e(t, i);
  };
}
export {
  l as useNavigateWithTransition
};
//# sourceMappingURL=useNavigateWithTransition.js.map
