import { c as createComponent, e as renderHead, r as renderTemplate, b as createAstro } from '../../chunks/astro/server_DrnzQWw3.mjs';
import 'kleur/colors';
import 'clsx';
/* empty css                                     */
import { i as isAdminAuthenticated } from '../../chunks/adminAuth_CY4OwU1a.mjs';
export { renderers } from '../../renderers.mjs';

const $$Astro = createAstro();
const $$Login = createComponent(($$result, $$props, $$slots) => {
  const Astro2 = $$result.createAstro($$Astro, $$props, $$slots);
  Astro2.self = $$Login;
  if (isAdminAuthenticated(Astro2)) {
    return Astro2.redirect("/admin/");
  }
  const error = Astro2.url.searchParams.has("error");
  return renderTemplate`<html lang="fa" dir="rtl"> <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>ورود ادمین | روس امروز</title><link rel="stylesheet" href="https://rc0.ir/vazirmatn/Vazirmatn-font-face.css">${renderHead()}</head> <body class="bg-gray-100 font-vazir text-gray-900 min-h-screen flex items-center justify-center p-4"> <form action="/api/admin/login" method="post" class="bg-white rounded-2xl shadow-sm p-6 w-full max-w-sm space-y-4"> <div> <span class="text-brand text-sm font-bold">روس امروز</span> <h1 class="text-2xl font-black mt-1">ورود ادمین</h1> </div> ${error && renderTemplate`<p class="bg-red-50 text-brand text-sm rounded-xl px-3 py-2">نام کاربری یا رمز عبور اشتباه است.</p>`} <label class="block text-sm font-bold">
نام کاربری
<input name="username" value="admin" class="mt-2 w-full bg-gray-100 rounded-xl px-4 py-3 outline-none focus:ring-1 focus:ring-brand"> </label> <label class="block text-sm font-bold">
رمز عبور
<input name="password" type="password" placeholder="admin123" class="mt-2 w-full bg-gray-100 rounded-xl px-4 py-3 outline-none focus:ring-1 focus:ring-brand"> </label> <button class="w-full bg-brand text-white rounded-xl py-3 font-bold hover:bg-red-700 transition-colors">ورود</button> <p class="text-xs text-gray-400 leading-6">پیش‌فرض: \`admin\` / \`admin123\`؛ برای production از \`ADMIN_USER\` و \`ADMIN_PASSWORD\` استفاده کنید.</p> </form> </body></html>`;
}, "/Users/drfelfel/ruseemrooz/src/pages/admin/login.astro", void 0);

const $$file = "/Users/drfelfel/ruseemrooz/src/pages/admin/login.astro";
const $$url = "/admin/login";

const _page = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
  __proto__: null,
  default: $$Login,
  file: $$file,
  url: $$url
}, Symbol.toStringTag, { value: 'Module' }));

const page = () => _page;

export { page };
