import { jsxs as f, jsx as e } from "react/jsx-runtime";
import { Box as p } from "@mui/material";
import { useSize as m, useCreation as a } from "ahooks";
import { useRef as c } from "react";
import d from "@arcblock/react-hooks/lib/useBrowser";
import x from "./powered-by.js";
import u from "./app-info-item.js";
import b from "./app-icon.js";
import { hexToRgba as h, getDIDColor as w } from "../Util/index.js";
import { mergeSx as g } from "../Util/style.js";
import { DID_CONNECT_MEDIUM_WIDTH as I } from "../Util/constant.js";
function N({
  currentAppInfo: r = globalThis.blocklet,
  currentAppColor: n = globalThis.blocklet?.appPid ? w(globalThis.blocklet?.appPid) : "#fff",
  sx: s = {}
}) {
  const l = d(), t = c(null), o = m(t), i = a(() => o ? o.width < I - 50 : !0, [o, o?.width]);
  return /* @__PURE__ */ f(
    p,
    {
      ref: t,
      sx: g(
        {
          display: "flex",
          justifyContent: "space-between",
          alignItems: "center",
          gap: 1,
          fontSize: 12,
          backgroundColor: h(n, 0.08),
          // 需要保持跟 .did-connect__root 的规则一样
          mx: i ? -2 : -3,
          // eslint-disable-next-line no-nested-ternary
          px: i ? l.arcSphere ? 1 : 2 : 3,
          py: 1.5,
          // HACK: 极限条件下，footer 会溢出，使用隐藏的滚动条来处理这种情况（屏幕宽度小于 360 时会出现）
          overflow: "auto",
          "&::-webkit-scrollbar": {
            display: "none"
            // 隐藏滚动条 (Webkit 浏览器)
          },
          "-ms-overflow-style": "none",
          // 隐藏滚动条 (IE 浏览器)
          "scrollbar-width": "none"
          // 隐藏滚动条 (Firefox)
        },
        s
      ),
      className: "did-connect__footer",
      children: [
        /* @__PURE__ */ e(
          u,
          {
            appInfo: r,
            appLogo: /* @__PURE__ */ e(b, { appInfo: r, size: 24, sx: { flexShrink: 0 } }),
            sx: {
              flex: 1,
              overflow: "hidden"
            }
          }
        ),
        /* @__PURE__ */ e(x, { sx: { maxWidth: "100%", justifyContent: "end" } })
      ]
    }
  );
}
export {
  N as default
};
