// src/react/components/Head.tsx
import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
var RobotsContent = ({ robots }) => {
  const directives = [];
  if (robots.index === false)
    directives.push("noindex");
  if (robots.index === true)
    directives.push("index");
  if (robots.follow === false)
    directives.push("nofollow");
  if (robots.follow === true)
    directives.push("follow");
  if (robots.noarchive)
    directives.push("noarchive");
  if (robots.nosnippet)
    directives.push("nosnippet");
  if (robots.noimageindex)
    directives.push("noimageindex");
  if (robots.maxSnippet !== undefined)
    directives.push(`max-snippet:${robots.maxSnippet}`);
  if (robots.maxImagePreview)
    directives.push(`max-image-preview:${robots.maxImagePreview}`);
  if (robots.maxVideoPreview !== undefined)
    directives.push(`max-video-preview:${robots.maxVideoPreview}`);
  const content = directives.join(", ");
  return content ? /* @__PURE__ */ jsxDEV("meta", {
    content,
    name: "robots"
  }, undefined, false, undefined, this) : null;
};
var OpenGraphTags = ({
  openGraph,
  title,
  description
}) => /* @__PURE__ */ jsxDEV(Fragment, {
  children: [
    /* @__PURE__ */ jsxDEV("meta", {
      content: openGraph.title ?? title,
      property: "og:title"
    }, undefined, false, undefined, this),
    /* @__PURE__ */ jsxDEV("meta", {
      content: openGraph.description ?? description,
      property: "og:description"
    }, undefined, false, undefined, this),
    openGraph.url && /* @__PURE__ */ jsxDEV("meta", {
      content: openGraph.url,
      property: "og:url"
    }, undefined, false, undefined, this),
    openGraph.image && /* @__PURE__ */ jsxDEV("meta", {
      content: openGraph.image,
      property: "og:image"
    }, undefined, false, undefined, this),
    openGraph.imageAlt && /* @__PURE__ */ jsxDEV("meta", {
      content: openGraph.imageAlt,
      property: "og:image:alt"
    }, undefined, false, undefined, this),
    openGraph.imageWidth && /* @__PURE__ */ jsxDEV("meta", {
      content: String(openGraph.imageWidth),
      property: "og:image:width"
    }, undefined, false, undefined, this),
    openGraph.imageHeight && /* @__PURE__ */ jsxDEV("meta", {
      content: String(openGraph.imageHeight),
      property: "og:image:height"
    }, undefined, false, undefined, this),
    openGraph.type && /* @__PURE__ */ jsxDEV("meta", {
      content: openGraph.type,
      property: "og:type"
    }, undefined, false, undefined, this),
    openGraph.siteName && /* @__PURE__ */ jsxDEV("meta", {
      content: openGraph.siteName,
      property: "og:site_name"
    }, undefined, false, undefined, this),
    openGraph.locale && /* @__PURE__ */ jsxDEV("meta", {
      content: openGraph.locale,
      property: "og:locale"
    }, undefined, false, undefined, this)
  ]
}, undefined, true, undefined, this);
var TwitterTags = ({
  twitter,
  title,
  description
}) => /* @__PURE__ */ jsxDEV(Fragment, {
  children: [
    twitter.card && /* @__PURE__ */ jsxDEV("meta", {
      content: twitter.card,
      name: "twitter:card"
    }, undefined, false, undefined, this),
    /* @__PURE__ */ jsxDEV("meta", {
      content: twitter.title ?? title,
      name: "twitter:title"
    }, undefined, false, undefined, this),
    /* @__PURE__ */ jsxDEV("meta", {
      content: twitter.description ?? description,
      name: "twitter:description"
    }, undefined, false, undefined, this),
    twitter.image && /* @__PURE__ */ jsxDEV("meta", {
      content: twitter.image,
      name: "twitter:image"
    }, undefined, false, undefined, this),
    twitter.imageAlt && /* @__PURE__ */ jsxDEV("meta", {
      content: twitter.imageAlt,
      name: "twitter:image:alt"
    }, undefined, false, undefined, this),
    twitter.site && /* @__PURE__ */ jsxDEV("meta", {
      content: twitter.site,
      name: "twitter:site"
    }, undefined, false, undefined, this),
    twitter.creator && /* @__PURE__ */ jsxDEV("meta", {
      content: twitter.creator,
      name: "twitter:creator"
    }, undefined, false, undefined, this)
  ]
}, undefined, true, undefined, this);
var CustomMetaTag = ({ tag }) => {
  if (tag.property)
    return /* @__PURE__ */ jsxDEV("meta", {
      content: tag.content,
      property: tag.property
    }, undefined, false, undefined, this);
  if (tag.httpEquiv)
    return /* @__PURE__ */ jsxDEV("meta", {
      content: tag.content,
      httpEquiv: tag.httpEquiv
    }, undefined, false, undefined, this);
  return /* @__PURE__ */ jsxDEV("meta", {
    content: tag.content,
    name: tag.name
  }, undefined, false, undefined, this);
};
var Head = ({
  title = "AbsoluteJS",
  description = "A page created using AbsoluteJS",
  icon = "/assets/ico/favicon.ico",
  font,
  cssPath,
  canonical,
  openGraph,
  twitter,
  robots,
  meta
} = {}) => /* @__PURE__ */ jsxDEV("head", {
  suppressHydrationWarning: true,
  children: [
    /* @__PURE__ */ jsxDEV("meta", {
      charSet: "utf-8"
    }, undefined, false, undefined, this),
    /* @__PURE__ */ jsxDEV("title", {
      children: title
    }, undefined, false, undefined, this),
    /* @__PURE__ */ jsxDEV("meta", {
      content: description,
      name: "description"
    }, undefined, false, undefined, this),
    /* @__PURE__ */ jsxDEV("meta", {
      content: "width=device-width, initial-scale=1",
      name: "viewport"
    }, undefined, false, undefined, this),
    /* @__PURE__ */ jsxDEV("link", {
      href: icon,
      rel: "icon"
    }, undefined, false, undefined, this),
    canonical && /* @__PURE__ */ jsxDEV("link", {
      href: canonical,
      rel: "canonical"
    }, undefined, false, undefined, this),
    openGraph && /* @__PURE__ */ jsxDEV(OpenGraphTags, {
      description,
      openGraph,
      title
    }, undefined, false, undefined, this),
    twitter && /* @__PURE__ */ jsxDEV(TwitterTags, {
      description,
      title,
      twitter
    }, undefined, false, undefined, this),
    robots && /* @__PURE__ */ jsxDEV(RobotsContent, {
      robots
    }, undefined, false, undefined, this),
    meta?.map((tag, i) => /* @__PURE__ */ jsxDEV(CustomMetaTag, {
      tag
    }, i, false, undefined, this)),
    font && /* @__PURE__ */ jsxDEV(Fragment, {
      children: [
        /* @__PURE__ */ jsxDEV("link", {
          href: "https://fonts.googleapis.com",
          rel: "preconnect"
        }, undefined, false, undefined, this),
        /* @__PURE__ */ jsxDEV("link", {
          crossOrigin: "anonymous",
          href: "https://fonts.gstatic.com",
          rel: "preconnect",
          suppressHydrationWarning: true
        }, undefined, false, undefined, this),
        /* @__PURE__ */ jsxDEV("link", {
          href: `https://fonts.googleapis.com/css2?family=${font}:wght@100..900&display=swap`,
          rel: "stylesheet",
          suppressHydrationWarning: true
        }, undefined, false, undefined, this)
      ]
    }, undefined, true, undefined, this),
    cssPath && [cssPath].flat().map((path) => /* @__PURE__ */ jsxDEV("link", {
      href: path,
      rel: "stylesheet",
      suppressHydrationWarning: true,
      type: "text/css"
    }, path, false, undefined, this))
  ]
}, undefined, true, undefined, this);
// src/utils/imageProcessing.ts
var {existsSync, mkdirSync, readFileSync, writeFileSync} = (() => ({}));

// node:path
function assertPath(path) {
  if (typeof path !== "string")
    throw TypeError("Path must be a string. Received " + JSON.stringify(path));
}
function normalizeStringPosix(path, allowAboveRoot) {
  var res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, code;
  for (var i = 0;i <= path.length; ++i) {
    if (i < path.length)
      code = path.charCodeAt(i);
    else if (code === 47)
      break;
    else
      code = 47;
    if (code === 47) {
      if (lastSlash === i - 1 || dots === 1)
        ;
      else if (lastSlash !== i - 1 && dots === 2) {
        if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 || res.charCodeAt(res.length - 2) !== 46) {
          if (res.length > 2) {
            var lastSlashIndex = res.lastIndexOf("/");
            if (lastSlashIndex !== res.length - 1) {
              if (lastSlashIndex === -1)
                res = "", lastSegmentLength = 0;
              else
                res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
              lastSlash = i, dots = 0;
              continue;
            }
          } else if (res.length === 2 || res.length === 1) {
            res = "", lastSegmentLength = 0, lastSlash = i, dots = 0;
            continue;
          }
        }
        if (allowAboveRoot) {
          if (res.length > 0)
            res += "/..";
          else
            res = "..";
          lastSegmentLength = 2;
        }
      } else {
        if (res.length > 0)
          res += "/" + path.slice(lastSlash + 1, i);
        else
          res = path.slice(lastSlash + 1, i);
        lastSegmentLength = i - lastSlash - 1;
      }
      lastSlash = i, dots = 0;
    } else if (code === 46 && dots !== -1)
      ++dots;
    else
      dots = -1;
  }
  return res;
}
function _format(sep, pathObject) {
  var dir = pathObject.dir || pathObject.root, base = pathObject.base || (pathObject.name || "") + (pathObject.ext || "");
  if (!dir)
    return base;
  if (dir === pathObject.root)
    return dir + base;
  return dir + sep + base;
}
function resolve() {
  var resolvedPath = "", resolvedAbsolute = false, cwd;
  for (var i = arguments.length - 1;i >= -1 && !resolvedAbsolute; i--) {
    var path;
    if (i >= 0)
      path = arguments[i];
    else {
      if (cwd === undefined)
        cwd = process.cwd();
      path = cwd;
    }
    if (assertPath(path), path.length === 0)
      continue;
    resolvedPath = path + "/" + resolvedPath, resolvedAbsolute = path.charCodeAt(0) === 47;
  }
  if (resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute), resolvedAbsolute)
    if (resolvedPath.length > 0)
      return "/" + resolvedPath;
    else
      return "/";
  else if (resolvedPath.length > 0)
    return resolvedPath;
  else
    return ".";
}
function normalize(path) {
  if (assertPath(path), path.length === 0)
    return ".";
  var isAbsolute = path.charCodeAt(0) === 47, trailingSeparator = path.charCodeAt(path.length - 1) === 47;
  if (path = normalizeStringPosix(path, !isAbsolute), path.length === 0 && !isAbsolute)
    path = ".";
  if (path.length > 0 && trailingSeparator)
    path += "/";
  if (isAbsolute)
    return "/" + path;
  return path;
}
function isAbsolute(path) {
  return assertPath(path), path.length > 0 && path.charCodeAt(0) === 47;
}
function join() {
  if (arguments.length === 0)
    return ".";
  var joined;
  for (var i = 0;i < arguments.length; ++i) {
    var arg = arguments[i];
    if (assertPath(arg), arg.length > 0)
      if (joined === undefined)
        joined = arg;
      else
        joined += "/" + arg;
  }
  if (joined === undefined)
    return ".";
  return normalize(joined);
}
function relative(from, to) {
  if (assertPath(from), assertPath(to), from === to)
    return "";
  if (from = resolve(from), to = resolve(to), from === to)
    return "";
  var fromStart = 1;
  for (;fromStart < from.length; ++fromStart)
    if (from.charCodeAt(fromStart) !== 47)
      break;
  var fromEnd = from.length, fromLen = fromEnd - fromStart, toStart = 1;
  for (;toStart < to.length; ++toStart)
    if (to.charCodeAt(toStart) !== 47)
      break;
  var toEnd = to.length, toLen = toEnd - toStart, length = fromLen < toLen ? fromLen : toLen, lastCommonSep = -1, i = 0;
  for (;i <= length; ++i) {
    if (i === length) {
      if (toLen > length) {
        if (to.charCodeAt(toStart + i) === 47)
          return to.slice(toStart + i + 1);
        else if (i === 0)
          return to.slice(toStart + i);
      } else if (fromLen > length) {
        if (from.charCodeAt(fromStart + i) === 47)
          lastCommonSep = i;
        else if (i === 0)
          lastCommonSep = 0;
      }
      break;
    }
    var fromCode = from.charCodeAt(fromStart + i), toCode = to.charCodeAt(toStart + i);
    if (fromCode !== toCode)
      break;
    else if (fromCode === 47)
      lastCommonSep = i;
  }
  var out = "";
  for (i = fromStart + lastCommonSep + 1;i <= fromEnd; ++i)
    if (i === fromEnd || from.charCodeAt(i) === 47)
      if (out.length === 0)
        out += "..";
      else
        out += "/..";
  if (out.length > 0)
    return out + to.slice(toStart + lastCommonSep);
  else {
    if (toStart += lastCommonSep, to.charCodeAt(toStart) === 47)
      ++toStart;
    return to.slice(toStart);
  }
}
function _makeLong(path) {
  return path;
}
function dirname(path) {
  if (assertPath(path), path.length === 0)
    return ".";
  var code = path.charCodeAt(0), hasRoot = code === 47, end = -1, matchedSlash = true;
  for (var i = path.length - 1;i >= 1; --i)
    if (code = path.charCodeAt(i), code === 47) {
      if (!matchedSlash) {
        end = i;
        break;
      }
    } else
      matchedSlash = false;
  if (end === -1)
    return hasRoot ? "/" : ".";
  if (hasRoot && end === 1)
    return "//";
  return path.slice(0, end);
}
function basename(path, ext) {
  if (ext !== undefined && typeof ext !== "string")
    throw TypeError('"ext" argument must be a string');
  assertPath(path);
  var start = 0, end = -1, matchedSlash = true, i;
  if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {
    if (ext.length === path.length && ext === path)
      return "";
    var extIdx = ext.length - 1, firstNonSlashEnd = -1;
    for (i = path.length - 1;i >= 0; --i) {
      var code = path.charCodeAt(i);
      if (code === 47) {
        if (!matchedSlash) {
          start = i + 1;
          break;
        }
      } else {
        if (firstNonSlashEnd === -1)
          matchedSlash = false, firstNonSlashEnd = i + 1;
        if (extIdx >= 0)
          if (code === ext.charCodeAt(extIdx)) {
            if (--extIdx === -1)
              end = i;
          } else
            extIdx = -1, end = firstNonSlashEnd;
      }
    }
    if (start === end)
      end = firstNonSlashEnd;
    else if (end === -1)
      end = path.length;
    return path.slice(start, end);
  } else {
    for (i = path.length - 1;i >= 0; --i)
      if (path.charCodeAt(i) === 47) {
        if (!matchedSlash) {
          start = i + 1;
          break;
        }
      } else if (end === -1)
        matchedSlash = false, end = i + 1;
    if (end === -1)
      return "";
    return path.slice(start, end);
  }
}
function extname(path) {
  assertPath(path);
  var startDot = -1, startPart = 0, end = -1, matchedSlash = true, preDotState = 0;
  for (var i = path.length - 1;i >= 0; --i) {
    var code = path.charCodeAt(i);
    if (code === 47) {
      if (!matchedSlash) {
        startPart = i + 1;
        break;
      }
      continue;
    }
    if (end === -1)
      matchedSlash = false, end = i + 1;
    if (code === 46) {
      if (startDot === -1)
        startDot = i;
      else if (preDotState !== 1)
        preDotState = 1;
    } else if (startDot !== -1)
      preDotState = -1;
  }
  if (startDot === -1 || end === -1 || preDotState === 0 || preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)
    return "";
  return path.slice(startDot, end);
}
function format(pathObject) {
  if (pathObject === null || typeof pathObject !== "object")
    throw TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
  return _format("/", pathObject);
}
function parse(path) {
  assertPath(path);
  var ret = { root: "", dir: "", base: "", ext: "", name: "" };
  if (path.length === 0)
    return ret;
  var code = path.charCodeAt(0), isAbsolute2 = code === 47, start;
  if (isAbsolute2)
    ret.root = "/", start = 1;
  else
    start = 0;
  var startDot = -1, startPart = 0, end = -1, matchedSlash = true, i = path.length - 1, preDotState = 0;
  for (;i >= start; --i) {
    if (code = path.charCodeAt(i), code === 47) {
      if (!matchedSlash) {
        startPart = i + 1;
        break;
      }
      continue;
    }
    if (end === -1)
      matchedSlash = false, end = i + 1;
    if (code === 46) {
      if (startDot === -1)
        startDot = i;
      else if (preDotState !== 1)
        preDotState = 1;
    } else if (startDot !== -1)
      preDotState = -1;
  }
  if (startDot === -1 || end === -1 || preDotState === 0 || preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
    if (end !== -1)
      if (startPart === 0 && isAbsolute2)
        ret.base = ret.name = path.slice(1, end);
      else
        ret.base = ret.name = path.slice(startPart, end);
  } else {
    if (startPart === 0 && isAbsolute2)
      ret.name = path.slice(1, startDot), ret.base = path.slice(1, end);
    else
      ret.name = path.slice(startPart, startDot), ret.base = path.slice(startPart, end);
    ret.ext = path.slice(startDot, end);
  }
  if (startPart > 0)
    ret.dir = path.slice(0, startPart - 1);
  else if (isAbsolute2)
    ret.dir = "/";
  return ret;
}
var sep = "/";
var delimiter = ":";
var posix = ((p) => (p.posix = p, p))({ resolve, normalize, isAbsolute, join, relative, _makeLong, dirname, basename, extname, format, parse, sep, delimiter, win32: null, posix: null });

// src/utils/imageProcessing.ts
var DEFAULT_DEVICE_SIZES = [
  640,
  750,
  828,
  1080,
  1200,
  1920,
  2048,
  3840
];
var DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
var DEFAULT_QUALITY = 75;
var OPTIMIZATION_ENDPOINT = "/_absolute/image";
var BLUR_DEVIATION = 20;
var snapToSize = (target, sizes) => {
  for (const size of sizes) {
    if (size >= target)
      return size;
  }
  return sizes[sizes.length - 1] ?? target;
};
var buildOptimizedUrl = (src, width, quality, basePath = OPTIMIZATION_ENDPOINT) => `${basePath}?url=${encodeURIComponent(src)}&w=${width}&q=${quality}`;
var generateBlurSvg = (base64Thumbnail) => {
  const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 320"><filter id="b" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="${BLUR_DEVIATION}"/><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1"/></filter><image filter="url(#b)" x="0" y="0" width="100%" height="100%" href="${base64Thumbnail}"/></svg>`;
  const encoded = encodeURIComponent(svg);
  return `url("data:image/svg+xml,${encoded}")`;
};
var generateSrcSet = (src, width, sizes, config, loader) => {
  const quality = config?.quality ?? DEFAULT_QUALITY;
  const basePath = config?.path ?? OPTIMIZATION_ENDPOINT;
  const buildUrl = loader ?? ((params) => buildOptimizedUrl(params.src, params.width, params.quality, basePath));
  if (sizes) {
    const allSizes = getAllSizes(config);
    return allSizes.map((sizeWidth) => `${buildUrl({ quality, src, width: sizeWidth })} ${sizeWidth}w`).join(", ");
  }
  if (width) {
    const allSizes = getAllSizes(config);
    const w1x = snapToSize(width, allSizes);
    const w2x = snapToSize(width * 2, allSizes);
    return `${buildUrl({ quality, src, width: w1x })} 1x, ${buildUrl({ quality, src, width: w2x })} 2x`;
  }
  const deviceSizes = config?.deviceSizes ?? DEFAULT_DEVICE_SIZES;
  return deviceSizes.map((sizeWidth) => `${buildUrl({ quality, src, width: sizeWidth })} ${sizeWidth}w`).join(", ");
};
var getAllSizes = (config) => {
  const device = config?.deviceSizes ?? DEFAULT_DEVICE_SIZES;
  const image = config?.imageSizes ?? DEFAULT_IMAGE_SIZES;
  return [...device, ...image].sort((left, right) => left - right);
};

// src/react/components/Image.tsx
import { jsxDEV as jsxDEV2, Fragment as Fragment2 } from "react/jsx-dev-runtime";
var resolveSource = (src, overrideSrc, unoptimized, loader, width, quality) => {
  if (overrideSrc)
    return overrideSrc;
  if (unoptimized)
    return src;
  if (loader)
    return loader({ quality, src, width: width ?? 0 });
  if (!width)
    return buildOptimizedUrl(src, 0, quality);
  return buildOptimizedUrl(src, width, quality);
};
var resolveBlurBackground = (hasBlur, placeholder, blurDataURL) => {
  if (!hasBlur)
    return;
  if (typeof placeholder === "string" && placeholder !== "blur" && placeholder.startsWith("data:")) {
    return generateBlurSvg(placeholder);
  }
  if (blurDataURL)
    return generateBlurSvg(blurDataURL);
  return;
};
var Image = ({
  alt,
  blurDataURL,
  className,
  crossOrigin,
  fetchPriority,
  fill,
  height,
  loader,
  loading,
  onError,
  onLoad,
  overrideSrc,
  placeholder,
  priority,
  quality = DEFAULT_QUALITY,
  referrerPolicy,
  sizes,
  src,
  style,
  unoptimized,
  width
}) => {
  const resolvedSrc = resolveSource(src, overrideSrc, unoptimized, loader, width, quality);
  const srcSet = unoptimized ? undefined : generateSrcSet(src, width, sizes, undefined, loader ?? undefined);
  const resolvedSizes = sizes ?? (fill ? "100vw" : undefined);
  const resolvedLoading = priority ? "eager" : loading ?? "lazy";
  const resolvedFetchPriority = priority ? "high" : fetchPriority;
  const hasBlur = placeholder === "blur" || typeof placeholder === "string" && placeholder !== "empty" && placeholder.startsWith("data:");
  const blurBackground = resolveBlurBackground(hasBlur, placeholder, blurDataURL);
  const imgStyle = {
    ...style ?? {},
    ...blurBackground ? {
      backgroundImage: blurBackground,
      backgroundPosition: "center",
      backgroundRepeat: "no-repeat",
      backgroundSize: "cover"
    } : {},
    ...fill ? {
      color: "transparent",
      height: "100%",
      inset: 0,
      objectFit: "cover",
      position: "absolute",
      width: "100%"
    } : { color: "transparent" }
  };
  const preloadLink = priority ? /* @__PURE__ */ jsxDEV2("link", {
    as: "image",
    crossOrigin,
    href: resolvedSrc,
    imageSizes: resolvedSizes,
    imageSrcSet: srcSet,
    rel: "preload"
  }, undefined, false, undefined, this) : null;
  const imgElement = /* @__PURE__ */ jsxDEV2("img", {
    alt,
    className,
    crossOrigin,
    decoding: "async",
    fetchPriority: resolvedFetchPriority,
    height: fill ? undefined : height,
    loading: resolvedLoading,
    onError: onError ? (event) => onError(event.nativeEvent) : undefined,
    onLoad: (event) => {
      const { target } = event;
      if (blurBackground && target instanceof HTMLImageElement) {
        target.style.backgroundImage = "none";
      }
      if (onLoad)
        onLoad(event.nativeEvent);
    },
    referrerPolicy,
    sizes: resolvedSizes,
    src: resolvedSrc,
    srcSet,
    style: imgStyle,
    width: fill ? undefined : width
  }, undefined, false, undefined, this);
  if (fill) {
    return /* @__PURE__ */ jsxDEV2(Fragment2, {
      children: [
        preloadLink,
        /* @__PURE__ */ jsxDEV2("span", {
          style: {
            display: "block",
            height: "100%",
            overflow: "hidden",
            position: "relative",
            width: "100%"
          },
          children: imgElement
        }, undefined, false, undefined, this)
      ]
    }, undefined, true, undefined, this);
  }
  return /* @__PURE__ */ jsxDEV2(Fragment2, {
    children: [
      preloadLink,
      imgElement
    ]
  }, undefined, true, undefined, this);
};
// src/react/components/JsonLd.tsx
import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
var JsonLd = ({
  schema
}) => {
  const schemaOrgContext = "https://schema.org";
  const data = Array.isArray(schema) ? schema.map((s) => ({
    "@context": schemaOrgContext,
    ...s
  })) : { "@context": schemaOrgContext, ...schema };
  return /* @__PURE__ */ jsxDEV3("script", {
    dangerouslySetInnerHTML: { __html: JSON.stringify(data) },
    type: "application/ld+json"
  }, undefined, false, undefined, this);
};
// src/core/streamingSlotRegistrar.ts
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
var getRegistrarGlobal = () => globalThis;
var registerStreamingSlot = (slot) => {
  getRegistrarGlobal()[STREAMING_SLOT_REGISTRAR_KEY]?.(slot);
};

// src/react/components/StreamSlot.tsx
import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
var StreamSlot = ({
  className,
  errorHtml,
  fallbackHtml = "",
  id,
  resolve: resolve2,
  timeoutMs
}) => {
  if (typeof window === "undefined") {
    registerStreamingSlot({
      errorHtml,
      fallbackHtml,
      id,
      resolve: resolve2,
      timeoutMs
    });
  }
  return /* @__PURE__ */ jsxDEV4("div", {
    className,
    dangerouslySetInnerHTML: { __html: fallbackHtml },
    "data-absolute-slot": "true",
    id: `slot-${id}`,
    suppressHydrationWarning: true
  }, undefined, false, undefined, this);
};

// src/react/components/SuspenseSlot.tsx
import { jsxDEV as jsxDEV5 } from "react/jsx-dev-runtime";
var SuspenseSlot = (props) => /* @__PURE__ */ jsxDEV5(StreamSlot, {
  ...props
}, undefined, false, undefined, this);
export {
  SuspenseSlot,
  StreamSlot,
  JsonLd,
  Image,
  Head
};
