PageSourceSearch

https://www.hamienet.com/assets/SystemSettings-BE6dCobQ.js

js hamienet.com collected 2026-10-02 05:02:20 UTC 8,306 bytes, 122 lines download raw bytes

1import { r as reactExports, j as jsxRuntimeExports, R as React } from "./vendor-react-Bay9Y7Lb.js";
2import RegionManager from "./RegionManager-CPU1lAIW.js";
3import TranslationManager from "./TranslationManager-B7c0Sg0H.js";
4import AdminSettings from "./AdminSettings-35H5SUoJ.js";
5import SocialSettings from "./SocialSettings-ADQAwuu5.js";
6import EmailSettings from "./EmailSettings-DRWNe2XQ.js";
7import AppearanceSettings from "./AppearanceSettings-1woTCeAo.js";
8import TrustScoreConfigPage from "./TrustScoreConfig-IIFCYa9Q.js";
9import CreditManager from "./CreditManager-BJML8BxY.js";
10import SubscriptionSettings from "./SubscriptionSettings-COU6ImTj.js";
11import SearchSettings from "./SearchSettings-B_107Tig.js";
12import BackupManager from "./BackupManager-C0vSVQLp.js";
13import AiSettings from "./AiSettings-CXu_UOCT.js";
14import { bn as Globe, e1 as Languages, e2 as Palette, cF as Key, e4 as Bot, c1 as Share2, aZ as Mail, e3 as Calculator, bq as Coins, bj as CreditCard, bf as Search, d$ as Archive, b9 as Settings, c_ as ChevronLeft, aY as TriangleAlert } from "./vendor-D0P4XgNj.js";
15import "./index-w5lXls15.js";
16import "./vendor-i18n-BC7ZMXWQ.js";
17import "./AdminShared-BP_vxG_A.js";
18import "./ai-B0Mlroaa.js";
19import "./vendor-ai-gQv1oOjO.js";
20import "./utils-CEVb7nN1.js";
21import "./UserAvatar-BQN4jlY-.js";
22import "./SpamConfigTabs-C-CN02Td.js";
23import "./credit-rules-8PgauDOD.js";
24class ErrorBoundary extends React.Component {
25  constructor(props) {
26    super(props);
27    this.state = { hasError: false, error: null, errorInfo: null };
28  }
29  static getDerivedStateFromError(error) {
30    return { hasError: true, error };
31  }
32  componentDidCatch(error, errorInfo) {
33    console.error("SystemSettings Crash:", error, errorInfo);
34    this.setState({ errorInfo });
35  }
36  render() {
37    var _a;
38    if (this.state.hasError) {
39      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-8 flex flex-col items-center justify-center text-center h-full", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-red-50 dark:bg-red-900/20 p-6 rounded-2xl border border-red-200 dark:border-red-800 max-w-2xl w-full", children: [
40        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-center mb-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-3 bg-red-100 dark:bg-red-900/30 rounded-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TriangleAlert, { size: 32, className: "text-red-600 dark:text-red-400" }) }) }),
41        /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-xl font-bold text-red-900 dark:text-red-200 mb-2", children: "Module Crash Detected" }),
42        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-red-700 dark:text-red-300 mb-4", children: "The selected settings module encountered an error and could not render." }),
43        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white dark:bg-black p-4 rounded-lg text-left overflow-auto max-h-60 border border-red-100 dark:border-red-900/50", children: [
44          /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: "text-xs font-mono text-red-800 dark:text-red-300 block mb-2", children: (_a = this.state.error) == null ? void 0 : _a.toString() }),
45          this.state.errorInfo && /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: "text-[10px] text-zinc-500 dark:text-zinc-500", children: this.state.errorInfo.componentStack })
46        ] }),
47        /* @__PURE__ */ jsxRuntimeExports.jsx(
48          "button",
49          {
50            onClick: () => this.setState({ hasError: false, error: null }),
51            className: "mt-6 px-6 py-2 bg-red-600 hover:bg-red-700 text-white rounded-lg font-bold text-sm transition-colors",
52            children: "Try Again"
53          }
54        )
55      ] }) });
56    }
57    return this.props.children;
58  }
59}
60const SystemSettings = ({ refreshTrigger, activeRole }) => {
61  const [activeTab, setActiveTab] = reactExports.useState("general");
62  const [isMobileMenuOpen, setIsMobileMenuOpen] = reactExports.useState(true);
63  const TABS = [
64    { id: "general", label: "Regions & Currencies", icon: Globe, component: RegionManager },
65    { id: "i18n", label: "Translations", icon: Languages, component: TranslationManager },
66    { id: "appearance", label: "Appearance", icon: Palette, component: AppearanceSettings },
67    { id: "roles", label: "Admin Roles", icon: Key, component: AdminSettings },
68    { id: "ai", label: "AI & Routing", icon: Bot, component: AiSettings },
69    { id: "social", label: "Social Login", icon: Share2, component: SocialSettings },
70    { id: "email", label: "Email SMTP", icon: Mail, component: EmailSettings },
71    { id: "trust", label: "Trust Algorithm", icon: Calculator, component: TrustScoreConfigPage },
72    { id: "credits", label: "Credit System", icon: Coins, component: CreditManager },
73    { id: "subscription", label: "Stripe & Supporter Tiers", icon: CreditCard, component: SubscriptionSettings },
74    { id: "search", label: "Search Intelligence", icon: Search, component: SearchSettings },
75    { id: "backup", label: "System Backups", icon: Archive, component: BackupManager }
76  ];
77  const ActiveComponent = reactExports.useMemo(() => {
78    const tab = TABS.find((t) => t.id === activeTab);
79    return tab ? tab.component : RegionManager;
80  }, [activeTab]);
81  const ComponentToRender = ActiveComponent;
82  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full min-h-0 flex-col lg:flex-row gap-6 animate-in fade-in", children: [
83    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `w-full lg:w-64 flex-shrink-0 flex flex-col gap-1 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 rounded-xl p-3 h-fit max-h-full overflow-y-auto shadow-sm custom-scrollbar ${!isMobileMenuOpen ? "hidden lg:flex" : "flex"}`, children: [
84      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-3 py-2 text-xs font-bold text-zinc-500 uppercase tracking-wider mb-1 flex items-center gap-2", children: [
85        /* @__PURE__ */ jsxRuntimeExports.jsx(Settings, { size: 12 }),
86        " Configuration"
87      ] }),
88      TABS.map((tab) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
89        "button",
90        {
91          onClick: () => {
92            setActiveTab(tab.id);
93            setIsMobileMenuOpen(false);
94          },
95          className: `flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition-all text-left ${activeTab === tab.id ? "bg-indigo-50 dark:bg-indigo-900/30 text-indigo-600 dark:text-indigo-400 font-bold" : "text-zinc-600 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800"}`,
96          children: [
97            /* @__PURE__ */ jsxRuntimeExports.jsx(tab.icon, { size: 18, className: activeTab === tab.id ? "text-indigo-600 dark:text-indigo-400" : "text-zinc-400" }),
98            tab.label
99          ]
100        },
101        tab.id
102      ))
103    ] }),
104    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `flex-1 min-w-0 h-full min-h-0 overflow-hidden flex flex-col ${isMobileMenuOpen ? "hidden lg:flex" : "flex"}`, children: [
105      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "lg:hidden pb-4 flex items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
106        "button",
107        {
108          onClick: () => setIsMobileMenuOpen(true),
109          className: "flex items-center gap-2 text-zinc-500 hover:text-zinc-900 dark:hover:text-white font-bold text-sm bg-zinc-100 dark:bg-zinc-800 px-3 py-1.5 rounded-lg transition-colors",
110          children: [
111            /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronLeft, { size: 16 }),
112            " Back to Menu"
113          ]
114        }
115      ) }),
116      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 relative min-h-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute inset-0 overflow-y-auto custom-scrollbar p-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { children: ComponentToRender ? /* @__PURE__ */ jsxRuntimeExports.jsx(ComponentToRender, { refreshTrigger, activeRole }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-10 text-center text-red-500", children: "Failed to load module." }) }, activeTab) }) })
117    ] })
118  ] });
119};
120export {
121  SystemSettings as default
122};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.