{
  "schemaVersion": 1,
  "slug": "cat-pregnancy-calculator",
  "category": "pets",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "4dd9aa8b1c3565027067bd71c8d47c27b910b02027707f87334e21181b66bb07",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/cat-pregnancy-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": "Estimated due date = mating date + G days; planning window = mating date + 60 to 66 days",
    "vars": [
      [
        "mating date",
        "entered mating date"
      ],
      [
        "G",
        "selected gestation estimate (days; 60–66)"
      ]
    ],
    "note": "Feline gestation is commonly about 60–66 days, often near 64–66 days after breeding. The mating date may not match conception; this is a planning estimate, not a pregnancy or labor diagnosis."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const start=new Date(matingDate+'T00:00:00Z'); if(!Number.isFinite(start.getTime())||start.toISOString().slice(0,10)!==matingDate)return{dueDate:null,rangeStart:null,rangeEnd:null,daysElapsed:null,daysRemaining:null,__error:'inputError'}; const today=new Date(); const day=86400000; const fmt=d=>d.toISOString().slice(0,10); const due=new Date(start.getTime()+gestationDays*day); const daysElapsed=Math.floor((today-start)/day); return {dueDate:fmt(due),rangeStart:fmt(new Date(start.getTime()+60*day)),rangeEnd:fmt(new Date(start.getTime()+66*day)),daysElapsed,daysRemaining:gestationDays-daysElapsed};",
    "inputs": [
      {
        "name": "matingDate",
        "type": "date",
        "default": "@today",
        "step": 1
      },
      {
        "name": "gestationDays",
        "type": "number",
        "default": 65,
        "min": 60,
        "max": 66,
        "step": 1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "dueDate",
        "precision": 0,
        "unit": "",
        "type": "text"
      },
      {
        "name": "rangeStart",
        "precision": 0,
        "unit": "",
        "type": "text"
      },
      {
        "name": "rangeEnd",
        "precision": 0,
        "unit": "",
        "type": "text"
      },
      {
        "name": "daysElapsed",
        "precision": 0,
        "unit": "days"
      },
      {
        "name": "daysRemaining",
        "precision": 0,
        "unit": "days"
      }
    ],
    "interpret": null
  }
}
