{
  "schemaVersion": 1,
  "slug": "airport-transit-time-calculator",
  "category": "travel",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "3a7ce1228c657bb6f8bd79ec345532d049cec6b5a5d9b3de2b8d3e36b8c06dcf",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/airport-transit-time-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": "buffer = layover − (arrival + immigration + security + walk + bags + tickets)",
    "vars": [
      [
        "buffer",
        "spare minutes after all steps"
      ],
      [
        "layover",
        "available connection time"
      ],
      [
        "arrival",
        "15 min domestic, 30 international"
      ],
      [
        "security",
        "10 min domestic, 25 international"
      ],
      [
        "walk",
        "8 min same terminal, 20 with terminal change"
      ],
      [
        "bags + tickets",
        "+25 min bag recheck, +30 min separate tickets"
      ]
    ],
    "note": "Planning model only: arrival, security, walking and baggage times are fixed assumptions, not airport or airline minimum connection times. The model adds 35 minutes for immigration only on an international-to-domestic transfer. Verify actual airport and ticket requirements."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-12",
    "sources": [
      {
        "name": "Heathrow — Connecting flights and transfer steps",
        "url": "https://www.heathrow.com/connecting-flights"
      }
    ],
    "referenceRole": "input",
    "implementationHash": "3a7ce1228c657bb6f8bd79ec345532d049cec6b5a5d9b3de2b8d3e36b8c06dcf",
    "basis": "buffer = layover − (arrival + immigration + security + walk + bags + tickets)",
    "limitations": "Use the cited guidance and your own measurements, bills or product specifications to choose inputs. Sample defaults are not current local data."
  },
  "contract": {
    "compute": "const arrive = connectionType === 'domestic' ? 15 : 30;\nconst immigration = connectionType === 'intl-to-domestic' ? 35 : 0;\nconst security = connectionType === 'domestic' ? 10 : 25;\nconst walk = terminalChange === 'yes' ? 20 : 8;\nconst bags = baggageRecheck === 'yes' ? 25 : 0;\nconst tickets = separateTicket === 'yes' ? 30 : 0;\nconst required = arrive + immigration + security + walk + bags + tickets;\nconst buffer = availableLayoverMinutes - required;\nconst verdict = buffer >= 30 ? 'Comfortable — time to eat something'\n  : buffer >= 10 ? 'Workable — go straight to the gate'\n  : buffer >= 0 ? 'Tight — no room for a delay'\n  : 'Too short — you would probably miss this connection';\nconst risk = buffer >= 30 ? 'Low' : buffer >= 15 ? 'Moderate' : buffer >= 0 ? 'High' : 'Very high';\nconst tip = separateTicket === 'yes' ? 'Separate-ticket connections may have limited protection if you miss a flight; check your ticket terms and leave a generous buffer.'\n  : baggageRecheck === 'yes' ? 'Pack so that a delayed bag does not strand you, and keep medication in your hand luggage.'\n  : terminalChange === 'yes' ? 'Check the terminal map before you land — some airport transfers take twenty minutes on their own.'\n  : 'You have a straightforward connection, so the main risk is a delayed inbound flight.';\nreturn { requiredMinutes: required, bufferMinutes: buffer, verdict: verdict, riskLevel: risk, walkAndArrivalMinutes: arrive + walk, passportAndSecurityMinutes: immigration + security, tip: tip };",
    "inputs": [
      {
        "name": "availableLayoverMinutes",
        "type": "number",
        "default": 120,
        "min": 20,
        "max": 1440,
        "step": 5,
        "slider": true
      },
      {
        "name": "connectionType",
        "type": "select",
        "default": "international",
        "options": [
          {
            "value": "domestic"
          },
          {
            "value": "international"
          },
          {
            "value": "intl-to-domestic"
          },
          {
            "value": "domestic-to-intl"
          }
        ]
      },
      {
        "name": "terminalChange",
        "type": "select",
        "default": "yes",
        "options": [
          {
            "value": "yes"
          },
          {
            "value": "no"
          }
        ]
      },
      {
        "name": "baggageRecheck",
        "type": "select",
        "default": "no",
        "options": [
          {
            "value": "yes"
          },
          {
            "value": "no"
          }
        ]
      },
      {
        "name": "separateTicket",
        "type": "select",
        "default": "no",
        "options": [
          {
            "value": "yes"
          },
          {
            "value": "no"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "requiredMinutes",
        "precision": 0,
        "unit": "min"
      },
      {
        "name": "bufferMinutes",
        "precision": 0,
        "unit": "min"
      },
      {
        "name": "verdict",
        "precision": 0,
        "unit": "",
        "type": "text"
      },
      {
        "name": "riskLevel",
        "precision": 0,
        "unit": "",
        "type": "text"
      },
      {
        "name": "walkAndArrivalMinutes",
        "precision": 0,
        "unit": "min"
      },
      {
        "name": "passportAndSecurityMinutes",
        "precision": 0,
        "unit": "min"
      },
      {
        "name": "tip",
        "precision": 0,
        "unit": "",
        "type": "text"
      }
    ],
    "interpret": null
  }
}
