import { j as t } from "../../../../../_virtual/jsx-runtime.js";
import { useState as u, useMemo as g } from "react";
import { a as f, b as x } from "../../../../sdk/dist/shared/chunk-EYPREFMH.js";
import "@sinclair/typebox";
import "../../../../sdk/dist/shared/chunk-UU2MSQXY.js";
import "../../../../sdk/dist/shared/chunk-T3LIA4YB.js";
import "../../../../sdk/dist/shared/chunk-YBGPPF7T.js";
import "../../../../sdk/dist/shared/chunk-UMHXXXVP.js";
import "../../../../sdk/dist/shared/chunk-5N6MBJJ4.js";
import "../../../../../node_modules/.pnpm/@formkit_auto-animate@0.8.2/node_modules/@formkit/auto-animate/index.js";
import "../../../../../node_modules/.pnpm/react-hot-toast@2.5.2_react-dom@18.3.0-canary-3d9b20132-20240124_react@18.3.0-canary-3d_c02c1e17bf76c343fd22d1f22394ecf5/node_modules/react-hot-toast/dist/index.js";
import { ScrollablePanelTab as i } from "./ScrollablePanelTab.js";
import { tx as a } from "../../../../style-system/dist/twind.js";
import o from "./AttributesSettingsView.js";
import { PanelBlockTitle as b } from "./PanelBlockTitle.js";
import { usePageAttributes as h, useSiteAttributes as d } from "../../../../../use-page-data.js";
import { Root as j, List as S, Trigger as l } from "../../../../../node_modules/.pnpm/@radix-ui_themes@3.1.4_@types_react-dom@18.3.6_@types_react@18.3.3__@types_react@18.3.3_46b1dabc193c5ff5696ee783983c694e/node_modules/@radix-ui/themes/dist/esm/components/tabs.js";
function q() {
  const [s, m] = u("page-settings"), e = s === "page-settings" ? f : x, n = h(), c = d(), r = g(() => ({
    ...e,
    properties: Object.fromEntries(
      Object.entries(e.properties).filter(([P, p]) => !p["ui:hidden"])
    )
  }), [e]);
  return /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col h-full", children: [
    /* @__PURE__ */ t.jsx(b, { children: "Settings" }),
    /* @__PURE__ */ t.jsxs(
      j,
      {
        defaultValue: s,
        onValueChange: m,
        className: "flex-grow flex flex-col h-dvh",
        children: [
          /* @__PURE__ */ t.jsxs(S, { size: "1", className: "sticky top-0 z-50 bg-gray-100", children: [
            /* @__PURE__ */ t.jsx(l, { value: "site-settings", className: a("!flex-1"), children: "Site" }),
            /* @__PURE__ */ t.jsx(l, { value: "page-settings", className: a("!flex-1"), children: "Current Page" })
          ] }),
          /* @__PURE__ */ t.jsx(i, { tab: "page-settings", children: /* @__PURE__ */ t.jsx(
            o,
            {
              type: "page",
              attributes: n,
              attributesSchema: r,
              title: "Page settings"
            }
          ) }),
          /* @__PURE__ */ t.jsx(i, { tab: "site-settings", children: /* @__PURE__ */ t.jsx(
            o,
            {
              type: "site",
              attributes: c,
              attributesSchema: r,
              title: "Site settings"
            }
          ) })
        ]
      }
    )
  ] });
}
export {
  q as default
};
//# sourceMappingURL=PanelAttributes.js.map
