// app/(lib)/services/programDetailService.ts
import { cache } from "react";
import { apiClient } from "../../app/api/client";
import { withCDN } from "../utils";
import { handleAPIError } from "../utils/apiErrorHandler";
import { getLanguageCode } from "../utils/getLanguageCode";

export interface ProgramObjective {
  icon: string;
  title: string;
  description: string;
}

export interface ProgramDiscovery {
  icon: string;
  text: string;
}

export interface ProgramHighlight {
  title: string;
  description: string;
}

export interface GallerySlide {
  img: string;
  title: string;
}

export interface ProgramDetailData {
  id: string;
  cwProgramId?: number | string | null;
  slug: string;
  title: string;
  subtitle: string;
  description: string;
  // SEO meta (from the backend program translation) — used by generateMetadata.
  seoTitle?: string;
  seoDescription?: string;
  ageRange: string;
  // API-driven label fields (with fallbacks)
  tag: string;
  createdFor: string;
  ageText: string;
  lessonDurationText: string;
  durationUnit: string;
  lessonDuration: string;
  lessonsTotal: string;
  borderColor: string;
  iconSrc: string;
  imageSrc: string;
  ribbonImage: string;
  mobileRibbonImage: string;
  categoryTag: string;
  categoryTagTextColor?: string;
  categoryTagBackgroundGradient?: string;
  objectives: ProgramObjective[];
  whatKidsDiscover: ProgramDiscovery[];
  programHighlights: ProgramHighlight[];
  ctaText: string;
  signUpCtaText: string;
  actionText: string;
  seeInActionTitle: string;
  seeInActionDescription: string;
  // New fields for complete page
  objectivesHeading: string;
  seeInActionHeading: string;
  whatKidsDiscoverHeading: string;
  programHighlightsHeading: string;
  highlightsImageSrc: string;
  galleryImageSrc: string;
  // Slider images
  autoScrollSliderImages: string[];
  reverseAutoScrollSliderImages: string[];
  animatedScrollItems: string[];
  // Gallery slider
  gallerySlides: GallerySlide[];
  // Hero banner backgrounds
  heroBgMobile: string;
  heroBgTablet?: string;
  heroBgDesktop: string;
  // Video and testimonials
  videoUrl?: string;
  videoThumbnail?: string;
  testimonials?: any;
  // Footer slider items (per-program, from admin)
  bottomSliders?: Array<{ tag: string; title: string; robot_image?: string }>;

  //Footerslider items
  footerSlides?: {
    id: number;
    image: string;
    title: string;
    text: string;
  }[];

  // AI- Feature section
  featureSection?: {
    heading?: string;
    AiSubtitle: string;
    AiDescription: string;
    AiImage: string;
    AiButtonText?: string;
    AiButtonLink?: string;
    reverse?: boolean;
    AiGradientStart?: string;
    AiGradientEnd?: string;
  };
  // Per-program testimonials banner overrides (heading/subheading + 4 highlights).
  // Falls back to the global home.json defaults when not set in the admin.
  testimonialsSection?: {
    mainHeading?: string;
    subHeading?: string;
    feature1?: string;
    feature2?: string;
    feature3?: string;
    feature4?: string;
  };
}


// ============ NEW TYPE FOR TRANSLATIONS ============
export interface ProgramDetailDataWithTranslations {
  default: ProgramDetailData;
  translated?: ProgramDetailData;
}

// Local fallback data for development
// Program-specific objectives, discoveries, and highlights
const BIG_BUILDERS_OBJECTIVES = [
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/Subtract%20(1).png",
    title: "Creative Thinking",
    description: "Encourage imaginative play and innovative building ideas",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/orange_circle_icon%20(1).png",
    title: "Spatial Awareness",
    description: "Develop 3D thinking and spatial reasoning skills",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/Subtract%20(2).png",
    title: "Fine Motor Skills",
    description: "Build dexterity through precise block manipulation",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/Subtract%20(3).png",
    title: "Collaboration",
    description: "Work together in group building projects",
  },
];

const BIG_BUILDERS_DISCOVERIES = [
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/Vector%20(1).png",
    text: "Basic structural engineering: balance, stability, and foundation principles",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/Vector%20(1).png",
    text: "Geometric shapes and how they fit together",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/Vector%20(1).png",
    text: "Introduction to problem-solving through trial and error",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/Vector%20(1).png",
    text: "Pattern recognition and symmetry",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/Vector%20(1).png",
    text: "Early STEM concepts through playful exploration",
  },
];

const BRICKS_CHALLENGE_OBJECTIVES = [
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Creative-thinking.png",
    title: "Creative Problem Solving",
    description: "Develop innovative approaches to engineering challenges",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/setting_circle_icon.png",
    title: "Physics Understanding",
    description: "Master fundamental physics concepts through hands-on building",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/motor_skills.png",
    title: "Technical Skills",
    description: "Build precision and coordination in mechanical assembly",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Teamwork.png",
    title: "Team Problem Solving",
    description: "Collaborate to design and build moving models",
  },
];

const BRICKS_CHALLENGE_DISCOVERIES = [
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Vector.png",
    text: "Real-world physics: motion, energy, and force principles",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Vector.png",
    text: "How machines and mechanisms work in real life",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Vector.png",
    text: "Hands-on testing and iteration in design",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Vector.png",
    text: "Cause-and-effect relationships in engineering",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Vector.png",
    text: "Real applications of physics in everyday objects",
  },
];

const ALGO_PLAY_OBJECTIVES = [
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/orange_circle_icon%20(1).png",
    title: "Computational Thinking",
    description: "Learn step-by-step logical thinking and algorithms",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/orange_circle_icon%20(2).png",
    title: "Coding Fundamentals",
    description: "Introduce programming through visual, block-based coding",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/orange_circle_icon%20(3).png",
    title: "Robotics Control",
    description: "Master the basics of programming robotic movement",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/orange_circle_icon%20(4).png",
    title: "Creative Collaboration",
    description: "Design and code interactive projects together",
  },
];

const ALGO_PLAY_DISCOVERIES = [
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/Vector.png",
    text: "Sequential logic and decision-making in programming",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/Vector.png",
    text: "How code controls physical robots and machines",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/Vector.png",
    text: "Debugging and problem-solving with code",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/Vector.png",
    text: "Connection between digital commands and physical actions",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/Vector.png",
    text: "Practical applications of coding in robotics",
  },
];

const ALGO_BUDDY_OBJECTIVES = [
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/orange_circle_icon%20(1).png",
    title: "Early Logic Skills",
    description: "Introduce basic programming concepts through play",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/orange_circle_icon%20(2).png",
    title: "Fun Coding Basics",
    description: "Make coding accessible and enjoyable for young learners",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/orange_circle_icon%20(3).png",
    title: "Pattern Recognition",
    description: "Develop pattern-spotting and sequencing abilities",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/orange_circle_icon%20(4).png",
    title: "Collaborative Play",
    description: "Learn coding concepts together in a playful environment",
  },
];

const ALGO_BUDDY_DISCOVERIES = [
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/Vector.png",
    text: "Sequences and simple algorithms through interactive activities",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/Vector.png",
    text: "Following instructions and logical order",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/Vector.png",
    text: "Introduction to problem-solving strategies",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/Vector.png",
    text: "How computers understand and execute commands",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/Vector.png",
    text: "Building confidence in STEM learning",
  },
];

const GALILEO_TECHNICS_OBJECTIVES = [
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/orange_circle_icon%20(1).png",
    title: "Advanced Engineering Design",
    description: "Master sophisticated mechanical design principles",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/orange_circle_icon%20(2).png",
    title: "Physics Mastery",
    description: "Deep understanding of torque, motion, and energy transfer",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/Subtract%20(1).png",
    title: "Precision Engineering",
    description: "Build complex mechanisms with accuracy and care",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/Subtract.png",
    title: "Project Collaboration",
    description: "Work as a team on advanced engineering projects",
  },
];

const GALILEO_TECHNICS_DISCOVERIES = [
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/Vector.png",
    text: "Advanced physics: torque, transmission, and mechanical advantage",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/Vector.png",
    text: "Complex gear systems and pulley mechanisms",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/Vector.png",
    text: "Engineering design and prototyping processes",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/Vector.png",
    text: "Real-world applications in technology and machinery",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/Vector.png",
    text: "Historical innovations of great engineers and inventors",
  },
];

const ROBO_TOYS_OBJECTIVES = [
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/orange_circle_icon%20(1).png",
    title: "Creative Robotics",
    description: "Design and build interactive robotic creations",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/orange_circle_icon%20(2).png",
    title: "Coding for Robots",
    description: "Learn practical programming to control robots",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/orange_circle_icon%20(3).png",
    title: "Building & Assembly",
    description: "Master robotic construction and integration",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/Subtract.png",
    title: "Team Projects",
    description: "Collaborate on multi-unit robotic challenges",
  },
];

const ROBO_TOYS_DISCOVERIES = [
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/Vector.png",
    text: "How robots sense and respond to their environment",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/Vector.png",
    text: "Programming logic that brings machines to life",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/Vector.png",
    text: "Integration of mechanical and electronic components",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/Vector.png",
    text: "Real-world uses of robotics in modern technology",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/Vector.png",
    text: "Innovation through creative robot design and programming",
  },
];

const ROBOTICS_OBJECTIVES = [
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/orange_circle_icon%20(1).png",
    title: "Advanced Programming",
    description: "Master complex coding for sophisticated robotics",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/orange_circle_icon%20(2).png",
    title: "Engineering Excellence",
    description: "Design and build competition-grade robots",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/orange_circle_icon%20(3).png",
    title: "System Integration",
    description: "Combine mechanics, electronics, and software seamlessly",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/Subtract.png",
    title: "Team Leadership",
    description: "Lead robotics teams in competitive environments",
  },
];

const ROBOTICS_DISCOVERIES = [
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotics/Vector.png",
    text: "Advanced algorithms and AI in robotic decision-making",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotics/Vector.png",
    text: "Complex sensor integration and autonomous systems",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotics/Vector.png",
    text: "Competition strategies and robotics challenges",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotics/Vector.png",
    text: "Real-world robotics applications in industry",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotics/Vector.png",
    text: "Future careers in robotics and engineering",
  },
];

// Gallery Slides for each program
const BIG_BUILDERS_GALLERY = [
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/pct%20(2).png", title: "Basset Hound" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/PCT_1.png", title: "Cube Buddy" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/PCT_2.png", title: "Tractor" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/PCT_3.png", title: "Hot air baloon" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/PCT_4.png", title: "Rabbit" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/PCT_6.png", title: "Seesaw" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/PCT_7.png", title: "Dragonfly" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/PCT_8.png", title: "Treasure Box" },
];

const BRICKS_CHALLENGE_GALLERY = [
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/main%20pct.png", title: "Robot rabbit" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/main%20pct-2.png", title: "Sand Truck" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/main%20pct-3.png", title: "Feeris Wheel" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/main%20pct-4.png", title: "Wolf" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/main%20pct-5.png", title: "Delivery Buddy" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/main%20pct-6.png", title: "Pumpjack" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/main%20pct-7.png", title: "Upside down" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/main%20pct-8.png", title: "Portable Drumming Machine" },
];

const ALGO_PLAY_GALLERY = [
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/pct%20(2).png", title: "Rube Goldberg Machine" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/pct-1.png", title: "Touchless Trash" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/pct-2.png", title: "Security patrol robot" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/pct-3.png", title: "RoboBot" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/pct-4.png", title: "Crawler Crane" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/pct-5.png", title: "Fly away" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/pct-6.png", title: "Microwave" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/pct-7.png", title: "waiter robot" },
];

const ALGO_BUDDY_GALLERY = [
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/pct%20(2).png", title: "Fan Moving Robot" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/pct-1.png", title: "Goal runner" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/pct-2.png", title: "Fun Coding" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/pct-3.png", title: "Trash collector" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/pct-4.png", title: "pointer" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/pct-5.png", title: "Illustrator" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/pct-6.png", title: "Basketball" },
];

const GALILEO_TECHNICS_GALLERY = [
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/pct-1.png", title: "Michael Jackson" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/pct-2.png", title: "Automatic catapult" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/pct-3.png", title: "Scissors" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/pct-4.png", title: "Drummer" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/pct-5.png", title: "Playground swing" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/pct-6.png", title: "spinning top bouncer" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/pct-7.png", title: "Continuous Turning Fan" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/pct-8.png", title: "Construction Site Crane" },
];

const ROBO_TOYS_GALLERY = [
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/pct-1.png", title: "Cuckoo Clock" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/pct-2.png", title: "Drummer" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/pct-3.png", title: "Santa and Reindeer" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/pct-4.png", title: "Solar System" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/pct-5.png", title: "Lifting Platform" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/pct-6.png", title: "Zombie" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/pct-7.png", title: "Cra Bot" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/pct-8.png", title: "Fire Truck" },
];

const ROBOTICS_GALLERY = [
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotics/gallery1.png", title: "Advanced Robotics" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotics/gallery2.png", title: "Competition Ready" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotics/gallery3.png", title: "Autonomous Systems" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotics/gallery4.png", title: "Complex Programming" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotics/gallery5.png", title: "Sensor Integration" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotics/gallery6.png", title: "Team Leadership" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotics/gallery7.png", title: "Innovation at Scale" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotics/gallery8.png", title: "Future Engineers" },
];

const SMARTIVO_GALLERY = [
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/pct-1.png", title: "Smartivo basket" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/pct-2.png", title: "Basic Robot Smartivo" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/pct-3.png", title: "Smartivo Transporter" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/pct-4.png", title: "Smartivo Sketching" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/pct-5.png", title: "Smartivo spotter" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/pct-6.png", title: "Smartivo Snowplow " },
];

const ALGOC_GALLERY = [
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/pct-1.png", title: "Musical Mobile" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/pct-2.png", title: "Mummy Guardian Challenge" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/pct-3.png", title: "Cards Dealer" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/pct-4.png", title: "Taming a Dog" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/pct-5.png", title: "Prize Claw" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/pct-6.png", title: "Portable Printer" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/pct-7.png", title: "Puppets Theater" },
  { img: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/pct-8.png", title: "Target-Detecting Scorebot" },
];

const SHARED_HIGHLIGHTS = [
  {
    title: "Moving Model Projects",
    description: "Build real working machines that demonstrate physics principles",
  },
  {
    title: "Progressive Complexity",
    description: "Projects increase in difficulty as skills develop",
  },
  {
    title: "Real-World Applications",
    description: "Connect learning to everyday machines and technology",
  },
  {
    title: "Hands-On Experimentation",
    description: "Learn through building, testing, and refining designs",
  },
];

const SMARTIVO_OBJECTIVES = [
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/orange_circle_icon%20(1).png",
    title: "Introduce Basic Coding",
    description: "Introduce children to basic coding concepts through fun, story-based missions",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/orange_circle_icon%20(2).png",
    title: "Logical Thinking",
    description: "Develop logical thinking and problem-solving skills",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/orange_circle_icon%20(3).png",
    title: "Pattern Recognition",
    description: "Strengthen the ability to recognize patterns, work with numbers, and follow visual instructions",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/orange_circle_icon%20(4).png",
    title: "Communication Skills",
    description: "Build communication skills and teamwork through collaborative activities",
  },
];

const SMARTIVO_DISCOVERIES = [
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/Vector.png",
    text: "Command Sequencing - Putting instructions in the right order to complete tasks.",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/Vector.png",
    text: "Move, Wait, Light, and Sound - Controlling actions, pauses, lights, and sounds.",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/Vector.png",
    text: "Conditions - Using if-then rules to react to situations.",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/Vector.png",
    text: "Loops - Repeating actions without extra steps.",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/Vector.png",
    text: "Multithreading - Running several commands at the same time.",
  },
];

const ALGOC_OBJECTIVES = [
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/orange_circle_icon%20(1).png",
    title: "Introduce Coding",
    description: "Introduce children to coding fundamentals through visual and interactive methods",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/orange_circle_icon%20(2).png",
    title: "Algorithmic Thinking",
    description: "Develop algorithmic thinking and computational problem-solving skills",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/orange_circle_icon%20(3).png",
    title: "Logic Building",
    description: "Build strong logical foundations through step-by-step learning",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/orange_circle_icon%20(4).png",
    title: "Team Collaboration",
    description: "Learn to collaborate and share ideas through group coding activities",
  },
];

const ALGOC_DISCOVERIES = [
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/Vector.png",
    text: "Sequential programming and control flow structures",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/Vector.png",
    text: "Variables, loops, and conditional statements",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/Vector.png",
    text: "Breaking down complex problems into smaller steps",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/Vector.png",
    text: "Debugging and testing code solutions",
  },
  {
    icon: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/Vector.png",
    text: "Real-world applications of algorithms in technology",
  },
];

const PROGRAM_DATA: Record<string, ProgramDetailData> = {
  "BIG_BUILDERS": {
    id: "BIG_BUILDERS",
    slug: "BIG_BUILDERS",
    title: "BIG BUILDERS",
    subtitle: "WELCOME TO A UNIQUE EARLY-LEARNING PROGRAM",
    description:
      "Where young minds explore the world of engineering and science through fun, hands-on building. Children learn STEM principles by creating 3D models with specially designed building blocks — all through play, imagination, and teamwork.",
    ageRange: "4–6",
    tag: "WORLD AROUND US",
    createdFor: "Created for children",
    ageText: "age",
    lessonDurationText: "Lesson duration",
    durationUnit: "min",
    lessonDuration: "45",
    lessonsTotal: "36 lessons total",
    borderColor: "#F49800",
    iconSrc: withCDN("/program-logo/logo_big_builders.svg"),
    imageSrc: "https://yefranchisees.b-cdn.net/frontend/programs-page/photo%20(9)%20(1).png",
    ribbonImage: "https://yefranchisees.b-cdn.net/frontend/Program-detail/ribbon_dekstop.png",
    mobileRibbonImage:"https://yefranchisees.b-cdn.net/frontend/Workshop/bg%20%285%29.png",
    categoryTag: "WORLD AROUND US",
    categoryTagTextColor: "#58585A",
    categoryTagBackgroundGradient: "linear-gradient(127.67deg, #F39000 34.95%, #F39300 35.96%, #F8B900 48.09%, #FCD500 59.21%, #FEE600 68.81%, #FFED00 76.39%)",
    objectivesHeading: "Program Objectives",
    seeInActionHeading: "See BIG BUILDERS in Action",
    whatKidsDiscoverHeading: "What Kids Discover",
    programHighlightsHeading: "program highlights",
    galleryImageSrc: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/instruction%20(1).png",
    highlightsImageSrc: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/Tadpole%202.png",
    heroBgMobile: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/bg_hero-mobile1.png",
    heroBgDesktop: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/bg_hero-screen4.png",
    objectives: BIG_BUILDERS_OBJECTIVES,
    whatKidsDiscover: BIG_BUILDERS_DISCOVERIES,
    programHighlights: SHARED_HIGHLIGHTS,
    ctaText: "SIGN UP FOR A TRIAL LESSON",
    signUpCtaText: "SIGN UP FOR A TRIAL LESSON",
    actionText: "See BIG BUILDERS in Action",
    seeInActionTitle: "See BIG BUILDERS in Action",
    seeInActionDescription:
      "Watch young learners discover the joy of creation through hands-on building — where imagination meets learning, skills develop, and fun is part of every build!",
    autoScrollSliderImages: [
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/photo%20(10).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/photo%20(11).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/photo%20(12).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/photo%20(13).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/photo%20(4).png",
    ],
    reverseAutoScrollSliderImages: [
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/photo%20(5).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/photo%20(6).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/photo%20(7).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/photo%20(8).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/photo%20(9).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/photo-(4).png",
    ],
    gallerySlides: BIG_BUILDERS_GALLERY,
    animatedScrollItems: [
      "NEW REALITY FOR YOUR CHILD",
      "GREAT OPPORTUNITIES",
      "TEAMWORK",
    ],
    footerSlides: [
      {
        id: 1,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/footer/Amusement%20Carousel%20Park%201.png",
        title: "Amusement Park Carousel",
        text:
          "Discover the mechanics behind the Amusement Park Carousel and learn about the important role of Belt Transmission in everyday life. This fun and educational lesson teaches children how carousels work while exploring the definition and function of belt transmission. 🎠⚙️",
      },
      {
        id: 2,
        image:
          "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/footer/tadpole%26frog%201%20(1).png",
        title: "From Tadpole to Frog",
        text:
          "🚗🐸✨ Witness the wonders of nature with our 'From Tadpole to Frog' model! ​Kids explore the fascinating life cycle of frogs while building and learning through hands-on fun. 🌿 Ready to see the magic of transformation unfold?​​",
      },
      {
        id: 3,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/footer/flower_butterfly%201.png",
        title: "Flower and Butterfy",
        text: "🌼🦋 Discover the magic of nature with our 'Flower and Butterfly' model!  From pollination to blooming flowers, kids learn how butterflies help bring life to every garden. Ready to explore the wonders of nature’s tiny helpers? Join the journey with Big Builders!​",
      },
      {
        id: 4,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/footer/tadpole%26frog%201.png",
        title: "Leafy Seadragon’s Camouflage",
        text: "In this engaging lesson, children will discover the fascinating Leafy Seadragon and learn how it uses camouflage to survive in its natural habitat. Through fun and interactive activities, they’ll explore the science behind camouflage and how it works! 🦎✨",
      },
      {
        id: 5,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/Big-builders/footer/goose%201%20(1).png",
        title: "Bird's Migration",
        text: "In this captivating lesson, children will explore the wonders of bird migration, learning why it’s important and how ducks and geese follow specific migration patterns. It’s a fun and interactive way to understand the natural world and its seasonal changes! 🌍✨",
      },
    ],
  },
  "BRICKS_CHALLENGE": {
    id: "BRICKS_CHALLENGE",
    slug: "BRICKS_CHALLENGE",
    title: "BRICKS CHALLENGE",
    subtitle: "WELCOME TO BRICKS CHALLENGE — A DYNAMIC PROGRAM",
    description:
      "Where kids learn science and engineering by building moving models. Through real-world themes like physics, energy, and motion, children discover how things work — all while having fun.",
    ageRange: "6–10",
    tag: "CODING",
    createdFor: "Created for children",
    ageText: "age",
    lessonDurationText: "Lesson duration",
    durationUnit: "min",
    lessonDuration: "75",
    lessonsTotal: "36 lessons total",
    borderColor: "#95C11F",
    iconSrc: withCDN("/program-logo/logo_bricks_chalenge.svg"),
    imageSrc: "https://yefranchisees.b-cdn.net/frontend/programs-page/AllPrograms/allPrograms1.svg",
    ribbonImage: "https://yefranchisees.b-cdn.net/frontend/Program-detail/ribbon_dekstop.png",
    mobileRibbonImage:"https://yefranchisees.b-cdn.net/frontend/Workshop/bg%20%284%29.png",
    categoryTag: "CODING",
    objectivesHeading: "Program Objectives",
    seeInActionHeading: "See BRICKS CHALLENGE in Action",
    whatKidsDiscoverHeading: "What Kids Discover",
    programHighlightsHeading: "program highlights",
    galleryImageSrc: "https://yefranchisees.b-cdn.net/frontend/Program-detail/instruction.png",
    highlightsImageSrc: "https://yefranchisees.b-cdn.net/frontend/Program-detail/snail-robot-shadow-edit%20(1).png",
    heroBgMobile: "https://yefranchisees.b-cdn.net/frontend/Program-detail/bg_mobile.png",
    heroBgDesktop: "https://yefranchisees.b-cdn.net/frontend/Program-detail/bg_hero-screen.jpg",
    objectives: BRICKS_CHALLENGE_OBJECTIVES,
    whatKidsDiscover: BRICKS_CHALLENGE_DISCOVERIES,
    programHighlights: SHARED_HIGHLIGHTS,
    ctaText: "SIGN UP FOR A TRIAL LESSON",
    signUpCtaText: "SIGN UP FOR A TRIAL LESSON",
    actionText: "See Bricks Challenge in Action",
    seeInActionTitle: "See Bricks Challenge in Action",
    seeInActionDescription:
      "Join us in making science tangible for young learners — where curiosity leads to creation, knowledge grows, and fun is part of every design.",
    autoScrollSliderImages: [
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/photo.png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/photo%20(1).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/bc_scroll_pct_3.png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/photo%20(2).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/photo%20(3).png",
    ],
    reverseAutoScrollSliderImages: [
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/photo%20(4).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/ab_scroll_pct_7.png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/photo%20(5).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/ab_scroll_pct_9.png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/photo%20(6).png",
    ],
    gallerySlides: BRICKS_CHALLENGE_GALLERY,
    animatedScrollItems: [
      "NEW REALITY FOR YOUR CHILD",
      "GREAT OPPORTUNITIES",
      "TEAMWORK",
    ],
    footerSlides: [
      {
        id: 1,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/footer/lever%20principle-01%202.png",
        title: "Lever Priciple",
        text:
          "Our Young Engineers are discovering the wonders of the Lever Principle through hands-on play and creativity! 🧠✨ By building their own models, they’re not only mastering the mechanics of lifting arms and forces but also learning how ancient discoveries like Archimedes' contributions shape our world today! 🌍🔧​",
      },
      {
        id: 2,
        image:
          "https://yefranchisees.b-cdn.net/frontend/Program-detail/footer/Carousel_netnet%202.png",
        title: "Carousel Model",
        text:
          "Watch your kids’ creativity and curiosity take off as they build their very own Carousel Model! 🚀 From mastering the electric motor to exploring the magic of centrifugal force, our young engineers are turning learning into an unforgettable adventure! ⚙️💡",
      },
      {
        id: 3,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/footer/Laundry%20Machine-01%201.png",
        title: "Laundry Machine",
        text: "Ever wondered how a laundry machine works? Our young engineers are diving deep into the science of centrifugal force and the mechanics behind the “wringing action” that gets your clothes dry! 🧠✨ From drive wheels to belt transmission, they’re exploring key engineering concepts while having tons of fun!​",
      },
      {
        id: 4,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/windmill%202.png",
        title: "Windmill",
        text: "Our young inventors are building their very own Windmill Model, learning all about the fascinating world of gear shifting and how it drives machines! From understanding the mechanics to hands-on experimentation, these future engineers are mastering real-world skills through fun and play! 🧠✨​",
      },
      {
        id: 5,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/footer/accordion%20robot%201.png",
        title: "Accordion Robot",
        text: "🤖 Unfolding the Power of Movement! 🤖🛠️​Our budding engineers are mastering the Accordion Robot, learning how the accordion mechanism and ratchet create one-way motion in machines! 🌟 It's all about combining fun with real-world engineering concepts, and our students are loving every minute of it! 🚀​",
      },
    ],
    featureSection: {
      AiSubtitle: "Supported Mechanical Understanding",
      AiDescription:
        "Students use the BuildWise App with AI Chat to deepen their mechanical understanding. AI supports the learning process with guided questions and detailed explanations, helping students explore how motion, gears, force, speed, and mechanical transmission shape the behavior of each model. This transforms building into a more reflective engineering experience, where students connect physical building with smart technology.",
      AiImage: "https://yefranchisees.b-cdn.net/frontend/programs-page/Group-290910.png",
      AiButtonText: "SIGN UP FOR A TRIAL LESSON",
      AiButtonLink: "#program-Form",
      reverse: false,
      AiGradientStart: "#226B20",
      AiGradientEnd: "#226B20",
    },
  },

  "ALGOPLAY": {
    id: "ALGOPLAY",
    slug: "ALGOPLAY",
    title: "ALGO PLAY",
    subtitle: "WELCOME TO AN IMMERSIVE, HANDS-ON ROBOTICS AND CODING ADVENTURE",
    description:
      "Using the unique Algo bricks system, kids build fun models and create graphical code sequences to bring them to life. It's engaging, educational, and designed for curious minds!",
    ageRange: "6–10",
    tag: "ROBOTICS",
    createdFor: "Created for children",
    ageText: "age",
    lessonDurationText: "Lesson duration",
    durationUnit: "min",
    lessonDuration: "75",
    lessonsTotal: "36 lessons total",
    borderColor: "#9E358C",
    iconSrc: withCDN("/program-logo/logo_algo_play.svg"),
    imageSrc: "https://yefranchisees.b-cdn.net/frontend/programs-page/photo%20(4)%20(1).png",
    ribbonImage: "https://yefranchisees.b-cdn.net/frontend/Program-detail/ribbon_dekstop.png",
    mobileRibbonImage:"https://yefranchisees.b-cdn.net/frontend/programs-page/bg%20%287%29%20%281%29.png",
    categoryTag: "ROBOTICS",
    objectivesHeading: "Program Objectives",
    seeInActionHeading: "See ALGO PLAY in Action",
    whatKidsDiscoverHeading: "What Kids Discover",
    programHighlightsHeading: "program highlights",
    galleryImageSrc: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/AP%20instruction.png",
    highlightsImageSrc: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/Tadpole%201%20(1).png",
    heroBgMobile: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/bg_hero-mobile3.png",
    heroBgDesktop: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/bg_hero-screen3.png",
    objectives: ALGO_PLAY_OBJECTIVES,
    whatKidsDiscover: ALGO_PLAY_DISCOVERIES,
    programHighlights: SHARED_HIGHLIGHTS,
    ctaText: "SIGN UP FOR A TRIAL LESSON",
    signUpCtaText: "SIGN UP FOR A TRIAL LESSON",
    actionText: "See Algo Play in Action",
    seeInActionTitle: "See Algo Play in Action",
    seeInActionDescription:
      "Discover the magic when creativity meets code — where young programmers bring their ideas to life through interactive robotics and hands-on learning!",
    autoScrollSliderImages: [
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/photo%20(10).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/photo%20(11).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/photo%20(4).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/photo%20(5).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/photo%20(6).png",
    ],
    reverseAutoScrollSliderImages: [
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/photo%20(7).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/photo%20(8).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/photo%20(9).png",
    ],
    gallerySlides: ALGO_PLAY_GALLERY,
    animatedScrollItems: [
      "NEW REALITY FOR YOUR CHILD",
      "GREAT OPPORTUNITIES",
      "TEAMWORK",
    ],
    footerSlides: [
      {
        id: 1,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/footer/Pendulum%20Ride%201.png",
        title: "Pendulum Ride",
        text:
          "Swinging through code, mastering time and movement with our Pendulum Ride in the AlgoPlay program! ​🎢🕰️ Watch as young engineers bring their creations to life, learning to set precise time limits and build code sequences—all while having a blast! 🤖💡 ​",
      },
      {
        id: 2,
        image:
          "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/footer/Elevator%201.png",
        title: "Elevator",
        text:
          "🏗🚀 Elevate Your Coding Skills with the Elevator Model! 🚀​Learn how to incorporate Time Wait Commands and tackle more complex code sequences as you build and program your very own elevator! This lesson offers a great opportunity to dive deeper into coding and see how small commands create big results. 🧠💡​",
      },
      {
        id: 3,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/pct-3.png",
        title: "RoboBot",
        text: "Unlock the power of coding by learning Command repetition and how to use the Loop Command! Students dive deep into programming logic while exploring the Counter Arguments of loops, giving them the tools to control their RoboBot like a pro! 🔄💡​",
      },
      {
        id: 4,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/footer/Cowboy%201.png",
        title: "Cowboy",
        text: "🤠 Ride into Coding with the Cowboy Model! 🤠​This lesson takes students deeper into programming by mastering the Move Infinity Parameter and understanding how to work with Functions and Parameters. They’ll also explore how ports connect between the Brain Block and building instructions, making this a hands-on journey into advanced robotics and coding! 🧠💡",
      },
      {
        id: 5,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/pct-5.png",
        title: "Fly Away",
        text: "Watch as our Fly Away model takes off! 🚁✨ ​Through the power of coding, students seamlessly control multiple transmission systems, enhancing efficiency and adaptability. Ready to see how your child can turn play into precision? Join the fun with AlgoPlay! 🤖💡 ​",
      },
    ],
    featureSection: {
      AiSubtitle: "Powered Coding and Machine Learning",
      AiDescription:
        "Through the GoAlgo App, students can use AI Chat while coding to get support with commands, events, and programming logic. With machine learning, students train AI to recognize inputs such as sounds, actions, or facial expressions, define them as events, and link them to commands. When the event is detected, the model responds through code, helping students understand how AI learns patterns and reacts to real-world information.",
      AiImage: "https://yefranchisees.b-cdn.net/frontend/programs-page/pct-12.png",
      AiButtonText: "SIGN UP FOR A TRIAL LESSON",
      AiButtonLink: "#program-Form",
      reverse: false,
      AiGradientStart: "#4B134A",
      AiGradientEnd: "#993F98",
    },
  },
  "ALGO_BUDDY": {
    id: "ALGOBUDDY",
    slug: "ALGO_BUDDY",
    title: "ALGO BUDDY",
    subtitle: "WELCOME TO ALGO BUDDY — EARLY CODING FUNDAMENTALS",
    description:
      "Introduce young children to coding concepts through playful, interactive activities. Algo Buddy builds foundational programming skills while maintaining the joy and wonder of learning through play.",
    ageRange: "4–6",
    tag: "CODING",
    createdFor: "Created for children",
    ageText: "age",
    lessonDurationText: "Lesson duration",
    durationUnit: "min",
    lessonDuration: "45",
    lessonsTotal: "36 lessons total",
    borderColor: "#0091D6",
    iconSrc: withCDN("/program-logo/logo_algo_buddy.svg"),
    imageSrc: "https://yefranchisees.b-cdn.net/frontend/programs-page/photo%20(8)%20(3).png",
    ribbonImage: "https://yefranchisees.b-cdn.net/frontend/Program-detail/ribbon_dekstop.png",
    mobileRibbonImage:"https://yefranchisees.b-cdn.net/frontend/programs-page/bg%20%283%29%20%282%29.png",
    categoryTag: "CODING",
    objectivesHeading: "Program Objectives",
    seeInActionHeading: "See ALGO BUDDY in Action",
    whatKidsDiscoverHeading: "What Kids Discover",
    programHighlightsHeading: "program highlights",
    galleryImageSrc: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/instruction%20pct.png",
    highlightsImageSrc: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/pct%20(8).png",
    heroBgMobile: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/bg_hero-mobile2.png",
    heroBgDesktop: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/bg_hero-screen5.png",
    objectives: ALGO_BUDDY_OBJECTIVES,
    whatKidsDiscover: ALGO_BUDDY_DISCOVERIES,
    programHighlights: SHARED_HIGHLIGHTS,
    ctaText: "SIGN UP FOR A TRIAL LESSON",
    signUpCtaText: "SIGN UP FOR A TRIAL LESSON",
    actionText: "See Algo Buddy in Action",
    seeInActionTitle: "See Algo Buddy in Action",
    seeInActionDescription:
      "Watch young learners discover the joy of programming through playful activities and creative problem-solving!",
    autoScrollSliderImages: [
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/photo%20(10).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/photo%20(11).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/photo%20(4).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/photo%20(5).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/photo%20(6).png",
    ],
    reverseAutoScrollSliderImages: [
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/photo%20(7).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/photo%20(8).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/photo%20(9).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/photo-(4).png",
    ],
    gallerySlides: ALGO_BUDDY_GALLERY,
    animatedScrollItems: [
      "NEW REALITY FOR YOUR CHILD",
      "GREAT OPPORTUNITIES",
      "TEAMWORK",
    ],
    footerSlides: [
      {
        id: 1,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/footer/Trash%20Collector%201.png",
        title: "Trash Collector Robot",
        text:
          "This engaging lesson teaches children about the importance of recycling sites while providing hands-on opportunities to practice the Recycle Sequence. With external device engagement and group games, students will master the Sequence Command while having fun and learning valuable environmental skills! ♻️✨​",
      },
      {
        id: 2,
        image:
          "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/footer/AlgoBuddyFireman_4-01_CORR%201.png",
        title: "Fireman Robot",
        text:
          "🚗 Drive Coding Skills with Triple Threaded Code! 🚗​ This fun and interactive lesson introduces children to the world of Triple Threaded Coding while practicing the Forever Light Command, the Sound Command, and developing strong algorithmic thinking. Through hands-on activities, children learn to code in a way that sparks creativity and problem-solving! 💡🎶",
      },
      {
        id: 3,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/footer/BasketballAlgoBuddy-01%201.png",
        title: "Basketball Robot",
        text: "🏀🤖 Ready, set, code! ​Meet the AlgoBuddy Basketball Robot—where distance, action, and conditions come together for the perfect play. From sensing to coding, every move counts! Watch your child become a coding champion with hands-on fun. 🚀​",
      },
      {
        id: 4,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/footer/iRobot%201.png",
        title: "IRobot",
        text: "🤖✨ Unlock the world of robotics with AlgoBuddy iRobot! ​Watch as kids bring machines to life using the power of algorithms, turning coding into an adventure of discovery. Ready to see your child’s creativity and problem-solving skills soar? 🚀💡",
      },
      {
        id: 5,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-buddy/footer/fan%20moving%201.png",
        title: "Fan Robot",
        text: "💡✨ Ready to see your child code their way to fun? Meet the AlgoBuddy Fan Robot! 🌬​ With every sequence they create, young minds learn the magic of turning ideas into action. Watch them master the art of coding while discovering the power of wind! 🚀",
      },
    ],
  },
  "GALILEO_TECHNIC": {
    id: "galileo-technics",
    slug: "GALILEO_TECHNIC",
    title: "GALILEO TECHNICS",
    subtitle: "WELCOME TO GALILEO TECHNIC — AN ADVANCED STEM PROGRAM",
    description:
      "Older kids explore real mechanical principles like torque, motion, and energy using custom building kits. They create machines, solve challenges, and understand how technology works.",
    ageRange: "7–10",
    tag: "STEM",
    createdFor: "Created for children",
    ageText: "age",
    lessonDurationText: "Lesson duration",
    durationUnit: "min",
    lessonDuration: "75",
    lessonsTotal: "36 lessons total",
    borderColor: "#DD043E",
    iconSrc: withCDN("/program-logo/logo_galileo_technic.svg"),
    imageSrc: "https://yefranchisees.b-cdn.net/frontend/programs-page/photo%20(5)%20(1).png",
    ribbonImage: "https://yefranchisees.b-cdn.net/frontend/Program-detail/ribbon_dekstop.png",
    mobileRibbonImage:"https://yefranchisees.b-cdn.net/frontend/programs-page/bg%20%284%29%20%281%29.png",
    categoryTag: "ENGINEERING",
    objectivesHeading: "Program Objectives",
    seeInActionHeading: "See GALILEO TECHNICS in Action",
    whatKidsDiscoverHeading: "What Kids Discover",
    programHighlightsHeading: "program highlights",
    galleryImageSrc: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/instruction.png",
    highlightsImageSrc: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/pct%20(7).png",
    heroBgMobile: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/bg_hero-mobile5.png",
    heroBgDesktop: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/bg_hero-screen2.png",
    objectives: GALILEO_TECHNICS_OBJECTIVES,
    whatKidsDiscover: GALILEO_TECHNICS_DISCOVERIES,
    programHighlights: SHARED_HIGHLIGHTS,
    ctaText: "SIGN UP FOR A TRIAL LESSON",
    signUpCtaText: "SIGN UP FOR A TRIAL LESSON",
    actionText: "See Galileo Technic in Action",
    seeInActionTitle: "See Galileo Technics in Action",
    seeInActionDescription:
      "Experience the thrill of engineering as students design and build sophisticated mechanical systems!",
    autoScrollSliderImages: [
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/photo%20(10).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/photo%20(11).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/photo%20(12).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/photo%20(13).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/photo%20(4).png",
    ],
    reverseAutoScrollSliderImages: [
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/photo%20(5).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/photo%20(6).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/photo%20(7).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/photo%20(8).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/photo%20(9).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/photo-(4).png",
    ],
    gallerySlides: GALILEO_TECHNICS_GALLERY,
    animatedScrollItems: [
      "NEW REALITY FOR YOUR CHILD",
      "GREAT OPPORTUNITIES",
      "TEAMWORK",
    ],
    footerSlides: [
      {
        id: 1,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/footer/RoboWalk%201.png",
        title: "RoboWalk",
        text:
          "Ever wonder how robots can mimic human movement? Our budding engineers are diving into the world of idler gears and discovering the amazing mechanics behind human walking! 🌟 By constructing the RoboWalk, they’re mastering coordination and movement in both robotics and everyday life.​",
      },
      {
        id: 2,
        image:
          "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/pct-6.png",
        title: "Spinning Top Bouncer",
        text:
          "Young innovators are tackling the science behind speed-increasing transmissions with the Spinning Top Bouncer! ⚙️💡 By exploring how gears work on a single axle and learning to calculate speed increases, they’re turning complex mechanics into fun, hands-on learning.​​",
      },
      {
        id: 3,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/pct-8.png",
        title: "Construction Site Crane",
        text: "🏗️ Building the Future, One Crane at a Time! 🏗️​Our students are hard at work mastering the mechanics of a Construction Site Crane! Through hands-on learning, they’re gaining insight into how real-world cranes operate and discovering the magic of mechanical sliding. 🚧💡​",
      },
      {
        id: 4,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/footer/wolf.png",
        title: "Wolf",
        text: "With the Wolf model, our young engineers are exploring the intricate world of gear synchronization! 🐺🔧 They’re learning how neighboring gears work together to create smooth, coordinated movement—an essential skill in the world of mechanics and robotics.",
      },
      {
        id: 5,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/footer/Steamroller%201.png",
        title: "Steamroller",
        text: "🏗The Steamroller model brings real-world engineering concepts to life! This lesson covers everything from symmetry vs. asymmetry to the use of centrifugal force and how circular motion transforms into vibration. It’s a hands-on way to understand the fascinating mechanics behind construction machines. 🚜",
      },
    ],
    featureSection: {
      AiSubtitle: "Supported Advanced Engineering",
      AiDescription:
        "In Galileo Technic, students use the BuildWise App with AI Chat as a digital support tool for advanced mechanical models. AI Chat helps explain how each model works, how motion is transferred, and how mechanisms create specific movements. It supports students in understanding the engineering logic behind the model, making the building process more analytical and connected to real mechanical principles.",
      AiImage: "https://yefranchisees.b-cdn.net/frontend/programs-page/pct-14.png",
      AiButtonText: "SIGN UP FOR A TRIAL LESSON",
      AiButtonLink: "#program-Form",
      reverse: false,
      AiGradientStart: "#ED174C",
      AiGradientEnd: "#8B0025",
    },
  },
  "ROBO_TOYS": {
    id: "robo-toys",
    slug: "ROBO_TOYS",
    title: "ROBO TOYS",
    subtitle: "WELCOME TO ROBO TOYS — A CREATIVE ROBOTICS COURSE",
    description:
      "In this course, kids build fun, interactive machines and bring them to life using simple code. Each class combines play, storytelling, and hands-on building to teach real STEM and logic skills.",
    ageRange: "9–12",
    tag: "ROBOTICS",
    createdFor: "Created for children",
    ageText: "age",
    lessonDurationText: "Lesson duration",
    durationUnit: "min",
    lessonDuration: "75",
    lessonsTotal: "36 lessons total",
    borderColor: "#01A498",
    iconSrc: withCDN("/program-logo/logo_robo_toys.svg"),
    imageSrc: "https://yefranchisees.b-cdn.net/frontend/programs-page/photo%20(6)%20(1).png",
    ribbonImage: "https://yefranchisees.b-cdn.net/frontend/Program-detail/ribbon_dekstop.png",
    mobileRibbonImage:"https://yefranchisees.b-cdn.net/frontend/programs-page/bg%20%285%29%20%281%29.png",
    categoryTag: "ROBOTICS",
    objectivesHeading: "Program Objectives",
    seeInActionHeading: "See ROBO TOYS in Action",
    whatKidsDiscoverHeading: "What Kids Discover",
    programHighlightsHeading: "program highlights",
    galleryImageSrc: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/RT%20instruction.png",
    highlightsImageSrc: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/Zombie_11.png",
    heroBgMobile: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/bg_hero-mobile6.png",
    heroBgDesktop: "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/bg_hero-screen1.png",
    objectives: ROBO_TOYS_OBJECTIVES,
    whatKidsDiscover: ROBO_TOYS_DISCOVERIES,
    programHighlights: SHARED_HIGHLIGHTS,
    ctaText: "SIGN UP FOR A TRIAL LESSON",
    signUpCtaText: "SIGN UP FOR A TRIAL LESSON",
    actionText: "See Robo Toys in Action",
    seeInActionTitle: "See Robo Toys in Action",
    seeInActionDescription:
      "Build amazing robots and code them to life! Watch your imagination become interactive reality!",
    autoScrollSliderImages: [
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/photo%20(10).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/photo%20(11).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/photo%20(12).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/photo%20(13).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/photo%20(4).png",
    ],
    reverseAutoScrollSliderImages: [
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/photo%20(5).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/photo%20(6).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/photo%20(7).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/photo%20(9).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/robotoys/photo-(4).png",
    ],
    gallerySlides: ROBO_TOYS_GALLERY,
    animatedScrollItems: [
      "NEW REALITY FOR YOUR CHILD",
      "GREAT OPPORTUNITIES",
      "TEAMWORK",
    ],

    footerSlides: [
      {
        id: 1,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/pct-6.png",
        title: "RoboTrain",
        text:
          "This lesson brings engineering to life by introducing students to the mechanics of belt transmission, conical gears, and the universal joint. By building the RoboTrain, they’ll gain hands-on experience with key concepts that drive real-world machines! 🔧💡",
      },
      {
        id: 2,
        image:
          "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/pct-6.png",
        title: "Fire Truck",
        text:
          "Discover the power of gear housing and the magic of the Light Infinity Command with the Fire Truck model. Students will explore real-world engineering principles while having fun building and coding this dynamic model. 🔥🚨",
      },
      {
        id: 3,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/galileo%20technic/pct-8.png",
        title: "Merry-Go-Round",
        text: "🎠 Get Ready for a Spin with the Merry-Go-Round Model! 🎠​ This hands-on project helps students dive into key engineering concepts, from measuring technic bricks and axles to understanding essential terms like Robot, Brain Block, and Infinity Command. Plus, it’s a fun way to connect with peers while mastering new skills! 🚀⚙️​",
      },
      {
        id: 4,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/pct-5.png",
        title: "Asteroid Collector",
        text: "Students will dive into the fascinating world of asteroids, learning about their creation and location while also tackling the real-world challenge of space pollution. Through the Asteroid Collector model, they’ll master the Wait time-based Command and sharpen their coding skills! 🚀🧠",
      },
      {
        id: 5,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algo-play/pct-5.png",
        title: "Zombie",
        text: "This model helps students explore key programming concepts like the difference between blocking and non-blocking commands, the power of interrupting commands, and how to implement a walking mechanism. Plus, they’ll get hands-on experience with the Light Time Command to add some extra flair! ⚙️💡",
      },
    ],
    featureSection: {
      AiSubtitle: "Powered Robotics and Machine Learning",
      AiDescription:
        "In RoboToys, students build mechanical robotic models and control them through code. Through the GoAlgo App, AI Chat supports the coding process as students work with commands, actions, and event-based responses. Machine learning allows them to train the AI to recognize inputs, define them as events, and link them to robot commands, enabling the model to respond through code. This helps students understand how trained inputs can trigger robotic actions.",
      AiImage: "https://yefranchisees.b-cdn.net/frontend/programs-page/Pct-15.png",
      AiButtonText: "SIGN UP FOR A TRIAL LESSON",
      AiButtonLink: "#program-Form",
      reverse: false,
      AiGradientStart: "#069B93",
      AiGradientEnd: "#006C64",
    },
  },
  "ROBOTICS": {
    id: "robotics",
    slug: "ROBOTICS",
    title: "ROBOTICS",
    subtitle: "WELCOME TO ROBOTICS — ADVANCED PROGRAMMING & ROBOTICS",
    description:
      "For teenagers ready for the next level. Build sophisticated robots, learn advanced coding, and compete in challenges. This program develops problem-solving skills for the future.",
    ageRange: "12–15",
    tag: "ADVANCED ROBOTICS",
    createdFor: "Created for children",
    ageText: "age",
    lessonDurationText: "Lesson duration",
    durationUnit: "min",
    lessonDuration: "90",
    lessonsTotal: "36 lessons total",
    borderColor: "#0097DC",
    iconSrc: withCDN("/program-logo/logo_pro.svg"),
    imageSrc: "https://yefranchisees.b-cdn.net/frontend/programs-page/AllPrograms/allPrograms1.svg",
    ribbonImage: "https://yefranchisees.b-cdn.net/frontend/Program-detail/ribbon_dekstop.png",
     mobileRibbonImage:"https://yefranchisees.b-cdn.net/frontend/programs-page/bg%20%283%29%20%282%29.png",
    categoryTag: "ADVANCED ROBOTICS",
    objectivesHeading: "Program Objectives",
    seeInActionHeading: "See ROBOTICS in Action",
    whatKidsDiscoverHeading: "What Kids Discover",
    programHighlightsHeading: "program highlights",
    galleryImageSrc: "https://yefranchisees.b-cdn.net/frontend/Program-detail/instruction.png",
    highlightsImageSrc: "https://yefranchisees.b-cdn.net/frontend/Program-detail/snail-robot-shadow-edit%20(1).png",
    heroBgMobile: "https://yefranchisees.b-cdn.net/frontend/Program-detail/bg_mobile.png",
    heroBgDesktop: "https://yefranchisees.b-cdn.net/frontend/Program-detail/bg_hero-screen.jpg",
    objectives: ROBOTICS_OBJECTIVES,
    whatKidsDiscover: ROBOTICS_DISCOVERIES,
    programHighlights: SHARED_HIGHLIGHTS,
    ctaText: "SIGN UP FOR A TRIAL LESSON",
    signUpCtaText: "SIGN UP FOR A TRIAL LESSON",
    actionText: "See Robotics in Action",
    seeInActionTitle: "See Robotics in Action",
    seeInActionDescription:
      "Join teens at the cutting edge of robotics and programming. Build, compete, and innovate with the next generation of engineers!",
    autoScrollSliderImages: [
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/photo.png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/photo%20(1).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/bc_scroll_pct_3.png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/photo%20(2).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/photo%20(3).png",
    ],
    reverseAutoScrollSliderImages: [
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/photo%20(4).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/ab_scroll_pct_7.png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/photo%20(5).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/ab_scroll_pct_9.png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/photo%20(6).png",
    ],
    gallerySlides: ROBOTICS_GALLERY,
    animatedScrollItems: [
      "NEW REALITY FOR YOUR CHILD",
      "GREAT OPPORTUNITIES",
      "TEAMWORK",
    ],
  },
  "SMARTIVO": {
    id: "smartivo",
    slug: "SMARTIVO",
    title: "SMARTIVO",
    subtitle: "Welcome to Your First Step into Coding",
    description:
      "where young children are introduced to the basics of programming through playful story-missions. Using colorful blocks and the GoAlgo app, kids make robots move, light up, and respond to commands.",
    ageRange: "4–6",
    tag: "CODING",
    createdFor: "Created for children",
    ageText: "age",
    lessonDurationText: "Lesson duration",
    durationUnit: "min",
    lessonDuration: "45",
    lessonsTotal: "36 lessons total",
    borderColor: "#0091D6",
    iconSrc: withCDN("/program-logo/logo_smartivo.svg"),
    imageSrc: "https://yefranchisees.b-cdn.net/frontend/programs-page/photo%20(10)%20(1).png",
    ribbonImage: "https://yefranchisees.b-cdn.net/frontend/Program-detail/ribbon_dekstop.png",
    mobileRibbonImage:"https://yefranchisees.b-cdn.net/frontend/programs-page/bg%20%283%29%20%282%29.png",
    categoryTag: "CODING",
    objectivesHeading: "Program Objectives",
    seeInActionHeading: "See Smartivo in Action",
    whatKidsDiscoverHeading: "What Kids Discover",
    programHighlightsHeading: "Program Highlights",
    galleryImageSrc: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/instruction%20-%202%20tab.png",
    highlightsImageSrc: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/Snowplow%20Smartivo_9%20(2)%201.png",
    heroBgMobile: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/bg_hero-mobile2.png",
    heroBgDesktop: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/bg_hero-screen5.png",
    objectives: SMARTIVO_OBJECTIVES,
    whatKidsDiscover: SMARTIVO_DISCOVERIES,
    programHighlights: SHARED_HIGHLIGHTS,
    ctaText: "Register",
    signUpCtaText: "Register",
    actionText: "See Smartivo in Action",
    seeInActionTitle: "See Smartivo in Action",
    seeInActionDescription:
      "Students engage in missions, work with coding blocks and the app, and test their solutions by watching how their robot responds.",
    autoScrollSliderImages: [
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/photo%20(10).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/photo%20(12).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/photo%20(4).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/photo%20(5).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/photo%20(6).png",
    ],
    reverseAutoScrollSliderImages: [
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/photo%20(7).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/photo%20(8).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/photo%20(9).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/photo%201).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/photo-(2).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/photo-(4).png",
    ],
    gallerySlides: SMARTIVO_GALLERY,
    animatedScrollItems: [
      "NEW REALITY FOR YOUR CHILD",
      "GREAT OPPORTUNITIES",
      "TEAMWORK",
    ],
    footerSlides: [
      {
        id: 1,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/pct-4.png",
        title: "Drawing Robot",
        text:
          "Turn every coded move into a masterpiece with sketching movement!",
      },
      {
        id: 2,
        image:
          "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/pct-1.png",
        title: "Random Basket Challenge",
        text:
          "Code the unpredictable! Move, light, and shoot through Random Basket Commands.",
      },
      {
        id: 3,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/pct-6.png",
        title: "Snow Push Challenge",
        text: "Clearing up the roads on a snowy day with Snowplow’s move commands and sequencing!",
      },
      {
        id: 4,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/Smartivo%20powershot_3%20(1)%201.png",
        title: "Obstacle Kick Challenge",
        text: "Master navigating and goal hitting! Now possible with a single Sequence Function.",
      },
      {
        id: 5,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/smartivo/pct-5.png",
        title: "Satellite Spotting Mission",
        text: "It’s a cosmic mission! Smartivo’s Distance Sensor lights up through event-based coding whenever a satellite is detected.",
      },
    ],
  },
  "ALGOC": {
    id: "algo-c",
    slug: "ALGOC",
    title: "ALGOC",
    subtitle: "Introduction to Computational Thinking",
    description:
      "AlgoC introduces children to the fundamentals of coding through visual and interactive methods. Kids learn computational thinking, algorithmic problem-solving, and the basics of programming through engaging activities and real-world applications.",
    ageRange: "6–10",
    tag: "CODING",
    createdFor: "Created for children",
    ageText: "age",
    lessonDurationText: "Lesson duration",
    durationUnit: "min",
    lessonDuration: "60",
    lessonsTotal: "36 lessons total",
    borderColor: "#E89163",
    iconSrc: withCDN("/program-logo/logo_algo_c.svg"),
    imageSrc: "https://yefranchisees.b-cdn.net/frontend/programs-page/photo%20(11)%20(1).png",
    ribbonImage: "https://yefranchisees.b-cdn.net/frontend/Program-detail/ribbon_dekstop.png",
    mobileRibbonImage:"https://yefranchisees.b-cdn.net/frontend/programs-page/bg%20%286%29%20%281%29.png",
    categoryTag: "CODING",
    objectivesHeading: "Program Objectives",
    seeInActionHeading: "See AlgoC in Action",
    whatKidsDiscoverHeading: "What Kids Discover",
    programHighlightsHeading: "Program Highlights",
    galleryImageSrc: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/instruction%20(2).png",
    highlightsImageSrc: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/Beats%20of%20Bits_02.png",
    heroBgMobile: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/bg_hero-mobile7.png",
    heroBgDesktop: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/bg_hero-screen6.png",
    objectives: ALGOC_OBJECTIVES,
    whatKidsDiscover: ALGOC_DISCOVERIES,
    programHighlights: SHARED_HIGHLIGHTS,
    ctaText: "Register",
    signUpCtaText: "Register",
    actionText: "See AlgoC in Action",
    seeInActionTitle: "See AlgoC in Action",
    seeInActionDescription:
      "Watch young learners explore the world of algorithms and coding through visual programming, interactive challenges, and hands-on projects!",
    autoScrollSliderImages: [
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/photo%20(10).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/photo%20(11).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/photo%20(12).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/photo%20(4).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/photo%20(5).png",
    ],
    reverseAutoScrollSliderImages: [
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/photo%20(6).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/photo%20(7).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/photo%20(8).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/photo%20(9).png",
      "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/photo-4).png",
    ],
    gallerySlides: ALGOC_GALLERY,
    animatedScrollItems: [
      "NEW REALITY FOR YOUR CHILD",
      "GREAT OPPORTUNITIES",
      "TEAMWORK",
    ],
    footerSlides: [
      {
        id: 1,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/pct-6.png",
        title: "Portable Printer",
        text:
          "Printing patterns through powerful function syntax and parameters.",
      },
      {
        id: 2,
        image:
          "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/footer/Automatic%20Barbecue%201.png",
        title: "Automatic Barbecue",
        text:
          "With the combination of blocking and non-blocking commands, cooking runs on time and in perfect parallel.",
      },
      {
        id: 3,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/footer/vending%20Machine%201.png",
        title: "Vending Machine",
        text: "Guided by sequential if-else and powered by rotations, the vending machine delivers exactly what you choose.",
      },
      {
        id: 4,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/footer/Factory%20Bricks%20Mover%201.png",
        title: "Factory Bricks Mover",
        text: "Multithreading and global variables allow the robot to perform simultaneous actions, helping the factory work efficiently.",
      },
      {
        id: 5,
        image: "https://yefranchisees.b-cdn.net/frontend/Program-detail/algoc/footer/Goal%20Hitter%201.png",
        title: "Goal Hitter",
        text: "Reading distance, reacting in commands, and striking with precision - Technology of the perfect hit!",
      },
    ],
  },
};

const _fetchProgramDetail = async (id: string, domain: string, language?: string): Promise<ProgramDetailDataWithTranslations> => {
  const startTime = Date.now();
  try {

    // Map language state to actual language code (e.g., "translated" -> "fr")
    const languageCode = getLanguageCode(language, domain);

    // Build request params
    const params: Record<string, string> = {};
    if (languageCode) params.language = languageCode;

    const defaultResponse = await apiClient.get<{
      status: boolean;
      data: any;
    }>(`programs/${id}`, {
      headers: { "X-Domain": domain },
      params: languageCode ? { language: languageCode } : undefined,
    });

    // Fetch translated version if specific language code is returned
    let translatedResponse = null;
    if (languageCode) {
      translatedResponse = await apiClient.get<{
        status: boolean;
        data: any;
      }>(`programs/${id}`, {
        headers: { "X-Domain": domain },
        params,
      });
    }

    const response = defaultResponse;

    if (!response.data?.status || !response.data?.data) {
      return {
        default: PROGRAM_DATA["BIG_BUILDERS"],
        translated: undefined,
      };
    }

    const apiData = response.data.data;
    const programDetails = apiData.program_details || {};
    const slug = apiData.slug || "";

    // Get static data from local PROGRAM_DATA using slug (without numeric suffix)
    const staticData = getStaticDataBySlug(slug) || PROGRAM_DATA["big-builders"];

    const elapsed = Date.now() - startTime;

    // Function to map API data to ProgramDetailData
    const mapToProgramDetailData = (apiData: any, programDetails: any): ProgramDetailData => ({
      id: apiData.id,
      cwProgramId: apiData.cw_program_id ?? null,
      slug: slug,
      // CONTENT from API only
      title: apiData.title,
      subtitle: apiData.sub_heading || "",
      description: apiData.description || "",
      seoTitle: apiData.seo_title || undefined,
      seoDescription: apiData.seo_description || undefined,
      ageRange: apiData.age_range || "",
      lessonDuration: apiData.duration || "",
      lessonsTotal: `${apiData.no_of_lessons || "0"}`,
      ctaText: apiData.button_text || "Register",

      // API-driven label fields (with fallbacks)
      tag: apiData.tag || staticData.categoryTag || "",
      categoryTag: apiData.tag || staticData.categoryTag,
      createdFor: apiData.created_for || programDetails.created_for || staticData.createdFor || "Created for children",
      ageText: apiData.age_text || staticData.ageText || "age",
      lessonDurationText: apiData.lesson_duration_text || staticData.lessonDurationText || "Lesson duration",
      durationUnit: apiData.duration_text || staticData.durationUnit || "min",

      // STYLING from local data ONLY
      borderColor: staticData.borderColor,
      iconSrc: apiData.program_icon ? withCDN(apiData.program_icon) : staticData.iconSrc,
      // Feature image from backend (`header_image`); fall back to the static default when unset.
      imageSrc: apiData.header_image ? withCDN(apiData.header_image) : staticData.imageSrc,
      ribbonImage: staticData.ribbonImage,
      mobileRibbonImage: staticData.mobileRibbonImage,	
      categoryTagTextColor: staticData.categoryTagTextColor,
      categoryTagBackgroundGradient: staticData.categoryTagBackgroundGradient,

      // Objectives from API - content only, icons from static data by index
      objectives: (programDetails.objectives?.items || []).map((item: string, index: number) => ({
        icon: staticData.objectives[index]?.icon || staticData.objectives[0]?.icon || "https://yefranchisees.b-cdn.net/frontend/Program-detail/default-icon.png",
        title: item.split(":")[0] || item,
        description: item,
      })),

      // What kids discover from API - content only, icons from static data by index
      whatKidsDiscover: (programDetails.discover_section?.points || []).map((point: string, index: number) => ({
        icon: staticData.whatKidsDiscover[index]?.icon || staticData.whatKidsDiscover[0]?.icon || "https://yefranchisees.b-cdn.net/frontend/Program-detail/Vector%20(1).png",
        text: point,
      })),

      // Program highlights from API - content only
      programHighlights: (programDetails.program_highlights?.items || []).map((item: any) => ({
        title: item.question || "",
        description: item.answer || "",
      })),

      signUpCtaText: programDetails.action_text?.signup_cta || staticData.signUpCtaText || "SIGN UP FOR A TRIAL LESSON",
      actionText: programDetails.action_text?.title || staticData.actionText,
      seeInActionTitle: programDetails.action_text?.title || staticData.seeInActionTitle,
      seeInActionDescription: programDetails.action_text?.text || staticData.seeInActionDescription,

      // Headings from API
      objectivesHeading: programDetails.objectives?.heading || "Program Objectives",
      seeInActionHeading: programDetails.action_text?.title || "See in Action",
      whatKidsDiscoverHeading: programDetails.discover_section?.heading || "What Kids Discover",
      programHighlightsHeading: programDetails.program_highlights?.heading || "Program Highlights",

      // Static images from local data (unchanged)
      highlightsImageSrc: staticData.highlightsImageSrc,
      galleryImageSrc: staticData.galleryImageSrc,

      // Use API slider images if provided, else fall back to static data
      autoScrollSliderImages:
        programDetails.sliders?.sliderImages && programDetails.sliders.sliderImages.length > 0
          ? programDetails.sliders.sliderImages
          : staticData.autoScrollSliderImages,
      reverseAutoScrollSliderImages:
        programDetails.sliders?.reverseSliderImages && programDetails.sliders.reverseSliderImages.length > 0
          ? programDetails.sliders.reverseSliderImages
          : staticData.reverseAutoScrollSliderImages,

      // Objectives robot gallery: admin-managed (program_details.gallery_slides)
      // overlaid on the static gallery; falls back to static when none set.
      gallerySlides: (() => {
        const apiSlides = Array.isArray(programDetails.gallery_slides)
          ? programDetails.gallery_slides
              .map((s: any) => ({
                img: (s?.robot_image || "").toString().trim(),
                title: (s?.tag || "").toString().trim(),
              }))
              .filter((s: { img: string; title: string }) => s.img || s.title)
          : [];
        return apiSlides.length > 0 ? apiSlides : staticData.gallerySlides;
      })(),
      heroBgMobile: staticData.heroBgMobile,
      heroBgDesktop: staticData.heroBgDesktop,

      // Use API slider_texts for animated scroll if provided, else fall back to static
      animatedScrollItems:
        programDetails.slider_texts && programDetails.slider_texts.length > 0
          ? programDetails.slider_texts
          : staticData.animatedScrollItems,

      videoUrl: programDetails.video_url || staticData.videoUrl,

      // Bottom slider items from admin (filter empties)
      bottomSliders: Array.isArray(programDetails.bottom_sliders)
        ? programDetails.bottom_sliders
          .map((item: any) => ({
            tag: (item?.tag || "").toString().trim(),
            title: (item?.title || "").toString().trim(),
            robot_image: (item?.robot_image || "").toString().trim(),
          }))
          .filter(
            (item: { tag: string; title: string; robot_image: string }) =>
              item.tag || item.title || item.robot_image,
          )
        : [],

      footerSlides: staticData?.footerSlides || [],

      // AI section: admin-managed content (program_details.feature_section) overlaid
      // on the static image/gradient; falls back to fully static when not set.
      featureSection: (() => {
        const apiFeature = programDetails.feature_section;
        const staticFeature = staticData?.featureSection;
        const hasApi =
          apiFeature &&
          ((apiFeature.sub_heading || "").toString().trim() ||
            (apiFeature.description || "").toString().trim());
        if (!hasApi) return staticFeature;
        return {
          heading: apiFeature.heading || staticFeature?.heading || "AI",
          AiSubtitle: apiFeature.sub_heading || staticFeature?.AiSubtitle || "",
          AiDescription:
            apiFeature.description || staticFeature?.AiDescription || "",
          AiButtonText:
            apiFeature.cta_text || staticFeature?.AiButtonText || "SIGN UP FOR A TRIAL LESSON",
          AiButtonLink: apiFeature.cta_url || staticFeature?.AiButtonLink || "#program-Form",
          // Image + gradient stay from static (matched by slug).
          AiImage:
            staticFeature?.AiImage ||
            "https://yefranchisees.b-cdn.net/frontend/programs-page/Group-290910.png",
          reverse: staticFeature?.reverse ?? false,
          AiGradientStart: staticFeature?.AiGradientStart || "#226B20",
          AiGradientEnd: staticFeature?.AiGradientEnd || "#6ECF68",
        };
      })(),

      // Testimonials banner: admin-managed per-program text overlaid on the
      // testimonials section. Only fields the admin actually set are returned;
      // the wrapper falls back to the global defaults for anything left blank.
      testimonialsSection: (() => {
        const ts = programDetails.testimonials_section;
        if (!ts) return undefined;
        const pick = (v: unknown) => {
          const s = (v ?? "").toString().trim();
          return s !== "" ? s : undefined;
        };
        const section = {
          mainHeading: pick(ts.main_heading),
          subHeading: pick(ts.sub_heading),
          feature1: pick(ts.feature1),
          feature2: pick(ts.feature2),
          feature3: pick(ts.feature3),
          feature4: pick(ts.feature4),
        };
        return Object.values(section).some(Boolean) ? section : undefined;
      })(),
    });

    // Map default data
    const defaultMappedData = mapToProgramDetailData(apiData, programDetails);

    // Map translated data if available
    let translatedMappedData: ProgramDetailData | undefined;
    if (translatedResponse?.data?.status && translatedResponse?.data?.data) {
      const translatedApiData = translatedResponse.data.data;
      const translatedProgramDetails = translatedApiData.program_details || {};
      translatedMappedData = mapToProgramDetailData(translatedApiData, translatedProgramDetails);
    }

    return {
      default: defaultMappedData,
      translated: translatedMappedData,
    };
  } catch (error) {
    console.error(`[ProgramDetailService] Error fetching program ${id}:`, error);
    return {
      default: PROGRAM_DATA["BIG_BUILDERS"],
      translated: undefined,
    };
  }
};

/**
 * Program detail fetch.
 *
 * Cross-request caching (`unstable_cache`) is disabled for now — every request
 * hits the backend so content edits show up immediately. Still wrapped in React
 * `cache()` so generateMetadata + the page render share ONE backend call within
 * a single request (per-request dedupe only, no staleness).
 */
export const getProgramDetailById = cache(
  async (id: string, domain: string, language?: string): Promise<ProgramDetailDataWithTranslations> => {
    return _fetchProgramDetail(id, domain, language);
  },
);

/**
 * Match slug from API with local PROGRAM_DATA.
 * Handles exact matches, case differences, and common naming variations.
 */
function getStaticDataBySlug(apiSlug: string): ProgramDetailData | null {
  if (!apiSlug) return null;

  const s = apiSlug.toUpperCase();

  // Try mapping common variations to the fixed keys used in PROGRAM_DATA
  if (s.includes("ALGOC")) return PROGRAM_DATA["ALGOC"] || null;
  if (s.includes("ALGOPLAY")) return PROGRAM_DATA["ALGOPLAY"] || null;
  if (s.includes("ALGO_BUDDY")) return PROGRAM_DATA["ALGO_BUDDY"] || null;
  if (s.includes("BRICKS_CHALLENGE") || s.includes("BRICKS CHALLENGE")) return PROGRAM_DATA["BRICKS_CHALLENGE"] || null;
  if (s.includes("BIG_BUILDERS") || s.includes("BIG BUILDERS")) return PROGRAM_DATA["BIG_BUILDERS"] || null;
  if (s.includes("ROBO_TOYS")) return PROGRAM_DATA["ROBO_TOYS"] || null;
  if (s.includes("ROBOBRICKS")) return PROGRAM_DATA["ROBOBRICKS"] || null;
  if (s.includes("GALILEO_TECHNIC") || s.includes("GALILEO TECHNIC")) return PROGRAM_DATA["GALILEO_TECHNIC"] || null;
  if (s.includes("SMARTIVO")) return PROGRAM_DATA["SMARTIVO"] || null;
  if (s.includes("PRO")) return PROGRAM_DATA["PRO"] || null;

  // Final fallback to exact case-sensitive match
  return PROGRAM_DATA[apiSlug] || null;
}

export async function getProgramDetail(slug: string): Promise<ProgramDetailData | null> {
  try {
    // Using local static data with the mapping logic for flexibility
    return getStaticDataBySlug(slug) || PROGRAM_DATA[slug] || null;
  } catch (error) {
    console.error("Error fetching program detail:", error);
    return getStaticDataBySlug(slug) || PROGRAM_DATA[slug] || null;
  }
}

export function getProgramDetailSync(slug: string): ProgramDetailData | null {
  return getStaticDataBySlug(slug) || PROGRAM_DATA[slug] || null;
}
