{
  "schemaVersion": 1,
  "slug": "dog-treat-calorie-calculator",
  "category": "pets",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "6d43ced9f8e927a489aa6b45509224f60fa8d9dd973f49c032834e83f4d8aaee",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/dog-treat-calorie-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "B = C × p ÷ 100; N = B ÷ k",
    "vars": [
      [
        "C",
        "entered daily calorie target, or estimated neutered-adult target"
      ],
      [
        "p",
        "treat share (maximum 10%)"
      ],
      [
        "k",
        "calories per treat"
      ],
      [
        "B",
        "daily treat-calorie budget"
      ],
      [
        "N",
        "estimated treats per day"
      ]
    ],
    "note": "If no daily target is entered, the calculator estimates one from 1.6 × RER. Treats and other extras should stay within 10% of daily calories; reduce complete food accordingly and ask a veterinarian about individual needs."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const weightKg = weight*0.45359237; const rer = 70*Math.pow(Math.max(weightKg, 0.1), 0.75); const calorieTarget = dailyCalories > 0 ? dailyCalories : rer*1.6; const share=Math.min(10,Math.max(0,treatShare)); const treatBudget = calorieTarget*share/100; const treatsPerDay = treatCalories > 0 ? treatBudget/treatCalories : 0; return { calorieTarget, treatBudget, treatsPerDay, treatsPerWeek: treatsPerDay*7, note: 'Subtract the treat calories from the main meal to keep the daily total steady' };",
    "inputs": [
      {
        "name": "weight",
        "type": "number",
        "default": 45,
        "min": 1,
        "max": 300,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "dailyCalories",
        "type": "number",
        "default": 0,
        "min": 0,
        "max": 5000,
        "step": 10,
        "slider": true
      },
      {
        "name": "treatCalories",
        "type": "number",
        "default": 25,
        "min": 0.5,
        "max": 500,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "treatShare",
        "type": "number",
        "default": 10,
        "min": 0,
        "max": 10,
        "step": 1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "calorieTarget",
        "precision": 0,
        "unit": "kcal/day"
      },
      {
        "name": "treatBudget",
        "precision": 0,
        "unit": "kcal/day"
      },
      {
        "name": "treatsPerDay",
        "precision": 1,
        "unit": ""
      },
      {
        "name": "treatsPerWeek",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "note",
        "precision": 0,
        "unit": "",
        "type": "text"
      }
    ],
    "interpret": null
  }
}
