<script lang="ts">
	import { BedarfsausweisWohnenClient } from "#components/Ausweis/types.js";

	export let ausweis: BedarfsausweisWohnenClient;
</script>

<div class="overflow-x-auto mt-16">

	<table class="table-auto border-collapse border border-gray-300 w-full text-sm">
		<!-- Tabellenüberschrift -->
		<thead>
			<tr class="bg-gray-200 text-left">
				<th colspan="6" class="border border-gray-300 p-2 text-left">
					<h2>Tabelle A.5 — Gebäude – Berechnung Wärmetransferkoeffizienten und maximaler Wärmeströme</h2>
				</th>
			</tr>
			<tr class="bg-gray-200 text-left">
				<th colspan="6" class="border border-gray-300 p-2 text-left text-xl">
					Wärmesenken
				</th>
			</tr>
		</thead>

		<!-- Objektdaten -->
		<tbody>
			<tr class="bg-yellow-100">
				<td colspan="1" class="border border-gray-300 p-2 text-left bg-white">Objekt:</td>
				<td colspan="5" class="border border-gray-300 p-2 text-left"></td>
			</tr>
			<tr>
				<td class="border border-gray-300 p-2 w-2/6">Nettogrundfläche</td>
				<td class="border border-gray-300 p-2 w-1/6">A<sub>NGF</sub> [m²]</td>
				<td class="border border-gray-300 p-2 w-1/6 bg-yellow-100"></td>
				<td class="border border-gray-300 p-2">θ<sub>e,min</sub> [°C]</td>
				<td class="border border-gray-300 p-2 bg-gray-100 text-center">−12</td>
				<td class="border border-gray-300 p-2" rowspan="2"></td>
			</tr>
			<tr>
				<td class="border border-gray-300 p-2">Lichte Raumhöhe</td>
				<td class="border border-gray-300 p-2">h<sub>G</sub> [m]</td>
				<td class="border border-gray-300 p-2 w-1/6 bg-yellow-100"></td>
				<td class="border border-gray-300 p-2">θ<sub>i,h,soll</sub> [°C]</td>
				<td class="border border-gray-300 p-2 bg-gray-100 text-center">20</td>
			</tr>
			<tr>
				<td class="border border-gray-300 p-2">Volumen (Innenmaß)</td>
				<td class="border border-gray-300 p-2">V = A<sub>NGF</sub> · h<sub>G</sub> [m³]</td>
				<td class="border-2 border-gray-600 p-2"></td>
				<td class="border border-gray-300 p-2">Δθ<sub>max</sub> = θ<sub>i,h,soll</sub> − θ<sub>e,min</sub></td>
				<td class="border border-gray-300 p-2 bg-gray-100 text-center">32</td>
			</tr>
			<tr>
				<td class="border border-gray-300 p-2">Volumen (Außenmaß)</td>
				<td class="border border-gray-300 p-2">V<sub>e</sub> [m³]</td>
				<td class="border border-gray-300 p-2 w-1/6 bg-yellow-100"></td>
				<td class="border border-gray-300 p-2"></td>
				<td class="border border-gray-300 p-2"></td>
			</tr>
			<tr>
				<td class="border border-gray-300 p-2">Faktor (kleine Gebäude: 0,76 / große Gebäude: 0,8)</td>
				<td class="border border-gray-300 p-2">n*</td>
				<td class="border border-gray-300 p-2 w-1/6 bg-yellow-100"></td>
				<td class="border border-gray-300 p-2"></td>
				<td class="border border-gray-300 p-2"></td>
			</tr>
			<tr>
				<td class="border border-gray-300 p-2">Volumen (Innenmaß)</td>
				<td class="border border-gray-300 p-2 italic">V = n* · V<sub>e</sub> [m³]</td>
				<td class="border-2 border-gray-600 p-2"></td>
				<td class="border border-gray-300 p-2">A/V-Verhätnis [1/m]</td>
				<td class="border-2 border-gray-600 p-2"></td>
			</tr>
		</tbody>
	</table>
	<br>
	<table class="table-auto border-collapse border border-gray-300 w-full text-sm">
		<!-- Tabellenkopf -->
		<thead>
			<tr class="text-center">
				<th class="border border-gray-300 p-2" colspan="2">Bauteil</th>
				<th class="border border-gray-300 p-2">Fläche<br>A<sub>i</sub> (m²)</th>
				<th class="border border-gray-300 p-2">Wärmedurchgangs-<br>koeffizient U<sub>i</sub><br>(W/m²·K)</th>
				<th class="border border-gray-300 p-2">H<sub>T,i*</sub><br>= U<sub>i</sub> · A<sub>i</sub><br>(W/K)</th>
				<th class="border border-gray-300 p-2">F<sub>xi</sub><br>aus Tabelle C.3/C.4</th>
				<th class="border border-gray-300 p-2">H<sub>T,i</sub><br>= U<sub>i</sub> · A<sub>i</sub> · F<sub>xi</sub><br>(W/K)</th>
				<th class="border border-gray-300 p-2">maximaler Wärmestrom<br>Q̇<sub>T,i</sub> = H<sub>T,i</sub> · ΔΘ<sub>max</sub><br>(W)</th>
			</tr>
		</thead>

		<!-- Tabellenkörper -->
		<tbody>
			<tr class="text-center">
				<td class="border border-gray-300 p-2" colspan="2">Außenwand</td>
				<td class="border border-gray-300 p-2 bg-yellow-100"></td>
				<td class="border border-gray-300 p-2 bg-yellow-100"></td>
				<td class="border-2 border-gray-600 p-2"></td>
				<td class="border border-gray-300 p-2  bg-blue-100"></td>
				<td class="border-2 border-gray-600 p-2"></td>
				<td class="border-2 border-gray-600 p-2"></td>
			</tr>
			<tr class="text-center">
				<td class="border border-gray-300 p-2" colspan="2">Fenster</td>
				<td class="border border-gray-300 p-2 bg-yellow-100"></td>
				<td class="border border-gray-300 p-2 bg-yellow-100"></td>
				<td class="border-2 border-gray-600 p-2"></td>
				<td class="border border-gray-300 p-2  bg-blue-100"></td>
				<td class="border-2 border-gray-600 p-2"></td>
				<td class="border-2 border-gray-600 p-2"></td>
			</tr>
			<tr class="text-center">
				<td class="border border-gray-300 p-2" colspan="2">Fenstertür</td>
				<td class="border border-gray-300 p-2 bg-yellow-100"></td>
				<td class="border border-gray-300 p-2 bg-yellow-100"></td>
				<td class="border-2 border-gray-600 p-2"></td>
				<td class="border border-gray-300 p-2  bg-blue-100"></td>
				<td class="border-2 border-gray-600 p-2"></td>
				<td class="border-2 border-gray-600 p-2"></td>
			</tr>
			<tr class="text-center">
				<td class="border border-gray-300 p-2" colspan="2">Haustür</td>
				<td class="border border-gray-300 p-2 bg-yellow-100"></td>
				<td class="border border-gray-300 p-2 bg-yellow-100"></td>
				<td class="border-2 border-gray-600 p-2"></td>
				<td class="border border-gray-300 p-2  bg-blue-100"></td>
				<td class="border-2 border-gray-600 p-2"></td>
				<td class="border-2 border-gray-600 p-2"></td>
			</tr>
			<tr class="text-center">
				<td class="border border-gray-300 p-2" colspan="2">Dach</td>
				<td class="border border-gray-300 p-2 bg-yellow-100"></td>
				<td class="border border-gray-300 p-2 bg-yellow-100"></td>
				<td class="border-2 border-gray-600 p-2"></td>
				<td class="border border-gray-300 p-2  bg-blue-100"></td>
				<td class="border-2 border-gray-600 p-2"></td>
				<td class="border-2 border-gray-600 p-2"></td>
			</tr>
			<tr class="text-center">
				<td class="border border-gray-300 p-2" colspan="2">Oberste Geschossdecke</td>
				<td class="border border-gray-300 p-2 bg-yellow-100"></td>
				<td class="border border-gray-300 p-2 bg-yellow-100"></td>
				<td class="border-2 border-gray-600 p-2"></td>
				<td class="border border-gray-300 p-2  bg-blue-100"></td>
				<td class="border-2 border-gray-600 p-2"></td>
				<td class="border-2 border-gray-600 p-2"></td>
			</tr>
			<tr class="text-center">
				<td class="border border-gray-300 p-2" colspan="2">Wand gegen Abseitenraum</td>
				<td class="border border-gray-300 p-2 bg-yellow-100"></td>
				<td class="border border-gray-300 p-2 bg-yellow-100"></td>
				<td class="border-2 border-gray-600 p-2"></td>
				<td class="border border-gray-300 p-2  bg-blue-100"></td>
				<td class="border-2 border-gray-600 p-2"></td>
				<td class="border-2 border-gray-600 p-2"></td>
			</tr>
			<tr class="text-center">
				<td class="border border-gray-300 p-2" colspan="2">Kellerdecke / Fußboden zum Erdreich</td>
				<td class="border border-gray-300 p-2 bg-yellow-100"></td>
				<td class="border border-gray-300 p-2 bg-yellow-100"></td>
				<td class="border-2 border-gray-600 p-2"></td>
				<td class="border border-gray-300 p-2  bg-blue-100"></td>
				<td class="border-2 border-gray-600 p-2"></td>
				<td class="border-2 border-gray-600 p-2"></td>
			</tr>
			<tr class="text-center">
				<td class="border border-gray-300 p-2 font-bold" colspan="2">Summen</td>
				<td class="border-2 border-gray-600 p-2"></td>
				<td class="border border-gray-300 p-2"></td>
				<td class="border border-gray-300 p-2"></td>
				<td class="border border-gray-300 p-2"></td>
				<td class="border-2 border-gray-600 p-2"></td>
				<td class="border border-gray-300 p-2"></td>
			</tr>
			<tr class="text-center">
				<td class="p-2" colspan="2"></td>
				<td class="p-2"></td>
				<td class="p-2"></td>
				<td class="p-2"></td>
				<td class="p-2"></td>
				<td class="p-2"></td>
				<td class="p-2"></td>
			</tr>
			<tr class="text-center">
				<td class="p-2" colspan="2"></td>
				<td class="p-2">Gesamthüllfläche
					A = ∑<sub>i</sub> A<sub>i</sub> [m²]</td>
				<td class="p-2">Wärmebrückenzuschlag<br> ΔU<sub>WB</sub> [W/m²K]
					aus C.5</td>
				<td class="p-2">
					H<sub>T,WB</sub> = ΔU<sub>WB</sub> · A [W/K]</td>
				<td class="p-2"></td>
				<td class="p-2"></td>
				<td class="p-2"></td>
			</tr>
			<tr class="text-center">
				<td class="border border-gray-300 p-2" colspan="2">Berücksichtigung von Wärmebrücken</td>
				<td class="border border-gray-300 p-2 bg-yellow-100"></td>
				<td class="border border-gray-300 p-2 bg-blue-100"></td>
				<td class="border-2 border-gray-600 p-2"></td>
				<td class="border border-gray-300 p-2"></td>
				<td class="border border-gray-300 p-2"></td>
				<td class="border border-gray-300 p-2"></td>
			</tr>

			<tr class="text-center">
				<td class="p-2" colspan="2"></td>
				<td class="p-2"></td>
				<td class="p-2"></td>
				<td class="p-2"></td>
				<td class="p-2"></td>
				<td class="p-2"></td>
				<td class="p-2"></td>
			</tr>
			<tr class="text-center">
				<td class="p-2" colspan="2"></td>
				<td class="p-2">H<sub>T,ges</sub> = ∑ H<sub>Ti</sub> + H<sub>T,WB</sub> [W/K]</td>
				<td class="p-2"></td>
				<td class="p-2"></td>
				<td class="p-2"></td>
				<td class="p-2"></td>
				<td class="p-2"></td>
			</tr>
			<tr class="text-left">
				<td class="border border-gray-300 font-bold p-2" colspan="2">Wärmetransferkoeffizient für Transmission</td>
				<td class="border-2 border-gray-600 p-2"></td>
				<td class="border border-gray-300 p-2"></td>
				<td class="border border-gray-300 p-2"></td>
				<td class="border border-gray-300 p-2"></td>
				<td class="border border-gray-300 p-2"></td>
				<td class="border border-gray-300 p-2"></td>
			</tr>

			<tr class="text-center">
				<td class="p-2" colspan="2"></td>
				<td class="p-2">Q̇<sub>T</sub> = H<sub>T,ges</sub> · ΔΘ<sub>max</sub> [W]</td>
				<td class="p-2"></td>
				<td class="p-2"></td>
				<td class="p-2"></td>
				<td class="p-2"></td>
				<td class="p-2"></td>
			</tr>
			<tr class="text-left">
				<td class="border border-gray-300 font-bold p-2" colspan="2">maximaler Wärmestrom</td>
				<td class="border-2 border-gray-600 p-2"></td>
				<td class="border border-gray-300 p-2"></td>
				<td class="border border-gray-300 p-2"></td>
				<td class="border border-gray-300 p-2"></td>
				<td class="border border-gray-300 p-2"></td>
				<td class="border border-gray-300 p-2"></td>
			</tr>

		</tbody>
	</table>
</div>