/*!
 * EdGEL: The University of Edinburgh Design System (consent.js) v5.1.0-rc.1 (https://design-system.ed.ac.uk/)
 * Copyright 2014-2023 The University of Edinburgh
 *
 * Bootstrap  v5.3.2 (https://getbootstrap.com/)
 * Copyright 2011-2023 The Bootstrap Authors
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 */

(function (global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  typeof define === 'function' && define.amd ? define(factory) :
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Consent = factory());
})(this, (function () { 'use strict';

  /**
   * --------------------------------------------------------------------------
   * Bootstrap dom/data.js
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
   * --------------------------------------------------------------------------
   */

  /**
   * Constants
   */

  const elementMap = new Map();
  var Data = {
    set(element, key, instance) {
      if (!elementMap.has(element)) {
        elementMap.set(element, new Map());
      }
      const instanceMap = elementMap.get(element);

      // make it clear we only want one instance per element
      // can be removed later when multiple key/instances are fine to be used
      if (!instanceMap.has(key) && instanceMap.size !== 0) {
        // eslint-disable-next-line no-console
        console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
        return;
      }
      instanceMap.set(key, instance);
    },
    get(element, key) {
      if (elementMap.has(element)) {
        return elementMap.get(element).get(key) || null;
      }
      return null;
    },
    remove(element, key) {
      if (!elementMap.has(element)) {
        return;
      }
      const instanceMap = elementMap.get(element);
      instanceMap.delete(key);

      // free up element references if there are no instances left for an element
      if (instanceMap.size === 0) {
        elementMap.delete(element);
      }
    }
  };

  /**
   * --------------------------------------------------------------------------
   * Bootstrap util/index.js
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
   * --------------------------------------------------------------------------
   */

  const MILLISECONDS_MULTIPLIER = 1000;
  const TRANSITION_END = 'transitionend';

  /**
   * Properly escape IDs selectors to handle weird IDs
   * @param {string} selector
   * @returns {string}
   */
  const parseSelector = selector => {
    if (selector && window.CSS && window.CSS.escape) {
      // document.querySelector needs escaping to handle IDs (html5+) containing for instance /
      selector = selector.replace(/#([^\s"#']+)/g, (match, id) => `#${CSS.escape(id)}`);
    }
    return selector;
  };

  // Shout-out Angus Croll (https://goo.gl/pxwQGp)
  const toType = object => {
    if (object === null || object === undefined) {
      return `${object}`;
    }
    return Object.prototype.toString.call(object).match(/\s([a-z]+)/i)[1].toLowerCase();
  };
  const getTransitionDurationFromElement = element => {
    if (!element) {
      return 0;
    }

    // Get transition-duration of the element
    let {
      transitionDuration,
      transitionDelay
    } = window.getComputedStyle(element);
    const floatTransitionDuration = Number.parseFloat(transitionDuration);
    const floatTransitionDelay = Number.parseFloat(transitionDelay);

    // Return 0 if element or transition duration is not found
    if (!floatTransitionDuration && !floatTransitionDelay) {
      return 0;
    }

    // If multiple durations are defined, take the first
    transitionDuration = transitionDuration.split(',')[0];
    transitionDelay = transitionDelay.split(',')[0];
    return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
  };
  const triggerTransitionEnd = element => {
    element.dispatchEvent(new Event(TRANSITION_END));
  };
  const isElement = object => {
    if (!object || typeof object !== 'object') {
      return false;
    }
    if (typeof object.jquery !== 'undefined') {
      object = object[0];
    }
    return typeof object.nodeType !== 'undefined';
  };
  const getElement = object => {
    // it's a jQuery object or a node element
    if (isElement(object)) {
      return object.jquery ? object[0] : object;
    }
    if (typeof object === 'string' && object.length > 0) {
      return document.querySelector(parseSelector(object));
    }
    return null;
  };
  const isVisible = element => {
    if (!isElement(element) || element.getClientRects().length === 0) {
      return false;
    }
    const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible';
    // Handle `details` element as its content may falsie appear visible when it is closed
    const closedDetails = element.closest('details:not([open])');
    if (!closedDetails) {
      return elementIsVisible;
    }
    if (closedDetails !== element) {
      const summary = element.closest('summary');
      if (summary && summary.parentNode !== closedDetails) {
        return false;
      }
      if (summary === null) {
        return false;
      }
    }
    return elementIsVisible;
  };
  const isDisabled = element => {
    if (!element || element.nodeType !== Node.ELEMENT_NODE) {
      return true;
    }
    if (element.classList.contains('disabled')) {
      return true;
    }
    if (typeof element.disabled !== 'undefined') {
      return element.disabled;
    }
    return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false';
  };

  /**
   * Trick to restart an element's animation
   *
   * @param {HTMLElement} element
   * @return void
   *
   * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation
   */
  const reflow = element => {
    element.offsetHeight; // eslint-disable-line no-unused-expressions
  };

  const getjQuery = () => {
    if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
      return window.jQuery;
    }
    return null;
  };
  const DOMContentLoadedCallbacks = [];
  const onDOMContentLoaded = callback => {
    if (document.readyState === 'loading') {
      // add listener on the first call when the document is in loading state
      if (!DOMContentLoadedCallbacks.length) {
        document.addEventListener('DOMContentLoaded', () => {
          for (const callback of DOMContentLoadedCallbacks) {
            callback();
          }
        });
      }
      DOMContentLoadedCallbacks.push(callback);
    } else {
      callback();
    }
  };
  const isRTL = () => document.documentElement.dir === 'rtl';
  const defineJQueryPlugin = plugin => {
    onDOMContentLoaded(() => {
      const $ = getjQuery();
      /* istanbul ignore if */
      if ($) {
        const name = plugin.NAME;
        const JQUERY_NO_CONFLICT = $.fn[name];
        $.fn[name] = plugin.jQueryInterface;
        $.fn[name].Constructor = plugin;
        $.fn[name].noConflict = () => {
          $.fn[name] = JQUERY_NO_CONFLICT;
          return plugin.jQueryInterface;
        };
      }
    });
  };
  const execute = (possibleCallback, args = [], defaultValue = possibleCallback) => {
    return typeof possibleCallback === 'function' ? possibleCallback(...args) : defaultValue;
  };
  const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {
    if (!waitForTransition) {
      execute(callback);
      return;
    }
    const durationPadding = 5;
    const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding;
    let called = false;
    const handler = ({
      target
    }) => {
      if (target !== transitionElement) {
        return;
      }
      called = true;
      transitionElement.removeEventListener(TRANSITION_END, handler);
      execute(callback);
    };
    transitionElement.addEventListener(TRANSITION_END, handler);
    setTimeout(() => {
      if (!called) {
        triggerTransitionEnd(transitionElement);
      }
    }, emulatedDuration);
  };

  /**
   * --------------------------------------------------------------------------
   * Bootstrap dom/event-handler.js
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
   * --------------------------------------------------------------------------
   */


  /**
   * Constants
   */

  const namespaceRegex = /[^.]*(?=\..*)\.|.*/;
  const stripNameRegex = /\..*/;
  const stripUidRegex = /::\d+$/;
  const eventRegistry = {}; // Events storage
  let uidEvent = 1;
  const customEvents = {
    mouseenter: 'mouseover',
    mouseleave: 'mouseout'
  };
  const nativeEvents = new Set(['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']);

  /**
   * Private methods
   */

  function makeEventUid(element, uid) {
    return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++;
  }
  function getElementEvents(element) {
    const uid = makeEventUid(element);
    element.uidEvent = uid;
    eventRegistry[uid] = eventRegistry[uid] || {};
    return eventRegistry[uid];
  }
  function bootstrapHandler(element, fn) {
    return function handler(event) {
      hydrateObj(event, {
        delegateTarget: element
      });
      if (handler.oneOff) {
        EventHandler.off(element, event.type, fn);
      }
      return fn.apply(element, [event]);
    };
  }
  function bootstrapDelegationHandler(element, selector, fn) {
    return function handler(event) {
      const domElements = element.querySelectorAll(selector);
      for (let {
        target
      } = event; target && target !== this; target = target.parentNode) {
        for (const domElement of domElements) {
          if (domElement !== target) {
            continue;
          }
          hydrateObj(event, {
            delegateTarget: target
          });
          if (handler.oneOff) {
            EventHandler.off(element, event.type, selector, fn);
          }
          return fn.apply(target, [event]);
        }
      }
    };
  }
  function findHandler(events, callable, delegationSelector = null) {
    return Object.values(events).find(event => event.callable === callable && event.delegationSelector === delegationSelector);
  }
  function normalizeParameters(originalTypeEvent, handler, delegationFunction) {
    const isDelegated = typeof handler === 'string';
    // TODO: tooltip passes `false` instead of selector, so we need to check
    const callable = isDelegated ? delegationFunction : handler || delegationFunction;
    let typeEvent = getTypeEvent(originalTypeEvent);
    if (!nativeEvents.has(typeEvent)) {
      typeEvent = originalTypeEvent;
    }
    return [isDelegated, callable, typeEvent];
  }
  function addHandler(element, originalTypeEvent, handler, delegationFunction, oneOff) {
    if (typeof originalTypeEvent !== 'string' || !element) {
      return;
    }
    let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction);

    // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position
    // this prevents the handler from being dispatched the same way as mouseover or mouseout does
    if (originalTypeEvent in customEvents) {
      const wrapFunction = fn => {
        return function (event) {
          if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) {
            return fn.call(this, event);
          }
        };
      };
      callable = wrapFunction(callable);
    }
    const events = getElementEvents(element);
    const handlers = events[typeEvent] || (events[typeEvent] = {});
    const previousFunction = findHandler(handlers, callable, isDelegated ? handler : null);
    if (previousFunction) {
      previousFunction.oneOff = previousFunction.oneOff && oneOff;
      return;
    }
    const uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, ''));
    const fn = isDelegated ? bootstrapDelegationHandler(element, handler, callable) : bootstrapHandler(element, callable);
    fn.delegationSelector = isDelegated ? handler : null;
    fn.callable = callable;
    fn.oneOff = oneOff;
    fn.uidEvent = uid;
    handlers[uid] = fn;
    element.addEventListener(typeEvent, fn, isDelegated);
  }
  function removeHandler(element, events, typeEvent, handler, delegationSelector) {
    const fn = findHandler(events[typeEvent], handler, delegationSelector);
    if (!fn) {
      return;
    }
    element.removeEventListener(typeEvent, fn, Boolean(delegationSelector));
    delete events[typeEvent][fn.uidEvent];
  }
  function removeNamespacedHandlers(element, events, typeEvent, namespace) {
    const storeElementEvent = events[typeEvent] || {};
    for (const [handlerKey, event] of Object.entries(storeElementEvent)) {
      if (handlerKey.includes(namespace)) {
        removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);
      }
    }
  }
  function getTypeEvent(event) {
    // allow to get the native events from namespaced events ('click.bs.button' --> 'click')
    event = event.replace(stripNameRegex, '');
    return customEvents[event] || event;
  }
  const EventHandler = {
    on(element, event, handler, delegationFunction) {
      addHandler(element, event, handler, delegationFunction, false);
    },
    one(element, event, handler, delegationFunction) {
      addHandler(element, event, handler, delegationFunction, true);
    },
    off(element, originalTypeEvent, handler, delegationFunction) {
      if (typeof originalTypeEvent !== 'string' || !element) {
        return;
      }
      const [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction);
      const inNamespace = typeEvent !== originalTypeEvent;
      const events = getElementEvents(element);
      const storeElementEvent = events[typeEvent] || {};
      const isNamespace = originalTypeEvent.startsWith('.');
      if (typeof callable !== 'undefined') {
        // Simplest case: handler is passed, remove that listener ONLY.
        if (!Object.keys(storeElementEvent).length) {
          return;
        }
        removeHandler(element, events, typeEvent, callable, isDelegated ? handler : null);
        return;
      }
      if (isNamespace) {
        for (const elementEvent of Object.keys(events)) {
          removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1));
        }
      }
      for (const [keyHandlers, event] of Object.entries(storeElementEvent)) {
        const handlerKey = keyHandlers.replace(stripUidRegex, '');
        if (!inNamespace || originalTypeEvent.includes(handlerKey)) {
          removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);
        }
      }
    },
    trigger(element, event, args) {
      if (typeof event !== 'string' || !element) {
        return null;
      }
      const $ = getjQuery();
      const typeEvent = getTypeEvent(event);
      const inNamespace = event !== typeEvent;
      let jQueryEvent = null;
      let bubbles = true;
      let nativeDispatch = true;
      let defaultPrevented = false;
      if (inNamespace && $) {
        jQueryEvent = $.Event(event, args);
        $(element).trigger(jQueryEvent);
        bubbles = !jQueryEvent.isPropagationStopped();
        nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
        defaultPrevented = jQueryEvent.isDefaultPrevented();
      }
      const evt = hydrateObj(new Event(event, {
        bubbles,
        cancelable: true
      }), args);
      if (defaultPrevented) {
        evt.preventDefault();
      }
      if (nativeDispatch) {
        element.dispatchEvent(evt);
      }
      if (evt.defaultPrevented && jQueryEvent) {
        jQueryEvent.preventDefault();
      }
      return evt;
    }
  };
  function hydrateObj(obj, meta = {}) {
    for (const [key, value] of Object.entries(meta)) {
      try {
        obj[key] = value;
      } catch (_unused) {
        Object.defineProperty(obj, key, {
          configurable: true,
          get() {
            return value;
          }
        });
      }
    }
    return obj;
  }

  /**
   * --------------------------------------------------------------------------
   * Bootstrap dom/manipulator.js
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
   * --------------------------------------------------------------------------
   */

  function normalizeData(value) {
    if (value === 'true') {
      return true;
    }
    if (value === 'false') {
      return false;
    }
    if (value === Number(value).toString()) {
      return Number(value);
    }
    if (value === '' || value === 'null') {
      return null;
    }
    if (typeof value !== 'string') {
      return value;
    }
    try {
      return JSON.parse(decodeURIComponent(value));
    } catch (_unused) {
      return value;
    }
  }
  function normalizeDataKey(key) {
    return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`);
  }
  const Manipulator = {
    setDataAttribute(element, key, value) {
      element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value);
    },
    removeDataAttribute(element, key) {
      element.removeAttribute(`data-bs-${normalizeDataKey(key)}`);
    },
    getDataAttributes(element) {
      if (!element) {
        return {};
      }
      const attributes = {};
      const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig'));
      for (const key of bsKeys) {
        let pureKey = key.replace(/^bs/, '');
        pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);
        attributes[pureKey] = normalizeData(element.dataset[key]);
      }
      return attributes;
    },
    getDataAttribute(element, key) {
      return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`));
    }
  };

  /**
   * --------------------------------------------------------------------------
   * Bootstrap util/config.js
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
   * --------------------------------------------------------------------------
   */


  /**
   * Class definition
   */

  class Config {
    // Getters
    static get Default() {
      return {};
    }
    static get DefaultType() {
      return {};
    }
    static get NAME() {
      throw new Error('You have to implement the static method "NAME", for each component!');
    }
    _getConfig(config) {
      config = this._mergeConfigObj(config);
      config = this._configAfterMerge(config);
      this._typeCheckConfig(config);
      return config;
    }
    _configAfterMerge(config) {
      return config;
    }
    _mergeConfigObj(config, element) {
      const jsonConfig = isElement(element) ? Manipulator.getDataAttribute(element, 'config') : {}; // try to parse

      return {
        ...this.constructor.Default,
        ...(typeof jsonConfig === 'object' ? jsonConfig : {}),
        ...(isElement(element) ? Manipulator.getDataAttributes(element) : {}),
        ...(typeof config === 'object' ? config : {})
      };
    }
    _typeCheckConfig(config, configTypes = this.constructor.DefaultType) {
      for (const [property, expectedTypes] of Object.entries(configTypes)) {
        const value = config[property];
        const valueType = isElement(value) ? 'element' : toType(value);
        if (!new RegExp(expectedTypes).test(valueType)) {
          throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);
        }
      }
    }
  }

  /**
   * --------------------------------------------------------------------------
   * Bootstrap base-component.js
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
   * --------------------------------------------------------------------------
   */


  /**
   * Constants
   */

  const VERSION$1 = '5.3.2';

  /**
   * Class definition
   */

  class BaseComponent extends Config {
    constructor(element, config) {
      super();
      element = getElement(element);
      if (!element) {
        return;
      }
      this._element = element;
      this._config = this._getConfig(config);
      Data.set(this._element, this.constructor.DATA_KEY, this);
    }

    // Public
    dispose() {
      Data.remove(this._element, this.constructor.DATA_KEY);
      EventHandler.off(this._element, this.constructor.EVENT_KEY);
      for (const propertyName of Object.getOwnPropertyNames(this)) {
        this[propertyName] = null;
      }
    }
    _queueCallback(callback, element, isAnimated = true) {
      executeAfterTransition(callback, element, isAnimated);
    }
    _getConfig(config) {
      config = this._mergeConfigObj(config, this._element);
      config = this._configAfterMerge(config);
      this._typeCheckConfig(config);
      return config;
    }

    // Static
    static getInstance(element) {
      return Data.get(getElement(element), this.DATA_KEY);
    }
    static getOrCreateInstance(element, config = {}) {
      return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null);
    }
    static get VERSION() {
      return VERSION$1;
    }
    static get DATA_KEY() {
      return `bs.${this.NAME}`;
    }
    static get EVENT_KEY() {
      return `.${this.DATA_KEY}`;
    }
    static eventName(name) {
      return `${name}${this.EVENT_KEY}`;
    }
  }

  /**
   * --------------------------------------------------------------------------
   * Bootstrap dom/selector-engine.js
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
   * --------------------------------------------------------------------------
   */

  const getSelector = element => {
    let selector = element.getAttribute('data-bs-target');
    if (!selector || selector === '#') {
      let hrefAttribute = element.getAttribute('href');

      // The only valid content that could double as a selector are IDs or classes,
      // so everything starting with `#` or `.`. If a "real" URL is used as the selector,
      // `document.querySelector` will rightfully complain it is invalid.
      // See https://github.com/twbs/bootstrap/issues/32273
      if (!hrefAttribute || !hrefAttribute.includes('#') && !hrefAttribute.startsWith('.')) {
        return null;
      }

      // Just in case some CMS puts out a full URL with the anchor appended
      if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) {
        hrefAttribute = `#${hrefAttribute.split('#')[1]}`;
      }
      selector = hrefAttribute && hrefAttribute !== '#' ? parseSelector(hrefAttribute.trim()) : null;
    }
    return selector;
  };
  const SelectorEngine = {
    find(selector, element = document.documentElement) {
      return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
    },
    findOne(selector, element = document.documentElement) {
      return Element.prototype.querySelector.call(element, selector);
    },
    children(element, selector) {
      return [].concat(...element.children).filter(child => child.matches(selector));
    },
    parents(element, selector) {
      const parents = [];
      let ancestor = element.parentNode.closest(selector);
      while (ancestor) {
        parents.push(ancestor);
        ancestor = ancestor.parentNode.closest(selector);
      }
      return parents;
    },
    prev(element, selector) {
      let previous = element.previousElementSibling;
      while (previous) {
        if (previous.matches(selector)) {
          return [previous];
        }
        previous = previous.previousElementSibling;
      }
      return [];
    },
    // TODO: this is now unused; remove later along with prev()
    next(element, selector) {
      let next = element.nextElementSibling;
      while (next) {
        if (next.matches(selector)) {
          return [next];
        }
        next = next.nextElementSibling;
      }
      return [];
    },
    focusableChildren(element) {
      const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(',');
      return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el));
    },
    getSelectorFromElement(element) {
      const selector = getSelector(element);
      if (selector) {
        return SelectorEngine.findOne(selector) ? selector : null;
      }
      return null;
    },
    getElementFromSelector(element) {
      const selector = getSelector(element);
      return selector ? SelectorEngine.findOne(selector) : null;
    },
    getMultipleElementsFromSelector(element) {
      const selector = getSelector(element);
      return selector ? SelectorEngine.find(selector) : [];
    }
  };

  /**
   * --------------------------------------------------------------------------
   * Bootstrap util/backdrop.js
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
   * --------------------------------------------------------------------------
   */


  /**
   * Constants
   */

  const NAME$4 = 'backdrop';
  const CLASS_NAME_FADE$2 = 'fade';
  const CLASS_NAME_SHOW$2 = 'show';
  const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$4}`;
  const Default$4 = {
    className: 'modal-backdrop',
    clickCallback: null,
    isAnimated: false,
    isVisible: true,
    // if false, we use the backdrop helper without adding any element to the dom
    rootElement: 'body' // give the choice to place backdrop under different elements
  };

  const DefaultType$4 = {
    className: 'string',
    clickCallback: '(function|null)',
    isAnimated: 'boolean',
    isVisible: 'boolean',
    rootElement: '(element|string)'
  };

  /**
   * Class definition
   */

  class Backdrop extends Config {
    constructor(config) {
      super();
      this._config = this._getConfig(config);
      this._isAppended = false;
      this._element = null;
    }

    // Getters
    static get Default() {
      return Default$4;
    }
    static get DefaultType() {
      return DefaultType$4;
    }
    static get NAME() {
      return NAME$4;
    }

    // Public
    show(callback) {
      if (!this._config.isVisible) {
        execute(callback);
        return;
      }
      this._append();
      const element = this._getElement();
      if (this._config.isAnimated) {
        reflow(element);
      }
      element.classList.add(CLASS_NAME_SHOW$2);
      this._emulateAnimation(() => {
        execute(callback);
      });
    }
    hide(callback) {
      if (!this._config.isVisible) {
        execute(callback);
        return;
      }
      this._getElement().classList.remove(CLASS_NAME_SHOW$2);
      this._emulateAnimation(() => {
        this.dispose();
        execute(callback);
      });
    }
    dispose() {
      if (!this._isAppended) {
        return;
      }
      EventHandler.off(this._element, EVENT_MOUSEDOWN);
      this._element.remove();
      this._isAppended = false;
    }

    // Private
    _getElement() {
      if (!this._element) {
        const backdrop = document.createElement('div');
        backdrop.className = this._config.className;
        if (this._config.isAnimated) {
          backdrop.classList.add(CLASS_NAME_FADE$2);
        }
        this._element = backdrop;
      }
      return this._element;
    }
    _configAfterMerge(config) {
      // use getElement() with the default "body" to get a fresh Element on each instantiation
      config.rootElement = getElement(config.rootElement);
      return config;
    }
    _append() {
      if (this._isAppended) {
        return;
      }
      const element = this._getElement();
      this._config.rootElement.append(element);
      EventHandler.on(element, EVENT_MOUSEDOWN, () => {
        execute(this._config.clickCallback);
      });
      this._isAppended = true;
    }
    _emulateAnimation(callback) {
      executeAfterTransition(callback, this._getElement(), this._config.isAnimated);
    }
  }

  /**
   * --------------------------------------------------------------------------
   * Bootstrap util/component-functions.js
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
   * --------------------------------------------------------------------------
   */

  const enableDismissTrigger = (component, method = 'hide') => {
    const clickEvent = `click.dismiss${component.EVENT_KEY}`;
    const name = component.NAME;
    EventHandler.on(document, clickEvent, `[data-bs-dismiss="${name}"]`, function (event) {
      if (['A', 'AREA'].includes(this.tagName)) {
        event.preventDefault();
      }
      if (isDisabled(this)) {
        return;
      }
      const target = SelectorEngine.getElementFromSelector(this) || this.closest(`.${name}`);
      const instance = component.getOrCreateInstance(target);

      // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method
      instance[method]();
    });
  };

  /**
   * --------------------------------------------------------------------------
   * Bootstrap util/focustrap.js
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
   * --------------------------------------------------------------------------
   */


  /**
   * Constants
   */

  const NAME$3 = 'focustrap';
  const DATA_KEY$2 = 'bs.focustrap';
  const EVENT_KEY$2 = `.${DATA_KEY$2}`;
  const EVENT_FOCUSIN = `focusin${EVENT_KEY$2}`;
  const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$2}`;
  const TAB_KEY = 'Tab';
  const TAB_NAV_FORWARD = 'forward';
  const TAB_NAV_BACKWARD = 'backward';
  const Default$3 = {
    autofocus: true,
    trapElement: null // The element to trap focus inside of
  };

  const DefaultType$3 = {
    autofocus: 'boolean',
    trapElement: 'element'
  };

  /**
   * Class definition
   */

  class FocusTrap extends Config {
    constructor(config) {
      super();
      this._config = this._getConfig(config);
      this._isActive = false;
      this._lastTabNavDirection = null;
    }

    // Getters
    static get Default() {
      return Default$3;
    }
    static get DefaultType() {
      return DefaultType$3;
    }
    static get NAME() {
      return NAME$3;
    }

    // Public
    activate() {
      if (this._isActive) {
        return;
      }
      if (this._config.autofocus) {
        this._config.trapElement.focus();
      }
      EventHandler.off(document, EVENT_KEY$2); // guard against infinite focus loop
      EventHandler.on(document, EVENT_FOCUSIN, event => this._handleFocusin(event));
      EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event));
      this._isActive = true;
    }
    deactivate() {
      if (!this._isActive) {
        return;
      }
      this._isActive = false;
      EventHandler.off(document, EVENT_KEY$2);
    }

    // Private
    _handleFocusin(event) {
      const {
        trapElement
      } = this._config;
      if (event.target === document || event.target === trapElement || trapElement.contains(event.target)) {
        return;
      }
      const elements = SelectorEngine.focusableChildren(trapElement);
      if (elements.length === 0) {
        trapElement.focus();
      } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) {
        elements[elements.length - 1].focus();
      } else {
        elements[0].focus();
      }
    }
    _handleKeydown(event) {
      if (event.key !== TAB_KEY) {
        return;
      }
      this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD;
    }
  }

  /**
   * --------------------------------------------------------------------------
   * Bootstrap util/scrollBar.js
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
   * --------------------------------------------------------------------------
   */


  /**
   * Constants
   */

  const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
  const SELECTOR_STICKY_CONTENT = '.sticky-top';
  const PROPERTY_PADDING = 'padding-right';
  const PROPERTY_MARGIN = 'margin-right';

  /**
   * Class definition
   */

  class ScrollBarHelper {
    constructor() {
      this._element = document.body;
    }

    // Public
    getWidth() {
      // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
      const documentWidth = document.documentElement.clientWidth;
      return Math.abs(window.innerWidth - documentWidth);
    }
    hide() {
      const width = this.getWidth();
      this._disableOverFlow();
      // give padding to element to balance the hidden scrollbar width
      this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
      // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
      this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
      this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);
    }
    reset() {
      this._resetElementAttributes(this._element, 'overflow');
      this._resetElementAttributes(this._element, PROPERTY_PADDING);
      this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);
      this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);
    }
    isOverflowing() {
      return this.getWidth() > 0;
    }

    // Private
    _disableOverFlow() {
      this._saveInitialAttribute(this._element, 'overflow');
      this._element.style.overflow = 'hidden';
    }
    _setElementAttributes(selector, styleProperty, callback) {
      const scrollbarWidth = this.getWidth();
      const manipulationCallBack = element => {
        if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
          return;
        }
        this._saveInitialAttribute(element, styleProperty);
        const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);
        element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);
      };
      this._applyManipulationCallback(selector, manipulationCallBack);
    }
    _saveInitialAttribute(element, styleProperty) {
      const actualValue = element.style.getPropertyValue(styleProperty);
      if (actualValue) {
        Manipulator.setDataAttribute(element, styleProperty, actualValue);
      }
    }
    _resetElementAttributes(selector, styleProperty) {
      const manipulationCallBack = element => {
        const value = Manipulator.getDataAttribute(element, styleProperty);
        // We only want to remove the property if the value is `null`; the value can also be zero
        if (value === null) {
          element.style.removeProperty(styleProperty);
          return;
        }
        Manipulator.removeDataAttribute(element, styleProperty);
        element.style.setProperty(styleProperty, value);
      };
      this._applyManipulationCallback(selector, manipulationCallBack);
    }
    _applyManipulationCallback(selector, callBack) {
      if (isElement(selector)) {
        callBack(selector);
        return;
      }
      for (const sel of SelectorEngine.find(selector, this._element)) {
        callBack(sel);
      }
    }
  }

  /**
   * --------------------------------------------------------------------------
   * Bootstrap modal.js
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
   * --------------------------------------------------------------------------
   */


  /**
   * Constants
   */

  const NAME$2 = 'modal';
  const DATA_KEY$1 = 'bs.modal';
  const EVENT_KEY$1 = `.${DATA_KEY$1}`;
  const DATA_API_KEY$1 = '.data-api';
  const ESCAPE_KEY = 'Escape';
  const EVENT_HIDE = `hide${EVENT_KEY$1}`;
  const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY$1}`;
  const EVENT_HIDDEN = `hidden${EVENT_KEY$1}`;
  const EVENT_SHOW = `show${EVENT_KEY$1}`;
  const EVENT_SHOWN = `shown${EVENT_KEY$1}`;
  const EVENT_RESIZE = `resize${EVENT_KEY$1}`;
  const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$1}`;
  const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$1}`;
  const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$1}`;
  const EVENT_CLICK_DATA_API = `click${EVENT_KEY$1}${DATA_API_KEY$1}`;
  const CLASS_NAME_OPEN = 'modal-open';
  const CLASS_NAME_FADE$1 = 'fade';
  const CLASS_NAME_SHOW$1 = 'show';
  const CLASS_NAME_STATIC = 'modal-static';
  const OPEN_SELECTOR = '.modal.show';
  const SELECTOR_DIALOG$1 = '.modal-dialog';
  const SELECTOR_MODAL_BODY = '.modal-body';
  const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="modal"]';
  const Default$2 = {
    backdrop: true,
    focus: true,
    keyboard: true
  };
  const DefaultType$2 = {
    backdrop: '(boolean|string)',
    focus: 'boolean',
    keyboard: 'boolean'
  };

  /**
   * Class definition
   */

  class Modal extends BaseComponent {
    constructor(element, config) {
      super(element, config);
      this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG$1, this._element);
      this._backdrop = this._initializeBackDrop();
      this._focustrap = this._initializeFocusTrap();
      this._isShown = false;
      this._isTransitioning = false;
      this._scrollBar = new ScrollBarHelper();
      this._addEventListeners();
    }

    // Getters
    static get Default() {
      return Default$2;
    }
    static get DefaultType() {
      return DefaultType$2;
    }
    static get NAME() {
      return NAME$2;
    }

    // Public
    toggle(relatedTarget) {
      return this._isShown ? this.hide() : this.show(relatedTarget);
    }
    show(relatedTarget) {
      if (this._isShown || this._isTransitioning) {
        return;
      }
      const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, {
        relatedTarget
      });
      if (showEvent.defaultPrevented) {
        return;
      }
      this._isShown = true;
      this._isTransitioning = true;
      this._scrollBar.hide();
      document.body.classList.add(CLASS_NAME_OPEN);
      this._adjustDialog();
      this._backdrop.show(() => this._showElement(relatedTarget));
    }
    hide() {
      if (!this._isShown || this._isTransitioning) {
        return;
      }
      const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE);
      if (hideEvent.defaultPrevented) {
        return;
      }
      this._isShown = false;
      this._isTransitioning = true;
      this._focustrap.deactivate();
      this._element.classList.remove(CLASS_NAME_SHOW$1);
      this._queueCallback(() => this._hideModal(), this._element, this._isAnimated());
    }
    dispose() {
      EventHandler.off(window, EVENT_KEY$1);
      EventHandler.off(this._dialog, EVENT_KEY$1);
      this._backdrop.dispose();
      this._focustrap.deactivate();
      super.dispose();
    }
    handleUpdate() {
      this._adjustDialog();
    }

    // Private
    _initializeBackDrop() {
      return new Backdrop({
        isVisible: Boolean(this._config.backdrop),
        // 'static' option will be translated to true, and booleans will keep their value,
        isAnimated: this._isAnimated()
      });
    }
    _initializeFocusTrap() {
      return new FocusTrap({
        trapElement: this._element
      });
    }
    _showElement(relatedTarget) {
      // try to append dynamic modal
      if (!document.body.contains(this._element)) {
        document.body.append(this._element);
      }
      this._element.style.display = 'block';
      this._element.removeAttribute('aria-hidden');
      this._element.setAttribute('aria-modal', true);
      this._element.setAttribute('role', 'dialog');
      this._element.scrollTop = 0;
      const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog);
      if (modalBody) {
        modalBody.scrollTop = 0;
      }
      reflow(this._element);
      this._element.classList.add(CLASS_NAME_SHOW$1);
      const transitionComplete = () => {
        if (this._config.focus) {
          this._focustrap.activate();
        }
        this._isTransitioning = false;
        EventHandler.trigger(this._element, EVENT_SHOWN, {
          relatedTarget
        });
      };
      this._queueCallback(transitionComplete, this._dialog, this._isAnimated());
    }
    _addEventListeners() {
      EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {
        if (event.key !== ESCAPE_KEY) {
          return;
        }
        if (this._config.keyboard) {
          this.hide();
          return;
        }
        this._triggerBackdropTransition();
      });
      EventHandler.on(window, EVENT_RESIZE, () => {
        if (this._isShown && !this._isTransitioning) {
          this._adjustDialog();
        }
      });
      EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => {
        // a bad trick to segregate clicks that may start inside dialog but end outside, and avoid listen to scrollbar clicks
        EventHandler.one(this._element, EVENT_CLICK_DISMISS, event2 => {
          if (this._element !== event.target || this._element !== event2.target) {
            return;
          }
          if (this._config.backdrop === 'static') {
            this._triggerBackdropTransition();
            return;
          }
          if (this._config.backdrop) {
            this.hide();
          }
        });
      });
    }
    _hideModal() {
      this._element.style.display = 'none';
      this._element.setAttribute('aria-hidden', true);
      this._element.removeAttribute('aria-modal');
      this._element.removeAttribute('role');
      this._isTransitioning = false;
      this._backdrop.hide(() => {
        document.body.classList.remove(CLASS_NAME_OPEN);
        this._resetAdjustments();
        this._scrollBar.reset();
        EventHandler.trigger(this._element, EVENT_HIDDEN);
      });
    }
    _isAnimated() {
      return this._element.classList.contains(CLASS_NAME_FADE$1);
    }
    _triggerBackdropTransition() {
      const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
      if (hideEvent.defaultPrevented) {
        return;
      }
      const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
      const initialOverflowY = this._element.style.overflowY;
      // return if the following background transition hasn't yet completed
      if (initialOverflowY === 'hidden' || this._element.classList.contains(CLASS_NAME_STATIC)) {
        return;
      }
      if (!isModalOverflowing) {
        this._element.style.overflowY = 'hidden';
      }
      this._element.classList.add(CLASS_NAME_STATIC);
      this._queueCallback(() => {
        this._element.classList.remove(CLASS_NAME_STATIC);
        this._queueCallback(() => {
          this._element.style.overflowY = initialOverflowY;
        }, this._dialog);
      }, this._dialog);
      this._element.focus();
    }

    /**
     * The following methods are used to handle overflowing modals
     */

    _adjustDialog() {
      const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
      const scrollbarWidth = this._scrollBar.getWidth();
      const isBodyOverflowing = scrollbarWidth > 0;
      if (isBodyOverflowing && !isModalOverflowing) {
        const property = isRTL() ? 'paddingLeft' : 'paddingRight';
        this._element.style[property] = `${scrollbarWidth}px`;
      }
      if (!isBodyOverflowing && isModalOverflowing) {
        const property = isRTL() ? 'paddingRight' : 'paddingLeft';
        this._element.style[property] = `${scrollbarWidth}px`;
      }
    }
    _resetAdjustments() {
      this._element.style.paddingLeft = '';
      this._element.style.paddingRight = '';
    }

    // Static
    static jQueryInterface(config, relatedTarget) {
      return this.each(function () {
        const data = Modal.getOrCreateInstance(this, config);
        if (typeof config !== 'string') {
          return;
        }
        if (typeof data[config] === 'undefined') {
          throw new TypeError(`No method named "${config}"`);
        }
        data[config](relatedTarget);
      });
    }
  }

  /**
   * Data API implementation
   */

  EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
    const target = SelectorEngine.getElementFromSelector(this);
    if (['A', 'AREA'].includes(this.tagName)) {
      event.preventDefault();
    }
    EventHandler.one(target, EVENT_SHOW, showEvent => {
      if (showEvent.defaultPrevented) {
        // only register focus restorer if modal will actually get shown
        return;
      }
      EventHandler.one(target, EVENT_HIDDEN, () => {
        if (isVisible(this)) {
          this.focus();
        }
      });
    });

    // avoid conflict when clicking modal toggler while another one is open
    const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR);
    if (alreadyOpen) {
      Modal.getInstance(alreadyOpen).hide();
    }
    const data = Modal.getOrCreateInstance(target);
    data.toggle(this);
  });
  enableDismissTrigger(Modal);

  /**
   * jQuery
   */

  defineJQueryPlugin(Modal);

  /**
   * --------------------------------------------------------------------------
   * Bootstrap util/sanitizer.js
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
   * --------------------------------------------------------------------------
   */

  // js-docs-start allow-list
  const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
  const DefaultAllowlist = {
    // Global attributes allowed on any supplied element below.
    '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
    a: ['target', 'href', 'title', 'rel'],
    area: [],
    b: [],
    br: [],
    col: [],
    code: [],
    div: [],
    em: [],
    hr: [],
    h1: [],
    h2: [],
    h3: [],
    h4: [],
    h5: [],
    h6: [],
    i: [],
    img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
    li: [],
    ol: [],
    p: [],
    pre: [],
    s: [],
    small: [],
    span: [],
    sub: [],
    sup: [],
    strong: [],
    u: [],
    ul: []
  };
  // js-docs-end allow-list

  const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);

  /**
   * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation
   * contexts.
   *
   * Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38
   */
  // eslint-disable-next-line unicorn/better-regex
  const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i;
  const allowedAttribute = (attribute, allowedAttributeList) => {
    const attributeName = attribute.nodeName.toLowerCase();
    if (allowedAttributeList.includes(attributeName)) {
      if (uriAttributes.has(attributeName)) {
        return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue));
      }
      return true;
    }

    // Check if a regular expression validates the attribute.
    return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName));
  };
  function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
    if (!unsafeHtml.length) {
      return unsafeHtml;
    }
    if (sanitizeFunction && typeof sanitizeFunction === 'function') {
      return sanitizeFunction(unsafeHtml);
    }
    const domParser = new window.DOMParser();
    const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
    const elements = [].concat(...createdDocument.body.querySelectorAll('*'));
    for (const element of elements) {
      const elementName = element.nodeName.toLowerCase();
      if (!Object.keys(allowList).includes(elementName)) {
        element.remove();
        continue;
      }
      const attributeList = [].concat(...element.attributes);
      const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []);
      for (const attribute of attributeList) {
        if (!allowedAttribute(attribute, allowedAttributes)) {
          element.removeAttribute(attribute.nodeName);
        }
      }
    }
    return createdDocument.body.innerHTML;
  }

  /**
   * --------------------------------------------------------------------------
   * Bootstrap util/template-factory.js
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
   * --------------------------------------------------------------------------
   */


  /**
   * Constants
   */

  const NAME$1 = 'TemplateFactory';
  const Default$1 = {
    allowList: DefaultAllowlist,
    content: {},
    // { selector : text ,  selector2 : text2 , }
    extraClass: '',
    html: false,
    sanitize: true,
    sanitizeFn: null,
    template: '<div></div>'
  };
  const DefaultType$1 = {
    allowList: 'object',
    content: 'object',
    extraClass: '(string|function)',
    html: 'boolean',
    sanitize: 'boolean',
    sanitizeFn: '(null|function)',
    template: 'string'
  };
  const DefaultContentType = {
    entry: '(string|element|function|null)',
    selector: '(string|element)'
  };

  /**
   * Class definition
   */

  class TemplateFactory extends Config {
    constructor(config) {
      super();
      this._config = this._getConfig(config);
    }

    // Getters
    static get Default() {
      return Default$1;
    }
    static get DefaultType() {
      return DefaultType$1;
    }
    static get NAME() {
      return NAME$1;
    }

    // Public
    getContent() {
      return Object.values(this._config.content).map(config => this._resolvePossibleFunction(config)).filter(Boolean);
    }
    hasContent() {
      return this.getContent().length > 0;
    }
    changeContent(content) {
      this._checkContent(content);
      this._config.content = {
        ...this._config.content,
        ...content
      };
      return this;
    }
    toHtml() {
      const templateWrapper = document.createElement('div');
      templateWrapper.innerHTML = this._maybeSanitize(this._config.template);
      for (const [selector, text] of Object.entries(this._config.content)) {
        this._setContent(templateWrapper, text, selector);
      }
      const template = templateWrapper.children[0];
      const extraClass = this._resolvePossibleFunction(this._config.extraClass);
      if (extraClass) {
        template.classList.add(...extraClass.split(' '));
      }
      return template;
    }

    // Private
    _typeCheckConfig(config) {
      super._typeCheckConfig(config);
      this._checkContent(config.content);
    }
    _checkContent(arg) {
      for (const [selector, content] of Object.entries(arg)) {
        super._typeCheckConfig({
          selector,
          entry: content
        }, DefaultContentType);
      }
    }
    _setContent(template, content, selector) {
      const templateElement = SelectorEngine.findOne(selector, template);
      if (!templateElement) {
        return;
      }
      content = this._resolvePossibleFunction(content);
      if (!content) {
        templateElement.remove();
        return;
      }
      if (isElement(content)) {
        this._putElementInTemplate(getElement(content), templateElement);
        return;
      }
      if (this._config.html) {
        templateElement.innerHTML = this._maybeSanitize(content);
        return;
      }
      templateElement.textContent = content;
    }
    _maybeSanitize(arg) {
      return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg;
    }
    _resolvePossibleFunction(arg) {
      return execute(arg, [this]);
    }
    _putElementInTemplate(element, templateElement) {
      if (this._config.html) {
        templateElement.innerHTML = '';
        templateElement.append(element);
        return;
      }
      templateElement.textContent = element.textContent;
    }
  }

  /**
   * --------------------------------------------------------------------------
   * helpers.js
   * Helper functions
   * --------------------------------------------------------------------------
   */

  const escapeHtml = function (text) {
    return text.replaceAll('&', '&amp;').replaceAll('<', '&lt;').replaceAll('>', '&gt;').replaceAll('"', '&quot;').replaceAll('\'', '&#039;');
  };

  const template$2 = `
  <div class="cookie-container">
    <div class="cookie-content">
      <h3 class="cookie-heading">Error with EdGEL Cookie Consent settings</h3>
      <ul>
      </ul>
    </div>
  </div>
`;

  const template$1 = `
<button type="button" class="cookie-btn-lid cookie-btn-secondary" data-cookie-change>Change cookie settings</button>
`;

  const template = `
<div class="cookie-container">
  <div class="cookie-content">
    <h3 class="cookie-heading"></h3>
      <p>
        We use cookies for different reasons, including measuring your visits to our sites and remembering
        your preferences.
        <span class="cookie-necessary-url"></span>
      </p>

      <h4 class="cookie-heading">Analytics data</h4>
      <p>
        We gather analytics data to improve this website. You can choose whether your website usage is
        recorded in our analytics.
        <span class="cookie-performance-url"></span>
      </p>
      <div class="cookie-settings">
        <div class="cookie-check">
          <input type="radio" class="cookie-check-input" data-cookie-choice
                 name="performance"
                 id="edgel-cookie-setting-1"
                 value="yes"
          >
          <label class="cookie-check-label" for="edgel-cookie-setting-1">I'm OK with analytics data being recorded</label>
        </div>
        <div class="cookie-check">
          <input type="radio" class="cookie-check-input" data-cookie-choice
                 name="performance"
                 id="edgel-cookie-setting-2"
                 value="no"
          >
          <label class="cookie-check-label" for="edgel-cookie-setting-2">I do not want my website usage included in analytics data</label>
        </div>
      </div>

      <h4 class="cookie-heading">Personalised ads</h4>
      <p>
        We work with advertising partners to show you personalised ads for events and services you might
        be interested in, such as open days.
        <span class="cookie-adverts-url"></span>
      </p>
      <div class="cookie-settings">
        <div class="cookie-check">
          <input type="radio" class="cookie-check-input" data-cookie-choice
                 name="advertising"
                 id="edgel-cookie-setting-3"
                 value="yes"
          >
          <label class="cookie-check-label" for="edgel-cookie-setting-3">I'm OK with personalised ads</label>
        </div>
        <div class="cookie-check">
          <input type="radio" class="cookie-check-input" data-cookie-choice
                 name="advertising"
                 id="edgel-cookie-setting-4"
                 value="no"
          >
          <label class="cookie-check-label" for="edgel-cookie-setting-4">I do not want to see personalised ads</label>
        </div>
      </div>

      <p>You can always revisit these settings by clicking on the link at the bottom of all web pages.</p>

      <div class="cookie-actions">
        <button type="button" class="cookie-btn cookie-btn-primary" data-cookie-save>Save settings</button>
      </div>
    </div>
  </div>
</div>
`;

  /**
   * --------------------------------------------------------------------------
   * consent.js
   * Cookie Consent Banner.
   * --------------------------------------------------------------------------
   */


  /**
   * Constants
   */
  const EdGELVersion = '5.1.0-rc.1';
  const NAME = 'consent';
  const DATA_KEY = 'uoe.consent';
  const EVENT_KEY = `.${DATA_KEY}`;
  const DATA_API_KEY = '.data-api';
  const VERSION = 4;
  const CLASS_NAME_COOKIE_JAR = 'cookie-jar';
  const CLASS_NAME_COOKIE_LID = 'cookie-lid';
  const CLASS_NAME_SHOW = 'show';
  const CLASS_NAME_FADE = 'fade';
  const CLASS_NAME_COLLAPSING = 'cookie-collapsing';
  const CLASS_NAME_COLLAPSE = 'cookie-collapse';
  const TRANSITION_DURATION = 410;
  const COOKIE_DOMAIN = '.ed.ac.uk';
  const PREFS_HEADING = 'Cookies on the University of Edinburgh website';
  const NECESSARY_URL = 'https://www.ed.ac.uk/about/website/privacy/cookies-we-use/types-of-cookies/strictly-necessary-cookies';
  const PERFORMANCE_URL = 'https://www.ed.ac.uk/about/website/privacy/cookies-we-use/types-of-cookies/performance-cookies';
  const ADVERTS_URL = 'https://www.ed.ac.uk/about/website/privacy/cookies-we-use/types-of-cookies/advertising-cookies';
  const COOKIE_NAME = `_uoeCookiePrefsV${VERSION}`;
  const COOKIE_EXPIRES_DAYS = 365;
  const COOKIE_EXPIRES = COOKIE_EXPIRES_DAYS * 24 * 60 * 60 * 1000;
  const DEFUNCT_COOKIES = ['_uoeCookiePrefs', '_uoeCookiePrefsV1', '_uoeCookiePrefsV2', '_uoeCookiePrefsV3'];
  const SELECTOR_SAVE_BTN = 'button[data-cookie-save]';
  const SELECTOR_SAVE_BTN_DEFAULT = 'button[data-cookie-save-default]';
  const SELECTOR_SAVE_BTN_ALL = 'button[data-cookie-save-all]';
  const SELECTOR_CHOICES = 'input[data-cookie-choice]';
  const SELECTOR_CHOICES_SELECTED = `${SELECTOR_CHOICES}:checked`;
  const SELECTOR_CHOICE_ACTIVE_AREA = '.cookie-check';
  const SELECTOR_DIALOG = '.cookie-container';
  const TPL_SELECTOR_HEADING = 'h3.cookie-heading';
  const TPL_SELECTOR_ERROR_LIST = 'ul';
  const TPL_SELECTOR_NECESSARY_LINK = '.cookie-necessary-url';
  const TPL_SELECTOR_PERFORMANCE_LINK = '.cookie-performance-url';
  const TPL_SELECTOR_ADVERTS_LINK = '.cookie-adverts-url';
  const EVENT_CLICK = `click${EVENT_KEY}`;
  const EVENT_CHANGE = `change${EVENT_KEY}`;
  const EVENT_CHANGED = `changed${EVENT_KEY}`;
  const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`;
  const Permissions = {
    necessary: {
      mandatory: true,
      isDefault: true
    },
    performance: {
      mandatory: false,
      isDefault: false
    },
    advertising: {
      mandatory: false,
      isDefault: false
    }
  };
  const Choices = {
    advertising: {
      permissions: ['advertising'],
      yes: 'I\'m OK with personalised ads',
      no: 'I do not want to see personalised ads'
    },
    performance: {
      permissions: ['performance'],
      yes: 'I\'m OK with analytics data being recorded',
      no: 'I do not want my website usage included in analytics data'
    }
  };
  const Default = {
    cookieDomain: COOKIE_DOMAIN,
    prefsHeading: PREFS_HEADING,
    necessaryUrl: NECESSARY_URL,
    performanceUrl: PERFORMANCE_URL,
    advertsUrl: ADVERTS_URL,
    unlocked: false,
    disabled: false
  };
  const DefaultType = {
    cookieDomain: 'string',
    prefsHeading: 'string',
    necessaryUrl: 'string',
    performanceUrl: 'string',
    advertsUrl: 'string',
    unlocked: 'boolean',
    disabled: 'boolean'
  };

  /**
   * Class definition
   */

  class Consent extends Modal {
    constructor(element, config) {
      super(element, {
        ...config,
        backdrop: 'static',
        focus: true,
        keyboard: false
      });
      this._bodyElement = element;
      this._loaded = false;
      this._errors = this._errors || [];
      if (this._config.disabled) {
        this.dispose();
        return;
      }
      this._templateFactories = {};
      this._templateConfigs = {
        errors: {
          sanitize: false,
          html: true,
          template: template$2,
          content: {
            [TPL_SELECTOR_ERROR_LIST]: this._renderErrors.bind(this)
          }
        },
        lid: {
          sanitize: false,
          html: false,
          template: template$1,
          content: {}
        },
        preferences: {
          sanitize: false,
          html: true,
          template: template,
          content: {
            [TPL_SELECTOR_HEADING]: escapeHtml(this._config.prefsHeading),
            [TPL_SELECTOR_NECESSARY_LINK]: this._renderNecessaryLink.bind(this),
            [TPL_SELECTOR_PERFORMANCE_LINK]: this._renderPerformanceLink.bind(this),
            [TPL_SELECTOR_ADVERTS_LINK]: this._renderAdvertsLink.bind(this)
          }
        }
      };
      this._selections = {};
      this._choices = {
        ...Choices
      };

      // Add the cookie lid
      this._cookieLid = document.createElement('div');
      this._cookieLid.className = `${CLASS_NAME_COOKIE_LID} ${CLASS_NAME_COLLAPSE}`;
      this._cookieLid.append(this._getTemplateFactory('lid').toHtml());
      getElement(this._bodyElement).insertBefore(this._cookieLid, null);
      this._displayBanner(false);
      this._addConsentEventListeners();
      this._notifyChoices();
    }

    // Getters
    static get Default() {
      return Default;
    }
    static get DefaultType() {
      return DefaultType;
    }
    static get NAME() {
      return NAME;
    }
    static get VERSION() {
      const bsVersion = super.VERSION;
      return `${bsVersion}+edgel-${EdGELVersion}`;
    }

    // Public

    allowed(permission) {
      const prefs = this._getSelections();
      return prefs[permission];
    }
    allowedList() {
      const prefs = this._getSelections();
      const allowed = [];
      for (const pref of Object.getOwnPropertyNames(prefs)) {
        if (prefs[pref]) {
          allowed.push(pref);
        }
      }
      return allowed.sort().join(',');
    }
    bannerRequired() {
      return !(this.hasSavedSettings() || this.isUnlocked());
    }
    hasSavedSettings() {
      return this._loaded;
    }

    // Private
    _configAfterMerge(config) {
      if (config.cookieDomain.startsWith('.')) {
        config.cookieDomain = config.cookieDomain.slice(1);
      }
      this._errors = this._errors || [];
      this._validateUrl(config.necessaryUrl, config.cookieDomain);
      this._validateUrl(config.performanceUrl, config.cookieDomain);
      this._validateUrl(config.advertsUrl, config.cookieDomain);
      return config;
    }
    _validateUrl(testUrl, cookieDomain) {
      // Validate URL
      let url;
      try {
        url = new URL(testUrl);
      } catch (_unused) {
        this._setError(`Invalid URL provided in "${testUrl}"`);
        return;
      }
      if (url.protocol !== 'https:') {
        this._setError(`Only https protocol accepted for "${testUrl}"`);
      }
      if (!url.hostname.endsWith(`.${cookieDomain}`)) {
        this._setError(`Mismatch between cookie domain and link hostname "${testUrl}"`);
      }
    }
    _notifyChoices() {
      const args = {
        permissions: {
          ...Permissions
        },
        allowedList: this.allowedList()
      };
      EventHandler.trigger(document, EVENT_CHANGED, args);
    }
    _addConsentEventListeners() {
      EventHandler.on(this._cookieLid, EVENT_CLICK, event => {
        event.preventDefault();
        event.stopPropagation();

        // Reload preferences from _uoeCookiePrefsV* cookie, if present.
        this._load();
        this._editPrefs();
      });
      EventHandler.on(this._cookieJar, EVENT_CLICK, event => {
        if (event.target.matches(SELECTOR_SAVE_BTN)) {
          event.preventDefault();
          event.stopPropagation();
          this._savePrefs({});
          // Re-open the banner; it should close to the lid
          this._displayBanner();
        }
        if (event.target.matches(SELECTOR_SAVE_BTN_DEFAULT)) {
          event.preventDefault();
          event.stopPropagation();
          this._savePrefs({
            defaults: true
          });
          // Re-open the banner; it should close to the lid
          this._displayBanner();
        }
        if (event.target.matches(SELECTOR_SAVE_BTN_ALL)) {
          event.preventDefault();
          event.stopPropagation();
          this._savePrefs({
            all: true
          });
          // Re-open the banner; it should close to the lid
          this._displayBanner();
        }
        if (event.target.matches(SELECTOR_CHOICE_ACTIVE_AREA)) {
          event.preventDefault();
          event.stopPropagation();

          // clicked on surround div, so click on the radio button
          const checkbox = SelectorEngine.findOne(SELECTOR_CHOICES, event.target);
          checkbox.checked = true;
        }
      });
      EventHandler.on(this._cookieJar, EVENT_CHANGE, SELECTOR_CHOICES, () => {
        SelectorEngine.findOne(SELECTOR_SAVE_BTN, this._cookieJar).disabled = this._selectionsComplete() ? '' : 'disabled';
      });
    }
    _selectionsComplete() {
      const selections = SelectorEngine.find(SELECTOR_CHOICES_SELECTED, this._cookieJar);
      const selectionsMade = new Set(selections.map(e => e.name.slice(e.name.lastIndexOf('-') + 1)));
      const selectionsAvailable = Object.entries(Permissions).filter(p => !p[1].mandatory).map(p => p[0]);
      return selectionsAvailable.every(o => selectionsMade.has(o) || Permissions[o].mandatory);
    }
    _applyStyle(element, styles) {
      for (const prop of Object.getOwnPropertyNames(styles)) {
        element.style[prop] = styles[prop];
      }
    }
    _showLid(animate) {
      const element = this._cookieLid;
      if (!animate) {
        element.classList.add(CLASS_NAME_SHOW);
      }
      if (!element.classList.contains(CLASS_NAME_SHOW)) {
        const {
          paddingTop,
          paddingBottom
        } = window.getComputedStyle(element);
        element.classList.remove(CLASS_NAME_COLLAPSE);
        element.classList.add(CLASS_NAME_COLLAPSING);

        // eslint-disable-next-line prefer-arrow-callback
        setTimeout(function (element) {
          element.classList.remove(CLASS_NAME_COLLAPSING);
          element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW);
          element.style.height = '';
          element.style.paddingTop = '';
          element.style.paddingBottom = '';
        }.bind(this, element), TRANSITION_DURATION);

        // eslint-disable-next-line prefer-arrow-callback
        setTimeout(function (element, paddingTop, paddingBottom) {
          element.style.height = `${element.scrollHeight}px`;
          element.style.paddingTop = paddingTop;
          element.style.paddingBottom = paddingBottom;
        }.bind(this, element, paddingTop, paddingBottom), 10);
      }
    }
    _hideLid(animate) {
      const element = this._cookieLid;
      if (!animate) {
        element.classList.remove(CLASS_NAME_SHOW);
      }
      if (element.classList.contains(CLASS_NAME_SHOW)) {
        element.style.height = `${element.scrollHeight}px`;
        element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW);
        element.classList.add(CLASS_NAME_COLLAPSING);

        // eslint-disable-next-line prefer-arrow-callback
        setTimeout(function (element) {
          element.classList.remove(CLASS_NAME_COLLAPSING);
          element.classList.add(CLASS_NAME_COLLAPSE);
        }.bind(this, element), TRANSITION_DURATION);

        // eslint-disable-next-line prefer-arrow-callback
        setTimeout(function (element) {
          element.style.height = '';
        }.bind(this, element), 10);
      }
    }
    _openJar(animate) {
      if (!this._cookieJar || !this._cookieLid) {
        return;
      }
      this.show(this);
      this._hideLid(animate);
    }
    _initializeBackDrop() {
      return new Backdrop({
        className: 'cookie-backdrop',
        isVisible: true,
        isAnimated: true
      });
    }
    _initializeFocusTrap() {
      // Add the cookie jar
      this._cookieJar = document.createElement('div');
      this._cookieJar.className = `${CLASS_NAME_COOKIE_JAR} ${CLASS_NAME_FADE}`;
      this._element.insertBefore(this._cookieJar, null);

      // Make the cookieJar the Modal dialogue
      this._element = this._cookieJar;
      return new FocusTrap({
        trapElement: this._cookieJar
      });
    }
    dispose() {
      if (this._cookieJar) {
        EventHandler.off(this._cookieJar, EVENT_CLICK);
        EventHandler.off(this._cookieJar, EVENT_CHANGE, SELECTOR_CHOICES);
        this._cookieJar.remove();
      }
      if (this._cookieLid) {
        EventHandler.off(this._cookieLid, EVENT_CLICK);
        this._cookieLid.remove();
      }
      super.dispose();
    }
    _closeJar(animate) {
      if (!this._cookieJar || !this._cookieLid) {
        return;
      }
      this._showLid(animate);
      this.hide();
    }
    _getSelections() {
      const values = {};
      for (const p of Object.getOwnPropertyNames(Permissions)) {
        values[p] = p in this._selections ? this._selections[p] : false;
      }
      return values;
    }
    _reset() {
      this._loaded = false;
      this._selections = {};
    }
    _load() {
      this._reset();
      this._selections = this._readCookie(this._config.cookieDomain);
      this._loaded = true;

      // If we are missing any mandatory values, we don't have a valid load.
      for (const perm of Object.getOwnPropertyNames(Permissions)) {
        if (Permissions[perm].mandatory && !(perm in this._selections)) {
          this._loaded = false;
        }
      }
    }
    _readCookie(update = true) {
      const decodedCookies = decodeURIComponent(document.cookie).split(';');
      let json = '';
      for (let cookie of decodedCookies) {
        cookie = cookie.trim();
        if (cookie.startsWith(`${COOKIE_NAME}=`)) {
          json = cookie.slice(COOKIE_NAME.length + 1);
        }
      }
      if (json !== '') {
        let requiresUpdate = false;
        let parsed = {};
        try {
          // If we have raw JSON string encode this since the value can cause
          // problems with other systems: I180531-0649
          if (json.startsWith('{')) {
            requiresUpdate = true;
          } else {
            json = window.atob(json);
          }
          parsed = JSON.parse(json);
        } catch (_unused2) {}
        if (requiresUpdate && update) {
          this._writeCookie(parsed);
        }
        return parsed;
      }
      return {};
    }
    _writeCookie() {
      if (!this._loaded) {
        return;
      }
      const d = new Date();
      d.setTime(d.getTime() + COOKIE_EXPIRES);
      const expires = `expires=${d.toUTCString()}`;
      const cValue = window.btoa(JSON.stringify(this._selections));
      document.cookie = `${COOKIE_NAME}=${cValue};${expires};domain=${this._config.cookieDomain};path=/`;

      // Confirm that the write worked by doing straight comparison of btoa values
      const readBack = window.btoa(JSON.stringify(this._readCookie(false)));
      if (readBack !== cValue) {
        this._setError(`Cookie setting write failed. Check the cookie domain (${COOKIE_DOMAIN}).`);
        this._loaded = false;
      }

      // Notify subscribers that a change has happened.
      this._notifyChoices();
    }
    _expireDefunct() {
      const d = new Date();
      d.setTime(d.getTime() - 60 * 60 * 1000); // set expired date 1 hour ago
      const expires = `expires=${d.toUTCString()}`;
      for (const defunct of DEFUNCT_COOKIES) {
        document.cookie = `${defunct}=;${expires};domain=${this._config.cookieDomain};path=/`;
      }
    }
    _savePrefs({
      defaults,
      all
    }) {
      this._reset();
      // Wipe all previously stored cookie settings.
      this._expireDefunct();
      for (const key of Object.getOwnPropertyNames(Permissions)) {
        this._selections[key] = Permissions[key].mandatory;
      }
      if (all) {
        for (const key of Object.getOwnPropertyNames(Permissions)) {
          this._selections[key] = true;
        }
      } else if (defaults) {
        for (const key of Object.getOwnPropertyNames(Permissions)) {
          this._selections[key] = Boolean(this._selections[key]) || Permissions[key].isDefault;
        }
      } else {
        const items = SelectorEngine.find(SELECTOR_CHOICES_SELECTED, this._cookieJar);
        for (const item of items) {
          this._selections[item.name] = item.value === 'yes';
        }
      }
      this._loaded = true;
      this._writeCookie();
    }

    // Detect whether we are on a "further information" page.  If we are we have to hide the
    // overlay to allow users to interact with the page.
    isUnlocked() {
      if (this._config.unlocked) {
        return true;
      }
      const urls = [this._config.necessaryUrl, this._config.performanceUrl, this._config.advertsUrl];
      return urls.includes(window.location.href);
    }
    _editPrefs() {
      this._cookieJar.innerHTML = '';
      this._cookieJar.append(this._getTemplateFactory('preferences').toHtml());
      this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._cookieJar);
      let allOptionsSelected = false;
      const selections = this._getSelections();
      if (this._loaded) {
        const selectionsMade = Object.getOwnPropertyNames(selections);
        const selectionsAvailable = Object.getOwnPropertyNames(this._choices).filter(c => c.options);
        allOptionsSelected = selectionsAvailable.every(o => selectionsMade.includes(o));

        // Get a list of selected object keys
        const active = new Set(Object.entries(selections).filter(a => {
          return a[1];
        }).map(a => {
          return a[0];
        }));
        for (const option of Object.getOwnPropertyNames(this._choices)) {
          const selected = active.has(option) ? 'yes' : 'no';
          const input = SelectorEngine.findOne(`${SELECTOR_CHOICES}[name=${option}][value=${selected}]`, this._cookieJar);
          if (input) {
            input.checked = true;
          }
        }
      }
      const button = SelectorEngine.findOne('button', this._cookieJar);
      button.disabled = !allOptionsSelected;
      this._openJar(true);
    }
    _setError(error) {
      // eslint-disable-next-line no-console
      console.error(error);
      this._errors.push(error);
    }
    _displayBanner(animate = true) {
      // Reload preferences from _uoeCookiePrefsV* cookie, if present.
      this._load();
      if (this._errors.length) {
        this._cookieJar.innerHTML = '';
        this._cookieJar.append(this._getTemplateFactory('errors').toHtml());
        this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._cookieJar);
        this._openJar(animate);
      } else if (this.bannerRequired()) {
        this._editPrefs();
      } else {
        this._closeJar(animate);
      }
    }
    _getTemplateFactory(tpl) {
      if (!this._templateFactories[tpl]) {
        this._templateFactories[tpl] = new TemplateFactory(this._templateConfigs[tpl]);
      }
      return this._templateFactories[tpl];
    }
    _renderNecessaryLink() {
      const {
        necessaryUrl
      } = this._config;
      if (necessaryUrl) {
        return `<a class="cookie-link" href="${encodeURI(necessaryUrl)}">Learn more about necessary cookies</a>`;
      }
    }
    _renderPerformanceLink() {
      const {
        performanceUrl
      } = this._config;
      if (performanceUrl) {
        return `<a class="cookie-link" href="${encodeURI(performanceUrl)}">Learn more about analytics cookies</a>`;
      }
    }
    _renderAdvertsLink() {
      const {
        advertsUrl
      } = this._config;
      if (advertsUrl) {
        return `<a class="cookie-link" href="${encodeURI(advertsUrl)}">Learn more about advertising cookies</a>`;
      }
    }
    _renderErrors() {
      return this._errors.map(e => `<li>${escapeHtml(e)}</li>`).join('');
    }

    // DEPRECATED: Allow extra departmental permissions to be added to the banner.
    addPermission() {
      // eslint-disable-next-line no-console
      console.warn('REMOVED: Cookie Consent addPermission can no longer be used to add extra departmental permissions');
    }
  }

  /**
   * Data API implementation
   * Add EdGEL cookie consent banner to page
   */

  EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
    Consent.getOrCreateInstance(SelectorEngine.findOne('body'));
  });

  return Consent;

}));
//# sourceMappingURL=consent.js.map
