"use strict";
"use client";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var document_exports = {};
__export(document_exports, {
  Document: () => Document
});
module.exports = __toCommonJS(document_exports);
var import_jsx_runtime = require("react/jsx-runtime");
var import_css = require("@emotion/css");
var import_create_instance = __toESM(require("@emotion/server/create-instance"));
var import_document = __toESM(require("next/document"));
var import_root_style_registry = require("../runtimes/react/root-style-registry");
class Document extends import_document.default {
  static async getInitialProps(ctx) {
    const initialProps = await import_document.default.getInitialProps(ctx);
    const { extractCritical } = (0, import_create_instance.default)(import_css.cache);
    const { ids, css } = extractCritical(initialProps.html);
    return {
      ...initialProps,
      styles: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
        initialProps.styles,
        /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_root_style_registry.StyleTagSSR, { cacheKey: import_css.cache.key, classNames: ids, css })
      ] })
    };
  }
  render() {
    return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_document.Html, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_document.Head, {}),
      /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("body", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_document.Main, {}),
        /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_document.NextScript, {})
      ] })
    ] });
  }
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  Document
});
//# sourceMappingURL=document.js.map