"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 _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 _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); }
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 _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 _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 _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; }
// GHS CRM — Marketing module
// Planning, Statistieken, Campagnes, Content library, Automatisering, Externe toegang
// Volledig geïntegreerd met de CRM-vormgeving (T tokens, cutPath, Icon, Card, ...)

/* ──────────────────────────────────────────────────────────────────────────
   DATA — sample posts, campaigns, top performers
   ────────────────────────────────────────────────────────────────────────── */

var MK_PLATFORMS = {
  facebook: {
    label: 'Facebook',
    color: '#1877F2'
  },
  instagram: {
    label: 'Instagram',
    color: '#E1306C'
  },
  tiktok: {
    label: 'TikTok',
    color: '#25F4EE'
  },
  linkedin: {
    label: 'LinkedIn',
    color: '#0A66C2'
  }
};
var MK_POSTS = [{
  id: 'p41',
  platforms: ['facebook', 'instagram'],
  type: 'reel',
  status: 'scheduled',
  title: 'Time-lapse install Gent',
  caption: 'Van leeg dak tot 8,4 kWp in één dag.',
  date: '2026-05-28',
  time: '18:00',
  campaign: 'Lente Solar 2026',
  author: 'Lisa V.',
  media: 'video'
}, {
  id: 'p42',
  platforms: ['instagram'],
  type: 'carousel',
  status: 'draft',
  title: 'Voor / na · Brugge',
  caption: 'Drie projecten, drie daken, één team.',
  date: '2026-05-29',
  time: '12:30',
  campaign: 'Lente Solar 2026',
  author: 'Stef M.',
  media: 'image'
}, {
  id: 'p43',
  platforms: ['tiktok'],
  type: 'reel',
  status: 'in-review',
  title: 'Batterij 101 — sneeuw test',
  caption: 'Werkt jouw thuisbatterij ook bij -5°C?',
  date: '2026-05-30',
  time: '19:15',
  campaign: 'Batterij weet wat te doen',
  author: 'Kevin D.',
  media: 'video'
}, {
  id: 'p44',
  platforms: ['facebook'],
  type: 'post',
  status: 'scheduled',
  title: 'Premie verlengd tot juni',
  caption: 'Vlaamse premie loopt door — bereken jouw teruggave.',
  date: '2026-05-30',
  time: '08:30',
  campaign: 'Premie 2026',
  author: 'Admin',
  media: 'image'
}, {
  id: 'p45',
  platforms: ['instagram', 'tiktok'],
  type: 'reel',
  status: 'scheduled',
  title: 'Heat pump in 60 sec',
  caption: 'Hoe warmtepomp + zonnepanelen samenwerken.',
  date: '2026-06-01',
  time: '17:45',
  campaign: 'Heat pump push',
  author: 'Lisa V.',
  media: 'video'
}, {
  id: 'p46',
  platforms: ['facebook', 'instagram'],
  type: 'post',
  status: 'scheduled',
  title: 'Klantverhaal · De Smet',
  caption: 'De Smet bespaart € 2.140 / jaar.',
  date: '2026-06-02',
  time: '10:00',
  campaign: 'Klantverhalen',
  author: 'Stef M.',
  media: 'image'
}, {
  id: 'p47',
  platforms: ['tiktok', 'instagram'],
  type: 'reel',
  status: 'ai-suggested',
  title: 'AI · "Wat kost mijn dak?"',
  caption: 'Dak inscannen → quote in 2 min.',
  date: '2026-06-03',
  time: '20:00',
  campaign: 'AI-content test',
  author: 'GHS AI',
  media: 'video'
}, {
  id: 'p48',
  platforms: ['linkedin'],
  type: 'post',
  status: 'scheduled',
  title: 'We zoeken 2 installateurs',
  caption: 'Mechelen · vast contract · € 38-46k.',
  date: '2026-06-03',
  time: '09:00',
  campaign: 'Recruitment',
  author: 'Admin',
  media: 'image'
}, {
  id: 'p49',
  platforms: ['instagram'],
  type: 'story',
  status: 'scheduled',
  title: 'Behind the scenes · Crew B',
  caption: 'Achter de schermen — Antwerpen project.',
  date: '2026-06-04',
  time: '16:30',
  campaign: 'Behind the scenes',
  author: 'Kevin D.',
  media: 'image'
}, {
  id: 'p50',
  platforms: ['facebook', 'instagram', 'tiktok'],
  type: 'reel',
  status: 'scheduled',
  title: 'Top 5 daken Mei 2026',
  caption: 'Een korte rondleiding van onze beste installaties.',
  date: '2026-06-05',
  time: '18:00',
  campaign: 'Maandelijkse round-up',
  author: 'Stef M.',
  media: 'video'
}, {
  id: 'p51',
  platforms: ['tiktok'],
  type: 'reel',
  status: 'draft',
  title: 'Mythe vs feit: zonnepanelen winter',
  caption: 'Werkt nog steeds — hier zijn de cijfers.',
  date: '2026-06-06',
  time: '12:00',
  campaign: 'Educatieve content',
  author: 'Lisa V.',
  media: 'video'
}, {
  id: 'p52',
  platforms: ['instagram'],
  type: 'post',
  status: 'published',
  title: 'Mei resultaten — bedankt!',
  caption: '92,4 kWp deze maand. Dank voor het vertrouwen.',
  date: '2026-05-25',
  time: '19:00',
  campaign: 'Maandelijkse round-up',
  author: 'Admin',
  media: 'image'
}];
var MK_CAMPAIGNS = [{
  id: 'c1',
  name: 'Lente Solar 2026',
  platform: 'Facebook + Instagram',
  status: 'live',
  spend: 4820,
  leads: 142,
  apts: 38,
  sales: 11,
  revenue: 184200,
  ctr: 3.2,
  cpl: 33.95,
  roas: 38.2,
  color: '#00D900'
}, {
  id: 'c2',
  name: 'Heat pump push',
  platform: 'Instagram + TikTok',
  status: 'live',
  spend: 2640,
  leads: 87,
  apts: 19,
  sales: 5,
  revenue: 71300,
  ctr: 2.8,
  cpl: 30.34,
  roas: 27.0,
  color: '#bf63ff'
}, {
  id: 'c3',
  name: 'Batterij weet wat te doen',
  platform: 'TikTok',
  status: 'live',
  spend: 1880,
  leads: 64,
  apts: 14,
  sales: 3,
  revenue: 38400,
  ctr: 4.1,
  cpl: 29.38,
  roas: 20.4,
  color: '#ffb020'
}, {
  id: 'c4',
  name: 'Premie 2026',
  platform: 'Facebook',
  status: 'live',
  spend: 1240,
  leads: 78,
  apts: 21,
  sales: 6,
  revenue: 96500,
  ctr: 5.6,
  cpl: 15.90,
  roas: 77.8,
  color: '#00C8FF'
}, {
  id: 'c5',
  name: 'Klantverhalen',
  platform: 'Alle kanalen',
  status: 'live',
  spend: 980,
  leads: 31,
  apts: 11,
  sales: 4,
  revenue: 62400,
  ctr: 2.1,
  cpl: 31.61,
  roas: 63.7,
  color: '#00D900'
}, {
  id: 'c6',
  name: 'Webinars Q2',
  platform: 'Facebook + LinkedIn',
  status: 'paused',
  spend: 540,
  leads: 18,
  apts: 4,
  sales: 1,
  revenue: 14200,
  ctr: 1.4,
  cpl: 30.00,
  roas: 26.3,
  color: '#bf63ff'
}, {
  id: 'c7',
  name: 'AI-content test',
  platform: 'TikTok + Instagram',
  status: 'draft',
  spend: 0,
  leads: 0,
  apts: 0,
  sales: 0,
  revenue: 0,
  ctr: 0,
  cpl: 0,
  roas: 0,
  color: '#7df37d'
}, {
  id: 'c8',
  name: 'Recruitment',
  platform: 'LinkedIn',
  status: 'live',
  spend: 360,
  leads: 24,
  apts: 8,
  sales: 0,
  revenue: 0,
  ctr: 6.2,
  cpl: 15.00,
  roas: 0,
  color: '#bf63ff'
}];
var MK_TOP_POSTS = [{
  id: 'p52',
  reach: 18420,
  eng: 9.1,
  leads: 24,
  label: 'Mei resultaten — bedankt!',
  platform: 'instagram'
}, {
  id: 'p44',
  reach: 14210,
  eng: 6.8,
  leads: 41,
  label: 'Premie verlengd tot juni',
  platform: 'facebook'
}, {
  id: 'p53',
  reach: 9210,
  eng: 4.2,
  leads: 17,
  label: 'Webinar zonneboiler',
  platform: 'facebook'
}, {
  id: 'p41',
  reach: 7840,
  eng: 7.4,
  leads: 12,
  label: 'Time-lapse install Gent',
  platform: 'instagram'
}];

/* ──────────────────────────────────────────────────────────────────────────
   Atoms
   ────────────────────────────────────────────────────────────────────────── */

var MkStatusPill = function MkStatusPill(_ref) {
  var status = _ref.status;
  var map = {
    'scheduled': {
      label: 'Gepland',
      c: T.accent,
      bg: 'rgba(0,217,0,0.10)',
      b: 'rgba(0,217,0,0.30)'
    },
    'draft': {
      label: 'Concept',
      c: T.fg2,
      bg: 'rgba(246,247,235,0.06)',
      b: 'rgba(246,247,235,0.14)'
    },
    'in-review': {
      label: 'Ter review',
      c: '#ffb020',
      bg: 'rgba(255,176,32,0.10)',
      b: 'rgba(255,176,32,0.30)'
    },
    'ai-suggested': {
      label: 'AI suggestie',
      c: '#bf63ff',
      bg: 'rgba(191,99,255,0.12)',
      b: 'rgba(191,99,255,0.32)'
    },
    'published': {
      label: 'Live',
      c: T.accent,
      bg: 'rgba(0,217,0,0.16)',
      b: 'rgba(0,217,0,0.45)'
    }
  };
  var m = map[status] || map.draft;
  return /*#__PURE__*/React.createElement("span", {
    style: {
      display: 'inline-flex',
      alignItems: 'center',
      gap: 5,
      padding: '3px 8px',
      fontSize: 10,
      fontWeight: 700,
      letterSpacing: '0.12em',
      textTransform: 'uppercase',
      color: m.c,
      background: m.bg,
      border: "1px solid ".concat(m.b),
      clipPath: cutPath(4),
      fontFamily: T.fontBody
    }
  }, status === 'published' && /*#__PURE__*/React.createElement("span", {
    style: {
      width: 5,
      height: 5,
      borderRadius: '50%',
      background: m.c,
      boxShadow: "0 0 5px ".concat(m.c)
    }
  }), m.label);
};
var MkPlatIcon = function MkPlatIcon(_ref2) {
  var _MK_PLATFORMS$id;
  var id = _ref2.id,
    _ref2$size = _ref2.size,
    size = _ref2$size === void 0 ? 14 : _ref2$size;
  return /*#__PURE__*/React.createElement(Icon, {
    name: id,
    size: size,
    color: ((_MK_PLATFORMS$id = MK_PLATFORMS[id]) === null || _MK_PLATFORMS$id === void 0 ? void 0 : _MK_PLATFORMS$id.color) || T.fg2
  });
};
var MkMediaThumb = function MkMediaThumb(_ref3) {
  var post = _ref3.post,
    _ref3$size = _ref3.size,
    size = _ref3$size === void 0 ? 44 : _ref3$size;
  var p = MK_PLATFORMS[post.platforms[0]];
  return /*#__PURE__*/React.createElement("div", {
    style: {
      width: size,
      height: size,
      background: "linear-gradient(135deg, ".concat(p.color, "33, ").concat(p.color, "11), ").concat(T.bg1),
      border: "1px solid ".concat(T.stroke1),
      display: 'flex',
      alignItems: 'center',
      justifyContent: 'center',
      flexShrink: 0,
      clipPath: cutPath(6),
      position: 'relative',
      overflow: 'hidden'
    }
  }, /*#__PURE__*/React.createElement(Icon, {
    name: post.media === 'video' ? 'play' : 'image',
    size: size * 0.36,
    color: p.color
  }), post.type === 'carousel' && /*#__PURE__*/React.createElement("span", {
    style: {
      position: 'absolute',
      top: 3,
      right: 4,
      fontSize: 8,
      fontWeight: 700,
      color: T.fg2
    }
  }, "\xD73"));
};
var MkChip = function MkChip(_ref4) {
  var active = _ref4.active,
    onClick = _ref4.onClick,
    icon = _ref4.icon,
    color = _ref4.color,
    children = _ref4.children;
  return /*#__PURE__*/React.createElement("button", {
    onClick: onClick,
    style: {
      display: 'inline-flex',
      alignItems: 'center',
      gap: 6,
      padding: '7px 12px',
      background: active ? 'rgba(0,217,0,0.12)' : 'transparent',
      color: active ? T.accent : T.fg2,
      border: 0,
      cursor: 'pointer',
      fontSize: 12,
      fontWeight: 600,
      fontFamily: T.fontBody,
      clipPath: cutPath(5)
    }
  }, icon && /*#__PURE__*/React.createElement(Icon, {
    name: icon,
    size: 12,
    color: active ? T.accent : color || T.fg3
  }), children);
};

/* ──────────────────────────────────────────────────────────────────────────
   Filter bar + KPI strip (shared between sub-views)
   ────────────────────────────────────────────────────────────────────────── */

var MkFilterBar = function MkFilterBar(_ref5) {
  var platform = _ref5.platform,
    setPlatform = _ref5.setPlatform,
    view = _ref5.view,
    setView = _ref5.setView,
    campaign = _ref5.campaign,
    setCampaign = _ref5.setCampaign,
    onCompose = _ref5.onCompose;
  var campaigns = _toConsumableArray(new Set(MK_POSTS.map(function (p) {
    return p.campaign;
  })));
  return /*#__PURE__*/React.createElement("div", {
    className: "ghs-werkbalk"
  }, /*#__PURE__*/React.createElement(GhsKeuze, {
    waarde: platform,
    onKies: setPlatform,
    opties: ['all', 'facebook', 'instagram', 'tiktok'].map(function (pf) {
      return {
        id: pf,
        label: pf === 'all' ? 'Alle kanalen' : MK_PLATFORMS[pf].label,
        icon: pf !== 'all' ? pf : undefined
      };
    })
  }), /*#__PURE__*/React.createElement("select", {
    value: campaign,
    onChange: function onChange(e) {
      return setCampaign(e.target.value);
    },
    style: {
      background: T.bg0,
      color: T.fg1,
      border: "1px solid ".concat(T.stroke1),
      borderRadius: 4,
      outline: 0,
      padding: '0 12px',
      fontSize: 12,
      fontWeight: 600,
      fontFamily: T.fontBody,
      cursor: 'pointer'
    }
  }, /*#__PURE__*/React.createElement("option", {
    value: "all"
  }, "Alle campagnes"), campaigns.map(function (c) {
    return /*#__PURE__*/React.createElement("option", {
      key: c,
      value: c
    }, c);
  })), /*#__PURE__*/React.createElement("div", {
    style: {
      flex: 1
    }
  }), /*#__PURE__*/React.createElement(GhsKeuze, {
    waarde: view,
    onKies: setView,
    opties: [{
      id: 'week',
      label: 'Week',
      icon: 'calendar'
    }, {
      id: 'month',
      label: 'Maand',
      icon: 'grid'
    }, {
      id: 'list',
      label: 'Lijst',
      icon: 'list'
    }]
  }), /*#__PURE__*/React.createElement(Button, {
    variant: "secondary",
    size: "sm",
    icon: "sparkles",
    style: {
      color: '#bf63ff'
    }
  }, "AI suggesties"));
};
var MkPlanningStats = function MkPlanningStats() {
  var stats = [{
    label: 'Geplande posts',
    value: '12',
    sub: 'deze week',
    icon: 'calendar',
    accent: true
  }, {
    label: 'Concepten',
    value: '3',
    sub: 'in opmaak',
    icon: 'edit',
    color: '#00aaff'
  }, {
    label: 'Ter review',
    value: '2',
    sub: 'wachten op goedkeuring',
    color: '#ffb020',
    icon: 'eye'
  }, {
    label: 'AI suggesties',
    value: '5',
    sub: 'klaar om te plannen',
    color: '#bf63ff',
    icon: 'sparkles'
  }, {
    label: 'Live posts MTD',
    value: '28',
    sub: '+6 vs vorige maand',
    color: T.accent,
    icon: 'trending'
  }];
  return /*#__PURE__*/React.createElement(GhsKpiRij, {
    min: 170
  }, stats.map(function (s, i) {
    return /*#__PURE__*/React.createElement(GhsKpi, {
      key: i,
      label: s.label,
      value: s.value,
      sub: s.sub,
      color: s.color,
      icon: s.icon,
      accent: s.accent
    });
  }));
};

/* ──────────────────────────────────────────────────────────────────────────
   Calendar views
   ────────────────────────────────────────────────────────────────────────── */

var MkWeekCalendar = function MkWeekCalendar(_ref6) {
  var posts = _ref6.posts;
  var start = new Date('2026-05-28');
  var days = Array.from({
    length: 7
  }, function (_, i) {
    var d = new Date(start);
    d.setDate(d.getDate() + i);
    return d;
  });
  var hours = [6, 8, 10, 12, 14, 16, 18, 20, 22];
  var fmtDay = function fmtDay(d) {
    return d.toLocaleDateString('nl-BE', {
      weekday: 'short'
    }).replace('.', '').toUpperCase();
  };
  return /*#__PURE__*/React.createElement("div", {
    style: {
      background: T.bg1,
      clipPath: cutPath(16),
      border: "1px solid ".concat(T.stroke1)
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      padding: '14px 18px',
      display: 'flex',
      alignItems: 'center',
      gap: 12,
      borderBottom: "1px solid ".concat(T.stroke1)
    }
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "calendar",
    size: 14,
    color: T.accent
  }), /*#__PURE__*/React.createElement("h3", {
    style: {
      fontFamily: T.fontDisplay,
      fontWeight: 600,
      fontSize: 15,
      margin: 0,
      letterSpacing: '-0.01em'
    }
  }, "Week 22 \xB7 28 Mei \u2192 3 Juni"), /*#__PURE__*/React.createElement("span", {
    style: {
      fontSize: 10,
      fontWeight: 700,
      letterSpacing: '0.16em',
      textTransform: 'uppercase',
      color: T.fg3
    }
  }, posts.length, " posts gepland"), /*#__PURE__*/React.createElement("div", {
    style: {
      marginLeft: 'auto',
      display: 'flex',
      gap: 5
    }
  }, /*#__PURE__*/React.createElement("button", {
    style: mkNavBtn
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "chevronleft",
    size: 13,
    color: T.fg2
  })), /*#__PURE__*/React.createElement("button", {
    style: _objectSpread(_objectSpread({}, mkNavBtn), {}, {
      padding: '5px 11px',
      fontSize: 11,
      color: T.fg2,
      fontWeight: 600,
      fontFamily: T.fontBody
    })
  }, "Vandaag"), /*#__PURE__*/React.createElement("button", {
    style: mkNavBtn
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "chevronright",
    size: 13,
    color: T.fg2
  })))), /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'grid',
      gridTemplateColumns: '56px repeat(7, minmax(0, 1fr))'
    }
  }, /*#__PURE__*/React.createElement("div", null), days.map(function (d) {
    var isToday = d.toISOString().slice(0, 10) === '2026-05-28';
    return /*#__PURE__*/React.createElement("div", {
      key: d.toISOString(),
      style: {
        padding: '10px 8px',
        textAlign: 'center',
        borderLeft: "1px solid ".concat(T.stroke1),
        borderBottom: "1px solid ".concat(T.stroke1)
      }
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        fontSize: 10,
        fontWeight: 700,
        letterSpacing: '0.14em',
        color: isToday ? T.accent : T.fg3
      }
    }, fmtDay(d)), /*#__PURE__*/React.createElement("div", {
      style: {
        fontFamily: T.fontDisplay,
        fontWeight: 600,
        fontSize: 18,
        marginTop: 3,
        color: isToday ? T.accent : T.fg1,
        fontVariantNumeric: 'tabular-nums'
      }
    }, d.getDate()), isToday && /*#__PURE__*/React.createElement("div", {
      style: {
        height: 2,
        width: 14,
        background: T.accent,
        boxShadow: "0 0 6px ".concat(T.accent),
        margin: '3px auto 0'
      }
    }));
  }), hours.map(function (h) {
    return /*#__PURE__*/React.createElement(React.Fragment, {
      key: h
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        padding: '7px 8px 0 10px',
        fontSize: 10,
        fontWeight: 700,
        letterSpacing: '0.12em',
        color: T.fg3,
        textAlign: 'right',
        borderBottom: "1px solid rgba(246,247,235,0.04)",
        minHeight: 80,
        fontVariantNumeric: 'tabular-nums'
      }
    }, String(h).padStart(2, '0'), ":00"), days.map(function (d) {
      var dKey = d.toISOString().slice(0, 10);
      var cellPosts = posts.filter(function (p) {
        if (p.date !== dKey) return false;
        var ph = parseInt(p.time.split(':')[0], 10);
        return ph >= h && ph < h + 2;
      });
      return /*#__PURE__*/React.createElement("div", {
        key: dKey + h,
        style: {
          borderLeft: "1px solid rgba(246,247,235,0.04)",
          borderBottom: "1px solid rgba(246,247,235,0.04)",
          padding: 5,
          minHeight: 80,
          display: 'flex',
          flexDirection: 'column',
          gap: 4
        }
      }, cellPosts.map(function (p) {
        return /*#__PURE__*/React.createElement(MkCalPost, {
          key: p.id,
          post: p
        });
      }));
    }));
  })));
};
var mkNavBtn = {
  background: 'rgba(246,247,235,0.04)',
  border: 0,
  cursor: 'pointer',
  padding: 5,
  clipPath: cutPath(4),
  display: 'inline-flex',
  alignItems: 'center',
  justifyContent: 'center'
};
var MkCalPost = function MkCalPost(_ref7) {
  var post = _ref7.post;
  var p = MK_PLATFORMS[post.platforms[0]];
  var c = post.status === 'ai-suggested' ? '#bf63ff' : post.status === 'in-review' ? '#ffb020' : post.status === 'draft' ? 'rgba(246,247,235,0.4)' : p.color;
  return /*#__PURE__*/React.createElement("div", {
    style: {
      background: "linear-gradient(135deg, ".concat(c, "1f, ").concat(c, "0a)"),
      border: "1px solid ".concat(c, "66"),
      borderLeft: "2px solid ".concat(c),
      padding: '4px 6px',
      cursor: 'pointer',
      clipPath: cutPath(4),
      fontSize: 10.5,
      lineHeight: 1.35,
      display: 'flex',
      flexDirection: 'column',
      gap: 3,
      overflow: 'hidden'
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      alignItems: 'center',
      gap: 4
    }
  }, /*#__PURE__*/React.createElement("span", {
    style: {
      fontSize: 9,
      fontWeight: 700,
      letterSpacing: '0.08em',
      color: c,
      fontVariantNumeric: 'tabular-nums'
    }
  }, post.time), /*#__PURE__*/React.createElement("div", {
    style: {
      marginLeft: 'auto',
      display: 'flex',
      gap: 2
    }
  }, post.platforms.map(function (pf) {
    return /*#__PURE__*/React.createElement(Icon, {
      key: pf,
      name: pf,
      size: 9,
      color: MK_PLATFORMS[pf].color
    });
  }))), /*#__PURE__*/React.createElement("div", {
    style: {
      fontWeight: 600,
      color: T.fg1,
      overflow: 'hidden',
      textOverflow: 'ellipsis',
      whiteSpace: 'nowrap',
      fontFamily: T.fontBody
    }
  }, post.title));
};
var MkMonthCalendar = function MkMonthCalendar(_ref8) {
  var posts = _ref8.posts;
  var start = new Date('2026-05-25');
  var cells = Array.from({
    length: 35
  }, function (_, i) {
    var d = new Date(start);
    d.setDate(d.getDate() + i);
    return d;
  });
  var dayLabels = ['MA', 'DI', 'WO', 'DO', 'VR', 'ZA', 'ZO'];
  return /*#__PURE__*/React.createElement("div", {
    style: {
      background: T.bg1,
      clipPath: cutPath(16),
      border: "1px solid ".concat(T.stroke1)
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      padding: '14px 18px',
      display: 'flex',
      alignItems: 'center',
      gap: 12,
      borderBottom: "1px solid ".concat(T.stroke1)
    }
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "grid",
    size: 14,
    color: T.accent
  }), /*#__PURE__*/React.createElement("h3", {
    style: {
      fontFamily: T.fontDisplay,
      fontWeight: 600,
      fontSize: 15,
      margin: 0
    }
  }, "Mei \u2192 Juni 2026"), /*#__PURE__*/React.createElement("div", {
    style: {
      marginLeft: 'auto',
      display: 'flex',
      gap: 5
    }
  }, /*#__PURE__*/React.createElement("button", {
    style: mkNavBtn
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "chevronleft",
    size: 13,
    color: T.fg2
  })), /*#__PURE__*/React.createElement("button", {
    style: mkNavBtn
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "chevronright",
    size: 13,
    color: T.fg2
  })))), /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'grid',
      gridTemplateColumns: 'repeat(7, minmax(0, 1fr))'
    }
  }, dayLabels.map(function (d) {
    return /*#__PURE__*/React.createElement("div", {
      key: d,
      style: {
        padding: '9px 11px',
        fontSize: 10,
        fontWeight: 700,
        letterSpacing: '0.14em',
        color: T.fg3,
        borderBottom: "1px solid ".concat(T.stroke1)
      }
    }, d);
  }), cells.map(function (d, i) {
    var dKey = d.toISOString().slice(0, 10);
    var cellPosts = posts.filter(function (p) {
      return p.date === dKey;
    });
    var isOther = d.getMonth() !== 4 && d.getMonth() !== 5;
    var isToday = dKey === '2026-05-28';
    return /*#__PURE__*/React.createElement("div", {
      key: i,
      style: {
        minHeight: 104,
        borderRight: (i + 1) % 7 ? "1px solid rgba(246,247,235,0.04)" : 0,
        borderBottom: "1px solid rgba(246,247,235,0.04)",
        padding: 7,
        opacity: isOther ? 0.45 : 1,
        background: isToday ? 'rgba(0,217,0,0.04)' : 'transparent',
        display: 'flex',
        flexDirection: 'column',
        gap: 3
      }
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'space-between',
        fontSize: 11,
        fontWeight: 600,
        color: isToday ? T.accent : T.fg2,
        fontVariantNumeric: 'tabular-nums'
      }
    }, /*#__PURE__*/React.createElement("span", null, d.getDate()), cellPosts.length > 0 && /*#__PURE__*/React.createElement("span", {
      style: {
        fontSize: 9,
        fontWeight: 700,
        letterSpacing: '0.08em',
        color: T.fg3
      }
    }, cellPosts.length, "\xD7")), cellPosts.slice(0, 3).map(function (p) {
      return /*#__PURE__*/React.createElement(MkCalPost, {
        key: p.id,
        post: p
      });
    }), cellPosts.length > 3 && /*#__PURE__*/React.createElement("div", {
      style: {
        fontSize: 10,
        color: T.fg3,
        paddingLeft: 4
      }
    }, "+", cellPosts.length - 3, " meer"));
  })));
};
var MkPostList = function MkPostList(_ref9) {
  var posts = _ref9.posts;
  return /*#__PURE__*/React.createElement("div", {
    style: {
      background: T.bg1,
      clipPath: cutPath(16),
      border: "1px solid ".concat(T.stroke1)
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'grid',
      gridTemplateColumns: '56px minmax(0,1.5fr) 96px minmax(0,1fr) 130px 110px 28px',
      padding: '10px 18px',
      borderBottom: "1px solid ".concat(T.stroke1),
      fontSize: 10,
      fontWeight: 700,
      letterSpacing: '0.14em',
      textTransform: 'uppercase',
      color: T.fg3
    }
  }, /*#__PURE__*/React.createElement("span", null), /*#__PURE__*/React.createElement("span", null, "Post"), /*#__PURE__*/React.createElement("span", null, "Kanaal"), /*#__PURE__*/React.createElement("span", null, "Campagne"), /*#__PURE__*/React.createElement("span", null, "Geplande tijd"), /*#__PURE__*/React.createElement("span", null, "Status"), /*#__PURE__*/React.createElement("span", null)), posts.map(function (p, i) {
    return /*#__PURE__*/React.createElement("div", {
      key: p.id,
      style: {
        display: 'grid',
        gridTemplateColumns: '56px minmax(0,1.5fr) 96px minmax(0,1fr) 130px 110px 28px',
        alignItems: 'center',
        padding: '11px 18px',
        borderBottom: i < posts.length - 1 ? "1px solid rgba(246,247,235,0.03)" : 0,
        cursor: 'pointer',
        transition: 'background 220ms'
      },
      onMouseEnter: function onMouseEnter(e) {
        return e.currentTarget.style.background = 'rgba(0,217,0,0.03)';
      },
      onMouseLeave: function onMouseLeave(e) {
        return e.currentTarget.style.background = 'transparent';
      }
    }, /*#__PURE__*/React.createElement(MkMediaThumb, {
      post: p,
      size: 40
    }), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
      style: {
        fontWeight: 600,
        fontSize: 13
      }
    }, p.title), /*#__PURE__*/React.createElement("div", {
      style: {
        fontSize: 11,
        color: T.fg3,
        marginTop: 2
      }
    }, p.author, " \xB7 ", p.type)), /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        gap: 3
      }
    }, p.platforms.map(function (pf) {
      return /*#__PURE__*/React.createElement(MkPlatIcon, {
        key: pf,
        id: pf,
        size: 13
      });
    })), /*#__PURE__*/React.createElement("div", {
      style: {
        fontSize: 12,
        color: T.fg2
      }
    }, p.campaign), /*#__PURE__*/React.createElement("div", {
      style: {
        fontSize: 12,
        color: T.fg2,
        fontVariantNumeric: 'tabular-nums'
      }
    }, new Date(p.date).toLocaleDateString('nl-BE', {
      day: '2-digit',
      month: 'short'
    }), " \xB7 ", p.time), /*#__PURE__*/React.createElement(MkStatusPill, {
      status: p.status
    }), /*#__PURE__*/React.createElement(Icon, {
      name: "moredots",
      size: 13,
      color: T.fg3
    }));
  }));
};

/* ──────────────────────────────────────────────────────────────────────────
   Side rail: Upcoming queue + AI suggestions + External partners
   ────────────────────────────────────────────────────────────────────────── */

var MkUpcoming = function MkUpcoming(_ref0) {
  var posts = _ref0.posts;
  var upcoming = posts.filter(function (p) {
    return p.status === 'scheduled' || p.status === 'in-review';
  }).slice(0, 5);
  return /*#__PURE__*/React.createElement("div", {
    style: {
      background: T.bg1,
      clipPath: cutPath(14),
      border: "1px solid ".concat(T.stroke1)
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      padding: '12px 16px',
      borderBottom: "1px solid ".concat(T.stroke1),
      display: 'flex',
      alignItems: 'center',
      gap: 9
    }
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "clock",
    size: 13,
    color: T.accent
  }), /*#__PURE__*/React.createElement("h4", {
    style: {
      fontFamily: T.fontDisplay,
      fontWeight: 600,
      fontSize: 13.5,
      margin: 0
    }
  }, "Eerstvolgende publicaties"), /*#__PURE__*/React.createElement("span", {
    style: {
      marginLeft: 'auto',
      fontSize: 9.5,
      fontWeight: 700,
      letterSpacing: '0.14em',
      color: T.fg3
    }
  }, "NEXT 24H")), /*#__PURE__*/React.createElement("div", {
    style: {
      padding: 10
    }
  }, upcoming.map(function (p, i) {
    return /*#__PURE__*/React.createElement("div", {
      key: p.id,
      style: {
        display: 'flex',
        alignItems: 'center',
        gap: 10,
        padding: '9px 6px',
        borderBottom: i < upcoming.length - 1 ? "1px solid rgba(246,247,235,0.04)" : 0,
        cursor: 'pointer'
      }
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        textAlign: 'center',
        flexShrink: 0,
        width: 36
      }
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        fontFamily: T.fontDisplay,
        fontWeight: 700,
        fontSize: 13,
        color: p.status === 'in-review' ? '#ffb020' : T.accent,
        fontVariantNumeric: 'tabular-nums',
        lineHeight: 1
      }
    }, p.time), /*#__PURE__*/React.createElement("div", {
      style: {
        fontSize: 9,
        color: T.fg3,
        letterSpacing: '0.08em',
        marginTop: 3
      }
    }, new Date(p.date).toLocaleDateString('nl-BE', {
      day: '2-digit',
      month: 'short'
    }).toUpperCase())), /*#__PURE__*/React.createElement(MkMediaThumb, {
      post: p,
      size: 32
    }), /*#__PURE__*/React.createElement("div", {
      style: {
        flex: 1,
        minWidth: 0
      }
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        fontSize: 12,
        fontWeight: 600,
        overflow: 'hidden',
        textOverflow: 'ellipsis',
        whiteSpace: 'nowrap'
      }
    }, p.title), /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        alignItems: 'center',
        gap: 4,
        marginTop: 3
      }
    }, p.platforms.map(function (pf) {
      return /*#__PURE__*/React.createElement(Icon, {
        key: pf,
        name: pf,
        size: 9,
        color: MK_PLATFORMS[pf].color
      });
    }), /*#__PURE__*/React.createElement("span", {
      style: {
        fontSize: 10,
        color: T.fg3
      }
    }, "\xB7 ", p.author))));
  })));
};
var MkAISuggestions = function MkAISuggestions() {
  var s = [{
    title: 'Beste tijd om te posten',
    body: 'Dinsdag 18:30 — IG (op basis van vorige 30 dagen)',
    action: 'Plan post'
  }, {
    title: 'Hashtag boost',
    body: '#zonnepanelenbe stijgt 38% — voeg toe aan reels',
    action: 'Toepassen'
  }, {
    title: 'Top post hergebruiken',
    body: '"Premie 2026" deed 14k bereik — maak TikTok variant',
    action: 'Genereer'
  }];
  return /*#__PURE__*/React.createElement("div", {
    style: {
      background: 'linear-gradient(180deg, rgba(191,99,255,0.08) 0%, rgba(0,0,0,0) 80%), ' + T.bg1,
      clipPath: cutPath(14),
      border: "1px solid rgba(191,99,255,0.22)"
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      padding: '12px 16px',
      borderBottom: "1px solid ".concat(T.stroke1),
      display: 'flex',
      alignItems: 'center',
      gap: 9
    }
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "sparkles",
    size: 13,
    color: "#bf63ff"
  }), /*#__PURE__*/React.createElement("h4", {
    style: {
      fontFamily: T.fontDisplay,
      fontWeight: 600,
      fontSize: 13.5,
      margin: 0
    }
  }, "GHS AI \xB7 Co-pilot"), /*#__PURE__*/React.createElement("span", {
    style: {
      marginLeft: 'auto',
      display: 'inline-flex',
      alignItems: 'center',
      gap: 4,
      fontSize: 9,
      fontWeight: 700,
      letterSpacing: '0.14em',
      color: '#bf63ff'
    }
  }, /*#__PURE__*/React.createElement("span", {
    style: {
      width: 5,
      height: 5,
      borderRadius: '50%',
      background: '#bf63ff',
      boxShadow: '0 0 6px #bf63ff'
    }
  }), "ACTIEF")), /*#__PURE__*/React.createElement("div", {
    style: {
      padding: 10,
      display: 'flex',
      flexDirection: 'column',
      gap: 8
    }
  }, s.map(function (it, i) {
    return /*#__PURE__*/React.createElement("div", {
      key: i,
      style: {
        padding: '10px 12px',
        background: 'rgba(191,99,255,0.06)',
        border: '1px solid rgba(191,99,255,0.18)',
        clipPath: cutPath(6)
      }
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        fontSize: 12.5,
        fontWeight: 700
      }
    }, it.title), /*#__PURE__*/React.createElement("div", {
      style: {
        fontSize: 11.5,
        color: T.fg2,
        marginTop: 4,
        lineHeight: 1.4
      }
    }, it.body), /*#__PURE__*/React.createElement("button", {
      style: {
        marginTop: 9,
        background: 'rgba(191,99,255,0.18)',
        color: '#bf63ff',
        border: '1px solid rgba(191,99,255,0.35)',
        padding: '4px 9px',
        fontSize: 11,
        fontWeight: 600,
        cursor: 'pointer',
        fontFamily: T.fontBody,
        clipPath: cutPath(4),
        display: 'inline-flex',
        alignItems: 'center',
        gap: 4
      }
    }, it.action, /*#__PURE__*/React.createElement(Icon, {
      name: "arrowright",
      size: 10,
      color: "#bf63ff"
    })));
  })));
};
var MkPartners = function MkPartners() {
  var c = [{
    name: 'Mediabureau Zoom',
    role: 'Reels & Stories',
    status: 'online',
    avatar: 'MZ'
  }, {
    name: 'Studio Nordlys',
    role: 'Foto & video',
    status: 'online',
    avatar: 'SN'
  }, {
    name: 'Fien · freelance',
    role: 'Captions / copy',
    status: 'offline',
    avatar: 'F'
  }];
  return /*#__PURE__*/React.createElement("div", {
    style: {
      background: T.bg1,
      clipPath: cutPath(14),
      border: "1px solid ".concat(T.stroke1)
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      padding: '12px 16px',
      borderBottom: "1px solid ".concat(T.stroke1),
      display: 'flex',
      alignItems: 'center',
      gap: 9
    }
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "usercheck",
    size: 13,
    color: T.accent
  }), /*#__PURE__*/React.createElement("h4", {
    style: {
      fontFamily: T.fontDisplay,
      fontWeight: 600,
      fontSize: 13.5,
      margin: 0
    }
  }, "Externe partners"), /*#__PURE__*/React.createElement("button", {
    style: {
      marginLeft: 'auto',
      background: 'transparent',
      border: 0,
      cursor: 'pointer',
      padding: 2
    }
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "userplus",
    size: 13,
    color: T.accent
  }))), /*#__PURE__*/React.createElement("div", {
    style: {
      padding: '9px 11px',
      display: 'flex',
      flexDirection: 'column'
    }
  }, c.map(function (it, i) {
    return /*#__PURE__*/React.createElement("div", {
      key: i,
      style: {
        display: 'flex',
        alignItems: 'center',
        gap: 10,
        padding: '7px 5px'
      }
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        width: 28,
        height: 28,
        borderRadius: '50%',
        background: 'linear-gradient(135deg, #1E7040, #063520)',
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center',
        fontSize: 10.5,
        fontWeight: 700,
        position: 'relative'
      }
    }, it.avatar, /*#__PURE__*/React.createElement("span", {
      style: {
        position: 'absolute',
        bottom: 0,
        right: 0,
        width: 7,
        height: 7,
        borderRadius: '50%',
        background: it.status === 'online' ? T.accent : T.fg4,
        border: "2px solid ".concat(T.bg1),
        boxShadow: it.status === 'online' ? "0 0 4px ".concat(T.accent) : 'none'
      }
    })), /*#__PURE__*/React.createElement("div", {
      style: {
        flex: 1,
        minWidth: 0
      }
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        fontSize: 12.5,
        fontWeight: 600
      }
    }, it.name), /*#__PURE__*/React.createElement("div", {
      style: {
        fontSize: 10.5,
        color: T.fg3
      }
    }, it.role)));
  })), /*#__PURE__*/React.createElement("div", {
    style: {
      padding: '10px 14px',
      borderTop: "1px solid rgba(246,247,235,0.04)",
      background: 'rgba(0,217,0,0.04)',
      fontSize: 11,
      color: T.fg2,
      display: 'flex',
      alignItems: 'center',
      gap: 8
    }
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "shield",
    size: 11,
    color: T.accent
  }), /*#__PURE__*/React.createElement("span", null, "Externen kunnen ", /*#__PURE__*/React.createElement("strong", {
    style: {
      color: T.accent
    }
  }, "plannen, niet publiceren"))));
};

/* ──────────────────────────────────────────────────────────────────────────
   PLANNING tab
   ────────────────────────────────────────────────────────────────────────── */

var MkPlanning = function MkPlanning(_ref1) {
  var onCompose = _ref1.onCompose;
  var _useState = useState('all'),
    _useState2 = _slicedToArray(_useState, 2),
    platform = _useState2[0],
    setPlatform = _useState2[1];
  /* Op een gsm is een week van zeven kolommen onleesbaar: daar opent de planner als lijst. */
  var _useState3 = useState(function () {
      return window.GHS_TIER === 'xs' ? 'list' : 'week';
    }),
    _useState4 = _slicedToArray(_useState3, 2),
    view = _useState4[0],
    setView = _useState4[1];
  var _useState5 = useState('all'),
    _useState6 = _slicedToArray(_useState5, 2),
    campaign = _useState6[0],
    setCampaign = _useState6[1];
  var posts = MK_POSTS.filter(function (p) {
    if (platform !== 'all' && !p.platforms.includes(platform)) return false;
    if (campaign !== 'all' && p.campaign !== campaign) return false;
    return true;
  });
  return /*#__PURE__*/React.createElement("div", {
    className: "ghs-stapel"
  }, /*#__PURE__*/React.createElement(MkPlanningStats, null), /*#__PURE__*/React.createElement(MkFilterBar, {
    platform: platform,
    setPlatform: setPlatform,
    view: view,
    setView: setView,
    campaign: campaign,
    setCampaign: setCampaign,
    onCompose: onCompose
  }), /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'grid',
      gridTemplateColumns: 'minmax(0,1fr) 320px',
      gap: GHS_RITME
    }
  }, /*#__PURE__*/React.createElement("div", null, view === 'week' && /*#__PURE__*/React.createElement(MkWeekCalendar, {
    posts: posts
  }), view === 'month' && /*#__PURE__*/React.createElement(MkMonthCalendar, {
    posts: posts
  }), view === 'list' && /*#__PURE__*/React.createElement(MkPostList, {
    posts: posts
  })), /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      flexDirection: 'column',
      gap: GHS_RITME
    }
  }, /*#__PURE__*/React.createElement(MkUpcoming, {
    posts: MK_POSTS
  }), /*#__PURE__*/React.createElement(MkAISuggestions, null), /*#__PURE__*/React.createElement(MkPartners, null))));
};
window.MkPlanning = MkPlanning;
window.MK_POSTS = MK_POSTS;
window.MK_CAMPAIGNS = MK_CAMPAIGNS;
window.MK_TOP_POSTS = MK_TOP_POSTS;
window.MK_PLATFORMS = MK_PLATFORMS;
window.MkStatusPill = MkStatusPill;
window.MkPlatIcon = MkPlatIcon;
window.MkChip = MkChip;
window.mkNavBtn = mkNavBtn;