`;
}
/** Inventory value = Σ unit cost × tracked stock (#104). Parts without a
* price or without tracked stock contribute nothing; null = no part has
* both, so the chip stays hidden rather than showing a misleading 0. */
private _inventoryValue(): number | null {
let sum = 0, any = false;
for (const p of this.parts) {
// Per unit: a package price spread over its contents (#98 follow-up).
const cost = unitPrice(p);
const stock = typeof p.stock === "number" ? p.stock : null;
if (cost !== null && stock !== null) { sum += cost * stock; any = true; }
}
return any ? sum : null;
}
protected render() {
const L = this._lang;
if (!this.parts.length && !this.canWrite) return nothing;
return html`