"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }"use client";


var _chunkVRHGVLSLcjs = require('./chunk-VRHGVLSL.cjs');

// src/embed-shims/next-navigation.tsx
var _react = require('react');
function registerNavigation(nav) {
  impl = { ...impl, ...nav };
}
function fallbackUseRouter() {
  if (typeof window === "undefined") return noopRouter;
  return {
    push: (href) => window.location.assign(href),
    replace: (href) => window.location.replace(href),
    back: () => window.history.back(),
    forward: () => window.history.forward(),
    refresh: () => window.location.reload(),
    prefetch: () => {
    }
  };
}
function readLocation(read, fallback) {
  return typeof window === "undefined" ? fallback : read();
}
function useLocationSubscription() {
  const [tick, setTick] = _react.useState.call(void 0, 0);
  _react.useEffect.call(void 0, () => {
    if (typeof window === "undefined") return;
    const onChange = () => setTick((t) => t + 1);
    window.addEventListener("popstate", onChange);
    return () => window.removeEventListener("popstate", onChange);
  }, []);
  return tick;
}
function fallbackUsePathname() {
  useLocationSubscription();
  return readLocation(() => window.location.pathname, "/");
}
function fallbackUseSearchParams() {
  useLocationSubscription();
  return readLocation(
    () => new URLSearchParams(window.location.search),
    new URLSearchParams()
  );
}
function fallbackUseParams() {
  return {};
}
function fallbackRedirect(url) {
  if (typeof window !== "undefined") window.location.assign(url);
  throw new Error(`[next-navigation shim] redirect(${url})`);
}
function fallbackPermanentRedirect(url) {
  if (typeof window !== "undefined") window.location.replace(url);
  throw new Error(`[next-navigation shim] permanentRedirect(${url})`);
}
function fallbackNotFound() {
  throw new Error("[next-navigation shim] notFound()");
}
function useRouter() {
  return (_nullishCoalesce(impl.useRouter, () => ( fallbackUseRouter)))();
}
function usePathname() {
  return (_nullishCoalesce(impl.usePathname, () => ( fallbackUsePathname)))();
}
function useSearchParams() {
  return (_nullishCoalesce(impl.useSearchParams, () => ( fallbackUseSearchParams)))();
}
function useParams() {
  return (_nullishCoalesce(impl.useParams, () => ( fallbackUseParams)))();
}
function redirect(url, type) {
  return (_nullishCoalesce(impl.redirect, () => ( fallbackRedirect)))(url, type);
}
function permanentRedirect(url, type) {
  return (_nullishCoalesce(impl.permanentRedirect, () => ( fallbackPermanentRedirect)))(url, type);
}
function notFound() {
  return (_nullishCoalesce(impl.notFound, () => ( fallbackNotFound)))();
}
var impl, noopRouter, RedirectType, ServerInsertedHTMLContext;
var init_next_navigation = _chunkVRHGVLSLcjs.__esm.call(void 0, {
  "src/embed-shims/next-navigation.tsx"() {
    impl = {};
    noopRouter = {
      push: () => {
      },
      replace: () => {
      },
      back: () => {
      },
      forward: () => {
      },
      refresh: () => {
      },
      prefetch: () => {
      }
    };
    RedirectType = exports.RedirectType = {
      push: "push",
      replace: "replace"
    };
    ServerInsertedHTMLContext = exports.ServerInsertedHTMLContext = null;
  }
});













exports.registerNavigation = registerNavigation; exports.useRouter = useRouter; exports.usePathname = usePathname; exports.useSearchParams = useSearchParams; exports.useParams = useParams; exports.redirect = redirect; exports.permanentRedirect = permanentRedirect; exports.notFound = notFound; exports.RedirectType = RedirectType; exports.ServerInsertedHTMLContext = ServerInsertedHTMLContext; exports.init_next_navigation = init_next_navigation;
//# sourceMappingURL=chunk-G7UE6RKV.cjs.map