import "./Grain.js";
import { e as escape_html, p as pop, a as push } from "./index.js";
function Coturnix($$payload, $$props) {
  let { logo = false } = $$props;
  if (logo) {
    $$payload.out.push("<!--[-->");
    $$payload.out.push(`<span style="font-size:25pt" class="align-bottom svelte-1mc5vze"><span class="co svelte-1mc5vze"><span class="g svelte-1mc5vze">CO</span><span class="ra svelte-1mc5vze">TURN</span>IX</span></span><img src="/grain/coturnix.svg" alt="Logo de Coturnix" class="svelte-1mc5vze"/>`);
  } else {
    $$payload.out.push("<!--[!-->");
    $$payload.out.push(`<span style="font-size:1.1em" class="svelte-1mc5vze"><span class="co svelte-1mc5vze"><span class="g svelte-1mc5vze">CO</span><span class="ra svelte-1mc5vze">TURN</span>IX</span></span>`);
  }
  $$payload.out.push(`<!--]-->`);
}
function Donnees($$payload, $$props) {
  push();
  let { donnees } = $$props;
  let fmt = (n) => Intl.NumberFormat("fr-FR", { maximumFractionDigits: n });
  function format(x) {
    let f = 0;
    let s = "";
    if (Math.abs(x) <= 1e3) {
      s = " kWc";
      f = x;
    } else if (Math.abs(x) <= 1e6) {
      s = " MWc";
      f = x / 1e3;
    } else {
      s = " GWc";
      f = x / 1e6;
    }
    return fmt(2).format(f) + s;
  }
  if (donnees) {
    $$payload.out.push("<!--[-->");
    $$payload.out.push(`<div class="my-5 py-2"><div class="flex justify-around text-primary p-5"><div class="flex flex-col justify-between text-center"><div class="pb-3 mb-3 border-b-4 border-primary text-4xl font-bold">${escape_html(donnees.projets)}</div> <div class="text-xl">Simulations</div></div> <div class="flex-column justify-content-between text-center mx-3"><div class="pb-3 mb-3 border-b-4 border-primary text-4xl font-bold">${escape_html(format(donnees.puissance))}</div> <div class="text-xl">Simulés</div></div></div></div>`);
  } else {
    $$payload.out.push("<!--[!-->");
  }
  $$payload.out.push(`<!--]-->`);
  pop();
}
export {
  Coturnix as C,
  Donnees as D
};
