import { QueryClientProvider, queryOptions, QueryClient } from "@tanstack/react-query";
import { Link, createRootRouteWithContext, useRouter, useRouterState, Outlet, HeadContent, Scripts, createFileRoute, lazyRouteComponent, redirect, notFound, createRouter } from "@tanstack/react-router";
import { jsx, jsxs } from "react/jsx-runtime";
import { useState, useEffect } from "react";
import { Toaster as Toaster$1 } from "sonner";
import { X, Menu, Phone } from "lucide-react";
import { s as supabase } from "./client-P40JY-SL.js";
const Toaster = ({ ...props }) => {
  return /* @__PURE__ */ jsx(
    Toaster$1,
    {
      className: "toaster group",
      toastOptions: {
        classNames: {
          toast: "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
          description: "group-[.toast]:text-muted-foreground",
          actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
          cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"
        }
      },
      ...props
    }
  );
};
const nav = [
  { to: "/", label: "Home" },
  { to: "/projects", label: "Projects" },
  { to: "/about", label: "About" },
  { to: "/blog", label: "Journal" },
  { to: "/contact", label: "Contact" }
];
function SiteHeader() {
  const [open, setOpen] = useState(false);
  return /* @__PURE__ */ jsxs("nav", { className: "sticky top-0 z-40 border-b border-navy/5 bg-ivory/95 backdrop-blur-md", children: [
    /* @__PURE__ */ jsxs("div", { className: "mx-auto flex max-w-7xl items-center justify-between px-6 py-4", children: [
      /* @__PURE__ */ jsx(Link, { to: "/", className: "font-display text-2xl font-extrabold uppercase tracking-tighter text-navy", children: "Bridgefield" }),
      /* @__PURE__ */ jsx("div", { className: "hidden gap-8 text-[11px] font-medium uppercase tracking-[0.2em] md:flex", children: nav.map((n) => /* @__PURE__ */ jsx(
        Link,
        {
          to: n.to,
          className: "text-navy transition-colors hover:text-gold",
          activeProps: { className: "text-gold" },
          activeOptions: { exact: n.to === "/" },
          children: n.label
        },
        n.to
      )) }),
      /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
        /* @__PURE__ */ jsx(
          Link,
          {
            to: "/contact",
            className: "hidden bg-navy px-6 py-2.5 text-[10px] font-bold uppercase tracking-widest text-ivory transition-colors hover:bg-gold hover:text-navy md:inline-block",
            children: "Inquire"
          }
        ),
        /* @__PURE__ */ jsx(
          "button",
          {
            "aria-label": "Toggle menu",
            onClick: () => setOpen((o) => !o),
            className: "rounded p-2 text-navy md:hidden",
            children: open ? /* @__PURE__ */ jsx(X, { size: 20 }) : /* @__PURE__ */ jsx(Menu, { size: 20 })
          }
        )
      ] })
    ] }),
    open && /* @__PURE__ */ jsx("div", { className: "border-t border-navy/5 bg-ivory md:hidden", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 px-6 py-4", children: [
      nav.map((n) => /* @__PURE__ */ jsx(
        Link,
        {
          to: n.to,
          onClick: () => setOpen(false),
          className: "py-3 text-sm font-medium uppercase tracking-wider text-navy",
          children: n.label
        },
        n.to
      )),
      /* @__PURE__ */ jsx(
        Link,
        {
          to: "/contact",
          onClick: () => setOpen(false),
          className: "mt-2 bg-navy px-6 py-3 text-center text-[10px] font-bold uppercase tracking-widest text-ivory",
          children: "Inquire"
        }
      )
    ] }) })
  ] });
}
const SITE = {
  phone: "+971 58 590 5139",
  whatsapp: "971585905139",
  email: "info@bridgefieldproerties.ae",
  address: "Dubai, United Arab Emirates",
  hours: "Mon – Sat, 9:00 AM – 7:00 PM (GST)",
  whatsappMessage: "Hi Bridgefield Properties, I'm interested in townhouses and villas in Dubai. Please share available options."
};
const whatsappHref = (msg = SITE.whatsappMessage) => `https://wa.me/${SITE.whatsapp}?text=${encodeURIComponent(msg)}`;
function SiteFooter() {
  return /* @__PURE__ */ jsx("footer", { className: "border-t border-white/5 bg-navy px-6 py-16 text-ivory/60", children: /* @__PURE__ */ jsxs("div", { className: "mx-auto max-w-7xl", children: [
    /* @__PURE__ */ jsxs("div", { className: "mb-16 grid gap-12 md:grid-cols-4", children: [
      /* @__PURE__ */ jsxs("div", { className: "md:col-span-2", children: [
        /* @__PURE__ */ jsx("div", { className: "mb-6 font-display text-3xl font-extrabold uppercase tracking-tighter text-white", children: "Bridgefield" }),
        /* @__PURE__ */ jsx("p", { className: "max-w-xs text-xs leading-relaxed", children: "Bespoke real estate advisory helping local and international buyers acquire premium townhouses and villas across Dubai's most prestigious communities." })
      ] }),
      /* @__PURE__ */ jsxs("div", { children: [
        /* @__PURE__ */ jsx("h5", { className: "mb-6 text-[10px] font-bold uppercase tracking-widest text-white", children: "Explore" }),
        /* @__PURE__ */ jsxs("ul", { className: "space-y-4 text-xs", children: [
          /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/projects", className: "hover:text-gold", children: "Projects" }) }),
          /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/about", className: "hover:text-gold", children: "About" }) }),
          /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/blog", className: "hover:text-gold", children: "Journal" }) }),
          /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { to: "/contact", className: "hover:text-gold", children: "Contact" }) })
        ] })
      ] }),
      /* @__PURE__ */ jsxs("div", { children: [
        /* @__PURE__ */ jsx("h5", { className: "mb-6 text-[10px] font-bold uppercase tracking-widest text-white", children: "Connect" }),
        /* @__PURE__ */ jsxs("ul", { className: "space-y-4 text-xs", children: [
          /* @__PURE__ */ jsx("li", { children: SITE.address }),
          /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("a", { href: `tel:${SITE.phone.replace(/\s+/g, "")}`, className: "hover:text-gold", children: SITE.phone }) }),
          /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("a", { href: `mailto:${SITE.email}`, className: "hover:text-gold", children: SITE.email }) })
        ] })
      ] })
    ] }),
    /* @__PURE__ */ jsxs("div", { className: "flex flex-col justify-between gap-4 border-t border-white/5 pt-8 text-[9px] uppercase tracking-widest md:flex-row", children: [
      /* @__PURE__ */ jsxs("p", { children: [
        "© ",
        (/* @__PURE__ */ new Date()).getFullYear(),
        " Bridgefield Properties. All rights reserved."
      ] }),
      /* @__PURE__ */ jsx("div", { className: "flex gap-6", children: /* @__PURE__ */ jsx(Link, { to: "/admin", className: "hover:text-gold", children: "Admin" }) })
    ] })
  ] }) });
}
function FloatingContacts() {
  return /* @__PURE__ */ jsxs("div", { className: "fixed bottom-6 right-6 z-50 flex flex-col gap-3", children: [
    /* @__PURE__ */ jsx(
      "a",
      {
        href: `tel:${SITE.phone.replace(/\s+/g, "")}`,
        "aria-label": "Call Bridgefield Properties",
        className: "grid size-12 place-items-center border border-navy/5 bg-white text-navy shadow-lg transition-all hover:bg-ivory md:hidden",
        children: /* @__PURE__ */ jsx(Phone, { size: 18 })
      }
    ),
    /* @__PURE__ */ jsx(
      "a",
      {
        href: whatsappHref(),
        target: "_blank",
        rel: "noopener noreferrer",
        "aria-label": "Chat on WhatsApp",
        className: "grid size-12 place-items-center bg-[#25D366] text-white shadow-lg transition-transform hover:scale-105",
        children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: "size-6", fill: "currentColor", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347M12.05 21.785h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z" }) })
      }
    )
  ] });
}
const appCss = "/assets/styles-DbUeFo4c.css";
function reportLovableError(error, context = {}) {
  if (typeof window === "undefined") return;
  window.__lovableEvents?.captureException?.(
    error,
    {
      source: "react_error_boundary",
      route: window.location.pathname,
      ...context
    },
    {
      mechanism: "react_error_boundary",
      handled: false,
      severity: "error"
    }
  );
}
function NotFoundComponent() {
  return /* @__PURE__ */ jsx("div", { className: "flex min-h-screen items-center justify-center bg-ivory px-4", children: /* @__PURE__ */ jsxs("div", { className: "max-w-md text-center", children: [
    /* @__PURE__ */ jsx("h1", { className: "font-display text-7xl font-extrabold text-navy", children: "404" }),
    /* @__PURE__ */ jsx("h2", { className: "mt-4 text-xl font-semibold text-navy", children: "Page not found" }),
    /* @__PURE__ */ jsx("p", { className: "mt-2 text-sm text-navy/60", children: "The page you're looking for doesn't exist or has moved." }),
    /* @__PURE__ */ jsx(
      Link,
      {
        to: "/",
        className: "mt-6 inline-block bg-navy px-6 py-3 text-[10px] font-bold uppercase tracking-widest text-ivory hover:bg-gold hover:text-navy",
        children: "Back home"
      }
    )
  ] }) });
}
function ErrorComponent({ error, reset }) {
  const router2 = useRouter();
  useEffect(() => {
    reportLovableError(error, { boundary: "tanstack_root_error_component" });
  }, [error]);
  return /* @__PURE__ */ jsx("div", { className: "flex min-h-screen items-center justify-center bg-ivory px-4", children: /* @__PURE__ */ jsxs("div", { className: "max-w-md text-center", children: [
    /* @__PURE__ */ jsx("h1", { className: "font-display text-xl font-semibold text-navy", children: "Something went wrong" }),
    /* @__PURE__ */ jsx("p", { className: "mt-2 text-sm text-navy/60", children: "Try again or head back home." }),
    /* @__PURE__ */ jsxs("div", { className: "mt-6 flex flex-wrap justify-center gap-2", children: [
      /* @__PURE__ */ jsx(
        "button",
        {
          onClick: () => {
            router2.invalidate();
            reset();
          },
          className: "bg-navy px-6 py-3 text-[10px] font-bold uppercase tracking-widest text-ivory hover:bg-gold hover:text-navy",
          children: "Try again"
        }
      ),
      /* @__PURE__ */ jsx("a", { href: "/", className: "border border-navy/15 px-6 py-3 text-[10px] font-bold uppercase tracking-widest text-navy", children: "Go home" })
    ] })
  ] }) });
}
const Route$e = createRootRouteWithContext()({
  head: () => ({
    meta: [
      { charSet: "utf-8" },
      { name: "viewport", content: "width=device-width, initial-scale=1" },
      { title: "Bridgefield Properties Dubai | Townhouses & Villas for Sale" },
      { name: "description", content: "Explore premium townhouses and villas for sale in Dubai with Bridgefield Properties. Off-plan projects, flexible payment plans, and expert property guidance." },
      { name: "author", content: "Bridgefield Properties" },
      { property: "og:site_name", content: "Bridgefield Properties" },
      { property: "og:type", content: "website" },
      { name: "twitter:card", content: "summary_large_image" },
      { name: "theme-color", content: "#0f1b3d" },
      { property: "og:title", content: "Bridgefield Properties Dubai | Townhouses & Villas for Sale" },
      { name: "twitter:title", content: "Bridgefield Properties Dubai | Townhouses & Villas for Sale" },
      { property: "og:description", content: "Explore premium townhouses and villas for sale in Dubai with Bridgefield Properties. Off-plan projects, flexible payment plans, and expert property guidance." },
      { name: "twitter:description", content: "Explore premium townhouses and villas for sale in Dubai with Bridgefield Properties. Off-plan projects, flexible payment plans, and expert property guidance." },
      { property: "og:image", content: "https://storage.googleapis.com/gpt-engineer-file-uploads/5BnDMoE0wfauY6Cy7HR751FWAWI3/social-images/social-1781167800428-ChatGPT_Image_Jun_5,_2026,_01_12_21_PM.webp" },
      { name: "twitter:image", content: "https://storage.googleapis.com/gpt-engineer-file-uploads/5BnDMoE0wfauY6Cy7HR751FWAWI3/social-images/social-1781167800428-ChatGPT_Image_Jun_5,_2026,_01_12_21_PM.webp" }
    ],
    links: [
      { rel: "stylesheet", href: appCss },
      { rel: "preconnect", href: "https://fonts.googleapis.com" },
      { rel: "preconnect", href: "https://fonts.gstatic.com", crossOrigin: "anonymous" },
      { rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=Epilogue:wght@400;500;600&family=Urbanist:wght@500;600;700;800&display=swap" }
    ],
    scripts: [{
      type: "application/ld+json",
      children: JSON.stringify({
        "@context": "https://schema.org",
        "@type": "RealEstateAgent",
        "name": "Bridgefield Properties",
        "description": "Premium townhouses and villas for sale in Dubai",
        "areaServed": "Dubai, United Arab Emirates",
        "telephone": "+971585905139",
        "address": { "@type": "PostalAddress", "addressLocality": "Dubai", "addressCountry": "AE" }
      })
    }]
  }),
  shellComponent: RootShell,
  component: RootComponent,
  notFoundComponent: NotFoundComponent,
  errorComponent: ErrorComponent
});
function RootShell({ children }) {
  return /* @__PURE__ */ jsxs("html", { lang: "en", children: [
    /* @__PURE__ */ jsx("head", { children: /* @__PURE__ */ jsx(HeadContent, {}) }),
    /* @__PURE__ */ jsxs("body", { children: [
      children,
      /* @__PURE__ */ jsx(Scripts, {})
    ] })
  ] });
}
function RootComponent() {
  const { queryClient } = Route$e.useRouteContext();
  const pathname = useRouterState({ select: (s) => s.location.pathname });
  const isAdmin = pathname.startsWith("/admin") || pathname.startsWith("/auth");
  return /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxs("div", { className: "flex min-h-screen flex-col bg-ivory text-navy", children: [
    !isAdmin && /* @__PURE__ */ jsx(SiteHeader, {}),
    /* @__PURE__ */ jsx("main", { className: "flex-1", children: /* @__PURE__ */ jsx(Outlet, {}) }),
    !isAdmin && /* @__PURE__ */ jsx(SiteFooter, {}),
    !isAdmin && /* @__PURE__ */ jsx(FloatingContacts, {}),
    /* @__PURE__ */ jsx(Toaster, { richColors: true, position: "top-center" })
  ] }) });
}
const BASE_URL = "";
const Route$d = createFileRoute("/sitemap.xml")({
  server: {
    handlers: {
      GET: async () => {
        const { createClient } = await import("@supabase/supabase-js");
        const url = process.env.SUPABASE_URL;
        const key = process.env.SUPABASE_PUBLISHABLE_KEY;
        const sb = createClient(url, key);
        const [{ data: projects }, { data: blogs }] = await Promise.all([
          sb.from("projects").select("slug,updated_at").eq("published", true),
          sb.from("blog_posts").select("slug,updated_at").eq("published", true)
        ]);
        const entries = [
          { path: "/", changefreq: "weekly", priority: "1.0" },
          { path: "/projects", changefreq: "weekly", priority: "0.9" },
          { path: "/about", changefreq: "monthly", priority: "0.6" },
          { path: "/contact", changefreq: "monthly", priority: "0.6" },
          { path: "/blog", changefreq: "weekly", priority: "0.8" },
          ...(projects ?? []).map((p) => ({ path: `/projects/${p.slug}`, lastmod: p.updated_at, changefreq: "weekly", priority: "0.8" })),
          ...(blogs ?? []).map((b) => ({ path: `/blog/${b.slug}`, lastmod: b.updated_at, changefreq: "monthly", priority: "0.7" }))
        ];
        const xml = `<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
${entries.map(
          (e) => `  <url>
    <loc>${BASE_URL}${e.path}</loc>
${e.lastmod ? `    <lastmod>${e.lastmod}</lastmod>
` : ""}${e.changefreq ? `    <changefreq>${e.changefreq}</changefreq>
` : ""}${e.priority ? `    <priority>${e.priority}</priority>
` : ""}  </url>`
        ).join("\n")}
</urlset>`;
        return new Response(xml, { headers: { "Content-Type": "application/xml", "Cache-Control": "public, max-age=3600" } });
      }
    }
  }
});
const q$3 = queryOptions({
  queryKey: ["projects-all"],
  queryFn: async () => {
    const {
      data
    } = await supabase.from("projects").select("slug,name,location,starting_price,bedrooms,handover_status,payment_plan,property_type,cover_image").eq("published", true).order("display_order", {
      ascending: true
    });
    return data ?? [];
  }
});
const $$splitNotFoundComponentImporter$4 = () => import("./projects-C-aKnOYL.js");
const $$splitErrorComponentImporter$4 = () => import("./projects-CS2bRMVy.js");
const $$splitComponentImporter$c = () => import("./projects-DfLWmZsc.js");
const Route$c = createFileRoute("/projects")({
  loader: ({
    context
  }) => context.queryClient.ensureQueryData(q$3),
  head: () => ({
    meta: [{
      title: "Dubai Townhouse & Villa Projects | Bridgefield Properties"
    }, {
      name: "description",
      content: "Browse off-plan and ready townhouse and villa projects across Dubai's most prestigious communities."
    }, {
      property: "og:title",
      content: "Dubai Townhouse & Villa Projects | Bridgefield Properties"
    }, {
      property: "og:description",
      content: "Browse off-plan and ready townhouse and villa projects across Dubai."
    }, {
      property: "og:url",
      content: "/projects"
    }],
    links: [{
      rel: "canonical",
      href: "/projects"
    }]
  }),
  component: lazyRouteComponent($$splitComponentImporter$c, "component"),
  errorComponent: lazyRouteComponent($$splitErrorComponentImporter$4, "errorComponent"),
  notFoundComponent: lazyRouteComponent($$splitNotFoundComponentImporter$4, "notFoundComponent")
});
const $$splitComponentImporter$b = () => import("./contact-C5WRxXTY.js");
const Route$b = createFileRoute("/contact")({
  head: () => ({
    meta: [{
      title: "Contact Bridgefield Properties | Dubai Property Advisors"
    }, {
      name: "description",
      content: "Speak with a Dubai property advisor. Phone, WhatsApp, and email contact for Bridgefield Properties."
    }, {
      property: "og:title",
      content: "Contact Bridgefield Properties"
    }, {
      property: "og:description",
      content: "Speak with a Dubai property advisor today."
    }, {
      property: "og:url",
      content: "/contact"
    }],
    links: [{
      rel: "canonical",
      href: "/contact"
    }]
  }),
  component: lazyRouteComponent($$splitComponentImporter$b, "component")
});
const q$2 = queryOptions({
  queryKey: ["blog-list"],
  queryFn: async () => {
    const {
      data
    } = await supabase.from("blog_posts").select("slug,title,excerpt,category,cover_image,published_at").eq("published", true).order("published_at", {
      ascending: false
    });
    return data ?? [];
  }
});
const $$splitNotFoundComponentImporter$3 = () => import("./blog-C-aKnOYL.js");
const $$splitErrorComponentImporter$3 = () => import("./blog-CS2bRMVy.js");
const $$splitComponentImporter$a = () => import("./blog-DH2c1m5k.js");
const Route$a = createFileRoute("/blog")({
  loader: ({
    context
  }) => context.queryClient.ensureQueryData(q$2),
  head: () => ({
    meta: [{
      title: "Dubai Real Estate Journal | Bridgefield Properties"
    }, {
      name: "description",
      content: "Insights, buyer guides, and market analysis on Dubai townhouses, villas, and off-plan investment."
    }, {
      property: "og:title",
      content: "Dubai Real Estate Journal"
    }, {
      property: "og:description",
      content: "Insights, guides, and market analysis on Dubai property."
    }, {
      property: "og:url",
      content: "/blog"
    }],
    links: [{
      rel: "canonical",
      href: "/blog"
    }]
  }),
  component: lazyRouteComponent($$splitComponentImporter$a, "component"),
  errorComponent: lazyRouteComponent($$splitErrorComponentImporter$3, "errorComponent"),
  notFoundComponent: lazyRouteComponent($$splitNotFoundComponentImporter$3, "notFoundComponent")
});
const $$splitComponentImporter$9 = () => import("./auth-WfRLsJKK.js");
const Route$9 = createFileRoute("/auth")({
  head: () => ({
    meta: [{
      title: "Admin Sign In | Bridgefield Properties"
    }, {
      name: "robots",
      content: "noindex"
    }]
  }),
  component: lazyRouteComponent($$splitComponentImporter$9, "component")
});
const $$splitComponentImporter$8 = () => import("./about-DWygv_WO.js");
const Route$8 = createFileRoute("/about")({
  head: () => ({
    meta: [{
      title: "About Bridgefield Properties | Dubai Real Estate Advisors"
    }, {
      name: "description",
      content: "Bridgefield Properties is a Dubai-based real estate advisory specialising in townhouses and villas for local and international buyers."
    }, {
      property: "og:title",
      content: "About Bridgefield Properties"
    }, {
      property: "og:description",
      content: "Dubai-based real estate advisory specialising in townhouses and villas."
    }, {
      property: "og:url",
      content: "/about"
    }],
    links: [{
      rel: "canonical",
      href: "/about"
    }]
  }),
  component: lazyRouteComponent($$splitComponentImporter$8, "component")
});
const $$splitComponentImporter$7 = () => import("./_authenticated-BQUgtBtn.js");
const Route$7 = createFileRoute("/_authenticated")({
  ssr: false,
  beforeLoad: async () => {
    const {
      data,
      error
    } = await supabase.auth.getUser();
    if (error || !data.user) throw redirect({
      to: "/auth"
    });
    return {
      user: data.user
    };
  },
  component: lazyRouteComponent($$splitComponentImporter$7, "component")
});
const homeData = queryOptions({
  queryKey: ["home-data"],
  queryFn: async () => {
    const [projects, blogs] = await Promise.all([supabase.from("projects").select("slug,name,location,starting_price,bedrooms,handover_status,payment_plan,property_type,cover_image,featured").eq("published", true).order("display_order", {
      ascending: true
    }).limit(6), supabase.from("blog_posts").select("slug,title,excerpt,category,cover_image,published_at").eq("published", true).order("published_at", {
      ascending: false
    }).limit(2)]);
    return {
      projects: projects.data ?? [],
      blogs: blogs.data ?? []
    };
  }
});
const $$splitNotFoundComponentImporter$2 = () => import("./index-C-aKnOYL.js");
const $$splitErrorComponentImporter$2 = () => import("./index-DQHWP8Hr.js");
const $$splitComponentImporter$6 = () => import("./index-kE4EPmUv.js");
const Route$6 = createFileRoute("/")({
  loader: ({
    context
  }) => context.queryClient.ensureQueryData(homeData),
  head: () => ({
    meta: [{
      title: "Bridgefield Properties Dubai | Townhouses & Villas for Sale"
    }, {
      name: "description",
      content: "Explore premium townhouses and villas for sale in Dubai with Bridgefield Properties. Discover off-plan projects, investment opportunities, flexible payment plans, and expert property guidance."
    }, {
      name: "keywords",
      content: "Dubai townhouses for sale, villas for sale in Dubai, off plan townhouses Dubai, off plan villas Dubai, Dubai real estate investment, Bridgefield Properties"
    }, {
      property: "og:title",
      content: "Bridgefield Properties Dubai | Townhouses & Villas for Sale"
    }, {
      property: "og:description",
      content: "Premium townhouses and villas for sale in Dubai. Off-plan projects, flexible payment plans, expert advisory."
    }, {
      property: "og:url",
      content: "/"
    }],
    links: [{
      rel: "canonical",
      href: "/"
    }]
  }),
  component: lazyRouteComponent($$splitComponentImporter$6, "component"),
  errorComponent: lazyRouteComponent($$splitErrorComponentImporter$2, "errorComponent"),
  notFoundComponent: lazyRouteComponent($$splitNotFoundComponentImporter$2, "notFoundComponent")
});
const q$1 = (slug) => queryOptions({
  queryKey: ["project", slug],
  queryFn: async () => {
    const {
      data,
      error
    } = await supabase.from("projects").select("*").eq("slug", slug).eq("published", true).maybeSingle();
    if (error) throw error;
    if (!data) throw notFound();
    return data;
  }
});
const $$splitNotFoundComponentImporter$1 = () => import("./projects._slug-CCDQscQS.js");
const $$splitErrorComponentImporter$1 = () => import("./projects._slug-CS2bRMVy.js");
const $$splitComponentImporter$5 = () => import("./projects._slug-DAx1s6qA.js");
const Route$5 = createFileRoute("/projects/$slug")({
  loader: ({
    context,
    params
  }) => context.queryClient.ensureQueryData(q$1(params.slug)),
  head: ({
    params,
    loaderData
  }) => {
    const p = loaderData;
    const title = p?.meta_title || `${p?.name ?? "Project"} — ${p?.location ?? "Dubai"} | Bridgefield Properties`;
    const desc = p?.meta_description || p?.short_description || "Explore this premium Dubai community.";
    return {
      meta: [{
        title
      }, {
        name: "description",
        content: desc
      }, {
        property: "og:title",
        content: title
      }, {
        property: "og:description",
        content: desc
      }, {
        property: "og:type",
        content: "article"
      }, {
        property: "og:url",
        content: `/projects/${params.slug}`
      }],
      links: [{
        rel: "canonical",
        href: `/projects/${params.slug}`
      }]
    };
  },
  component: lazyRouteComponent($$splitComponentImporter$5, "component"),
  errorComponent: lazyRouteComponent($$splitErrorComponentImporter$1, "errorComponent"),
  notFoundComponent: lazyRouteComponent($$splitNotFoundComponentImporter$1, "notFoundComponent")
});
const q = (slug) => queryOptions({
  queryKey: ["blog", slug],
  queryFn: async () => {
    const {
      data,
      error
    } = await supabase.from("blog_posts").select("*").eq("slug", slug).eq("published", true).maybeSingle();
    if (error) throw error;
    if (!data) throw notFound();
    return data;
  }
});
const $$splitNotFoundComponentImporter = () => import("./blog._slug-C7NxYBFI.js");
const $$splitErrorComponentImporter = () => import("./blog._slug-CS2bRMVy.js");
const $$splitComponentImporter$4 = () => import("./blog._slug-8n1CBmJm.js");
const Route$4 = createFileRoute("/blog/$slug")({
  loader: ({
    context,
    params
  }) => context.queryClient.ensureQueryData(q(params.slug)),
  head: ({
    params,
    loaderData
  }) => {
    const b = loaderData;
    return {
      meta: [{
        title: b?.meta_title || `${b?.title ?? "Article"} | Bridgefield Properties`
      }, {
        name: "description",
        content: b?.meta_description || b?.excerpt || ""
      }, {
        property: "og:title",
        content: b?.title ?? "Article"
      }, {
        property: "og:description",
        content: b?.excerpt ?? ""
      }, {
        property: "og:type",
        content: "article"
      }, {
        property: "og:url",
        content: `/blog/${params.slug}`
      }],
      links: [{
        rel: "canonical",
        href: `/blog/${params.slug}`
      }]
    };
  },
  component: lazyRouteComponent($$splitComponentImporter$4, "component"),
  errorComponent: lazyRouteComponent($$splitErrorComponentImporter, "errorComponent"),
  notFoundComponent: lazyRouteComponent($$splitNotFoundComponentImporter, "notFoundComponent")
});
const $$splitComponentImporter$3 = () => import("./_authenticated.admin.index-SHrXG865.js");
const Route$3 = createFileRoute("/_authenticated/admin/")({
  component: lazyRouteComponent($$splitComponentImporter$3, "component")
});
const $$splitComponentImporter$2 = () => import("./_authenticated.admin.projects-BSTYRajr.js");
const Route$2 = createFileRoute("/_authenticated/admin/projects")({
  component: lazyRouteComponent($$splitComponentImporter$2, "component")
});
const $$splitComponentImporter$1 = () => import("./_authenticated.admin.leads-DQpu13t3.js");
const Route$1 = createFileRoute("/_authenticated/admin/leads")({
  component: lazyRouteComponent($$splitComponentImporter$1, "component")
});
const $$splitComponentImporter = () => import("./_authenticated.admin.blogs-BYhyAirx.js");
const Route = createFileRoute("/_authenticated/admin/blogs")({
  component: lazyRouteComponent($$splitComponentImporter, "component")
});
const SitemapDotxmlRoute = Route$d.update({
  id: "/sitemap.xml",
  path: "/sitemap.xml",
  getParentRoute: () => Route$e
});
const ProjectsRoute = Route$c.update({
  id: "/projects",
  path: "/projects",
  getParentRoute: () => Route$e
});
const ContactRoute = Route$b.update({
  id: "/contact",
  path: "/contact",
  getParentRoute: () => Route$e
});
const BlogRoute = Route$a.update({
  id: "/blog",
  path: "/blog",
  getParentRoute: () => Route$e
});
const AuthRoute = Route$9.update({
  id: "/auth",
  path: "/auth",
  getParentRoute: () => Route$e
});
const AboutRoute = Route$8.update({
  id: "/about",
  path: "/about",
  getParentRoute: () => Route$e
});
const AuthenticatedRoute = Route$7.update({
  id: "/_authenticated",
  getParentRoute: () => Route$e
});
const IndexRoute = Route$6.update({
  id: "/",
  path: "/",
  getParentRoute: () => Route$e
});
const ProjectsSlugRoute = Route$5.update({
  id: "/$slug",
  path: "/$slug",
  getParentRoute: () => ProjectsRoute
});
const BlogSlugRoute = Route$4.update({
  id: "/$slug",
  path: "/$slug",
  getParentRoute: () => BlogRoute
});
const AuthenticatedAdminIndexRoute = Route$3.update({
  id: "/admin/",
  path: "/admin/",
  getParentRoute: () => AuthenticatedRoute
});
const AuthenticatedAdminProjectsRoute = Route$2.update({
  id: "/admin/projects",
  path: "/admin/projects",
  getParentRoute: () => AuthenticatedRoute
});
const AuthenticatedAdminLeadsRoute = Route$1.update({
  id: "/admin/leads",
  path: "/admin/leads",
  getParentRoute: () => AuthenticatedRoute
});
const AuthenticatedAdminBlogsRoute = Route.update({
  id: "/admin/blogs",
  path: "/admin/blogs",
  getParentRoute: () => AuthenticatedRoute
});
const AuthenticatedRouteChildren = {
  AuthenticatedAdminBlogsRoute,
  AuthenticatedAdminLeadsRoute,
  AuthenticatedAdminProjectsRoute,
  AuthenticatedAdminIndexRoute
};
const AuthenticatedRouteWithChildren = AuthenticatedRoute._addFileChildren(
  AuthenticatedRouteChildren
);
const BlogRouteChildren = {
  BlogSlugRoute
};
const BlogRouteWithChildren = BlogRoute._addFileChildren(BlogRouteChildren);
const ProjectsRouteChildren = {
  ProjectsSlugRoute
};
const ProjectsRouteWithChildren = ProjectsRoute._addFileChildren(
  ProjectsRouteChildren
);
const rootRouteChildren = {
  IndexRoute,
  AuthenticatedRoute: AuthenticatedRouteWithChildren,
  AboutRoute,
  AuthRoute,
  BlogRoute: BlogRouteWithChildren,
  ContactRoute,
  ProjectsRoute: ProjectsRouteWithChildren,
  SitemapDotxmlRoute
};
const routeTree = Route$e._addFileChildren(rootRouteChildren)._addFileTypes();
const getRouter = () => {
  const queryClient = new QueryClient();
  const router2 = createRouter({
    routeTree,
    context: { queryClient },
    scrollRestoration: true,
    defaultPreloadStaleTime: 0
  });
  return router2;
};
const router = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  getRouter
}, Symbol.toStringTag, { value: "Module" }));
export {
  Route$5 as R,
  SITE as S,
  q$2 as a,
  q$1 as b,
  Route$4 as c,
  q as d,
  homeData as h,
  q$3 as q,
  router as r,
  whatsappHref as w
};
