Can make me a presentation on topic drugs for treatment of mycosis of skin and its derivatives

Reading File
Reading File
Reading File
Finding Sources
Finding Sources
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Finding Sources
Reading File
Finding Sources
Searching Images

antifungal drug mechanism of action skin mycosis

Reading File
Searching Images

tinea capitis tinea pedis onychomycosis clinical photos

Reading File
Searching Images

ergosterol synthesis pathway azole terbinafine mechanism fungal cell

Reading File
Running Command

mkdir -p /home/daytona/workspace/antifungal-pptx && ls /home/daytona/workspace/antifungal-pptx/

Writing File

~/antifungal-pptx/build.js

const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");

// ── Download images ────────────────────────────────────────────────────────────
const imageUrls = [
  // Clinical presentations composite (tinea capitis, pedis, corporis, cruris, onychomycosis)
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_11d7cf4e49fce6a7701eab40f3667102048917d9e2a96afa56c488595c72c1a3.jpg",
  // Another clinical composite (onychomycosis, candidiasis, pityriasis versicolor)
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_f083aeddbc9f8ce48b590fc2c18dcade267ac0d53be15a0bfea54a019da04e86.jpg",
  // AmphoB mechanism
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_9cba238b28ddb695bf76b8ea05f85765cda3dfd04d149f32c7dd0a713338bfdd.jpg",
  // Onychomycosis + moccasin tinea pedis
  "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_09e97cadc35b1880d65c4adff710ff8b61ac4193a97f64d9638444f48042aec7.jpg",
];

let images = [];
try {
  const cmd = `node /home/daytona/skills/shared/scripts/fetch_images.js ${imageUrls.map(u => `"${u}"`).join(" ")}`;
  images = JSON.parse(execSync(cmd, { maxBuffer: 50 * 1024 * 1024 }).toString());
} catch (e) {
  console.error("Image fetch error:", e.message);
  images = imageUrls.map(() => ({ base64: null, error: "fetch failed" }));
}

// ── Helpers ────────────────────────────────────────────────────────────────────
const DARK_BG   = "0D1B2A";   // deep navy
const MID_BG    = "1B2E45";   // medium navy panel
const ACCENT1   = "00B4D8";   // cyan accent
const ACCENT2   = "90E0EF";   // light cyan
const GREEN     = "52B788";   // teal-green
const GOLD      = "FFD166";   // amber highlight
const WHITE     = "FFFFFF";
const LIGHT_TXT = "CAF0F8";
const MUTED     = "8ECAE6";

function addBg(slide, color = DARK_BG) {
  slide.addShape("rect", { x: 0, y: 0, w: "100%", h: "100%", fill: { color } });
}

function sectionBanner(slide, text, y = 0, h = 0.55) {
  slide.addShape("rect", { x: 0, y, w: "100%", h, fill: { color: ACCENT1 } });
  slide.addText(text, {
    x: 0.3, y: y + 0.04, w: 9.4, h: h - 0.08,
    fontSize: 14, bold: true, color: DARK_BG, fontFace: "Calibri", valign: "middle",
    margin: 0
  });
}

function addBullets(slide, items, x, y, w, h, opts = {}) {
  const defaults = { fontSize: 11, color: WHITE, fontFace: "Calibri", bold: false };
  const o = { ...defaults, ...opts };
  slide.addText(
    items.map((item, i) => ({
      text: item,
      options: { bullet: { type: "bullet" }, breakLine: i < items.length - 1, ...o }
    })),
    { x, y, w, h, valign: "top" }
  );
}

// ══════════════════════════════════════════════════════════════════════════════
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Drugs for Treatment of Mycosis of Skin and Its Derivatives";

// ── SLIDE 1 — Title ────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s, DARK_BG);
  // decorative top stripe
  s.addShape("rect", { x: 0, y: 0, w: "100%", h: 0.08, fill: { color: ACCENT1 } });
  // vertical accent bar
  s.addShape("rect", { x: 0.35, y: 0.7, w: 0.08, h: 4.2, fill: { color: ACCENT1 } });
  // title
  s.addText("Drugs for Treatment of", {
    x: 0.65, y: 0.9, w: 8.7, h: 0.75,
    fontSize: 30, bold: true, color: ACCENT2, fontFace: "Calibri",
  });
  s.addText("Mycosis of Skin and Its Derivatives", {
    x: 0.65, y: 1.55, w: 8.7, h: 0.8,
    fontSize: 28, bold: true, color: WHITE, fontFace: "Calibri",
  });
  s.addText("Superficial & Cutaneous Fungal Infections | Pharmacology", {
    x: 0.65, y: 2.55, w: 8, h: 0.45,
    fontSize: 15, color: MUTED, fontFace: "Calibri", italic: true,
  });
  // decorative pill tags
  ["Topical Antifungals", "Systemic Antifungals", "Dermatophytosis", "Candidiasis"].forEach((tag, i) => {
    s.addShape("roundRect", {
      x: 0.65 + i * 2.25, y: 3.6, w: 2.1, h: 0.38,
      fill: { color: MID_BG }, line: { color: ACCENT1, width: 1 }, rectRadius: 0.12
    });
    s.addText(tag, {
      x: 0.65 + i * 2.25, y: 3.6, w: 2.1, h: 0.38,
      fontSize: 9.5, color: ACCENT2, fontFace: "Calibri", align: "center", valign: "middle",
    });
  });
  s.addText("Sources: Fitzpatrick's Dermatology 9e | Dermatology 5e | Medical Microbiology 9e | Harrison's 22e", {
    x: 0.65, y: 4.9, w: 9.0, h: 0.3,
    fontSize: 7.5, color: MUTED, fontFace: "Calibri",
  });
  s.addShape("rect", { x: 0, y: 5.325, w: "100%", h: 0.3, fill: { color: MID_BG } });
  s.addText("Pharmacology of Cutaneous Mycosis | 2026", {
    x: 0, y: 5.325, w: "100%", h: 0.3,
    fontSize: 9, color: ACCENT2, align: "center", valign: "middle", fontFace: "Calibri",
  });
}

// ── SLIDE 2 — Overview & Classification ───────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s, DARK_BG);
  sectionBanner(s, "Classification of Skin Mycoses");
  s.addText("What are Skin Mycoses?", {
    x: 0.3, y: 0.65, w: 9.4, h: 0.45,
    fontSize: 18, bold: true, color: WHITE, fontFace: "Calibri",
  });
  s.addText(
    "Mycoses of the skin and its derivatives (hair, nails) are fungal infections of the keratinized layers of the integument. " +
    "They are classified by depth and causative organism.",
    { x: 0.3, y: 1.1, w: 9.4, h: 0.55, fontSize: 11, color: LIGHT_TXT, fontFace: "Calibri" }
  );

  // 3 cards
  const cards = [
    {
      title: "Superficial / Cutaneous", color: GREEN,
      items: [
        "Dermatophytoses (tinea spp.)",
        "Tinea versicolor (Malassezia)",
        "Cutaneous candidiasis",
        "Affects stratum corneum, hair & nails",
      ]
    },
    {
      title: "Subcutaneous", color: GOLD,
      items: [
        "Sporotrichosis",
        "Chromoblastomycosis",
        "Mycetoma",
        "Invades dermis & subcutaneous tissue",
      ]
    },
    {
      title: "Systemic (with cutaneous signs)", color: ACCENT1,
      items: [
        "Histoplasmosis",
        "Coccidioidomycosis",
        "Cryptococcosis (skin lesions)",
        "Requires systemic antifungal therapy",
      ]
    },
  ];
  cards.forEach((card, i) => {
    const cx = 0.25 + i * 3.3;
    s.addShape("roundRect", {
      x: cx, y: 1.75, w: 3.1, h: 2.8,
      fill: { color: MID_BG }, line: { color: card.color, width: 2 }, rectRadius: 0.15
    });
    s.addShape("rect", { x: cx, y: 1.75, w: 3.1, h: 0.42, fill: { color: card.color }, rectRadius: 0.1 });
    s.addText(card.title, {
      x: cx + 0.1, y: 1.75, w: 2.9, h: 0.42,
      fontSize: 10.5, bold: true, color: DARK_BG, fontFace: "Calibri", valign: "middle", margin: 0,
    });
    addBullets(s, card.items, cx + 0.15, 2.22, 2.8, 2.2, { fontSize: 10, color: LIGHT_TXT });
  });

  s.addShape("rect", { x: 0, y: 5.325, w: "100%", h: 0.3, fill: { color: MID_BG } });
  s.addText("Focus: Treatment of superficial/cutaneous mycoses — dermatophytoses, candidiasis, pityriasis versicolor", {
    x: 0, y: 5.325, w: "100%", h: 0.3,
    fontSize: 8, color: ACCENT2, align: "center", valign: "middle", fontFace: "Calibri",
  });
}

// ── SLIDE 3 — Clinical Images ─────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s, DARK_BG);
  sectionBanner(s, "Clinical Presentations of Cutaneous Mycoses");
  s.addText("Dermatophytoses — Tinea Species", {
    x: 0.3, y: 0.65, w: 9.4, h: 0.4, fontSize: 16, bold: true, color: WHITE, fontFace: "Calibri",
  });

  if (images[0] && images[0].base64) {
    s.addImage({ data: images[0].base64, x: 0.3, y: 1.15, w: 5.0, h: 3.5 });
  }

  const tineaTypes = [
    ["Tinea Capitis", "Scalp ringworm; hair shaft involvement; treated with oral antifungals (griseofulvin, terbinafine)"],
    ["Tinea Pedis", "Athlete's foot; most common dermatophytosis; topical or oral terbinafine/azoles"],
    ["Tinea Corporis", "Annular 'ringworm' plaque; topical allylamines or imidazoles"],
    ["Tinea Cruris", "Groin; topical antifungals; oral for recalcitrant cases"],
    ["Tinea Unguium", "Onychomycosis; nail involvement; requires prolonged oral therapy"],
  ];
  tineaTypes.forEach(([name, desc], i) => {
    s.addShape("roundRect", {
      x: 5.6, y: 1.15 + i * 0.72, w: 4.05, h: 0.65,
      fill: { color: MID_BG }, line: { color: ACCENT1, width: 0.5 }, rectRadius: 0.1
    });
    s.addText(name, {
      x: 5.7, y: 1.17 + i * 0.72, w: 3.85, h: 0.25,
      fontSize: 10, bold: true, color: ACCENT2, fontFace: "Calibri", margin: 0,
    });
    s.addText(desc, {
      x: 5.7, y: 1.38 + i * 0.72, w: 3.85, h: 0.35,
      fontSize: 8.5, color: LIGHT_TXT, fontFace: "Calibri", margin: 0,
    });
  });
  s.addShape("rect", { x: 0, y: 5.325, w: "100%", h: 0.3, fill: { color: MID_BG } });
  s.addText("Fitzpatrick's Dermatology 9e, Ch. 160 | Dermatology 5e, Ch. 77", {
    x: 0, y: 5.325, w: "100%", h: 0.3,
    fontSize: 8, color: MUTED, align: "center", valign: "middle", fontFace: "Calibri",
  });
}

// ── SLIDE 4 — Clinical Images 2 (Candida / Pityriasis) ────────────────────────
{
  const s = pres.addSlide();
  addBg(s, DARK_BG);
  sectionBanner(s, "Other Cutaneous Mycoses");
  s.addText("Candidiasis & Pityriasis Versicolor", {
    x: 0.3, y: 0.65, w: 9.4, h: 0.4, fontSize: 16, bold: true, color: WHITE, fontFace: "Calibri",
  });
  if (images[1] && images[1].base64) {
    s.addImage({ data: images[1].base64, x: 0.3, y: 1.1, w: 4.7, h: 3.7 });
  }
  const items2 = [
    { title: "Cutaneous Candidiasis", color: GREEN,
      lines: ["Caused by Candida spp. (C. albicans)", "Intertriginous areas, skin folds", "Treatment: topical imidazoles (clotrimazole, miconazole)", "Oral fluconazole for widespread/recurrent cases"] },
    { title: "Pityriasis Versicolor", color: GOLD,
      lines: ["Caused by Malassezia furfur", "Hypopigmented/hyperpigmented macules on trunk", "Treatment: topical selenium sulfide, zinc pyrithione, ketoconazole shampoo", "Oral itraconazole or fluconazole for extensive cases"] },
  ];
  items2.forEach((item, i) => {
    s.addShape("roundRect", {
      x: 5.25, y: 1.1 + i * 2.0, w: 4.4, h: 1.85,
      fill: { color: MID_BG }, line: { color: item.color, width: 2 }, rectRadius: 0.15,
    });
    s.addText(item.title, {
      x: 5.35, y: 1.15 + i * 2.0, w: 4.1, h: 0.35,
      fontSize: 12, bold: true, color: item.color, fontFace: "Calibri", margin: 0,
    });
    addBullets(s, item.lines, 5.35, 1.5 + i * 2.0, 4.1, 1.3, { fontSize: 9.5, color: LIGHT_TXT });
  });
  s.addShape("rect", { x: 0, y: 5.325, w: "100%", h: 0.3, fill: { color: MID_BG } });
  s.addText("Dermatology 5e | Fitzpatrick's Dermatology 9e", {
    x: 0, y: 5.325, w: "100%", h: 0.3,
    fontSize: 8, color: MUTED, align: "center", valign: "middle", fontFace: "Calibri",
  });
}

// ── SLIDE 5 — Mechanism of Action Overview ────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s, DARK_BG);
  sectionBanner(s, "Mechanisms of Action of Antifungal Drugs");
  s.addText("Target Sites in the Fungal Cell", {
    x: 0.3, y: 0.65, w: 9.4, h: 0.4, fontSize: 16, bold: true, color: WHITE, fontFace: "Calibri",
  });

  if (images[2] && images[2].base64) {
    s.addImage({ data: images[2].base64, x: 0.3, y: 1.1, w: 4.2, h: 3.3 });
    s.addText("Amphotericin B binds ergosterol → transmembrane pore formation → cell death", {
      x: 0.3, y: 4.42, w: 4.2, h: 0.4,
      fontSize: 8.5, color: MUTED, fontFace: "Calibri", italic: true, align: "center",
    });
  }

  const mechs = [
    { drug: "Allylamines (Terbinafine, Naftifine)", mech: "Inhibit squalene epoxidase → ↓ ergosterol synthesis + squalene accumulation", color: ACCENT1 },
    { drug: "Azoles (Imidazoles & Triazoles)", mech: "Inhibit lanosterol 14α-demethylase (CYP450) → ↓ ergosterol → disrupted membrane", color: GOLD },
    { drug: "Polyenes (Amphotericin B, Nystatin)", mech: "Bind ergosterol directly → pore formation → ion leakage → cell death", color: GREEN },
    { drug: "Griseofulvin", mech: "Inhibits fungal microtubule polymerization → arrests mitosis in metaphase", color: MUTED },
    { drug: "Ciclopirox", mech: "Chelates metal ions → inhibits metal-dependent enzymes; disrupts cell membrane", color: ACCENT2 },
    { drug: "Echinocandins (Caspofungin)", mech: "Inhibit β-1,3-glucan synthase → ↓ cell wall synthesis (not first-line for skin)", color: "#E07A5F" },
  ];
  mechs.forEach((m, i) => {
    const col = i < 3 ? 4.75 : 4.75;
    const row = i % 3;
    const xOff = i < 3 ? 4.7 : 7.2;  // we fit in 2 columns on right side only if needed
    // Put all 6 in single column on right
    s.addShape("rect", { x: 4.7, y: 1.1 + i * 0.72, w: 5.0, h: 0.65, fill: { color: MID_BG } });
    s.addShape("rect", { x: 4.7, y: 1.1 + i * 0.72, w: 0.06, h: 0.65, fill: { color: m.color } });
    s.addText(m.drug, {
      x: 4.85, y: 1.12 + i * 0.72, w: 4.7, h: 0.25,
      fontSize: 9.5, bold: true, color: m.color, fontFace: "Calibri", margin: 0,
    });
    s.addText(m.mech, {
      x: 4.85, y: 1.33 + i * 0.72, w: 4.7, h: 0.35,
      fontSize: 8.5, color: LIGHT_TXT, fontFace: "Calibri", margin: 0,
    });
  });
  s.addShape("rect", { x: 0, y: 5.325, w: "100%", h: 0.3, fill: { color: MID_BG } });
  s.addText("Medical Microbiology 9e, Table 61.1 | Dermatology 5e, Fig. 127.9", {
    x: 0, y: 5.325, w: "100%", h: 0.3,
    fontSize: 8, color: MUTED, align: "center", valign: "middle", fontFace: "Calibri",
  });
}

// ── SLIDE 6 — Topical Antifungals ─────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s, DARK_BG);
  sectionBanner(s, "Topical Antifungal Agents");
  s.addText("First-line for localized superficial infections", {
    x: 0.3, y: 0.65, w: 9.4, h: 0.35, fontSize: 14, color: LIGHT_TXT, fontFace: "Calibri", italic: true,
  });

  const topicals = [
    { class: "Allylamines", color: ACCENT1,
      agents: "Terbinafine 1%, Naftifine 1%",
      indications: "Tinea pedis, corporis, cruris; apply 1–2× daily × 1–4 wks",
      notes: "Fungicidal; superior cure rates vs imidazoles for dermatophytes" },
    { class: "Imidazoles", color: GOLD,
      agents: "Clotrimazole, Miconazole, Ketoconazole, Econazole, Oxiconazole",
      indications: "Tinea spp., cutaneous candidiasis, pityriasis versicolor",
      notes: "Fungistatic; broad-spectrum including Candida & Malassezia; OTC available" },
    { class: "Benzylamines", color: GREEN,
      agents: "Butenafine 1%",
      indications: "Tinea pedis, corporis, cruris; once-daily dosing available",
      notes: "Similar to allylamines; inhibits squalene epoxidase" },
    { class: "Hydroxypyridones", color: MUTED,
      agents: "Ciclopirox 0.77% cream, 8% nail lacquer",
      indications: "Dermatophytoses, candidiasis, onychomycosis (nail lacquer)",
      notes: "Broad-spectrum; metal chelation MOA; nail lacquer for mild onychomycosis" },
    { class: "Polyenes (topical)", color: ACCENT2,
      agents: "Nystatin cream, powder",
      indications: "Cutaneous candidiasis, intertrigo",
      notes: "Fungicidal vs Candida; NOT active against dermatophytes" },
    { class: "Others", color: "#E07A5F",
      agents: "Tolnaftate 1%, Selenium sulfide 2.5%, Zinc pyrithione",
      indications: "Tinea pedis/corporis (tolnaftate); pityriasis versicolor (selenium sulfide)",
      notes: "Tolnaftate: OTC; selenium sulfide/ketoconazole shampoo as body wash for PV" },
  ];

  topicals.forEach((row, i) => {
    const y = 1.1 + i * 0.73;
    s.addShape("rect", { x: 0.2, y, w: 9.6, h: 0.66, fill: { color: i % 2 === 0 ? MID_BG : "152338" } });
    s.addShape("rect", { x: 0.2, y, w: 0.06, h: 0.66, fill: { color: row.color } });
    s.addText(row.class, {
      x: 0.35, y: y + 0.04, w: 1.5, h: 0.25,
      fontSize: 9.5, bold: true, color: row.color, fontFace: "Calibri", margin: 0,
    });
    s.addText(row.agents, {
      x: 0.35, y: y + 0.31, w: 1.6, h: 0.28,
      fontSize: 8, color: LIGHT_TXT, fontFace: "Calibri", margin: 0,
    });
    s.addText(row.indications, {
      x: 1.95, y: y + 0.04, w: 4.0, h: 0.55,
      fontSize: 8.5, color: LIGHT_TXT, fontFace: "Calibri", margin: 0,
    });
    s.addText(row.notes, {
      x: 6.0, y: y + 0.04, w: 3.7, h: 0.55,
      fontSize: 8, color: MUTED, fontFace: "Calibri", italic: true, margin: 0,
    });
  });

  // Column headers
  const headers = ["Class", "Agents", "Indications / Dosing", "Notes"];
  const hx = [0.35, 1.95, 1.95, 6.0];
  const hw = [1.5, 1.5, 4.0, 3.7];
  headers.forEach((h, i) => {
    s.addText(h, {
      x: hx[i], y: 0.98, w: hw[i] + (i === 1 ? 2.2 : 0), h: 0.25,
      fontSize: 8, bold: true, color: ACCENT1, fontFace: "Calibri", margin: 0,
      underline: true,
    });
  });

  s.addShape("rect", { x: 0, y: 5.325, w: "100%", h: 0.3, fill: { color: MID_BG } });
  s.addText("Dermatology 5e, Tables 127.12 & 127.13 | Fitzpatrick's 9e, Tables 160-10 & 160-11", {
    x: 0, y: 5.325, w: "100%", h: 0.3,
    fontSize: 8, color: MUTED, align: "center", valign: "middle", fontFace: "Calibri",
  });
}

// ── SLIDE 7 — Oral Systemic Antifungals ───────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s, DARK_BG);
  sectionBanner(s, "Systemic (Oral) Antifungal Agents for Skin Mycoses");
  s.addText("Indicated for: hair/nail infections, widespread disease, immunocompromise, topical failure", {
    x: 0.3, y: 0.65, w: 9.4, h: 0.35, fontSize: 11, color: MUTED, fontFace: "Calibri", italic: true,
  });

  const drugs = [
    { drug: "Terbinafine", class: "Allylamine", mech: "Squalene epoxidase inhibitor", dose: "250 mg/day oral", indications: "Onychomycosis (fingernail 6 wks, toenail 12 wks); tinea capitis", se: "GI upset, hepatotoxicity (rare), taste disturbance", color: ACCENT1 },
    { drug: "Itraconazole", class: "Triazole", mech: "Lanosterol 14α-demethylase inhibitor", dose: "200 mg/day or pulse 200 mg BID × 1 wk/month", indications: "Onychomycosis (pulse therapy), widespread dermatophytosis, PV, candidiasis", se: "Hepatotoxicity, negative inotropy, drug interactions (CYP3A4)", color: GOLD },
    { drug: "Fluconazole", class: "Triazole", mech: "Lanosterol 14α-demethylase inhibitor", dose: "150–300 mg/week for tinea; 50 mg/day", indications: "Candidiasis (skin, mucosal), tinea capitis/corporis, PV (less efficacious vs dermatophytes)", se: "Nausea, headache, rare hepatotoxicity; QT prolongation at high doses", color: GREEN },
    { drug: "Griseofulvin", class: "Antimitotic", mech: "Inhibits fungal microtubule assembly", dose: "Microsize 500–1000 mg/day; ultramicrosize 375–500 mg/day (with fatty meal)", indications: "Tinea capitis (drug of choice in children), tinea corporis", se: "Photosensitivity, GI, headache; CYP inducer; contraindicated in porphyria", color: MUTED },
    { drug: "Ketoconazole (systemic)", class: "Imidazole", mech: "Lanosterol 14α-demethylase inhibitor", dose: "200–400 mg/day (RESTRICTED USE)", indications: "Reserved for refractory cases; shampoo/cream used topically for PV", se: "Hepatotoxicity, adrenal suppression, QT prolongation; many drug interactions", color: "#E07A5F" },
  ];

  drugs.forEach((d, i) => {
    const y = 1.08 + i * 0.87;
    s.addShape("roundRect", {
      x: 0.2, y, w: 9.6, h: 0.8,
      fill: { color: MID_BG }, line: { color: d.color, width: 0.8 }, rectRadius: 0.1,
    });
    // Drug name badge
    s.addShape("roundRect", {
      x: 0.25, y: y + 0.08, w: 1.55, h: 0.65,
      fill: { color: d.color }, rectRadius: 0.08,
    });
    s.addText(d.drug, {
      x: 0.25, y: y + 0.08, w: 1.55, h: 0.35,
      fontSize: 11, bold: true, color: DARK_BG, fontFace: "Calibri", align: "center", valign: "bottom", margin: 0,
    });
    s.addText(d.class, {
      x: 0.25, y: y + 0.43, w: 1.55, h: 0.25,
      fontSize: 8.5, color: DARK_BG, fontFace: "Calibri", align: "center", valign: "top", margin: 0,
    });
    // Mechanism
    s.addText("⚙ " + d.mech, {
      x: 1.95, y: y + 0.05, w: 2.4, h: 0.3,
      fontSize: 8.5, color: ACCENT2, fontFace: "Calibri", margin: 0,
    });
    // Dose
    s.addText("💊 " + d.dose, {
      x: 1.95, y: y + 0.38, w: 2.4, h: 0.35,
      fontSize: 8, color: LIGHT_TXT, fontFace: "Calibri", margin: 0,
    });
    // Indications
    s.addText(d.indications, {
      x: 4.45, y: y + 0.05, w: 3.0, h: 0.68,
      fontSize: 8.5, color: LIGHT_TXT, fontFace: "Calibri", margin: 0,
    });
    // Side effects
    s.addText("⚠ " + d.se, {
      x: 7.55, y: y + 0.05, w: 2.1, h: 0.68,
      fontSize: 8, color: "#FFB347", fontFace: "Calibri", margin: 0,
    });
  });

  s.addShape("rect", { x: 0, y: 5.325, w: "100%", h: 0.3, fill: { color: MID_BG } });
  s.addText("Dermatology 5e, Table 127.18 | Harrison's 22e | Medical Microbiology 9e, Table 61.1", {
    x: 0, y: 5.325, w: "100%", h: 0.3,
    fontSize: 8, color: MUTED, align: "center", valign: "middle", fontFace: "Calibri",
  });
}

// ── SLIDE 8 — Onychomycosis Deep-Dive ─────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s, DARK_BG);
  sectionBanner(s, "Treatment of Onychomycosis (Tinea Unguium)");
  s.addText("Nail Mycosis — Most Challenging to Treat", {
    x: 0.3, y: 0.65, w: 9.4, h: 0.4, fontSize: 16, bold: true, color: WHITE, fontFace: "Calibri",
  });

  if (images[3] && images[3].base64) {
    s.addImage({ data: images[3].base64, x: 0.3, y: 1.1, w: 4.5, h: 3.2 });
    s.addText("Distal-lateral subungual onychomycosis + moccasin tinea pedis", {
      x: 0.3, y: 4.32, w: 4.5, h: 0.3,
      fontSize: 7.5, color: MUTED, fontFace: "Calibri", italic: true, align: "center",
    });
  }

  const oData = [
    { header: "Oral Terbinafine (First-Line)", color: ACCENT1,
      lines: ["Fingernails: 250 mg/day × 6 weeks", "Toenails: 250 mg/day × 12 weeks", "Fungicidal; highest mycologic cure rates", "Monitor LFTs; avoid in liver disease"] },
    { header: "Oral Itraconazole (Pulse)", color: GOLD,
      lines: ["200 mg BID × 1 week/month", "Fingernails: 2 pulses; Toenails: 3 pulses", "Broad spectrum; useful for non-dermatophyte molds", "CYP3A4 interactions; negative inotrope"] },
    { header: "Topical (Adjunct / Mild cases)", color: GREEN,
      lines: ["Ciclopirox 8% lacquer (Penlac) — apply daily × ≥48 weeks", "Efinaconazole 10% solution (Jublia) — once daily", "Tavaborole 5% solution (Kerydin) — once daily", "Lower cure rates; no systemic effects"] },
    { header: "Griseofulvin (Historical / Pediatric)", color: MUTED,
      lines: ["4–6 months for fingernails; 6+ months for toenails", "No longer commonly used for onychomycosis", "Used for tinea capitis in children when terbinafine unavailable"] },
  ];
  oData.forEach((item, i) => {
    const row = Math.floor(i / 2);
    const col = i % 2;
    const x = 5.05 + col * 2.4;
    const y = 1.1 + row * 2.15;
    s.addShape("roundRect", {
      x, y, w: 2.25, h: 2.0,
      fill: { color: MID_BG }, line: { color: item.color, width: 1.5 }, rectRadius: 0.1,
    });
    s.addShape("rect", { x, y, w: 2.25, h: 0.35, fill: { color: item.color } });
    s.addText(item.header, {
      x: x + 0.07, y, w: 2.1, h: 0.35,
      fontSize: 8, bold: true, color: DARK_BG, fontFace: "Calibri", valign: "middle", margin: 0,
    });
    addBullets(s, item.lines, x + 0.1, y + 0.4, 2.0, 1.5, { fontSize: 8, color: LIGHT_TXT });
  });

  s.addShape("rect", { x: 0, y: 5.325, w: "100%", h: 0.3, fill: { color: MID_BG } });
  s.addText("Dermatology 5e | Fitzpatrick's 9e | Harrison's 22e", {
    x: 0, y: 5.325, w: "100%", h: 0.3,
    fontSize: 8, color: MUTED, align: "center", valign: "middle", fontFace: "Calibri",
  });
}

// ── SLIDE 9 — Tinea Capitis Deep-Dive ─────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s, DARK_BG);
  sectionBanner(s, "Treatment of Tinea Capitis (Scalp Ringworm)");
  s.addText("Hair shaft involvement requires oral therapy — topical antifungals are insufficient", {
    x: 0.3, y: 0.65, w: 9.4, h: 0.35, fontSize: 11, color: MUTED, fontFace: "Calibri", italic: true,
  });

  const tcData = [
    { drug: "Griseofulvin", detail: "Microsize: 20–25 mg/kg/day (children)\nDuration: 6–12 weeks\nFirst-line in many regions; must be taken with fatty meal\nNot active against Candida or Malassezia", color: GOLD },
    { drug: "Terbinafine", detail: "< 20 kg: 62.5 mg/day\n20–40 kg: 125 mg/day\n> 40 kg: 250 mg/day\n4–6 weeks; preferred for T. tonsurans infections", color: ACCENT1 },
    { drug: "Itraconazole", detail: "5 mg/kg/day × 4–6 weeks OR\n5 mg/kg/day pulse 1 wk/month × 2–3 months\nBetter for M. canis infections", color: GREEN },
    { drug: "Fluconazole", detail: "6 mg/kg/day × 3–6 weeks\nAlternative option; good safety profile in children\nActive against M. canis & T. tonsurans", color: MUTED },
  ];

  tcData.forEach((item, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = 0.25 + col * 4.85;
    const y = 1.1 + row * 2.15;
    s.addShape("roundRect", {
      x, y, w: 4.6, h: 1.9,
      fill: { color: MID_BG }, line: { color: item.color, width: 2 }, rectRadius: 0.12,
    });
    s.addShape("rect", { x, y, w: 4.6, h: 0.4, fill: { color: item.color } });
    s.addText(item.drug, {
      x: x + 0.1, y, w: 4.4, h: 0.4,
      fontSize: 14, bold: true, color: DARK_BG, fontFace: "Calibri", valign: "middle", margin: 0,
    });
    s.addText(item.detail, {
      x: x + 0.15, y: y + 0.48, w: 4.3, h: 1.35,
      fontSize: 10, color: LIGHT_TXT, fontFace: "Calibri",
    });
  });

  s.addShape("rect", { x: 0, y: 5.08, w: "100%", h: 0.22, fill: { color: "#1B3A5C" } });
  s.addText("Adjunct: Selenium sulfide 1–2.5% or ketoconazole 2% shampoo (2×/week) to reduce spore shedding", {
    x: 0, y: 5.08, w: "100%", h: 0.22,
    fontSize: 8.5, color: ACCENT2, align: "center", valign: "middle", fontFace: "Calibri",
  });
  s.addShape("rect", { x: 0, y: 5.325, w: "100%", h: 0.3, fill: { color: MID_BG } });
  s.addText("Harriet Lane Handbook 23e | Red Book 2021 | Dermatology 5e", {
    x: 0, y: 5.325, w: "100%", h: 0.3,
    fontSize: 8, color: MUTED, align: "center", valign: "middle", fontFace: "Calibri",
  });
}

// ── SLIDE 10 — Drug Comparison Table ─────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s, DARK_BG);
  sectionBanner(s, "Antifungal Drug Comparison — Quick Reference");

  // Table header
  const cols = [
    { label: "Drug", x: 0.2, w: 1.5 },
    { label: "Class", x: 1.7, w: 1.2 },
    { label: "Route", x: 2.9, w: 0.8 },
    { label: "MOA target", x: 3.7, w: 2.0 },
    { label: "Spectrum", x: 5.7, w: 1.8 },
    { label: "Key Side Effects", x: 7.5, w: 2.25 },
  ];
  s.addShape("rect", { x: 0.2, y: 0.6, w: 9.55, h: 0.32, fill: { color: ACCENT1 } });
  cols.forEach(c => {
    s.addText(c.label, {
      x: c.x + 0.05, y: 0.62, w: c.w, h: 0.28,
      fontSize: 8.5, bold: true, color: DARK_BG, fontFace: "Calibri", margin: 0,
    });
  });

  const rows = [
    ["Terbinafine", "Allylamine", "T / O", "Squalene epoxidase", "Dermatophytes (fungicidal)", "GI, taste, hepatotox (rare)", ACCENT1],
    ["Naftifine", "Allylamine", "T", "Squalene epoxidase", "Dermatophytes", "Local irritation", ACCENT1],
    ["Clotrimazole", "Imidazole", "T", "14α-demethylase", "Dermatophytes, Candida, Malassezia", "Local irritation", GOLD],
    ["Miconazole", "Imidazole", "T / IV", "14α-demethylase", "Dermatophytes, Candida", "Local burning", GOLD],
    ["Ketoconazole", "Imidazole", "T / O", "14α-demethylase", "Broad (dermatophytes, yeast)", "Hepatotox, adrenal suppression", GOLD],
    ["Itraconazole", "Triazole", "O / IV", "14α-demethylase", "Broad including molds", "Hepatotox, ↓ cardiac contractility", GOLD],
    ["Fluconazole", "Triazole", "O / IV", "14α-demethylase", "Candida, limited dermatophytes", "Nausea, QT prolongation", GOLD],
    ["Griseofulvin", "Antimitotic", "O", "Microtubules", "Dermatophytes ONLY", "Photosensitivity, CYP inducer", MUTED],
    ["Ciclopirox", "Hydroxypyridone", "T", "Metal chelation", "Broad (dermatophytes, Candida)", "Local irritation", GREEN],
    ["Nystatin", "Polyene", "T", "Ergosterol binding", "Candida ONLY (topical)", "Local irritation", ACCENT2],
    ["Amphotericin B", "Polyene", "IV", "Ergosterol pore", "Broad, systemic mycoses", "Nephrotoxicity, infusion reactions", "#E07A5F"],
  ];

  rows.forEach((r, i) => {
    const y = 0.97 + i * 0.41;
    s.addShape("rect", {
      x: 0.2, y, w: 9.55, h: 0.4,
      fill: { color: i % 2 === 0 ? MID_BG : DARK_BG }
    });
    s.addShape("rect", { x: 0.2, y, w: 0.06, h: 0.4, fill: { color: r[6] } });
    const vals = r.slice(0, 6);
    vals.forEach((val, j) => {
      s.addText(val, {
        x: cols[j].x + 0.1, y: y + 0.04, w: cols[j].w - 0.05, h: 0.32,
        fontSize: 8, color: j === 0 ? r[6] : LIGHT_TXT, bold: j === 0, fontFace: "Calibri", margin: 0,
      });
    });
  });

  s.addShape("rect", { x: 0, y: 5.325, w: "100%", h: 0.3, fill: { color: MID_BG } });
  s.addText("T=Topical, O=Oral, IV=Intravenous | Medical Microbiology 9e | Dermatology 5e", {
    x: 0, y: 5.325, w: "100%", h: 0.3,
    fontSize: 8, color: MUTED, align: "center", valign: "middle", fontFace: "Calibri",
  });
}

// ── SLIDE 11 — Treatment Algorithm ───────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s, DARK_BG);
  sectionBanner(s, "Treatment Algorithm — Selecting the Right Antifungal");

  const nodes = [
    { label: "Fungal skin infection suspected", x: 3.5, y: 0.65, w: 3.0, h: 0.5, color: ACCENT1, textColor: DARK_BG },
  ];
  nodes.forEach(n => {
    s.addShape("roundRect", { x: n.x, y: n.y, w: n.w, h: n.h, fill: { color: n.color }, rectRadius: 0.15 });
    s.addText(n.label, {
      x: n.x, y: n.y, w: n.w, h: n.h,
      fontSize: 10, bold: true, color: n.textColor, fontFace: "Calibri", align: "center", valign: "middle",
    });
  });

  // Arrow down
  s.addShape("line", { x: 4.95, y: 1.15, w: 0.01, h: 0.3, line: { color: ACCENT1, width: 2 } });

  // 3 branches
  const branches = [
    { label: "Skin only\n(localized)", x: 0.3, y: 1.5, color: GREEN },
    { label: "Hair / Nail\ninvolvement", x: 3.8, y: 1.5, color: GOLD },
    { label: "Candidiasis /\nPityriasis versicolor", x: 7.1, y: 1.5, color: ACCENT2 },
  ];
  s.addShape("line", { x: 0.95, y: 1.45, w: 9.0, h: 0.01, line: { color: ACCENT1, width: 1.5 } });
  branches.forEach(b => {
    s.addShape("roundRect", { x: b.x, y: b.y, w: 2.5, h: 0.55, fill: { color: b.color }, rectRadius: 0.1 });
    s.addText(b.label, {
      x: b.x, y: b.y, w: 2.5, h: 0.55,
      fontSize: 9.5, bold: true, color: DARK_BG, fontFace: "Calibri", align: "center", valign: "middle",
    });
  });

  // Sub-boxes per branch
  const subBoxes = [
    [
      { label: "Topical allylamine\n(terbinafine 1% × 1–2 wk)", color: ACCENT1 },
      { label: "Topical imidazole\n(clotrimazole, miconazole × 2–4 wk)", color: GOLD },
      { label: "If widespread/failed:\nOral terbinafine or itraconazole", color: MUTED },
    ],
    [
      { label: "Tinea capitis:\nOral griseofulvin or terbinafine\n(4–12 weeks)", color: GOLD },
      { label: "Onychomycosis:\nOral terbinafine (6–12 wks)\nor itraconazole pulse therapy", color: ACCENT1 },
      { label: "Topical ciclopirox lacquer\nfor mild onychomycosis\nor adjunct therapy", color: GREEN },
    ],
    [
      { label: "Topical: nystatin, clotrimazole\nfor candidiasis", color: ACCENT2 },
      { label: "Topical: ketoconazole/selenium\nsulfide for pityriasis versicolor", color: GOLD },
      { label: "Extensive/recurrent:\nOral fluconazole or itraconazole", color: ACCENT1 },
    ],
  ];

  subBoxes.forEach((col, ci) => {
    col.forEach((box, ri) => {
      const x = 0.25 + ci * 3.25;
      const y = 2.15 + ri * 1.05;
      s.addShape("roundRect", {
        x, y, w: 3.05, h: 0.95,
        fill: { color: MID_BG }, line: { color: box.color, width: 1.5 }, rectRadius: 0.1
      });
      s.addText(box.label, {
        x: x + 0.1, y: y + 0.05, w: 2.85, h: 0.85,
        fontSize: 9, color: LIGHT_TXT, fontFace: "Calibri", align: "left", valign: "middle",
      });
    });
  });

  s.addShape("rect", { x: 0, y: 5.325, w: "100%", h: 0.3, fill: { color: MID_BG } });
  s.addText("Harrison's 22e | Fitzpatrick's 9e | Harriet Lane Handbook 23e", {
    x: 0, y: 5.325, w: "100%", h: 0.3,
    fontSize: 8, color: MUTED, align: "center", valign: "middle", fontFace: "Calibri",
  });
}

// ── SLIDE 12 — Special Considerations ────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s, DARK_BG);
  sectionBanner(s, "Special Considerations & Contraindications");

  const panels = [
    { title: "Pregnancy & Lactation", color: "#F4A261", icon: "🤰",
      items: [
        "Topical azoles: generally safe (minimal absorption)",
        "Griseofulvin: CONTRAINDICATED (teratogenic)",
        "Itraconazole: Avoid (cardiac concerns, teratogenic in animals)",
        "Fluconazole: Avoid high-dose systemic use (teratogenic risk)",
        "Terbinafine: Limited data; use with caution",
        "Nystatin topical: Safe (not absorbed)",
      ]},
    { title: "Pediatrics", color: ACCENT2, icon: "👶",
      items: [
        "Griseofulvin: First-line for tinea capitis in young children",
        "Terbinafine: Weight-based dosing for tinea capitis (>2 yrs)",
        "Fluconazole: Safe alternative in children",
        "Topical antifungals: Generally safe for children",
        "Monitor for hepatotoxicity with systemic agents",
      ]},
    { title: "Drug Interactions", color: GOLD, icon: "⚗",
      items: [
        "Azoles inhibit CYP3A4 → ↑ levels of statins, warfarin, cyclosporine",
        "Itraconazole: Contraindicated with cisapride, pimozide, quinidine",
        "Ketoconazole: CYP3A4 inhibitor; many serious interactions",
        "Griseofulvin: CYP INDUCER → ↓ warfarin, OCPs",
        "Terbinafine: CYP2D6 inhibitor (mild interactions)",
      ]},
    { title: "Immunocompromised / Renal/Hepatic", color: "#E07A5F", icon: "⚠",
      items: [
        "Dose-adjust fluconazole in renal impairment",
        "Avoid itraconazole in significant hepatic disease",
        "Terbinafine: contraindicated in liver disease (LFTs required)",
        "Immunocompromised: may require systemic therapy for localized infections",
        "Consider resistance in recurrent/refractory cases",
      ]},
  ];

  panels.forEach((p, i) => {
    const col = i % 2;
    const row = Math.floor(i / 2);
    const x = 0.2 + col * 4.9;
    const y = 0.65 + row * 2.35;
    s.addShape("roundRect", {
      x, y, w: 4.65, h: 2.2,
      fill: { color: MID_BG }, line: { color: p.color, width: 2 }, rectRadius: 0.15,
    });
    s.addShape("rect", { x, y, w: 4.65, h: 0.38, fill: { color: p.color }, rectRadius: 0.1 });
    s.addText(p.icon + "  " + p.title, {
      x: x + 0.1, y, w: 4.45, h: 0.38,
      fontSize: 11, bold: true, color: DARK_BG, fontFace: "Calibri", valign: "middle", margin: 0,
    });
    addBullets(s, p.items, x + 0.12, y + 0.44, 4.4, 1.65, { fontSize: 9, color: LIGHT_TXT });
  });

  s.addShape("rect", { x: 0, y: 5.325, w: "100%", h: 0.3, fill: { color: MID_BG } });
  s.addText("Dermatology 5e | Medical Microbiology 9e | Fitzpatrick's 9e", {
    x: 0, y: 5.325, w: "100%", h: 0.3,
    fontSize: 8, color: MUTED, align: "center", valign: "middle", fontFace: "Calibri",
  });
}

// ── SLIDE 13 — Summary ────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s, DARK_BG);
  s.addShape("rect", { x: 0, y: 0, w: "100%", h: 0.08, fill: { color: ACCENT1 } });
  s.addText("Summary", {
    x: 0.4, y: 0.2, w: 9.2, h: 0.55,
    fontSize: 26, bold: true, color: WHITE, fontFace: "Calibri",
  });
  s.addText("Key Takeaways — Antifungals for Skin Mycoses", {
    x: 0.4, y: 0.75, w: 9.2, h: 0.35,
    fontSize: 14, color: MUTED, fontFace: "Calibri", italic: true,
  });

  const takeaways = [
    ["1", "Localized cutaneous mycoses → Topical allylamines (terbinafine) or imidazoles (clotrimazole, miconazole). Apply 1–4 weeks.", ACCENT1],
    ["2", "Hair (tinea capitis) → Always oral. Griseofulvin (children) or terbinafine. 4–12 weeks minimum.", GOLD],
    ["3", "Nail (onychomycosis) → Oral terbinafine (first-line) or itraconazole pulse. Prolonged therapy (6–12 weeks+).", GREEN],
    ["4", "Candidiasis → Topical nystatin or clotrimazole; oral fluconazole for recurrent/widespread cases.", ACCENT2],
    ["5", "Pityriasis versicolor → Topical selenium sulfide or ketoconazole shampoo; oral azoles for extensive disease.", MUTED],
    ["6", "Drug interactions: Azoles inhibit CYP3A4. Griseofulvin induces CYP enzymes. Monitor LFTs with systemic agents.", "#E07A5F"],
  ];

  takeaways.forEach(([num, text, color], i) => {
    const y = 1.18 + i * 0.68;
    s.addShape("circle", { x: 0.25, y: y + 0.02, w: 0.42, h: 0.42, fill: { color } });
    s.addText(num, {
      x: 0.25, y: y + 0.02, w: 0.42, h: 0.42,
      fontSize: 14, bold: true, color: DARK_BG, fontFace: "Calibri", align: "center", valign: "middle",
    });
    s.addShape("rect", {
      x: 0.75, y: y + 0.05, w: 9.0, h: 0.5,
      fill: { color: MID_BG },
    });
    s.addShape("rect", { x: 0.75, y: y + 0.05, w: 0.06, h: 0.5, fill: { color } });
    s.addText(text, {
      x: 0.9, y: y + 0.07, w: 8.7, h: 0.44,
      fontSize: 10.5, color: LIGHT_TXT, fontFace: "Calibri", valign: "middle",
    });
  });

  s.addShape("rect", { x: 0, y: 5.325, w: "100%", h: 0.3, fill: { color: MID_BG } });
  s.addText("Content sourced from: Fitzpatrick's Dermatology 9e | Dermatology 5e | Medical Microbiology 9e | Harrison's 22e | Red Book 2021", {
    x: 0, y: 5.325, w: "100%", h: 0.3,
    fontSize: 7.5, color: MUTED, align: "center", valign: "middle", fontFace: "Calibri",
  });
}

// ── Write file ─────────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/antifungal-pptx/Antifungal_Skin_Mycosis.pptx" })
  .then(() => console.log("DONE: /home/daytona/workspace/antifungal-pptx/Antifungal_Skin_Mycosis.pptx"))
  .catch(err => { console.error("ERROR:", err); process.exit(1); });
Running Command

cd /home/daytona/workspace/antifungal-pptx && node build.js 2>&1

You've run out of free credits. Sign up for a free account to continue using Orris.
This is a shared conversation. Sign in to Orris to start your own chat.