"use strict";

function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
// GHS CRM — Dashboard: bouwstenen.
// Hiërarchie in vier lagen: pagina (bg0) → paneel (bg1) → tegel of kaart (bg2) → inzet
// (bg0, voor balken en sporen). Typografie: H1 28 · H2 20 · H3 15.5 · tekst 13.5 · klein 12.
// Kleur is spaarzaam en heeft één betekenis: groen = de hoofdlijn of in orde, amber = let op
// of wacht, rood = te laat. "Te laat" krijgt de rode gradient van de sectiekoppen
// (GhsSectieKop): zelfde verloop, zelfde balk links.
(function () {
  var DSH_LBL = {
    fontFamily: T.fontBody,
    fontSize: 10.5,
    fontWeight: 700,
    letterSpacing: '0.14em',
    textTransform: 'uppercase',
    color: T.fg3
  };
  var DSH_GETAL = {
    fontFamily: T.fontDisplay,
    fontWeight: 600,
    color: T.fg1,
    fontVariantNumeric: 'tabular-nums',
    lineHeight: 1.05
  };
  var DSH_H1 = {
    margin: 0,
    fontFamily: T.fontDisplay,
    fontSize: 28,
    fontWeight: 600,
    color: T.fg1,
    lineHeight: 1.15,
    letterSpacing: '-0.015em'
  };
  var DSH_H2 = {
    margin: 0,
    fontFamily: T.fontDisplay,
    fontSize: 20,
    fontWeight: 600,
    color: T.fg1,
    lineHeight: 1.25
  };
  var DSH_H3 = {
    margin: 0,
    fontFamily: T.fontDisplay,
    fontSize: 15.5,
    fontWeight: 600,
    color: T.fg1,
    lineHeight: 1.3
  };
  var DSH_P = {
    margin: 0,
    fontFamily: T.fontBody,
    fontSize: 13.5,
    color: T.fg2,
    lineHeight: 1.6,
    maxWidth: 760,
    textWrap: 'pretty'
  };
  var DSH_KLEIN = {
    margin: 0,
    fontFamily: T.fontBody,
    fontSize: 12,
    color: T.fg3,
    lineHeight: 1.5,
    textWrap: 'pretty'
  };
  var DSH_GROEN = '#00D900',
    DSH_ROOD = '#ff5a4d',
    DSH_AMBER = '#ffb020';
  var dshFmt = function dshFmt(v, geld) {
    return v == null ? '—' : geld ? window.dshEur(v) : (Math.round(v * 10) / 10).toLocaleString('nl-BE');
  };
  /* Het verloop van de toestand. Rood ligt op zwart: rood over het groen van de ondergrond
     mengt naar geel. Het zwart verloopt naar het uiteinde, zodat daar het groen terugkomt.
     px = lengte in pixels voor brede vlakken (rij, banier); zonder px in procent (kaart). */
  var dshGrad = function dshGrad(k, px) {
    if (k !== DSH_ROOD) return "linear-gradient(100deg, ".concat(k, "2b 0%, ").concat(k, "10 34%, rgba(0,0,0,0.30) 100%)");
    var s = px ? ['0px', Math.round(px * 0.36) + 'px', Math.round(px * 0.72) + 'px', px + 'px'] : ['0%', '36%', '72%', '92%'];
    return "linear-gradient(100deg, ".concat(k, "3d ").concat(s[0], ", ").concat(k, "14 ").concat(s[1], ", ").concat(k, "00 ").concat(s[2], "), linear-gradient(100deg, rgba(0,0,0,0.92) ").concat(s[0], ", rgba(0,0,0,0.72) ").concat(s[1], ", rgba(0,0,0,0) ").concat(s[3], ")");
  };
  var DshBalk = function DshBalk(_ref) {
    var kleur = _ref.kleur;
    return /*#__PURE__*/React.createElement("span", {
      "aria-hidden": "true",
      style: {
        position: 'absolute',
        left: 0,
        top: 0,
        bottom: 0,
        width: 4,
        background: kleur,
        boxShadow: "0 0 16px ".concat(kleur),
        pointerEvents: 'none'
      }
    });
  };

  /* Sectie: H2 + uitleg, daaronder de inhoud. */
  var DshSectie = function DshSectie(_ref2) {
    var titel = _ref2.titel,
      lead = _ref2.lead,
      rechts = _ref2.rechts,
      children = _ref2.children;
    return /*#__PURE__*/React.createElement("section", {
      style: {
        display: 'flex',
        flexDirection: 'column',
        gap: 16,
        minWidth: 0
      }
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        alignItems: 'flex-end',
        gap: '10px 16px',
        flexWrap: 'wrap'
      }
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        flex: '1 1 320px',
        minWidth: 0
      }
    }, /*#__PURE__*/React.createElement("h2", {
      style: DSH_H2
    }, titel), lead && /*#__PURE__*/React.createElement("p", {
      style: _objectSpread(_objectSpread({}, DSH_P), {}, {
        marginTop: 6
      })
    }, lead)), rechts && /*#__PURE__*/React.createElement("div", {
      style: {
        marginLeft: 'auto',
        display: 'flex',
        alignItems: 'center',
        gap: 8,
        flexWrap: 'wrap'
      }
    }, rechts)), children);
  };
  var DshPaneel = function DshPaneel(_ref3) {
    var children = _ref3.children,
      _ref3$pad = _ref3.pad,
      pad = _ref3$pad === void 0 ? 24 : _ref3$pad,
      style = _ref3.style;
    return /*#__PURE__*/React.createElement("div", {
      style: _objectSpread({
        background: T.bg1,
        border: "1px solid ".concat(T.stroke1),
        clipPath: cutPath(14),
        padding: pad,
        minWidth: 0
      }, style || {})
    }, children);
  };

  /* Verschil met de vorige periode. beter = 'hoger', 'lager' (bij dagen is minder beter)
     of 'neutraal' (meer instroom is niet goed of slecht). */
  /* Waarmee vergeleken wordt: de vorige periode, of bij Eigen periode de zelfgekozen periode 2. */
  var DshVsContext = React.createContext(null);
  var DSH_VS_STD = {
    kort: 'vs vorige',
    lang: 'Tegenover dezelfde stand in de vorige periode',
    gelijk: 'gelijk aan de vorige periode',
    tegel: 'vorige'
  };
  var DshDelta = function DshDelta(_ref4) {
    var nu = _ref4.nu,
      vorige = _ref4.vorige,
      _ref4$beter = _ref4.beter,
      beter = _ref4$beter === void 0 ? 'hoger' : _ref4$beter,
      geld = _ref4.geld,
      eenheid = _ref4.eenheid,
      zonderPct = _ref4.zonderPct;
    var vs = React.useContext(DshVsContext) || DSH_VS_STD;
    if (nu == null || vorige == null) return null;
    var v = Math.round((nu - vorige) * 10) / 10;
    if (!v) return /*#__PURE__*/React.createElement("span", {
      style: {
        fontFamily: T.fontBody,
        fontSize: 12,
        color: T.fg3
      }
    }, vs.gelijk);
    var kleur = beter === 'neutraal' ? T.fg2 : (beter === 'hoger' ? v > 0 : v < 0) ? DSH_GROEN : DSH_ROOD;
    var pct = !zonderPct && vorige ? Math.round(Math.abs(v) / Math.abs(vorige) * 100) : null;
    return /*#__PURE__*/React.createElement("span", {
      title: vs.lang,
      style: {
        display: 'inline-flex',
        alignItems: 'center',
        gap: 4,
        fontFamily: T.fontBody,
        fontSize: 12,
        fontWeight: 700,
        color: kleur,
        whiteSpace: 'nowrap'
      }
    }, /*#__PURE__*/React.createElement(Icon, {
      name: v > 0 ? 'chevronup' : 'chevrondown',
      size: 12,
      color: "currentColor"
    }), geld ? window.dshEur(Math.abs(v)) : Math.abs(v).toLocaleString('nl-BE'), eenheid ? ' ' + eenheid : '', pct != null && pct < 1000 ? " (".concat(pct, "%)") : '', /*#__PURE__*/React.createElement("span", {
      style: {
        fontWeight: 500,
        color: T.fg3
      }
    }, vs.kort));
  };

  /* Kerncijfers: een paneel met een H3 en tegels die er een laag boven liggen. */
  var DshKpiGroep = function DshKpiGroep(_ref5) {
    var titel = _ref5.titel,
      uitleg = _ref5.uitleg,
      children = _ref5.children,
      _ref5$min = _ref5.min,
      min = _ref5$min === void 0 ? 180 : _ref5$min;
    return /*#__PURE__*/React.createElement(DshPaneel, {
      pad: 20
    }, /*#__PURE__*/React.createElement("h3", {
      style: DSH_H3
    }, titel), uitleg && /*#__PURE__*/React.createElement("p", {
      style: _objectSpread(_objectSpread({}, DSH_KLEIN), {}, {
        marginTop: 4
      })
    }, uitleg), /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'grid',
        gridTemplateColumns: "repeat(auto-fit,minmax(".concat(min, "px,1fr))"),
        gap: 10,
        marginTop: 16
      }
    }, children));
  };
  var DshKpi = function DshKpi(_ref6) {
    var label = _ref6.label,
      waarde = _ref6.waarde,
      sub = _ref6.sub,
      nadruk = _ref6.nadruk,
      delta = _ref6.delta,
      kleur = _ref6.kleur,
      title = _ref6.title;
    return /*#__PURE__*/React.createElement("div", {
      title: title,
      style: {
        display: 'flex',
        flexDirection: 'column',
        gap: 8,
        minWidth: 0,
        padding: '16px 16px 18px',
        background: T.bg2,
        border: "1px solid ".concat(T.stroke1),
        clipPath: cutPath(9)
      }
    }, /*#__PURE__*/React.createElement("span", {
      style: {
        fontFamily: T.fontBody,
        fontSize: 12.5,
        fontWeight: 600,
        color: T.fg2,
        lineHeight: 1.35
      }
    }, label), /*#__PURE__*/React.createElement("span", {
      style: _objectSpread(_objectSpread({}, DSH_GETAL), {}, {
        fontSize: function (n) {
          return n > 10 ? 22 : n > 8 ? 26 : 30;
        }(String(waarde == null ? '' : waarde).length),
        whiteSpace: 'nowrap',
        overflow: 'hidden',
        textOverflow: 'ellipsis',
        color: kleur || T.fg1
      })
    }, waarde == null ? '—' : waarde), nadruk && /*#__PURE__*/React.createElement("span", {
      style: {
        fontFamily: T.fontBody,
        fontSize: 12.5,
        fontWeight: 700,
        color: nadruk.kleur || T.fg1,
        lineHeight: 1.4
      }
    }, nadruk.tekst), sub && /*#__PURE__*/React.createElement("span", {
      style: DSH_KLEIN
    }, sub), delta);
  };

  /* Legende van de vijf tonen. */
  var DshTonen = function DshTonen(_ref7) {
    var alleen = _ref7.alleen;
    return /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        flexWrap: 'wrap',
        gap: '6px 16px'
      }
    }, (window.DSH_TONEN || []).filter(function (_ref8) {
      var _ref9 = _slicedToArray(_ref8, 1),
        k = _ref9[0];
      return !alleen || alleen.includes(k);
    }).map(function (_ref0) {
      var _ref1 = _slicedToArray(_ref0, 2),
        k = _ref1[0],
        l = _ref1[1];
      return /*#__PURE__*/React.createElement("span", {
        key: k,
        style: {
          display: 'inline-flex',
          alignItems: 'center',
          gap: 7,
          fontFamily: T.fontBody,
          fontSize: 12,
          color: T.fg3
        }
      }, /*#__PURE__*/React.createElement("span", {
        style: {
          width: 9,
          height: 9,
          borderRadius: 2,
          background: k
        }
      }), l);
    }));
  };

  /* Keuzestrook: één rij knoppen, één gekozen. Een optie met uit:true staat grijs met uitleg. */
  /* Keuzestrook van het dashboard = de gedeelde keuzebalk (een optie met uit:true staat grijs met uitleg). */
  var DshSegment = function DshSegment(_ref10) {
    var opties = _ref10.opties,
      waarde = _ref10.waarde,
      onKies = _ref10.onKies,
      label = _ref10.label;
    return /*#__PURE__*/React.createElement(GhsKeuze, {
      waarde: waarde,
      onKies: onKies,
      opties: opties,
      attrs: {
        'aria-label': label
      }
    });
  };

  /* Het oordeel over een module: chip (in de stappen) en banier (bovenaan de kerncijfers). */
  var DshOordeelChip = function DshOordeelChip(_ref11) {
    var o = _ref11.o;
    return /*#__PURE__*/React.createElement("span", {
      title: o.tip,
      style: {
        display: 'inline-flex',
        alignItems: 'center',
        gap: 6,
        padding: '4px 9px',
        background: "".concat(o.kleur, "14"),
        border: "1px solid ".concat(o.kleur, "59"),
        borderRadius: 4,
        fontFamily: T.fontBody,
        fontSize: 11.5,
        fontWeight: 700,
        color: o.kleur,
        whiteSpace: 'nowrap'
      }
    }, /*#__PURE__*/React.createElement("span", {
      style: {
        width: 6,
        height: 6,
        borderRadius: '50%',
        background: o.kleur
      }
    }), o.label);
  };
  /* Werkdruk: het totaal tegenover de twee grenzen, op één balk. Eén vulkleur: die van de
     stand (groen · amber · rood); de grenzen als streepjes met hun waarde eronder. */
  var DSH_STAND_KLEUR = {
    goed: DSH_GROEN,
    letop: DSH_AMBER,
    achter: DSH_ROOD
  };
  var DshWerkdrukMeter = function DshWerkdrukMeter(_ref12) {
    var W = _ref12.W,
      klein = _ref12.klein;
    var kleur = DSH_STAND_KLEUR[W.stand] || DSH_GROEN;
    var schaal = Math.max(W.achter * 1.25, W.letop * 1.25, W.totaal * 1.05, 1);
    var pos = function pos(v) {
      return Math.min(100, Math.max(0, v / schaal * 100));
    };
    var pL = pos(W.letop),
      pA = pos(W.achter),
      dicht = Math.abs(pA - pL) < 18;
    var nr = function nr(v) {
      return (Math.round((v || 0) * 10) / 10).toLocaleString('nl-BE');
    };
    var tik = [['let op', W.letop, pL, DSH_AMBER], ['loopt achter', W.achter, pA, DSH_ROOD]];
    return /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        flexDirection: 'column',
        gap: 12,
        minWidth: 0
      }
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        alignItems: 'baseline',
        gap: '4px 10px',
        flexWrap: 'wrap'
      }
    }, /*#__PURE__*/React.createElement("span", {
      style: DSH_LBL
    }, "Werkdruk"), /*#__PURE__*/React.createElement("span", {
      style: _objectSpread(_objectSpread({}, DSH_GETAL), {}, {
        fontSize: klein ? 22 : 26,
        color: kleur
      })
    }, nr(W.totaal)), /*#__PURE__*/React.createElement("span", {
      style: {
        fontFamily: T.fontBody,
        fontSize: 13,
        fontWeight: 600,
        color: T.fg2
      }
    }, "punten"), /*#__PURE__*/React.createElement("span", {
      style: DSH_KLEIN
    }, "let op vanaf ".concat(W.letop, " \xB7 loopt achter vanaf ").concat(W.achter))), /*#__PURE__*/React.createElement("div", {
      role: "img",
      "aria-label": "Werkdruk ".concat(nr(W.totaal), " punten, let op vanaf ").concat(W.letop, ", loopt achter vanaf ").concat(W.achter),
      style: {
        position: 'relative',
        height: 10,
        marginBottom: 22
      }
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        position: 'absolute',
        inset: 0,
        background: T.bg0,
        border: "1px solid ".concat(T.stroke1),
        borderRadius: 5,
        overflow: 'hidden'
      }
    }, /*#__PURE__*/React.createElement("span", {
      style: {
        display: 'block',
        width: "".concat(pos(W.totaal), "%"),
        height: '100%',
        background: kleur,
        opacity: 0.8,
        transition: 'width 240ms ease'
      }
    })), tik.map(function (_ref13, i) {
      var _ref14 = _slicedToArray(_ref13, 4),
        l = _ref14[0],
        v = _ref14[1],
        p = _ref14[2],
        k = _ref14[3];
      return /*#__PURE__*/React.createElement(React.Fragment, {
        key: l
      }, /*#__PURE__*/React.createElement("span", {
        "aria-hidden": "true",
        style: {
          position: 'absolute',
          left: "".concat(p, "%"),
          top: -4,
          bottom: -4,
          width: 2,
          marginLeft: -1,
          background: k,
          borderRadius: 1
        }
      }), /*#__PURE__*/React.createElement("span", {
        "aria-hidden": "true",
        style: {
          position: 'absolute',
          left: "".concat(p, "%"),
          top: 18,
          transform: dicht ? i === 0 ? 'translateX(calc(-100% - 4px))' : 'translateX(4px)' : 'translateX(-50%)',
          fontFamily: T.fontBody,
          fontSize: 11,
          fontWeight: 700,
          color: k,
          whiteSpace: 'nowrap'
        }
      }, "".concat(l, " ").concat(v)));
    })));
  };
  /* ── De regels achter het oordeel ───────────────────────────────────────────
     Werkdruk, op tijd afgewerkt en drukte: elk met waarde, grens en stand, en — voor wie mag
     instellen — een knop naar de juiste plek in de normenlade. compact = één regel per regel. */
  var DSH_REGEL_KLEUR = {
    achter: DSH_ROOD,
    letop: DSH_AMBER,
    drukker: DSH_AMBER,
    goed: DSH_GROEN
  };
  var DSH_REGEL_STAND = {
    achter: 'Loopt achter',
    letop: 'Let op',
    drukker: 'Drukker',
    goed: 'In orde',
    geen: 'Niet te meten',
    uit: 'Telt niet mee'
  };
  var DshRegels = function DshRegels(_ref15) {
    var regels = _ref15.regels,
      onRegel = _ref15.onRegel,
      compact = _ref15.compact;
    var kl = function kl(r) {
      return DSH_REGEL_KLEUR[r.stand] || T.fg4;
    };
    if (compact) return /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        flexDirection: 'column',
        padding: '2px 14px',
        background: T.bg1,
        border: "1px solid ".concat(T.stroke1),
        clipPath: cutPath(9)
      }
    }, regels.map(function (r, i) {
      return /*#__PURE__*/React.createElement("div", {
        key: r.id,
        style: {
          display: 'flex',
          alignItems: 'center',
          flexWrap: 'wrap',
          gap: '4px 10px',
          padding: '10px 0',
          borderTop: i ? "1px solid ".concat(T.stroke1) : 'none'
        }
      }, /*#__PURE__*/React.createElement("span", {
        style: {
          width: 8,
          height: 8,
          borderRadius: '50%',
          background: kl(r),
          flexShrink: 0
        }
      }), /*#__PURE__*/React.createElement("span", {
        style: {
          flex: '1 1 120px',
          minWidth: 0,
          fontFamily: T.fontBody,
          fontSize: 13,
          fontWeight: 600,
          color: T.fg1
        }
      }, r.label), /*#__PURE__*/React.createElement("span", {
        style: {
          fontFamily: T.fontDisplay,
          fontSize: 14,
          fontWeight: 600,
          color: T.fg1,
          fontVariantNumeric: 'tabular-nums',
          whiteSpace: 'nowrap'
        }
      }, r.waarde), /*#__PURE__*/React.createElement("span", {
        style: _objectSpread(_objectSpread({}, DSH_KLEIN), {}, {
          whiteSpace: 'nowrap'
        })
      }, r.grens), /*#__PURE__*/React.createElement("span", {
        style: {
          minWidth: 92,
          textAlign: 'right',
          fontFamily: T.fontBody,
          fontSize: 11.5,
          fontWeight: 700,
          color: kl(r),
          whiteSpace: 'nowrap'
        }
      }, DSH_REGEL_STAND[r.stand] || ''));
    }));
    return /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'grid',
        gridTemplateColumns: 'repeat(auto-fit,minmax(min(100%,240px),1fr))',
        gap: 10
      }
    }, regels.map(function (r) {
      var k = kl(r),
        uit = !DSH_REGEL_KLEUR[r.stand];
      return /*#__PURE__*/React.createElement("div", {
        key: r.id,
        style: {
          display: 'flex',
          flexDirection: 'column',
          gap: 7,
          minWidth: 0,
          padding: '14px 16px',
          background: T.bg0,
          border: "1px solid ".concat(!uit && r.stand !== 'goed' ? k + '59' : T.stroke1),
          clipPath: cutPath(9)
        }
      }, /*#__PURE__*/React.createElement("span", {
        style: {
          display: 'flex',
          alignItems: 'center',
          gap: 8
        }
      }, /*#__PURE__*/React.createElement("span", {
        style: {
          width: 8,
          height: 8,
          borderRadius: '50%',
          background: k,
          flexShrink: 0
        }
      }), /*#__PURE__*/React.createElement("span", {
        style: _objectSpread(_objectSpread({}, DSH_LBL), {}, {
          fontSize: 10
        })
      }, r.label), /*#__PURE__*/React.createElement("span", {
        style: {
          marginLeft: 'auto',
          fontFamily: T.fontBody,
          fontSize: 11.5,
          fontWeight: 700,
          color: k,
          whiteSpace: 'nowrap'
        }
      }, DSH_REGEL_STAND[r.stand] || '')), /*#__PURE__*/React.createElement("span", {
        style: {
          display: 'flex',
          alignItems: 'baseline',
          gap: '2px 10px',
          flexWrap: 'wrap'
        }
      }, /*#__PURE__*/React.createElement("span", {
        style: _objectSpread(_objectSpread({}, DSH_GETAL), {}, {
          fontSize: 22,
          color: uit ? T.fg3 : T.fg1
        })
      }, r.waarde), /*#__PURE__*/React.createElement("span", {
        style: DSH_KLEIN
      }, r.grens)), /*#__PURE__*/React.createElement("span", {
        style: DSH_KLEIN
      }, r.uitleg), onRegel && /*#__PURE__*/React.createElement("button", {
        type: "button",
        onClick: function onClick() {
          return onRegel(r.focus);
        },
        style: {
          alignSelf: 'flex-start',
          display: 'inline-flex',
          alignItems: 'center',
          gap: 6,
          minHeight: 32,
          marginTop: 'auto',
          padding: 0,
          background: 'none',
          border: 'none',
          cursor: 'pointer',
          fontFamily: T.fontBody,
          fontSize: 12.5,
          fontWeight: 700,
          color: DSH_GROEN
        }
      }, /*#__PURE__*/React.createElement(Icon, {
        name: "settings",
        size: 13,
        color: "currentColor"
      }), "Instellen"));
    }));
  };
  var DshAanhoudendChip = function DshAanhoudendChip(_ref16) {
    var o = _ref16.o;
    return /*#__PURE__*/React.createElement("span", {
      title: (o.aanhoudend || []).map(function (a) {
        return "".concat(a.label, " ").concat(a.tekst);
      }).join('\n'),
      style: {
        display: 'inline-flex',
        alignItems: 'center',
        gap: 6,
        padding: '4px 9px',
        background: "".concat(DSH_ROOD, "14"),
        border: "1px solid ".concat(DSH_ROOD, "59"),
        borderRadius: 4,
        fontFamily: T.fontBody,
        fontSize: 11.5,
        fontWeight: 700,
        color: DSH_ROOD,
        whiteSpace: 'nowrap'
      }
    }, /*#__PURE__*/React.createElement(Icon, {
      name: "alert",
      size: 11,
      color: "currentColor"
    }), "Aanhoudend");
  };
  /* Het oordeel over een module: stand, waarom, de drie regels, de werkdrukbalk en wat al
     langer misloopt. onRegel opent de normenlade op die regel. */
  var DshOordeel = function DshOordeel(_ref17) {
    var o = _ref17.o,
      onRegel = _ref17.onRegel;
    var aanh = o.aanhoudend || [];
    return /*#__PURE__*/React.createElement("div", {
      style: {
        position: 'relative',
        display: 'flex',
        flexDirection: 'column',
        gap: 18,
        padding: '20px 24px 22px 28px',
        background: "".concat(dshGrad(o.kleur, 900), ", ").concat(T.bg2),
        border: "1px solid ".concat(o.kleur, "40"),
        clipPath: cutPath(12)
      }
    }, /*#__PURE__*/React.createElement(DshBalk, {
      kleur: o.kleur
    }), /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        alignItems: 'flex-start',
        gap: '10px 20px',
        flexWrap: 'wrap'
      }
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        flex: '1 1 320px',
        minWidth: 0
      }
    }, /*#__PURE__*/React.createElement("span", {
      style: DSH_LBL
    }, "Stand van zaken"), /*#__PURE__*/React.createElement("div", {
      style: {
        fontFamily: T.fontDisplay,
        fontSize: 26,
        fontWeight: 600,
        color: o.kleur,
        marginTop: 6,
        lineHeight: 1.15,
        textShadow: "0 0 22px ".concat(o.kleur, "59")
      }
    }, o.label), o.waarom && /*#__PURE__*/React.createElement("p", {
      style: _objectSpread(_objectSpread({}, DSH_P), {}, {
        marginTop: 8
      })
    }, o.waarom)), aanh.length > 0 && /*#__PURE__*/React.createElement(DshAanhoudendChip, {
      o: o
    })), o.regels && /*#__PURE__*/React.createElement(DshRegels, {
      regels: o.regels,
      onRegel: onRegel
    }), o.werkdruk && /*#__PURE__*/React.createElement("div", {
      style: {
        paddingTop: 16,
        borderTop: "1px solid ".concat(o.kleur, "2e")
      }
    }, /*#__PURE__*/React.createElement(DshWerkdrukMeter, {
      W: o.werkdruk
    })), aanh.length > 0 && /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        flexDirection: 'column',
        gap: 8,
        paddingTop: 14,
        borderTop: "1px solid ".concat(o.kleur, "2e")
      }
    }, /*#__PURE__*/React.createElement("span", {
      style: DSH_LBL
    }, "Loopt al langer mis"), aanh.map(function (a) {
      return /*#__PURE__*/React.createElement("span", {
        key: a.id,
        style: {
          display: 'flex',
          alignItems: 'flex-start',
          gap: 8,
          fontFamily: T.fontBody,
          fontSize: 13.5,
          fontWeight: 600,
          color: T.fg1,
          lineHeight: 1.45
        }
      }, /*#__PURE__*/React.createElement("span", {
        style: {
          display: 'flex',
          marginTop: 3
        }
      }, /*#__PURE__*/React.createElement(Icon, {
        name: "alert",
        size: 13,
        color: DSH_ROOD
      })), "".concat(a.label, " ").concat(a.tekst, "."));
    })));
  };

  /* Grootste knelpunt nu: de status waar alles samen de meeste dagen boven de norm zit. */
  var DshKnelpunt = function DshKnelpunt(_ref18) {
    var k = _ref18.k,
      onKies = _ref18.onKies;
    return /*#__PURE__*/React.createElement("button", {
      type: "button",
      onClick: function onClick() {
        return onKies(k.id);
      },
      style: {
        position: 'relative',
        display: 'flex',
        alignItems: 'center',
        gap: '12px 24px',
        flexWrap: 'wrap',
        width: '100%',
        textAlign: 'left',
        padding: '16px 20px 16px 26px',
        background: "".concat(dshGrad(DSH_ROOD, 900), ", ").concat(T.bg2),
        border: "1px solid ".concat(DSH_ROOD, "40"),
        clipPath: cutPath(10),
        cursor: 'pointer'
      }
    }, /*#__PURE__*/React.createElement(DshBalk, {
      kleur: DSH_ROOD
    }), /*#__PURE__*/React.createElement("span", {
      style: {
        flex: '1 1 260px',
        minWidth: 0
      }
    }, /*#__PURE__*/React.createElement("span", {
      style: _objectSpread(_objectSpread({}, DSH_LBL), {}, {
        display: 'block'
      })
    }, "Grootste knelpunt nu"), /*#__PURE__*/React.createElement("span", {
      style: {
        display: 'block',
        fontFamily: T.fontDisplay,
        fontSize: 18,
        fontWeight: 600,
        color: T.fg1,
        marginTop: 5
      }
    }, k.label), /*#__PURE__*/React.createElement("span", {
      style: _objectSpread(_objectSpread({}, DSH_KLEIN), {}, {
        display: 'block',
        marginTop: 4
      })
    }, "Hier zit nu de meeste vertraging: alle dagen boven de norm van deze status, samengeteld.")), /*#__PURE__*/React.createElement("span", {
      style: {
        display: 'flex',
        gap: '10px 26px',
        flexWrap: 'wrap'
      }
    }, [[k.boven, k.boven === 1 ? 'dossier boven de norm' : 'dossiers boven de norm'], ["".concat(k.teveel, " d"), 'samen te laat'], ["".concat(dshFmt(k.gem), " d"), 'gemiddeld per dossier']].map(function (_ref19) {
      var _ref20 = _slicedToArray(_ref19, 2),
        w = _ref20[0],
        l = _ref20[1];
      return /*#__PURE__*/React.createElement("span", {
        key: l,
        style: {
          display: 'flex',
          flexDirection: 'column',
          gap: 3
        }
      }, /*#__PURE__*/React.createElement("span", {
        style: _objectSpread(_objectSpread({}, DSH_GETAL), {}, {
          fontSize: 20,
          color: DSH_ROOD
        })
      }, w), /*#__PURE__*/React.createElement("span", {
        style: DSH_KLEIN
      }, l));
    })), /*#__PURE__*/React.createElement("span", {
      style: {
        display: 'inline-flex',
        alignItems: 'center',
        gap: 5,
        fontFamily: T.fontBody,
        fontSize: 12.5,
        fontWeight: 700,
        color: DSH_GROEN,
        whiteSpace: 'nowrap'
      }
    }, "Toon de dossiers", /*#__PURE__*/React.createElement(Icon, {
      name: "chevronright",
      size: 14,
      color: "currentColor"
    })));
  };

  /* ── Verloop: de voorbije 12 maanden, maand per maand ─────────────────────────
     Binnen, afgewerkt, het verschil (groeit de werkvoorraad?), op tijd tegenover het minimum
     en de doorlooptijd tegenover de norm. Een maand buiten de norm kleurt amber: zo valt een
     probleem dat blijft duren meteen op. Nieuwste maand bovenaan. */
  var DshVerloop = function DshVerloop(_ref21) {
    var maanden = _ref21.maanden,
      norm = _ref21.norm,
      minOk = _ref21.minOk;
    var box = window.useGhsBox ? window.useGhsBox({
      krap: 700
    }) : {
      ref: null,
      krap: false
    };
    var rijen = (maanden || []).slice().reverse();
    var GRID = box.krap ? 'minmax(0,1fr) auto' : 'minmax(120px,1fr) 70px 88px 82px minmax(170px,1.6fr) minmax(110px,auto)';
    var num = {
      fontFamily: T.fontDisplay,
      fontSize: 14,
      fontWeight: 600,
      fontVariantNumeric: 'tabular-nums',
      textAlign: 'right',
      whiteSpace: 'nowrap'
    };
    return /*#__PURE__*/React.createElement("div", {
      ref: box.ref,
      style: {
        minWidth: 0
      }
    }, !box.krap && /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'grid',
        gridTemplateColumns: GRID,
        gap: 14,
        padding: '0 12px 10px',
        borderBottom: "1px solid ".concat(T.stroke2)
      }
    }, ['MAAND', 'BINNEN', 'AFGEWERKT', 'VERSCHIL', 'OP TIJD', 'DOORLOOPTIJD'].map(function (k, i) {
      return /*#__PURE__*/React.createElement("span", {
        key: k,
        style: _objectSpread(_objectSpread({}, DSH_LBL), {}, {
          fontSize: 9.5,
          textAlign: i === 0 || i === 4 ? 'left' : 'right'
        })
      }, k);
    })), rijen.map(function (v) {
      var bal = v.instroom - v.afgewerkt;
      var otSlecht = !!(v.opTijd && v.opTijd.pct < minOk),
        ltSlecht = v.looptijd != null && v.looptijd > norm;
      return /*#__PURE__*/React.createElement("div", {
        key: v.van,
        style: {
          display: 'grid',
          gridTemplateColumns: GRID,
          gap: 14,
          alignItems: 'center',
          padding: '12px 12px',
          borderBottom: "1px solid ".concat(T.stroke1)
        }
      }, /*#__PURE__*/React.createElement("span", {
        style: {
          display: 'flex',
          alignItems: 'baseline',
          gap: 8,
          minWidth: 0
        }
      }, /*#__PURE__*/React.createElement("span", {
        style: {
          fontFamily: T.fontBody,
          fontSize: 13.5,
          fontWeight: 600,
          color: T.fg1,
          whiteSpace: 'nowrap'
        }
      }, v.lang), v.lopend && /*#__PURE__*/React.createElement("span", {
        style: DSH_KLEIN
      }, "lopend")), box.krap ? /*#__PURE__*/React.createElement("span", {
        style: {
          display: 'flex',
          flexDirection: 'column',
          alignItems: 'flex-end',
          gap: 2
        }
      }, /*#__PURE__*/React.createElement("span", {
        style: _objectSpread(_objectSpread({}, num), {}, {
          color: otSlecht ? DSH_AMBER : T.fg1
        })
      }, v.opTijd ? "".concat(v.opTijd.pct, "% op tijd") : '—'), /*#__PURE__*/React.createElement("span", {
        style: DSH_KLEIN
      }, "".concat(v.instroom, " binnen \xB7 ").concat(v.afgewerkt, " af \xB7 ").concat(v.looptijd == null ? '—' : dshFmt(v.looptijd) + ' d'))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
        style: _objectSpread(_objectSpread({}, num), {}, {
          color: T.fg1
        })
      }, v.instroom), /*#__PURE__*/React.createElement("span", {
        style: _objectSpread(_objectSpread({}, num), {}, {
          color: T.fg1
        })
      }, v.afgewerkt), /*#__PURE__*/React.createElement("span", {
        style: _objectSpread(_objectSpread({}, num), {}, {
          color: bal > 0 ? DSH_AMBER : T.fg3
        })
      }, bal > 0 ? "+".concat(bal) : bal < 0 ? "\u2212".concat(-bal) : '0'), /*#__PURE__*/React.createElement("span", {
        style: {
          display: 'flex',
          alignItems: 'center',
          gap: 10,
          minWidth: 0
        }
      }, /*#__PURE__*/React.createElement("span", {
        style: {
          position: 'relative',
          flex: 1,
          height: 8,
          background: T.bg0,
          border: "1px solid ".concat(T.stroke1),
          borderRadius: 4
        }
      }, v.opTijd && /*#__PURE__*/React.createElement("span", {
        style: {
          position: 'absolute',
          left: 0,
          top: 0,
          bottom: 0,
          width: "".concat(v.opTijd.pct, "%"),
          background: otSlecht ? DSH_AMBER : 'rgba(0,217,0,0.6)',
          borderRadius: 4
        }
      }), /*#__PURE__*/React.createElement("span", {
        "aria-hidden": "true",
        style: {
          position: 'absolute',
          left: "".concat(minOk, "%"),
          top: -4,
          bottom: -4,
          width: 2,
          marginLeft: -1,
          background: T.fg2
        }
      })), /*#__PURE__*/React.createElement("span", {
        style: _objectSpread(_objectSpread({}, num), {}, {
          minWidth: 44,
          color: otSlecht ? DSH_AMBER : v.opTijd ? T.fg1 : T.fg4
        })
      }, v.opTijd ? "".concat(v.opTijd.pct, "%") : '—')), /*#__PURE__*/React.createElement("span", {
        style: _objectSpread(_objectSpread({}, num), {}, {
          color: ltSlecht ? DSH_AMBER : v.looptijd == null ? T.fg4 : T.fg1
        })
      }, v.looptijd == null ? '—' : "".concat(dshFmt(v.looptijd), " d"))));
    }), /*#__PURE__*/React.createElement("p", {
      style: _objectSpread(_objectSpread({}, DSH_KLEIN), {}, {
        marginTop: 12
      })
    }, "Streepje = minimum op tijd (".concat(minOk, "%) \xB7 doorlooptijd tegenover de norm van ").concat(norm, " dagen \xB7 verschil = binnen min afgewerkt \xB7 amber = buiten de norm")));
  };

  /* ── Waar staan de dossiers: de vier stappen naast elkaar ───────────────────────
     Per stap één kolom: nummer, naam en oordeel, het aantal met een staande meter (aandeel
     van alle lopende dossiers), waar ze nu op wachten, en onderaan wat dringend is + doorklikken.
     Loopt een module achter, dan krijgt haar kolom de rode gradient. */
  var DshPijplijn = function DshPijplijn(_ref22) {
    var stappen = _ref22.stappen,
      onOpen = _ref22.onOpen;
    /* Vier naast elkaar; smaller twee bij twee; heel smal onder elkaar — nooit één stap alleen op een rij. */
    var box = window.useGhsBox ? window.useGhsBox({
      krap: 960
    }) : {
      ref: null,
      krap: false
    };
    var smal = window.useGhsBox ? window.useGhsBox({
      krap: 520
    }) : {
      ref: null,
      krap: false
    };
    var kol = !box.krap ? stappen.length : !smal.krap ? 2 : 1;
    var pijl = function pijl(i) {
      return i > 0 && (kol === stappen.length || kol === 2 && i % 2 === 1);
    };
    var max = Math.max.apply(Math, [1].concat(_toConsumableArray(stappen.map(function (s) {
      return s.n;
    }))));
    var totaal = stappen.reduce(function (s, x) {
      return s + x.n;
    }, 0);
    return /*#__PURE__*/React.createElement("div", {
      ref: smal.ref
    }, /*#__PURE__*/React.createElement("div", {
      ref: box.ref,
      style: {
        display: 'grid',
        gridTemplateColumns: "repeat(".concat(kol, ",minmax(0,1fr))"),
        gap: kol === 1 ? 12 : 30
      }
    }, stappen.map(function (s, i) {
      var top = s.statussen.filter(function (x) {
        return x.n;
      }).sort(function (a, b) {
        return b.n - a.n;
      });
      var rest = top.slice(4).reduce(function (t, x) {
        return t + x.n;
      }, 0);
      var o = s.oordeel;
      var achter = !!(o && o.id === 'achter');
      return /*#__PURE__*/React.createElement("div", {
        key: s.id,
        style: {
          position: 'relative',
          display: 'flex',
          minWidth: 0
        }
      }, pijl(i) && /*#__PURE__*/React.createElement("span", {
        "aria-hidden": "true",
        style: {
          position: 'absolute',
          left: -24,
          top: 62,
          display: 'flex',
          color: T.fg4
        }
      }, /*#__PURE__*/React.createElement(Icon, {
        name: "chevronright",
        size: 18,
        color: "currentColor"
      })), /*#__PURE__*/React.createElement("div", {
        style: {
          position: 'relative',
          flex: 1,
          display: 'flex',
          flexDirection: 'column',
          gap: 18,
          minWidth: 0,
          padding: '18px 18px 16px 20px',
          background: achter ? "".concat(dshGrad(DSH_ROOD), ", ").concat(T.bg2) : T.bg2,
          border: "1px solid ".concat(achter ? DSH_ROOD + '59' : T.stroke1),
          clipPath: cutPath(12)
        }
      }, achter && /*#__PURE__*/React.createElement(DshBalk, {
        kleur: DSH_ROOD
      }), /*#__PURE__*/React.createElement("div", {
        style: {
          display: 'flex',
          alignItems: 'flex-start',
          justifyContent: 'space-between',
          gap: '6px 10px',
          flexWrap: 'wrap'
        }
      }, /*#__PURE__*/React.createElement("div", {
        style: {
          minWidth: 0
        }
      }, /*#__PURE__*/React.createElement("span", {
        style: DSH_LBL
      }, "Stap ".concat(i + 1)), /*#__PURE__*/React.createElement("h3", {
        style: _objectSpread(_objectSpread({}, DSH_H3), {}, {
          marginTop: 4
        })
      }, s.label)), o && /*#__PURE__*/React.createElement("span", {
        style: {
          display: 'flex',
          alignItems: 'center',
          gap: 6,
          flexWrap: 'wrap',
          justifyContent: 'flex-end'
        }
      }, /*#__PURE__*/React.createElement(DshOordeelChip, {
        o: o
      }), o.aanhoudend && o.aanhoudend.length > 0 && /*#__PURE__*/React.createElement(DshAanhoudendChip, {
        o: o
      }))), /*#__PURE__*/React.createElement("div", {
        style: {
          display: 'flex',
          alignItems: 'flex-end',
          gap: 16
        }
      }, /*#__PURE__*/React.createElement("div", {
        title: "".concat(s.n, " van ").concat(totaal, " lopende dossiers"),
        style: {
          width: 40,
          height: 132,
          flexShrink: 0,
          display: 'flex',
          alignItems: 'flex-end',
          background: T.bg0,
          border: "1px solid ".concat(T.stroke1),
          borderRadius: 3,
          overflow: 'hidden'
        }
      }, /*#__PURE__*/React.createElement("span", {
        style: {
          width: '100%',
          height: "".concat(s.n / max * 100, "%"),
          minHeight: s.n ? 4 : 0,
          background: 'linear-gradient(180deg, rgba(0,217,0,0.75), rgba(0,217,0,0.32))'
        }
      })), /*#__PURE__*/React.createElement("div", {
        style: {
          minWidth: 0,
          paddingBottom: 2
        }
      }, /*#__PURE__*/React.createElement("span", {
        style: _objectSpread(_objectSpread({}, DSH_GETAL), {}, {
          display: 'block',
          fontSize: 42
        })
      }, s.n), /*#__PURE__*/React.createElement("span", {
        style: _objectSpread(_objectSpread({}, DSH_KLEIN), {}, {
          display: 'block',
          marginTop: 6
        })
      }, "dossiers \xB7 ".concat(totaal ? Math.round(s.n / totaal * 100) : 0, "% van alle lopende")))), /*#__PURE__*/React.createElement("div", {
        style: {
          paddingTop: 14,
          borderTop: "1px solid ".concat(achter ? DSH_ROOD + '33' : T.stroke1),
          display: 'flex',
          flexDirection: 'column',
          gap: 8
        }
      }, /*#__PURE__*/React.createElement("span", {
        style: _objectSpread(_objectSpread({}, DSH_LBL), {}, {
          fontSize: 10
        })
      }, "Waar ze nu staan"), top.length ? top.slice(0, 4).map(function (x) {
        return /*#__PURE__*/React.createElement("span", {
          key: x.id,
          style: {
            display: 'flex',
            alignItems: 'center',
            gap: 9,
            minWidth: 0
          }
        }, /*#__PURE__*/React.createElement("span", {
          style: {
            width: 8,
            height: 8,
            borderRadius: 2,
            background: x.kleur,
            flexShrink: 0
          }
        }), /*#__PURE__*/React.createElement("span", {
          style: {
            flex: 1,
            minWidth: 0,
            fontFamily: T.fontBody,
            fontSize: 12.5,
            color: T.fg2,
            lineHeight: 1.35
          }
        }, x.label), x.boven > 0 && /*#__PURE__*/React.createElement("span", {
          title: "".concat(x.boven, " boven de norm"),
          style: {
            fontFamily: T.fontBody,
            fontSize: 11,
            fontWeight: 700,
            color: DSH_ROOD
          }
        }, "".concat(x.boven, " boven norm")), /*#__PURE__*/React.createElement("span", {
          style: {
            fontFamily: T.fontDisplay,
            fontSize: 14,
            fontWeight: 600,
            color: T.fg1,
            fontVariantNumeric: 'tabular-nums'
          }
        }, x.n));
      }) : /*#__PURE__*/React.createElement("span", {
        style: DSH_KLEIN
      }, "Niets in deze stap."), rest > 0 && /*#__PURE__*/React.createElement("span", {
        style: DSH_KLEIN
      }, "+ ".concat(rest, " in andere statussen"))), /*#__PURE__*/React.createElement("div", {
        style: {
          marginTop: 'auto',
          paddingTop: 14,
          borderTop: "1px solid ".concat(achter ? DSH_ROOD + '33' : T.stroke1),
          display: 'flex',
          alignItems: 'center',
          gap: 10,
          flexWrap: 'wrap'
        }
      }, s.dringend ? /*#__PURE__*/React.createElement("span", {
        style: {
          display: 'inline-flex',
          alignItems: 'center',
          gap: 6,
          fontFamily: T.fontBody,
          fontSize: 12.5,
          fontWeight: 700,
          color: DSH_ROOD
        }
      }, /*#__PURE__*/React.createElement("span", {
        style: {
          width: 7,
          height: 7,
          borderRadius: '50%',
          background: DSH_ROOD
        }
      }), "".concat(s.dringend, " ").concat(s.dringend === 1 ? 'vraagt' : 'vragen', " nu opvolging")) : /*#__PURE__*/React.createElement("span", {
        style: _objectSpread({}, DSH_KLEIN)
      }, "Niets dringend"), /*#__PURE__*/React.createElement("button", {
        type: "button",
        onClick: function onClick() {
          return onOpen(s.id);
        },
        style: {
          marginLeft: 'auto',
          display: 'inline-flex',
          alignItems: 'center',
          gap: 5,
          minHeight: 36,
          padding: '0 4px',
          background: 'none',
          border: 'none',
          cursor: 'pointer',
          fontFamily: T.fontBody,
          fontSize: 12.5,
          fontWeight: 700,
          color: DSH_GROEN
        }
      }, "Bekijk", /*#__PURE__*/React.createElement(Icon, {
        name: "chevronright",
        size: 14,
        color: "currentColor"
      })))));
    })));
  };

  /* ── Doorlooptijd: per fase gegroepeerd, één kleur, het knelpunt in amber ── */
  var DSH_FASEGROEP = [['Verkoop', ['lead', 'afspraak', 'versturen', 'tekenen']], ['Opmeting', ['opmeting']], ['Uitvoering', ['planning', 'bon']], ['Administratie', ['doorsturen', 'betalen']]];
  var DshDoorloop = function DshDoorloop(_ref23) {
    var traject = _ref23.traject,
      trajectV = _ref23.trajectV,
      vergelijk = _ref23.vergelijk,
      alleen = _ref23.alleen;
    var box = window.useGhsBox ? window.useGhsBox({
      krap: 640
    }) : {
      ref: null,
      krap: false
    };
    var stappen = traject.stappen.filter(function (s) {
      return !alleen || alleen.includes(s.id);
    });
    var max = Math.max.apply(Math, [1].concat(_toConsumableArray(stappen.map(function (s) {
      return s.gem || 0;
    }))));
    var knel = alleen ? null : stappen.reduce(function (a, s) {
      return (s.gem || 0) > (a && a.gem || 0) ? s : a;
    }, null);
    var vorig = function vorig(id) {
      return trajectV ? (trajectV.stappen.find(function (s) {
        return s.id === id;
      }) || {}).gem : null;
    };
    var groepen = alleen ? [['', alleen]] : DSH_FASEGROEP;
    var GRID = box.krap ? 'minmax(0,1fr) auto' : 'minmax(180px,1.2fr) minmax(0,2.2fr) 84px minmax(120px,auto)';
    return /*#__PURE__*/React.createElement("div", {
      ref: box.ref,
      style: {
        display: 'flex',
        flexDirection: 'column',
        gap: 22,
        minWidth: 0
      }
    }, !alleen && /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        alignItems: 'stretch',
        gap: 12,
        flexWrap: 'wrap'
      }
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        flex: '1 1 280px',
        padding: '16px 18px',
        background: T.bg2,
        border: "1px solid ".concat(T.stroke1),
        clipPath: cutPath(9)
      }
    }, /*#__PURE__*/React.createElement("span", {
      style: {
        fontFamily: T.fontBody,
        fontSize: 12.5,
        fontWeight: 600,
        color: T.fg2
      }
    }, "Van eerste contact tot betaald"), /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        alignItems: 'baseline',
        gap: 10,
        marginTop: 6,
        flexWrap: 'wrap'
      }
    }, /*#__PURE__*/React.createElement("span", {
      style: _objectSpread(_objectSpread({}, DSH_GETAL), {}, {
        fontSize: 34
      })
    }, traject.totaal.gem == null ? '—' : "".concat(dshFmt(traject.totaal.gem), " dagen")), vergelijk && /*#__PURE__*/React.createElement(DshDelta, {
      nu: traject.totaal.gem,
      vorige: trajectV ? trajectV.totaal.gem : null,
      beter: "lager",
      eenheid: "d"
    })), /*#__PURE__*/React.createElement("p", {
      style: _objectSpread(_objectSpread({}, DSH_KLEIN), {}, {
        marginTop: 6
      })
    }, "mediaan ".concat(traject.totaal.med == null ? '—' : dshFmt(traject.totaal.med) + ' dagen', " \xB7 ").concat(traject.totaal.n, " dossiers betaald in de periode"))), knel && knel.gem != null && /*#__PURE__*/React.createElement("div", {
      style: {
        flex: '1 1 280px',
        padding: '16px 18px',
        background: 'rgba(255,176,32,0.07)',
        border: '1px solid rgba(255,176,32,0.35)',
        clipPath: cutPath(9)
      }
    }, /*#__PURE__*/React.createElement("span", {
      style: {
        display: 'inline-flex',
        alignItems: 'center',
        gap: 7,
        fontFamily: T.fontBody,
        fontSize: 12.5,
        fontWeight: 700,
        color: DSH_AMBER
      }
    }, /*#__PURE__*/React.createElement(Icon, {
      name: "alert",
      size: 13,
      color: "currentColor"
    }), "Langste stap"), /*#__PURE__*/React.createElement("div", {
      style: _objectSpread(_objectSpread({}, DSH_GETAL), {}, {
        fontSize: 22,
        marginTop: 8
      })
    }, knel.label), /*#__PURE__*/React.createElement("p", {
      style: _objectSpread(_objectSpread({}, DSH_KLEIN), {}, {
        marginTop: 6
      })
    }, "gemiddeld ".concat(dshFmt(knel.gem), " dagen \u2014 ").concat(Math.round(knel.gem / Math.max(1, stappen.reduce(function (s, x) {
      return s + (x.gem || 0);
    }, 0)) * 100), "% van alle stappen samen")))), groepen.map(function (_ref24) {
      var _ref25 = _slicedToArray(_ref24, 2),
        titel = _ref25[0],
        ids = _ref25[1];
      return /*#__PURE__*/React.createElement("div", {
        key: titel || 'stappen',
        style: {
          minWidth: 0
        }
      }, titel && /*#__PURE__*/React.createElement("h3", {
        style: _objectSpread(_objectSpread({}, DSH_H3), {}, {
          fontSize: 14,
          marginBottom: 6
        })
      }, titel), ids.map(function (id) {
        var s = stappen.find(function (x) {
          return x.id === id;
        });
        if (!s) return null;
        var isK = knel && knel.id === id;
        return /*#__PURE__*/React.createElement("div", {
          key: id,
          style: {
            display: 'grid',
            gridTemplateColumns: GRID,
            gap: 14,
            alignItems: 'center',
            padding: '11px 0',
            borderBottom: "1px solid ".concat(T.stroke1)
          }
        }, /*#__PURE__*/React.createElement("span", {
          style: {
            fontFamily: T.fontBody,
            fontSize: 13,
            color: T.fg1,
            minWidth: 0
          }
        }, s.label), box.krap ? /*#__PURE__*/React.createElement("span", {
          style: {
            textAlign: 'right'
          }
        }, /*#__PURE__*/React.createElement("span", {
          style: _objectSpread(_objectSpread({}, DSH_GETAL), {}, {
            fontSize: 15,
            color: isK ? DSH_AMBER : T.fg1
          })
        }, s.gem == null ? '—' : "".concat(dshFmt(s.gem), " d")), /*#__PURE__*/React.createElement("span", {
          style: _objectSpread(_objectSpread({}, DSH_KLEIN), {}, {
            marginLeft: 6
          })
        }, "n=".concat(s.n))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
          style: {
            height: 8,
            background: T.bg0,
            borderRadius: 4,
            overflow: 'hidden'
          }
        }, /*#__PURE__*/React.createElement("span", {
          style: {
            display: 'block',
            width: "".concat(s.gem == null ? 0 : Math.max(2, s.gem / max * 100), "%"),
            height: '100%',
            background: isK ? DSH_AMBER : 'rgba(0,217,0,0.6)',
            borderRadius: 4
          }
        })), /*#__PURE__*/React.createElement("span", {
          style: _objectSpread(_objectSpread({}, DSH_GETAL), {}, {
            fontSize: 16,
            textAlign: 'right',
            color: s.gem == null ? T.fg4 : isK ? DSH_AMBER : T.fg1
          })
        }, s.gem == null ? '—' : "".concat(dshFmt(s.gem), " d")), /*#__PURE__*/React.createElement("span", {
          style: {
            display: 'flex',
            flexDirection: 'column',
            alignItems: 'flex-end',
            gap: 2
          }
        }, /*#__PURE__*/React.createElement("span", {
          style: DSH_KLEIN
        }, "mediaan ".concat(s.med == null ? '—' : dshFmt(s.med) + ' d', " \xB7 ").concat(s.n, " dossiers")), vergelijk && /*#__PURE__*/React.createElement(DshDelta, {
          nu: s.gem,
          vorige: vorig(id),
          beter: "lager",
          eenheid: "d"
        }))));
      }));
    }));
  };

  /* ── Statussen van één module: een kaart per status ──────────────────────────────
     Groot het aantal, daaronder gemiddeld · norm · oudste. Ligt het gemiddelde boven de
     norm (of is de status per definitie te laat), dan krijgt de kaart de rode gradient.
     Lege statussen staan samen op één regel eronder. */
  var DshStatusKaarten = function DshStatusKaarten(_ref26) {
    var statussen = _ref26.statussen,
      totaal = _ref26.totaal,
      geld = _ref26.geld,
      gekozen = _ref26.gekozen,
      onKies = _ref26.onKies,
      onNorm = _ref26.onNorm;
    var vol = statussen.filter(function (s) {
        return s.n;
      }),
      leeg = statussen.filter(function (s) {
        return !s.n;
      });
    var normTxt = function normTxt(s) {
      return s.normDagen === 'altijd' ? 'altijd te laat' : typeof s.normDagen === 'number' ? "".concat(s.normDagen, " d") : 'gepland';
    };
    return /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        flexDirection: 'column',
        gap: 14
      }
    }, vol.length ? /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'grid',
        gridTemplateColumns: 'repeat(auto-fill,minmax(min(100%,290px),1fr))',
        gap: 12
      }
    }, vol.map(function (s) {
      var on = gekozen === s.id,
        rood = s.achter,
        tot = s.richting === 'tot';
      return /*#__PURE__*/React.createElement("div", {
        key: s.id,
        role: "button",
        tabIndex: 0,
        onClick: function onClick() {
          return onKies(on ? null : s.id);
        },
        "aria-pressed": on,
        onKeyDown: function onKeyDown(e) {
          if (e.target === e.currentTarget && (e.key === 'Enter' || e.key === ' ')) {
            e.preventDefault();
            onKies(on ? null : s.id);
          }
        },
        onMouseEnter: function onMouseEnter(e) {
          if (!on) e.currentTarget.style.borderColor = rood ? DSH_ROOD + '99' : T.stroke2;
        },
        onMouseLeave: function onMouseLeave(e) {
          if (!on) e.currentTarget.style.borderColor = rood ? DSH_ROOD + '59' : T.stroke1;
        },
        style: {
          position: 'relative',
          display: 'flex',
          flexDirection: 'column',
          gap: 16,
          textAlign: 'left',
          minWidth: 0,
          padding: '18px 18px 16px 22px',
          background: rood ? "".concat(dshGrad(DSH_ROOD), ", ").concat(T.bg2) : T.bg2,
          border: "1px solid ".concat(on ? DSH_GROEN : rood ? DSH_ROOD + '59' : T.stroke1),
          clipPath: cutPath(12),
          cursor: 'pointer',
          transition: 'border-color 140ms'
        }
      }, rood && /*#__PURE__*/React.createElement(DshBalk, {
        kleur: DSH_ROOD
      }), /*#__PURE__*/React.createElement("span", {
        style: {
          display: 'flex',
          alignItems: 'flex-start',
          gap: 10,
          width: '100%'
        }
      }, /*#__PURE__*/React.createElement("span", {
        style: {
          width: 9,
          height: 9,
          marginTop: 6,
          borderRadius: 2,
          background: s.kleur,
          flexShrink: 0
        }
      }), /*#__PURE__*/React.createElement("span", {
        style: {
          flex: 1,
          minWidth: 0
        }
      }, /*#__PURE__*/React.createElement("span", {
        style: _objectSpread(_objectSpread({}, DSH_H3), {}, {
          display: 'block',
          fontSize: 15
        })
      }, s.label), /*#__PURE__*/React.createElement("span", {
        style: _objectSpread(_objectSpread({}, DSH_KLEIN), {}, {
          display: 'block',
          marginTop: 3
        })
      }, "dagen ".concat(s.uitleg))), on && /*#__PURE__*/React.createElement("span", {
        style: {
          fontFamily: T.fontBody,
          fontSize: 11,
          fontWeight: 700,
          color: DSH_GROEN,
          whiteSpace: 'nowrap'
        }
      }, "Getoond")), /*#__PURE__*/React.createElement("span", {
        style: {
          display: 'flex',
          alignItems: 'baseline',
          gap: '4px 10px',
          flexWrap: 'wrap',
          width: '100%'
        }
      }, /*#__PURE__*/React.createElement("span", {
        style: _objectSpread(_objectSpread({}, DSH_GETAL), {}, {
          fontSize: 36
        })
      }, s.n), /*#__PURE__*/React.createElement("span", {
        style: DSH_KLEIN
      }, "".concat(totaal ? Math.round(s.n / totaal * 100) : 0, "% van de module")), /*#__PURE__*/React.createElement("span", {
        title: "Werkdruk: aantal \xD7 gewicht van de status",
        style: {
          marginLeft: 'auto',
          fontFamily: T.fontBody,
          fontSize: 12,
          fontWeight: 600,
          color: s.gewicht ? T.fg2 : T.fg4,
          whiteSpace: 'nowrap'
        }
      }, s.gewicht ? "\xD7 ".concat(dshFmt(s.gewicht), " = ").concat(dshFmt(s.punten), " pt") : 'telt niet mee')), /*#__PURE__*/React.createElement("span", {
        style: {
          display: 'grid',
          gridTemplateColumns: 'repeat(3,minmax(0,1fr))',
          gap: 10,
          width: '100%',
          paddingTop: 12,
          borderTop: "1px solid ".concat(rood ? DSH_ROOD + '33' : T.stroke1)
        }
      }, [['Gemiddeld', s.gem == null ? '—' : "".concat(tot ? 'over ' : '').concat(dshFmt(s.gem), " d"), rood], ['Norm', normTxt(s), false, !!onNorm && typeof s.normDagen === 'number'], [tot ? 'Eerstvolgende' : 'Oudste', tot ? s.min == null ? '—' : s.min === 0 ? 'vandaag' : "over ".concat(s.min, " d") : s.max == null ? '—' : "".concat(s.max, " d"), !tot && s.boven > 0]].map(function (_ref27) {
        var _ref28 = _slicedToArray(_ref27, 4),
          l = _ref28[0],
          w = _ref28[1],
          r = _ref28[2],
          knop = _ref28[3];
        return /*#__PURE__*/React.createElement("span", {
          key: l,
          style: {
            minWidth: 0
          }
        }, /*#__PURE__*/React.createElement("span", {
          style: _objectSpread(_objectSpread({}, DSH_LBL), {}, {
            display: 'block',
            fontSize: 9.5
          })
        }, l), knop ? /*#__PURE__*/React.createElement("button", {
          type: "button",
          title: "Norm aanpassen",
          onClick: function onClick(e) {
            e.stopPropagation();
            onNorm(s.norm);
          },
          onMouseEnter: function onMouseEnter(e) {
            e.currentTarget.style.color = DSH_GROEN;
          },
          onMouseLeave: function onMouseLeave(e) {
            e.currentTarget.style.color = T.fg1;
          },
          style: {
            display: 'inline-flex',
            alignItems: 'center',
            gap: 6,
            minHeight: 30,
            marginTop: 1,
            padding: '0 8px 0 0',
            background: 'none',
            border: 'none',
            cursor: 'pointer',
            fontFamily: T.fontDisplay,
            fontSize: 15,
            fontWeight: 600,
            color: T.fg1,
            fontVariantNumeric: 'tabular-nums',
            whiteSpace: 'nowrap',
            textDecoration: 'underline dashed',
            textDecorationColor: T.fg4,
            textUnderlineOffset: 5
          }
        }, w, /*#__PURE__*/React.createElement(Icon, {
          name: "edit",
          size: 12,
          color: "currentColor"
        })) : /*#__PURE__*/React.createElement("span", {
          style: {
            display: 'block',
            marginTop: 5,
            fontFamily: T.fontDisplay,
            fontSize: 15,
            fontWeight: 600,
            color: r ? DSH_ROOD : T.fg1,
            fontVariantNumeric: 'tabular-nums',
            whiteSpace: 'nowrap',
            overflow: 'hidden',
            textOverflow: 'ellipsis'
          }
        }, w));
      })), /*#__PURE__*/React.createElement("span", {
        style: {
          display: 'flex',
          alignItems: 'center',
          gap: '6px 14px',
          flexWrap: 'wrap',
          width: '100%'
        }
      }, s.boven ? /*#__PURE__*/React.createElement("span", {
        style: {
          display: 'inline-flex',
          alignItems: 'center',
          gap: 6,
          fontFamily: T.fontBody,
          fontSize: 12.5,
          fontWeight: 700,
          color: DSH_ROOD
        }
      }, /*#__PURE__*/React.createElement(Icon, {
        name: "alert",
        size: 12,
        color: "currentColor"
      }), "".concat(s.boven, " boven de norm")) : /*#__PURE__*/React.createElement("span", {
        style: DSH_KLEIN
      }, tot ? 'Gepland — geen norm' : 'Alles binnen de norm'), s.opvolging > 0 && /*#__PURE__*/React.createElement("span", {
        style: {
          fontFamily: T.fontBody,
          fontSize: 12,
          fontWeight: 600,
          color: s.dringend ? DSH_ROOD : DSH_AMBER
        }
      }, "".concat(s.opvolging, " ").concat(s.opvolging === 1 ? 'vraagt' : 'vragen', " opvolging")), geld && /*#__PURE__*/React.createElement("span", {
        style: {
          marginLeft: 'auto',
          fontFamily: T.fontDisplay,
          fontSize: 14,
          fontWeight: 600,
          color: T.fg1,
          fontVariantNumeric: 'tabular-nums'
        }
      }, window.dshEur(s.bedrag))));
    })) : /*#__PURE__*/React.createElement("p", {
      style: DSH_KLEIN
    }, "Niets in deze module."), leeg.length > 0 && /*#__PURE__*/React.createElement("p", {
      style: DSH_KLEIN
    }, /*#__PURE__*/React.createElement("b", {
      style: {
        color: T.fg2,
        fontWeight: 600
      }
    }, "Nu leeg: "), leeg.map(function (s) {
      return s.label;
    }).join(' · ')));
  };

  /* ── Doorstroom: staven per dag, week of maand, met de gemiddelde lijn ───────────
     Boven de lijn = drukker dan gemiddeld (vol groen), eronder gedempt. Vergelijken toont
     de vorige periode als stippellijn op dezelfde plek in de reeks. */
  var DshDoorstroom = function DshDoorstroom(_ref29) {
    var P = _ref29.P,
      reeksen = _ref29.reeksen,
      vergelijk = _ref29.vergelijk,
      korrel = _ref29.korrel,
      onKorrel = _ref29.onKorrel,
      _ref29$hoogte = _ref29.hoogte,
      hoogte = _ref29$hoogte === void 0 ? 220 : _ref29$hoogte;
    var _React$useState = React.useState('uit'),
      _React$useState2 = _slicedToArray(_React$useState, 2),
      rid = _React$useState2[0],
      setRid = _React$useState2[1];
    var r = reeksen.find(function (x) {
      return x.id === rid;
    }) || reeksen[0];
    var kOk = function kOk(k) {
      var n = window.dshVakken(P, k).length;
      return n >= 2 && n <= 120;
    };
    var opties = (window.DSH_KORRELS || []).map(function (_ref30) {
      var _ref31 = _slicedToArray(_ref30, 2),
        id = _ref31[0],
        label = _ref31[1];
      return {
        id: id,
        label: label,
        uit: !kOk(id),
        waarom: 'Past niet bij deze periode'
      };
    });
    var k = korrel && kOk(korrel) ? korrel : window.dshAutoKorrel(P);
    var vakken = window.dshVakken(P, k),
      vakkenV = vergelijk ? window.dshVakken(P.vorige, k) : null;
    var geld = !!(r && r.geld),
      fn = geld ? function (x) {
        return x.v || 0;
      } : null;
    var w = r ? window.dshTel(vakken, r.lijst, fn) : [];
    var wv = r && vakkenV ? window.dshTel(vakkenV, r.lijst, fn) : null;
    var totaal = w.reduce(function (s, v) {
        return s + v;
      }, 0),
      totaalV = wv ? wv.reduce(function (s, v) {
        return s + v;
      }, 0) : null;
    var gem = vakken.length ? totaal / vakken.length : 0;
    var max = Math.max.apply(Math, [1, gem].concat(_toConsumableArray(w), _toConsumableArray(wv || [])));
    var elke = vakken.length > 16 ? Math.ceil(vakken.length / 12) : 1;
    var gap = vakken.length > 40 ? 1 : vakken.length > 20 ? 2 : 6;
    var gemTxt = dshFmt(geld ? Math.round(gem) : Math.round(gem * 10) / 10, geld);
    /* Rechtergoot: daar staat het label van de gemiddelde lijn, naast de staven in plaats van erop. */
    var goot = geld ? 112 : 84;
    return /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        flexDirection: 'column',
        gap: 18,
        minWidth: 0
      }
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'space-between',
        gap: '10px 16px',
        flexWrap: 'wrap'
      }
    }, reeksen.length > 1 ? /*#__PURE__*/React.createElement(DshSegment, {
      label: "Reeks",
      opties: reeksen.map(function (x) {
        return {
          id: x.id,
          label: x.label,
          title: x.uitleg
        };
      }),
      waarde: r && r.id,
      onKies: setRid
    }) : /*#__PURE__*/React.createElement("span", null), /*#__PURE__*/React.createElement(DshSegment, {
      label: "Weergave",
      opties: opties,
      waarde: k,
      onKies: onKorrel
    })), /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        alignItems: 'baseline',
        gap: '6px 14px',
        flexWrap: 'wrap'
      }
    }, /*#__PURE__*/React.createElement("span", {
      style: _objectSpread(_objectSpread({}, DSH_GETAL), {}, {
        fontSize: 30
      })
    }, dshFmt(totaal, geld)), /*#__PURE__*/React.createElement("span", {
      style: {
        fontFamily: T.fontBody,
        fontSize: 13.5,
        color: T.fg2
      }
    }, r ? r.uitleg : ''), /*#__PURE__*/React.createElement("span", {
      style: DSH_KLEIN
    }, "\xB7 gemiddeld ".concat(gemTxt, " per ").concat(k)), vergelijk && /*#__PURE__*/React.createElement(DshDelta, {
      nu: totaal,
      vorige: totaalV,
      geld: geld
    })), /*#__PURE__*/React.createElement("div", {
      style: {
        minWidth: 0
      }
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        position: 'relative',
        height: hoogte,
        borderBottom: "1px solid ".concat(T.stroke2),
        marginTop: 14
      }
    }, [0.5, 1].map(function (f) {
      return /*#__PURE__*/React.createElement("span", {
        key: f,
        "aria-hidden": "true",
        style: {
          position: 'absolute',
          left: 0,
          right: goot,
          bottom: "".concat(f * 100, "%"),
          borderTop: "1px dashed ".concat(T.stroke1),
          pointerEvents: 'none'
        }
      });
    }), /*#__PURE__*/React.createElement("span", {
      style: {
        position: 'absolute',
        left: 0,
        top: -4,
        transform: 'translateY(-100%)',
        fontFamily: T.fontBody,
        fontSize: 10.5,
        color: T.fg4
      }
    }, dshFmt(max, geld)), /*#__PURE__*/React.createElement("div", {
      style: {
        position: 'absolute',
        left: 0,
        right: goot,
        top: 0,
        bottom: 0,
        display: 'flex',
        alignItems: 'flex-end',
        gap: gap
      }
    }, vakken.map(function (v, i) {
      var x = w[i] || 0,
        xv = wv ? wv[i] || 0 : 0;
      return /*#__PURE__*/React.createElement("div", {
        key: v.van,
        title: "".concat(v.lang, "\n").concat(r ? r.label : '', ": ").concat(dshFmt(x, geld)).concat(vergelijk && wv ? "\nvorige periode: ".concat(dshFmt(xv, geld)) : ''),
        style: {
          flex: '1 1 0',
          minWidth: 0,
          height: '100%',
          display: 'flex',
          alignItems: 'flex-end',
          justifyContent: 'center'
        }
      }, /*#__PURE__*/React.createElement("div", {
        style: {
          position: 'relative',
          width: '100%',
          maxWidth: 36,
          height: '100%',
          display: 'flex',
          alignItems: 'flex-end'
        }
      }, vergelijk && wv && /*#__PURE__*/React.createElement("span", {
        style: {
          position: 'absolute',
          left: -2,
          right: -2,
          bottom: 0,
          height: "".concat(xv / max * 100, "%"),
          border: "1px dashed ".concat(T.fg4),
          borderBottom: 'none',
          boxSizing: 'border-box'
        }
      }), /*#__PURE__*/React.createElement("span", {
        style: {
          position: 'relative',
          width: '100%',
          height: "".concat(x / max * 100, "%"),
          minHeight: x ? 2 : 0,
          background: x > gem ? 'rgba(0,217,0,0.85)' : 'rgba(0,217,0,0.38)',
          borderRadius: '2px 2px 0 0'
        }
      })));
    })), gem > 0 && /*#__PURE__*/React.createElement("span", {
      "aria-hidden": "true",
      style: {
        position: 'absolute',
        left: 0,
        right: 0,
        bottom: "".concat(gem / max * 100, "%"),
        borderTop: '2px solid rgba(246,247,235,0.7)',
        pointerEvents: 'none'
      }
    }, /*#__PURE__*/React.createElement("span", {
      style: {
        position: 'absolute',
        right: 0,
        top: -2,
        transform: 'translateY(-50%)',
        maxWidth: goot - 6,
        boxSizing: 'border-box',
        padding: '2px 7px',
        background: T.bg1,
        border: "1px solid ".concat(T.stroke2),
        borderRadius: 4,
        fontFamily: T.fontBody,
        fontSize: 11,
        fontWeight: 700,
        color: T.fg1,
        whiteSpace: 'nowrap',
        overflow: 'hidden',
        textOverflow: 'ellipsis'
      }
    }, "gem. ".concat(gemTxt)))), /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        gap: gap,
        height: 18,
        marginTop: 7,
        marginRight: goot
      }
    }, vakken.map(function (v, i) {
      return /*#__PURE__*/React.createElement("span", {
        key: v.van,
        style: {
          position: 'relative',
          flex: '1 1 0',
          minWidth: 0
        }
      }, i % elke === 0 && /*#__PURE__*/React.createElement("span", {
        style: {
          position: 'absolute',
          left: '50%',
          top: 0,
          transform: 'translateX(-50%)',
          fontFamily: T.fontBody,
          fontSize: 10.5,
          color: T.fg3,
          whiteSpace: 'nowrap'
        }
      }, v.label));
    }))), /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        flexWrap: 'wrap',
        gap: '6px 18px'
      }
    }, /*#__PURE__*/React.createElement("span", {
      style: {
        display: 'inline-flex',
        alignItems: 'center',
        gap: 7,
        fontFamily: T.fontBody,
        fontSize: 12,
        color: T.fg3
      }
    }, /*#__PURE__*/React.createElement("span", {
      style: {
        width: 10,
        height: 10,
        borderRadius: 2,
        background: 'rgba(0,217,0,0.85)'
      }
    }), "boven het gemiddelde"), /*#__PURE__*/React.createElement("span", {
      style: {
        display: 'inline-flex',
        alignItems: 'center',
        gap: 7,
        fontFamily: T.fontBody,
        fontSize: 12,
        color: T.fg3
      }
    }, /*#__PURE__*/React.createElement("span", {
      style: {
        width: 10,
        height: 10,
        borderRadius: 2,
        background: 'rgba(0,217,0,0.38)'
      }
    }), "eronder"), /*#__PURE__*/React.createElement("span", {
      style: {
        display: 'inline-flex',
        alignItems: 'center',
        gap: 7,
        fontFamily: T.fontBody,
        fontSize: 12,
        color: T.fg3
      }
    }, /*#__PURE__*/React.createElement("span", {
      style: {
        width: 16,
        borderTop: '2px solid rgba(246,247,235,0.7)'
      }
    }), "gemiddelde per ".concat(k)), vergelijk && /*#__PURE__*/React.createElement("span", {
      style: {
        display: 'inline-flex',
        alignItems: 'center',
        gap: 7,
        fontFamily: T.fontBody,
        fontSize: 12,
        color: T.fg3
      }
    }, /*#__PURE__*/React.createElement("span", {
      style: {
        width: 10,
        height: 10,
        border: "1px dashed ".concat(T.fg3),
        boxSizing: 'border-box'
      }
    }), "vorige periode")));
  };
  Object.assign(window, {
    DshVsContext: DshVsContext,
    DSH_VS_STD: DSH_VS_STD,
    DSH_LBL: DSH_LBL,
    DSH_GETAL: DSH_GETAL,
    DSH_H1: DSH_H1,
    DSH_H2: DSH_H2,
    DSH_H3: DSH_H3,
    DSH_P: DSH_P,
    DSH_KLEIN: DSH_KLEIN,
    DSH_GROEN: DSH_GROEN,
    DSH_ROOD: DSH_ROOD,
    DSH_AMBER: DSH_AMBER,
    dshFmt: dshFmt,
    dshGrad: dshGrad,
    DshSectie: DshSectie,
    DshPaneel: DshPaneel,
    DshDelta: DshDelta,
    DshKpiGroep: DshKpiGroep,
    DshKpi: DshKpi,
    DshTonen: DshTonen,
    DshSegment: DshSegment,
    DshOordeelChip: DshOordeelChip,
    DshOordeel: DshOordeel,
    DshWerkdrukMeter: DshWerkdrukMeter,
    DshRegels: DshRegels,
    DshAanhoudendChip: DshAanhoudendChip,
    DshKnelpunt: DshKnelpunt,
    DshVerloop: DshVerloop,
    DshPijplijn: DshPijplijn,
    DshDoorloop: DshDoorloop,
    DshStatusKaarten: DshStatusKaarten,
    DshDoorstroom: DshDoorstroom
  });
})();