Module:Adjacent stations/Trenitalia

-- station aliases
local hbf = "[[%1 Hauptbahnhof|%1 Hbf]]"
local s = "%1 station"

-- standardized types
local fr = {
	["color"] = "FF0000",
	["title"] = "[[Frecciarossa]]",
}

local fa = {
	["color"] = "9d9fa2",
	["title"] = "[[Frecciargento]]",
}

local ec = {
	["color"] = "0000FF",
	["title"] = "[[EuroCity]]",
}

local ic = {
	["color"] = "0000FF",
	["title"] = "[[InterCity#Italy|InterCity]]",
}

local icn = {
	["color"] = "000099",
	["title"] = "[[InterCity#Italy|InterCity Notte]]",
}

local rv = {
	["color"] = "8dc63f",
	["title"] = "[[Train categories in Europe#Italy|Regionale Veloce]]",
}

local r = {
	["color"] = "8dc63f",
	["title"] = "[[Regional rail#Regional rail in different countries|Regionale]]",
}

local p = {
	["system title"] = "[[Trenitalia]]",
	["system icon"] = "",
	["station format"] = {
		"%1 railway station",
		["Chambéry-Challes-les-Eaux"] = s,
		["Frankfurt (Main)"] = hbf,
		["Lyon-Perrache"] = s,
		["Paris-Lyon"] = "Gare de Lyon",
		["Villach"] = hbf,
		["Wien"] = hbf,
		["Zürich"] = "[[Zürich Hauptbahnhof|Zürich HB]]",
	},
	["lines"] = {
		-- FR (Frecciarossa)
		["FR Quadro 1"] = {
			["title"] = fr.title,
			["color"] = fr.color,
			["left terminus"] = "Torino Porta Nuova",
			["right terminus"] = {"Taranto", "Reggio di Calabria Centrale"},
		},
		["FR Quadro 2"] = {
			["title"] = fr.title,
			["color"] = fr.color,
			["left terminus"] = {"Bolzano/Bozen", "Brescia", "Trieste Centrale", "Udine"},
			["right terminus"] = {"Sibari", "Reggio di Calabria Centrale"},
		},
		["FR Quadro 3"] = {
			["title"] = fr.title,
			["color"] = fr.color,
			["left terminus"] = {"Torino Porta Nuova", "Genova Brignole"},
			["right terminus"] = {"Trieste Centrale", "Udine", "Bolzano/Bozen"},
		},
		["FR Quadro 5"] = {
			["title"] = fr.title,
			["color"] = fr.color,
			["left terminus"] = "Torino Porta Nuova",
			["right terminus"] = {"Lecce", "Taranto"},
		},
		["FR Quadro 8"] = {
			["title"] = fr.title,
			["color"] = fr.color,
			["left terminus"] = "Torino Porta Nuova",
			["right terminus"] = {"Venezia Santa Lucia", "Sibari", "Reggio di Calabria Centrale"},
		},
		["FR Bolzano/Bozen-Sibari"] = {
			["title"] = fr.title,
			["color"] = fr.color,
			["left terminus"] = "Bolzano/Bozen",
			["right terminus"] = "Sibari",
		},
		["FR Genova-Venezia"] = {
			["title"] = fr.title,
			["color"] = fr.color,
			["left terminus"] = "Genova Brignole",
			["right terminus"] = "Venezia Santa Lucia",
		},
		["FR Milano-Bari"] = {
			["title"] = fr.title,
			["color"] = fr.color,
			["left terminus"] = "Milano Centrale",
			["right terminus"] = "Bari Centrale",
		},
		["FR Milano-Taranto"] = {
			["title"] = fr.title,
			["color"] = fr.color,
			["left terminus"] = "Milano Centrale",
			["right terminus"] = "Taranto",
		},
		["FR Milano-Trieste"] = {
			["title"] = fr.title,
			["color"] = fr.color,
			["left terminus"] = "Milano Centrale",
			["right terminus"] = "Trieste Centrale",
		},
		["FR Milano-Udine"] = {
			["title"] = fr.title,
			["color"] = fr.color,
			["left terminus"] = "Milano Centrale",
			["right terminus"] = "Udine",
		},
		["FR Milano-Venezia"] = {
			["title"] = fr.title,
			["color"] = fr.color,
			["left terminus"] = "Milano Centrale",
			["right terminus"] = "Venezia Santa Lucia",
		},
		["FR Roma-Lecce"] = {
			["title"] = fr.title,
			["color"] = fr.color,
			["left terminus"] = "Roma Termini",
			["right terminus"] = "Lecce",
		},
		["FR Torino-Reggio Calabria"] = {
			["title"] = fr.title,
			["color"] = fr.color,
			["left terminus"] = "Torino Porta Nuova",
			["right terminus"] = "Reggio di Calabria Centrale",
		},
		["FR Torino-Salerno"] = {
			["title"] = fr.title,
			["color"] = fr.color,
			["left terminus"] = "Torino Porta Nuova",
			["right terminus"] = "Salerno",
		},
		["FR Torino-Venezia"] = {
			["title"] = fr.title,
			["color"] = fr.color,
			["left terminus"] = "Torino Porta Nuova",
			["right terminus"] = "Venezia Santa Lucia",
		},
		["FR Venezia-Lecce"] = {
			["title"] = fr.title,
			["color"] = fr.color,
			["left terminus"] = "Venezia Santa Lucia",
			["right terminus"] = "Lecce",
		},
		["FR Venezia-Reggio Calabria"] = {
			["title"] = fr.title,
			["color"] = fr.color,
			["left terminus"] = "Venezia Santa Lucia",
			["right terminus"] = "Reggio di Calabria Centrale",
		},
		["FR Venezia-Salerno"] = {
			["title"] = fr.title,
			["color"] = fr.color,
			["left terminus"] = "Venezia Santa Lucia",
			["right terminus"] = "Salerno",
		},

		-- FA (Frecciargento)
		["FA Roma-Bari"] = {
			["title"] = fa.title,
			["color"] = fa.color,
			["left terminus"] = "Roma Termini",
			["right terminus"] = "Bari Centrale",
		},
		["FA Roma-Reggio Calabria"] = {
			["title"] = fa.title,
			["color"] = fa.color,
			["left terminus"] = "Roma Termini",
			["right terminus"] = "Reggio di Calabria Centrale",
		},

		-- EC (EuroCity)
		["EC Basel-Milan"] = {
			["title"] = ec.title,
			["color"] = ec.color,
			["left terminus"] = "Basel SBB",
			["right terminus"] = "Milano Centrale",					
		},
		["EC Frankfurt-Milan"] = {
			["title"] = ec.title,
			["color"] = ec.color,
			["left terminus"] = "Frankfurt (Main)",
			["right terminus"] = "Milano Porta Garibaldi",					
		},
		["EC Geneva-Milan"] = {
			["title"] = ec.title,
			["color"] = ec.color,
			["left terminus"] = "Genève-Cornavin",
			["right terminus"] = "Milano Centrale",					
		},
		["EC Genève-Venezia"] = {
			["title"] = ec.title,
			["color"] = ec.color,
			["left terminus"] = "Genève-Cornavin",
			["right terminus"] = "Venezia Santa Lucia",	
		},
		["EC Zürich-Milan"] = {
			["title"] = ec.title,
			["color"] = ec.color,
			["left terminus"] = "Zürich",
			["right terminus"] = {"Bologna Centrale", "Genova Piazza Principe", "Milano Centrale", "Venezia Santa Lucia"},					
		},

		-- IC (InterCity)
		["IC Bologna-Bari"] = {
			["title"] = ic.title,
			["color"] = ic.color,
			["left terminus"] = "Bologna Centrale",
			["right terminus"] = "Bari Centrale",
		},
		["IC Milano-Lecce"] = {
			["title"] = ic.title,
			["color"] = ic.color,
			["left terminus"] = {"Milano Centrale", "Milano Porta Garibaldi"},
			["right terminus"] = "Lecce",
		},
		["IC Napoli-Bari"] = {
			["title"] = ic.title,
			["color"] = ic.color,
			["left terminus"] = "Napoli Centrale",
			["right terminus"] = "Bari Centrale",
		},
		["IC Reggio Calabria-Taranto"] = {
			["title"] = ic.title,
			["color"] = ic.color,
			["left terminus"] = "Reggio di Calabria Centrale",
			["right terminus"] = "Taranto",
		},
		["IC Roma-Bari"] = {
			["title"] = ic.title,
			["color"] = ic.color,
			["left terminus"] = "Roma Termini",
			["right terminus"] = "Bari Centrale",
		},
		["IC Roma-Reggio Calabria"] = {
			["title"] = ic.title,
			["color"] = ic.color,
			["left terminus"] = "Roma Termini",
			["right terminus"] = "Reggio di Calabria Centrale",
		},

		-- ICN (InterCity Notte)
		["ICN Milano-Lecce"] = {
			["title"] = icn.title,
			["color"] = icn.color,
			["left terminus"] = "Milano Centrale",
			["right terminus"] = "Lecce",
		},
		["ICN Milano-Siracusa"] = {
			["title"] = icn.title,
			["color"] = icn.color,
			["left terminus"] = "Milano Centrale",
			["right terminus"] = "Siracusa",
		},
		["ICN Torino-Lecce"] = {
			["title"] = icn.title,
			["color"] = icn.color,
			["left terminus"] = "Torino Porta Nuova",
			["right terminus"] = "Lecce",
		},
		["ICN Torino-Reggio Calabria"] = {
			["title"] = icn.title,
			["color"] = icn.color,
			["left terminus"] = "Torino Porta Nuova",
			["right terminus"] = "Reggio di Calabria Centrale",
		},
		["ICN Torino-Salerno"] = {
			["title"] = icn.title,
			["color"] = icn.color,
			["left terminus"] = "Torino Porta Nuova",
			["right terminus"] = "Salerno",
		},

		-- RV (Regionale Veloce)
		["RV Bari-Lecce"] = {
			["title"] = rv.title,
			["color"] = rv.color,
			["left terminus"] = "Bari Centrale",
			["right terminus"] = "Lecce",
		},
		["RV Brenner-Bologna"] = {
			["title"] = rv.title,
			["color"] = rv.color,
			["left terminus"] = "Brenner",
			["right terminus"] = "Bologna Centrale",
		},
		["RV Verona-Venezia"] = {
			["title"] = rv.title,
			["color"] = rv.color,
			["left terminus"] = "Verona Porta Nuova",
			["right terminus"] = "Venezia Santa Lucia",
		},

		-- R (Regionale)
		["R Arona-Novara"] = {
			["title"] = r.title,
			["color"] = r.color,
			["left terminus"] = "Arona",
			["right terminus"] = "Novara",
		},
		["R Barletta-Fasano"] = {
			["title"] = r.title,
			["color"] = r.color,
			["left terminus"] = "Barletta",
			["right terminus"] = "Fasano",
		},
		["R Bari-Taranto"] = {
			["title"] = r.title,
			["color"] = r.color,
			["left terminus"] = "Bari Centrale",
			["right terminus"] = "Taranto",
		},
		["R Bitritto-Bari"] = {
			["title"] = r.title,
			["color"] = r.color,
			["left terminus"] = "Bitritto",
			["right terminus"] = "Bari Centrale",
		},
		["R Bolzano/Bozen-Verona"] = {
			["title"] = r.title,
			["color"] = r.color,
			["left terminus"] = "Bolzano/Bozen",
			["right terminus"] = "Verona Porta Nuova",
		},
		["R Brescia-Venezia Santa Lucia"] = {
			["title"] = r.title,
			["color"] = r.color,
			["left terminus"] = "Brescia",
			["right terminus"] = "Venezia Santa Lucia",
		},
		["R Cosenza-Reggio Calabria"] = {
			["title"] = r.title,
			["color"] = r.color,
			["left terminus"] = "Cosenza",
			["right terminus"] = "Reggio di Calabria Centrale",
		},
		["R Domodossola–Novara"] = {
			["title"] = r.title,
			["color"] = r.color,
			["left terminus"] = "Domodossola",
			["right terminus"] = "Novara"
		},
		["R Lamezia Terme-Reggio Calabria"] = {
			["title"] = r.title,
			["color"] = r.color,
			["left terminus"] = "Lamezia Terme Centrale",
			["right terminus"] = "Reggio di Calabria Centrale",
		},
		["R Reggio Calabria-Catanzaro Lido"] = {
			["title"] = r.title,
			["color"] = r.color,
			["left terminus"] = "Reggio di Calabria Centrale",
			["right terminus"] = "Catanzaro Lido",
		},
		["R Tarvisio-Trieste"] = {
			["title"] = r.title,
			["color"] = r.color,
			["left terminus"] = "Tarvisio Boscoverde",
			["right terminus"] = "Trieste Centrale",
			["types"] = {
				["North"] = {
					["title"] = "",
					["left terminus"] = "Trieste Centrale",
					["right terminus"] = "Tarvisio Boscoverde",
				},
			},
		},
		["R Verona-Bologna"] = {
			["title"] = r.title,
			["color"] = r.color,
			["left terminus"] = "Verona Porta Nuova",
			["right terminus"] = "Bologna Centrale",
		},
		["R Verona-Mantova"] = {
			["title"] = r.title,
			["color"] = r.color,
			["left terminus"] = "Verona Porta Nuova",
			["right terminus"] = "Mantova",
		},
		["R Vicenza-Schio"] = {
			["title"] = r.title,
			["color"] = r.color,
			["left terminus"] = "Vicenza",
			["right terminus"] = "Schio",
		},
		["R Vicenza-Treviso"] = {
			["title"] = r.title,
			["color"] = r.color,
			["left terminus"] = "Vicenza",
			["right terminus"] = "Treviso Centrale",
		},
		["R23"] = {
			["title"] = "[[Regional rail#Regional rail in different countries|R23]]",
			["color"] = r.color,
			["left terminus"] = "Domodossola",
			["right terminus"] = "Milano Porta Garibaldi"
		},

		["Frecciabianca"] = {
			["title"] = "[[Frecciabianca]]",
			["color"] = "ffffff",
			["left terminus"] = "?",
			["right terminus"] = "?"
		},
		["Frecciarossa"] = {
			["title"] = "[[Frecciarossa]]",
			["color"] = "e31936",
			["left terminus"] = "?",
			["right terminus"] = "?"
		},
		["Leonardo Express"] = {
			["title"] = "[[Leonardo Express]]",
			["left terminus"] = "Roma Termini",
			["right terminus"] = "Fiumicino Aeroporto",
		},
		["Regionale"] = {
			["title"] = "[[Regional rail#Regional rail in different countries|Regionale]]",
			["types"] = {
				["23"] = {
					["title"] = "R23",
					["color"] = "8dc63f",
					["left terminus"] = "Domodossola",
					["right terminus"] = "Milano Porta Garibaldi"
				},
				["Domodossola–Novara"] = {
					["title"] = "",
					["color"] = "8dc63f",
					["left terminus"] = "Domodossola",
					["right terminus"] = "Novara"
				},
			},
		},
		["Thello"] = {
			["title"] = "[[Thello]]",
			["color"] = "fd3107",
			["left terminus"] = "?",
			["right terminus"] = "?"
		}
	},
}

-- Import OBB international services
local obb = require('Module:Adjacent stations/ÖBB')
p["lines"]["RJ Venice-Vienna"] = obb["lines"]["RJ Venice-Vienna"]
p["lines"]["REX Udine-Villach"] = obb["lines"]["REX Udine-Villach"]

return p