(function (global) {
  // Add array index of for old browsers (IE<9).
  if (!Array.prototype.indexOf) {
    Array.prototype.indexOf = function(obj, start) {
      var i, j;
      i = start || 0;
      j = this.length;
      while (i < j) {
        if (this[i] === obj) {
          return i;
        }
        i++;
      }
      return -1;
    };
  }

  // Make a global object to store stuff in.
  if (!global.KIWidgets) { global.KIWidgets = {}; };
  var KIWidgets = global.KIWidgets;

  // To keep track of which embeds we have already processed.
  if (!KIWidgets.processedScripts) { KIWidgets.processedScripts = []; };
  var processedScripts = KIWidgets.processedScripts;

  if (!KIWidgets.styleTags) { KIWidgets.styleTags = []; };
  var styleTags = KIWidgets.styleTags;

  var scriptTags = document.getElementsByTagName('script');
  var thisRequestUrl = 'https://news.ki.se/widget/view/events?type=events&au=&aa=0&ae=0&ar=0&ty%5B1%5D=1&m=0&d=widget&n=9&l=1&lang=en&id=777b823a-d398-44d7-bd57-551408481a65';

  for (var i = 0; i < scriptTags.length; i++) {
    var scriptTag = scriptTags[i];

    // src matches the url of this request, and not processed it yet.
    if (scriptTag.src == thisRequestUrl && processedScripts.indexOf(scriptTag) < 0) {
      processedScripts.push(scriptTag);

      // Add the style tag into the head (once only).
      if (styleTags.length == 0) {
        // Add a style tag to the head.
        var styleTag = document.createElement("link");
        styleTag.rel = "stylesheet";
        styleTag.type = "text/css";
        styleTag.href =  "https://news.ki.se/modules/custom/ki_widget_builder/css/dist/widgets_v1.css";
        styleTag.media = "all";
        document.getElementsByTagName('head')[0].appendChild(styleTag);
        styleTags.push(styleTag);
      }

      // Create a div
      var div = document.createElement('div');
      div.id = 'ki-embed-777b823a-d398-44d7-bd57-551408481a65';
      div.className = '';

      scriptTag.parentNode.insertBefore(div, scriptTag);
      div.innerHTML = '  <div class=\"event-listing-results\">    <div class=\"inner\">      <div class=\"item-listing item-listing__regular item-listing__event no-image\">  <div class=\"inside--listing\">    <a href=\"https://news.ki.se/calendar/dissertation-elin-holmen\" target=\"_parent\" class=\"absolute-cover\">      <span><span>Dissertation – Elin Holmén</span></span>    </a>        <div>      <h3><span>Dissertation – Elin Holmén</span></h3>      <p class=\"date\">        19-09-2025 <span class=\"icon icon-time\"></span>9:00 am - 1:00 pm      </p>                  <p class=\"preamble\">“Effects, Experiences and Perceptions of Harm Reduction Interventions among People Who Inject Drugs”</p>    </div>  </div></div><div class=\"item-listing item-listing__regular item-listing__event no-image\">  <div class=\"inside--listing\">    <a href=\"https://news.ki.se/calendar/dissertation-bhavik-rathod\" target=\"_parent\" class=\"absolute-cover\">      <span><span>Dissertation - Bhavik Rathod</span></span>    </a>        <div>      <h3><span>Dissertation - Bhavik Rathod</span></h3>      <p class=\"date\">        19-09-2025 <span class=\"icon icon-time\"></span>10:00 am      </p>                  <p class=\"preamble\">Tartrate-resistant acid phosphatase/ACP5 in Bone Development and Maintenance: Age- and Sex-Specific Skeletal Phenotypes in Mice</p>    </div>  </div></div><div class=\"item-listing item-listing__regular item-listing__event no-image\">  <div class=\"inside--listing\">    <a href=\"https://news.ki.se/calendar/doctoral-dissertation-hannaneh-yazdi-0\" target=\"_parent\" class=\"absolute-cover\">      <span><span>Doctoral Dissertation: Hannaneh Yazdi</span></span>    </a>        <div>      <h3><span>Doctoral Dissertation: Hannaneh Yazdi</span></h3>      <p class=\"date\">        25-09-2025 <span class=\"icon icon-time\"></span>1:00 pm      </p>                  <p class=\"preamble\">Welcome to Hannaneh Yazdis dissertation; &quot;Unveiling Frustration: Underlying Mechanisms and Individual Differences&quot; at 1:00 PM in Atrium, Nobels väg 12B, 171 65 Solna.</p>    </div>  </div></div><div class=\"item-listing item-listing__regular item-listing__event no-image\">  <div class=\"inside--listing\">    <a href=\"https://news.ki.se/calendar/dissertation-anne-brynolf\" target=\"_parent\" class=\"absolute-cover\">      <span><span>Dissertation - Anne Brynolf</span></span>    </a>        <div>      <h3><span>Dissertation - Anne Brynolf</span></h3>      <p class=\"date\">        26-09-2025 <span class=\"icon icon-time\"></span>9:00 am      </p>                  <p class=\"preamble\">Blood in, Blood out: Aspects of blood transfusions and donations in the realms of obstetric care and beyond.</p>    </div>  </div></div><div class=\"item-listing item-listing__regular item-listing__event no-image\">  <div class=\"inside--listing\">    <a href=\"https://news.ki.se/calendar/dissertation-faisal-alagrafi\" target=\"_parent\" class=\"absolute-cover\">      <span><span>Dissertation: Faisal Alagrafi</span></span>    </a>        <div>      <h3><span>Dissertation: Faisal Alagrafi</span></h3>      <p class=\"date\">        26-09-2025 <span class=\"icon icon-time\"></span>9:00 am      </p>                  <p class=\"preamble\">Welcome to Faisal Alagrafi&#039;s dissertation with the title &quot;The Role of gd T Cells in Haematopoietic Stem Cell Transplantation and Malignancies&quot;.</p>    </div>  </div></div><div class=\"item-listing item-listing__regular item-listing__event no-image\">  <div class=\"inside--listing\">    <a href=\"https://news.ki.se/calendar/dissertation-karolina-olin\" target=\"_parent\" class=\"absolute-cover\">      <span><span>Dissertation: Karolina Olin</span></span>    </a>        <div>      <h3><span>Dissertation: Karolina Olin</span></h3>      <p class=\"date\">        26-09-2025 <span class=\"icon icon-time\"></span>9:00 am      </p>                  <p class=\"preamble\">&quot;Team Resilience - Exploring Adaptive Management of Complexity in Healthcare&quot;</p>    </div>  </div></div><div class=\"item-listing item-listing__regular item-listing__event no-image\">  <div class=\"inside--listing\">    <a href=\"https://news.ki.se/calendar/dissertation-ahmed-abdelmoez\" target=\"_parent\" class=\"absolute-cover\">      <span><span>Dissertation: Ahmed Abdelmoez</span></span>    </a>        <div>      <h3><span>Dissertation: Ahmed Abdelmoez</span></h3>      <p class=\"date\">        26-09-2025 <span class=\"icon icon-time\"></span>9:00 am      </p>                  <p class=\"preamble\">Molecular Modulators of Skeletal Muscle Metabolism in Exercise and Type 2 Diabetes</p>    </div>  </div></div><div class=\"item-listing item-listing__regular item-listing__event no-image\">  <div class=\"inside--listing\">    <a href=\"https://news.ki.se/calendar/dissertation-mikael-erhardsson\" target=\"_parent\" class=\"absolute-cover\">      <span><span>Dissertation - Mikael Erhardsson</span></span>    </a>        <div>      <h3><span>Dissertation - Mikael Erhardsson</span></h3>      <p class=\"date\">        26-09-2025 <span class=\"icon icon-time\"></span>9:00 am      </p>                  <p class=\"preamble\">Metabolic Aspects in Heart Failure Phenotypes: Impact of Biomarkers, Body Measurements and Coronary Microvascular Dysfunction</p>    </div>  </div></div><div class=\"item-listing item-listing__regular item-listing__event no-image\">  <div class=\"inside--listing\">    <a href=\"https://news.ki.se/calendar/dissertation-jutta-jalkanen\" target=\"_parent\" class=\"absolute-cover\">      <span><span>Dissertation: Jutta Jalkanen</span></span>    </a>        <div>      <h3><span>Dissertation: Jutta Jalkanen</span></h3>      <p class=\"date\">        26-09-2025 <span class=\"icon icon-time\"></span>9:30 am      </p>                  <p class=\"preamble\">Welcome to Jutta Jalkanen&#039;s dissertation with the title &quot;Unveiling Human White Adipose Tissue Diversity at Single-Cell Resolution&quot;.</p>    </div>  </div></div>                <a href=\"https://news.ki.se/ki-calendar?et=1\" class=\"read-more__events\">More events</a>            <a href=\"https://news.ki.se/widget/rss/events?au=&amp;aa=0&amp;ae=0&amp;ar=0&amp;m=0&amp;n=9&amp;lang=en\" target=\"_blank\" class=\"read-more__rss\">RSS</a>    </div>  </div>';

      scriptTag.parentNode.querySelector('#ki-embed-loading-777b823a-d398-44d7-bd57-551408481a65').classList.remove('ki-embed-loading');
    }
  }
})(this);