text: /**
   * @file
   * Drupal Bootstrap object.
   */
  
  /**
   * All Drupal Bootstrap JavaScript APIs are contained in this namespace.
   *
   * @param {underscore} _
   * @param {jQuery} $
   * @param {Drupal} Drupal
   * @param {drupalSettings} drupalSettings
   */
  (function (_, $, Drupal, drupalSettings) {
    'use strict';
  
    /**
     * @typedef Drupal.bootstrap
     */
    var Bootstrap = {
      processedOnce: {},
      settings: drupalSettings.bootstrap || {}
    };
  
    /**
     * Wraps Drupal.checkPlain() to ensure value passed isn't empty.
     *
     * Encodes special characters in a plain-text string for display as HTML.
     *
     * @param {string} str
     *   The string to be encoded.
     *
     * @return {string}
     *   The encoded string.
     *
     * @ingroup sanitization
     */
    Bootstrap.checkPlain = function (str) {
      return str && Drupal.checkPlain(str) || '';
    };
  
    /**
     * Creates a jQuery plugin.
     *
     * @param {String} id
     *   A jQuery plugin identifier located in $.fn.
     * @param {Function} plugin
     *   A constructor function used to initialize the for the jQuery plugin.
     * @param {Boolean} [noConflict]
     *   Flag indicating whether or not to create a ".noConflict()" helper method
     *   for the plugin.
     */
    Bootstrap.createPlugin = function (id, plugin, noConflict) {
      // Immediately return if plugin doesn't exist.
      if ($.fn[id] !== void 0) {
        return this.fatal('Specified jQuery plugin identifier already exists: @id. Use Drupal.bootstrap.replacePlugin() instead.', {'@id': id});
      }
  
      // Immediately return if plugin isn't a function.
      if (typeof plugin !== 'function') {
        return this.fatal('You must provide a constructor function to create a jQuery plugin "@id": @plugin', {'@id': id, '@plugin':  plugin});
      }
  
      // Add a ".noConflict()" helper method.
      this.pluginNoConflict(id, plugin, noConflict);
  
      $.fn[id] = plugin;
    };
  
    /**
     * Diff object properties.
     *
     * @param {...Object} objects
     *   Two or more objects. The first object will be used to return properties
     *   values.
     *
     * @return {Object}
     *   Returns the properties of the first passed object that are not present
     *   in all other passed objects.
     */
    Bootstrap.diffObjects = function (objects) {
      var args = Array.prototype.slice.call(arguments);
      return _.pick(args[0], _.difference.apply(_, _.map(args, function (obj) {
        return Object.keys(obj);
      })));
    };
  
    /**
     * Map of supported events by regular expression.
     *
     * @type {Object<Event|MouseEvent|KeyboardEvent|TouchEvent,RegExp>}
     */
    Bootstrap.eventMap = {
      Event: /^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/,
      MouseEvent: /^(?:click|dblclick|mouse(?:down|enter|leave|up|over|move|out))$/,
      KeyboardEvent: /^(?:key(?:down|press|up))$/,
      TouchEvent: /^(?:touch(?:start|end|move|cancel))$/
    };
  
    /**
     * Extends a jQuery Plugin.
     *
     * @param {String} id
     *   A jQuery plugin identifier located in $.fn.
     * @param {Function} callback
     *   A constructor function used to initialize the for the jQuery plugin.
     *
     * @return {Function|Boolean}
     *   The jQuery plugin constructor or FALSE if the plugin does not exist.
     */
    Bootstrap.extendPlugin = function (id, callback) {
      // Immediately return if plugin doesn't exist.
      if (typeof $.fn[id] !== 'function') {
        return this.fatal('Specified jQuery plugin identifier does not exist: @id', {'@id':  id});
      }
  
      // Immediately return if callback isn't a function.
      if (typeof callback !== 'function') {
        return this.fatal('You must provide a callback function to extend the jQuery plugin "@id": @callback', {'@id': id, '@callback':  callback});
      }
  
      // Determine existing plugin constructor.
      var constructor = $.fn[id] && $.fn[id].Constructor || $.fn[id];
      var plugin = callback.apply(constructor, [this.settings]);
      if (!$.isPlainObject(plugin)) {
        return this.fatal('Returned value from callback is not a plain object that can be used to extend the jQuery plugin "@id": @obj', {'@obj':  plugin});
      }
  
      this.wrapPluginConstructor(constructor, plugin, true);
  
      return $.fn[id];
    };
  
    Bootstrap.superWrapper = function (parent, fn) {
      return function () {
        var previousSuper = this.super;
        this.super = parent;
        var ret = fn.apply(this, arguments);
        if (previousSuper) {
          this.super = previousSuper;
        }
        else {
          delete this.super;
        }
        return ret;
      };
    };
  
    /**
     * Provide a helper method for displaying when something is went wrong.
     *
     * @param {String} message
     *   The message to display.
     * @param {Object} [args]
     *   An arguments to use in message.
     *
     * @return {Boolean}
     *   Always returns FALSE.
     */
    Bootstrap.fatal = function (message, args) {
      if (this.settings.dev && console.warn) {
        for (var name in args) {
          if (args.hasOwnProperty(name) && typeof args[name] === 'object') {
            args[name] = JSON.stringify(args[name]);
          }
        }
        Drupal.throwError(new Error(Drupal.formatString(message, args)));
      }
      return false;
    };
  
    /**
     * Intersects object properties.
     *
     * @param {...Object} objects
     *   Two or more objects. The first object will be used to return properties
     *   values.
     *
     * @return {Object}
     *   Returns the properties of first passed object that intersects with all
     *   other passed objects.
     */
    Bootstrap.intersectObjects = function (objects) {
      var args = Array.prototype.slice.call(arguments);
      return _.pick(args[0], _.intersection.apply(_, _.map(args, function (obj) {
        return Object.keys(obj);
      })));
    };
  
    /**
     * Normalizes an object's values.
     *
     * @param {Object} obj
     *   The object to normalize.
     *
     * @return {Object}
     *   The normalized object.
     */
    Bootstrap.normalizeObject = function (obj) {
      if (!$.isPlainObject(obj)) {
        return obj;
      }
  
      for (var k in obj) {
        if (typeof obj[k] === 'string') {
          if (obj[k] === 'true') {
            obj[k] = true;
          }
          else if (obj[k] === 'false') {
            obj[k] = false;
          }
          else if (obj[k].match(/^[\d-.]$/)) {
            obj[k] = parseFloat(obj[k]);
          }
        }
        else if ($.isPlainObject(obj[k])) {
          obj[k] = Bootstrap.normalizeObject(obj[k]);
        }
      }
  
      return obj;
    };
  
    /**
     * An object based once plugin (similar to jquery.once, but without the DOM).
     *
     * @param {String} id
     *   A unique identifier.
     * @param {Function} callback
     *   The callback to invoke if the identifier has not yet been seen.
     *
     * @return {Bootstrap}
     */
    Bootstrap.once = function (id, callback) {
      // Immediately return if identifier has already been processed.
      if (this.processedOnce[id]) {
        return this;
      }
      callback.call(this, this.settings);
      this.processedOnce[id] = true;
      return this;
    };
  
    /**
     * Provide jQuery UI like ability to get/set options for Bootstrap plugins.
     *
     * @param {string|object} key
     *   A string value of the option to set, can be dot like to a nested key.
     *   An object of key/value pairs.
     * @param {*} [value]
     *   (optional) A value to set for key.
     *
     * @returns {*}
     *   - Returns nothing if key is an object or both key and value parameters
     *   were provided to set an option.
     *   - Returns the a value for a specific setting if key was provided.
     *   - Returns an object of key/value pairs of all the options if no key or
     *   value parameter was provided.
     *
     * @see https://github.com/jquery/jquery-ui/blob/master/ui/widget.js
     */
    Bootstrap.option = function (key, value) {
      var options = $.isPlainObject(key) ? $.extend({}, key) : {};
  
      // Get all options (clone so it doesn't reference the internal object).
      if (arguments.length === 0) {
        return $.extend({}, this.options);
      }
  
      // Get/set single option.
      if (typeof key === "string") {
        // Handle nested keys in dot notation.
        // e.g., "foo.bar" => { foo: { bar: true } }
        var parts = key.split('.');
        key = parts.shift();
        var obj = options;
        if (parts.length) {
          for (var i = 0; i < parts.length - 1; i++) {
            obj[parts[i]] = obj[parts[i]] || {};
            obj = obj[parts[i]];
          }
          key = parts.pop();
        }
  
        // Get.
        if (arguments.length === 1) {
          return obj[key] === void 0 ? null : obj[key];
        }
  
        // Set.
        obj[key] = value;
      }
  
      // Set multiple options.
      $.extend(true, this.options, options);
    };
  
    /**
     * Adds a ".noConflict()" helper method if needed.
     *
     * @param {String} id
     *   A jQuery plugin identifier located in $.fn.
     * @param {Function} plugin
     * @param {Function} plugin
     *   A constructor function used to initialize the for the jQuery plugin.
     * @param {Boolean} [noConflict]
     *   Flag indicating whether or not to create a ".noConflict()" helper method
     *   for the plugin.
     */
    Bootstrap.pluginNoConflict = function (id, plugin, noConflict) {
      if (plugin.noConflict === void 0 && (noConflict === void 0 || noConflict)) {
        var old = $.fn[id];
        plugin.noConflict = function () {
          $.fn[id] = old;
          return this;
        };
      }
    };
  
    /**
     * Creates a handler that relays to another event name.
     *
     * @param {HTMLElement|jQuery} target
     *   A target element.
     * @param {String} name
     *   The name of the event to trigger.
     * @param {Boolean} [stopPropagation=true]
     *   Flag indicating whether to stop the propagation of the event, defaults
     *   to true.
     *
     * @return {Function}
     *   An even handler callback function.
     */
    Bootstrap.relayEvent = function (target, name, stopPropagation) {
      return function (e) {
        if (stopPropagation === void 0 || stopPropagation) {
          e.stopPropagation();
        }
        var $target = $(target);
        var parts = name.split('.').filter(Boolean);
        var type = parts.shift();
        e.target = $target[0];
        e.currentTarget = $target[0];
        e.namespace = parts.join('.');
        e.type = type;
        $target.trigger(e);
      };
    };
  
    /**
     * Replaces a Bootstrap jQuery plugin definition.
     *
     * @param {String} id
     *   A jQuery plugin identifier located in $.fn.
     * @param {Function} callback
     *   A callback function that is immediately invoked and must return a
     *   function that will be used as the plugin constructor.
     * @param {Boolean} [noConflict]
     *   Flag indicating whether or not to create a ".noConflict()" helper method
     *   for the plugin.
     */
    Bootstrap.replacePlugin = function (id, callback, noConflict) {
      // Immediately return if plugin doesn't exist.
      if (typeof $.fn[id] !== 'function') {
        return this.fatal('Specified jQuery plugin identifier does not exist: @id', {'@id':  id});
      }
  
      // Immediately return if callback isn't a function.
      if (typeof callback !== 'function') {
        return this.fatal('You must provide a valid callback function to replace a jQuery plugin: @callback', {'@callback': callback});
      }
  
      // Determine existing plugin constructor.
      var constructor = $.fn[id] && $.fn[id].Constructor || $.fn[id];
      var plugin = callback.apply(constructor, [this.settings]);
  
      // Immediately return if plugin isn't a function.
      if (typeof plugin !== 'function') {
        return this.fatal('Returned value from callback is not a usable function to replace a jQuery plugin "@id": @plugin', {'@id': id, '@plugin': plugin});
      }
  
      this.wrapPluginConstructor(constructor, plugin);
  
      // Add a ".noConflict()" helper method.
      this.pluginNoConflict(id, plugin, noConflict);
  
      $.fn[id] = plugin;
    };
  
    /**
     * Simulates a native event on an element in the browser.
     *
     * Note: This is a fairly complete modern implementation. If things aren't
     * working quite the way you intend (in older browsers), you may wish to use
     * the jQuery.simulate plugin. If it's available, this method will defer to
     * that plugin.
     *
     * @see https://github.com/jquery/jquery-simulate
     *
     * @param {HTMLElement|jQuery} element
     *   A DOM element to dispatch event on. Note: this may be a jQuery object,
     *   however be aware that this will trigger the same event for each element
     *   inside the jQuery collection; use with caution.
     * @param {String|String[]} type
     *   The type(s) of event to simulate.
     * @param {Object} [options]
     *   An object of options to pass to the event constructor. Typically, if
     *   an event is being proxied, you should just pass the original event
     *   object here. This allows, if the browser supports it, to be a truly
     *   simulated event.
     *
     * @return {Boolean}
     *   The return value is false if event is cancelable and at least one of the
     *   event handlers which handled this event called Event.preventDefault().
     *   Otherwise it returns true.
     */
    Bootstrap.simulate = function (element, type, options) {
      // Handle jQuery object wrappers so it triggers on each element.
      var ret = true;
      if (element instanceof $) {
        element.each(function () {
          if (!Bootstrap.simulate(this, type, options)) {
            ret = false;
          }
        });
        return ret;
      }
  
      if (!(element instanceof HTMLElement)) {
        this.fatal('Passed element must be an instance of HTMLElement, got "@type" instead.', {
          '@type': typeof element,
        });
      }
  
      // Defer to the jQuery.simulate plugin, if it's available.
      if (typeof $.simulate === 'function') {
        new $.simulate(element, type, options);
        return true;
      }
  
      var event;
      var ctor;
      var types = [].concat(type);
      for (var i = 0, l = types.length; i < l; i++) {
        type = types[i];
        for (var name in this.eventMap) {
          if (this.eventMap[name].test(type)) {
            ctor = name;
            break;
          }
        }
        if (!ctor) {
          throw new SyntaxError('Only rudimentary HTMLEvents, KeyboardEvents and MouseEvents are supported: ' + type);
        }
        var opts = {bubbles: true, cancelable: true};
        if (ctor === 'KeyboardEvent' || ctor === 'MouseEvent') {
          $.extend(opts, {ctrlKey: !1, altKey: !1, shiftKey: !1, metaKey: !1});
        }
        if (ctor === 'MouseEvent') {
          $.extend(opts, {button: 0, pointerX: 0, pointerY: 0, view: window});
        }
        if (options) {
          $.extend(opts, options);
        }
        if (typeof window[ctor] === 'function') {
          event = new window[ctor](type, opts);
          if (!element.dispatchEvent(event)) {
            ret = false;
          }
        }
        else if (document.createEvent) {
          event = document.createEvent(ctor);
          event.initEvent(type, opts.bubbles, opts.cancelable);
          if (!element.dispatchEvent(event)) {
            ret = false;
          }
        }
        else if (typeof element.fireEvent === 'function') {
          event = $.extend(document.createEventObject(), opts);
          if (!element.fireEvent('on' + type, event)) {
            ret = false;
          }
        }
        else if (typeof element[type]) {
          element[type]();
        }
      }
      return ret;
    };
  
    /**
     * Strips HTML and returns just text.
     *
     * @param {String|Element|jQuery} html
     *   A string of HTML content, an Element DOM object or a jQuery object.
     *
     * @return {String}
     *   The text without HTML tags.
     *
     * @todo Replace with http://locutus.io/php/strings/strip_tags/
     */
    Bootstrap.stripHtml = function (html) {
      if (html instanceof $) {
        html = html.html();
      }
      else if (html instanceof Element) {
        html = html.innerHTML;
      }
      var tmp = document.createElement('DIV');
      tmp.innerHTML = html;
      return (tmp.textContent || tmp.innerText || '').replace(/^[\s\n\t]*|[\s\n\t]*$/, '');
    };
  
    /**
     * Provide a helper method for displaying when something is unsupported.
     *
     * @param {String} type
     *   The type of unsupported object, e.g. method or option.
     * @param {String} name
     *   The name of the unsupported object.
     * @param {*} [value]
     *   The value of the unsupported object.
     */
    Bootstrap.unsupported = function (type, name, value) {
      Bootstrap.warn('Unsupported by Drupal Bootstrap: (@type) @name -> @value', {
        '@type': type,
        '@name': name,
        '@value': typeof value === 'object' ? JSON.stringify(value) : value
      });
    };
  
    /**
     * Provide a helper method to display a warning.
     *
     * @param {String} message
     *   The message to display.
     * @param {Object} [args]
     *   Arguments to use as replacements in Drupal.formatString.
     */
    Bootstrap.warn = function (message, args) {
      if (this.settings.dev && console.warn) {
        console.warn(Drupal.formatString(message, args));
      }
    };
  
    /**
     * Wraps a plugin with common functionality.
     *
     * @param {Function} constructor
     *   A plugin constructor being wrapped.
     * @param {Object|Function} plugin
     *   The plugin being wrapped.
     * @param {Boolean} [extend = false]
     *   Whether to add super extensibility.
     */
    Bootstrap.wrapPluginConstructor = function (constructor, plugin, extend) {
      var proto = constructor.prototype;
  
      // Add a jQuery UI like option getter/setter method.
      var option = this.option;
      if (proto.option === void(0)) {
        proto.option = function () {
          return option.apply(this, arguments);
        };
      }
  
      if (extend) {
        // Handle prototype properties separately.
        if (plugin.prototype !== void 0) {
          for (var key in plugin.prototype) {
            if (!plugin.prototype.hasOwnProperty(key)) continue;
            var value = plugin.prototype[key];
            if (typeof value === 'function') {
              proto[key] = this.superWrapper(proto[key] || function () {}, value);
            }
            else {
              proto[key] = $.isPlainObject(value) ? $.extend(true, {}, proto[key], value) : value;
            }
          }
        }
        delete plugin.prototype;
  
        // Handle static properties.
        for (key in plugin) {
          if (!plugin.hasOwnProperty(key)) continue;
          value = plugin[key];
          if (typeof value === 'function') {
            constructor[key] = this.superWrapper(constructor[key] || function () {}, value);
          }
          else {
            constructor[key] = $.isPlainObject(value) ? $.extend(true, {}, constructor[key], value) : value;
          }
        }
      }
    };
  
    // Add Bootstrap to the global Drupal object.
    Drupal.bootstrap = Drupal.bootstrap || Bootstrap;
  
  })(window._, window.jQuery, window.Drupal, window.drupalSettings);
  ;
  (function ($, _) {
  
    /**
     * @class Attributes
     *
     * Modifies attributes.
     *
     * @param {Object|Attributes} attributes
     *   An object to initialize attributes with.
     */
    var Attributes = function (attributes) {
      this.data = {};
      this.data['class'] = [];
      this.merge(attributes);
    };
  
    /**
     * Renders the attributes object as a string to inject into an HTML element.
     *
     * @return {String}
     *   A rendered string suitable for inclusion in HTML markup.
     */
    Attributes.prototype.toString = function () {
      var output = '';
      var name, value;
      var checkPlain = function (str) {
        return str && str.toString().replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;') || '';
      };
      var data = this.getData();
      for (name in data) {
        if (!data.hasOwnProperty(name)) continue;
        value = data[name];
        if (_.isFunction(value)) value = value();
        if (_.isObject(value)) value = _.values(value);
        if (_.isArray(value)) value = value.join(' ');
        output += ' ' + checkPlain(name) + '="' + checkPlain(value) + '"';
      }
      return output;
    };
  
    /**
     * Renders the Attributes object as a plain object.
     *
     * @return {Object}
     *   A plain object suitable for inclusion in DOM elements.
     */
    Attributes.prototype.toPlainObject = function () {
      var object = {};
      var name, value;
      var data = this.getData();
      for (name in data) {
        if (!data.hasOwnProperty(name)) continue;
        value = data[name];
        if (_.isFunction(value)) value = value();
        if (_.isObject(value)) value = _.values(value);
        if (_.isArray(value)) value = value.join(' ');
        object[name] = value;
      }
      return object;
    };
  
    /**
     * Add class(es) to the array.
     *
     * @param {string|Array} value
     *   An individual class or an array of classes to add.
     *
     * @return {Attributes}
     *
     * @chainable
     */
    Attributes.prototype.addClass = function (value) {
      var args = Array.prototype.slice.call(arguments);
      this.data['class'] = this.sanitizeClasses(this.data['class'].concat(args));
      return this;
    };
  
    /**
     * Returns whether the requested attribute exists.
     *
     * @param {string} name
     *   An attribute name to check.
     *
     * @return {boolean}
     *   TRUE or FALSE
     */
    Attributes.prototype.exists = function (name) {
      return this.data[name] !== void(0) && this.data[name] !== null;
    };
  
    /**
     * Retrieve a specific attribute from the array.
     *
     * @param {string} name
     *   The specific attribute to retrieve.
     * @param {*} defaultValue
     *   (optional) The default value to set if the attribute does not exist.
     *
     * @return {*}
     *   A specific attribute value, passed by reference.
     */
    Attributes.prototype.get = function (name, defaultValue) {
      if (!this.exists(name)) this.data[name] = defaultValue;
      return this.data[name];
    };
  
    /**
     * Retrieves a cloned copy of the internal attributes data object.
     *
     * @return {Object}
     */
    Attributes.prototype.getData = function () {
      return _.extend({}, this.data);
    };
  
    /**
     * Retrieves classes from the array.
     *
     * @return {Array}
     *   The classes array.
     */
    Attributes.prototype.getClasses = function () {
      return this.get('class', []);
    };
  
    /**
     * Indicates whether a class is present in the array.
     *
     * @param {string|Array} className
     *   The class(es) to search for.
     *
     * @return {boolean}
     *   TRUE or FALSE
     */
    Attributes.prototype.hasClass = function (className) {
      className = this.sanitizeClasses(Array.prototype.slice.call(arguments));
      var classes = this.getClasses();
      for (var i = 0, l = className.length; i < l; i++) {
        // If one of the classes fails, immediately return false.
        if (_.indexOf(classes, className[i]) === -1) {
          return false;
        }
      }
      return true;
    };
  
    /**
     * Merges multiple values into the array.
     *
     * @param {Attributes|Node|jQuery|Object} object
     *   An Attributes object with existing data, a Node DOM element, a jQuery
     *   instance or a plain object where the key is the attribute name and the
     *   value is the attribute value.
     * @param {boolean} [recursive]
     *   Flag determining whether or not to recursively merge key/value pairs.
     *
     * @return {Attributes}
     *
     * @chainable
     */
    Attributes.prototype.merge = function (object, recursive) {
      // Immediately return if there is nothing to merge.
      if (!object) {
        return this;
      }
  
      // Get attributes from a jQuery element.
      if (object instanceof $) {
        object = object[0];
      }
  
      // Get attributes from a DOM element.
      if (object instanceof Node) {
        object = Array.prototype.slice.call(object.attributes).reduce(function (attributes, attribute) {
          attributes[attribute.name] = attribute.value;
          return attributes;
        }, {});
      }
      // Get attributes from an Attributes instance.
      else if (object instanceof Attributes) {
        object = object.getData();
      }
      // Otherwise, clone the object.
      else {
        object = _.extend({}, object);
      }
  
      // By this point, there should be a valid plain object.
      if (!$.isPlainObject(object)) {
        setTimeout(function () {
          throw new Error('Passed object is not supported: ' + object);
        });
        return this;
      }
  
      // Handle classes separately.
      if (object && object['class'] !== void 0) {
        this.addClass(object['class']);
        delete object['class'];
      }
  
      if (recursive === void 0 || recursive) {
        this.data = $.extend(true, {}, this.data, object);
      }
      else {
        this.data = $.extend({}, this.data, object);
      }
  
      return this;
    };
  
    /**
     * Removes an attribute from the array.
     *
     * @param {string} name
     *   The name of the attribute to remove.
     *
     * @return {Attributes}
     *
     * @chainable
     */
    Attributes.prototype.remove = function (name) {
      if (this.exists(name)) delete this.data[name];
      return this;
    };
  
    /**
     * Removes a class from the attributes array.
     *
     * @param {...string|Array} className
     *   An individual class or an array of classes to remove.
     *
     * @return {Attributes}
     *
     * @chainable
     */
    Attributes.prototype.removeClass = function (className) {
      var remove = this.sanitizeClasses(Array.prototype.slice.apply(arguments));
      this.data['class'] = _.without(this.getClasses(), remove);
      return this;
    };
  
    /**
     * Replaces a class in the attributes array.
     *
     * @param {string} oldValue
     *   The old class to remove.
     * @param {string} newValue
     *   The new class. It will not be added if the old class does not exist.
     *
     * @return {Attributes}
     *
     * @chainable
     */
    Attributes.prototype.replaceClass = function (oldValue, newValue) {
      var classes = this.getClasses();
      var i = _.indexOf(this.sanitizeClasses(oldValue), classes);
      if (i >= 0) {
        classes[i] = newValue;
        this.set('class', classes);
      }
      return this;
    };
  
    /**
     * Ensures classes are flattened into a single is an array and sanitized.
     *
     * @param {...String|Array} classes
     *   The class or classes to sanitize.
     *
     * @return {Array}
     *   A sanitized array of classes.
     */
    Attributes.prototype.sanitizeClasses = function (classes) {
      return _.chain(Array.prototype.slice.call(arguments))
        // Flatten in case there's a mix of strings and arrays.
        .flatten()
  
        // Split classes that may have been added with a space as a separator.
        .map(function (string) {
          return string.split(' ');
        })
  
        // Flatten again since it was just split into arrays.
        .flatten()
  
        // Filter out empty items.
        .filter()
  
        // Clean the class to ensure it's a valid class name.
        .map(function (value) {
          return Attributes.cleanClass(value);
        })
  
        // Ensure classes are unique.
        .uniq()
  
        // Retrieve the final value.
        .value();
    };
  
    /**
     * Sets an attribute on the array.
     *
     * @param {string} name
     *   The name of the attribute to set.
     * @param {*} value
     *   The value of the attribute to set.
     *
     * @return {Attributes}
     *
     * @chainable
     */
    Attributes.prototype.set = function (name, value) {
      var obj = $.isPlainObject(name) ? name : {};
      if (typeof name === 'string') {
        obj[name] = value;
      }
      return this.merge(obj);
    };
  
    /**
     * Prepares a string for use as a CSS identifier (element, class, or ID name).
     *
     * Note: this is essentially a direct copy from
     * \Drupal\Component\Utility\Html::cleanCssIdentifier
     *
     * @param {string} identifier
     *   The identifier to clean.
     * @param {Object} [filter]
     *   An object of string replacements to use on the identifier.
     *
     * @return {string}
     *   The cleaned identifier.
     */
    Attributes.cleanClass = function (identifier, filter) {
      filter = filter || {
        ' ': '-',
        '_': '-',
        '/': '-',
        '[': '-',
        ']': ''
      };
  
      identifier = identifier.toLowerCase();
  
      if (filter['__'] === void 0) {
        identifier = identifier.replace('__', '#DOUBLE_UNDERSCORE#');
      }
  
      identifier = identifier.replace(Object.keys(filter), Object.keys(filter).map(function(key) { return filter[key]; }));
  
      if (filter['__'] === void 0) {
        identifier = identifier.replace('#DOUBLE_UNDERSCORE#', '__');
      }
  
      identifier = identifier.replace(/[^\u002D\u0030-\u0039\u0041-\u005A\u005F\u0061-\u007A\u00A1-\uFFFF]/g, '');
      identifier = identifier.replace(['/^[0-9]/', '/^(-[0-9])|^(--)/'], ['_', '__']);
  
      return identifier;
    };
  
    /**
     * Creates an Attributes instance.
     *
     * @param {object|Attributes} [attributes]
     *   An object to initialize attributes with.
     *
     * @return {Attributes}
     *   An Attributes instance.
     *
     * @constructor
     */
    Attributes.create = function (attributes) {
      return new Attributes(attributes);
    };
  
    window.Attributes = Attributes;
  
  })(window.jQuery, window._);
  ;
  /**
   * @file
   * Theme hooks for the Drupal Bootstrap base theme.
   */
  (function ($, Drupal, Bootstrap, Attributes) {
  
    /**
     * Fallback for theming an icon if the Icon API module is not installed.
     */
    if (!Drupal.icon) Drupal.icon = { bundles: {} };
    if (!Drupal.theme.icon || Drupal.theme.prototype.icon) {
      $.extend(Drupal.theme, /** @lends Drupal.theme */ {
        /**
         * Renders an icon.
         *
         * @param {string} bundle
         *   The bundle which the icon belongs to.
         * @param {string} icon
         *   The name of the icon to render.
         * @param {object|Attributes} [attributes]
         *   An object of attributes to also apply to the icon.
         *
         * @returns {string}
         */
        icon: function (bundle, icon, attributes) {
          if (!Drupal.icon.bundles[bundle]) return '';
          attributes = Attributes.create(attributes).addClass('icon').set('aria-hidden', 'true');
          icon = Drupal.icon.bundles[bundle](icon, attributes);
          return '<span' + attributes + '></span>';
        }
      });
    }
  
    /**
     * Callback for modifying an icon in the "bootstrap" icon bundle.
     *
     * @param {string} icon
     *   The icon being rendered.
     * @param {Attributes} attributes
     *   Attributes object for the icon.
     */
    Drupal.icon.bundles.bootstrap = function (icon, attributes) {
      attributes.addClass(['glyphicon', 'glyphicon-' + icon]);
    };
  
    /**
     * Add necessary theming hooks.
     */
    $.extend(Drupal.theme, /** @lends Drupal.theme */ {
  
      /**
       * Renders a Bootstrap AJAX glyphicon throbber.
       *
       * @returns {string}
       */
      ajaxThrobber: function () {
        return Drupal.theme('bootstrapIcon', 'refresh', {'class': ['ajax-throbber', 'glyphicon-spin'] });
      },
  
      /**
       * Renders a button element.
       *
       * @param {object|Attributes} attributes
       *   An object of attributes to apply to the button. If it contains one of:
       *   - value: The label of the button.
       *   - context: The context type of Bootstrap button, can be one of:
       *     - default
       *     - primary
       *     - success
       *     - info
       *     - warning
       *     - danger
       *     - link
       *
       * @returns {string}
       */
      button: function (attributes) {
        attributes = Attributes.create(attributes).addClass('btn');
        var context = attributes.get('context', 'default');
        var label = attributes.get('value', '');
        attributes.remove('context').remove('value');
        if (!attributes.hasClass(['btn-default', 'btn-primary', 'btn-success', 'btn-info', 'btn-warning', 'btn-danger', 'btn-link'])) {
          attributes.addClass('btn-' + Bootstrap.checkPlain(context));
        }
  
        // Attempt to, intelligently, provide a default button "type".
        if (!attributes.exists('type')) {
          attributes.set('type', attributes.hasClass('form-submit') ? 'submit' : 'button');
        }
  
        return '<button' + attributes + '>' + label + '</button>';
      },
  
      /**
       * Alias for "button" theme hook.
       *
       * @param {object|Attributes} attributes
       *   An object of attributes to apply to the button.
       *
       * @see Drupal.theme.button()
       *
       * @returns {string}
       */
      btn: function (attributes) {
        return Drupal.theme('button', attributes);
      },
  
      /**
       * Renders a button block element.
       *
       * @param {object|Attributes} attributes
       *   An object of attributes to apply to the button.
       *
       * @see Drupal.theme.button()
       *
       * @returns {string}
       */
      'btn-block': function (attributes) {
        return Drupal.theme('button', Attributes.create(attributes).addClass('btn-block'));
      },
  
      /**
       * Renders a large button element.
       *
       * @param {object|Attributes} attributes
       *   An object of attributes to apply to the button.
       *
       * @see Drupal.theme.button()
       *
       * @returns {string}
       */
      'btn-lg': function (attributes) {
        return Drupal.theme('button', Attributes.create(attributes).addClass('btn-lg'));
      },
  
      /**
       * Renders a small button element.
       *
       * @param {object|Attributes} attributes
       *   An object of attributes to apply to the button.
       *
       * @see Drupal.theme.button()
       *
       * @returns {string}
       */
      'btn-sm': function (attributes) {
        return Drupal.theme('button', Attributes.create(attributes).addClass('btn-sm'));
      },
  
      /**
       * Renders an extra small button element.
       *
       * @param {object|Attributes} attributes
       *   An object of attributes to apply to the button.
       *
       * @see Drupal.theme.button()
       *
       * @returns {string}
       */
      'btn-xs': function (attributes) {
        return Drupal.theme('button', Attributes.create(attributes).addClass('btn-xs'));
      },
  
      /**
       * Renders a glyphicon.
       *
       * @param {string} name
       *   The name of the glyphicon.
       * @param {object|Attributes} [attributes]
       *   An object of attributes to apply to the icon.
       *
       * @returns {string}
       */
      bootstrapIcon: function (name, attributes) {
        return Drupal.theme('icon', 'bootstrap', name, attributes);
      }
  
    });
  
  })(window.jQuery, window.Drupal, window.Drupal.bootstrap, window.Attributes);
  ;
  /**
   * @file
   * Bootstrap Popovers.
   */
  
  var Drupal = Drupal || {};
  
  (function ($, Drupal, Bootstrap) {
    "use strict";
  
    var $document = $(document);
  
    /**
     * Extend the Bootstrap Popover plugin constructor class.
     */
    Bootstrap.extendPlugin('popover', function (settings) {
      return {
        DEFAULTS: {
          animation: !!settings.popover_animation,
          autoClose: !!settings.popover_auto_close,
          enabled: settings.popover_enabled,
          html: !!settings.popover_html,
          placement: settings.popover_placement,
          selector: settings.popover_selector,
          trigger: settings.popover_trigger,
          title: settings.popover_title,
          content: settings.popover_content,
          delay: parseInt(settings.popover_delay, 10),
          container: settings.popover_container
        }
      };
    });
  
    /**
     * Bootstrap Popovers.
     *
     * @todo This should really be properly delegated if selector option is set.
     */
    Drupal.behaviors.bootstrapPopovers = {
      $activePopover: null,
      attach: function (context) {
        // Immediately return if popovers are not available.
        if (!$.fn.popover || !$.fn.popover.Constructor.DEFAULTS.enabled) {
          return;
        }
  
        var _this = this;
  
        $document
          .on('show.bs.popover', '[data-toggle=popover]', function () {
            var $trigger = $(this);
            var popover = $trigger.data('bs.popover');
  
            // Only keep track of clicked triggers that we're manually handling.
            if (popover.options.originalTrigger === 'click') {
              if (_this.$activePopover && _this.getOption('autoClose') && !_this.$activePopover.is($trigger)) {
                _this.$activePopover.popover('hide');
              }
              _this.$activePopover = $trigger;
            }
          })
          // Unfortunately, :focusable is only made available when using jQuery
          // UI. While this would be the most semantic pseudo selector to use
          // here, jQuery UI may not always be loaded. Instead, just use :visible
          // here as this just needs some sort of selector here. This activates
          // delegate binding to elements in jQuery so it can work it's bubbling
          // focus magic since elements don't really propagate their focus events.
          // @see https://www.drupal.org/project/bootstrap/issues/3013236
          .on('focus.bs.popover', ':visible', function (e) {
            var $target = $(e.target);
            if (_this.$activePopover && _this.getOption('autoClose') && !_this.$activePopover.is($target) && !$target.closest('.popover.in')[0]) {
              _this.$activePopover.popover('hide');
              _this.$activePopover = null;
            }
          })
          .on('click.bs.popover', function (e) {
            var $target = $(e.target);
            if (_this.$activePopover && _this.getOption('autoClose') && !$target.is('[data-toggle=popover]') && !$target.closest('.popover.in')[0]) {
              _this.$activePopover.popover('hide');
              _this.$activePopover = null;
            }
          })
          .on('keyup.bs.popover', function (e) {
            if (_this.$activePopover && _this.getOption('autoClose') && e.which === 27) {
              _this.$activePopover.popover('hide');
              _this.$activePopover = null;
            }
          })
        ;
  
        var elements = $(context).find('[data-toggle=popover]').toArray();
        for (var i = 0; i < elements.length; i++) {
          var $element = $(elements[i]);
          var options = $.extend({}, $.fn.popover.Constructor.DEFAULTS, $element.data());
  
          // Store the original trigger.
          options.originalTrigger = options.trigger;
  
          // If the trigger is "click", then we'll handle it manually here.
          if (options.trigger === 'click') {
            options.trigger = 'manual';
          }
  
          // Retrieve content from a target element.
          var target = options.target || $element.is('a[href^="#"]') && $element.attr('href');
          var $target = $document.find(target).clone();
          if (!options.content && $target[0]) {
            $target.removeClass('visually-hidden hidden').removeAttr('aria-hidden');
            options.content = $target.wrap('<div/>').parent()[options.html ? 'html' : 'text']() || '';
          }
  
          // Initialize the popover.
          $element.popover(options);
  
          // Handle clicks manually.
          if (options.originalTrigger === 'click') {
            // To ensure the element is bound multiple times, remove any
            // previously set event handler before adding another one.
            $element
              .off('click.drupal.bootstrap.popover')
              .on('click.drupal.bootstrap.popover', function (e) {
                $(this).popover('toggle');
                e.preventDefault();
                e.stopPropagation();
              })
            ;
          }
        }
      },
      detach: function (context) {
        // Immediately return if popovers are not available.
        if (!$.fn.popover || !$.fn.popover.Constructor.DEFAULTS.enabled) {
          return;
        }
  
        // Destroy all popovers.
        $(context).find('[data-toggle="popover"]')
          .off('click.drupal.bootstrap.popover')
          .popover('destroy')
        ;
      },
      getOption: function(name, defaultValue, element) {
        var $element = element ? $(element) : this.$activePopover;
        var options = $.extend(true, {}, $.fn.popover.Constructor.DEFAULTS, ($element && $element.data('bs.popover') || {}).options);
        if (options[name] !== void 0) {
          return options[name];
        }
        return defaultValue !== void 0 ? defaultValue : void 0;
      }
    };
  
  })(window.jQuery, window.Drupal, window.Drupal.bootstrap);
  ;
  /**
   * @file
   * Bootstrap Tooltips.
   */
  
  var Drupal = Drupal || {};
  
  (function ($, Drupal, Bootstrap) {
    "use strict";
  
    /**
     * Extend the Bootstrap Tooltip plugin constructor class.
     */
    Bootstrap.extendPlugin('tooltip', function (settings) {
      return {
        DEFAULTS: {
          animation: !!settings.tooltip_animation,
          enabled: settings.tooltip_enabled,
          html: !!settings.tooltip_html,
          placement: settings.tooltip_placement,
          selector: settings.tooltip_selector,
          trigger: settings.tooltip_trigger,
          delay: parseInt(settings.tooltip_delay, 10),
          container: settings.tooltip_container
        }
      };
    });
  
    /**
     * Bootstrap Tooltips.
     *
     * @todo This should really be properly delegated if selector option is set.
     */
    Drupal.behaviors.bootstrapTooltips = {
      attach: function (context) {
        // Immediately return if tooltips are not available.
        if (!$.fn.tooltip || !$.fn.tooltip.Constructor.DEFAULTS.enabled) {
          return;
        }
  
        var elements = $(context).find('[data-toggle="tooltip"]').toArray();
        for (var i = 0; i < elements.length; i++) {
          var $element = $(elements[i]);
          var options = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, $element.data());
          $element.tooltip(options);
        }
      },
      detach: function (context) {
        // Immediately return if tooltips are not available.
        if (!$.fn.tooltip || !$.fn.tooltip.Constructor.DEFAULTS.enabled) {
          return;
        }
  
        // Destroy all tooltips.
        $(context).find('[data-toggle="tooltip"]').tooltip('destroy');
      }
    };
  
  })(window.jQuery, window.Drupal, window.Drupal.bootstrap);
  ;
  /**
  * DO NOT EDIT THIS FILE.
  * See the following change record for more information,
  * https://www.drupal.org/node/2815083
  * @preserve
  **/
  
  (function ($, Drupal) {
    Drupal.theme.progressBar = function (id) {
      return "<div id=\"".concat(id, "\" class=\"progress\" aria-live=\"polite\">") + '<div class="progress__label">&nbsp;</div>' + '<div class="progress__track"><div class="progress__bar"></div></div>' + '<div class="progress__percentage"></div>' + '<div class="progress__description">&nbsp;</div>' + '</div>';
    };
  
    Drupal.ProgressBar = function (id, updateCallback, method, errorCallback) {
      this.id = id;
      this.method = method || 'GET';
      this.updateCallback = updateCallback;
      this.errorCallback = errorCallback;
      this.element = $(Drupal.theme('progressBar', id));
    };
  
    $.extend(Drupal.ProgressBar.prototype, {
      setProgress: function setProgress(percentage, message, label) {
        if (percentage >= 0 && percentage <= 100) {
          $(this.element).find('div.progress__bar').css('width', "".concat(percentage, "%"));
          $(this.element).find('div.progress__percentage').html("".concat(percentage, "%"));
        }
  
        $('div.progress__description', this.element).html(message);
        $('div.progress__label', this.element).html(label);
  
        if (this.updateCallback) {
          this.updateCallback(percentage, message, this);
        }
      },
      startMonitoring: function startMonitoring(uri, delay) {
        this.delay = delay;
        this.uri = uri;
        this.sendPing();
      },
      stopMonitoring: function stopMonitoring() {
        clearTimeout(this.timer);
        this.uri = null;
      },
      sendPing: function sendPing() {
        if (this.timer) {
          clearTimeout(this.timer);
        }
  
        if (this.uri) {
          var pb = this;
          var uri = this.uri;
  
          if (uri.indexOf('?') === -1) {
            uri += '?';
          } else {
            uri += '&';
          }
  
          uri += '_format=json';
          $.ajax({
            type: this.method,
            url: uri,
            data: '',
            dataType: 'json',
            success: function success(progress) {
              if (progress.status === 0) {
                pb.displayError(progress.data);
                return;
              }
  
              pb.setProgress(progress.percentage, progress.message, progress.label);
              pb.timer = setTimeout(function () {
                pb.sendPing();
              }, pb.delay);
            },
            error: function error(xmlhttp) {
              var e = new Drupal.AjaxError(xmlhttp, pb.uri);
              pb.displayError("<pre>".concat(e.message, "</pre>"));
            }
          });
        }
      },
      displayError: function displayError(string) {
        var error = $('<div class="messages messages--error"></div>').html(string);
        $(this.element).before(error).hide();
  
        if (this.errorCallback) {
          this.errorCallback(this);
        }
      }
    });
  })(jQuery, Drupal);;
  /**
   * @file
   * Extends methods from core/misc/progress.js.
   */
  
  (function ($, Drupal) {
  
    'use strict';
  
    /**
     * Theme function for the progress bar.
     *
     * @param {string} id
     *
     * @return {string}
     *   The HTML for the progress bar.
     */
    Drupal.theme.progressBar = function (id) {
      return '<div class="progress-wrapper" aria-live="polite">' +
               '<div class="message"></div>'+
               '<div id ="' + id + '" class="progress progress-striped active">' +
                 '<div class="progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">' +
                   '<span class="percentage"></span>' +
                 '</div>' +
               '</div>' +
               '<div class="progress-label"></div>' +
             '</div>';
    };
  
    $.extend(Drupal.ProgressBar.prototype, /** @lends Drupal.ProgressBar */{
  
      /**
       * Set the percentage and status message for the progressbar.
       *
       * @param {number} percentage
       * @param {string} message
       * @param {string} label
       */
      setProgress: function (percentage, message, label) {
        if (percentage >= 0 && percentage <= 100) {
          $(this.element).find('.progress-bar').css('width', percentage + '%').attr('aria-valuenow', percentage);
          $(this.element).find('.percentage').html(percentage + '%');
        }
        if (message) {
          // Remove the unnecessary whitespace at the end of the message.
          message = message.replace(/<br\/>&nbsp;|\s*$/, '');
  
          $('.message', this.element).html(message);
        }
        if (label) {
          $('.progress-label', this.element).html(label);
        }
        if (this.updateCallback) {
          this.updateCallback(percentage, message, this);
        }
      },
  
      /**
       * Display errors on the page.
       *
       * @param {string} string
       */
      displayError: function (string) {
        var error = $('<div class="alert alert-block alert-error"><button class="close" data-dismiss="alert">&times;</button><h4>' + Drupal.t('Error message') + '</h4></div>').append(string);
        $(this.element).before(error).hide();
  
        if (this.errorCallback) {
          this.errorCallback(this);
        }
      }
    });
  
  })(jQuery, Drupal);
  ;
  /**
  * DO NOT EDIT THIS FILE.
  * See the following change record for more information,
  * https://www.drupal.org/node/2815083
  * @preserve
  **/
  
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _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(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
  
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
  
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  
  (function ($, window, Drupal, drupalSettings, _ref) {
    var isFocusable = _ref.isFocusable,
        tabbable = _ref.tabbable;
    Drupal.behaviors.AJAX = {
      attach: function attach(context, settings) {
        function loadAjaxBehavior(base) {
          var elementSettings = settings.ajax[base];
  
          if (typeof elementSettings.selector === 'undefined') {
            elementSettings.selector = "#".concat(base);
          }
  
          $(elementSettings.selector).once('drupal-ajax').each(function () {
            elementSettings.element = this;
            elementSettings.base = base;
            Drupal.ajax(elementSettings);
          });
        }
  
        Object.keys(settings.ajax || {}).forEach(function (base) {
          return loadAjaxBehavior(base);
        });
        Drupal.ajax.bindAjaxLinks(document.body);
        $('.use-ajax-submit').once('ajax').each(function () {
          var elementSettings = {};
          elementSettings.url = $(this.form).attr('action');
          elementSettings.setClick = true;
          elementSettings.event = 'click';
          elementSettings.progress = {
            type: 'throbber'
          };
          elementSettings.base = $(this).attr('id');
          elementSettings.element = this;
          Drupal.ajax(elementSettings);
        });
      },
      detach: function detach(context, settings, trigger) {
        if (trigger === 'unload') {
          Drupal.ajax.expired().forEach(function (instance) {
            Drupal.ajax.instances[instance.instanceIndex] = null;
          });
        }
      }
    };
  
    Drupal.AjaxError = function (xmlhttp, uri, customMessage) {
      var statusCode;
      var statusText;
      var responseText;
  
      if (xmlhttp.status) {
        statusCode = "\n".concat(Drupal.t('An AJAX HTTP error occurred.'), "\n").concat(Drupal.t('HTTP Result Code: !status', {
          '!status': xmlhttp.status
        }));
      } else {
        statusCode = "\n".concat(Drupal.t('An AJAX HTTP request terminated abnormally.'));
      }
  
      statusCode += "\n".concat(Drupal.t('Debugging information follows.'));
      var pathText = "\n".concat(Drupal.t('Path: !uri', {
        '!uri': uri
      }));
      statusText = '';
  
      try {
        statusText = "\n".concat(Drupal.t('StatusText: !statusText', {
          '!statusText': $.trim(xmlhttp.statusText)
        }));
      } catch (e) {}
  
      responseText = '';
  
      try {
        responseText = "\n".concat(Drupal.t('ResponseText: !responseText', {
          '!responseText': $.trim(xmlhttp.responseText)
        }));
      } catch (e) {}
  
      responseText = responseText.replace(/<("[^"]*"|'[^']*'|[^'">])*>/gi, '');
      responseText = responseText.replace(/[\n]+\s+/g, '\n');
      var readyStateText = xmlhttp.status === 0 ? "\n".concat(Drupal.t('ReadyState: !readyState', {
        '!readyState': xmlhttp.readyState
      })) : '';
      customMessage = customMessage ? "\n".concat(Drupal.t('CustomMessage: !customMessage', {
        '!customMessage': customMessage
      })) : '';
      this.message = statusCode + pathText + statusText + customMessage + responseText + readyStateText;
      this.name = 'AjaxError';
    };
  
    Drupal.AjaxError.prototype = new Error();
    Drupal.AjaxError.prototype.constructor = Drupal.AjaxError;
  
    Drupal.ajax = function (settings) {
      if (arguments.length !== 1) {
        throw new Error('Drupal.ajax() function must be called with one configuration object only');
      }
  
      var base = settings.base || false;
      var element = settings.element || false;
      delete settings.base;
      delete settings.element;
  
      if (!settings.progress && !element) {
        settings.progress = false;
      }
  
      var ajax = new Drupal.Ajax(base, element, settings);
      ajax.instanceIndex = Drupal.ajax.instances.length;
      Drupal.ajax.instances.push(ajax);
      return ajax;
    };
  
    Drupal.ajax.instances = [];
  
    Drupal.ajax.expired = function () {
      return Drupal.ajax.instances.filter(function (instance) {
        return instance && instance.element !== false && !document.body.contains(instance.element);
      });
    };
  
    Drupal.ajax.bindAjaxLinks = function (element) {
      $(element).find('.use-ajax').once('ajax').each(function (i, ajaxLink) {
        var $linkElement = $(ajaxLink);
        var elementSettings = {
          progress: {
            type: 'throbber'
          },
          dialogType: $linkElement.data('dialog-type'),
          dialog: $linkElement.data('dialog-options'),
          dialogRenderer: $linkElement.data('dialog-renderer'),
          base: $linkElement.attr('id'),
          element: ajaxLink
        };
        var href = $linkElement.attr('href');
  
        if (href) {
          elementSettings.url = href;
          elementSettings.event = 'click';
        }
  
        Drupal.ajax(elementSettings);
      });
    };
  
    Drupal.Ajax = function (base, element, elementSettings) {
      var defaults = {
        event: element ? 'mousedown' : null,
        keypress: true,
        selector: base ? "#".concat(base) : null,
        effect: 'none',
        speed: 'none',
        method: 'replaceWith',
        progress: {
          type: 'throbber',
          message: Drupal.t('Please wait...')
        },
        submit: {
          js: true
        }
      };
      $.extend(this, defaults, elementSettings);
      this.commands = new Drupal.AjaxCommands();
      this.instanceIndex = false;
  
      if (this.wrapper) {
        this.wrapper = "#".concat(this.wrapper);
      }
  
      this.element = element;
      this.element_settings = elementSettings;
      this.elementSettings = elementSettings;
  
      if (this.element && this.element.form) {
        this.$form = $(this.element.form);
      }
  
      if (!this.url) {
        var $element = $(this.element);
  
        if ($element.is('a')) {
          this.url = $element.attr('href');
        } else if (this.element && element.form) {
          this.url = this.$form.attr('action');
        }
      }
  
      var originalUrl = this.url;
      this.url = this.url.replace(/\/nojs(\/|$|\?|#)/, '/ajax$1');
  
      if (drupalSettings.ajaxTrustedUrl[originalUrl]) {
        drupalSettings.ajaxTrustedUrl[this.url] = true;
      }
  
      var ajax = this;
      ajax.options = {
        url: ajax.url,
        data: ajax.submit,
        beforeSerialize: function beforeSerialize(elementSettings, options) {
          return ajax.beforeSerialize(elementSettings, options);
        },
        beforeSubmit: function beforeSubmit(formValues, elementSettings, options) {
          ajax.ajaxing = true;
          return ajax.beforeSubmit(formValues, elementSettings, options);
        },
        beforeSend: function beforeSend(xmlhttprequest, options) {
          ajax.ajaxing = true;
          return ajax.beforeSend(xmlhttprequest, options);
        },
        success: function success(response, status, xmlhttprequest) {
          if (typeof response === 'string') {
            response = $.parseJSON(response);
          }
  
          if (response !== null && !drupalSettings.ajaxTrustedUrl[ajax.url]) {
            if (xmlhttprequest.getResponseHeader('X-Drupal-Ajax-Token') !== '1') {
              var customMessage = Drupal.t('The response failed verification so will not be processed.');
              return ajax.error(xmlhttprequest, ajax.url, customMessage);
            }
          }
  
          return ajax.success(response, status);
        },
        complete: function complete(xmlhttprequest, status) {
          ajax.ajaxing = false;
  
          if (status === 'error' || status === 'parsererror') {
            return ajax.error(xmlhttprequest, ajax.url);
          }
        },
        dataType: 'json',
        jsonp: false,
        type: 'POST'
      };
  
      if (elementSettings.dialog) {
        ajax.options.data.dialogOptions = elementSettings.dialog;
      }
  
      if (ajax.options.url.indexOf('?') === -1) {
        ajax.options.url += '?';
      } else {
        ajax.options.url += '&';
      }
  
      var wrapper = "drupal_".concat(elementSettings.dialogType || 'ajax');
  
      if (elementSettings.dialogRenderer) {
        wrapper += ".".concat(elementSettings.dialogRenderer);
      }
  
      ajax.options.url += "".concat(Drupal.ajax.WRAPPER_FORMAT, "=").concat(wrapper);
      $(ajax.element).on(elementSettings.event, function (event) {
        if (!drupalSettings.ajaxTrustedUrl[ajax.url] && !Drupal.url.isLocal(ajax.url)) {
          throw new Error(Drupal.t('The callback URL is not local and not trusted: !url', {
            '!url': ajax.url
          }));
        }
  
        return ajax.eventResponse(this, event);
      });
  
      if (elementSettings.keypress) {
        $(ajax.element).on('keypress', function (event) {
          return ajax.keypressResponse(this, event);
        });
      }
  
      if (elementSettings.prevent) {
        $(ajax.element).on(elementSettings.prevent, false);
      }
    };
  
    Drupal.ajax.WRAPPER_FORMAT = '_wrapper_format';
    Drupal.Ajax.AJAX_REQUEST_PARAMETER = '_drupal_ajax';
  
    Drupal.Ajax.prototype.execute = function () {
      if (this.ajaxing) {
        return;
      }
  
      try {
        this.beforeSerialize(this.element, this.options);
        return $.ajax(this.options);
      } catch (e) {
        this.ajaxing = false;
        window.alert("An error occurred while attempting to process ".concat(this.options.url, ": ").concat(e.message));
        return $.Deferred().reject();
      }
    };
  
    Drupal.Ajax.prototype.keypressResponse = function (element, event) {
      var ajax = this;
  
      if (event.which === 13 || event.which === 32 && element.type !== 'text' && element.type !== 'textarea' && element.type !== 'tel' && element.type !== 'number') {
        event.preventDefault();
        event.stopPropagation();
        $(element).trigger(ajax.elementSettings.event);
      }
    };
  
    Drupal.Ajax.prototype.eventResponse = function (element, event) {
      event.preventDefault();
      event.stopPropagation();
      var ajax = this;
  
      if (ajax.ajaxing) {
        return;
      }
  
      try {
        if (ajax.$form) {
          if (ajax.setClick) {
            element.form.clk = element;
          }
  
          ajax.$form.ajaxSubmit(ajax.options);
        } else {
          ajax.beforeSerialize(ajax.element, ajax.options);
          $.ajax(ajax.options);
        }
      } catch (e) {
        ajax.ajaxing = false;
        window.alert("An error occurred while attempting to process ".concat(ajax.options.url, ": ").concat(e.message));
      }
    };
  
    Drupal.Ajax.prototype.beforeSerialize = function (element, options) {
      if (this.$form && document.body.contains(this.$form.get(0))) {
        var settings = this.settings || drupalSettings;
        Drupal.detachBehaviors(this.$form.get(0), settings, 'serialize');
      }
  
      options.data[Drupal.Ajax.AJAX_REQUEST_PARAMETER] = 1;
      var pageState = drupalSettings.ajaxPageState;
      options.data['ajax_page_state[theme]'] = pageState.theme;
      options.data['ajax_page_state[theme_token]'] = pageState.theme_token;
      options.data['ajax_page_state[libraries]'] = pageState.libraries;
    };
  
    Drupal.Ajax.prototype.beforeSubmit = function (formValues, element, options) {};
  
    Drupal.Ajax.prototype.beforeSend = function (xmlhttprequest, options) {
      if (this.$form) {
        options.extraData = options.extraData || {};
        options.extraData.ajax_iframe_upload = '1';
        var v = $.fieldValue(this.element);
  
        if (v !== null) {
          options.extraData[this.element.name] = v;
        }
      }
  
      $(this.element).prop('disabled', true);
  
      if (!this.progress || !this.progress.type) {
        return;
      }
  
      var progressIndicatorMethod = "setProgressIndicator".concat(this.progress.type.slice(0, 1).toUpperCase()).concat(this.progress.type.slice(1).toLowerCase());
  
      if (progressIndicatorMethod in this && typeof this[progressIndicatorMethod] === 'function') {
        this[progressIndicatorMethod].call(this);
      }
    };
  
    Drupal.theme.ajaxProgressThrobber = function (message) {
      var messageMarkup = typeof message === 'string' ? Drupal.theme('ajaxProgressMessage', message) : '';
      var throbber = '<div class="throbber">&nbsp;</div>';
      return "<div class=\"ajax-progress ajax-progress-throbber\">".concat(throbber).concat(messageMarkup, "</div>");
    };
  
    Drupal.theme.ajaxProgressIndicatorFullscreen = function () {
      return '<div class="ajax-progress ajax-progress-fullscreen">&nbsp;</div>';
    };
  
    Drupal.theme.ajaxProgressMessage = function (message) {
      return "<div class=\"message\">".concat(message, "</div>");
    };
  
    Drupal.theme.ajaxProgressBar = function ($element) {
      return $('<div class="ajax-progress ajax-progress-bar"></div>').append($element);
    };
  
    Drupal.Ajax.prototype.setProgressIndicatorBar = function () {
      var progressBar = new Drupal.ProgressBar("ajax-progress-".concat(this.element.id), $.noop, this.progress.method, $.noop);
  
      if (this.progress.message) {
        progressBar.setProgress(-1, this.progress.message);
      }
  
      if (this.progress.url) {
        progressBar.startMonitoring(this.progress.url, this.progress.interval || 1500);
      }
  
      this.progress.element = $(Drupal.theme('ajaxProgressBar', progressBar.element));
      this.progress.object = progressBar;
      $(this.element).after(this.progress.element);
    };
  
    Drupal.Ajax.prototype.setProgressIndicatorThrobber = function () {
      this.progress.element = $(Drupal.theme('ajaxProgressThrobber', this.progress.message));
      $(this.element).after(this.progress.element);
    };
  
    Drupal.Ajax.prototype.setProgressIndicatorFullscreen = function () {
      this.progress.element = $(Drupal.theme('ajaxProgressIndicatorFullscreen'));
      $('body').append(this.progress.element);
    };
  
    Drupal.Ajax.prototype.success = function (response, status) {
      var _this = this;
  
      if (this.progress.element) {
        $(this.progress.element).remove();
      }
  
      if (this.progress.object) {
        this.progress.object.stopMonitoring();
      }
  
      $(this.element).prop('disabled', false);
      var elementParents = $(this.element).parents('[data-drupal-selector]').addBack().toArray();
      var focusChanged = false;
      Object.keys(response || {}).forEach(function (i) {
        if (response[i].command && _this.commands[response[i].command]) {
          _this.commands[response[i].command](_this, response[i], status);
  
          if (response[i].command === 'invoke' && response[i].method === 'focus' || response[i].command === 'focusFirst') {
            focusChanged = true;
          }
        }
      });
  
      if (!focusChanged && this.element && !$(this.element).data('disable-refocus')) {
        var target = false;
  
        for (var n = elementParents.length - 1; !target && n >= 0; n--) {
          target = document.querySelector("[data-drupal-selector=\"".concat(elementParents[n].getAttribute('data-drupal-selector'), "\"]"));
        }
  
        if (target) {
          $(target).trigger('focus');
        }
      }
  
      if (this.$form && document.body.contains(this.$form.get(0))) {
        var settings = this.settings || drupalSettings;
        Drupal.attachBehaviors(this.$form.get(0), settings);
      }
  
      this.settings = null;
    };
  
    Drupal.Ajax.prototype.getEffect = function (response) {
      var type = response.effect || this.effect;
      var speed = response.speed || this.speed;
      var effect = {};
  
      if (type === 'none') {
        effect.showEffect = 'show';
        effect.hideEffect = 'hide';
        effect.showSpeed = '';
      } else if (type === 'fade') {
        effect.showEffect = 'fadeIn';
        effect.hideEffect = 'fadeOut';
        effect.showSpeed = speed;
      } else {
        effect.showEffect = "".concat(type, "Toggle");
        effect.hideEffect = "".concat(type, "Toggle");
        effect.showSpeed = speed;
      }
  
      return effect;
    };
  
    Drupal.Ajax.prototype.error = function (xmlhttprequest, uri, customMessage) {
      if (this.progress.element) {
        $(this.progress.element).remove();
      }
  
      if (this.progress.object) {
        this.progress.object.stopMonitoring();
      }
  
      $(this.wrapper).show();
      $(this.element).prop('disabled', false);
  
      if (this.$form && document.body.contains(this.$form.get(0))) {
        var settings = this.settings || drupalSettings;
        Drupal.attachBehaviors(this.$form.get(0), settings);
      }
  
      throw new Drupal.AjaxError(xmlhttprequest, uri, customMessage);
    };
  
    Drupal.theme.ajaxWrapperNewContent = function ($newContent, ajax, response) {
      return (response.effect || ajax.effect) !== 'none' && $newContent.filter(function (i) {
        return !($newContent[i].nodeName === '#comment' || $newContent[i].nodeName === '#text' && /^(\s|\n|\r)*$/.test($newContent[i].textContent));
      }).length > 1 ? Drupal.theme('ajaxWrapperMultipleRootElements', $newContent) : $newContent;
    };
  
    Drupal.theme.ajaxWrapperMultipleRootElements = function ($elements) {
      return $('<div></div>').append($elements);
    };
  
    Drupal.AjaxCommands = function () {};
  
    Drupal.AjaxCommands.prototype = {
      insert: function insert(ajax, response) {
        var $wrapper = response.selector ? $(response.selector) : $(ajax.wrapper);
        var method = response.method || ajax.method;
        var effect = ajax.getEffect(response);
        var settings = response.settings || ajax.settings || drupalSettings;
        var $newContent = $($.parseHTML(response.data, document, true));
        $newContent = Drupal.theme('ajaxWrapperNewContent', $newContent, ajax, response);
  
        switch (method) {
          case 'html':
          case 'replaceWith':
          case 'replaceAll':
          case 'empty':
          case 'remove':
            Drupal.detachBehaviors($wrapper.get(0), settings);
            break;
  
          default:
            break;
        }
  
        $wrapper[method]($newContent);
  
        if (effect.showEffect !== 'show') {
          $newContent.hide();
        }
  
        var $ajaxNewContent = $newContent.find('.ajax-new-content');
  
        if ($ajaxNewContent.length) {
          $ajaxNewContent.hide();
          $newContent.show();
          $ajaxNewContent[effect.showEffect](effect.showSpeed);
        } else if (effect.showEffect !== 'show') {
          $newContent[effect.showEffect](effect.showSpeed);
        }
  
        if ($newContent.parents('html').length) {
          $newContent.each(function (index, element) {
            if (element.nodeType === Node.ELEMENT_NODE) {
              Drupal.attachBehaviors(element, settings);
            }
          });
        }
      },
      remove: function remove(ajax, response, status) {
        var settings = response.settings || ajax.settings || drupalSettings;
        $(response.selector).each(function () {
          Drupal.detachBehaviors(this, settings);
        }).remove();
      },
      changed: function changed(ajax, response, status) {
        var $element = $(response.selector);
  
        if (!$element.hasClass('ajax-changed')) {
          $element.addClass('ajax-changed');
  
          if (response.asterisk) {
            $element.find(response.asterisk).append(" <abbr class=\"ajax-changed\" title=\"".concat(Drupal.t('Changed'), "\">*</abbr> "));
          }
        }
      },
      alert: function alert(ajax, response, status) {
        window.alert(response.text);
      },
      announce: function announce(ajax, response) {
        if (response.priority) {
          Drupal.announce(response.text, response.priority);
        } else {
          Drupal.announce(response.text);
        }
      },
      redirect: function redirect(ajax, response, status) {
        window.location = response.url;
      },
      css: function css(ajax, response, status) {
        $(response.selector).css(response.argument);
      },
      settings: function settings(ajax, response, status) {
        var ajaxSettings = drupalSettings.ajax;
  
        if (ajaxSettings) {
          Drupal.ajax.expired().forEach(function (instance) {
            if (instance.selector) {
              var selector = instance.selector.replace('#', '');
  
              if (selector in ajaxSettings) {
                delete ajaxSettings[selector];
              }
            }
          });
        }
  
        if (response.merge) {
          $.extend(true, drupalSettings, response.settings);
        } else {
          ajax.settings = response.settings;
        }
      },
      data: function data(ajax, response, status) {
        $(response.selector).data(response.name, response.value);
      },
      focusFirst: function focusFirst(ajax, response, status) {
        var focusChanged = false;
        var container = document.querySelector(response.selector);
  
        if (container) {
          var tabbableElements = tabbable(container);
  
          if (tabbableElements.length) {
            tabbableElements[0].focus();
            focusChanged = true;
          } else if (isFocusable(container)) {
            container.focus();
            focusChanged = true;
          }
        }
  
        if (ajax.hasOwnProperty('element') && !focusChanged) {
          ajax.element.focus();
        }
      },
      invoke: function invoke(ajax, response, status) {
        var $element = $(response.selector);
        $element[response.method].apply($element, _toConsumableArray(response.args));
      },
      restripe: function restripe(ajax, response, status) {
        $(response.selector).find('> tbody > tr:visible, > tr:visible').removeClass('odd even').filter(':even').addClass('odd').end().filter(':odd').addClass('even');
      },
      update_build_id: function update_build_id(ajax, response, status) {
        $("input[name=\"form_build_id\"][value=\"".concat(response.old, "\"]")).val(response.new);
      },
      add_css: function add_css(ajax, response, status) {
        $('head').prepend(response.data);
      },
      message: function message(ajax, response) {
        var messages = new Drupal.Message(document.querySelector(response.messageWrapperQuerySelector));
  
        if (response.clearPrevious) {
          messages.clear();
        }
  
        messages.add(response.message, response.messageOptions);
      }
    };
  })(jQuery, window, Drupal, drupalSettings, window.tabbable);;
  /**
   * @file
   * Extends methods from core/misc/ajax.js.
   */
  
  (function ($, window, Drupal, drupalSettings) {
  
    /**
     * Attempts to find the closest glyphicon progress indicator.
     *
     * @param {jQuery|Element} element
     *   A DOM element.
     *
     * @returns {jQuery}
     *   A jQuery object.
     */
    Drupal.Ajax.prototype.findGlyphicon = function (element) {
      return $(element).closest('.form-item').find('.ajax-progress.glyphicon')
    };
  
    /**
     * Starts the spinning of the glyphicon progress indicator.
     *
     * @param {jQuery|Element} element
     *   A DOM element.
     * @param {string} [message]
     *   An optional message to display (tooltip) for the progress.
     *
     * @returns {jQuery}
     *   A jQuery object.
     */
    Drupal.Ajax.prototype.glyphiconStart = function (element, message) {
      var $glyphicon = this.findGlyphicon(element);
      if ($glyphicon[0]) {
        $glyphicon.addClass('glyphicon-spin');
  
        // Add any message as a tooltip to the glyphicon.
        if ($.fn.tooltip && drupalSettings.bootstrap.tooltip_enabled) {
          $glyphicon
            .removeAttr('data-toggle')
            .removeAttr('data-original-title')
            .removeAttr('title')
            .tooltip('destroy')
          ;
  
          if (message) {
            $glyphicon.attr('data-toggle', 'tooltip').attr('title', message).tooltip();
          }
        }
  
        // Append a message for screen readers.
        if (message) {
          $glyphicon.parent().append('<div class="sr-only message">' + message + '</div>');
        }
      }
      return $glyphicon;
    };
  
    /**
     * Stop the spinning of a glyphicon progress indicator.
     *
     * @param {jQuery|Element} element
     *   A DOM element.
     */
    Drupal.Ajax.prototype.glyphiconStop = function (element) {
      var $glyphicon = this.findGlyphicon(element);
      if ($glyphicon[0]) {
        $glyphicon.removeClass('glyphicon-spin');
        if ($.fn.tooltip && drupalSettings.bootstrap.tooltip_enabled) {
          $glyphicon
            .removeAttr('data-toggle')
            .removeAttr('data-original-title')
            .removeAttr('title')
            .tooltip('destroy')
          ;
        }
      }
    };
  
    /**
     * Sets the throbber progress indicator.
     */
    Drupal.Ajax.prototype.setProgressIndicatorThrobber = function () {
      var $element = $(this.element);
  
      // Find an existing glyphicon progress indicator.
      var $glyphicon = this.glyphiconStart($element, this.progress.message);
      if ($glyphicon[0]) {
        this.progress.element = $glyphicon.parent();
        this.progress.glyphicon = true;
        return;
      }
  
      // Otherwise, add a glyphicon throbber after the element.
      if (!this.progress.element) {
        this.progress.element = $(Drupal.theme('ajaxThrobber'));
      }
      if (this.progress.message) {
        this.progress.element.after('<div class="message">' + this.progress.message + '</div>');
      }
  
      // If element is an input DOM element type (not :input), append after.
      if ($element.is('input')) {
        $element.after(this.progress.element);
      }
      // Otherwise append the throbber inside the element.
      else {
        $element.append(this.progress.element);
      }
    };
  
  
    /**
     * Handler for the form redirection completion.
     *
     * @param {Array.<Drupal.AjaxCommands~commandDefinition>} response
     * @param {number} status
     */
    var success = Drupal.Ajax.prototype.success;
    Drupal.Ajax.prototype.success = function (response, status) {
      if (this.progress.element) {
  
        // Stop a glyphicon throbber.
        if (this.progress.glyphicon) {
          this.glyphiconStop(this.progress.element);
        }
        // Remove the progress element.
        else {
          this.progress.element.remove();
        }
  
        // Remove any message set.
        this.progress.element.parent().find('.message').remove();
      }
  
      // Invoke the original success handler.
      return success.apply(this, [response, status]);
    };
  
  })(jQuery, this, Drupal, drupalSettings);
  ;
  /**
  * DO NOT EDIT THIS FILE.
  * See the following change record for more information,
  * https://www.drupal.org/node/2815083
  * @preserve
  **/
  
  Drupal.debounce = function (func, wait, immediate) {
    var timeout;
    var result;
    return function () {
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
  
      var context = this;
  
      var later = function later() {
        timeout = null;
  
        if (!immediate) {
          result = func.apply(context, args);
        }
      };
  
      var callNow = immediate && !timeout;
      clearTimeout(timeout);
      timeout = setTimeout(later, wait);
  
      if (callNow) {
        result = func.apply(context, args);
      }
  
      return result;
    };
  };;
  /**
  * DO NOT EDIT THIS FILE.
  * See the following change record for more information,
  * https://www.drupal.org/node/2815083
  * @preserve
  **/
  
  (function ($, Drupal, debounce) {
    var offsets = {
      top: 0,
      right: 0,
      bottom: 0,
      left: 0
    };
  
    function getRawOffset(el, edge) {
      var $el = $(el);
      var documentElement = document.documentElement;
      var displacement = 0;
      var horizontal = edge === 'left' || edge === 'right';
      var placement = $el.offset()[horizontal ? 'left' : 'top'];
      placement -= window["scroll".concat(horizontal ? 'X' : 'Y')] || document.documentElement["scroll".concat(horizontal ? 'Left' : 'Top')] || 0;
  
      switch (edge) {
        case 'top':
          displacement = placement + $el.outerHeight();
          break;
  
        case 'left':
          displacement = placement + $el.outerWidth();
          break;
  
        case 'bottom':
          displacement = documentElement.clientHeight - placement;
          break;
  
        case 'right':
          displacement = documentElement.clientWidth - placement;
          break;
  
        default:
          displacement = 0;
      }
  
      return displacement;
    }
  
    function calculateOffset(edge) {
      var edgeOffset = 0;
      var displacingElements = document.querySelectorAll("[data-offset-".concat(edge, "]"));
      var n = displacingElements.length;
  
      for (var i = 0; i < n; i++) {
        var el = displacingElements[i];
  
        if (el.style.display === 'none') {
          continue;
        }
  
        var displacement = parseInt(el.getAttribute("data-offset-".concat(edge)), 10);
  
        if (isNaN(displacement)) {
          displacement = getRawOffset(el, edge);
        }
  
        edgeOffset = Math.max(edgeOffset, displacement);
      }
  
      return edgeOffset;
    }
  
    function calculateOffsets() {
      return {
        top: calculateOffset('top'),
        right: calculateOffset('right'),
        bottom: calculateOffset('bottom'),
        left: calculateOffset('left')
      };
    }
  
    function displace(broadcast) {
      offsets = calculateOffsets();
      Drupal.displace.offsets = offsets;
  
      if (typeof broadcast === 'undefined' || broadcast) {
        $(document).trigger('drupalViewportOffsetChange', offsets);
      }
  
      return offsets;
    }
  
    Drupal.behaviors.drupalDisplace = {
      attach: function attach() {
        if (this.displaceProcessed) {
          return;
        }
  
        this.displaceProcessed = true;
        $(window).on('resize.drupalDisplace', debounce(displace, 200));
      }
    };
    Drupal.displace = displace;
    $.extend(Drupal.displace, {
      offsets: offsets,
      calculateOffset: calculateOffset
    });
  })(jQuery, Drupal, Drupal.debounce);;
  /**
  * DO NOT EDIT THIS FILE.
  * See the following change record for more information,
  * https://www.drupal.org/node/2815083
  * @preserve
  **/
  
  (function ($, Drupal, _ref) {
    var isTabbable = _ref.isTabbable;
    $.extend($.expr[':'], {
      tabbable: function tabbable(element) {
        Drupal.deprecationError({
          message: 'The :tabbable selector is deprecated in Drupal 9.2.0 and will be removed in Drupal 10.0.0. Use the core/tabbable library instead. See https://www.drupal.org/node/3183730'
        });
  
        if (element.tagName === 'SUMMARY' || element.tagName === 'DETAILS') {
          var tabIndex = element.getAttribute('tabIndex');
  
          if (tabIndex === null || tabIndex < 0) {
            return false;
          }
        }
  
        return isTabbable(element);
      }
    });
  })(jQuery, Drupal, window.tabbable);;
  /**
  * DO NOT EDIT THIS FILE.
  * See the following change record for more information,
  * https://www.drupal.org/node/2815083
  * @preserve
  **/
  
  (function ($) {
    var cachedScrollbarWidth = null;
    var max = Math.max,
        abs = Math.abs;
    var regexHorizontal = /left|center|right/;
    var regexVertical = /top|center|bottom/;
    var regexOffset = /[+-]\d+(\.[\d]+)?%?/;
    var regexPosition = /^\w+/;
    var regexPercent = /%$/;
    var _position = $.fn.position;
  
    function getOffsets(offsets, width, height) {
      return [parseFloat(offsets[0]) * (regexPercent.test(offsets[0]) ? width / 100 : 1), parseFloat(offsets[1]) * (regexPercent.test(offsets[1]) ? height / 100 : 1)];
    }
  
    function parseCss(element, property) {
      return parseInt($.css(element, property), 10) || 0;
    }
  
    function getDimensions(elem) {
      var raw = elem[0];
  
      if (raw.nodeType === 9) {
        return {
          width: elem.width(),
          height: elem.height(),
          offset: {
            top: 0,
            left: 0
          }
        };
      }
  
      if ($.isWindow(raw)) {
        return {
          width: elem.width(),
          height: elem.height(),
          offset: {
            top: elem.scrollTop(),
            left: elem.scrollLeft()
          }
        };
      }
  
      if (raw.preventDefault) {
        return {
          width: 0,
          height: 0,
          offset: {
            top: raw.pageY,
            left: raw.pageX
          }
        };
      }
  
      return {
        width: elem.outerWidth(),
        height: elem.outerHeight(),
        offset: elem.offset()
      };
    }
  
    var collisions = {
      fit: {
        left: function left(position, data) {
          var within = data.within;
          var withinOffset = within.isWindow ? within.scrollLeft : within.offset.left;
          var outerWidth = within.width;
          var collisionPosLeft = position.left - data.collisionPosition.marginLeft;
          var overLeft = withinOffset - collisionPosLeft;
          var overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset;
          var newOverRight;
  
          if (data.collisionWidth > outerWidth) {
            if (overLeft > 0 && overRight <= 0) {
              newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
              position.left += overLeft - newOverRight;
            } else if (overRight > 0 && overLeft <= 0) {
              position.left = withinOffset;
            } else if (overLeft > overRight) {
              position.left = withinOffset + outerWidth - data.collisionWidth;
            } else {
              position.left = withinOffset;
            }
          } else if (overLeft > 0) {
            position.left += overLeft;
          } else if (overRight > 0) {
            position.left -= overRight;
          } else {
            position.left = max(position.left - collisionPosLeft, position.left);
          }
        },
        top: function top(position, data) {
          var within = data.within;
          var withinOffset = within.isWindow ? within.scrollTop : within.offset.top;
          var outerHeight = data.within.height;
          var collisionPosTop = position.top - data.collisionPosition.marginTop;
          var overTop = withinOffset - collisionPosTop;
          var overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset;
          var newOverBottom;
  
          if (data.collisionHeight > outerHeight) {
            if (overTop > 0 && overBottom <= 0) {
              newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
              position.top += overTop - newOverBottom;
            } else if (overBottom > 0 && overTop <= 0) {
              position.top = withinOffset;
            } else if (overTop > overBottom) {
              position.top = withinOffset + outerHeight - data.collisionHeight;
            } else {
              position.top = withinOffset;
            }
          } else if (overTop > 0) {
            position.top += overTop;
          } else if (overBottom > 0) {
            position.top -= overBottom;
          } else {
            position.top = max(position.top - collisionPosTop, position.top);
          }
        }
      },
      flip: {
        left: function left(position, data) {
          var within = data.within;
          var withinOffset = within.offset.left + within.scrollLeft;
          var outerWidth = within.width;
          var offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left;
          var collisionPosLeft = position.left - data.collisionPosition.marginLeft;
          var overLeft = collisionPosLeft - offsetLeft;
          var overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft;
          var myOffset = data.my[0] === 'left' ? -data.elemWidth : data.my[0] === 'right' ? data.elemWidth : 0;
          var atOffset = data.at[0] === 'left' ? data.targetWidth : data.at[0] === 'right' ? -data.targetWidth : 0;
          var offset = -2 * data.offset[0];
          var newOverRight;
          var newOverLeft;
  
          if (overLeft < 0) {
            newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
  
            if (newOverRight < 0 || newOverRight < abs(overLeft)) {
              position.left += myOffset + atOffset + offset;
            }
          } else if (overRight > 0) {
            newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
  
            if (newOverLeft > 0 || abs(newOverLeft) < overRight) {
              position.left += myOffset + atOffset + offset;
            }
          }
        },
        top: function top(position, data) {
          var within = data.within;
          var withinOffset = within.offset.top + within.scrollTop;
          var outerHeight = within.height;
          var offsetTop = within.isWindow ? within.scrollTop : within.offset.top;
          var collisionPosTop = position.top - data.collisionPosition.marginTop;
          var overTop = collisionPosTop - offsetTop;
          var overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop;
          var top = data.my[1] === 'top';
          var myOffset = top ? -data.elemHeight : data.my[1] === 'bottom' ? data.elemHeight : 0;
          var atOffset = data.at[1] === 'top' ? data.targetHeight : data.at[1] === 'bottom' ? -data.targetHeight : 0;
          var offset = -2 * data.offset[1];
          var newOverTop;
          var newOverBottom;
  
          if (overTop < 0) {
            newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
  
            if (newOverBottom < 0 || newOverBottom < abs(overTop)) {
              position.top += myOffset + atOffset + offset;
            }
          } else if (overBottom > 0) {
            newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
  
            if (newOverTop > 0 || abs(newOverTop) < overBottom) {
              position.top += myOffset + atOffset + offset;
            }
          }
        }
      },
      flipfit: {
        left: function left() {
          for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }
  
          collisions.flip.left.apply(this, args);
          collisions.fit.left.apply(this, args);
        },
        top: function top() {
          for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
            args[_key2] = arguments[_key2];
          }
  
          collisions.flip.top.apply(this, args);
          collisions.fit.top.apply(this, args);
        }
      }
    };
    $.position = {
      scrollbarWidth: function scrollbarWidth() {
        if (cachedScrollbarWidth !== undefined) {
          return cachedScrollbarWidth;
        }
  
        var div = $('<div ' + "style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'>" + "<div style='height:100px;width:auto;'></div></div>");
        var innerDiv = div.children()[0];
        $('body').append(div);
        var w1 = innerDiv.offsetWidth;
        div.css('overflow', 'scroll');
        var w2 = innerDiv.offsetWidth;
  
        if (w1 === w2) {
          w2 = div[0].clientWidth;
        }
  
        div.remove();
        cachedScrollbarWidth = w1 - w2;
        return cachedScrollbarWidth;
      },
      getScrollInfo: function getScrollInfo(within) {
        var overflowX = within.isWindow || within.isDocument ? '' : within.element.css('overflow-x');
        var overflowY = within.isWindow || within.isDocument ? '' : within.element.css('overflow-y');
        var hasOverflowX = overflowX === 'scroll' || overflowX === 'auto' && within.width < within.element[0].scrollWidth;
        var hasOverflowY = overflowY === 'scroll' || overflowY === 'auto' && within.height < within.element[0].scrollHeight;
        return {
          width: hasOverflowY ? $.position.scrollbarWidth() : 0,
          height: hasOverflowX ? $.position.scrollbarWidth() : 0
        };
      },
      getWithinInfo: function getWithinInfo(element) {
        var withinElement = $(element || window);
        var isWindow = $.isWindow(withinElement[0]);
        var isDocument = !!withinElement[0] && withinElement[0].nodeType === 9;
        var hasOffset = !isWindow && !isDocument;
        return {
          element: withinElement,
          isWindow: isWindow,
          isDocument: isDocument,
          offset: hasOffset ? $(element).offset() : {
            left: 0,
            top: 0
          },
          scrollLeft: withinElement.scrollLeft(),
          scrollTop: withinElement.scrollTop(),
          width: withinElement.outerWidth(),
          height: withinElement.outerHeight()
        };
      }
    };
  
    $.fn.position = function (options) {
      if (!options || !options.of) {
        return _position.apply(this, arguments);
      }
  
      options = $.extend({}, options);
      var within = $.position.getWithinInfo(options.within);
      var scrollInfo = $.position.getScrollInfo(within);
      var collision = (options.collision || 'flip').split(' ');
      var offsets = {};
      var target = $(options.of);
      var dimensions = getDimensions(target);
      var targetWidth = dimensions.width;
      var targetHeight = dimensions.height;
      var targetOffset = dimensions.offset;
  
      if (target[0].preventDefault) {
        options.at = 'left top';
      }
  
      var basePosition = $.extend({}, targetOffset);
      $.each(['my', 'at'], function () {
        var pos = (options[this] || '').split(' ');
  
        if (pos.length === 1) {
          pos = regexHorizontal.test(pos[0]) ? pos.concat(['center']) : regexVertical.test(pos[0]) ? ['center'].concat(pos) : ['center', 'center'];
        }
  
        pos[0] = regexHorizontal.test(pos[0]) ? pos[0] : 'center';
        pos[1] = regexVertical.test(pos[1]) ? pos[1] : 'center';
        var horizontalOffset = regexOffset.exec(pos[0]);
        var verticalOffset = regexOffset.exec(pos[1]);
        offsets[this] = [horizontalOffset ? horizontalOffset[0] : 0, verticalOffset ? verticalOffset[0] : 0];
        options[this] = [regexPosition.exec(pos[0])[0], regexPosition.exec(pos[1])[0]];
      });
  
      if (collision.length === 1) {
        collision[1] = collision[0];
      }
  
      if (options.at[0] === 'right') {
        basePosition.left += targetWidth;
      } else if (options.at[0] === 'center') {
        basePosition.left += targetWidth / 2;
      }
  
      if (options.at[1] === 'bottom') {
        basePosition.top += targetHeight;
      } else if (options.at[1] === 'center') {
        basePosition.top += targetHeight / 2;
      }
  
      var atOffset = getOffsets(offsets.at, targetWidth, targetHeight);
      basePosition.left += atOffset[0];
      basePosition.top += atOffset[1];
      return this.each(function () {
        var using;
        var elem = $(this);
        var elemWidth = elem.outerWidth();
        var elemHeight = elem.outerHeight();
        var marginLeft = parseCss(this, 'marginLeft');
        var marginTop = parseCss(this, 'marginTop');
        var collisionWidth = elemWidth + marginLeft + parseCss(this, 'marginRight') + scrollInfo.width;
        var collisionHeight = elemHeight + marginTop + parseCss(this, 'marginBottom') + scrollInfo.height;
        var position = $.extend({}, basePosition);
        var myOffset = getOffsets(offsets.my, elem.outerWidth(), elem.outerHeight());
  
        if (options.my[0] === 'right') {
          position.left -= elemWidth;
        } else if (options.my[0] === 'center') {
          position.left -= elemWidth / 2;
        }
  
        if (options.my[1] === 'bottom') {
          position.top -= elemHeight;
        } else if (options.my[1] === 'center') {
          position.top -= elemHeight / 2;
        }
  
        position.left += myOffset[0];
        position.top += myOffset[1];
        var collisionPosition = {
          marginLeft: marginLeft,
          marginTop: marginTop
        };
        $.each(['left', 'top'], function (i, dir) {
          if (collisions[collision[i]]) {
            collisions[collision[i]][dir](position, {
              targetWidth: targetWidth,
              targetHeight: targetHeight,
              elemWidth: elemWidth,
              elemHeight: elemHeight,
              collisionPosition: collisionPosition,
              collisionWidth: collisionWidth,
              collisionHeight: collisionHeight,
              offset: [atOffset[0] + myOffset[0], atOffset[1] + myOffset[1]],
              my: options.my,
              at: options.at,
              within: within,
              elem: elem
            });
          }
        });
  
        if (options.using) {
          using = function using(props) {
            var left = targetOffset.left - position.left;
            var right = left + targetWidth - elemWidth;
            var top = targetOffset.top - position.top;
            var bottom = top + targetHeight - elemHeight;
            var feedback = {
              target: {
                element: target,
                left: targetOffset.left,
                top: targetOffset.top,
                width: targetWidth,
                height: targetHeight
              },
              element: {
                element: elem,
                left: position.left,
                top: position.top,
                width: elemWidth,
                height: elemHeight
              },
              horizontal: right < 0 ? 'left' : left > 0 ? 'right' : 'center',
              vertical: bottom < 0 ? 'top' : top > 0 ? 'bottom' : 'middle'
            };
  
            if (targetWidth < elemWidth && abs(left + right) < targetWidth) {
              feedback.horizontal = 'center';
            }
  
            if (targetHeight < elemHeight && abs(top + bottom) < targetHeight) {
              feedback.vertical = 'middle';
            }
  
            if (max(abs(left), abs(right)) > max(abs(top), abs(bottom))) {
              feedback.important = 'horizontal';
            } else {
              feedback.important = 'vertical';
            }
  
            options.using.call(this, props, feedback);
          };
        }
  
        elem.offset($.extend(position, {
          using: using
        }));
      });
    };
  
    if (!$.hasOwnProperty('ui')) {
      $.ui = {};
    }
  
    $.ui.position = collisions;
  })(jQuery);;
  /**
   * @file
   * Bootstrap Modals.
   *
   * @param {jQuery} $
   * @param {Drupal} Drupal
   * @param {Drupal.bootstrap} Bootstrap
   * @param {Attributes} Attributes
   */
  (function ($, Drupal, Bootstrap, Attributes) {
    'use strict';
  
    /**
     * Document jQuery object.
     *
     * @type {jQuery}
     */
    var $document = $(document);
  
    /**
     * Finds the first available and visible focusable input element.
     *
     * This is abstracted from the main code below so sub-themes can override
     * this method to return their own element if desired.
     *
     * @param {Modal} modal
     *   The Bootstrap modal instance.
     *
     * @return {jQuery}
     *   A jQuery object containing the element that should be focused. Note: if
     *   this object contains multiple elements, only the first visible one will
     *   be used.
     */
    Bootstrap.modalFindFocusableElement = function (modal) {
      return modal.$dialogBody.find(':input,:button,.btn').not('.visually-hidden,.sr-only');
    };
  
    $document.on('shown.bs.modal', function (e) {
      var $modal = $(e.target);
      var modal = $modal.data('bs.modal');
  
      // Focus the first input element found.
      if (modal && modal.options.focusInput) {
        var $focusable = Bootstrap.modalFindFocusableElement(modal);
        if ($focusable && $focusable[0]) {
          var $input = $focusable.filter(':visible:first').focus();
  
          // Select text if input is text.
          if (modal.options.selectText && $input.is(':text')) {
            $input[0].setSelectionRange(0, $input[0].value.length)
          }
        }
        else if (modal.$close.is(':visible')) {
          modal.$close.focus();
        }
      }
    });
  
    /**
     * Only process this once.
     */
    Bootstrap.once('modal', function (settings) {
  
      /**
       * Replace the Bootstrap Modal jQuery plugin definition.
       *
       * This adds a little bit of functionality so it works better with Drupal.
       */
      Bootstrap.replacePlugin('modal', function () {
        var BootstrapModal = this;
  
        // Override the Modal constructor.
        Bootstrap.Modal = function (element, options) {
          this.$body               = $(document.body);
          this.$element            = $(element);
          this.$dialog             = this.$element.find('.modal-dialog');
          this.$header             = this.$dialog.find('.modal-header');
          this.$title              = this.$dialog.find('.modal-title');
          this.$close              = this.$header.find('.close');
          this.$footer             = this.$dialog.find('.modal-footer');
          this.$content            = this.$dialog.find('.modal-content');
          this.$dialogBody         = this.$dialog.find('.modal-body');
          this.$backdrop           = null;
          this.isShown             = null;
          this.originalBodyPad     = null;
          this.scrollbarWidth      = 0;
          this.ignoreBackdropClick = false;
          this.options             = this.mapDialogOptions(options);
        };
  
        // Extend defaults to take into account for theme settings.
        Bootstrap.Modal.DEFAULTS = $.extend({}, BootstrapModal.DEFAULTS, {
          animation: !!settings.modal_animation,
          backdrop: settings.modal_backdrop === 'static' ? 'static' : !!settings.modal_backdrop,
          focusInput: !!settings.modal_focus_input,
          selectText: !!settings.modal_select_text,
          keyboard: !!settings.modal_keyboard,
          remote: null,
          show: !!settings.modal_show,
          size: settings.modal_size
        });
  
        // Copy over the original prototype methods.
        Bootstrap.Modal.prototype = BootstrapModal.prototype;
  
        /**
         * Handler for $.fn.modal('destroy').
         */
        Bootstrap.Modal.prototype.destroy = function () {
          this.hide();
          Drupal.detachBehaviors(this.$element[0]);
          this.$element.removeData('bs.modal').remove();
        };
  
        /**
         * Initialize the modal.
         */
        Bootstrap.Modal.prototype.init = function () {
          if (this.options.remote) {
            this.$content.load(this.options.remote, $.proxy(function () {
              this.$element.trigger('loaded.bs.modal');
            }, this));
          }
        };
  
        /**
         * Map dialog options.
         *
         * Note: this is primarily for use in modal.jquery.ui.bridge.js.
         *
         * @param {Object} options
         *   The passed options.
         */
        Bootstrap.Modal.prototype.mapDialogOptions = function (options) {
          return options || {};
        }
  
        // Modal jQuery Plugin Definition.
        var Plugin = function () {
          // Extract the arguments.
          var args = Array.prototype.slice.call(arguments);
          var method = args[0];
          var options = args[1] || {};
          var relatedTarget = args[2] || null;
          // Move arguments down if no method was passed.
          if ($.isPlainObject(method)) {
            relatedTarget = options || null;
            options = method;
            method = null;
          }
          var ret = void 0;
          this.each(function () {
            var $this   = $(this);
            var data    = $this.data('bs.modal');
            var initialize = false;
  
            // Immediately return if there's no instance to invoke a valid method.
            var showMethods = ['open', 'show', 'toggle'];
            if (!data && method && showMethods.indexOf(method) === -1) {
              return;
            }
  
            options = Bootstrap.normalizeObject($.extend({}, Bootstrap.Modal.DEFAULTS, data && data.options, $this.data(), options));
            delete options['bs.modal'];
  
            if (!data) {
              $this.data('bs.modal', (data = new Bootstrap.Modal(this, options)));
              initialize = true;
            }
  
            // Initialize the modal.
            if (initialize || (!method && !args.length)) {
              data.init();
            }
  
            // Explicit method passed.
            if (method) {
              if (typeof data[method] === 'function') {
                try {
                  ret = data[method].apply(data, args.slice(1));
                }
                catch (e) {
                  Drupal.throwError(e);
                }
              }
              else {
                Bootstrap.unsupported('method', method);
              }
            }
            // No method, set options and open if necessary.
            else {
              data.option(options);
              if (options.show && !data.isShown) {
                data.show(relatedTarget);
              }
            }
          });
  
          // If just one element and there was a result returned for the option passed,
          // then return the result. Otherwise, just return the jQuery object.
          return this.length === 1 && ret !== void 0 ? ret : this;
        };
  
        // Replace the plugin constructor with the new Modal constructor.
        Plugin.Constructor = Bootstrap.Modal;
  
        // Replace the data API so that it calls $.fn.modal rather than Plugin.
        // This allows sub-themes to replace the jQuery Plugin if they like with
        // out having to redo all this boilerplate.
        $document
          .off('click.bs.modal.data-api')
          .on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
            var $this   = $(this);
            var href    = $this.attr('href');
            var target  = $this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, '')); // strip for ie7
            var $target = $document.find(target);
            var options  = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data());
  
            if ($this.is('a')) e.preventDefault();
  
            $target.one('show.bs.modal', function (showEvent) {
              // Only register focus restorer if modal will actually get shown.
              if (showEvent.isDefaultPrevented()) return;
              $target.one('hidden.bs.modal', function () {
                $this.is(':visible') && $this.trigger('focus');
              });
            });
            $target.modal(options, this);
          });
  
        return Plugin;
      });
  
      /**
       * Extend Drupal theming functions.
       */
      $.extend(Drupal.theme, /** @lend Drupal.theme */ {
        /**
         * Theme function for a Bootstrap Modal.
         *
         * @param {Object} [variables]
         *   An object containing key/value pairs of variables.
         *
         * @return {string}
         *   The HTML for the modal.
         */
        bootstrapModal: function (variables) {
          var output = '';
          var settings = drupalSettings.bootstrap || {};
          var defaults = {
            attributes: {
              class: ['modal'],
              tabindex: -1,
              role: 'dialog'
            },
            body: '',
            closeButton: true,
            description: {
              attributes: {
                class: ['help-block']
              },
              content: null,
              position: 'before'
            },
            footer: '',
            id: 'drupal-modal',
            size: settings.modal_size ? settings.modal_size : '',
            title: {
              attributes: {
                class: ['modal-title']
              },
              content: Drupal.t('Loading...'),
              html: false,
              tag: 'h4'
            }
          };
          variables = $.extend(true, {}, defaults, variables);
  
          var attributes = Attributes.create(defaults.attributes).merge(variables.attributes);
          attributes.set('id', attributes.get('id', variables.id));
  
          if (settings.modal_animation) {
            attributes.addClass('fade');
          }
  
          // Build the modal wrapper.
          output += '<div' + attributes + '>';
  
          // Build the modal-dialog wrapper.
          output += Drupal.theme('bootstrapModalDialog', _.omit(variables, 'attributes'));
  
          // Close the modal wrapper.
          output += '</div>';
  
          // Return the constructed modal.
          return output;
        },
  
        /**
         * Theme function for a Bootstrap Modal dialog markup.
         *
         * @param {Object} [variables]
         *   An object containing key/value pairs of variables.
         *
         * @return {string}
         *   The HTML for the modal close button.
         */
        bootstrapModalDialog: function (variables) {
          var output = '';
  
          var defaults = {
            attributes: {
              class: ['modal-dialog'],
              role: 'document'
            },
            id: 'drupal-modal'
          };
          variables = $.extend(true, {}, defaults, variables);
  
          var attributes = Attributes.create(defaults.attributes).merge(variables.attributes);
          attributes.set('id', attributes.get('id', variables.id + '--dialog'));
  
          if (variables.size) {
            attributes.addClass(variables.size);
          }
          output += '<div' + attributes + '>';
  
          // Build the modal-content wrapper.
          output += Drupal.theme('bootstrapModalContent', _.omit(variables, 'attributes'));
  
          // Close the modal-dialog wrapper.
          output += '</div>';
          return output;
        },
  
        /**
         * Theme function for a Bootstrap Modal content markup.
         *
         * @param {Object} [variables]
         *   An object containing key/value pairs of variables.
         *
         * @return {string}
         *   The HTML for the modal close button.
         */
        bootstrapModalContent: function (variables) {
          var output = '';
  
          var defaults = {
            attributes: {
              class: ['modal-content']
            },
            id: 'drupal-modal'
          };
          variables = $.extend(true, {}, defaults, variables);
  
          var attributes = Attributes.create(defaults.attributes).merge(variables.attributes);
          attributes.set('id', attributes.get('id', variables.id + '--content'));
  
          // Build the modal-content wrapper.
          output += '<div' + attributes + '>';
          variables = _.omit(variables, 'attributes');
  
          // Build the header wrapper and title.
          output += Drupal.theme('bootstrapModalHeader', variables);
  
          // Build the body.
          output += Drupal.theme('bootstrapModalBody', variables);
  
          // Build the footer.
          output += Drupal.theme('bootstrapModalFooter', variables);
  
          // Close the modal-content wrapper.
          output += '</div>';
  
          return output;
        },
  
        /**
         * Theme function for a Bootstrap Modal body markup.
         *
         * @param {Object} [variables]
         *   An object containing key/value pairs of variables.
         *
         * @return {string}
         *   The HTML for the modal close button.
         */
        bootstrapModalBody: function (variables) {
          var output = '';
  
          var defaults = {
            attributes: {
              class: ['modal-body']
            },
            body: '',
            description: {
              attributes: {
                class: ['help-block']
              },
              content: null,
              position: 'before'
            },
            id: 'drupal-modal'
          };
          variables = $.extend(true, {}, defaults, variables);
  
          var attributes = Attributes.create(defaults.attributes).merge(variables.attributes);
          attributes.set('id', attributes.get('id', variables.id + '--body'));
  
          output += '<div' + attributes + '>';
  
          if (typeof variables.description === 'string') {
            variables.description = $.extend({}, defaults.description, { content: variables.description });
          }
  
          var description = variables.description;
          description.attributes = Attributes.create(defaults.description.attributes).merge(description.attributes);
  
          if (description.content && description.position === 'invisible') {
            description.attributes.addClass('sr-only');
          }
  
          if (description.content && description.position === 'before') {
            output += '<p' + description.attributes + '>' + description.content + '</p>';
          }
  
          output += variables.body;
  
          if (description.content && (description.position === 'after' || description.position === 'invisible')) {
            output += '<p' + description.attributes + '>' + description.content + '</p>';
          }
  
          output += '</div>';
  
          return output;
        },
  
        /**
         * Theme function for a Bootstrap Modal close button.
         *
         * @param {Object} [variables]
         *   An object containing key/value pairs of variables.
         *
         * @return {string}
         *   The HTML for the modal close button.
         */
        bootstrapModalClose: function (variables) {
          var defaults = {
            attributes: {
              'aria-label': Drupal.t('Close'),
              class: ['close'],
              'data-dismiss': 'modal',
              type: 'button'
            }
          };
          variables = $.extend(true, {}, defaults, variables);
          var attributes = Attributes.create(defaults.attributes).merge(variables.attributes);
          return '<button' + attributes + '><span aria-hidden="true">&times;</span></button>';
        },
  
        /**
         * Theme function for a Bootstrap Modal footer.
         *
         * @param {Object} [variables]
         *   An object containing key/value pairs of variables.
         * @param {boolean} [force]
         *   Flag to force rendering the footer, regardless if there's content.
         *
         * @return {string}
         *   The HTML for the modal footer.
         */
        bootstrapModalFooter: function (variables, force) {
          var output = '';
          var defaults = {
            attributes: {
              class: ['modal-footer']
            },
            footer: '',
            id: 'drupal-modal'
          };
  
          variables = $.extend(true, {}, defaults, variables);
  
          if (force || variables.footer) {
            var attributes = Attributes.create(defaults.attributes).merge(variables.attributes);
            attributes.set('id', attributes.get('id', variables.id + '--footer'));
            output += '<div' + attributes + '>';
            output += variables.footer;
            output += '</div>';
          }
  
          return output;
        },
  
        /**
         * Theme function for a Bootstrap Modal header.
         *
         * @param {Object} [variables]
         *   An object containing key/value pairs of variables.
         *
         * @return {string}
         *   The HTML for the modal header.
         */
        bootstrapModalHeader: function (variables) {
          var output = '';
  
          var defaults = {
            attributes: {
              class: ['modal-header']
            },
            closeButton: true,
            id: 'drupal-modal',
            title: {
              attributes: {
                class: ['modal-title']
              },
              content: Drupal.t('Loading...'),
              html: false,
              tag: 'h4'
            }
          };
          variables = $.extend(true, {}, defaults, variables);
  
          if (typeof variables.title === 'string') {
            variables.title = $.extend({}, defaults.title, { content: variables.title });
          }
  
          var title = Drupal.theme('bootstrapModalTitle', variables.title);
          if (title) {
            var attributes = Attributes.create(defaults.attributes).merge(variables.attributes);
            attributes.set('id', attributes.get('id', variables.id + '--header'));
  
            output += '<div' + attributes + '>';
  
            if (variables.closeButton) {
              output += Drupal.theme('bootstrapModalClose', _.omit(variables, 'attributes'));
            }
  
            output += title;
  
            output += '</div>';
          }
  
          return output;
        },
  
        /**
         * Theme function for a Bootstrap Modal title.
         *
         * @param {Object} [variables]
         *   An object containing key/value pairs of variables.
         *
         * @return {string}
         *   The HTML for the modal title.
         */
        bootstrapModalTitle: function (variables) {
          var output = '';
  
          var defaults = {
            attributes: {
              class: ['modal-title']
            },
            closeButton: true,
            id: 'drupal-modal',
            content: Drupal.t('Loading...'),
            html: false,
            tag: 'h4'
          };
  
          if (typeof variables === 'string') {
            variables = $.extend({}, defaults, { content: title });
          }
  
          variables = $.extend(true, {}, defaults, variables);
  
          var attributes = Attributes.create(defaults.attributes).merge(variables.attributes);
          attributes.set('id', attributes.get('id', variables.id + '--title'));
  
          output += '<' + Drupal.checkPlain(variables.tag) + Attributes.create(defaults.attributes).merge(variables.attributes) + '>';
  
          if (variables.closeButton) {
            output += Drupal.theme('bootstrapModalClose', _.omit(variables, 'attributes'));
          }
  
          output += (variables.html ? variables.content : Drupal.checkPlain(variables.content));
  
          output += '</' + Drupal.checkPlain(variables.tag) + '>';
  
          return output;
        }
  
      })
  
    });
  
  })(window.jQuery, window.Drupal, window.Drupal.bootstrap, window.Attributes);
  ;
  /**
   * @file
   * dialog.js
   */
  (function ($, Drupal, Bootstrap, Attributes) {
  
    Bootstrap.Dialog = Bootstrap.Dialog || {};
  
    /**
     * A collection of Drupal dialog handlers.
     *
     * @type {Object<String, Drupal.bootstrap.Dialog.Handler>}
     */
    Bootstrap.Dialog.handlers = {};
  
    /**
     * @class Drupal.bootstrap.Dialog.Handler
     *
     * @param type
     * @param data
     */
    Bootstrap.Dialog.Handler = function (type, data) {
      this.ctor = $.fn.modal;
      this.extend = null;
      this.plugin = 'modal';
      this.prefix = 'modal';
      this.themeHooks = {
        modal: 'bootstrapModal',
        dialog: 'bootstrapModalDialog',
        header: 'bootstrapModalHeader',
        title: 'bootstrapModalTitle',
        close: 'bootstrapModalClose',
        content: 'bootstrapModalContent',
        body: 'bootstrapModalBody',
        footer: 'bootstrapModalFooter',
      };
      this.type = type;
      this.selectors = {
        dialog: '.modal-dialog',
        header: '.modal-header',
        title: '.modal-title',
        close: '.close',
        content: '.modal-content',
        body: '.modal-body',
        footer: '.modal-footer',
        buttons: '.modal-buttons'
      };
  
      // Extend the object with subclassed data.
      $.extend(this, data);
  
      // Extend the jQuery plugin.
      if (this.extend) {
        Bootstrap.extend(this.plugin, this.extend);
      }
    };
  
    /**
     * Retrieves a Drupal dialog type handler.
     *
     * @param {String|HTMLElement|jQuery} type
     *   The dialog type to retrieve.
     *
     * @return {Drupal.bootstrap.Dialog.Handler}
     *   A Bootstrap.Dialog.Handler instance.
     */
    Bootstrap.Dialog.Handler.get = function (type) {
      if (type instanceof $) {
        type = type[0];
      }
      if (type instanceof HTMLElement) {
        type = type.dialogType;
      }
      if (!type) {
        type = 'modal';
      }
      if (!Bootstrap.Dialog.handlers[type]) {
        Bootstrap.Dialog.handlers[type] = new Bootstrap.Dialog.Handler();
      }
      return Bootstrap.Dialog.handlers[type];
    };
  
    /**
     * Registers a Drupal dialog type handler.
     *
     * @param {String} type
     *   The dialog type to
     * @param {Object} [data]
     *   Optional. Additional data to use to create the dialog handler. By
     *   default, this assumes values relative to the Bootstrap Modal plugin.
     */
    Bootstrap.Dialog.Handler.register = function (type, data) {
      Bootstrap.Dialog.handlers[type] = new Bootstrap.Dialog.Handler(type, data);
    };
  
    Bootstrap.Dialog.Handler.prototype.invoke = function (context) {
      var args = Array.prototype.slice.call(arguments);
      return this.ctor.apply(context, args.slice(1));
    };
  
    Bootstrap.Dialog.Handler.prototype.theme = function (hook) {
      var args = Array.prototype.slice.call(arguments);
      return $(Drupal.theme.apply(Drupal.theme, [this.themeHooks[hook]].concat(args.slice(1))));
    };
  
    /**
     * Ensures a DOM element has the appropriate structure for a modal.
     *
     * Note: this can get a little tricky. Core potentially already
     * semi-processes a "dialog" if was created using an Ajax command
     * (i.e. prepareDialogButtons in drupal.ajax.js). Because of this, the
     * contents (HTML) of the existing element cannot simply be dumped into a
     * newly created modal. This would destroy any existing event bindings.
     * Instead, the contents must be "moved" (appended) to the new modal and
     * then "moved" again back to the to the existing container as needed.
     *
     * @param {HTMLElement|jQuery} element
     *   The element to ensure is a modal structure.
     * @param {Object} options
     *   THe dialog options to use to construct the modal.
     */
    Bootstrap.Dialog.Handler.prototype.ensureModalStructure = function (element, options) {
      var $element = $(element);
  
      // Immediately return if the modal was already converted into a proper modal.
      if ($element.is('[data-drupal-theme="' + this.themeHooks.modal + '"]')) {
        return;
      }
  
      var attributes = Attributes.create(element).remove('style').set('data-drupal-theme', this.themeHooks.modal);
  
      // Merge in trigger data attributes.
      if (options.$trigger && options.$trigger[0]) {
        /** @var {HTMLElement} trigger */
        var trigger = options.$trigger[0];
        var data = {};
        for (var i = 0, l = trigger.attributes.length; i < l; i++) {
          var name = trigger.attributes[i].name;
          if (name && name.substring(0, 5) === 'data-') {
            data[name] = trigger.getAttribute(name);
          }
        }
        attributes.merge(data);
      }
  
      options = $.extend(true, {}, options, {
        attributes: attributes,
      });
  
      // Create a new modal.
      var $modal = this.theme('modal', options);
  
      // Store a reference to the content inside the existing element container.
      // This references the actual DOM node elements which will allow
      // jQuery to "move" then when appending below. Using $.fn.children()
      // does not return any text nodes present and $.fn.html() only returns
      // a string representation of the content, which effectively destroys
      // any prior event bindings or processing.
      var $body = $element.find(this.selectors.body);
      var $existing = $body[0] ? $body.contents() : $element.contents();
  
      // Set the attributes of the dialog to that of the newly created modal.
      $element.attr(Attributes.create($modal).toPlainObject());
  
      // Append the newly created modal markup.
      $element.append($modal.html());
  
      // Move the existing HTML into the modal markup that was just appended.
      $element.find(this.selectors.body).append($existing);
    };
  
  })(jQuery, Drupal, Drupal.bootstrap, Attributes);
  ;
  /**
   * @file
   * Bootstrap Modals.
   *
   * @param {jQuery} $
   * @param {Drupal} Drupal
   * @param {Drupal.bootstrap} Bootstrap
   * @param {Attributes} Attributes
   * @param {drupalSettings} drupalSettings
   */
  (function ($, Drupal, Bootstrap, Attributes, drupalSettings) {
    'use strict';
  
    /**
     * Only process this once.
     */
    Bootstrap.once('modal.jquery.ui.bridge', function (settings) {
      // RTL support.
      var rtl = document.documentElement.getAttribute('dir').toLowerCase() === 'rtl';
  
      // Override drupal.dialog button classes. This must be done on DOM ready
      // since core/drupal.dialog technically depends on this file and has not
      // yet set their default settings.
      $(function () {
        drupalSettings.dialog.buttonClass = 'btn';
        drupalSettings.dialog.buttonPrimaryClass = 'btn-primary';
      });
  
      // Create the "dialog" plugin bridge.
      Bootstrap.Dialog.Bridge = function (options) {
        var args = Array.prototype.slice.call(arguments);
        var $element = $(this);
        var type = options && options.dialogType || $element[0].dialogType || 'modal';
  
        $element[0].dialogType = type;
  
        var handler = Bootstrap.Dialog.Handler.get(type);
  
        // When only options are passed, jQuery UI dialog treats this like a
        // initialization method. Destroy any existing Bootstrap modal and
        // recreate it using the contents of the dialog HTML.
        if (args.length === 1 && typeof options === 'object') {
          this.each(function () {
            handler.ensureModalStructure(this, options);
          });
  
          // Proxy to the Bootstrap Modal plugin, indicating that this is a
          // jQuery UI dialog bridge.
          return handler.invoke(this, {
            dialogOptions: options,
            jQueryUiBridge: true
          });
        }
  
        // Otherwise, proxy all arguments to the Bootstrap Modal plugin.
        var ret;
        try {
          ret = handler.invoke.apply(handler, [this].concat(args));
        }
        catch (e) {
          Bootstrap.warn(e);
        }
  
        // If just one element and there was a result returned for the option passed,
        // then return the result. Otherwise, just return the jQuery object.
        return this.length === 1 && ret !== void 0 ? ret : this;
      };
  
      // Assign the jQuery "dialog" plugin to use to the bridge.
      Bootstrap.createPlugin('dialog', Bootstrap.Dialog.Bridge);
  
      // Create the "modal" plugin bridge.
      Bootstrap.Modal.Bridge = function () {
        var Modal = this;
  
        return {
          DEFAULTS: {
            // By default, this option is disabled. It's only flagged when a modal
            // was created using $.fn.dialog above.
            jQueryUiBridge: false
          },
          prototype: {
  
            /**
             * Handler for $.fn.dialog('close').
             */
            close: function () {
              var _this = this;
  
              this.hide.apply(this, arguments);
  
              // For some reason (likely due to the transition event not being
              // registered properly), the backdrop doesn't always get removed
              // after the above "hide" method is invoked . Instead, ensure the
              // backdrop is removed after the transition duration by manually
              // invoking the internal "hideModal" method shortly thereafter.
              setTimeout(function () {
                if (!_this.isShown && _this.$backdrop) {
                  _this.hideModal();
                }
              }, (Modal.TRANSITION_DURATION !== void 0 ? Modal.TRANSITION_DURATION : 300) + 10);
            },
  
            /**
             * Creates any necessary buttons from dialog options.
             */
            createButtons: function () {
              var handler = Bootstrap.Dialog.Handler.get(this.$element);
              this.$footer.find(handler.selectors.buttons).remove();
  
              // jQuery UI supports both objects and arrays. Unfortunately
              // developers have misunderstood and abused this by simply placing
              // the objects that should be in an array inside an object with
              // arbitrary keys (likely to target specific buttons as a hack).
              var buttons = this.options.dialogOptions && this.options.dialogOptions.buttons || [];
              if (!Array.isArray(buttons)) {
                var array = [];
                for (var k in buttons) {
                  // Support the proper object values: label => click callback.
                  if (typeof buttons[k] === 'function') {
                    array.push({
                      label: k,
                      click: buttons[k],
                    });
                  }
                  // Support nested objects, but log a warning.
                  else if (buttons[k].text || buttons[k].label) {
                    Bootstrap.warn('Malformed jQuery UI dialog button: @key. The button object should be inside an array.', {
                      '@key': k
                    });
                    array.push(buttons[k]);
                  }
                  else {
                    Bootstrap.unsupported('button', k, buttons[k]);
                  }
                }
                buttons = array;
              }
  
              if (buttons.length) {
                var $buttons = $('<div class="modal-buttons"/>').appendTo(this.$footer);
                for (var i = 0, l = buttons.length; i < l; i++) {
                  var button = buttons[i];
                  var $button = $(Drupal.theme('bootstrapModalDialogButton', button));
  
                  // Invoke the "create" method for jQuery UI buttons.
                  if (typeof button.create === 'function') {
                    button.create.call($button[0]);
                  }
  
                  // Bind the "click" method for jQuery UI buttons to the modal.
                  if (typeof button.click === 'function') {
                    $button.on('click', button.click.bind(this.$element));
                  }
  
                  $buttons.append($button);
                }
              }
  
              // Toggle footer visibility based on whether it has child elements.
              this.$footer[this.$footer.children()[0] ? 'show' : 'hide']();
            },
  
            /**
             * Initializes the Bootstrap Modal.
             */
            init: function () {
              var handler = Bootstrap.Dialog.Handler.get(this.$element);
              if (!this.$dialog) {
                this.$dialog = this.$element.find(handler.selectors.dialog);
              }
              this.$dialog.addClass('js-drupal-dialog');
  
              if (!this.$header) {
                this.$header = this.$dialog.find(handler.selectors.header);
              }
              if (!this.$title) {
                this.$title = this.$dialog.find(handler.selectors.title);
              }
              if (!this.$close) {
                this.$close = this.$header.find(handler.selectors.close);
              }
              if (!this.$footer) {
                this.$footer = this.$dialog.find(handler.selectors.footer);
              }
              if (!this.$content) {
                this.$content = this.$dialog.find(handler.selectors.content);
              }
              if (!this.$dialogBody) {
                this.$dialogBody = this.$dialog.find(handler.selectors.body);
              }
  
              // Relay necessary events.
              if (this.options.jQueryUiBridge) {
                this.$element.on('hide.bs.modal',   Bootstrap.relayEvent(this.$element, 'dialogbeforeclose', false));
                this.$element.on('hidden.bs.modal', Bootstrap.relayEvent(this.$element, 'dialogclose', false));
                this.$element.on('show.bs.modal',   Bootstrap.relayEvent(this.$element, 'dialogcreate', false));
                this.$element.on('shown.bs.modal',  Bootstrap.relayEvent(this.$element, 'dialogopen', false));
              }
  
              // Create a footer if one doesn't exist.
              // This is necessary in case dialog.ajax.js decides to add buttons.
              if (!this.$footer[0]) {
                this.$footer = handler.theme('footer', {}, true).insertAfter(this.$dialogBody);
              }
  
              // Map the initial options.
              $.extend(true, this.options, this.mapDialogOptions(this.options));
  
              // Update buttons.
              this.createButtons();
  
              // Now call the parent init method.
              this.super();
  
              // Handle autoResize option (this is a drupal.dialog option).
              if (this.options.dialogOptions && this.options.dialogOptions.autoResize && this.options.dialogOptions.position) {
                this.position(this.options.dialogOptions.position);
              }
  
              // If show is enabled and currently not shown, show it.
              if (this.options.jQueryUiBridge && this.options.show && !this.isShown) {
                this.show();
              }
            },
  
            /**
             * Handler for $.fn.dialog('instance').
             */
            instance: function () {
              Bootstrap.unsupported('method', 'instance', arguments);
            },
  
            /**
             * Handler for $.fn.dialog('isOpen').
             */
            isOpen: function () {
              return !!this.isShown;
            },
  
            /**
             * Maps dialog options to the modal.
             *
             * @param {Object} options
             *   The options to map.
             */
            mapDialogOptions: function (options) {
              // Retrieve the dialog handler for this type.
              var handler = Bootstrap.Dialog.Handler.get(this.$element);
  
              var mappedOptions = {};
              var dialogOptions = options.dialogOptions || {};
  
              // Remove any existing dialog options.
              delete options.dialogOptions;
  
              // Separate Bootstrap modal options from jQuery UI dialog options.
              for (var k in options) {
                if (Modal.DEFAULTS.hasOwnProperty(k)) {
                  mappedOptions[k] = options[k];
                }
                else {
                  dialogOptions[k] = options[k];
                }
              }
  
  
              // Handle CSS properties.
              var cssUnitRegExp = /^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)?$/;
              var parseCssUnit = function (value, defaultUnit) {
                var parts = ('' + value).match(cssUnitRegExp);
                return parts && parts[1] !== void 0 ? parts[1] + (parts[2] || defaultUnit || 'px') : null;
              };
              var styles = {};
              var cssProperties = ['height', 'maxHeight', 'maxWidth', 'minHeight', 'minWidth', 'width'];
              for (var i = 0, l = cssProperties.length; i < l; i++) {
                var prop = cssProperties[i];
                if (dialogOptions[prop] !== void 0) {
                  var value = parseCssUnit(dialogOptions[prop]);
                  if (value) {
                    styles[prop] = value;
  
                    // If there's a defined height of some kind, enforce the modal
                    // to use flex (on modern browsers). This will ensure that
                    // the core autoResize calculations don't cause the content
                    // to overflow.
                    if (dialogOptions.autoResize && (prop === 'height' || prop === 'maxHeight')) {
                      styles.display = 'flex';
                      styles.flexDirection = 'column';
                      this.$dialogBody.css('overflow', 'scroll');
                    }
                  }
                }
              }
  
              // Apply mapped CSS styles to the modal-content container.
              this.$content.css(styles);
  
              // Handle deprecated "dialogClass" option by merging it with "classes".
              var classesMap = {
                'ui-dialog': 'modal-content',
                'ui-dialog-titlebar': 'modal-header',
                'ui-dialog-title': 'modal-title',
                'ui-dialog-titlebar-close': 'close',
                'ui-dialog-content': 'modal-body',
                'ui-dialog-buttonpane': 'modal-footer'
              };
              if (dialogOptions.dialogClass) {
                if (dialogOptions.classes === void 0) {
                  dialogOptions.classes = {};
                }
                if (dialogOptions.classes['ui-dialog'] === void 0) {
                  dialogOptions.classes['ui-dialog'] = '';
                }
                var dialogClass = dialogOptions.classes['ui-dialog'].split(' ');
                dialogClass.push(dialogOptions.dialogClass);
                dialogOptions.classes['ui-dialog'] = dialogClass.join(' ');
                delete dialogOptions.dialogClass;
              }
  
              // Add jQuery UI classes to elements in case developers target them
              // in callbacks.
              for (k in classesMap) {
                this.$element.find('.' + classesMap[k]).addClass(k);
              }
  
              // Bind events.
              var events = [
                'beforeClose', 'close',
                'create',
                'drag', 'dragStart', 'dragStop',
                'focus',
                'open',
                'resize', 'resizeStart', 'resizeStop'
              ];
              for (i = 0, l = events.length; i < l; i++) {
                var event = events[i].toLowerCase();
                if (dialogOptions[event] === void 0 || typeof dialogOptions[event] !== 'function') continue;
                this.$element.on('dialog' + event, dialogOptions[event]);
              }
  
              // Support title attribute on the modal.
              var title;
              if ((dialogOptions.title === null || dialogOptions.title === void 0) && (title = this.$element.attr('title'))) {
                dialogOptions.title = title;
              }
  
              // Handle the reset of the options.
              for (var name in dialogOptions) {
                if (!dialogOptions.hasOwnProperty(name) || dialogOptions[name] === void 0) continue;
  
                switch (name) {
                  case 'appendTo':
                    Bootstrap.unsupported('option', name, dialogOptions.appendTo);
                    break;
  
                  case 'autoOpen':
                    mappedOptions.show = dialogOptions.show = !!dialogOptions.autoOpen;
                    break;
  
                  case 'classes':
                    if (dialogOptions.classes) {
                      for (var key in dialogOptions.classes) {
                        if (dialogOptions.classes.hasOwnProperty(key) && classesMap[key] !== void 0) {
                          // Run through Attributes to sanitize classes.
                          var attributes = Attributes.create().addClass(dialogOptions.classes[key]).toPlainObject();
                          var selector = '.' + classesMap[key];
                          this.$element.find(selector).addClass(attributes['class']);
                        }
                      }
                    }
                    break;
  
                  case 'closeOnEscape':
                    mappedOptions.keyboard = !!dialogOptions.closeOnEscape;
                    if (!dialogOptions.closeOnEscape && dialogOptions.modal) {
                      mappedOptions.backdrop = 'static';
                    }
                    break;
  
                  case 'closeText':
                    Bootstrap.unsupported('option', name, dialogOptions.closeText);
                    break;
  
                  case 'draggable':
                    this.$content
                      .draggable({
                        handle: handler.selectors.header,
                        drag: Bootstrap.relayEvent(this.$element, 'dialogdrag'),
                        start: Bootstrap.relayEvent(this.$element, 'dialogdragstart'),
                        end: Bootstrap.relayEvent(this.$element, 'dialogdragend')
                      })
                      .draggable(dialogOptions.draggable ? 'enable' : 'disable');
                    break;
  
                  case 'hide':
                    if (dialogOptions.hide === false || dialogOptions.hide === true) {
                      this.$element[dialogOptions.hide ? 'addClass' : 'removeClass']('fade');
                      mappedOptions.animation = dialogOptions.hide;
                    }
                    else {
                      Bootstrap.unsupported('option', name + ' (complex animation)', dialogOptions.hide);
                    }
                    break;
  
                  case 'modal':
                    if (!dialogOptions.closeOnEscape && dialogOptions.modal) {
                      mappedOptions.backdrop = 'static';
                    }
                    else {
                      mappedOptions.backdrop = dialogOptions.modal;
                    }
  
                    // If not a modal and no initial position, center it.
                    if (!dialogOptions.modal && !dialogOptions.position) {
                      this.position({ my: 'center', of: window });
                    }
                    break;
  
                  case 'position':
                    this.position(dialogOptions.position);
                    break;
  
                  // Resizable support (must initialize first).
                  case 'resizable':
                    this.$content
                      .resizable({
                        resize: Bootstrap.relayEvent(this.$element, 'dialogresize'),
                        start: Bootstrap.relayEvent(this.$element, 'dialogresizestart'),
                        end: Bootstrap.relayEvent(this.$element, 'dialogresizeend')
                      })
                      .resizable(dialogOptions.resizable ? 'enable' : 'disable');
                    break;
  
                  case 'show':
                    if (dialogOptions.show === false || dialogOptions.show === true) {
                      this.$element[dialogOptions.show ? 'addClass' : 'removeClass']('fade');
                      mappedOptions.animation = dialogOptions.show;
                    }
                    else {
                      Bootstrap.unsupported('option', name + ' (complex animation)', dialogOptions.show);
                    }
                    break;
  
                  case 'title':
                    this.$title.text(dialogOptions.title);
                    break;
  
                }
              }
  
              // Add the supported dialog options to the mapped options.
              mappedOptions.dialogOptions = dialogOptions;
  
              return mappedOptions;
            },
  
            /**
             * Handler for $.fn.dialog('moveToTop').
             */
            moveToTop: function () {
              Bootstrap.unsupported('method', 'moveToTop', arguments);
            },
  
            /**
             * Handler for $.fn.dialog('option').
             */
            option: function () {
              var clone = {options: {}};
  
              // Apply the parent option method to the clone of current options.
              this.super.apply(clone, arguments);
  
              // Merge in the cloned mapped options.
              $.extend(true, this.options, this.mapDialogOptions(clone.options));
  
              // Update buttons.
              this.createButtons();
            },
  
            position: function(position) {
              // Reset modal styling.
              this.$element.css({
                bottom: 'initial',
                overflow: 'visible',
                right: 'initial'
              });
  
              // Position the modal.
              this.$element.position(position);
            },
  
            /**
             * Handler for $.fn.dialog('open').
             */
            open: function () {
              this.show.apply(this, arguments);
            },
  
            /**
             * Handler for $.fn.dialog('widget').
             */
            widget: function () {
              return this.$element;
            }
          }
        };
      };
  
      // Extend the Bootstrap Modal plugin constructor class.
      Bootstrap.extendPlugin('modal', Bootstrap.Modal.Bridge);
  
      // Register default core dialog type handlers.
      Bootstrap.Dialog.Handler.register('dialog');
      Bootstrap.Dialog.Handler.register('modal');
  
      /**
       * Extend Drupal theming functions.
       */
      $.extend(Drupal.theme, /** @lend Drupal.theme */ {
  
        /**
         * Renders a jQuery UI Dialog compatible button element.
         *
         * @param {Object} button
         *   The button object passed in the dialog options.
         *
         * @return {String}
         *   The modal dialog button markup.
         *
         * @see http://api.jqueryui.com/dialog/#option-buttons
         * @see http://api.jqueryui.com/button/
         */
        bootstrapModalDialogButton: function (button) {
          var attributes = Attributes.create();
  
          var icon = '';
          var iconPosition = button.iconPosition || 'beginning';
          iconPosition = (iconPosition === 'end' && !rtl) || (iconPosition === 'beginning' && rtl) ? 'after' : 'before';
  
          // Handle Bootstrap icons differently.
          if (button.bootstrapIcon) {
            icon = Drupal.theme('icon', 'bootstrap', button.icon);
          }
          // Otherwise, assume it's a jQuery UI icon.
          // @todo Map jQuery UI icons to Bootstrap icons?
          else if (button.icon) {
            var iconAttributes = Attributes.create()
              .addClass(['ui-icon', button.icon])
              .set('aria-hidden', 'true');
            icon = '<span' + iconAttributes + '></span>';
          }
  
          // Label. Note: jQuery UI dialog has an inconsistency where it uses
          // "text" instead of "label", so both need to be supported.
          var value = button.label || button.text;
  
          // Show/hide label.
          if (icon && ((button.showLabel !== void 0 && !button.showLabel) || (button.text !== void 0 && !button.text))) {
            value = '<span' + Attributes.create().addClass('sr-only') + '>' + value + '</span>';
          }
          attributes.set('value', iconPosition === 'before' ? icon + value : value + icon);
  
          // Handle disabled.
          attributes[button.disabled ? 'set' :'remove']('disabled', 'disabled');
  
          if (button.classes) {
            attributes.addClass(Object.keys(button.classes).map(function(key) { return button.classes[key]; }));
          }
          if (button['class']) {
            attributes.addClass(button['class']);
          }
          if (button.primary) {
            attributes.addClass('btn-primary');
          }
  
          return Drupal.theme('button', attributes);
        }
  
      });
  
    });
  
  
  })(window.jQuery, window.Drupal, window.Drupal.bootstrap, window.Attributes, window.drupalSettings);
  ;
  /**
  * DO NOT EDIT THIS FILE.
  * See the following change record for more information,
  * https://www.drupal.org/node/2815083
  * @preserve
  **/
  
  (function ($, Drupal, drupalSettings) {
    drupalSettings.dialog = {
      autoOpen: true,
      dialogClass: '',
      buttonClass: 'button',
      buttonPrimaryClass: 'button--primary',
      close: function close(event) {
        Drupal.dialog(event.target).close();
        Drupal.detachBehaviors(event.target, null, 'unload');
      }
    };
  
    Drupal.dialog = function (element, options) {
      var undef;
      var $element = $(element);
      var dialog = {
        open: false,
        returnValue: undef
      };
  
      function openDialog(settings) {
        settings = $.extend({}, drupalSettings.dialog, options, settings);
        $(window).trigger('dialog:beforecreate', [dialog, $element, settings]);
        $element.dialog(settings);
        dialog.open = true;
        $(window).trigger('dialog:aftercreate', [dialog, $element, settings]);
      }
  
      function closeDialog(value) {
        $(window).trigger('dialog:beforeclose', [dialog, $element]);
        $element.dialog('close');
        dialog.returnValue = value;
        dialog.open = false;
        $(window).trigger('dialog:afterclose', [dialog, $element]);
      }
  
      dialog.show = function () {
        openDialog({
          modal: false
        });
      };
  
      dialog.showModal = function () {
        openDialog({
          modal: true
        });
      };
  
      dialog.close = closeDialog;
      return dialog;
    };
  })(jQuery, Drupal, drupalSettings);;
  /**
  * DO NOT EDIT THIS FILE.
  * See the following change record for more information,
  * https://www.drupal.org/node/2815083
  * @preserve
  **/
  
  (function ($, Drupal, drupalSettings, debounce, displace) {
    drupalSettings.dialog = $.extend({
      autoResize: true,
      maxHeight: '95%'
    }, drupalSettings.dialog);
  
    function resetPosition(options) {
      var offsets = displace.offsets;
      var left = offsets.left - offsets.right;
      var top = offsets.top - offsets.bottom;
      var leftString = "".concat((left > 0 ? '+' : '-') + Math.abs(Math.round(left / 2)), "px");
      var topString = "".concat((top > 0 ? '+' : '-') + Math.abs(Math.round(top / 2)), "px");
      options.position = {
        my: "center".concat(left !== 0 ? leftString : '', " center").concat(top !== 0 ? topString : ''),
        of: window
      };
      return options;
    }
  
    function resetSize(event) {
      var positionOptions = ['width', 'height', 'minWidth', 'minHeight', 'maxHeight', 'maxWidth', 'position'];
      var adjustedOptions = {};
      var windowHeight = $(window).height();
      var option;
      var optionValue;
      var adjustedValue;
  
      for (var n = 0; n < positionOptions.length; n++) {
        option = positionOptions[n];
        optionValue = event.data.settings[option];
  
        if (optionValue) {
          if (typeof optionValue === 'string' && /%$/.test(optionValue) && /height/i.test(option)) {
            windowHeight -= displace.offsets.top + displace.offsets.bottom;
            adjustedValue = parseInt(0.01 * parseInt(optionValue, 10) * windowHeight, 10);
  
            if (option === 'height' && event.data.$element.parent().outerHeight() < adjustedValue) {
              adjustedValue = 'auto';
            }
  
            adjustedOptions[option] = adjustedValue;
          }
        }
      }
  
      if (!event.data.settings.modal) {
        adjustedOptions = resetPosition(adjustedOptions);
      }
  
      event.data.$element.dialog('option', adjustedOptions).trigger('dialogContentResize');
    }
  
    $(window).on({
      'dialog:aftercreate': function dialogAftercreate(event, dialog, $element, settings) {
        var autoResize = debounce(resetSize, 20);
        var eventData = {
          settings: settings,
          $element: $element
        };
  
        if (settings.autoResize === true || settings.autoResize === 'true') {
          $element.dialog('option', {
            resizable: false,
            draggable: false
          }).dialog('widget').css('position', 'fixed');
          $(window).on('resize.dialogResize scroll.dialogResize', eventData, autoResize).trigger('resize.dialogResize');
          $(document).on('drupalViewportOffsetChange.dialogResize', eventData, autoResize);
        }
      },
      'dialog:beforeclose': function dialogBeforeclose(event, dialog, $element) {
        $(window).off('.dialogResize');
        $(document).off('.dialogResize');
      }
    });
  })(jQuery, Drupal, drupalSettings, Drupal.debounce, Drupal.displace);;
  /**
  * DO NOT EDIT THIS FILE.
  * See the following change record for more information,
  * https://www.drupal.org/node/2815083
  * @preserve
  **/
  
  (function ($, Drupal) {
    Drupal.behaviors.dialog = {
      attach: function attach(context, settings) {
        var $context = $(context);
  
        if (!$('#drupal-modal').length) {
          $('<div id="drupal-modal" class="ui-front"></div>').hide().appendTo('body');
        }
  
        var $dialog = $context.closest('.ui-dialog-content');
  
        if ($dialog.length) {
          if ($dialog.dialog('option', 'drupalAutoButtons')) {
            $dialog.trigger('dialogButtonsChange');
          }
  
          $dialog.dialog('widget').trigger('focus');
        }
  
        var originalClose = settings.dialog.close;
  
        settings.dialog.close = function (event) {
          for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
            args[_key - 1] = arguments[_key];
          }
  
          originalClose.apply(settings.dialog, [event].concat(args));
          $(event.target).remove();
        };
      },
      prepareDialogButtons: function prepareDialogButtons($dialog) {
        var buttons = [];
        var $buttons = $dialog.find('.form-actions input[type=submit], .form-actions a.button');
        $buttons.each(function () {
          var $originalButton = $(this).css({
            display: 'none'
          });
          buttons.push({
            text: $originalButton.html() || $originalButton.attr('value'),
            class: $originalButton.attr('class'),
            click: function click(e) {
              if ($originalButton.is('a')) {
                $originalButton[0].click();
              } else {
                $originalButton.trigger('mousedown').trigger('mouseup').trigger('click');
                e.preventDefault();
              }
            }
          });
        });
        return buttons;
      }
    };
  
    Drupal.AjaxCommands.prototype.openDialog = function (ajax, response, status) {
      if (!response.selector) {
        return false;
      }
  
      var $dialog = $(response.selector);
  
      if (!$dialog.length) {
        $dialog = $("<div id=\"".concat(response.selector.replace(/^#/, ''), "\" class=\"ui-front\"></div>")).appendTo('body');
      }
  
      if (!ajax.wrapper) {
        ajax.wrapper = $dialog.attr('id');
      }
  
      response.command = 'insert';
      response.method = 'html';
      ajax.commands.insert(ajax, response, status);
  
      if (!response.dialogOptions.buttons) {
        response.dialogOptions.drupalAutoButtons = true;
        response.dialogOptions.buttons = Drupal.behaviors.dialog.prepareDialogButtons($dialog);
      }
  
      $dialog.on('dialogButtonsChange', function () {
        var buttons = Drupal.behaviors.dialog.prepareDialogButtons($dialog);
        $dialog.dialog('option', 'buttons', buttons);
      });
      response.dialogOptions = response.dialogOptions || {};
      var dialog = Drupal.dialog($dialog.get(0), response.dialogOptions);
  
      if (response.dialogOptions.modal) {
        dialog.showModal();
      } else {
        dialog.show();
      }
  
      $dialog.parent().find('.ui-dialog-buttonset').addClass('form-actions');
    };
  
    Drupal.AjaxCommands.prototype.closeDialog = function (ajax, response, status) {
      var $dialog = $(response.selector);
  
      if ($dialog.length) {
        Drupal.dialog($dialog.get(0)).close();
  
        if (!response.persist) {
          $dialog.remove();
        }
      }
  
      $dialog.off('dialogButtonsChange');
    };
  
    Drupal.AjaxCommands.prototype.setDialogOption = function (ajax, response, status) {
      var $dialog = $(response.selector);
  
      if ($dialog.length) {
        $dialog.dialog('option', response.optionName, response.optionValue);
      }
    };
  
    $(window).on('dialog:aftercreate', function (e, dialog, $element, settings) {
      $element.on('click.dialog', '.dialog-cancel', function (e) {
        dialog.close('cancel');
        e.preventDefault();
        e.stopPropagation();
      });
    });
    $(window).on('dialog:beforeclose', function (e, dialog, $element) {
      $element.off('.dialog');
    });
  })(jQuery, Drupal);;
  /**
   * @file
   * dialog.ajax.js
   */
  (function ($, Drupal, Bootstrap) {
  
    Drupal.behaviors.dialog.ajaxCurrentButton = null;
    Drupal.behaviors.dialog.ajaxOriginalButton = null;
  
    // Intercept the success event to add the dialog type to commands.
    var success = Drupal.Ajax.prototype.success;
    Drupal.Ajax.prototype.success = function (response, status) {
      if (this.dialogType) {
        for (var i = 0, l = response.length; i < l; i++) {
          if (response[i].dialogOptions) {
            response[i].dialogType = response[i].dialogOptions.dialogType = this.dialogType;
            response[i].$trigger = response[i].dialogOptions.$trigger = $(this.element);
          }
        }
      }
      return success.apply(this, [response, status]);
    };
  
    var beforeSerialize = Drupal.Ajax.prototype.beforeSerialize;
    Drupal.Ajax.prototype.beforeSerialize = function (element, options) {
      // Add the dialog type currently in use.
      if (this.dialogType) {
        options.data['ajax_page_state[dialogType]'] = this.dialogType;
  
        // Add the dialog element ID if it can be found (useful for closing it).
        var id = $(this.element).parents('.js-drupal-dialog:first').attr('id');
        if (id) {
          options.data['ajax_page_state[dialogId]'] = id;
        }
      }
      return beforeSerialize.apply(this, arguments);
    };
  
    /**
     * Synchronizes a faux button with its original counterpart.
     *
     * @param {Boolean} [reset = false]
     *   Whether to reset the current and original buttons after synchronizing.
     */
    Drupal.behaviors.dialog.ajaxUpdateButtons = function (reset) {
      if (this.ajaxCurrentButton && this.ajaxOriginalButton) {
        this.ajaxCurrentButton.html(this.ajaxOriginalButton.html());
        this.ajaxCurrentButton.prop('disabled', this.ajaxOriginalButton.prop('disabled'));
      }
      if (reset) {
        this.ajaxCurrentButton = null;
        this.ajaxOriginalButton = null;
      }
    };
  
    $(document)
      .ajaxSend(function () {
        Drupal.behaviors.dialog.ajaxUpdateButtons();
      })
      .ajaxComplete(function () {
        Drupal.behaviors.dialog.ajaxUpdateButtons(true);
      })
    ;
  
    /**
     * {@inheritdoc}
     */
    Drupal.behaviors.dialog.prepareDialogButtons = function prepareDialogButtons($dialog) {
      var _this = this;
      var buttons = [];
      var $buttons = $dialog.find('.form-actions').find('button, input[type=submit], a.button, .btn');
      $buttons.each(function () {
        var $originalButton = $(this)
          // Prevent original button from being tabbed to.
          .attr('tabindex', -1)
          // Visually make the original button invisible, but don't actually hide
          // or remove it from the DOM because the click needs to be proxied from
          // the faux button created in the footer to its original counterpart.
          .css({
            display: 'block',
            width: 0,
            height: 0,
            padding: 0,
            border: 0,
            overflow: 'hidden'
          });
  
        buttons.push({
          // Strip all HTML from the actual text value. This value is escaped.
          // It actual HTML value will be synced with the original button's HTML
          // below in the "create" method.
          text: Bootstrap.stripHtml($originalButton),
          class: $originalButton.attr('class').replace('use-ajax-submit', ''),
          click: function click(e) {
            e.preventDefault();
            e.stopPropagation();
            _this.ajaxCurrentButton = $(e.target);
            _this.ajaxOriginalButton = $originalButton;
            // Some core JS binds dialog buttons to the mousedown or mouseup
            // events instead of click; all three events must be simulated here.
            // @see https://www.drupal.org/project/bootstrap/issues/3016254
            Bootstrap.simulate($originalButton, ['mousedown', 'mouseup', 'click']);
          },
          create: function () {
            _this.ajaxCurrentButton = $(this);
            _this.ajaxOriginalButton = $originalButton;
            _this.ajaxUpdateButtons(true);
          }
        });
      });
  
      return buttons;
    };
  
  })(window.jQuery, window.Drupal, window.Drupal.bootstrap);
  ;
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";function e(){return Qe.apply(null,arguments)}function t(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function n(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e){return void 0===e}function i(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function r(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function a(e,t){var n,s=[];for(n=0;n<e.length;++n)s.push(t(e[n],n));return s}function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function u(e,t){for(var n in t)o(t,n)&&(e[n]=t[n]);return o(t,"toString")&&(e.toString=t.toString),o(t,"valueOf")&&(e.valueOf=t.valueOf),e}function l(e,t,n,s){return ge(e,t,n,s,!0).utc()}function d(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function h(e){if(null==e._isValid){var t=d(e),n=Xe.call(t.parsedDateParts,function(e){return null!=e}),s=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return s;e._isValid=s}return e._isValid}function c(e){var t=l(NaN);return null!=e?u(d(t),e):d(t).userInvalidated=!0,t}function f(e,t){var n,i,r;if(s(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),s(t._i)||(e._i=t._i),s(t._f)||(e._f=t._f),s(t._l)||(e._l=t._l),s(t._strict)||(e._strict=t._strict),s(t._tzm)||(e._tzm=t._tzm),s(t._isUTC)||(e._isUTC=t._isUTC),s(t._offset)||(e._offset=t._offset),s(t._pf)||(e._pf=d(t)),s(t._locale)||(e._locale=t._locale),Ke.length>0)for(n=0;n<Ke.length;n++)s(r=t[i=Ke[n]])||(e[i]=r);return e}function m(t){f(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===et&&(et=!0,e.updateOffset(this),et=!1)}function _(e){return e instanceof m||null!=e&&null!=e._isAMomentObject}function y(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function g(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=y(t)),n}function p(e,t,n){var s,i=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),a=0;for(s=0;s<i;s++)(n&&e[s]!==t[s]||!n&&g(e[s])!==g(t[s]))&&a++;return a+r}function w(t){!1===e.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function v(t,n){var s=!0;return u(function(){if(null!=e.deprecationHandler&&e.deprecationHandler(null,t),s){for(var i,r=[],a=0;a<arguments.length;a++){if(i="","object"==typeof arguments[a]){i+="\n["+a+"] ";for(var o in arguments[0])i+=o+": "+arguments[0][o]+", ";i=i.slice(0,-2)}else i=arguments[a];r.push(i)}w(t+"\nArguments: "+Array.prototype.slice.call(r).join("")+"\n"+(new Error).stack),s=!1}return n.apply(this,arguments)},n)}function M(t,n){null!=e.deprecationHandler&&e.deprecationHandler(t,n),tt[t]||(w(n),tt[t]=!0)}function S(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function D(e,t){var s,i=u({},e);for(s in t)o(t,s)&&(n(e[s])&&n(t[s])?(i[s]={},u(i[s],e[s]),u(i[s],t[s])):null!=t[s]?i[s]=t[s]:delete i[s]);for(s in e)o(e,s)&&!o(t,s)&&n(e[s])&&(i[s]=u({},i[s]));return i}function k(e){null!=e&&this.set(e)}function Y(e,t){var n=e.toLowerCase();st[n]=st[n+"s"]=st[t]=e}function O(e){return"string"==typeof e?st[e]||st[e.toLowerCase()]:void 0}function T(e){var t,n,s={};for(n in e)o(e,n)&&(t=O(n))&&(s[t]=e[n]);return s}function x(e,t){it[e]=t}function b(e,t,n){var s=""+Math.abs(e),i=t-s.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}function P(e,t,n,s){var i=s;"string"==typeof s&&(i=function(){return this[s]()}),e&&(ut[e]=i),t&&(ut[t[0]]=function(){return b(i.apply(this,arguments),t[1],t[2])}),n&&(ut[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function W(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function H(e,t){return e.isValid()?(t=R(t,e.localeData()),ot[t]=ot[t]||function(e){var t,n,s=e.match(rt);for(t=0,n=s.length;t<n;t++)ut[s[t]]?s[t]=ut[s[t]]:s[t]=W(s[t]);return function(t){var i,r="";for(i=0;i<n;i++)r+=S(s[i])?s[i].call(t,e):s[i];return r}}(t),ot[t](e)):e.localeData().invalidDate()}function R(e,t){function n(e){return t.longDateFormat(e)||e}var s=5;for(at.lastIndex=0;s>=0&&at.test(e);)e=e.replace(at,n),at.lastIndex=0,s-=1;return e}function C(e,t,n){Yt[e]=S(t)?t:function(e,s){return e&&n?n:t}}function F(e,t){return o(Yt,e)?Yt[e](t._strict,t._locale):new RegExp(function(e){return U(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i}))}(e))}function U(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function L(e,t){var n,s=t;for("string"==typeof e&&(e=[e]),i(t)&&(s=function(e,n){n[t]=g(e)}),n=0;n<e.length;n++)Ot[e[n]]=s}function N(e,t){L(e,function(e,n,s,i){s._w=s._w||{},t(e,s._w,s,i)})}function G(e,t,n){null!=t&&o(Ot,e)&&Ot[e](t,n._a,n,e)}function V(e){return E(e)?366:365}function E(e){return e%4==0&&e%100!=0||e%400==0}function I(t,n){return function(s){return null!=s?(j(this,t,s),e.updateOffset(this,n),this):A(this,t)}}function A(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function j(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&E(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Z(n,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function Z(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=function(e,t){return(e%t+t)%t}(t,12);return e+=(t-n)/12,1===n?E(e)?29:28:31-n%7%2}function z(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=g(t);else if(t=e.localeData().monthsParse(t),!i(t))return e;return n=Math.min(e.date(),Z(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function $(t){return null!=t?(z(this,t),e.updateOffset(this,!0),this):A(this,"Month")}function q(){function e(e,t){return t.length-e.length}var t,n,s=[],i=[],r=[];for(t=0;t<12;t++)n=l([2e3,t]),s.push(this.monthsShort(n,"")),i.push(this.months(n,"")),r.push(this.months(n,"")),r.push(this.monthsShort(n,""));for(s.sort(e),i.sort(e),r.sort(e),t=0;t<12;t++)s[t]=U(s[t]),i[t]=U(i[t]);for(t=0;t<24;t++)r[t]=U(r[t]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function J(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function B(e,t,n){var s=7+t-n;return-((7+J(e,0,s).getUTCDay()-t)%7)+s-1}function Q(e,t,n,s,i){var r,a,o=1+7*(t-1)+(7+n-s)%7+B(e,s,i);return o<=0?a=V(r=e-1)+o:o>V(e)?(r=e+1,a=o-V(e)):(r=e,a=o),{year:r,dayOfYear:a}}function X(e,t,n){var s,i,r=B(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+K(i=e.year()-1,t,n):a>K(e.year(),t,n)?(s=a-K(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function K(e,t,n){var s=B(e,t,n),i=B(e+1,t,n);return(V(e)-s+i)/7}function ee(){function e(e,t){return t.length-e.length}var t,n,s,i,r,a=[],o=[],u=[],d=[];for(t=0;t<7;t++)n=l([2e3,1]).day(t),s=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),r=this.weekdays(n,""),a.push(s),o.push(i),u.push(r),d.push(s),d.push(i),d.push(r);for(a.sort(e),o.sort(e),u.sort(e),d.sort(e),t=0;t<7;t++)o[t]=U(o[t]),u[t]=U(u[t]),d[t]=U(d[t]);this._weekdaysRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function te(){return this.hours()%12||12}function ne(e,t){P(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function se(e,t){return t._meridiemParse}function ie(e){return e?e.toLowerCase().replace("_","-"):e}function re(e){var t=null;if(!Xt[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=Jt._abbr;require("./locale/"+e),ae(t)}catch(e){}return Xt[e]}function ae(e,t){var n;return e&&(n=s(t)?ue(e):oe(e,t))&&(Jt=n),Jt._abbr}function oe(e,t){if(null!==t){var n=Qt;if(t.abbr=e,null!=Xt[e])M("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=Xt[e]._config;else if(null!=t.parentLocale){if(null==Xt[t.parentLocale])return Kt[t.parentLocale]||(Kt[t.parentLocale]=[]),Kt[t.parentLocale].push({name:e,config:t}),null;n=Xt[t.parentLocale]._config}return Xt[e]=new k(D(n,t)),Kt[e]&&Kt[e].forEach(function(e){oe(e.name,e.config)}),ae(e),Xt[e]}return delete Xt[e],null}function ue(e){var n;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Jt;if(!t(e)){if(n=re(e))return n;e=[e]}return function(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=ie(e[r]).split("-")).length,n=(n=ie(e[r+1]))?n.split("-"):null;t>0;){if(s=re(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&p(i,n,!0)>=t-1)break;t--}r++}return null}(e)}function le(e){var t,n=e._a;return n&&-2===d(e).overflow&&(t=n[xt]<0||n[xt]>11?xt:n[bt]<1||n[bt]>Z(n[Tt],n[xt])?bt:n[Pt]<0||n[Pt]>24||24===n[Pt]&&(0!==n[Wt]||0!==n[Ht]||0!==n[Rt])?Pt:n[Wt]<0||n[Wt]>59?Wt:n[Ht]<0||n[Ht]>59?Ht:n[Rt]<0||n[Rt]>999?Rt:-1,d(e)._overflowDayOfYear&&(t<Tt||t>bt)&&(t=bt),d(e)._overflowWeeks&&-1===t&&(t=Ct),d(e)._overflowWeekday&&-1===t&&(t=Ft),d(e).overflow=t),e}function de(e,t,n){return null!=e?e:null!=t?t:n}function he(t){var n,s,i,r,a,o=[];if(!t._d){for(i=function(t){var n=new Date(e.now());return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}(t),t._w&&null==t._a[bt]&&null==t._a[xt]&&function(e){var t,n,s,i,r,a,o,u;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)r=1,a=4,n=de(t.GG,e._a[Tt],X(pe(),1,4).year),s=de(t.W,1),((i=de(t.E,1))<1||i>7)&&(u=!0);else{r=e._locale._week.dow,a=e._locale._week.doy;var l=X(pe(),r,a);n=de(t.gg,e._a[Tt],l.year),s=de(t.w,l.week),null!=t.d?((i=t.d)<0||i>6)&&(u=!0):null!=t.e?(i=t.e+r,(t.e<0||t.e>6)&&(u=!0)):i=r}s<1||s>K(n,r,a)?d(e)._overflowWeeks=!0:null!=u?d(e)._overflowWeekday=!0:(o=Q(n,s,i,r,a),e._a[Tt]=o.year,e._dayOfYear=o.dayOfYear)}(t),null!=t._dayOfYear&&(a=de(t._a[Tt],i[Tt]),(t._dayOfYear>V(a)||0===t._dayOfYear)&&(d(t)._overflowDayOfYear=!0),s=J(a,0,t._dayOfYear),t._a[xt]=s.getUTCMonth(),t._a[bt]=s.getUTCDate()),n=0;n<3&&null==t._a[n];++n)t._a[n]=o[n]=i[n];for(;n<7;n++)t._a[n]=o[n]=null==t._a[n]?2===n?1:0:t._a[n];24===t._a[Pt]&&0===t._a[Wt]&&0===t._a[Ht]&&0===t._a[Rt]&&(t._nextDay=!0,t._a[Pt]=0),t._d=(t._useUTC?J:function(e,t,n,s,i,r,a){var o=new Date(e,t,n,s,i,r,a);return e<100&&e>=0&&isFinite(o.getFullYear())&&o.setFullYear(e),o}).apply(null,o),r=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Pt]=24),t._w&&void 0!==t._w.d&&t._w.d!==r&&(d(t).weekdayMismatch=!0)}}function ce(e){var t,n,s,i,r,a,o=e._i,u=en.exec(o)||tn.exec(o);if(u){for(d(e).iso=!0,t=0,n=sn.length;t<n;t++)if(sn[t][1].exec(u[1])){i=sn[t][0],s=!1!==sn[t][2];break}if(null==i)return void(e._isValid=!1);if(u[3]){for(t=0,n=rn.length;t<n;t++)if(rn[t][1].exec(u[3])){r=(u[2]||" ")+rn[t][0];break}if(null==r)return void(e._isValid=!1)}if(!s&&null!=r)return void(e._isValid=!1);if(u[4]){if(!nn.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),_e(e)}else e._isValid=!1}function fe(e,t,n,s,i,r){var a=[function(e){var t=parseInt(e,10);{if(t<=49)return 2e3+t;if(t<=999)return 1900+t}return t}(e),Vt.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(i,10)];return r&&a.push(parseInt(r,10)),a}function me(e){var t=on.exec(function(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e._i));if(t){var n=fe(t[4],t[3],t[2],t[5],t[6],t[7]);if(!function(e,t,n){if(e&&jt.indexOf(e)!==new Date(t[0],t[1],t[2]).getDay())return d(n).weekdayMismatch=!0,n._isValid=!1,!1;return!0}(t[1],n,e))return;e._a=n,e._tzm=function(e,t,n){if(e)return un[e];if(t)return 0;var s=parseInt(n,10),i=s%100;return(s-i)/100*60+i}(t[8],t[9],t[10]),e._d=J.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),d(e).rfc2822=!0}else e._isValid=!1}function _e(t){if(t._f!==e.ISO_8601)if(t._f!==e.RFC_2822){t._a=[],d(t).empty=!0;var n,s,i,r,a,o=""+t._i,u=o.length,l=0;for(i=R(t._f,t._locale).match(rt)||[],n=0;n<i.length;n++)r=i[n],(s=(o.match(F(r,t))||[])[0])&&((a=o.substr(0,o.indexOf(s))).length>0&&d(t).unusedInput.push(a),o=o.slice(o.indexOf(s)+s.length),l+=s.length),ut[r]?(s?d(t).empty=!1:d(t).unusedTokens.push(r),G(r,s,t)):t._strict&&!s&&d(t).unusedTokens.push(r);d(t).charsLeftOver=u-l,o.length>0&&d(t).unusedInput.push(o),t._a[Pt]<=12&&!0===d(t).bigHour&&t._a[Pt]>0&&(d(t).bigHour=void 0),d(t).parsedDateParts=t._a.slice(0),d(t).meridiem=t._meridiem,t._a[Pt]=function(e,t,n){var s;if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((s=e.isPM(n))&&t<12&&(t+=12),s||12!==t||(t=0),t):t}(t._locale,t._a[Pt],t._meridiem),he(t),le(t)}else me(t);else ce(t)}function ye(o){var l=o._i,y=o._f;return o._locale=o._locale||ue(o._l),null===l||void 0===y&&""===l?c({nullInput:!0}):("string"==typeof l&&(o._i=l=o._locale.preparse(l)),_(l)?new m(le(l)):(r(l)?o._d=l:t(y)?function(e){var t,n,s,i,r;if(0===e._f.length)return d(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;i<e._f.length;i++)r=0,t=f({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],_e(t),h(t)&&(r+=d(t).charsLeftOver,r+=10*d(t).unusedTokens.length,d(t).score=r,(null==s||r<s)&&(s=r,n=t));u(e,n||t)}(o):y?_e(o):function(o){var u=o._i;s(u)?o._d=new Date(e.now()):r(u)?o._d=new Date(u.valueOf()):"string"==typeof u?function(t){var n=an.exec(t._i);null===n?(ce(t),!1===t._isValid&&(delete t._isValid,me(t),!1===t._isValid&&(delete t._isValid,e.createFromInputFallback(t)))):t._d=new Date(+n[1])}(o):t(u)?(o._a=a(u.slice(0),function(e){return parseInt(e,10)}),he(o)):n(u)?function(e){if(!e._d){var t=T(e._i);e._a=a([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),he(e)}}(o):i(u)?o._d=new Date(u):e.createFromInputFallback(o)}(o),h(o)||(o._d=null),o))}function ge(e,s,i,r,a){var o={};return!0!==i&&!1!==i||(r=i,i=void 0),(n(e)&&function(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}(e)||t(e)&&0===e.length)&&(e=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=a,o._l=i,o._i=e,o._f=s,o._strict=r,function(e){var t=new m(le(ye(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}(o)}function pe(e,t,n,s){return ge(e,t,n,s,!1)}function we(e,n){var s,i;if(1===n.length&&t(n[0])&&(n=n[0]),!n.length)return pe();for(s=n[0],i=1;i<n.length;++i)n[i].isValid()&&!n[i][e](s)||(s=n[i]);return s}function ve(e){var t=T(e),n=t.year||0,s=t.quarter||0,i=t.month||0,r=t.week||0,a=t.day||0,o=t.hour||0,u=t.minute||0,l=t.second||0,d=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===Ut.call(hn,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var n=!1,s=0;s<hn.length;++s)if(e[hn[s]]){if(n)return!1;parseFloat(e[hn[s]])!==g(e[hn[s]])&&(n=!0)}return!0}(t),this._milliseconds=+d+1e3*l+6e4*u+1e3*o*60*60,this._days=+a+7*r,this._months=+i+3*s+12*n,this._data={},this._locale=ue(),this._bubble()}function Me(e){return e instanceof ve}function Se(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function De(e,t){P(e,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+b(~~(e/60),2)+t+b(~~e%60,2)})}function ke(e,t){var n=(t||"").match(e);if(null===n)return null;var s=((n[n.length-1]||[])+"").match(cn)||["-",0,0],i=60*s[1]+g(s[2]);return 0===i?0:"+"===s[0]?i:-i}function Ye(t,n){var s,i;return n._isUTC?(s=n.clone(),i=(_(t)||r(t)?t.valueOf():pe(t).valueOf())-s.valueOf(),s._d.setTime(s._d.valueOf()+i),e.updateOffset(s,!1),s):pe(t).local()}function Oe(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Te(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function xe(e,t){var n,s,r,a=e,u=null;return Me(e)?a={ms:e._milliseconds,d:e._days,M:e._months}:i(e)?(a={},t?a[t]=e:a.milliseconds=e):(u=fn.exec(e))?(n="-"===u[1]?-1:1,a={y:0,d:g(u[bt])*n,h:g(u[Pt])*n,m:g(u[Wt])*n,s:g(u[Ht])*n,ms:g(Se(1e3*u[Rt]))*n}):(u=mn.exec(e))?(n="-"===u[1]?-1:(u[1],1),a={y:be(u[2],n),M:be(u[3],n),w:be(u[4],n),d:be(u[5],n),h:be(u[6],n),m:be(u[7],n),s:be(u[8],n)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(r=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Ye(t,e),e.isBefore(t)?n=Pe(e,t):((n=Pe(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(pe(a.from),pe(a.to)),(a={}).ms=r.milliseconds,a.M=r.months),s=new ve(a),Me(e)&&o(e,"_locale")&&(s._locale=e._locale),s}function be(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Pe(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function We(e,t){return function(n,s){var i,r;return null===s||isNaN(+s)||(M(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=n,n=s,s=r),n="string"==typeof n?+n:n,i=xe(n,s),He(this,i,e),this}}function He(t,n,s,i){var r=n._milliseconds,a=Se(n._days),o=Se(n._months);t.isValid()&&(i=null==i||i,o&&z(t,A(t,"Month")+o*s),a&&j(t,"Date",A(t,"Date")+a*s),r&&t._d.setTime(t._d.valueOf()+r*s),i&&e.updateOffset(t,a||o))}function Re(e,t){var n,s=12*(t.year()-e.year())+(t.month()-e.month()),i=e.clone().add(s,"months");return n=t-i<0?(t-i)/(i-e.clone().add(s-1,"months")):(t-i)/(e.clone().add(s+1,"months")-i),-(s+n)||0}function Ce(e){var t;return void 0===e?this._locale._abbr:(null!=(t=ue(e))&&(this._locale=t),this)}function Fe(){return this._locale}function Ue(e,t){P(0,[e,e.length],0,t)}function Le(e,t,n,s,i){var r;return null==e?X(this,s,i).year:(r=K(e,s,i),t>r&&(t=r),function(e,t,n,s,i){var r=Q(e,t,n,s,i),a=J(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}.call(this,e,t,n,s,i))}function Ne(e,t){t[Rt]=g(1e3*("0."+e))}function Ge(e){return e}function Ve(e,t,n,s){var i=ue(),r=l().set(s,t);return i[n](r,e)}function Ee(e,t,n){if(i(e)&&(t=e,e=void 0),e=e||"",null!=t)return Ve(e,t,n,"month");var s,r=[];for(s=0;s<12;s++)r[s]=Ve(e,s,n,"month");return r}function Ie(e,t,n,s){"boolean"==typeof e?(i(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,i(t)&&(n=t,t=void 0),t=t||"");var r=ue(),a=e?r._week.dow:0;if(null!=n)return Ve(t,(n+a)%7,s,"day");var o,u=[];for(o=0;o<7;o++)u[o]=Ve(t,(o+a)%7,s,"day");return u}function Ae(e,t,n,s){var i=xe(t,n);return e._milliseconds+=s*i._milliseconds,e._days+=s*i._days,e._months+=s*i._months,e._bubble()}function je(e){return e<0?Math.floor(e):Math.ceil(e)}function Ze(e){return 4800*e/146097}function ze(e){return 146097*e/4800}function $e(e){return function(){return this.as(e)}}function qe(e){return function(){return this.isValid()?this._data[e]:NaN}}function Je(e){return(e>0)-(e<0)||+e}function Be(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=An(this._milliseconds)/1e3,s=An(this._days),i=An(this._months);t=y((e=y(n/60))/60),n%=60,e%=60;var r=y(i/12),a=i%=12,o=s,u=t,l=e,d=n?n.toFixed(3).replace(/\.?0+$/,""):"",h=this.asSeconds();if(!h)return"P0D";var c=h<0?"-":"",f=Je(this._months)!==Je(h)?"-":"",m=Je(this._days)!==Je(h)?"-":"",_=Je(this._milliseconds)!==Je(h)?"-":"";return c+"P"+(r?f+r+"Y":"")+(a?f+a+"M":"")+(o?m+o+"D":"")+(u||l||d?"T":"")+(u?_+u+"H":"")+(l?_+l+"M":"")+(d?_+d+"S":"")}var Qe,Xe;Xe=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1};var Ke=e.momentProperties=[],et=!1,tt={};e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;var nt;nt=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)o(e,t)&&n.push(t);return n};var st={},it={},rt=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,at=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ot={},ut={},lt=/\d/,dt=/\d\d/,ht=/\d{3}/,ct=/\d{4}/,ft=/[+-]?\d{6}/,mt=/\d\d?/,_t=/\d\d\d\d?/,yt=/\d\d\d\d\d\d?/,gt=/\d{1,3}/,pt=/\d{1,4}/,wt=/[+-]?\d{1,6}/,vt=/\d+/,Mt=/[+-]?\d+/,St=/Z|[+-]\d\d:?\d\d/gi,Dt=/Z|[+-]\d\d(?::?\d\d)?/gi,kt=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Yt={},Ot={},Tt=0,xt=1,bt=2,Pt=3,Wt=4,Ht=5,Rt=6,Ct=7,Ft=8;P("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),P(0,["YY",2],0,function(){return this.year()%100}),P(0,["YYYY",4],0,"year"),P(0,["YYYYY",5],0,"year"),P(0,["YYYYYY",6,!0],0,"year"),Y("year","y"),x("year",1),C("Y",Mt),C("YY",mt,dt),C("YYYY",pt,ct),C("YYYYY",wt,ft),C("YYYYYY",wt,ft),L(["YYYYY","YYYYYY"],Tt),L("YYYY",function(t,n){n[Tt]=2===t.length?e.parseTwoDigitYear(t):g(t)}),L("YY",function(t,n){n[Tt]=e.parseTwoDigitYear(t)}),L("Y",function(e,t){t[Tt]=parseInt(e,10)}),e.parseTwoDigitYear=function(e){return g(e)+(g(e)>68?1900:2e3)};var Ut,Lt=I("FullYear",!0);Ut=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},P("M",["MM",2],"Mo",function(){return this.month()+1}),P("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),P("MMMM",0,0,function(e){return this.localeData().months(this,e)}),Y("month","M"),x("month",8),C("M",mt),C("MM",mt,dt),C("MMM",function(e,t){return t.monthsShortRegex(e)}),C("MMMM",function(e,t){return t.monthsRegex(e)}),L(["M","MM"],function(e,t){t[xt]=g(e)-1}),L(["MMM","MMMM"],function(e,t,n,s){var i=n._locale.monthsParse(e,s,n._strict);null!=i?t[xt]=i:d(n).invalidMonth=e});var Nt=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Gt="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Vt="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Et=kt,It=kt;P("w",["ww",2],"wo","week"),P("W",["WW",2],"Wo","isoWeek"),Y("week","w"),Y("isoWeek","W"),x("week",5),x("isoWeek",5),C("w",mt),C("ww",mt,dt),C("W",mt),C("WW",mt,dt),N(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=g(e)});P("d",0,"do","day"),P("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),P("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),P("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),P("e",0,0,"weekday"),P("E",0,0,"isoWeekday"),Y("day","d"),Y("weekday","e"),Y("isoWeekday","E"),x("day",11),x("weekday",11),x("isoWeekday",11),C("d",mt),C("e",mt),C("E",mt),C("dd",function(e,t){return t.weekdaysMinRegex(e)}),C("ddd",function(e,t){return t.weekdaysShortRegex(e)}),C("dddd",function(e,t){return t.weekdaysRegex(e)}),N(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:d(n).invalidWeekday=e}),N(["d","e","E"],function(e,t,n,s){t[s]=g(e)});var At="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),jt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Zt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),zt=kt,$t=kt,qt=kt;P("H",["HH",2],0,"hour"),P("h",["hh",2],0,te),P("k",["kk",2],0,function(){return this.hours()||24}),P("hmm",0,0,function(){return""+te.apply(this)+b(this.minutes(),2)}),P("hmmss",0,0,function(){return""+te.apply(this)+b(this.minutes(),2)+b(this.seconds(),2)}),P("Hmm",0,0,function(){return""+this.hours()+b(this.minutes(),2)}),P("Hmmss",0,0,function(){return""+this.hours()+b(this.minutes(),2)+b(this.seconds(),2)}),ne("a",!0),ne("A",!1),Y("hour","h"),x("hour",13),C("a",se),C("A",se),C("H",mt),C("h",mt),C("k",mt),C("HH",mt,dt),C("hh",mt,dt),C("kk",mt,dt),C("hmm",_t),C("hmmss",yt),C("Hmm",_t),C("Hmmss",yt),L(["H","HH"],Pt),L(["k","kk"],function(e,t,n){var s=g(e);t[Pt]=24===s?0:s}),L(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),L(["h","hh"],function(e,t,n){t[Pt]=g(e),d(n).bigHour=!0}),L("hmm",function(e,t,n){var s=e.length-2;t[Pt]=g(e.substr(0,s)),t[Wt]=g(e.substr(s)),d(n).bigHour=!0}),L("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[Pt]=g(e.substr(0,s)),t[Wt]=g(e.substr(s,2)),t[Ht]=g(e.substr(i)),d(n).bigHour=!0}),L("Hmm",function(e,t,n){var s=e.length-2;t[Pt]=g(e.substr(0,s)),t[Wt]=g(e.substr(s))}),L("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[Pt]=g(e.substr(0,s)),t[Wt]=g(e.substr(s,2)),t[Ht]=g(e.substr(i))});var Jt,Bt=I("Hours",!0),Qt={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Gt,monthsShort:Vt,week:{dow:0,doy:6},weekdays:At,weekdaysMin:Zt,weekdaysShort:jt,meridiemParse:/[ap]\.?m?\.?/i},Xt={},Kt={},en=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,tn=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,nn=/Z|[+-]\d\d(?::?\d\d)?/,sn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],rn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],an=/^\/?Date\((\-?\d+)/i,on=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,un={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};e.createFromInputFallback=v("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),e.ISO_8601=function(){},e.RFC_2822=function(){};var ln=v("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=pe.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:c()}),dn=v("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=pe.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:c()}),hn=["year","quarter","month","week","day","hour","minute","second","millisecond"];De("Z",":"),De("ZZ",""),C("Z",Dt),C("ZZ",Dt),L(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=ke(Dt,e)});var cn=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var fn=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,mn=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;xe.fn=ve.prototype,xe.invalid=function(){return xe(NaN)};var _n=We(1,"add"),yn=We(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var gn=v("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});P(0,["gg",2],0,function(){return this.weekYear()%100}),P(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ue("gggg","weekYear"),Ue("ggggg","weekYear"),Ue("GGGG","isoWeekYear"),Ue("GGGGG","isoWeekYear"),Y("weekYear","gg"),Y("isoWeekYear","GG"),x("weekYear",1),x("isoWeekYear",1),C("G",Mt),C("g",Mt),C("GG",mt,dt),C("gg",mt,dt),C("GGGG",pt,ct),C("gggg",pt,ct),C("GGGGG",wt,ft),C("ggggg",wt,ft),N(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=g(e)}),N(["gg","GG"],function(t,n,s,i){n[i]=e.parseTwoDigitYear(t)}),P("Q",0,"Qo","quarter"),Y("quarter","Q"),x("quarter",7),C("Q",lt),L("Q",function(e,t){t[xt]=3*(g(e)-1)}),P("D",["DD",2],"Do","date"),Y("date","D"),x("date",9),C("D",mt),C("DD",mt,dt),C("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),L(["D","DD"],bt),L("Do",function(e,t){t[bt]=g(e.match(mt)[0])});var pn=I("Date",!0);P("DDD",["DDDD",3],"DDDo","dayOfYear"),Y("dayOfYear","DDD"),x("dayOfYear",4),C("DDD",gt),C("DDDD",ht),L(["DDD","DDDD"],function(e,t,n){n._dayOfYear=g(e)}),P("m",["mm",2],0,"minute"),Y("minute","m"),x("minute",14),C("m",mt),C("mm",mt,dt),L(["m","mm"],Wt);var wn=I("Minutes",!1);P("s",["ss",2],0,"second"),Y("second","s"),x("second",15),C("s",mt),C("ss",mt,dt),L(["s","ss"],Ht);var vn=I("Seconds",!1);P("S",0,0,function(){return~~(this.millisecond()/100)}),P(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),P(0,["SSS",3],0,"millisecond"),P(0,["SSSS",4],0,function(){return 10*this.millisecond()}),P(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),P(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),P(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),P(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),P(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),Y("millisecond","ms"),x("millisecond",16),C("S",gt,lt),C("SS",gt,dt),C("SSS",gt,ht);var Mn;for(Mn="SSSS";Mn.length<=9;Mn+="S")C(Mn,vt);for(Mn="S";Mn.length<=9;Mn+="S")L(Mn,Ne);var Sn=I("Milliseconds",!1);P("z",0,0,"zoneAbbr"),P("zz",0,0,"zoneName");var Dn=m.prototype;Dn.add=_n,Dn.calendar=function(t,n){var s=t||pe(),i=Ye(s,this).startOf("day"),r=e.calendarFormat(this,i)||"sameElse",a=n&&(S(n[r])?n[r].call(this,s):n[r]);return this.format(a||this.localeData().calendar(r,this,pe(s)))},Dn.clone=function(){return new m(this)},Dn.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Ye(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=O(t)){case"year":r=Re(this,s)/12;break;case"month":r=Re(this,s);break;case"quarter":r=Re(this,s)/3;break;case"second":r=(this-s)/1e3;break;case"minute":r=(this-s)/6e4;break;case"hour":r=(this-s)/36e5;break;case"day":r=(this-s-i)/864e5;break;case"week":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:y(r)},Dn.endOf=function(e){return void 0===(e=O(e))||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))},Dn.format=function(t){t||(t=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var n=H(this,t);return this.localeData().postformat(n)},Dn.from=function(e,t){return this.isValid()&&(_(e)&&e.isValid()||pe(e).isValid())?xe({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Dn.fromNow=function(e){return this.from(pe(),e)},Dn.to=function(e,t){return this.isValid()&&(_(e)&&e.isValid()||pe(e).isValid())?xe({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Dn.toNow=function(e){return this.to(pe(),e)},Dn.get=function(e){return e=O(e),S(this[e])?this[e]():this},Dn.invalidAt=function(){return d(this).overflow},Dn.isAfter=function(e,t){var n=_(e)?e:pe(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=O(s(t)?"millisecond":t))?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},Dn.isBefore=function(e,t){var n=_(e)?e:pe(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=O(s(t)?"millisecond":t))?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},Dn.isBetween=function(e,t,n,s){return("("===(s=s||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===s[1]?this.isBefore(t,n):!this.isAfter(t,n))},Dn.isSame=function(e,t){var n,s=_(e)?e:pe(e);return!(!this.isValid()||!s.isValid())&&("millisecond"===(t=O(t||"millisecond"))?this.valueOf()===s.valueOf():(n=s.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},Dn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},Dn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},Dn.isValid=function(){return h(this)},Dn.lang=gn,Dn.locale=Ce,Dn.localeData=Fe,Dn.max=dn,Dn.min=ln,Dn.parsingFlags=function(){return u({},d(this))},Dn.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t=[];for(var n in e)t.push({unit:n,priority:it[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}(e=T(e)),s=0;s<n.length;s++)this[n[s].unit](e[n[s].unit]);else if(e=O(e),S(this[e]))return this[e](t);return this},Dn.startOf=function(e){switch(e=O(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this},Dn.subtract=yn,Dn.toArray=function(){return[this.year(),this.month(),this.date(),this.hour(),this.minute(),this.second(),this.millisecond()]},Dn.toObject=function(){return{years:this.year(),months:this.month(),date:this.date(),hours:this.hours(),minutes:this.minutes(),seconds:this.seconds(),milliseconds:this.milliseconds()}},Dn.toDate=function(){return new Date(this.valueOf())},Dn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?H(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):S(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this._d.valueOf()).toISOString().replace("Z",H(n,"Z")):H(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},Dn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var n="["+e+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i=t+'[")]';return this.format(n+s+"-MM-DD[T]HH:mm:ss.SSS"+i)},Dn.toJSON=function(){return this.isValid()?this.toISOString():null},Dn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Dn.unix=function(){return Math.floor(this.valueOf()/1e3)},Dn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},Dn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Dn.year=Lt,Dn.isLeapYear=function(){return E(this.year())},Dn.weekYear=function(e){return Le.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},Dn.isoWeekYear=function(e){return Le.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},Dn.quarter=Dn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},Dn.month=$,Dn.daysInMonth=function(){return Z(this.year(),this.month())},Dn.week=Dn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},Dn.isoWeek=Dn.isoWeeks=function(e){var t=X(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},Dn.weeksInYear=function(){var e=this.localeData()._week;return K(this.year(),e.dow,e.doy)},Dn.isoWeeksInYear=function(){return K(this.year(),1,4)},Dn.date=pn,Dn.day=Dn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=function(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},Dn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},Dn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},Dn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},Dn.hour=Dn.hours=Bt,Dn.minute=Dn.minutes=wn,Dn.second=Dn.seconds=vn,Dn.millisecond=Dn.milliseconds=Sn,Dn.utcOffset=function(t,n,s){var i,r=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=ke(Dt,t)))return this}else Math.abs(t)<16&&!s&&(t*=60);return!this._isUTC&&n&&(i=Oe(this)),this._offset=t,this._isUTC=!0,null!=i&&this.add(i,"m"),r!==t&&(!n||this._changeInProgress?He(this,xe(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?r:Oe(this)},Dn.utc=function(e){return this.utcOffset(0,e)},Dn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Oe(this),"m")),this},Dn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=ke(St,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},Dn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?pe(e).utcOffset():0,(this.utcOffset()-e)%60==0)},Dn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Dn.isLocal=function(){return!!this.isValid()&&!this._isUTC},Dn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},Dn.isUtc=Te,Dn.isUTC=Te,Dn.zoneAbbr=function(){return this._isUTC?"UTC":""},Dn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Dn.dates=v("dates accessor is deprecated. Use date instead.",pn),Dn.months=v("months accessor is deprecated. Use month instead",$),Dn.years=v("years accessor is deprecated. Use year instead",Lt),Dn.zone=v("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),Dn.isDSTShifted=v("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var e={};if(f(e,this),(e=ye(e))._a){var t=e._isUTC?l(e._a):pe(e._a);this._isDSTShifted=this.isValid()&&p(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted});var kn=k.prototype;kn.calendar=function(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return S(s)?s.call(t,n):s},kn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])},kn.invalidDate=function(){return this._invalidDate},kn.ordinal=function(e){return this._ordinal.replace("%d",e)},kn.preparse=Ge,kn.postformat=Ge,kn.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return S(i)?i(e,t,n,s):i.replace(/%d/i,e)},kn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return S(n)?n(t):n.replace(/%s/i,t)},kn.set=function(e){var t,n;for(n in e)S(t=e[n])?this[n]=t:this["_"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},kn.months=function(e,n){return e?t(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Nt).test(n)?"format":"standalone"][e.month()]:t(this._months)?this._months:this._months.standalone},kn.monthsShort=function(e,n){return e?t(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Nt.test(n)?"format":"standalone"][e.month()]:t(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},kn.monthsParse=function(e,t,n){var s,i,r;if(this._monthsParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=l([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=Ut.call(this._shortMonthsParse,a))?i:null:-1!==(i=Ut.call(this._longMonthsParse,a))?i:null:"MMM"===t?-1!==(i=Ut.call(this._shortMonthsParse,a))?i:-1!==(i=Ut.call(this._longMonthsParse,a))?i:null:-1!==(i=Ut.call(this._longMonthsParse,a))?i:-1!==(i=Ut.call(this._shortMonthsParse,a))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=l([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},kn.monthsRegex=function(e){return this._monthsParseExact?(o(this,"_monthsRegex")||q.call(this),e?this._monthsStrictRegex:this._monthsRegex):(o(this,"_monthsRegex")||(this._monthsRegex=It),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},kn.monthsShortRegex=function(e){return this._monthsParseExact?(o(this,"_monthsRegex")||q.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(o(this,"_monthsShortRegex")||(this._monthsShortRegex=Et),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},kn.week=function(e){return X(e,this._week.dow,this._week.doy).week},kn.firstDayOfYear=function(){return this._week.doy},kn.firstDayOfWeek=function(){return this._week.dow},kn.weekdays=function(e,n){return e?t(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(n)?"format":"standalone"][e.day()]:t(this._weekdays)?this._weekdays:this._weekdays.standalone},kn.weekdaysMin=function(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin},kn.weekdaysShort=function(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort},kn.weekdaysParse=function(e,t,n){var s,i,r;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=l([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=Ut.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ut.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=Ut.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=Ut.call(this._weekdaysParse,a))?i:-1!==(i=Ut.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ut.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ut.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ut.call(this._weekdaysParse,a))?i:-1!==(i=Ut.call(this._minWeekdaysParse,a))?i:null:-1!==(i=Ut.call(this._minWeekdaysParse,a))?i:-1!==(i=Ut.call(this._weekdaysParse,a))?i:-1!==(i=Ut.call(this._shortWeekdaysParse,a))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=l([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".",".?")+"$","i")),this._weekdaysParse[s]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},kn.weekdaysRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||ee.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(o(this,"_weekdaysRegex")||(this._weekdaysRegex=zt),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},kn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||ee.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(o(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=$t),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},kn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||ee.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(o(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=qt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},kn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},kn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},ae("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===g(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),e.lang=v("moment.lang is deprecated. Use moment.locale instead.",ae),e.langData=v("moment.langData is deprecated. Use moment.localeData instead.",ue);var Yn=Math.abs,On=$e("ms"),Tn=$e("s"),xn=$e("m"),bn=$e("h"),Pn=$e("d"),Wn=$e("w"),Hn=$e("M"),Rn=$e("y"),Cn=qe("milliseconds"),Fn=qe("seconds"),Un=qe("minutes"),Ln=qe("hours"),Nn=qe("days"),Gn=qe("months"),Vn=qe("years"),En=Math.round,In={ss:44,s:45,m:45,h:22,d:26,M:11},An=Math.abs,jn=ve.prototype;return jn.isValid=function(){return this._isValid},jn.abs=function(){var e=this._data;return this._milliseconds=Yn(this._milliseconds),this._days=Yn(this._days),this._months=Yn(this._months),e.milliseconds=Yn(e.milliseconds),e.seconds=Yn(e.seconds),e.minutes=Yn(e.minutes),e.hours=Yn(e.hours),e.months=Yn(e.months),e.years=Yn(e.years),this},jn.add=function(e,t){return Ae(this,e,t,1)},jn.subtract=function(e,t){return Ae(this,e,t,-1)},jn.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if("month"===(e=O(e))||"year"===e)return t=this._days+s/864e5,n=this._months+Ze(t),"month"===e?n:n/12;switch(t=this._days+Math.round(ze(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},jn.asMilliseconds=On,jn.asSeconds=Tn,jn.asMinutes=xn,jn.asHours=bn,jn.asDays=Pn,jn.asWeeks=Wn,jn.asMonths=Hn,jn.asYears=Rn,jn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*g(this._months/12):NaN},jn._bubble=function(){var e,t,n,s,i,r=this._milliseconds,a=this._days,o=this._months,u=this._data;return r>=0&&a>=0&&o>=0||r<=0&&a<=0&&o<=0||(r+=864e5*je(ze(o)+a),a=0,o=0),u.milliseconds=r%1e3,e=y(r/1e3),u.seconds=e%60,t=y(e/60),u.minutes=t%60,n=y(t/60),u.hours=n%24,a+=y(n/24),i=y(Ze(a)),o+=i,a-=je(ze(i)),s=y(o/12),o%=12,u.days=a,u.months=o,u.years=s,this},jn.clone=function(){return xe(this)},jn.get=function(e){return e=O(e),this.isValid()?this[e+"s"]():NaN},jn.milliseconds=Cn,jn.seconds=Fn,jn.minutes=Un,jn.hours=Ln,jn.days=Nn,jn.weeks=function(){return y(this.days()/7)},jn.months=Gn,jn.years=Vn,jn.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),n=function(e,t,n){var s=xe(e).abs(),i=En(s.as("s")),r=En(s.as("m")),a=En(s.as("h")),o=En(s.as("d")),u=En(s.as("M")),l=En(s.as("y")),d=i<=In.ss&&["s",i]||i<In.s&&["ss",i]||r<=1&&["m"]||r<In.m&&["mm",r]||a<=1&&["h"]||a<In.h&&["hh",a]||o<=1&&["d"]||o<In.d&&["dd",o]||u<=1&&["M"]||u<In.M&&["MM",u]||l<=1&&["y"]||["yy",l];return d[2]=t,d[3]=+e>0,d[4]=n,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,d)}(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)},jn.toISOString=Be,jn.toString=Be,jn.toJSON=Be,jn.locale=Ce,jn.localeData=Fe,jn.toIsoString=v("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Be),jn.lang=gn,P("X",0,0,"unix"),P("x",0,0,"valueOf"),C("x",Mt),C("X",/[+-]?\d+(\.\d{1,3})?/),L("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),L("x",function(e,t,n){n._d=new Date(g(e))}),e.version="2.20.1",function(e){Qe=e}(pe),e.fn=Dn,e.min=function(){return we("isBefore",[].slice.call(arguments,0))},e.max=function(){return we("isAfter",[].slice.call(arguments,0))},e.now=function(){return Date.now?Date.now():+new Date},e.utc=l,e.unix=function(e){return pe(1e3*e)},e.months=function(e,t){return Ee(e,t,"months")},e.isDate=r,e.locale=ae,e.invalid=c,e.duration=xe,e.isMoment=_,e.weekdays=function(e,t,n){return Ie(e,t,n,"weekdays")},e.parseZone=function(){return pe.apply(null,arguments).parseZone()},e.localeData=ue,e.isDuration=Me,e.monthsShort=function(e,t){return Ee(e,t,"monthsShort")},e.weekdaysMin=function(e,t,n){return Ie(e,t,n,"weekdaysMin")},e.defineLocale=oe,e.updateLocale=function(e,t){if(null!=t){var n,s,i=Qt;null!=(s=re(e))&&(i=s._config),(n=new k(t=D(i,t))).parentLocale=Xt[e],Xt[e]=n,ae(e)}else null!=Xt[e]&&(null!=Xt[e].parentLocale?Xt[e]=Xt[e].parentLocale:null!=Xt[e]&&delete Xt[e]);return Xt[e]},e.locales=function(){return nt(Xt)},e.weekdaysShort=function(e,t,n){return Ie(e,t,n,"weekdaysShort")},e.normalizeUnits=O,e.relativeTimeRounding=function(e){return void 0===e?En:"function"==typeof e&&(En=e,!0)},e.relativeTimeThreshold=function(e,t){return void 0!==In[e]&&(void 0===t?In[e]:(In[e]=t,"s"===e&&(In.ss=t-1),!0))},e.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},e.prototype=Dn,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"YYYY-[W]WW",MONTH:"YYYY-MM"},e});;
  