"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const dotenv_1 = __importDefault(require("dotenv"));
const mongoose_1 = __importDefault(require("mongoose"));
const Blog_1 = __importDefault(require("./models/Blog"));
dotenv_1.default.config();
const IS_PRODUCTION = process.env.IS_PRODUCTION === "true";
const DB_URL = (IS_PRODUCTION ? process.env.MONGO_URI_PROD : process.env.MONGO_URI_DEV) || "mongodb://localhost:27017/cycling-escape";
const blogs = [
    {
        slug: "5-essential-tips-cycling-sri-lanka",
        image: "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcS2B4fZcfL6kVV-Kzu1XA83bRNKXRzW8FGfIqj6aFN3DEzG-O9usDl927H0ZzH-",
        date: "2026-04-05",
        title: "5 Essential Tips for Cycling in Sri Lanka",
        excerpt: "Planning a cycling trip to the Pearl of the Indian Ocean? Here are our top five tips to make your riding adventure smooth, safe, and unforgettable.",
        content: [
            "When cycling in a tropical climate, managing your hydration and sun exposure is the absolute top priority. The midday sun can be intense, so we always recommend starting your rides early in the morning—ideally around 6:00 AM—to cover the bulk of your distance before the heat peaks. Always carry at least two water bottles and take advantage of the frequent roadside King Coconut (Thambili) stands for natural electrolytes.",
            "Navigating local traffic can feel chaotic at first, but there is a rhythm to it. Always hold your line, be predictable, and use hand signals clearly. Remember that larger vehicles like buses and trucks generally have the right of way in practice, so stay alert, keep to the left shoulder where possible, and don't hesitate to pull over if a narrow road gets too crowded.",
            "Finally, make sure your gear is dialed in for the terrain. While the main coastal roads are mostly paved, many of the most scenic routes involve potholed tarmac or hard-packed gravel. A sturdy hybrid bike or a hardtail mountain bike with puncture-resistant tires is usually the best choice for handling whatever the island throws at you."
        ]
    },
    {
        slug: "conquering-central-highlands-cyclists-guide",
        image: "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRxqsB3Gt7S-7grX48zZ3IIZBePhzvG2Bzpj0COtWK8vY5WDVpviVnv1-jchpAY",
        date: "2026-04-12",
        title: "Conquering the Central Highlands: A Cyclist's Guide",
        excerpt: "The crisp air and rolling tea estates make the Hill Country a cyclist's dream. Discover what it takes to tackle these challenging but rewarding climbs.",
        content: [
            "The Central Highlands offer a dramatic shift from the warm, breezy coastlines, presenting cyclists with crisp mountain air and emerald-green landscapes. Riding through regions like Nuwara Eliya, Hatton, and Ella means winding your way through endless working tea plantations and historic British-era railway bridges. The scenery here is unparalleled, providing stunning panoramic views that make every drop of sweat worth it.",
            "However, this region is not for the faint of heart. The elevation gains can be massive, with endless switchbacks testing your endurance and gearing. You will be dealing with continuous climbing, often with gradients kicking up past 10%. Pacing yourself is crucial, as is ensuring your bicycle has a wide gear ratio to help you spin comfortably up the steepest segments of the route.",
            "Weather in the highlands is famously unpredictable. You might start a climb in bright sunshine and reach the summit in a thick, chilly mist or sudden downpour. Layering is essential; always carry a lightweight, packable rain jacket and a warm base layer, even if the forecast looks clear when you set off from the valley below."
        ]
    },
    {
        slug: "pedaling-through-history-cultural-triangle",
        image: "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTJfHxOnd5UTsggpsMW_5c1TSV9SHpz_BGn67gabchTHyvYmrZRAEiV72lUIFkF",
        date: "2026-04-19",
        title: "Pedaling Through History: Exploring the Cultural Triangle",
        excerpt: "Experience the ancient wonders of Sigiriya and Polonnaruwa at your own pace. Why a bicycle is the best way to explore Sri Lanka's historic ruins.",
        content: [
            "There is no better way to connect with the rich, ancient history of Sri Lanka than from the saddle of a bicycle. The Cultural Triangle—encompassing Anuradhapura, Polonnaruwa, and Sigiriya—is largely flat, making it an incredibly accessible riding destination for cyclists of all skill levels. Moving at a slower pace allows you to soak in the atmosphere of these UNESCO World Heritage sites without feeling rushed.",
            "Renting a bike to explore the ancient city of Polonnaruwa is particularly magical. The archaeological park is vast, and cycling between the beautifully preserved stupas, royal palaces, and massive Buddha statues carved into granite rock faces is far more efficient than walking. It gives you the freedom to pull over whenever a specific ruin catches your eye or when you spot a troop of toque macaques playing in the trees.",
            "Beyond the ruins themselves, riding through the Cultural Triangle takes you past massive, ancient irrigation reservoirs (tanks) built by ancient kings. These tranquil lakes are teeming with birdlife and offer a perfect, shady spot for a midday picnic. The surrounding villages are quiet and traditional, offering a glimpse into the slower-paced, agricultural life of the island."
        ]
    },
    {
        slug: "chasing-sunsets-riding-southern-coast",
        image: "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcReWQLdIxWavPeyirg_XbntuPktZoi3qrTSOBU5mgNxsl834YVKJBlHUO5CwlII",
        date: "2026-04-26",
        title: "Chasing Sunsets: Riding the Southern Coast",
        excerpt: "From Galle to Tangalle, the southern coastal road offers ocean breezes and vibrant beach towns. Here is what to expect on this scenic route.",
        content: [
            "The ride along the southern coast of the island is an absolute classic, offering a vibrant mix of culture, history, and stunning Indian Ocean views. Starting from the historic, cobblestoned streets of the Galle Fort, the route stretches eastward toward Matara and Tangalle. The ocean breeze provides a welcome relief from the tropical heat, and the sound of crashing waves serves as a constant, soothing soundtrack to your journey.",
            "One of the best parts about this route is the abundance of fantastic pit stops. You are never more than a few kilometers away from a bustling fishing village, a secluded surfing beach, or a roadside cafe serving up incredible local seafood. Taking breaks to watch the famous stilt fishermen, or hopping off the bike for a quick swim in the warm ocean, turns a simple ride into a full-day adventure.",
            "While the main Galle Road (A2) is paved and fast, it can get quite busy with buses and tuk-tuks. For a more relaxed experience, savvy cyclists will often divert onto the smaller, parallel backroads that weave through local neighborhoods and cinnamon plantations. These quieter lanes offer a much safer, more intimate look at coastal community life away from the tourist hubs."
        ]
    },
    {
        slug: "sample-5th-blog-entry",
        image: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ_3pH2kQQbTFSEoKghnex0Tavow9LD4hCh_rrxEWhrmkGLABanP0PVwdMDr7NH",
        date: "2026-05-03",
        title: "Island Riding Habits: Why Sri Lanka is a Cyclist's Paradise",
        excerpt: "From tea estates to coastline roads, discover what makes Sri Lanka uniquely rewarding for bike travelers.",
        content: [
            "Sri Lanka's variety in terrain allows cyclists to choose laid-back coastal paths or highland endurance climbs. Local hospitality makes it easy to find homestay accommodation and warming meals after a long ride.",
            "The small size of the island means you can tour multiple ecosystems in one trip—beaches in the morning and mountains by afternoon. Keep your gear prepared for everything from humidity along the coast to cool fog in the hills.",
            "Respect local riders and wildlife by staying on marked routes during the monsoon seasons. Safety gear and bike maintenance are keys to a fantastic, long-lasting journey."
        ]
    }
];
async function seedBlogs() {
    try {
        await mongoose_1.default.connect(DB_URL);
        console.log("Connected to DB for blog seeding");
        for (const blog of blogs) {
            await Blog_1.default.findOneAndUpdate({ slug: blog.slug }, blog, { upsert: true, new: true, setDefaultsOnInsert: true });
        }
        console.log("Blog seeding finished");
        process.exit(0);
    }
    catch (error) {
        console.error("Blog seeding failed", error);
        process.exit(1);
    }
}
seedBlogs();
